Conversation
Quote model ids and environment commands as YAML scalars so hostile input cannot inject keys, comments, or block scalars into kickstart artifacts.
adrian-lorenzo
left a comment
There was a problem hiding this comment.
Thanks for adapting this to the current workspace templates.
CLI substitution still interprets values such as $& and {{CODEX_PLAN_MODEL}}, corrupting generated models. The doctor change also accepts invalid model values. Please use the core renderer’s single-pass callback approach, preserve model validation, and add regression tests for both.
String replaceAll treated $& as the match and re-expanded nested placeholders. Doctor now parses the model as a YAML string so comments and unclosed quotes fail while quoted names with spaces still pass.
|
@adrian-lorenzo, Doctor parses model as a YAML string (1–160 chars). Comment-only lines and unclosed quotes fail; quoted names with spaces still pass. Added regressions for both in the CLI, and the $& / nested placeholder case in core. |
Addresses #228.
Facility 0.12 no longer generates GitHub workflows or Claude settings, so the original doctor-watch, settings.json, and protect-branch regex vectors are gone. Model ids were still interpolated unquoted into agent YAML frontmatter, so values like a newline plus
enabled: false,|,#, or$(id)could change structure or truncate the scalar.This quotes every generated YAML scalar (models and environment commands) in both
facility initand kickstart rendering, and adds hostile-input regressions through the CLI, core renderer, and agent parser.Test plan
pnpm test --filter @theagilemonkeys/facilitypnpm test --filter @facility/corepnpm test --filter @facility/agents$(id),foo"bar # pwned, newline +enabled: false,|) stay quoted scalars and parse as the original model stringgpt-5.6-sol, datedclaude-opus-4-8-20260101) still work after quotingsetup/start/readycommands with quotes and$(id)remain data, not shell