test(#3149): correct stale tdd_mode assertion and drop a marker-token collision

Two failures from the remote runner on 654b2cc10, both introduced here.

1. tests/mcp-catalog-parity.install.test.cjs greps emitted workflow files
   for the bare substring 'gsd:section' and treats its presence in a
   composed file as an un-stripped marker. debug.md's new Step 0 prose
   documented the field by writing that token literally, so the emitted
   file tripped the gate even though the parser correctly ignored it as
   prose. Reworded to 'applicability-section markers'. Same class as
   DEFECT.PROMPT-INJECTION-SCAN-COLLISION.

2. tests/debug-session-management.test.cjs asserted debug.md contains the
   literal 'config-get workflow.tdd_mode'. That call is gone. The
   invariant it protected -- tdd_mode comes from the workflow.tdd_mode
   key, never a bare top-level one -- is unchanged, and now has a
   stronger behavioral home: init-debug.test.cjs row A9 asserts a bare
   key is ignored and the canonical key is honored, whatever the read
   mechanism.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
sim
2026-08-07 10:09:18 -04:00
parent 654b2cc10c
commit 8a0c1bce2e
4 changed files with 32 additions and 4 deletions

View File

@@ -76,13 +76,21 @@ describe('debug session management implementation', () => {
path.join(process.cwd(), 'gsd-core/workflows/debug.md'),
'utf8'
);
// #3149: tdd_mode now arrives on the `init.debug` bundle rather than a
// `config-get` call in this workflow, so the old literal-call assertion no
// longer describes reality. The invariant it protected is unchanged and is
// asserted at its new home: `cmdInitDebug` resolves `config.workflow`'s
// `tdd_mode`, never a bare top-level key — proven behaviorally in
// tests/init-debug.test.cjs ('honors workflow.tdd_mode, ignores a bare
// top-level tdd_mode'). What must remain true HERE is only that this
// workflow never reintroduces a bare-key read of its own.
assert.ok(
!content.includes('config-get tdd_mode'),
'debug.md must not use bare "tdd_mode" key — use "workflow.tdd_mode" to match every other consumer'
);
assert.ok(
content.includes('config-get workflow.tdd_mode'),
'debug.md must read tdd_mode via the "workflow.tdd_mode" key'
content.includes('tdd_mode'),
'debug.md must still consume tdd_mode (now from the init.debug bundle)'
);
});