From 8b70db343bb248249ee196483a8c526e6ca98be9 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Tue, 14 Jul 2026 14:47:03 -0400 Subject: [PATCH] fix(#2204): phase-completion writes 'All phases complete' per ADR-2207 (#2259) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(#2204): phase-completion writes 'All phases complete' per ADR-2207 completePhaseCore was writing the overloaded bare 'Milestone complete' on the last phase — the same string space the milestone-close verb owns for terminal state. Per ADR-2207, phase-completion now writes the existing intermediate value 'All phases complete' (already used in gsd2-import.cts). Milestone termination (' milestone complete' / 'Awaiting next milestone') remains solely with milestoneCompleteCore. Status lifecycle: Ready to plan → All phases complete → milestone complete → Awaiting next milestone. Changes: - src/state-transition.cts: completePhaseCore status value - src/phase.cts: #2028 guard comment - tests/state-transition.test.cjs: assertion + test name - tests/phase.test.cjs: 8 assertion updates (positive + negative) - tests/state.test.cjs: normalizeStateStatus test case + reset regex - tests/workstream.test.cjs: fixture status to terminal value - gsd-core/workflows/progress.md: Route D label - gsd-core/workflows/transition.md: Route B label - CONTEXT.md: Status lifecycle glossary entry (ADR-2207) - .changeset/brave-geese-jump.md * test(#2204): regenerate golden-install-parity fixtures + workflow-size baseline Workflow file edits (progress.md, transition.md) changed install payload hashes and pushed past the committed workflow-size baseline. Regenerated all 17 golden-install-parity fixtures + claude-local via the standalone gen script (which now also covers the local-scope claude layout). Updated workflow-size-baseline.json and agent-size-baseline.json via size:baseline. * fix(#2204): correct claude-local golden hashes + document gen-script limitation The gen-script's claude-local generation produces macOS-specific hashes incompatible with Linux CI (local-scope install embeds platform-varying node-runner paths). Reverted to manual update using Linux FAILURES.md +actual hashes for the 2 changed workflow files. Added explanatory comment in the gen script. * test(#2204): add isCompletedInventory coverage + clarify CONTEXT.md glossary Addresses orthogonal code-review findings (Medium #1 + #2): - Add isCompletedInventory test cases for ADR-2207 status lifecycle (terminal 'milestone complete' → true; intermediate 'All phases complete' → false; archived → true; active statuses → false) - Clarify CONTEXT.md glossary: note that isCompletedInventory intentionally excludes the intermediate value * docs: backfill changeset PR number (#2259) * docs(#2204): add Status lifecycle table to state-md reference (ADR-2207) --- .changeset/gallant-foxes-bark.md | 5 + CONTEXT.md | 3 + docs/reference/state-md.md | 13 + gsd-core/bin/lib/markdown-table.cjs | 698 ++++++++++++++++++ gsd-core/bin/lib/state-transition.cjs | 10 +- gsd-core/bin/lib/write-set.cjs | 38 + gsd-core/workflows/progress.md | 4 +- gsd-core/workflows/transition.md | 2 +- src/phase.cts | 2 +- src/state-transition.cts | 10 +- .../golden-install-parity/antigravity.json | 6 +- .../golden-install-parity/augment.json | 6 +- .../golden-install-parity/claude.json | 6 +- .../fixtures/golden-install-parity/cline.json | 4 +- .../golden-install-parity/codebuddy.json | 6 +- .../fixtures/golden-install-parity/codex.json | 4 +- .../golden-install-parity/copilot.json | 4 +- .../golden-install-parity/cursor.json | 4 +- .../golden-install-parity/hermes.json | 6 +- .../fixtures/golden-install-parity/kilo.json | 4 +- .../fixtures/golden-install-parity/kimi.json | 6 +- .../golden-install-parity/opencode.json | 6 +- tests/fixtures/golden-install-parity/pi.json | 6 +- .../fixtures/golden-install-parity/qwen.json | 6 +- .../fixtures/golden-install-parity/trae.json | 4 +- .../golden-install-parity/windsurf.json | 4 +- .../fixtures/golden-install-parity/zcode.json | 4 +- tests/phase.test.cjs | 28 +- tests/state-transition.test.cjs | 4 +- tests/state.test.cjs | 5 +- tests/workflow-size-baseline.json | 4 +- tests/workstream-inventory.test.cjs | 25 +- tests/workstream.test.cjs | 2 +- 33 files changed, 862 insertions(+), 77 deletions(-) create mode 100644 .changeset/gallant-foxes-bark.md create mode 100644 gsd-core/bin/lib/markdown-table.cjs create mode 100644 gsd-core/bin/lib/write-set.cjs diff --git a/.changeset/gallant-foxes-bark.md b/.changeset/gallant-foxes-bark.md new file mode 100644 index 000000000..51e5c2741 --- /dev/null +++ b/.changeset/gallant-foxes-bark.md @@ -0,0 +1,5 @@ +--- +type: Changed +pr: 2259 +--- +**Phase-completion now writes `Status: All phases complete` instead of the overloaded bare `Milestone complete`** — the phase-level completion verb (`completePhaseCore`) was writing the same bare 'Milestone complete' string that the milestone-close verb uses for terminal state, causing a phase-level verb to own a milestone-level field. Per ADR-2207, phase-completion now writes the existing intermediate value 'All phases complete' (already used in gsd2-import.cts); milestone termination (' milestone complete' / 'Awaiting next milestone') remains solely with the milestone-close verb. (#2204) diff --git a/CONTEXT.md b/CONTEXT.md index f701eac97..6f6c8be02 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -55,6 +55,9 @@ Module owning STATE.md parse, field extraction, field replacement, status normal ### STATE.md Transition Module Module owning STATE.md lifecycle/maintenance transitions as intent-based methods (`beginPhase`, `advancePlan`, `completePhase`, `plannedPhase`, `milestoneSwitch`, `milestoneComplete`, `patch`, `sync`, `prune`, `update`, `rebuild`). Pure core `(content, intent, deps) → newContent` with injected I/O (file read/write, lock, disk scan); consults a field-classification table that names each STATE.md field's class (`derived-from-body` | `derived-from-disk` | `derived-from-external` | `curated` | `free`) and its preservation policy. Supersedes the 14 scattered RMW callbacks in `state.cts` and the direct `writeStateMd` callers in `milestone.cts:352` and `phase.cts:1770`; verify's `regenerateState` factory-reset primitive stays as a direct `writeStateMd` call. Absorbs `syncStateFrontmatter` + `readModifyWriteStateMd`'s post-sync preservation block; Encoding 3 (`cmdStateBuildFrontmatter`) stays separate — read path concern. Sibling/super-module of the STATE.md Document Module; consumes its `stateReplaceField`/`stateExtractField` primitives. Body section structure (`## Current Position`, `## Session`, etc.) lives as a constants block inside the Module. Append-only transitions (`addDecision`, `addBlocker`, etc.) stay on today's RMW seam for now. Targets the #1760/#1761/#1743/#1695/#1264/#1255/#1257/#3242 bug cluster. Migration per ADR-1372 §T6 sequenced as substrate + `beginPhase` first (PR1), then transition-by-transition with characterization tests first per transition. **ADR-1817 adds `rebuild` as the capstone 11th transition — the body-structure derivability contract.** Re-derives `## Current Position` prose from frontmatter and `## By-Phase Progress` table from phase dirs on disk; preserves `## Session` / `## Decisions` / unknown sections verbatim; de-duplicates `## Session Continuity Archive` (keep most-recent N, default 3); appends a structured audit entry to `## Rebuild Log` (`timestamp`, `kind`, `section`, `before`, `after`, `reason`) for every mutation. Hard idempotency guarantee: a no-mutation rebuild appends no log entry, so two successive invocations on a clean file are byte-identical. Non-overlapping with `sync` (3 lightweight frontmatter fields, auto-triggered) and orthogonal to `auto_prune_state` (age-based removal) — `rebuild` reconciles with current canonical sources, `prune` removes by retention policy, the two compose (rebuild first, then prune). Section ordering is invariant: rebuild rewrites content in place, never reorders. Targets the #1776/#1761/#1591 body-drift cluster that survived ADR-1769's per-field transitions. Phased per ADR-1817: Phase 0 = this ADR + predicates (closes #1817), Phase 1 = `rebuildCore` body + `rebuild` dispatch case + drift-class unit tests (#1827), Phase 2 = `cmdStateRebuild` CLI + `--dry-run`/`--verbose` + integration tests + docs + changeset (#1826). Source of truth: `gsd-core/bin/lib/state-transition.cjs` (generated from `src/state-transition.cts`). +### STATE.md Status Lifecycle (ADR-2207) +The `Status` field in STATE.md follows a strict lifecycle: `Ready to plan` → `All phases complete` (all phases done, milestone awaiting formal close) → ` milestone complete` (terminal, written only by the milestone-close verb `milestoneCompleteCore`) → `Awaiting next milestone` (archived). Phase-completion verbs write `All phases complete` on the last phase — never `Milestone complete` (the overloaded bare value was removed in #2204 per ADR-2207 to decouple phase-level writes from milestone termination). `normalizeStateStatus` maps any status containing "complete" → `completed`, so consumers using the normalized projection (workstream inventory's `status` field, statusline) recognize `All phases complete` without code changes. Note: `isCompletedInventory` (workstream-inventory-builder.cts) intentionally checks only for the terminal `\bmilestone\s+complete\b` / `\barchived\b` — `All phases complete` returns `false` (intermediate, not terminal). + ### Query Execution Policy Module Module owning query transport routing policy projection (`preferNative`, fallback policy, workstream subprocess forcing) at execution seam. diff --git a/docs/reference/state-md.md b/docs/reference/state-md.md index 967ec14ee..f7cc85d8e 100644 --- a/docs/reference/state-md.md +++ b/docs/reference/state-md.md @@ -98,6 +98,19 @@ When an orchestrator command is in flight, the convention (issue #2833) is to wr | `/gsd-execute-phase` | `executing` | | `/gsd-verify-work` | `verifying` | +### Status lifecycle (ADR-2207) + +The `Status` field follows a strict lifecycle across phase and milestone boundaries: + +| Value | Written by | Meaning | +|---|---|---| +| `Ready to plan` | `completePhaseCore` (non-last phase) | Next phase is ready for planning | +| `All phases complete` | `completePhaseCore` (last phase) | All phases done; milestone awaiting formal close | +| ` milestone complete` | `milestoneCompleteCore` | Milestone formally closed and archived | +| `Awaiting next milestone` | `milestoneCompleteCore` | Terminal/archived state | + +Phase-completion verbs never write `Milestone complete` (the overloaded bare value was removed in #2204 per ADR-2207 to decouple phase-level writes from milestone termination). + --- ## Status-line rendering scenes diff --git a/gsd-core/bin/lib/markdown-table.cjs b/gsd-core/bin/lib/markdown-table.cjs new file mode 100644 index 000000000..cb9b54144 --- /dev/null +++ b/gsd-core/bin/lib/markdown-table.cjs @@ -0,0 +1,698 @@ +"use strict"; +/** + * Markdown Table Model — canonical GFM table parsing + schema registry seam + * (ADR-2143, epic #2143). Pure functions, Node built-ins only, string-in/value-out, + * no I/O. Compiled by tsc to gsd-core/bin/lib/markdown-table.cjs. + * + * NOTE: the `Result` here is the ADR-2143 §5 parse-result shape {ok,value|reason}, + * now defined once in `./write-set.cjs` (the shared fail-loud + write-set seam) and + * re-exported here so existing importers of `Result` from this module keep working + * unchanged — deliberately distinct from command-routing-hub's dispatch `Result` + * {ok,data|kind}; the two never mix (different modules). + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TABLE_SCHEMAS = void 0; +exports.matchTableSchema = matchTableSchema; +exports.splitTableRow = splitTableRow; +exports.isDelimiterRow = isDelimiterRow; +exports.parseMarkdownTable = parseMarkdownTable; +exports.updateTableCell = updateTableCell; +exports.deleteTableRow = deleteTableRow; +exports.insertTableRow = insertTableRow; +exports.findTableBySchema = findTableBySchema; +exports.findTableWithColumns = findTableWithColumns; +exports.escapeCell = escapeCell; +exports.appendQuickTaskRow = appendQuickTaskRow; +const markdown_sectionizer_cjs_1 = require("./markdown-sectionizer.cjs"); +// ─── Schema registry ────────────────────────────────────────────────────────── +/** + * Canonical column-header shapes for every GFM table GSD parses or generates. + * Each entry in `TABLE_SCHEMAS[id]` is one accepted variant (exact column names, + * in order); `matchTableSchema` resolves a parsed header back to `{id, label}`. + * + * This registry is the single source of truth — a parity test + * (tests/markdown-table.test.cjs) asserts every variant's header appears + * verbatim in the template/workflow file that generates it, so the registry + * and the templates can never silently drift (ADR-2143 §3 Generative-Fix- + * Divergence guard). + */ +exports.TABLE_SCHEMAS = { + RoadmapProgress: [ + { label: 'flat', columns: ['Phase', 'Plans Complete', 'Status', 'Completed'] }, + { + label: 'milestone-grouped', + columns: ['Phase', 'Milestone', 'Plans Complete', 'Status', 'Completed'], + }, + ], + RequirementsTraceability: [ + { label: 'default', columns: ['Requirement', 'Phase', 'Status'] }, + ], + QuickTasks: [ + { label: 'no-status', columns: ['#', 'Description', 'Date', 'Commit', 'Directory'] }, + { + label: 'with-status', + columns: ['#', 'Description', 'Date', 'Commit', 'Status', 'Directory'], + }, + ], + Security: [ + { label: 'trust-boundaries', columns: ['Boundary', 'Description', 'Data Crossing'] }, + { + label: 'threat-register', + columns: [ + 'Threat ID', + 'Category', + 'Component', + 'Severity', + 'Disposition', + 'Mitigation', + 'Status', + ], + }, + { + label: 'accepted-risks', + columns: ['Risk ID', 'Threat Ref', 'Rationale', 'Accepted By', 'Date'], + }, + { + label: 'audit-trail', + columns: ['Audit Date', 'Threats Total', 'Closed', 'Open', 'Run By'], + }, + ], +}; +/** + * Resolve a parsed table's header columns to the canonical schema it matches + * (exact column names, same length, same order), else `null`. + */ +function matchTableSchema(columns) { + for (const [id, variants] of Object.entries(exports.TABLE_SCHEMAS)) { + for (const variant of variants) { + if (variant.columns.length === columns.length + && variant.columns.every((col, idx) => col === columns[idx])) { + return { id, label: variant.label }; + } + } + } + return null; +} +// ─── Parsing ────────────────────────────────────────────────────────────────── +/** + * Split one GFM table row line into trimmed cell strings. + * Strips one leading and one trailing `|`, splits on unescaped `|`, trims + * each cell, and unescapes `\\` back to `\` and `\|` back to `|` (the exact + * reverse of `escapeCell`'s `\`->`\\` then `|`->`\|` order below), so cell + * values round-trip exactly — including literal backslashes. + */ +function splitTableRow(line) { + let stripped = line.trim(); + if (stripped.startsWith('|')) + stripped = stripped.slice(1); + if (stripped.endsWith('|')) + stripped = stripped.slice(0, -1); + return stripped.split(/(? cell.trim().replace(/\\([\\|])/g, '$1')); +} +/** + * True when every delimiter cell matches GFM's `:?-{1,}:?` shape (spaces + * removed). Exported (alongside `splitTableRow`) so callers that need their + * own ragged-tolerant header/delimiter detection — e.g. state.cts's + * `cmdStateRecordMetric` row-append, which must recognize an existing table + * without requiring every DATA row to also parse cleanly (#2245 Blocker 2) — + * reuse the exact same header/delimiter-shape check `parseMarkdownTable` uses, + * instead of re-deriving it and risking divergence. + */ +function isDelimiterRow(cells) { + return cells.every((cell) => /^:?-{1,}:?$/.test(cell.replace(/\s+/g, ''))); +} +/** + * Parse the FIRST GFM pipe table found in `sectionText`. + * + * Defensive by design: never throws — every malformed shape (no table, + * missing/misaligned delimiter row, ragged data row) returns a typed + * `{ok:false, reason}` instead of silently coercing or dropping data + * (ADR-2143 §3 — ragged rows are errors, not silent). + * + * Scope note: GSD planning tables (STATE.md/ROADMAP.md/requirements.md/ + * SECURITY.md) are always fully-piped (leading + trailing `|` on every row) + * and non-indented — this parser targets THAT shape, not arbitrary + * CommonMark (which also allows non-piped rows and up to 3 leading spaces). + */ +function parseMarkdownTable(sectionText) { + if (typeof sectionText !== 'string' || sectionText.trim() === '') { + return { ok: false, reason: 'empty or non-string input' }; + } + const lines = sectionText.split(/\r?\n/); + let headerIdx = -1; + for (let i = 0; i < lines.length; i++) { + const trimmed = lines[i].trim(); + if (trimmed.startsWith('|') && trimmed.indexOf('|', 1) !== -1) { + headerIdx = i; + break; + } + } + if (headerIdx === -1) { + return { ok: false, reason: 'no table found' }; + } + const columns = splitTableRow(lines[headerIdx]); + const delimiterLine = lines[headerIdx + 1]; + if (delimiterLine === undefined || !delimiterLine.trim().startsWith('|')) { + return { ok: false, reason: 'missing delimiter row' }; + } + const delimiterCells = splitTableRow(delimiterLine); + if (!isDelimiterRow(delimiterCells)) { + return { ok: false, reason: 'missing delimiter row' }; + } + if (delimiterCells.length !== columns.length) { + return { ok: false, reason: 'delimiter/header column count mismatch' }; + } + const rows = []; + let rowNum = 0; + for (let i = headerIdx + 2; i < lines.length; i++) { + const trimmed = lines[i].trim(); + if (!trimmed.startsWith('|')) + break; + rowNum += 1; + const cells = splitTableRow(lines[i]); + if (cells.length !== columns.length) { + return { + ok: false, + reason: `row ${rowNum} has ${cells.length} cells, expected ${columns.length}`, + }; + } + const row = {}; + columns.forEach((col, idx) => { + row[col] = cells[idx]; + }); + rows.push(row); + } + return { ok: true, value: { columns, rows } }; +} +/** + * Split `text` into lines exactly like `.split(/\r?\n/)` (bare `\r` is NOT a + * line break, matching `parseMarkdownTable`), tracking each line's absolute + * start offset in `text` so cell ranges can be computed relative to the + * ORIGINAL string, not the trimmed/relative line. + */ +function splitLinesWithOffsets(text) { + const result = []; + let start = 0; + const re = /\r\n|\n/g; + let m; + while ((m = re.exec(text)) !== null) { + result.push({ line: text.slice(start, m.index), start }); + start = m.index + m[0].length; + } + result.push({ line: text.slice(start), start }); + return result; +} +/** + * Split one GFM table row LINE into raw cell ranges, absolute to the original + * `text` the line was sliced from (`lineStart` = that line's start offset). + * Mirrors `splitTableRow`'s trim + strip-leading/trailing-pipe + unescaped-pipe + * split EXACTLY, but returns character ranges instead of trimmed values, so a + * caller can splice a replacement into the original string byte-for-byte. + */ +function splitTableRowRanges(line, lineStart) { + const leftTrim = /^\s*/.exec(line)[0].length; + const rightTrim = /\s*$/.exec(line)[0].length; + let stripped = line.slice(leftTrim, line.length - rightTrim); + let strippedStart = lineStart + leftTrim; + if (stripped.startsWith('|')) { + stripped = stripped.slice(1); + strippedStart += 1; + } + if (stripped.endsWith('|')) { + stripped = stripped.slice(0, -1); + } + const cells = []; + const re = /(? `\` and `\|` -> `|`. */ +function unescapeCellText(raw) { + return raw.trim().replace(/\\([\\|])/g, '$1'); +} +/** + * Surgically edit ONE table cell while preserving the table's exact byte + * formatting (ADR-2143 §7). Locates the first GFM table's header + delimiter + * row in `tableText` (own header/delimiter detection — deliberately does NOT + * gate on `parseMarkdownTable(tableText).ok`), finds the first DATA row where + * `match(row, index)` is true, and replaces ONLY that row's `column` cell's + * raw inner text (the span between its two delimiting `|` characters) — every + * other byte of `tableText` (other cells, padding, alignment, EOL style) is + * left BYTE-IDENTICAL. This is deliberately NOT a parse-then-render: a + * render pass would reformat padding/alignment/dates that mutation sites + * (e.g. `status.padEnd(11)`) depend on staying pinned. + * + * Ragged-tolerant by design (#2245 review Fix 2): each data row's + * `{colName:cellText}` record is built ONLY from the columns physically + * present in THAT row — a short row simply omits its trailing column names; + * an over-long row's extra trailing cells are ignored — so `match` is called + * with whatever partial record a ragged row yields. A single sibling row + * whose cell count doesn't match the header must never silently no-op the + * whole write (the prior `parseMarkdownTable(tableText).ok` gate failed the + * ENTIRE table — including an otherwise-well-formed target row — the moment + * ANY other row in the same table was ragged). A row that matches on content + * but is too short to physically contain `column` has no cell to splice + * into, so it cannot be selected; the scan continues past it. + * + * `newValue` is spliced in VERBATIM as the new raw cell span — it is the + * caller's responsibility to supply the fully-formatted text (including any + * leading/trailing padding needed to reproduce the table's existing column + * alignment, and to escape a literal `|` or `\` the value might contain via + * the same convention `splitTableRow`/`escapeCell` use elsewhere in this + * module). When `newValue` is a function, it receives the CURRENT (trimmed, + * unescaped) cell value — the same value that appears in `match`'s `row` + * argument — and must return the full literal replacement text. Returning + * the current value unchanged is a supported no-op-probe pattern for callers + * that need to know whether (and to what current value) a row matched + * without necessarily writing a new value. + * + * Returns `{ok:false, reason}` only for a genuinely absent/malformed table + * (no header line, or no valid delimiter row immediately below it), an + * unknown `column`, or zero rows satisfying `match` while physically + * containing `column` — never for a ragged sibling row. + */ +function updateTableCell(tableText, match, column, newValue) { + const lines = splitLinesWithOffsets(tableText); + let headerIdx = -1; + for (let i = 0; i < lines.length; i++) { + const trimmed = lines[i].line.trim(); + if (trimmed.startsWith('|') && trimmed.indexOf('|', 1) !== -1) { + headerIdx = i; + break; + } + } + if (headerIdx === -1) { + return { ok: false, reason: 'no table found' }; + } + const delimiterLine = lines[headerIdx + 1]?.line; + if (delimiterLine === undefined || !delimiterLine.trim().startsWith('|')) { + return { ok: false, reason: 'missing delimiter row' }; + } + const headerRanges = splitTableRowRanges(lines[headerIdx].line, lines[headerIdx].start); + const columns = headerRanges.map((r) => unescapeCellText(tableText.slice(r.start, r.end))); + const delimiterCells = splitTableRow(delimiterLine); + if (!isDelimiterRow(delimiterCells)) { + return { ok: false, reason: 'missing delimiter row' }; + } + if (delimiterCells.length !== columns.length) { + return { ok: false, reason: 'delimiter/header column count mismatch' }; + } + if (!columns.includes(column)) { + return { ok: false, reason: `unknown column: ${column}` }; + } + const targetColIdx = columns.indexOf(column); + let selectedRange; + let dataRowIndex = 0; + for (let i = headerIdx + 2; i < lines.length; i++) { + const trimmed = lines[i].line.trim(); + if (!trimmed.startsWith('|')) + break; + const cellRanges = splitTableRowRanges(lines[i].line, lines[i].start); + const record = {}; + const presentCount = Math.min(cellRanges.length, columns.length); + for (let c = 0; c < presentCount; c++) { + record[columns[c]] = unescapeCellText(tableText.slice(cellRanges[c].start, cellRanges[c].end)); + } + if (targetColIdx < cellRanges.length && match(record, dataRowIndex)) { + selectedRange = cellRanges[targetColIdx]; + break; + } + dataRowIndex += 1; + } + if (!selectedRange) { + return { ok: false, reason: 'no matching row' }; + } + const currentValue = unescapeCellText(tableText.slice(selectedRange.start, selectedRange.end)); + const replacement = typeof newValue === 'function' ? newValue(currentValue) : newValue; + // True no-op guard: a function `newValue` that returns `current` UNCHANGED + // (the documented no-op-probe pattern) must leave `tableText` genuinely + // byte-identical, padding included. `current` is already trimmed/unescaped, + // so naively splicing it back in would strip the raw cell's original + // leading/trailing padding — this returns the ORIGINAL text untouched + // instead whenever the callback's answer is "no change". + if (typeof newValue === 'function' && replacement === currentValue) { + return { ok: true, value: tableText }; + } + return { + ok: true, + value: tableText.slice(0, selectedRange.start) + replacement + tableText.slice(selectedRange.end), + }; +} +// ─── deleteTableRow (ADR-2143 §7 row-removal sibling of updateTableCell) ───── +/** + * Surgically delete ONE whole table row while preserving every other byte of + * `tableText` (ADR-2143 §7, row-removal sibling of `updateTableCell`). Locates + * the first GFM table's header + delimiter row in `tableText` using the exact + * same self-contained, ragged-tolerant scan `updateTableCell` uses (own + * header/delimiter detection — does NOT gate on `parseMarkdownTable(tableText).ok`), + * finds the FIRST data row where `match(row, index)` is true, and splices out + * that row's entire LINE — including its trailing newline (`\r\n` or `\n`, + * whichever terminates it) — from `tableText`. Every other byte (header, + * delimiter, other rows, surrounding prose before/after the table, EOL style) + * is left BYTE-IDENTICAL. + * + * Ragged-tolerant by design, mirroring `updateTableCell` (#2245 review Fix 2): + * each data row's `{colName:cellText}` record is built ONLY from the columns + * physically present in THAT row — a sibling row whose cell count doesn't + * match the header must never abort the whole scan; `match` is simply called + * with whatever partial record a ragged row yields. + * + * Returns `{ok:false, reason}` for a genuinely absent/malformed table (no + * header line, or no valid delimiter row immediately below it) or zero rows + * satisfying `match` — never for a ragged sibling row. + */ +function deleteTableRow(tableText, match) { + const lines = splitLinesWithOffsets(tableText); + let headerIdx = -1; + for (let i = 0; i < lines.length; i++) { + const trimmed = lines[i].line.trim(); + if (trimmed.startsWith('|') && trimmed.indexOf('|', 1) !== -1) { + headerIdx = i; + break; + } + } + if (headerIdx === -1) { + return { ok: false, reason: 'no table found' }; + } + const delimiterLine = lines[headerIdx + 1]?.line; + if (delimiterLine === undefined || !delimiterLine.trim().startsWith('|')) { + return { ok: false, reason: 'missing delimiter row' }; + } + const headerRanges = splitTableRowRanges(lines[headerIdx].line, lines[headerIdx].start); + const columns = headerRanges.map((r) => unescapeCellText(tableText.slice(r.start, r.end))); + const delimiterCells = splitTableRow(delimiterLine); + if (!isDelimiterRow(delimiterCells)) { + return { ok: false, reason: 'missing delimiter row' }; + } + if (delimiterCells.length !== columns.length) { + return { ok: false, reason: 'delimiter/header column count mismatch' }; + } + let selectedLineIdx = -1; + let dataRowIndex = 0; + for (let i = headerIdx + 2; i < lines.length; i++) { + const trimmed = lines[i].line.trim(); + if (!trimmed.startsWith('|')) + break; + const cellRanges = splitTableRowRanges(lines[i].line, lines[i].start); + const record = {}; + const presentCount = Math.min(cellRanges.length, columns.length); + for (let c = 0; c < presentCount; c++) { + record[columns[c]] = unescapeCellText(tableText.slice(cellRanges[c].start, cellRanges[c].end)); + } + if (match(record, dataRowIndex)) { + selectedLineIdx = i; + break; + } + dataRowIndex += 1; + } + if (selectedLineIdx === -1) { + return { ok: false, reason: 'no matching row' }; + } + // Splice out the whole LINE including its trailing EOL: the next line's + // recorded `start` offset is already positioned right after whatever EOL + // (`\r\n` or `\n`) terminated the selected line (see `splitLinesWithOffsets` + // above) — when the selected row is the LAST line in `tableText` (no + // trailing EOL to preserve), fall back to the end of the string. + let rowStart = lines[selectedLineIdx].start; + let rowEnd; + if (selectedLineIdx + 1 < lines.length) { + rowEnd = lines[selectedLineIdx + 1].start; + } + else { + // The selected row is the LAST line and has no trailing EOL: deleting from + // its `start` to end-of-string would strand the EOL that terminated the + // PREVIOUS line as a dangling newline. Back `rowStart` up over that + // preceding `\n` (and its `\r`, if any) so the table ends cleanly after the + // new last row. + rowEnd = tableText.length; + if (rowStart > 0 && tableText[rowStart - 1] === '\n') { + rowStart -= 1; + if (rowStart > 0 && tableText[rowStart - 1] === '\r') + rowStart -= 1; + } + } + return { + ok: true, + value: tableText.slice(0, rowStart) + tableText.slice(rowEnd), + }; +} +// ─── insertTableRow (ADR-2143 §7 row-insertion sibling of updateTableCell) ─── +/** + * Insert ONE new row into a GFM table while preserving every other byte of + * `tableText` (ADR-2143 §7, row-insertion sibling of `updateTableCell` / + * `deleteTableRow`). Locates the first table's header + delimiter row using + * the exact same self-contained, ragged-tolerant scan the other two use (own + * header/delimiter detection — does NOT gate on `parseMarkdownTable(tableText).ok`), + * builds the new row's cells in the table's ACTUAL header order — each column + * name is passed through `valueFor(column)`; a column for which `valueFor` + * returns `undefined` gets `fallback` (default `'-'`) — and splices it in + * immediately after the table's LAST existing data row (or immediately after + * the delimiter row when the table has zero data rows). + * + * Name-addressed and header-order-agnostic by construction: unlike a + * hardcoded positional literal (`| ${a} | ${b} | - | - |`), this never + * silently no-ops or mis-maps a value onto the wrong column when the header + * is reordered or a superset of the columns `valueFor` knows about (#2245 + * audit sibling finding — the bug this helper replaces). + * + * EOL-preserving: the new row reuses whatever exact EOL bytes (`\r\n` or + * `\n`) already terminate the line it's inserted after, so a CRLF document + * stays CRLF and an LF document stays LF — never guessed or hardcoded. When + * the insertion point is at the very end of `tableText` with no following + * line (the table's last row has no trailing EOL of its own), the existing + * last row is terminated with the header/delimiter boundary's own EOL (so it + * gains a terminator, since it is no longer the last line) and the new row + * becomes the new EOL-less tail — mirroring `tableText`'s own convention of + * not forcing a trailing newline that wasn't already there. + * + * Escaping (F4 #2245 review): unlike `updateTableCell`, whose `newValue` is + * spliced in VERBATIM (caller-must-escape — see its doc comment above), every + * value returned by `valueFor` (and `fallback`) IS escaped internally here via + * `escapeCell` before being joined into the new row, exactly like + * `appendQuickTaskRow` below — a caller-supplied name containing a literal + * `|` or `\` cannot silently split the new row into extra columns. Callers do + * NOT need to pre-escape their values. + * + * Returns `{ok:false, reason}` only for a genuinely absent/malformed table + * (no header line, or no valid delimiter row immediately below it) — never + * for a ragged data row (mirrors `updateTableCell`/`deleteTableRow`). + */ +function insertTableRow(tableText, valueFor, fallback = '-') { + const lines = splitLinesWithOffsets(tableText); + let headerIdx = -1; + for (let i = 0; i < lines.length; i++) { + const trimmed = lines[i].line.trim(); + if (trimmed.startsWith('|') && trimmed.indexOf('|', 1) !== -1) { + headerIdx = i; + break; + } + } + if (headerIdx === -1) { + return { ok: false, reason: 'no table found' }; + } + const delimiterLine = lines[headerIdx + 1]?.line; + if (delimiterLine === undefined || !delimiterLine.trim().startsWith('|')) { + return { ok: false, reason: 'missing delimiter row' }; + } + const delimiterCells = splitTableRow(delimiterLine); + if (!isDelimiterRow(delimiterCells)) { + return { ok: false, reason: 'missing delimiter row' }; + } + const headerRanges = splitTableRowRanges(lines[headerIdx].line, lines[headerIdx].start); + const columns = headerRanges.map((r) => unescapeCellText(tableText.slice(r.start, r.end))); + // Header -> delimiter EOL, reused as the fallback terminator for the "insert + // point is at the absolute end of tableText" edge case below. + const headerToDelimiterEol = tableText.slice(lines[headerIdx].start + lines[headerIdx].line.length, lines[headerIdx + 1].start) || '\n'; + let lastLineIdx = headerIdx + 1; // delimiter row, when the table has zero data rows + for (let i = headerIdx + 2; i < lines.length; i++) { + if (!lines[i].line.trim().startsWith('|')) + break; + lastLineIdx = i; + } + const newRow = `| ${columns.map((col) => escapeCell(valueFor(col) ?? fallback)).join(' | ')} |`; + if (lastLineIdx + 1 < lines.length) { + // A following line exists — insert the new row, reusing the EXACT EOL + // that already terminates the current last table line, so every other + // byte (including everything after the table) stays untouched. + const insertAt = lines[lastLineIdx + 1].start; + const eol = tableText.slice(lines[lastLineIdx].start + lines[lastLineIdx].line.length, insertAt); + return { ok: true, value: tableText.slice(0, insertAt) + newRow + eol + tableText.slice(insertAt) }; + } + // The table's last row is also the last line of `tableText` (no trailing + // EOL). Terminate it now — it needs one, since it is no longer last — and + // append the new row as the new EOL-less tail. + return { ok: true, value: tableText + headerToDelimiterEol + newRow }; +} +/** + * Find the first table in `text` whose header matches `TABLE_SCHEMAS[schemaId]`, + * scanning the WHOLE document (not just a named section). Returns `null` when + * no table with that schema is found. + * + * Fixes the regression where callers first located a named heading (e.g. + * `## Progress`) via `collectSection` and only then parsed a table inside it — + * a schema-matching table that lives under a differently-named heading (or no + * heading at all), or that isn't the first table in the document, was + * invisible to that approach. Scanning the whole document by schema restores + * the old "find the progress table anywhere" behaviour while staying + * seam-based (ADR-2143). + */ +function findTableBySchema(text, schemaId) { + if (typeof text !== 'string') + return null; + const lines = text.split(/\r?\n/); + for (let i = 0; i < lines.length; i++) { + const t = lines[i].trim(); + if (!t.startsWith('|') || t.indexOf('|', 1) === -1) + continue; + const cols = splitTableRow(lines[i]); + const m = matchTableSchema(cols); + if (m && m.id === schemaId) { + const parsed = parseMarkdownTable(lines.slice(i).join('\n')); + if (parsed.ok) + return parsed.value; + } + } + return null; +} +/** + * Find the first GFM table in `text` whose header contains ALL of `required` + * column names (order-independent; extra/injected columns allowed). Returns + * the parsed `MarkdownTable`, or `null` when no table's header is a superset + * of `required`. + * + * Column-NAME/order/count-invariant counterpart to `findTableBySchema` (ADR-2143 + * §3 "addressed by NAME, never ordinal"): where `findTableBySchema` requires an + * EXACT canonical column set+order registered in `TABLE_SCHEMAS`, this scans + * for any header that names the required columns, in any order, tolerating + * extra/unrelated injected columns. Cells remain addressable by column NAME + * via the returned `MarkdownTable`. + */ +function findTableWithColumns(text, required) { + if (typeof text !== 'string') + return null; + const lines = text.split(/\r?\n/); + for (let i = 0; i < lines.length; i++) { + const t = lines[i].trim(); + if (!t.startsWith('|') || t.indexOf('|', 1) === -1) + continue; + const cols = splitTableRow(lines[i]); + if (required.every((rq) => cols.includes(rq))) { + const parsed = parseMarkdownTable(lines.slice(i).join('\n')); + if (parsed.ok) + return parsed.value; + } + } + return null; +} +// ─── Quick Tasks row append (#2133) ──────────────────────────────────────────── +/** + * Escape one dynamic cell value for insertion into a GFM pipe-table row. + * + * Escapes `\` -> `\\` FIRST, then `|` -> `\|` (in that order, so a literal + * backslash already in the value is never mistaken for part of an escape + * sequence introduced by this function — CodeQL js/incomplete-sanitization). + * `splitTableRow` reverses both in the opposite order (`\\` -> `\` then + * `\|` -> `|`, see line ~114 above), so escaping/unescaping round-trips + * exactly, including literal backslashes. Newlines are collapsed to a + * single space — a raw `|` or embedded newline in a cell value (e.g. a task + * `description`) would otherwise corrupt the table (extra column / a fake + * extra row) and get rejected by the now-fail-loud `parseMarkdownTable` as a + * ragged row. + * + * Exported (F3/#2245 review) so callers of `updateTableCell` that build a + * replacement value by transforming the CURRENT (already-unescaped) cell + * text — e.g. phase.cts's Progress-ordinal renumber, which decrements the + * leading digit of a `Phase` cell like `3. Parser | Lexer` and splices the + * rest of the cell text back verbatim — can re-escape that value before + * returning it from the `newValue` callback, honoring `updateTableCell`'s + * caller-must-re-escape contract (see its doc comment above) instead of + * spliceing a raw, unescaped `|` back into the table and silently splitting + * the cell. + */ +function escapeCell(value) { + return String(value) + .replace(/\r?\n+/g, ' ') + .replace(/\\/g, '\\\\') // escape the escape char FIRST (CodeQL js/incomplete-sanitization) + .replace(/\|/g, '\\|') + .trim(); +} +/** + * Append one row to STATE.md's "Quick Tasks Completed" table. + * + * Pure, schema-driven replacement for fast.md's inline `awk NF-2` column-count + * guess (#2133, ADR-2143 §3 schema registry / §7 fail-loud unrecognized-schema + * guard). Never touches disk, git, or the clock — callers (the `gsd-tools + * quick-tasks-append` subcommand) compute `date`/`commit` and pass them in. + * + * Fails loud (`{ok:false, reason}`, never a silent skip) when: + * - no "Quick Tasks Completed" heading exists in `stateContent` + * - the section's body doesn't parse as a GFM table (parseMarkdownTable failure) + * - the table's header doesn't match a known `TABLE_SCHEMAS.QuickTasks` variant + * (the old awk arithmetic silently skipped here instead — that silent-skip + * branch is the bug this replaces). + * + * The new row is inserted immediately after the LAST existing table row line + * (or immediately after the header/delimiter when the table has zero data + * rows), preserving any surrounding blank lines/trailing content in the section. + */ +function appendQuickTaskRow(stateContent, fields) { + const section = (0, markdown_sectionizer_cjs_1.collectSection)(stateContent, (h) => /^quick tasks completed$/i.test(h.text.trim())); + if (!section) { + return { ok: false, reason: 'no Quick Tasks Completed section' }; + } + const parsed = parseMarkdownTable(section.body); + if (!parsed.ok) { + return { ok: false, reason: `quick-tasks table: ${parsed.reason}` }; + } + const match = matchTableSchema(parsed.value.columns); + if (!match || match.id !== 'QuickTasks') { + return { + ok: false, + reason: `unrecognized Quick Tasks schema (columns: ${parsed.value.columns.join(' | ')})`, + }; + } + const variant = exports.TABLE_SCHEMAS.QuickTasks.find((v) => v.label === match.label); + const columns = variant ? variant.columns : parsed.value.columns; + const rowNumber = parsed.value.rows.length + 1; + const cellFor = (col) => { + switch (col) { + case '#': return escapeCell(String(rowNumber)); + case 'Description': return escapeCell(fields.description); + case 'Date': return escapeCell(fields.date); + case 'Commit': return escapeCell(fields.commit); + case 'Status': return escapeCell(fields.status ?? '—'); + case 'Directory': return escapeCell(fields.directory ?? '—'); + default: return '—'; + } + }; + const row = `| ${columns.map(cellFor).join(' | ')} |`; + // Detect the section's EOL BEFORE splitting on /\r?\n/ (which discards it) so + // the rejoin below preserves CRLF instead of downgrading a CRLF section to + // mixed EOL (the inserted `row` itself never contains a newline). + const eol = /\r\n/.test(section.body) ? '\r\n' : '\n'; + const lines = section.body.split(/\r?\n/); + let lastTableLineIdx = -1; + for (let i = 0; i < lines.length; i++) { + if (lines[i].trim().startsWith('|')) + lastTableLineIdx = i; + } + // lastTableLineIdx is always >= 0 here — parseMarkdownTable already + // confirmed a header + delimiter row exist in this same `section.body`. + const newLines = [ + ...lines.slice(0, lastTableLineIdx + 1), + row, + ...lines.slice(lastTableLineIdx + 1), + ]; + const newBody = newLines.join(eol); + const content = (0, markdown_sectionizer_cjs_1.replaceSection)(stateContent, section, newBody); + return { ok: true, value: { content, row, variant: match.label } }; +} +// Consumers: require('../gsd-core/bin/lib/markdown-table.cjs') +// Named CJS exports are the canonical surface (ADR-457 .cts → .cjs build-at-publish). diff --git a/gsd-core/bin/lib/state-transition.cjs b/gsd-core/bin/lib/state-transition.cjs index 8ea8ec8a6..55efadc53 100644 --- a/gsd-core/bin/lib/state-transition.cjs +++ b/gsd-core/bin/lib/state-transition.cjs @@ -586,8 +586,8 @@ function advancePlanCore(content, deps) { * Migrates the inline STATE.md transform that lived inside `cmdPhaseComplete` * (phase.cts) onto the substrate. Owns the field-classification-governed body * mutations: Current Phase (preserving the `of total` shape and phase name), - * Current Phase Name, Status (`Milestone complete` on the last phase, else - * `Ready to plan`), Current Plan (`Not started`), Last Activity + Description, + * Current Phase Name, Status (`All phases complete` on the last phase, else + * `Ready to plan` per ADR-2207), Current Plan (`Not started`), Last Activity + Description, * and the Completed/Total Phases + Progress percent block (re-derived from the * roadmap via the injected `roadmapProvider`). * @@ -667,8 +667,10 @@ function completePhaseCore(content, intent, deps) { updated.push('Current Phase Name'); } } - // Status — `Milestone complete` on the final phase, otherwise `Ready to plan`. - const statusValue = intent.isLastPhase ? 'Milestone complete' : 'Ready to plan'; + // Status — `All phases complete` on the final phase (ADR-2207), otherwise + // `Ready to plan`. Milestone termination (` milestone complete`) is + // owned solely by the milestone-close verb (milestoneCompleteCore). + const statusValue = intent.isLastPhase ? 'All phases complete' : 'Ready to plan'; const statusAfter = (0, state_document_cjs_1.stateReplaceFieldWithFallback)(body, 'Status', null, statusValue); if (statusAfter !== body) { body = statusAfter; diff --git a/gsd-core/bin/lib/write-set.cjs b/gsd-core/bin/lib/write-set.cjs new file mode 100644 index 000000000..a62f261f2 --- /dev/null +++ b/gsd-core/bin/lib/write-set.cjs @@ -0,0 +1,38 @@ +"use strict"; +/** + * Write-Set — shared fail-loud parse `Result` and per-surface write-set + * contracts (ADR-2143, epic #2143). Pure, Node built-ins only, no I/O. + * Compiled by tsc to gsd-core/bin/lib/write-set.cjs. + * + * ADR-2143 §5 (fail-loud parsing, no null-swallow): seam parse operations + * and document-model accessors return a typed `Result` — never a bare + * `null` a caller can mistake for "empty but fine." This is the same + * `{ ok: true; value: T } | { ok: false; reason: string }` shape + * `markdown-table.cts` already defined for `parseMarkdownTable` / + * `appendQuickTaskRow`; this module is now the single source of truth for + * it and `markdown-table.cjs` re-exports the type so existing importers of + * `Result` from that module keep working unchanged. + * + * NOTE: deliberately distinct from command-routing-hub's dispatch `Result` + * (`{ok,data}|{ok:false,kind}`) — the two never mix (different modules, + * different shapes, different purposes). + * + * ADR-2143 §6 (write-set results for multi-surface commands, no + * OR-into-one-flag): a command that mutates more than one surface returns + * an explicit per-surface write-set — `{ surface, applied }` outcomes — and + * its top-level "did this fully succeed" signal is true only if EVERY + * surface in the set applied. ORing independent surfaces into a single + * boolean is the direct anti-pattern that let a checkbox-only partial + * write (#2140) report full success. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeSetComplete = writeSetComplete; +/** + * True only if the write-set is non-empty AND every surface in it applied. + * An empty write-set is never "complete" — there is nothing to be complete + * about, so treating it as vacuously true would let a no-op masquerade as + * a full success (the same OR-into-one-flag class ADR-2143 §6 prohibits). + */ +function writeSetComplete(ws) { + return ws.length > 0 && ws.every((o) => o.applied); +} diff --git a/gsd-core/workflows/progress.md b/gsd-core/workflows/progress.md index 9f21da74b..49ca1dbd1 100644 --- a/gsd-core/workflows/progress.md +++ b/gsd-core/workflows/progress.md @@ -536,7 +536,7 @@ State: "Current phase is {X}. Milestone has {N} phases (highest: {Y})." | Condition | Meaning | Action | |-----------|---------|--------| | current phase < highest phase | More phases remain | Go to **Route C** | -| current phase = highest phase | Milestone complete | Go to **Route D** | +| current phase = highest phase | All phases complete | Go to **Route D** | --- @@ -602,7 +602,7 @@ NEXT_HAS_UI=$(echo "$NEXT_PHASE_SECTION" | grep -qi "UI hint.*yes" && echo "true --- -**Route D: Milestone complete** +**Route D: All phases complete (milestone ready to close)** ``` --- diff --git a/gsd-core/workflows/transition.md b/gsd-core/workflows/transition.md index 0a4bebcf2..672057777 100644 --- a/gsd-core/workflows/transition.md +++ b/gsd-core/workflows/transition.md @@ -597,7 +597,7 @@ Do NOT auto-invoke any further slash commands. --- -**Route B: Milestone complete (all phases done)** +**Route B: All phases complete (milestone ready to close)** **This route is only reached when:** - `is_last_phase: true` AND no other active workstreams exist (or flat mode) diff --git a/src/phase.cts b/src/phase.cts index cf20e1004..e5f98be9d 100644 --- a/src/phase.cts +++ b/src/phase.cts @@ -2090,7 +2090,7 @@ function cmdPhaseComplete(cwd: string, phaseNum: string, raw: boolean): void { } } - // #2028: don't stamp "Milestone complete" when a LOWER-numbered phase is + // #2028: don't stamp "All phases complete" when a LOWER-numbered phase is // still outstanding. The two blocks above only clear isLastPhase when a // HIGHER-numbered phase exists, so completing the numerically-highest phase // out of order (e.g. Phase 10 before Phase 9) wrongly read as milestone-end. diff --git a/src/state-transition.cts b/src/state-transition.cts index 4b82c9156..8a482597e 100644 --- a/src/state-transition.cts +++ b/src/state-transition.cts @@ -816,8 +816,8 @@ function advancePlanCore(content: string, deps: StateTransitionDeps): StateTrans * Migrates the inline STATE.md transform that lived inside `cmdPhaseComplete` * (phase.cts) onto the substrate. Owns the field-classification-governed body * mutations: Current Phase (preserving the `of total` shape and phase name), - * Current Phase Name, Status (`Milestone complete` on the last phase, else - * `Ready to plan`), Current Plan (`Not started`), Last Activity + Description, + * Current Phase Name, Status (`All phases complete` on the last phase, else + * `Ready to plan` per ADR-2207), Current Plan (`Not started`), Last Activity + Description, * and the Completed/Total Phases + Progress percent block (re-derived from the * roadmap via the injected `roadmapProvider`). * @@ -917,8 +917,10 @@ function completePhaseCore( } } - // Status — `Milestone complete` on the final phase, otherwise `Ready to plan`. - const statusValue = intent.isLastPhase ? 'Milestone complete' : 'Ready to plan'; + // Status — `All phases complete` on the final phase (ADR-2207), otherwise + // `Ready to plan`. Milestone termination (` milestone complete`) is + // owned solely by the milestone-close verb (milestoneCompleteCore). + const statusValue = intent.isLastPhase ? 'All phases complete' : 'Ready to plan'; const statusAfter = stateReplaceFieldWithFallback(body, 'Status', null, statusValue); if (statusAfter !== body) { body = statusAfter; diff --git a/tests/fixtures/golden-install-parity/antigravity.json b/tests/fixtures/golden-install-parity/antigravity.json index b4af36875..4f7bdba20 100644 --- a/tests/fixtures/golden-install-parity/antigravity.json +++ b/tests/fixtures/golden-install-parity/antigravity.json @@ -279,7 +279,7 @@ "gsd-core/workflows/plant-seed.md": "6cf726be6427a35a", "gsd-core/workflows/pr-branch.md": "dc5598ae8accdecd", "gsd-core/workflows/profile-user.md": "355af92ac285567f", - "gsd-core/workflows/progress.md": "79a11ce798082054", + "gsd-core/workflows/progress.md": "4f0c285ce35553e3", "gsd-core/workflows/quick.md": "424c0eb61769e747", "gsd-core/workflows/reapply-patches.md": "4dcd6117d0a507ca", "gsd-core/workflows/remove-phase.md": "23b9eb0858a2535e", @@ -302,7 +302,7 @@ "gsd-core/workflows/stats.md": "b64bda5c0a1a06fb", "gsd-core/workflows/sync-skills.md": "8326a7ff0411b077", "gsd-core/workflows/thread.md": "31201839d0530e89", - "gsd-core/workflows/transition.md": "3eb5edaa5c95c0de", + "gsd-core/workflows/transition.md": "d3486f115d808175", "gsd-core/workflows/ui-phase.md": "be51b5f5229ac856", "gsd-core/workflows/ui-review.md": "ba558aaf1ad9f58d", "gsd-core/workflows/ultraplan-phase.md": "d8e92b0b7214eba6", @@ -328,7 +328,7 @@ "hooks/gsd-read-guard.js": "9e423cd03e2d1b16", "hooks/gsd-read-injection-scanner.js": "eefea61f9b0e464c", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "25996df685a0dac9", + "hooks/gsd-statusline.js": "8ae31be7a006204b", "hooks/gsd-update-banner.js": "55143a25f978f301", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/augment.json b/tests/fixtures/golden-install-parity/augment.json index 7a3f2f0b4..5cef0a97c 100644 --- a/tests/fixtures/golden-install-parity/augment.json +++ b/tests/fixtures/golden-install-parity/augment.json @@ -350,7 +350,7 @@ "gsd-core/workflows/plant-seed.md": "10b92ae08a6fdede", "gsd-core/workflows/pr-branch.md": "c87db7ac8c28be1b", "gsd-core/workflows/profile-user.md": "14263db831230142", - "gsd-core/workflows/progress.md": "893aa3c36983f74b", + "gsd-core/workflows/progress.md": "281a77e800d11614", "gsd-core/workflows/quick.md": "25f0cc40bc22ed3e", "gsd-core/workflows/reapply-patches.md": "39050f72601aec89", "gsd-core/workflows/remove-phase.md": "df9a45f0b1880999", @@ -373,7 +373,7 @@ "gsd-core/workflows/stats.md": "76a42cbeaf6007c2", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "927e7eeefd2fcf5c", - "gsd-core/workflows/transition.md": "cb8ec5affb7ebba1", + "gsd-core/workflows/transition.md": "aea486bb7a0e80e7", "gsd-core/workflows/ui-phase.md": "0ae35f603071630e", "gsd-core/workflows/ui-review.md": "7acfc485526d064b", "gsd-core/workflows/ultraplan-phase.md": "0fb8291153e3937d", @@ -399,7 +399,7 @@ "hooks/gsd-read-guard.js": "9e423cd03e2d1b16", "hooks/gsd-read-injection-scanner.js": "c8800819f7443a15", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "2fab68f4fd190331", + "hooks/gsd-statusline.js": "3be32d2012c77fc1", "hooks/gsd-update-banner.js": "55143a25f978f301", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/claude.json b/tests/fixtures/golden-install-parity/claude.json index afadae2e0..fa01eae3f 100644 --- a/tests/fixtures/golden-install-parity/claude.json +++ b/tests/fixtures/golden-install-parity/claude.json @@ -278,7 +278,7 @@ "gsd-core/workflows/plant-seed.md": "af50e9f10d3cc6e1", "gsd-core/workflows/pr-branch.md": "ab157cd8e49621dd", "gsd-core/workflows/profile-user.md": "ff3820a27731ceb8", - "gsd-core/workflows/progress.md": "bd1ecf9207331bda", + "gsd-core/workflows/progress.md": "5ce5a11b468bd419", "gsd-core/workflows/quick.md": "b4237633eaf5a246", "gsd-core/workflows/reapply-patches.md": "ba9406b60f2c4041", "gsd-core/workflows/remove-phase.md": "ada8a0546c686483", @@ -301,7 +301,7 @@ "gsd-core/workflows/stats.md": "e7852c5d8f2b05a9", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "3b2c560d7189576d", - "gsd-core/workflows/transition.md": "f6731bbb766929e7", + "gsd-core/workflows/transition.md": "fb35a3de7feaa056", "gsd-core/workflows/ui-phase.md": "05eb644af3a15516", "gsd-core/workflows/ui-review.md": "7b488a7486a6b7cf", "gsd-core/workflows/ultraplan-phase.md": "328664400a001fd5", @@ -327,7 +327,7 @@ "hooks/gsd-read-guard.js": "9e423cd03e2d1b16", "hooks/gsd-read-injection-scanner.js": "00d2449afefd2e5f", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "4ad7c2f59577c5bc", + "hooks/gsd-statusline.js": "7c315416ffc99a9a", "hooks/gsd-update-banner.js": "b457746cb76c1957", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/cline.json b/tests/fixtures/golden-install-parity/cline.json index 9f44fd2ec..83776639e 100644 --- a/tests/fixtures/golden-install-parity/cline.json +++ b/tests/fixtures/golden-install-parity/cline.json @@ -282,7 +282,7 @@ "gsd-core/workflows/plant-seed.md": "a2cdd513663226f1", "gsd-core/workflows/pr-branch.md": "9923878a4f6a2d91", "gsd-core/workflows/profile-user.md": "26f74db0a7fcd268", - "gsd-core/workflows/progress.md": "9f326d63afb4b76b", + "gsd-core/workflows/progress.md": "c5ce768042ca9b8b", "gsd-core/workflows/quick.md": "797b1c8d62c3d33d", "gsd-core/workflows/reapply-patches.md": "eb4272145a117904", "gsd-core/workflows/remove-phase.md": "e336350f8113a328", @@ -305,7 +305,7 @@ "gsd-core/workflows/stats.md": "f9241bb65770c5a4", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "d71b1e815925c5cc", - "gsd-core/workflows/transition.md": "b9e41eb751375faf", + "gsd-core/workflows/transition.md": "6fa9751b097a3f52", "gsd-core/workflows/ui-phase.md": "c7e6a2ab78e74c1b", "gsd-core/workflows/ui-review.md": "8cd9605add21301e", "gsd-core/workflows/ultraplan-phase.md": "ceff456b1e9d94d8", diff --git a/tests/fixtures/golden-install-parity/codebuddy.json b/tests/fixtures/golden-install-parity/codebuddy.json index cce115927..67cea98b8 100644 --- a/tests/fixtures/golden-install-parity/codebuddy.json +++ b/tests/fixtures/golden-install-parity/codebuddy.json @@ -350,7 +350,7 @@ "gsd-core/workflows/plant-seed.md": "10b92ae08a6fdede", "gsd-core/workflows/pr-branch.md": "c87db7ac8c28be1b", "gsd-core/workflows/profile-user.md": "4fa910d15dea5695", - "gsd-core/workflows/progress.md": "893aa3c36983f74b", + "gsd-core/workflows/progress.md": "281a77e800d11614", "gsd-core/workflows/quick.md": "0bd83bd88c5e63d1", "gsd-core/workflows/reapply-patches.md": "39050f72601aec89", "gsd-core/workflows/remove-phase.md": "df9a45f0b1880999", @@ -373,7 +373,7 @@ "gsd-core/workflows/stats.md": "76a42cbeaf6007c2", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "927e7eeefd2fcf5c", - "gsd-core/workflows/transition.md": "cb8ec5affb7ebba1", + "gsd-core/workflows/transition.md": "aea486bb7a0e80e7", "gsd-core/workflows/ui-phase.md": "e4bef31fd9389c63", "gsd-core/workflows/ui-review.md": "7acfc485526d064b", "gsd-core/workflows/ultraplan-phase.md": "0fb8291153e3937d", @@ -399,7 +399,7 @@ "hooks/gsd-read-guard.js": "9e423cd03e2d1b16", "hooks/gsd-read-injection-scanner.js": "7f7a7615b303369a", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "29cdce15038d1ab1", + "hooks/gsd-statusline.js": "ef8dcb6d64fd4493", "hooks/gsd-update-banner.js": "55143a25f978f301", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/codex.json b/tests/fixtures/golden-install-parity/codex.json index 35bd639ab..d74671302 100644 --- a/tests/fixtures/golden-install-parity/codex.json +++ b/tests/fixtures/golden-install-parity/codex.json @@ -385,7 +385,7 @@ "gsd-core/workflows/plant-seed.md": "5b07de07e4593281", "gsd-core/workflows/pr-branch.md": "d13e1cc81de40896", "gsd-core/workflows/profile-user.md": "05828c8cc61ef384", - "gsd-core/workflows/progress.md": "7bedc431bb55edb8", + "gsd-core/workflows/progress.md": "7ec6495e273904cf", "gsd-core/workflows/quick.md": "bf70b7beb314aa50", "gsd-core/workflows/reapply-patches.md": "26297b84736e66a4", "gsd-core/workflows/remove-phase.md": "9ee0fddd11a0d9d4", @@ -408,7 +408,7 @@ "gsd-core/workflows/stats.md": "6dfc500555849d74", "gsd-core/workflows/sync-skills.md": "e2b793963799f8ce", "gsd-core/workflows/thread.md": "3eef3b6baf50fbfa", - "gsd-core/workflows/transition.md": "423d12e392f5cb87", + "gsd-core/workflows/transition.md": "de3c63b3f62e6988", "gsd-core/workflows/ui-phase.md": "989eefe25c06ae48", "gsd-core/workflows/ui-review.md": "5768b7aac1429ea0", "gsd-core/workflows/ultraplan-phase.md": "0bafc2af27be4591", diff --git a/tests/fixtures/golden-install-parity/copilot.json b/tests/fixtures/golden-install-parity/copilot.json index 37c73dd09..786aa3692 100644 --- a/tests/fixtures/golden-install-parity/copilot.json +++ b/tests/fixtures/golden-install-parity/copilot.json @@ -280,7 +280,7 @@ "gsd-core/workflows/plant-seed.md": "21e461cd39e5181b", "gsd-core/workflows/pr-branch.md": "2833905f119b5722", "gsd-core/workflows/profile-user.md": "5cc032206c99ef71", - "gsd-core/workflows/progress.md": "6b9a84a43dc55af5", + "gsd-core/workflows/progress.md": "9bd7472d2efe14dd", "gsd-core/workflows/quick.md": "4a53899b69b8c801", "gsd-core/workflows/reapply-patches.md": "8fd59e24b486f180", "gsd-core/workflows/remove-phase.md": "e262654e319d1bc4", @@ -303,7 +303,7 @@ "gsd-core/workflows/stats.md": "1db01bd96aa570fe", "gsd-core/workflows/sync-skills.md": "eca50ffe8320dba8", "gsd-core/workflows/thread.md": "c5cbd66223906998", - "gsd-core/workflows/transition.md": "0bb671f58f9522f3", + "gsd-core/workflows/transition.md": "9219cd7c61e3323f", "gsd-core/workflows/ui-phase.md": "646b99f22a6e4762", "gsd-core/workflows/ui-review.md": "2851b3576894ee75", "gsd-core/workflows/ultraplan-phase.md": "7217c34dc9eaf7bb", diff --git a/tests/fixtures/golden-install-parity/cursor.json b/tests/fixtures/golden-install-parity/cursor.json index 33392e4bf..a84a6b74d 100644 --- a/tests/fixtures/golden-install-parity/cursor.json +++ b/tests/fixtures/golden-install-parity/cursor.json @@ -350,7 +350,7 @@ "gsd-core/workflows/plant-seed.md": "7bccd151ce7b69f2", "gsd-core/workflows/pr-branch.md": "c67d90c65da47168", "gsd-core/workflows/profile-user.md": "8c943983241260b5", - "gsd-core/workflows/progress.md": "65aabee5e8a6dd82", + "gsd-core/workflows/progress.md": "a980339715a431f0", "gsd-core/workflows/quick.md": "3b37350964cfe391", "gsd-core/workflows/reapply-patches.md": "ba9406b60f2c4041", "gsd-core/workflows/remove-phase.md": "ada8a0546c686483", @@ -373,7 +373,7 @@ "gsd-core/workflows/stats.md": "e7852c5d8f2b05a9", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "bf9a944978dad763", - "gsd-core/workflows/transition.md": "f6731bbb766929e7", + "gsd-core/workflows/transition.md": "fb35a3de7feaa056", "gsd-core/workflows/ui-phase.md": "d1ae54a7ba413d69", "gsd-core/workflows/ui-review.md": "4bc0fd55fc037998", "gsd-core/workflows/ultraplan-phase.md": "466e01d65c350ef6", diff --git a/tests/fixtures/golden-install-parity/hermes.json b/tests/fixtures/golden-install-parity/hermes.json index a4ef83259..39b171e49 100644 --- a/tests/fixtures/golden-install-parity/hermes.json +++ b/tests/fixtures/golden-install-parity/hermes.json @@ -279,7 +279,7 @@ "gsd-core/workflows/plant-seed.md": "f862f77fca983749", "gsd-core/workflows/pr-branch.md": "ecabd55e4eabf229", "gsd-core/workflows/profile-user.md": "de5030437226cf2c", - "gsd-core/workflows/progress.md": "f18db000584d9cb1", + "gsd-core/workflows/progress.md": "2641aa5457ab784f", "gsd-core/workflows/quick.md": "731c20b5605bd319", "gsd-core/workflows/reapply-patches.md": "158083a310859594", "gsd-core/workflows/remove-phase.md": "fce799aae3ab2715", @@ -302,7 +302,7 @@ "gsd-core/workflows/stats.md": "49a991d0d3905a56", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "5a6759e01763c2a6", - "gsd-core/workflows/transition.md": "2f65c0e12675ea08", + "gsd-core/workflows/transition.md": "bcfaad44668d07fd", "gsd-core/workflows/ui-phase.md": "a45a9409c26699f4", "gsd-core/workflows/ui-review.md": "bc0ae72c0e1cab94", "gsd-core/workflows/ultraplan-phase.md": "0d103bf2622436f7", @@ -328,7 +328,7 @@ "hooks/gsd-read-guard.js": "1f58b020a91f032b", "hooks/gsd-read-injection-scanner.js": "f358eca3fa1eab24", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "884347ccd6549f29", + "hooks/gsd-statusline.js": "861808560e60b233", "hooks/gsd-update-banner.js": "b457746cb76c1957", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/kilo.json b/tests/fixtures/golden-install-parity/kilo.json index e08e30b15..c882325a9 100644 --- a/tests/fixtures/golden-install-parity/kilo.json +++ b/tests/fixtures/golden-install-parity/kilo.json @@ -350,7 +350,7 @@ "gsd-core/workflows/plant-seed.md": "ffa5774304243649", "gsd-core/workflows/pr-branch.md": "ab157cd8e49621dd", "gsd-core/workflows/profile-user.md": "203ebe3f8f3876a8", - "gsd-core/workflows/progress.md": "9381c59676ccb937", + "gsd-core/workflows/progress.md": "fb1ea7476a839fd8", "gsd-core/workflows/quick.md": "4ddd6d3214f57f57", "gsd-core/workflows/reapply-patches.md": "becf9728cdb124c4", "gsd-core/workflows/remove-phase.md": "ada8a0546c686483", @@ -373,7 +373,7 @@ "gsd-core/workflows/stats.md": "e7852c5d8f2b05a9", "gsd-core/workflows/sync-skills.md": "dc7b8b015afa4b3b", "gsd-core/workflows/thread.md": "3b2c560d7189576d", - "gsd-core/workflows/transition.md": "caf7616dc597ad86", + "gsd-core/workflows/transition.md": "590128488fe2ad66", "gsd-core/workflows/ui-phase.md": "47ae6541bbfdf2b6", "gsd-core/workflows/ui-review.md": "0fb289914252d53e", "gsd-core/workflows/ultraplan-phase.md": "29245758b8497fa0", diff --git a/tests/fixtures/golden-install-parity/kimi.json b/tests/fixtures/golden-install-parity/kimi.json index 178351d3e..5ae55a77b 100644 --- a/tests/fixtures/golden-install-parity/kimi.json +++ b/tests/fixtures/golden-install-parity/kimi.json @@ -18,7 +18,7 @@ ".kimi/hooks/gsd-read-guard.js": "9e423cd03e2d1b16", ".kimi/hooks/gsd-read-injection-scanner.js": "c519598b9257aafa", ".kimi/hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - ".kimi/hooks/gsd-statusline.js": "be35341758d50fa5", + ".kimi/hooks/gsd-statusline.js": "2736b0885aa97bbf", ".kimi/hooks/gsd-update-banner.js": "55143a25f978f301", ".kimi/hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", ".kimi/hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", @@ -343,7 +343,7 @@ "gsd-core/workflows/plant-seed.md": "10b92ae08a6fdede", "gsd-core/workflows/pr-branch.md": "c87db7ac8c28be1b", "gsd-core/workflows/profile-user.md": "5abfae83739fa978", - "gsd-core/workflows/progress.md": "893aa3c36983f74b", + "gsd-core/workflows/progress.md": "281a77e800d11614", "gsd-core/workflows/quick.md": "8dcda37c46954ebe", "gsd-core/workflows/reapply-patches.md": "39050f72601aec89", "gsd-core/workflows/remove-phase.md": "df9a45f0b1880999", @@ -366,7 +366,7 @@ "gsd-core/workflows/stats.md": "76a42cbeaf6007c2", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "927e7eeefd2fcf5c", - "gsd-core/workflows/transition.md": "cb8ec5affb7ebba1", + "gsd-core/workflows/transition.md": "aea486bb7a0e80e7", "gsd-core/workflows/ui-phase.md": "d02054ab9f01abb4", "gsd-core/workflows/ui-review.md": "7acfc485526d064b", "gsd-core/workflows/ultraplan-phase.md": "0fb8291153e3937d", diff --git a/tests/fixtures/golden-install-parity/opencode.json b/tests/fixtures/golden-install-parity/opencode.json index 26ddd926c..954ead1cb 100644 --- a/tests/fixtures/golden-install-parity/opencode.json +++ b/tests/fixtures/golden-install-parity/opencode.json @@ -350,7 +350,7 @@ "gsd-core/workflows/plant-seed.md": "b8dad652e31c2318", "gsd-core/workflows/pr-branch.md": "929b7cb0c99c7b9e", "gsd-core/workflows/profile-user.md": "248d59a31948e0ed", - "gsd-core/workflows/progress.md": "8fc3404087f50b95", + "gsd-core/workflows/progress.md": "8e01238a8ac6b73d", "gsd-core/workflows/quick.md": "774d646560a74c93", "gsd-core/workflows/reapply-patches.md": "a0e9b53f90abceb2", "gsd-core/workflows/remove-phase.md": "dea4661e8f89596f", @@ -373,7 +373,7 @@ "gsd-core/workflows/stats.md": "846cd2808461ccdc", "gsd-core/workflows/sync-skills.md": "7e2c138cdbef4282", "gsd-core/workflows/thread.md": "82652edb1883af59", - "gsd-core/workflows/transition.md": "a66f117fad29d65a", + "gsd-core/workflows/transition.md": "372b6fc7c0c68a89", "gsd-core/workflows/ui-phase.md": "4d11cc725ebfe597", "gsd-core/workflows/ui-review.md": "149f39373eee5c92", "gsd-core/workflows/ultraplan-phase.md": "f4bad8de3fdb49fa", @@ -399,7 +399,7 @@ "hooks/gsd-read-guard.js": "9e423cd03e2d1b16", "hooks/gsd-read-injection-scanner.js": "f72060dfe035f706", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "6fcb59ad86d2d0ea", + "hooks/gsd-statusline.js": "9c132b5985800462", "hooks/gsd-update-banner.js": "55143a25f978f301", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/pi.json b/tests/fixtures/golden-install-parity/pi.json index 7408f056a..0289b032f 100644 --- a/tests/fixtures/golden-install-parity/pi.json +++ b/tests/fixtures/golden-install-parity/pi.json @@ -246,7 +246,7 @@ "gsd-core/workflows/plant-seed.md": "10b92ae08a6fdede", "gsd-core/workflows/pr-branch.md": "c87db7ac8c28be1b", "gsd-core/workflows/profile-user.md": "1bac7f69142801ef", - "gsd-core/workflows/progress.md": "893aa3c36983f74b", + "gsd-core/workflows/progress.md": "281a77e800d11614", "gsd-core/workflows/quick.md": "31787c1e8a867e3f", "gsd-core/workflows/reapply-patches.md": "39050f72601aec89", "gsd-core/workflows/remove-phase.md": "df9a45f0b1880999", @@ -269,7 +269,7 @@ "gsd-core/workflows/stats.md": "76a42cbeaf6007c2", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "927e7eeefd2fcf5c", - "gsd-core/workflows/transition.md": "cb8ec5affb7ebba1", + "gsd-core/workflows/transition.md": "aea486bb7a0e80e7", "gsd-core/workflows/ui-phase.md": "d77fa19403a4684b", "gsd-core/workflows/ui-review.md": "7acfc485526d064b", "gsd-core/workflows/ultraplan-phase.md": "0fb8291153e3937d", @@ -295,7 +295,7 @@ "hooks/gsd-read-guard.js": "9e423cd03e2d1b16", "hooks/gsd-read-injection-scanner.js": "f454242c010804cf", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "daa1a98fde95ccaf", + "hooks/gsd-statusline.js": "5539e1ae859b987e", "hooks/gsd-update-banner.js": "55143a25f978f301", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/qwen.json b/tests/fixtures/golden-install-parity/qwen.json index cb2b3b7a6..02d2472c4 100644 --- a/tests/fixtures/golden-install-parity/qwen.json +++ b/tests/fixtures/golden-install-parity/qwen.json @@ -279,7 +279,7 @@ "gsd-core/workflows/plant-seed.md": "0a92ba12993ac261", "gsd-core/workflows/pr-branch.md": "cef0f65b16d500b4", "gsd-core/workflows/profile-user.md": "263c0693563d98da", - "gsd-core/workflows/progress.md": "3b1b2142a74af85c", + "gsd-core/workflows/progress.md": "b1b3f88614d6b9cc", "gsd-core/workflows/quick.md": "d0fffe516abaf47a", "gsd-core/workflows/reapply-patches.md": "de0ee8acfe7245b2", "gsd-core/workflows/remove-phase.md": "e8ae4fbbfac700f0", @@ -302,7 +302,7 @@ "gsd-core/workflows/stats.md": "89a08155b92f4a2d", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "f24b6454c69d064a", - "gsd-core/workflows/transition.md": "9c615db5686219d0", + "gsd-core/workflows/transition.md": "a30cba2ad6920641", "gsd-core/workflows/ui-phase.md": "041cb6bcb496881d", "gsd-core/workflows/ui-review.md": "8b989f372684851f", "gsd-core/workflows/ultraplan-phase.md": "49921383982474e0", @@ -328,7 +328,7 @@ "hooks/gsd-read-guard.js": "2c8d417d12b51040", "hooks/gsd-read-injection-scanner.js": "396574bd25e99ff9", "hooks/gsd-session-state.sh": "e54379ba86bf1b6d", - "hooks/gsd-statusline.js": "2541196849ec5ffc", + "hooks/gsd-statusline.js": "739140996a3c0d49", "hooks/gsd-update-banner.js": "b457746cb76c1957", "hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38", "hooks/gsd-windsurf-pre-command.js": "948be1c6d14c79cd", diff --git a/tests/fixtures/golden-install-parity/trae.json b/tests/fixtures/golden-install-parity/trae.json index 4bc108286..60287415a 100644 --- a/tests/fixtures/golden-install-parity/trae.json +++ b/tests/fixtures/golden-install-parity/trae.json @@ -279,7 +279,7 @@ "gsd-core/workflows/plant-seed.md": "856ad565b2eb0c47", "gsd-core/workflows/pr-branch.md": "79fd55b88ea2db9c", "gsd-core/workflows/profile-user.md": "672821e6b1266645", - "gsd-core/workflows/progress.md": "94768f835b0b8908", + "gsd-core/workflows/progress.md": "e7d05715aff75881", "gsd-core/workflows/quick.md": "0529abcf9913ec04", "gsd-core/workflows/reapply-patches.md": "21b38c374f19fd78", "gsd-core/workflows/remove-phase.md": "a46c2fe853bf4e86", @@ -302,7 +302,7 @@ "gsd-core/workflows/stats.md": "e4f84542fb5721ef", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "0582c6be8a78bbd8", - "gsd-core/workflows/transition.md": "163d220813b0835f", + "gsd-core/workflows/transition.md": "45dc17cc631dc485", "gsd-core/workflows/ui-phase.md": "0c4c1a26a4297ac3", "gsd-core/workflows/ui-review.md": "4e70afbfd5601853", "gsd-core/workflows/ultraplan-phase.md": "77b58ef8af5209bd", diff --git a/tests/fixtures/golden-install-parity/windsurf.json b/tests/fixtures/golden-install-parity/windsurf.json index d1e164ce6..b06e0b1bf 100644 --- a/tests/fixtures/golden-install-parity/windsurf.json +++ b/tests/fixtures/golden-install-parity/windsurf.json @@ -279,7 +279,7 @@ "gsd-core/workflows/plant-seed.md": "6cf61f540cdbd8b9", "gsd-core/workflows/pr-branch.md": "acd59f915d018ad4", "gsd-core/workflows/profile-user.md": "c4313672b81b5bcd", - "gsd-core/workflows/progress.md": "18813a345bd2343a", + "gsd-core/workflows/progress.md": "d4a4f96975419d09", "gsd-core/workflows/quick.md": "71fbcf38e2305de0", "gsd-core/workflows/reapply-patches.md": "d449a23d3acf6379", "gsd-core/workflows/remove-phase.md": "e7a6af429b36e77b", @@ -302,7 +302,7 @@ "gsd-core/workflows/stats.md": "d58325fc3fb8d1b6", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "d83a0d0bd0f94c4c", - "gsd-core/workflows/transition.md": "1bd8a772f0aac5ba", + "gsd-core/workflows/transition.md": "5e2c96544e9981ed", "gsd-core/workflows/ui-phase.md": "829285b180dd7b9e", "gsd-core/workflows/ui-review.md": "dca8100a43161ea7", "gsd-core/workflows/ultraplan-phase.md": "53b77a8edf60acd0", diff --git a/tests/fixtures/golden-install-parity/zcode.json b/tests/fixtures/golden-install-parity/zcode.json index 51e2621bf..2447b7cd8 100644 --- a/tests/fixtures/golden-install-parity/zcode.json +++ b/tests/fixtures/golden-install-parity/zcode.json @@ -350,7 +350,7 @@ "gsd-core/workflows/plant-seed.md": "10b92ae08a6fdede", "gsd-core/workflows/pr-branch.md": "c87db7ac8c28be1b", "gsd-core/workflows/profile-user.md": "e23bea0a69c0bb4b", - "gsd-core/workflows/progress.md": "893aa3c36983f74b", + "gsd-core/workflows/progress.md": "281a77e800d11614", "gsd-core/workflows/quick.md": "7ad8d250c536c4dd", "gsd-core/workflows/reapply-patches.md": "39050f72601aec89", "gsd-core/workflows/remove-phase.md": "df9a45f0b1880999", @@ -373,7 +373,7 @@ "gsd-core/workflows/stats.md": "76a42cbeaf6007c2", "gsd-core/workflows/sync-skills.md": "b505e6f8331c0918", "gsd-core/workflows/thread.md": "927e7eeefd2fcf5c", - "gsd-core/workflows/transition.md": "cb8ec5affb7ebba1", + "gsd-core/workflows/transition.md": "aea486bb7a0e80e7", "gsd-core/workflows/ui-phase.md": "98d044ed4d7163d7", "gsd-core/workflows/ui-review.md": "7acfc485526d064b", "gsd-core/workflows/ultraplan-phase.md": "0fb8291153e3937d", diff --git a/tests/phase.test.cjs b/tests/phase.test.cjs index 1baf5dd36..fb884528f 100644 --- a/tests/phase.test.cjs +++ b/tests/phase.test.cjs @@ -2940,7 +2940,7 @@ describe('phase complete command', () => { assert.strictEqual(output.next_phase, null, 'no next phase'); const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); - assert.ok(state.includes('Milestone complete'), 'status should be milestone complete'); + assert.ok(state.includes('All phases complete'), 'status should be All phases complete'); }); // #1591: when the active milestone's phase checklist is wrapped in a @@ -3031,8 +3031,8 @@ describe('phase complete command', () => { // still in progress. const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); assert.ok( - !/Milestone complete/i.test(state), - 'a mid-milestone phase must not flip STATE.md to "Milestone complete" (#1591)', + !/Milestone complete|All phases complete/i.test(state), + 'a mid-milestone phase must not flip STATE.md to milestone-complete (#1591)', ); }); @@ -3101,8 +3101,8 @@ describe('phase complete command', () => { const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); assert.ok( - !/Milestone complete/i.test(state), - 'a mid-milestone phase must not flip STATE.md to "Milestone complete" — bold checklist (#1591)', + !/Milestone complete|All phases complete/i.test(state), + 'a mid-milestone phase must not flip STATE.md to milestone-complete — bold checklist (#1591)', ); }); @@ -3182,8 +3182,8 @@ describe('phase complete command', () => { const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); assert.ok( - !/Milestone complete/i.test(state), - 'a mid-milestone phase must not flip STATE.md to "Milestone complete" (#1752)', + !/Milestone complete|All phases complete/i.test(state), + 'a mid-milestone phase must not flip STATE.md to milestone-complete (#1752)', ); const tpMatch = state.match(/total_phases:\s*(\d+)/); assert.ok(tpMatch, 'STATE.md must carry a total_phases value after phase.complete'); @@ -3747,7 +3747,7 @@ describe('phase complete command', () => { assert.ok(result.success, `Command failed: ${result.error}`); const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); - assert.ok(state.includes('Milestone complete'), 'plain Status field should be updated'); + assert.ok(state.includes('All phases complete'), 'plain Status field should be updated'); assert.ok(state.includes('Not started'), 'plain Plan field should be updated'); // Verify compound format preserved assert.ok(state.match(/Phase:.*of\s+1/), 'should preserve "of N" in compound Phase format'); @@ -4169,7 +4169,7 @@ describe('#2028 — phase complete milestone-end + workstream guard', () => { // A complement phase numbered AFTER Phase 9 but executed first. Completing the // numerically-highest phase must not read as milestone-end while a lower phase // is still outstanding (the isLastPhase blocks only checked for HIGHER phases). - test('does NOT stamp "Milestone complete" when a lower-numbered phase is still outstanding', () => { + test('does NOT stamp "All phases complete" when a lower-numbered phase is still outstanding', () => { fs.writeFileSync( path.join(tmpDir, '.planning', 'ROADMAP.md'), `# Roadmap\n\n- [ ] Phase 9: Introspection\n- [ ] Phase 10: Complement\n\n### Phase 9: Introspection\n**Goal:** baseline\n\n### Phase 10: Complement\n**Goal:** complement\n` @@ -4198,8 +4198,8 @@ describe('#2028 — phase complete milestone-end + workstream guard', () => { const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); assert.ok( - !/Milestone complete/i.test(state), - 'STATE.md must NOT flip to "Milestone complete" while a lower phase is outstanding', + !/Milestone complete|All phases complete/i.test(state), + 'STATE.md must NOT flip to milestone-complete while a lower phase is outstanding', ); assert.ok(/Ready to plan/i.test(state), 'status should be "Ready to plan"'); assert.match( @@ -4236,7 +4236,7 @@ describe('#2028 — phase complete milestone-end + workstream guard', () => { const output = JSON.parse(result.output); assert.strictEqual(output.is_last_phase, true, 'all lower phases complete → Phase 10 is milestone-end'); const state = fs.readFileSync(path.join(tmpDir, '.planning', 'STATE.md'), 'utf-8'); - assert.ok(/Milestone complete/i.test(state), 'status should be "Milestone complete"'); + assert.ok(/All phases complete/i.test(state), 'status should be "All phases complete"'); }); // The lower-phase scan must not treat an unrelated checklist line that merely @@ -4318,9 +4318,9 @@ describe('#2028 — phase complete milestone-end + workstream guard', () => { rootState, 'root STATE.md must NOT be written when --ws targets a workstream', ); - // The workstream's own STATE.md advanced (single phase → milestone complete). + // The workstream's own STATE.md advanced (single phase → all phases complete). const wsState = fs.readFileSync(path.join(wsDir, 'STATE.md'), 'utf-8'); - assert.match(wsState, /Milestone complete/i, "the workstream's STATE.md should be the one updated"); + assert.match(wsState, /All phases complete/i, "the workstream's STATE.md should be the one updated"); }); // The guard only fires in workstream mode — a flat project (no workstreams dir) diff --git a/tests/state-transition.test.cjs b/tests/state-transition.test.cjs index 6a69bd803..657669fcd 100644 --- a/tests/state-transition.test.cjs +++ b/tests/state-transition.test.cjs @@ -604,13 +604,13 @@ describe('ADR-1769 Phase 3: completePhase transition — body field updates', () assert.strictEqual(stateExtractField(result.content, 'Status'), 'Ready to plan'); }); - test('Status becomes "Milestone complete" when isLastPhase is true', () => { + test('Status becomes "All phases complete" when isLastPhase is true', () => { const result = transitionCore( completePhaseBody(), { kind: 'completePhase', phaseNum: '5', nextPhaseNum: null, nextPhaseName: null, isLastPhase: true, planCount: 2, summaryCount: 2 }, deps, ); - assert.strictEqual(stateExtractField(result.content, 'Status'), 'Milestone complete'); + assert.strictEqual(stateExtractField(result.content, 'Status'), 'All phases complete'); }); test('Current Plan resets to "Not started"', () => { diff --git a/tests/state.test.cjs b/tests/state.test.cjs index e1dd36043..028c2a33c 100644 --- a/tests/state.test.cjs +++ b/tests/state.test.cjs @@ -498,6 +498,7 @@ stopped_at: Plan 2 of Phase 3 { input: 'Ready to plan', expected: 'planning' }, { input: 'Phase complete — ready for verification', expected: 'verifying' }, { input: 'Milestone complete', expected: 'completed' }, + { input: 'All phases complete', expected: 'completed' }, ]; for (const { input, expected } of statusTests) { @@ -2053,7 +2054,7 @@ describe('progress counters correct after plan execution (#1589)', () => { ); // Trigger a STATE.md write (e.g. state update Status) - const result = runGsdTools('state update Status "Milestone complete"', tmpDir); + const result = runGsdTools('state update Status "All phases complete"', tmpDir); assert.ok(result.success, `Command failed: ${result.error}`); // Read the frontmatter — percent must be derived from disk (4/4 = 100%), not from body "0%" @@ -2296,7 +2297,7 @@ describe('updatePerformanceMetricsSection', () => { const afterFirst = fs.readFileSync(statePath, 'utf-8'); // Reset state so we can complete again - let resetContent = afterFirst.replace(/Milestone complete|Ready to plan/, 'Executing Phase 5'); + let resetContent = afterFirst.replace(/All phases complete|Ready to plan/, 'Executing Phase 5'); resetContent = resetContent.replace(/Not started/, '1'); fs.writeFileSync(statePath, resetContent); diff --git a/tests/workflow-size-baseline.json b/tests/workflow-size-baseline.json index 1a7d4662f..4be6332e7 100644 --- a/tests/workflow-size-baseline.json +++ b/tests/workflow-size-baseline.json @@ -58,7 +58,7 @@ "plant-seed.md": 11785, "pr-branch.md": 15963, "profile-user.md": 21246, - "progress.md": 30599, + "progress.md": 30628, "quick.md": 50699, "reapply-patches.md": 20312, "remove-phase.md": 8513, @@ -81,7 +81,7 @@ "stats.md": 6762, "sync-skills.md": 6125, "thread.md": 12508, - "transition.md": 22060, + "transition.md": 22070, "ui-phase.md": 26054, "ui-review.md": 11216, "ultraplan-phase.md": 10512, diff --git a/tests/workstream-inventory.test.cjs b/tests/workstream-inventory.test.cjs index 20d6e9c6c..d2d5fd56b 100644 --- a/tests/workstream-inventory.test.cjs +++ b/tests/workstream-inventory.test.cjs @@ -11,7 +11,7 @@ const fs = require('fs'); const path = require('path'); const { cleanup } = require('./helpers.cjs'); const { createFixture, seedWorkstream } = require('./fixtures/index.cjs'); -const { buildWorkstreamInventory } = require('../gsd-core/bin/lib/workstream-inventory-builder.cjs'); +const { buildWorkstreamInventory, isCompletedInventory } = require('../gsd-core/bin/lib/workstream-inventory-builder.cjs'); const { inspectWorkstream } = require('../gsd-core/bin/lib/workstream-inventory.cjs'); const STALE_STATE = 'status: executing\n'; @@ -101,3 +101,26 @@ describe('#1913 — workstream status derived from authoritative shipped signals assert.equal(inv.status_conflict, false); }); }); + +describe('isCompletedInventory — ADR-2207 status lifecycle', () => { + test('terminal "milestone complete" variants are completed', () => { + assert.ok(isCompletedInventory('1.0 milestone complete')); + assert.ok(isCompletedInventory('Milestone complete')); + assert.ok(isCompletedInventory('milestone complete')); + }); + + test('intermediate "All phases complete" is NOT completed (ADR-2207)', () => { + assert.ok(!isCompletedInventory('All phases complete'), + 'All phases complete is an intermediate state — milestone not yet formally closed'); + }); + + test('archived is completed', () => { + assert.ok(isCompletedInventory('archived')); + }); + + test('active statuses are NOT completed', () => { + assert.ok(!isCompletedInventory('Ready to plan')); + assert.ok(!isCompletedInventory('In progress')); + assert.ok(!isCompletedInventory('Executing')); + }); +}); diff --git a/tests/workstream.test.cjs b/tests/workstream.test.cjs index da2762a13..3e18e7e67 100644 --- a/tests/workstream.test.cjs +++ b/tests/workstream.test.cjs @@ -600,7 +600,7 @@ describe('getOtherActiveWorkstreams', () => { fs.writeFileSync(path.join(tmpDir, '.planning', 'workstreams', 'beta', 'STATE.md'), '# State\n**Status:** In progress\n**Current Phase:** 5\n'); fs.writeFileSync(path.join(tmpDir, '.planning', 'workstreams', 'gamma', 'STATE.md'), - '# State\n**Status:** Milestone complete\n'); + '# State\n**Status:** 1.0 milestone complete\n'); }); after(() => cleanup(tmpDir));