Adversarial fuzz worker

template-probe

Session sc-compose-fuzz-20261007-5 · Worker template-probe

FAIL

Fuzz run descriptionIterationsPassResult
template run5 rerun at a0ce54da (fake bd stub); binary pass/fail counts not supplied 568 not supplied/568 FAIL

Inputs exercised

CaseTemplate / inputOutcome
run5/family/A-roundtrip23 hostile string values plus 7 non-string values through TOML and JSON escaping, checked through bd's parse of the rendered formula in the create --graph plan (exact round trip; runtime {{ }} kept literally; no --var); {"scenarios": 60, "flagged": 0}flagged 0
run5/family/B-structureseeded loops (1-40 steps with random needs), conditionals, includes (escape, absolute, cycle, self, missing, symlink out), frontmatter, comment/raw blocks, CRLF/BOM/invalid UTF-8, formula grammar refusals; attach re-run must be a no-op (FR-23.5); {"scenarios": 80, "flagged": 4}flagged 4
run5/family/C-pathstemplate and rendered_formula confinement, symlink final component and parent, plan-file symlink or directory, bd_executable missing/dir/non-executable/relative/shell metacharacters, Unicode, dash-leading and newline file names; files outside the root are checked for changes; {"scenarios": 78, "flagged": 0}flagged 0
run5/family/D-idsparent, ref and relation identifiers, scope mismatch, authorization, request shape; JSON and human output; {"scenarios": 144, "flagged": 0}flagged 0
run5/family/E-bd-responseshostile cook/show/dep list/create --graph replies (non-JSON, ANSI/bidi, wrong/duplicate ids, missing ids, exit codes, 17 MB stdout, path echo); JSON and human output; {"scenarios": 106, "flagged": 0}flagged 0
run5/family/F-pourregistry vs graph pour mode, ambiguity, name mismatch, relations/bead_variables per mode, authorization, where/mol pour failures, 70 KB validate stdout; JSON and human output; {"scenarios": 100, "flagged": 0}flagged 0

Findings

TMPL5-01

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
{ "template f.formula.toml.j2": "formula = \"f\"\ntype = \"workflow\"\n[[steps]]\nid = \"a\"\ntitle = \"t\"\n", "request": { "schema": "sc-compose/beads/v1", "operation": "preview_attach", "working_directory": "$WS", "template": "f.formula.toml.j2", "rendered_formula": "build/f.formula.toml", "compose_variables": {}, "bead_variables": {}, "bd_executable": "$CAMPAIGN/fakebin/bd", "parent": "pa-1", "ref": "r1" }, "fake bd": "`bd cook <path> --json` prints the parsed formula plus \"source\": <path> (the shape of bd v1.3.1 captures in crates/sc-composer-beads/tests/fixtures/beads/graph/*.cooked.json); variant: cook exits 1 and echoes <path> on stdout" }
Expected
FUZZ-055 / d487f845 presentation rule: no receipt field presents the private .sc-compose-input-* snapshot path; argv and stderr_excerpt of the same stage already show the public rendered_formula path, and the registry validate route presents stdout too
Observed
(at f9f32454; does not reproduce at e44ef65b or a0ce54da) JSON receipt, stage `validate` (attach routes) or `preview_pour`/`pour` (graph-mode pour, second cook), field stdout_excerpt contains <ws>/build/.sc-compose-input-<pid>-<ns>-0.formula.toml (a deleted file). argv and stderr_excerpt in the same stage are presented correctly. Happens on success (cook stdout with source) and on cook failure (stdout echo). Registry validate does not leak. Human output does not print stdout_excerpt, so it is clean. graph.rs execute() rewrites argv and stderr_excerpt but not stdout_excerpt, and Runtime::invoke() passes no presentation source for cook.
Requirement / ADR
FUZZ-055 / d487f845 presentation rule: no receipt field presents the private .sc-compose-input-* snapshot path; argv and stderr_excerpt of the same stage already show the public rendered_formula path, and the registry validate route presents stdout too
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
(at f9f32454; does not reproduce at e44ef65b or a0ce54da) JSON receipt, stage `validate` (attach routes) or `preview_pour`/`pour` (graph-mode pour, second cook), field stdout_excerpt contains <ws>/build/.sc-compose-input-<pid>-<ns>-0.formula.toml (a deleted file). argv and stderr_excerpt in the same stage are presented correctly. Happens on success (cook stdout with source) and on cook failure (stdout echo). Registry validate does not leak. Human output does not print stdout_excerpt, so it is clean. graph.rs execute() rewrites argv and stderr_excerpt but not stdout_excerpt, and Runtime::invoke() passes no presentation source for cook.
Recommended fix
No further fix indicated at a0ce54da: the run5 rerun records fixed_at_tested_head (confirmed_bug at f9f32454); team-lead to confirm closure. Not fixed by this report.

