fix(#4628): expose DAG-ready plans and restrict dispatch to them (#4781)

Emitted-Drift-Ack-Growth: execute-phase.md — #4628 consumer wiring: ready_plans parse pointer, not-ready named skip, and waiting condition 2b reference to the ready-wave-gate step file

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-16 02:38:43 -04:00
committed by GitHub
parent febe6c9885
commit 740ba0d8a3
41 changed files with 432 additions and 684 deletions

View File

@@ -37,12 +37,9 @@ const TIMEOUT = 5000;
// site 1/2 (execute-phase.md): source PHASE_NUMBER, prefix PHASE
// site 3 (completion-reconciliation.md): source SPOT_PHASE_NUMBER, prefix SPOT_PHASE
// site 4 (tdd.md): source PHASE, prefix PHASE
// #4748: the split is at the first NON-DIGIT, not the first dot, so a letter
// suffix (`03A`, `23A.1.2`) rides through in the rest instead of aborting the
// base-10 arithmetic; the rest is `_REST`, no longer only a `_FRAC`.
function fixedSnippet(sourceVar, prefix, indent = '') {
return `${indent}${prefix}_INT=\${${sourceVar}%%[!0-9]*}; ${prefix}_REST=\${${sourceVar}#"$${prefix}_INT"}\n` +
`${indent}${prefix}_N="$((10#$${prefix}_INT))\${${prefix}_REST//./\\\\.}"`;
return `${indent}${prefix}_INT=\${${sourceVar}%%.*}; ${prefix}_FRAC=\${${sourceVar}#"$${prefix}_INT"}\n` +
`${indent}${prefix}_N="$((10#$${prefix}_INT))\${${prefix}_FRAC//./\\\\.}"`;
}
function runFixed(phaseNumberValue) {
@@ -67,11 +64,6 @@ describe('#4619 — execute-phase decimal/N-segment phase-number arithmetic', ()
assert.equal(runFixed('01'), '1');
});
test('#4748: a letter-suffixed phase number keeps its letter and zero-strips the digit run (03A -> 3A, 23A.1.2 -> 23A\\.1\\.2)', () => {
assert.equal(runFixed('03A'), '3A');
assert.equal(runFixed('23A.1.2'), '23A\\.1\\.2');
});
test('failing-first: the OLD $((10#...)) form is a hard shell syntax error on a decimal phase number', () => {
assert.throws(() => {
execFileSync('bash', ['-c', 'echo $((10#01.1))'], { encoding: 'utf8', timeout: TIMEOUT });
@@ -131,13 +123,13 @@ describe('#4619 — execute-phase decimal/N-segment phase-number arithmetic', ()
});
describe('source parity — each of the 4 production sites carries the fixed logic', () => {
test('execute-phase.md safe_resume_gate carries the fixed PHASE_NUMBER/PHASE_INT/PHASE_REST/PHASE_N logic', () => {
test('execute-phase.md safe_resume_gate carries the fixed PHASE_NUMBER/PHASE_INT/PHASE_FRAC/PHASE_N logic', () => {
const w = fs.readFileSync(EXECUTE_PHASE, 'utf8');
assert.ok(w.includes(fixedSnippet('PHASE_NUMBER', 'PHASE')),
'safe_resume_gate must carry the byte-identical fixed decimal-tolerant snippet');
});
test('execute-phase.md TDD gate carries the fixed PHASE_NUMBER/PHASE_INT/PHASE_REST/PHASE_N logic', () => {
test('execute-phase.md TDD gate carries the fixed PHASE_NUMBER/PHASE_INT/PHASE_FRAC/PHASE_N logic', () => {
const w = fs.readFileSync(EXECUTE_PHASE, 'utf8');
// The TDD gate block is nested one level deeper (4-space indent) than
// safe_resume_gate's top-level snippet.