test(#1973): consolidate 48 workflow regression tests into workflow-aspect suites
Fold 48 issue-named workflow-markdown regression files into the canonical test that owns each workflow aspect (execute-phase-*, plan-phase-*, quick-*, discuss-*, worktree-cleanup, secure-phase, verify, update, settings, etc.), across 32 existing suites. Verbatim block-scoped describe wrappers; 281 subtests conserved 1:1. No new test files. Host-env pre-check: only gsd-settings-advanced spawns CLI and it sets no GSD_WORKSTREAM/GSD_PROJECT value — no leak risk. Regenerates regression-name allowlist (222->181), ratchets file-count allowlist (verify 11->10), makes 30 relocated allow-test-rule exemptions issue-ref-compliant (ADR-456; prunes 30 stale ids). lint:ci green. Part of epic #1969. Closes #1973. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -8007,3 +8007,79 @@ describe('issue #1159 (Defect B): deferred/future requirement IDs must not trigg
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────
|
||||
// Folded from tests/bug-2502-insert-phase-state-update.test.cjs — consolidation epic #1969 (B4 #1973)
|
||||
// ────────────────────────────────────────────────────────────────────────
|
||||
{
|
||||
const { describe: __foldDescribe } = require('node:test');
|
||||
__foldDescribe("folded:bug-2502-insert-phase-state-update (consolidation epic #1969 B4 #1973)", () => {
|
||||
// allow-test-rule: source-text-is-the-product (see #2502)
|
||||
// Workflow .md / agent .md / command .md / reference .md files — their text
|
||||
// IS what the runtime loads. Testing text content tests the deployed contract.
|
||||
// Per CONTRIBUTING.md exception matrix.
|
||||
|
||||
/**
|
||||
* Regression test for #2502: insert-phase does not update STATE.md's
|
||||
* next-phase recommendation after inserting a decimal phase.
|
||||
*
|
||||
* Root cause: insert-phase.md's update_project_state step only added a
|
||||
* "Roadmap Evolution" note to STATE.md, but never updated the "Current Phase"
|
||||
* / next-run recommendation to point at the newly inserted phase.
|
||||
*
|
||||
* Fix: insert-phase.md must include a step that updates STATE.md's next-phase
|
||||
* pointer (current_phase / next recommended run) to the newly inserted phase.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const INSERT_PHASE_PATH = path.join(
|
||||
__dirname, '..', 'gsd-core', 'workflows', 'insert-phase.md'
|
||||
);
|
||||
|
||||
describe('bug-2502: insert-phase must update STATE.md next-phase recommendation', () => {
|
||||
test('insert-phase.md exists', () => {
|
||||
assert.ok(fs.existsSync(INSERT_PHASE_PATH), 'insert-phase.md should exist');
|
||||
});
|
||||
|
||||
test('insert-phase.md contains a STATE.md next-phase update instruction', () => {
|
||||
const content = fs.readFileSync(INSERT_PHASE_PATH, 'utf-8');
|
||||
|
||||
// Must reference STATE.md and the concept of updating the next/current phase pointer
|
||||
const mentionsStateUpdate = (
|
||||
/STATE\.md.{0,200}(next.phase|current.phase|next.run|recommendation)/is.test(content) ||
|
||||
/(next.phase|current.phase|next.run|recommendation).{0,200}STATE\.md/is.test(content)
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
mentionsStateUpdate,
|
||||
'insert-phase.md must instruct updating STATE.md\'s next-phase recommendation to point to the newly inserted phase'
|
||||
);
|
||||
});
|
||||
|
||||
test('insert-phase.md update_project_state step covers next-phase pointer', () => {
|
||||
const content = fs.readFileSync(INSERT_PHASE_PATH, 'utf-8');
|
||||
|
||||
const stepMatch = content.match(/<step name="update_project_state">([\s\S]*?)<\/step>/i);
|
||||
assert.ok(stepMatch, 'insert-phase.md must contain update_project_state step');
|
||||
const stepContent = stepMatch[1];
|
||||
|
||||
const hasNextPhasePointerUpdate = (
|
||||
/\bcurrent[_ -]?phase\b/i.test(stepContent) ||
|
||||
/\bnext[_ -]?phase\b/i.test(stepContent) ||
|
||||
/\bnext recommended run\b/i.test(stepContent)
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
hasNextPhasePointerUpdate,
|
||||
'insert-phase.md update_project_state step must update STATE.md\'s next-phase pointer (current_phase) to the inserted decimal phase'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user