TMPL5-02

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
{ "template f.formula.toml.j2": "---\nrequired_variables: [title]\n---\nformula = \"f\"\ntype = \"workflow\"\n[[steps]]\nid = \"a\"\ntitle = \"{{{ title }}}\"\n", "request": { "operation": "attach", "compose_variables": {}, "pour_authorization": "CreatePersistentBeads", "parent": "pa-1", "ref": "r1", "...": "as TMPL5-01" } }
Expected
FR-2b (docs/requirements.md): missing frontmatter-declared required variables must fail rendering; `sc-compose render --file` does fail with ERR_VAL_MISSING_REQUIRED for the same frontmatter. Frontmatter `defaults` should bind the variable.
Observed
Exit 0, outcome succeeded; the frontmatter block is stripped (malformed YAML frontmatter does fail with BEADS_RENDER_FAILED, so it is parsed), but required_variables is not enforced and defaults are not applied: the rendered formula has title = "", and attach sends a create --graph plan with an empty title. Without frontmatter an undefined {{{ title }}} also renders silently as an empty string.
Requirement / ADR
FR-2b (docs/requirements.md): missing frontmatter-declared required variables must fail rendering; `sc-compose render --file` does fail with ERR_VAL_MISSING_REQUIRED for the same frontmatter. Frontmatter `defaults` should bind the variable.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
Exit 0, outcome succeeded; the frontmatter block is stripped (malformed YAML frontmatter does fail with BEADS_RENDER_FAILED, so it is parsed), but required_variables is not enforced and defaults are not applied: the rendered formula has title = "", and attach sends a create --graph plan with an empty title. Without frontmatter an undefined {{{ title }}} also renders silently as an empty string.
Recommended fix
Team-lead pending triage; confirmed_bug at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-03

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
{ "layout": "$WS/f.formula.toml.j2 (any valid formula), $WS/.beads/formulas/ (the active registry), $WS-outside/ (sibling directory)", "request": { "operation": "preview_pour", "formula_name": "x", "rendered_formula": "$WS-outside/x.formula.toml", "...": "as TMPL5-01 without parent/ref" } }
Expected
ADR-0023 Authorization and confinement: rendered_formula is confined to working_directory, and a rendered formula outside working_directory that is not in the active registry is refused. preview-pour writes nothing persistent. A refused request should not write outside the root.
Observed
rc 2, outcome failed BEADS_OUTPUT_OUTSIDE_WORKING_DIR (baseline gives BEADS_FORMULA_OUTSIDE_ACTIVE_REGISTRY), but $WS-outside/x.formula.toml has already been written (atomic replace, so an existing file there is overwritten) and `bd cook` has run on it. validate_request skips the confinement check for PreviewPour/Pour because the registry may be outside the root, and the refusal comes only after `bd where`.
Requirement / ADR
ADR-0023 Authorization and confinement: rendered_formula is confined to working_directory, and a rendered formula outside working_directory that is not in the active registry is refused. preview-pour writes nothing persistent. A refused request should not write outside the root.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
rc 2, outcome failed BEADS_OUTPUT_OUTSIDE_WORKING_DIR (baseline gives BEADS_FORMULA_OUTSIDE_ACTIVE_REGISTRY), but $WS-outside/x.formula.toml has already been written (atomic replace, so an existing file there is overwritten) and `bd cook` has run on it. validate_request skips the confinement check for PreviewPour/Pour because the registry may be outside the root, and the refusal comes only after `bd where`.
Recommended fix
Team-lead pending triage; confirmed_bug at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-O1

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
"Non-string compose values in a quoted slot render differently by escape mode: null -> '' in TOML templates and 'null' in JSON templates; arrays render as [\"a\", \"b\"] (TOML) and [\"a\",\"b\"] (JSON). No documented oracle, so not reported as a bug."
Expected
No decisive documented oracle supplied; retain original observation classification.
Observed
Non-string compose values in a quoted slot render differently by escape mode: null -> '' in TOML templates and 'null' in JSON templates; arrays render as ["a", "b"] (TOML) and ["a","b"] (JSON). No documented oracle, so not reported as a bug.
Requirement / ADR
Undecided requirement/documentation boundary; team lead must triage.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
Non-string compose values in a quoted slot render differently by escape mode: null -> '' in TOML templates and 'null' in JSON templates; arrays render as ["a", "b"] (TOML) and ["a","b"] (JSON). No documented oracle, so not reported as a bug.
Recommended fix
Team-lead pending triage; inconclusive at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-O2

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
"Unknown top-level request fields (for example a typo such as `relation` for `relations`) are accepted and ignored on every route. Undocumented either way, and a typo silently drops the intended edges."
Expected
No decisive documented oracle supplied; retain original observation classification.
Observed
Unknown top-level request fields (for example a typo such as `relation` for `relations`) are accepted and ignored on every route. Undocumented either way, and a typo silently drops the intended edges.
Requirement / ADR
Undecided requirement/documentation boundary; team lead must triage.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
Unknown top-level request fields (for example a typo such as `relation` for `relations`) are accepted and ignored on every route. Undocumented either way, and a typo silently drops the intended edges.
Recommended fix
Team-lead pending triage; inconclusive at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-B1

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
"A template path containing a control character (\\n, \\t) fails BEADS_RENDER_FAILED with the canonical-source rule 'no control characters'. A newline in rendered_formula alone is accepted."
Expected
No decisive documented oracle supplied; retain original observation classification.
Observed
A template path containing a control character (\n, \t) fails BEADS_RENDER_FAILED with the canonical-source rule 'no control characters'. A newline in rendered_formula alone is accepted.
Requirement / ADR
Undecided requirement/documentation boundary; team lead must triage.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
A template path containing a control character (\n, \t) fails BEADS_RENDER_FAILED with the canonical-source rule 'no control characters'. A newline in rendered_formula alone is accepted.
Recommended fix
Team-lead pending triage; intentional_boundary at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-B2

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
"compose_variables nested more than about 128 levels deep give BEADS_REQUEST_DESERIALIZATION_FAILED, exit 3 (serde_json recursion limit)."
Expected
No decisive documented oracle supplied; retain original observation classification.
Observed
compose_variables nested more than about 128 levels deep give BEADS_REQUEST_DESERIALIZATION_FAILED, exit 3 (serde_json recursion limit).
Requirement / ADR
Undecided requirement/documentation boundary; team lead must triage.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
compose_variables nested more than about 128 levels deep give BEADS_REQUEST_DESERIALIZATION_FAILED, exit 3 (serde_json recursion limit).
Recommended fix
Team-lead pending triage; intentional_boundary at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-B3

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
"When template == rendered_formula, the template is overwritten in place. Plain `sc-compose render --output <same file>` does the same, so this is consistent."
Expected
No decisive documented oracle supplied; retain original observation classification.
Observed
When template == rendered_formula, the template is overwritten in place. Plain `sc-compose render --output <same file>` does the same, so this is consistent.
Requirement / ADR
Undecided requirement/documentation boundary; team lead must triage.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
When template == rendered_formula, the template is overwritten in place. Plain `sc-compose render --output <same file>` does the same, so this is consistent.
Recommended fix
Team-lead pending triage; intentional_boundary at a0ce54da (run5 rerun), not fixed by this report.

TMPL5-N1

Minimal template / frontmatter
See literal minimal_input in source envelope.
Input
"Cosmetic: render-stage stderr_excerpt includes the trailing text 'backtrace:\\ndisabled backtrace'."
Expected
No decisive documented oracle supplied; retain original observation classification.
Observed
Cosmetic: render-stage stderr_excerpt includes the trailing text 'backtrace:\ndisabled backtrace'.
Requirement / ADR
Undecided requirement/documentation boundary; team lead must triage.
Requirement / ADR follow-up
Team-lead pending triage; no new requirement or fix is asserted by report integration.
Root cause
Cosmetic: render-stage stderr_excerpt includes the trailing text 'backtrace:\ndisabled backtrace'.
Recommended fix
Team-lead pending triage; inconclusive at a0ce54da (run5 rerun), not fixed by this report.