* test(#3409): failing-first regression tests for unreachable shell guard arms Drives the three live defects fail-first, executing the shipped workflow snippets rather than a re-typed copy: - G1/G2 plan-phase.md Walking Skeleton gate reads `--pick summaries_total`, a field that does not exist, so PRIOR_SUMMARIES is always "" and the gate has never fired (#3365). G2 is the load-bearing negative-space case: it rejects a fix that treats "no answer" as "zero" and fires unconditionally. - G3 plan-phase.md PHASE_REQ_IDS resolves "" instead of the TBD sentinel on a phase with zero requirements. - G4 complete-milestone.md's bare `cat <glob>` blocks on stdin under a nullglob left set by an earlier block (measured hang). Skipped on Windows for G4 only: the FIFO-blocked-stdin mechanism is POSIX only, and a weakened assertion there would pass vacuously. Refs #3409 * fix(#3409): make nine shell guards observe their own failure arm `--pick` coerces a missing field to empty string and exits 0, so the `|| echo <default>` fallback after it fires only on a verb typo, never on the field absence it was written for. Nine sites relied on that arm. - plan-phase.md walking-skeleton gate: `--pick summaries_total` names a field that does not exist under any flag combination, so the gate has never fired on any project (#3365). Repointed at the existing single owner, `phases.list --type summaries --pick count`, which returns a real integer in every case including a project with no `.planning` directory. No new counter is added: a second one would duplicate the ownership ADR-3180 Decision 1 forbids. The gate now fires only on a literal "0", so an unanswerable query fails safe instead of entering skeleton mode. - plan-phase.md phase_req_ids: now falls back to the documented TBD. - The remaining seven convert to an explicit empty test. - complete-milestone.md read all phase summaries through a bare `cat <glob>`; under a nullglob left set by an earlier block that is zero operands, so cat blocks on stdin. Guarded with the array shape the #3300 fix already established in review.md. Refs #3409 * fix(#3409): guard eleven more globs that defeat their own fallback arm The nullglob audit this issue asks for turned up the same class in files #3300 never touched. - Eight bare `cat <glob>` reads (transition, complete-milestone, planner x4, verifier, phase-researcher). With nullglob set that is zero operands, so cat reads stdin and blocks; measured rc=137 at 3s. - Three `ls <glob> || echo "<message>"` sites (session-report, review-backlog and its generated skill). nullglob makes ls succeed listing the cwd, so the message never prints and the user gets a directory listing instead. Guarded with `[ -e "${_ARR[0]}" ]` rather than `[ ${#_ARR[@]} -gt 0 ]`. The count form is correct only when nullglob is set, and six of these seven files never set it: without it the array holds the unmatched literal pattern, so the count is 1 and the guard passes wrongly. `-e` is correct in both worlds. review.md keeps its count guards — that block sets nullglob two lines above them. skills/gsd-review-backlog regenerated from commands/, never hand-edited. Refs #3409 * feat(#3409): add the unreachable-shell-guard drift lint A sibling of lint-planning-prompt-drift.cjs, consuming the shared scripts/lib/drift-scan.cjs rather than copying it, wired into lint:ci. Both detectors are one shape — a fallback arm defeated by a legitimate success-on-empty: - Detector A: `--pick` and `|| echo` on one line. `--pick` is the discriminator because "missing field renders empty at exit 0" is a documented CLI contract, not a heuristic. A rule keyed on gsd_run matched 111 lines, ~132 of them legitimate, and was rejected. - Detector B: `cat <glob>` in command position, and `ls <glob>` whose exit code feeds a real fallback or an if/while head. Informational `ls <glob>` whose stdout is consumed (97 sites) and `|| true` failure suppression (~15) are not guards and never fire. Shrink-only ratchet keyed on (file, trimmed text) with a per-pair count, POSIX-normalized unconditionally so Windows CI cannot report everything fresh and stale at once. Ships with a ZERO-entry baseline: every site it can find is fixed. Exemption is the per-line `# gsd-scan-ignore: #NNN` marker whose reason must name an issue or URL; a malformed reason reports a distinct error rather than silently exempting. No file allowlists. ADR-3409 records the invariant, the measurements behind both detectors, and why the upstream `--pick` contract fix belongs to #3473. Refs #3409 * fix(#3409): resolve review findings — typed surface, sanitized reports, tighter marker Standards axis (blocker): the guard's tests asserted on human-readable stdout/stderr and on free-form baseline-load prose, which CONTRIBUTING prohibits by name. Added the typed surface it prescribes instead of weakening the tests: a frozen REASON enum, a --json report mode, structured loadBaseline errors, and a test locking Object.keys(REASON) so a new reason stays three coordinated changes. Security axis: sanitizeForReport covered every violation field but not the baseline-load error path, which embeds raw JSON.stringify output -- that escapes nothing above 0x1f, so bidi and C1 controls reached CI logs unfiltered. Routed through the sanitizer at the output seam. Security axis: the scan-ignore marker accepted `#0` and a bare `http://`. Tightened to a positive issue number and a URL with a host. This diverges deliberately from the sibling in tests/commit-files-pathspec.test.cjs, whose looser form was copied verbatim; the header now records the divergence. Security axis: G4 built its FIFO with `mktemp -u`, reserving a name without creating it. Now created inside a `mktemp -d` directory. Spec axis: ADR-3409 claimed a ninth site landed after the issue was filed. git blame disproves it -- all nine predate it; the issue's hand count missed one. Corrected. The design and test matrix still specified B9 as a FLAG after implementation reversed it to PASS; both now record the reversal and why. Refs #3409 * docs(#3409): add the how-to for resolving unreachable-guard findings Reference and Explanation are carried by ADR-3409; this is the task-oriented quadrant CI cannot check for. The page exists mainly for one thing the lint structurally cannot catch: both `[ -e "${_ARR[0]}" ]` and `[ ${#_ARR[@]} -gt 0 ]` remove the glob from the command and therefore both pass, but the count form is correct only when nullglob is set — and nullglob is usually set in a different block of the same file. A reference table cannot carry that; a how-to can. Also documents the reason codes, so a reader can tell "nothing to report" from "could not look". No tutorial: this is a gate inside an existing CI loop, not a new entry point a newcomer starts from. Refs #3409 * fix(#3409): bring the touched prompt files back under their size gates The remote run was red on 14 tests, all size/attribution, none of them the regression suite. - agents/gsd-planner.md was 194 chars over a 49152 cap enforced by four separate tests, each of which says the remedy is extraction, not a bump. It had 41 chars of headroom before this branch. Its `## Checkpoint Types` section was an unlinked, condensed duplicate of references/checkpoints.md, which already carries all three types and their XML shapes; the section now points there and keeps the three names and percentages inline. Net -969, margin 1010. - gsd-core/workflows/execute-phase.md sat 2 chars under a comfortable margin assertion. Dropped the AUTO_MODE default: the `|| echo "false"` it replaced was unreachable, so the value was already sometimes empty on next, and its only consumer compares against `true`. Net -16. Left plan-phase.md's AUTO_CHAIN default alone -- that file names an explicit `false` branch, so empty would match neither branch. - Acknowledged the seven prompt files that genuinely grew, one specific reason each. Five of those paths were already claimed by spent fragments identical to next, which blocks a second source naming the same path; removed just the colliding key from each, deleting the two that this emptied. Refs #3409 * test(#3409): extract the whole PHASE_REQ_IDS block, not just its first line G3 failed on the remote runner with '' !== 'TBD'. The test was wrong, not the workflow. The shipped contract is now two consecutive lines -- the capture and the `${PHASE_REQ_IDS:-TBD}` default -- but the helper's `^PREFIX=.*$` regex returns only the first match, so the test executed half the contract and correctly observed the empty string. Renamed to extractAssignmentBlockFor and taught it to consume the contiguous run of lines sharing the prefix. The assertion is untouched: TBD is the right expectation, and weakening it to accept the empty string would have reinstated exactly the class this suite exists to catch -- a check that cannot observe the thing it is checking. extractFencedBashAfterAnchor is unaffected: it is fence-delimited rather than line-anchored, so G1/G2/G4 still capture their full blocks. Refs #3409 * chore(#3409): drop a spent ack fragment that collided on complete-milestone.md #3458 landed on next while this branch was in flight and its fragment claims complete-milestone.md, which this branch also grows. Two ack sources may never name the same path. Its entry is spent: the +9163 it explains is already absorbed at base, so it can no longer clear anything, and the checker's own guidance for spent entries is to delete them. Removing the key emptied the fragment, so the file goes too -- an empty one signals nothing. Refs #3409 * chore(#3409): backfill changeset pr number 3558 * test(#3409): hoist a regex subject out of exec() to clear the injection scan CI's prompt-injection scan flagged `MARKER_RE.exec('# gsd-scan-ignore: ...')`. The pattern `exec[[:space:]]*\(["']` is receiver-blind on purpose, so it catches `require('child_process').exec('...')` -- and the scanner's own header records that RegExp.prototype.exec is collateral, to be handled by its allowlist. Allowlisting the file would blind it to the real exec vector permanently, so the subject is hoisted into a const instead: same assertion, scanner left at full strength, no security surface widened. Refs #3409 --------- Co-authored-by: sim <sim@local>
40 KiB
Mark a shipped version (v1.0, v1.1, v2.0) as complete. Creates historical record in MILESTONES.md, performs full PROJECT.md evolution review, reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
<required_reading>
- templates/milestone.md
- templates/milestone-archive.md
.planning/ROADMAP.md.planning/REQUIREMENTS.md.planning/PROJECT.md
</required_reading>
<archival_behavior>
When a milestone completes:
- Extract full milestone details to
.planning/milestones/v[X.Y]-ROADMAP.md - Archive requirements to
.planning/milestones/v[X.Y]-REQUIREMENTS.md - Update ROADMAP.md — overwrite in place with milestone grouping (preserve Backlog section)
- Safety commit archive files + updated ROADMAP.md, then
git rm REQUIREMENTS.md(fresh for next milestone) - Perform full PROJECT.md evolution review
- Offer to create next milestone inline
- Archive UI artifacts (
*-UI-SPEC.md,*-UI-REVIEW.md) alongside other phase documents - Clean up
.planning/ui-reviews/screenshot files (binary assets, never archived)
Context Efficiency: Archives keep ROADMAP.md constant-size and REQUIREMENTS.md milestone-scoped.
ROADMAP archive uses templates/milestone-archive.md — includes milestone header (status, phases, date), full phase details, milestone summary (decisions, issues, tech debt).
REQUIREMENTS archive contains all requirements marked complete with outcomes, traceability table with final status, notes on changed requirements.
</archival_behavior>
Before proceeding with milestone close, run the comprehensive open artifact audit._GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; if [ -f "$GSD_TOOLS" ]; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif command -v gsd-tools >/dev/null 2>&1; then GSD_TOOLS="$(command -v gsd-tools)"; gsd_run() { "$GSD_TOOLS" "$@"; }; elif [ -f "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; elif [ -f "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}" ]; then GSD_TOOLS="${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; gsd_run() { node "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and gsd-tools is not on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
RESPONSE_LANGUAGE=$(gsd_run query config-get response_language --default "" 2>/dev/null || echo "")
gsd_run query audit-open
If response_language is set: All user-facing questions, prompts, and explanations in this workflow MUST be presented in {response_language}. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
If the output contains open items (any section with count > 0):
Display the full audit report to the user.
Then ask:
These items are open. Choose an action:
[R] Resolve — stop and fix items, then re-run /gsd:complete-milestone
[A] Acknowledge all — document as deferred and proceed with close
[C] Cancel — exit without closing
If user chooses [A] (Acknowledge):
- Re-run
gsd-tools.cjs query audit-open --jsonto get structured data. - Acknowledge every open item through the
audit-open acknowledgeCLI writer — this is what actually suppresses each item starting at the NEXTaudit-openscan; the STATE.md table in step 3 is a disclosure record only, it is no longer the suppression mechanism. Every acknowledge call's exit status is accumulated (ACK_FAILURES); the step HALTS before closing if any failed — a refusal (unsupported_heading_shape,ambiguous,not_found, missing file, etc.) must never be silently discarded and let the close proceed as if everything were suppressed.AUDIT_JSONuses the same@file:large-payload sentinel handlingINIT_MANAGERuses inverify_readinessbelow —io.outputswaps any JSON payload over 50000 chars for a@file:<path>marker, and feeding that literal string tojqwould silently make every loop body below iterate zero times:AUDIT_JSON=$(gsd_run query audit-open --json) if [[ "$AUDIT_JSON" == @file:* ]]; then AUDIT_JSON=$(cat "${AUDIT_JSON#@file:}"); fi MILESTONE_VERSION="v[X.Y]" # already known from ROADMAP.md's active milestone header — the same identifier `milestone.complete` uses in the archive_milestone step ACK_FAILURES=0 ACK_FAILURE_LOG="" record_ack_failure() { ACK_FAILURES=$((ACK_FAILURES + 1)) ACK_FAILURE_LOG="${ACK_FAILURE_LOG} - $1" } # debug_sessions / threads (--slug) # NOTE: `< <(...)` process substitution, not `... | while`, so the loop # runs in THIS shell — a `| while` pipeline puts the loop in a subshell # and any ACK_FAILURES/ACK_FAILURE_LOG update inside it is lost the # moment the pipeline exits. for cat in debug_sessions threads; do while IFS= read -r slug; do [ -z "$slug" ] && continue if ! gsd_run query audit-open acknowledge --category "$cat" --milestone "$MILESTONE_VERSION" --slug "$slug"; then record_ack_failure "$cat slug=$slug" fi done < <(printf '%s' "$AUDIT_JSON" | jq -r --arg cat "$cat" '.items[$cat][] | select(.scan_error | not) | .slug') done # seeds (--seed-id) while IFS= read -r seed_id; do [ -z "$seed_id" ] && continue if ! gsd_run query audit-open acknowledge --category seeds --milestone "$MILESTONE_VERSION" --seed-id "$seed_id"; then record_ack_failure "seeds seed_id=$seed_id" fi done < <(printf '%s' "$AUDIT_JSON" | jq -r '.items.seeds[] | select(.scan_error | not) | .seed_id') # todos (--filename) — the scanner caps its list to 5 entries per scan # (remainder items carry `_remainder_count`, no `filename`, and are skipped) while IFS= read -r filename; do [ -z "$filename" ] && continue if ! gsd_run query audit-open acknowledge --category todos --milestone "$MILESTONE_VERSION" --filename "$filename"; then record_ack_failure "todos filename=$filename" fi done < <(printf '%s' "$AUDIT_JSON" | jq -r '.items.todos[] | select((.scan_error or ._remainder_count) | not) | .filename') # quick_tasks (--dir) — the scanner's `slug` strips a leading # YYYYMMDD-/YYYY-MM-DD- date prefix for display; `--dir` needs the # ORIGINAL .planning/quick/<dir>/ name, so reconstruct it from `date`+`slug`. while IFS= read -r dir; do [ -z "$dir" ] && continue if ! gsd_run query audit-open acknowledge --category quick_tasks --milestone "$MILESTONE_VERSION" --dir "$dir"; then record_ack_failure "quick_tasks dir=$dir" fi done < <(printf '%s' "$AUDIT_JSON" | jq -r '.items.quick_tasks[] | select(.scan_error | not) | if .date != "" then "\(.date)-\(.slug)" else .slug end') # uat_gaps / verification_gaps / context_questions — phase-scoped # (--phase --file [--archived-milestone] when the item was found in an archived phase) for cat in uat_gaps verification_gaps context_questions; do while IFS= read -r item; do [ -z "$item" ] && continue phase=$(printf '%s' "$item" | jq -r '.phase') file=$(printf '%s' "$item" | jq -r '.file') archived=$(printf '%s' "$item" | jq -r '.archived_milestone // empty') if [ -n "$archived" ]; then if ! gsd_run query audit-open acknowledge --category "$cat" --milestone "$MILESTONE_VERSION" --phase "$phase" --file "$file" --archived-milestone "$archived"; then record_ack_failure "$cat phase=$phase file=$file archived-milestone=$archived" fi else if ! gsd_run query audit-open acknowledge --category "$cat" --milestone "$MILESTONE_VERSION" --phase "$phase" --file "$file"; then record_ack_failure "$cat phase=$phase file=$file" fi fi done < <(printf '%s' "$AUDIT_JSON" | jq -c --arg cat "$cat" '.items[$cat][] | select(.scan_error | not)') done # deferred_items — same phase-scoped identification, plus --text (the # exact bullet the audit read, which uniquely identifies the entry) while IFS= read -r item; do [ -z "$item" ] && continue phase=$(printf '%s' "$item" | jq -r '.phase') file=$(printf '%s' "$item" | jq -r '.file') text=$(printf '%s' "$item" | jq -r '.text') archived=$(printf '%s' "$item" | jq -r '.archived_milestone // empty') if [ -n "$archived" ]; then if ! gsd_run query audit-open acknowledge --category deferred_items --milestone "$MILESTONE_VERSION" --phase "$phase" --file "$file" --text "$text" --archived-milestone "$archived"; then record_ack_failure "deferred_items phase=$phase file=$file archived-milestone=$archived" fi else if ! gsd_run query audit-open acknowledge --category deferred_items --milestone "$MILESTONE_VERSION" --phase "$phase" --file "$file" --text "$text"; then record_ack_failure "deferred_items phase=$phase file=$file" fi fi done < <(printf '%s' "$AUDIT_JSON" | jq -c '.items.deferred_items[] | select(.scan_error | not)') if [ "$ACK_FAILURES" -gt 0 ]; then echo "ERROR: $ACK_FAILURES acknowledge call(s) failed — HALTING before milestone close. Resolve each listed item manually (e.g. edit the file directly for unsupported_heading_shape/ambiguous, or re-run the audit if a --text/--file target has since changed) and re-run /gsd:complete-milestone:" >&2 printf '%s\n' "$ACK_FAILURE_LOG" >&2 exit 1 fitodosis the only category the scanner caps (5 entries per scan, with a remainder count for the rest). Re-rungsd-tools.cjs query audit-open --json(through the same@file:handling above) and repeat thetodosblock until it reports notodositems — every other category always returns its full open set in one pass. - Re-run
gsd-tools.cjs query audit-open --jsononce more and write the items just acknowledged as new rows to STATE.md under## Deferred Items— append to the existing table (creating the section if absent) rather than overwriting it, preserving rows recorded at earlier milestone closes:One row per item actually acknowledged in step 2 (omit categories with nothing to disclose this close).## Deferred Items Items acknowledged and deferred at milestone close, most recent first: | Category | Item | Status | Deferred At | Milestone | |----------|------|--------|-------------|-----------| | debug_sessions | {slug} | {status} | {date} | {milestone} | | quick_tasks | {slug} | {status} | {date} | {milestone} | | threads | {slug} | {status} | {date} | {milestone} | | seeds | {seed_id} | {status} | {date} | {milestone} | | todos | {filename} | (presence-only) | {date} | {milestone} | | uat_gaps | {phase}/{file} | {status} | {date} | {milestone} | | verification_gaps | {phase}/{file} | {status} | {date} | {milestone} | | context_questions | {phase}/{file} | {question_count} questions | {date} | {milestone} | | deferred_items | {phase}/{file}: {text} | acknowledged | {date} | {milestone} |{date}is today's date;{milestone}isMILESTONE_VERSION. Sanitize all slug/status/text values viasanitizeForDisplay()before writing. Never inject raw file content into STATE.md. - Set
closeout_type=override_closeoutand record in the MILESTONES.md entry:Known verification overrides: {N} newly acknowledged, {M} carried forward from a prior close (see STATE.md Deferred Items)—{N}is the count of items acknowledged in step 2 (the pre-acknowledgment audit JSON'scounts.total) and{M}is that same audit JSON'sacknowledged.total(items a PRIOR close already suppressed and still are). - Proceed with milestone close.
Acknowledging is verdict-preserving and self-invalidating: it never rewrites the artifact's own status: field (except deferred_items, whose entry has no other meaning for that field), and the suppression it grants lapses automatically the moment the artifact's observed state changes again — a reopened debug session, an edited UAT gap, a re-triggered seed, etc. resurfaces on its own at the next audit and must be acknowledged again.
If output shows all clear (no open items): set closeout_type=verified_closeout. If the audit JSON's acknowledged.total is 0, print All artifact types clear. and proceed. Otherwise the close is clean only because {acknowledged.total} item(s) acknowledged at an earlier milestone close are still being suppressed, not because everything was fixed this time — print All artifact types clear ({acknowledged.total} previously acknowledged item(s) still suppressed — see STATE.md Deferred Items). and record Known verification overrides: 0 newly acknowledged, {acknowledged.total} carried forward from a prior close (see STATE.md Deferred Items) in the MILESTONES.md entry before proceeding.
SECURITY: Audit JSON output is structured data from the audit-open query handler (same JSON contract as legacy gsd-tools.cjs audit-open) — validated and sanitized at source. The audit-open acknowledge writer is the only path that sets the audit_acknowledged suppression marker — it snapshots each artifact's current state itself from the identifiers passed on the command line, so this workflow never hand-authors the marker. When writing the STATE.md disclosure table, item identifiers, statuses, and deferred-item text are sanitized via sanitizeForDisplay() before inclusion. Never inject raw user-supplied content into STATE.md without sanitization.
Use init.manager for canonical readiness check:
INIT_MANAGER=$(gsd_run query init.manager)
if [[ "$INIT_MANAGER" == @file:* ]]; then INIT_MANAGER=$(cat "${INIT_MANAGER#@file:}"); fi
This returns all phases with implementation and verification projection. Use this to verify:
- Which phases belong to this milestone?
all_phases_verified: all milestone phases havephase_complete === trueandverification_status === 'passed'.progress_percentshould be 100%.
Compute readiness from INIT_MANAGER, not from roadmap counts:
ALL_PHASES_VERIFIED=$(printf '%s' "$INIT_MANAGER" | jq -r '[
.phases[] | select((.number | tostring | test("^999(\\.|$)") | not))
| (.phase_complete == true and .verification_status == "passed")
] | all')
If not all_phases_verified, verified_closeout must not proceed. Set closeout_type=override_closeout, show each phase whose phase_complete !== true or verification_status !== 'passed', and require an explicit user choice:
- Proceed anyway — record verification overrides in MILESTONES.md/STATE.md
- Run verification first —
/gsd:verify-work {phase}or/gsd:execute-phase {phase} - Abort — return to development
Only set closeout_type=verified_closeout when ALL_PHASES_VERIFIED is true.
Requirements completion check (REQUIRED before presenting):
Parse REQUIREMENTS.md traceability table:
- Count total v1 requirements vs checked-off (
[x]) requirements - Identify any non-Complete rows in the traceability table
Present:
Milestone: [Name, e.g., "v1.0 MVP"]
Includes:
- Phase 1: Foundation (2/2 plans complete)
- Phase 2: Authentication (2/2 plans complete)
- Phase 3: Core Features (3/3 plans complete)
- Phase 4: Polish (1/1 plan complete)
Total: {phase_count} phases, {total_plans} plans
Verification: {all_phases_verified ? "all phases verified" : "override needed"}
Closeout type: {closeout_type}
Requirements: {N}/{M} v1 requirements checked off
If requirements incomplete (N < M):
⚠ Unchecked Requirements:
- [ ] {REQ-ID}: {description} (Phase {X})
- [ ] {REQ-ID}: {description} (Phase {Y})
MUST present 3 options:
- Proceed anyway — mark milestone complete with known gaps
- Run audit first —
/gsd:audit-milestoneto assess gap severity - Abort — return to development
If user selects "Proceed anyway": set closeout_type=override_closeout; note incomplete requirements in MILESTONES.md under ### Known Gaps with REQ-IDs and descriptions.
cat .planning/config.json 2>/dev/null || true
⚡ Auto-approved: Milestone scope verification
[Show breakdown summary without prompting]
Proceeding to stats gathering...
Proceed to gather_stats.
Ready to mark this milestone as shipped?
(yes / wait / adjust scope)
Wait for confirmation.
- "adjust scope": Ask which phases to include.
- "wait": Stop, user returns when ready.
Calculate milestone statistics:
git log --oneline --grep="feat(" | head -20
git diff --stat FIRST_COMMIT..LAST_COMMIT | tail -1
find . -name "*.swift" -o -name "*.ts" -o -name "*.py" | xargs wc -l 2>/dev/null || true
git log --format="%ai" FIRST_COMMIT | tail -1
git log --format="%ai" LAST_COMMIT | head -1
Present:
Milestone Stats:
- Phases: [X-Y]
- Plans: [Z] total
- Tasks: [N] total (from phase summaries)
- Files modified: [M]
- Lines of code: [LOC] [language]
- Timeline: [Days] days ([Start] → [End])
- Git range: feat(XX-XX) → feat(YY-YY)
Extract one-liners from SUMMARY.md files using summary-extract:
# #2962: zsh aborts the block on an unmatched for-list glob (nomatch); bash passes it through. nullglob both.
shopt -s nullglob 2>/dev/null; setopt NULL_GLOB 2>/dev/null
# For each phase in milestone, extract one-liner
for summary in .planning/phases/*-*/*-SUMMARY.md; do
[ -e "$summary" ] || continue
gsd_run query summary-extract "$summary" --fields one_liner --pick one_liner
done
Extract 4-6 key accomplishments. Present:
Key accomplishments for this milestone:
1. [Achievement from phase 1]
2. [Achievement from phase 2]
3. [Achievement from phase 3]
4. [Achievement from phase 4]
5. [Achievement from phase 5]
Note: MILESTONES.md entry is now created automatically by gsd-tools.cjs query milestone.complete in the archive_milestone step. The entry includes version, date, phase/plan/task counts, and accomplishments extracted from SUMMARY.md files.
If additional details are needed (e.g., user-provided "Delivered" summary, git range, LOC stats), add them manually after the CLI creates the base entry.
Full PROJECT.md evolution review at milestone completion.
Read all phase summaries:
_SUMMARIES=( .planning/phases/*-*/*-SUMMARY.md )
if [ -e "${_SUMMARIES[0]}" ]; then cat "${_SUMMARIES[@]}"; fi
Full review checklist:
-
"What This Is" accuracy:
- Compare current description to what was built
- Update if product has meaningfully changed
-
Core Value check:
- Still the right priority? Did shipping reveal a different core value?
- Update if the ONE thing has shifted
-
Business Context check (only if the section is present):
- Skip entirely if PROJECT.md has no
## Business Contextsection - Customer, revenue model, and success metric still accurate after shipping?
- Update any field that drifted; refresh the linked strategy doc reference if it moved
- Skip entirely if PROJECT.md has no
-
Requirements audit:
Validated section:
- All Active requirements shipped this milestone → Move to Validated
- Format:
- ✓ [Requirement] — v[X.Y]
Active section:
- Remove requirements moved to Validated
- Add new requirements for next milestone
- Keep unaddressed requirements
Out of Scope audit:
- Review each item — reasoning still valid?
- Remove irrelevant items
- Add requirements invalidated during milestone
-
Context update:
- Current codebase state (LOC, tech stack)
- User feedback themes (if any)
- Known issues or technical debt
-
Key Decisions audit:
- Extract all decisions from milestone phase summaries
- Add to Key Decisions table with outcomes
- Mark ✓ Good, ⚠️ Revisit, or — Pending
-
Constraints check:
- Any constraints changed during development? Update as needed
Update PROJECT.md inline. Update "Last updated" footer:
---
*Last updated: [date] after v[X.Y] milestone*
Example full evolution (v1.0 → v1.1 prep):
Before:
## What This Is
A real-time collaborative whiteboard for remote teams.
## Core Value
Real-time sync that feels instant.
## Requirements
### Validated
(None yet — ship to validate)
### Active
- [ ] Canvas drawing tools
- [ ] Real-time sync < 500ms
- [ ] User authentication
- [ ] Export to PNG
### Out of Scope
- Mobile app — web-first approach
- Video chat — use external tools
After v1.0:
## What This Is
A real-time collaborative whiteboard for remote teams with instant sync and drawing tools.
## Core Value
Real-time sync that feels instant.
## Requirements
### Validated
- ✓ Canvas drawing tools — v1.0
- ✓ Real-time sync < 500ms — v1.0 (achieved 200ms avg)
- ✓ User authentication — v1.0
### Active
- [ ] Export to PNG
- [ ] Undo/redo history
- [ ] Shape tools (rectangles, circles)
### Out of Scope
- Mobile app — web-first approach, PWA works well
- Video chat — use external tools
- Offline mode — real-time is core value
## Context
Shipped v1.0 with 2,400 LOC TypeScript.
Tech stack: Next.js, Supabase, Canvas API.
Initial user testing showed demand for shape tools.
Step complete when:
- "What This Is" reviewed and updated if needed
- Core Value verified as still correct
- Business Context checked (or confirmed absent)
- All shipped requirements moved to Validated
- New requirements added to Active for next milestone
- Out of Scope reasoning audited
- Context updated with current state
- All milestone decisions added to Key Decisions
- "Last updated" footer reflects milestone completion
Delegate archival to gsd-tools.cjs query milestone.complete:
ARCHIVE=$(gsd_run query milestone.complete "v[X.Y]" --name "[Milestone Name]")
The CLI handles:
- Creating
.planning/milestones/directory - Archiving ROADMAP.md to
milestones/v[X.Y]-ROADMAP.md - Archiving REQUIREMENTS.md to
milestones/v[X.Y]-REQUIREMENTS.mdwith archive header - Moving audit file to milestones if it exists
- Creating/appending MILESTONES.md entry with accomplishments from SUMMARY.md files
- Updating STATE.md (status, last activity)
Extract from result: version, date, phases, plans, tasks, accomplishments, archived.
Verify: ✅ Milestone archived to .planning/milestones/
Phase archival (default-on): milestone complete archives phase directories to milestones/v[X.Y]-phases/ by default (#1871), so the next /gsd:new-milestone never inherits un-archived dirs. No manual mkdir/mv or --archive-phases flag is needed.
If the user explicitly wants to keep phase directories in place as raw execution history, invoke milestone complete with --no-archive-phases:
gsd_run query milestone complete v[X.Y] --no-archive-phases
Verify after a default (archived) completion: ✅ Phase directories archived to .planning/milestones/v[X.Y]-phases/
Text mode (workflow.text_mode: true in config or --text flag): Set TEXT_MODE=true if --text is present in $ARGUMENTS OR text_mode from init JSON is true. When TEXT_MODE is active, replace every AskUserQuestion call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where AskUserQuestion is not available.
After archival, the AI still handles:
- Reorganizing ROADMAP.md with milestone grouping (requires judgment) — overwrite in place after extracting Backlog section, with the write-guard's single-use sentinel armed first (a per-step env var cannot reach a hook — see the reorganize step for the sentinel mechanics)
- Full PROJECT.md evolution review (requires understanding)
- Safety commit of archive files + updated ROADMAP.md, then
git rm .planning/REQUIREMENTS.md - These are NOT fully delegated because they require AI interpretation of content
After milestone complete has archived, reorganize ROADMAP.md with milestone groupings, then commit archives as a safety checkpoint before removing originals.
Backlog preservation — do this FIRST before rewriting ROADMAP.md:
Extract the Backlog section from the current ROADMAP.md before making any changes:
# Extract lines under ## Backlog through end of file (or next ## section)
BACKLOG_SECTION=$(awk '/^## Backlog/{found=1} found{print}' .planning/ROADMAP.md)
If $BACKLOG_SECTION is empty, there is no Backlog section — skip silently.
Reorganize ROADMAP.md — overwrite in place (do NOT delete first) with milestone groupings.
This rewrite is an intentional catastrophic shrink: phase detail was just archived to milestones/v[X.Y]-ROADMAP.md, and a multi-hundred-line ROADMAP.md collapses to a compact grouped summary. The gsd-write-guard PreToolUse hook (#2255) hard-blocks exactly that shape on curated .planning/ files — this step is the legitimate milestone reset its escape hatch exists for. A hook inherits the runtime's environment, so no per-step env var can reach it; the hatch is a single-use sentinel file the guard itself consumes. Arm it, then write:
- Arm the sentinel (single-use; the guard checks it is fresh — within 15 minutes — and names exactly this file, then consumes it):
printf '.planning/ROADMAP.md\n' > .planning/.gsd-allow-shrink
- Compose the full new ROADMAP.md content (template below) and overwrite
.planning/ROADMAP.mdwith the Write tool — the normal path. The guard allows this one shrink and deletes the sentinel. If the Write is blocked anyway, the sentinel was stale or consumed — re-run theprintfand retry the Write.
Template for the composed content:
# Roadmap: [Project Name]
## Milestones
- ✅ **v1.0 MVP** — Phases 1-4 (shipped YYYY-MM-DD)
- 🚧 **v1.1 Security** — Phases 5-6 (in progress)
## Phases
<details>
<summary>✅ v1.0 MVP (Phases 1-4) — SHIPPED YYYY-MM-DD</summary>
- [x] Phase 1: Foundation (2/2 plans) — completed YYYY-MM-DD
- [x] Phase 2: Authentication (2/2 plans) — completed YYYY-MM-DD
</details>
Re-append Backlog section after the rewrite (only if $BACKLOG_SECTION was non-empty):
Append the extracted Backlog content verbatim to the end of the newly written ROADMAP.md. This ensures 999.x backlog items are never silently dropped during milestone reorganization.
Safety commit — commit archive files BEFORE deleting any originals:
gsd_run query commit "chore: archive v[X.Y] milestone files" --files .planning/milestones/v[X.Y]-ROADMAP.md .planning/milestones/v[X.Y]-REQUIREMENTS.md .planning/milestones/v[X.Y]-MILESTONE-AUDIT.md .planning/MILESTONES.md .planning/PROJECT.md .planning/STATE.md .planning/ROADMAP.md
This creates a durable checkpoint in git history. If anything fails after this point, the working tree can be reconstructed from git.
Remove REQUIREMENTS.md via git rm (preserves history, stages deletion atomically):
git rm .planning/REQUIREMENTS.md
Append to living retrospective:
Check for existing retrospective:
ls .planning/RETROSPECTIVE.md 2>/dev/null || true
If exists: Read the file, append new milestone section before the "## Cross-Milestone Trends" section.
If doesn't exist: Create from template at ~/.claude/gsd-core/templates/retrospective.md.
Gather retrospective data:
- From SUMMARY.md files: Extract key deliverables, one-liners, tech decisions
- From VERIFICATION.md files: Extract verification scores, gaps found
- From UAT.md files: Extract test results, issues found
- From git log: Count commits, calculate timeline
- From the milestone work: Reflect on what worked and what didn't
Write the milestone section:
## Milestone: v{version} — {name}
**Shipped:** {date}
**Phases:** {phase_count} | **Plans:** {plan_count}
### What Was Built
{Extract from SUMMARY.md one-liners}
### What Worked
{Patterns that led to smooth execution}
### What Was Inefficient
{Missed opportunities, rework, bottlenecks}
### Patterns Established
{New conventions discovered during this milestone}
### Key Lessons
{Specific, actionable takeaways}
### Cost Observations
- Model mix: {X}% opus, {Y}% sonnet, {Z}% haiku
- Sessions: {count}
- Notable: {efficiency observation}
Update cross-milestone trends:
If the "## Cross-Milestone Trends" section exists, update the tables with new data from this milestone.
Commit:
gsd_run query commit "docs: update retrospective for v${VERSION}" --files .planning/RETROSPECTIVE.md
Most STATE.md updates were handled by milestone complete, but verify and update remaining fields:
Project Reference:
## Project Reference
See: .planning/PROJECT.md (updated [today])
**Core value:** [Current core value from PROJECT.md]
**Current focus:** [Next milestone or "Planning next milestone"]
Accumulated Context:
- Clear decisions summary (full log in PROJECT.md)
- Clear resolved blockers
- Keep open blockers for next milestone
Check branching strategy and offer merge options.
Use init milestone-op for context, or load config directly:
INIT=$(gsd_run query init.execute-phase "1")
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
INIT_CM=$(gsd_run query init.complete-milestone)
if [[ "$INIT_CM" == @file:* ]]; then INIT_CM=$(cat "${INIT_CM#@file:}"); fi
Extract branching_strategy, phase_branch_template, milestone_branch_template, and commit_docs from init JSON. Extract git_create_tag and section_manifest from INIT_CM (used by the git_tag step below).
Detect base branch:
BASE_BRANCH=$(gsd_run query git.base-branch)
If "none": Skip to git_tag.
For "phase" strategy:
BRANCH_PREFIX=$(echo "$PHASE_BRANCH_TEMPLATE" | sed 's/{.*//')
PHASE_BRANCHES=$(git branch --list "${BRANCH_PREFIX}*" 2>/dev/null | sed 's/^\*//' | tr -d ' ')
For "milestone" strategy:
BRANCH_PREFIX=$(echo "$MILESTONE_BRANCH_TEMPLATE" | sed 's/{.*//')
MILESTONE_BRANCH=$(git branch --list "${BRANCH_PREFIX}*" 2>/dev/null | sed 's/^\*//' | tr -d ' ' | head -1)
If no branches found: Skip to git_tag.
If branches exist:
## Git Branches Detected
Branching strategy: {phase/milestone}
Branches: {list}
Options:
1. **Merge to main** — Merge branch(es) to main
2. **Delete without merging** — Already merged or not needed
3. **Keep branches** — Leave for manual handling
AskUserQuestion with options: Squash merge (Recommended), Merge with history, Delete without merging, Keep branches.
Squash merge:
CURRENT_BRANCH=$(git branch --show-current)
git checkout ${BASE_BRANCH}
if [ "$BRANCHING_STRATEGY" = "phase" ]; then
for branch in $PHASE_BRANCHES; do
git merge --squash "$branch"
# Strip .planning/ from staging if commit_docs is false
if [ "$COMMIT_DOCS" = "false" ]; then
git reset HEAD .planning/ 2>/dev/null || true
fi
git commit -m "feat: $branch for v[X.Y]"
done
fi
if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
git merge --squash "$MILESTONE_BRANCH"
# Strip .planning/ from staging if commit_docs is false
if [ "$COMMIT_DOCS" = "false" ]; then
git reset HEAD .planning/ 2>/dev/null || true
fi
git commit -m "feat: $MILESTONE_BRANCH for v[X.Y]"
fi
git checkout "$CURRENT_BRANCH"
Merge with history:
CURRENT_BRANCH=$(git branch --show-current)
git checkout ${BASE_BRANCH}
if [ "$BRANCHING_STRATEGY" = "phase" ]; then
for branch in $PHASE_BRANCHES; do
git merge --no-ff --no-commit "$branch"
# Strip .planning/ from staging if commit_docs is false
if [ "$COMMIT_DOCS" = "false" ]; then
git reset HEAD .planning/ 2>/dev/null || true
fi
git commit -m "Merge branch '$branch' for v[X.Y]"
done
fi
if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
git merge --no-ff --no-commit "$MILESTONE_BRANCH"
# Strip .planning/ from staging if commit_docs is false
if [ "$COMMIT_DOCS" = "false" ]; then
git reset HEAD .planning/ 2>/dev/null || true
fi
git commit -m "Merge branch '$MILESTONE_BRANCH' for v[X.Y]"
fi
git checkout "$CURRENT_BRANCH"
Delete without merging:
if [ "$BRANCHING_STRATEGY" = "phase" ]; then
for branch in $PHASE_BRANCHES; do
git branch -d "$branch" 2>/dev/null || git branch -D "$branch"
done
fi
if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
git branch -d "$MILESTONE_BRANCH" 2>/dev/null || git branch -D "$MILESTONE_BRANCH"
fi
Keep branches: Report "Branches preserved for manual handling"
If section_manifest is null or "git-tag" is in its included list: read and execute gsd-core/workflows/complete-milestone/steps/git-tag.md. Otherwise skip — do not read the file; proceed to git_commit_milestone.
Commit the REQUIREMENTS.md deletion (archive files and ROADMAP.md were already committed in the safety commit in reorganize_roadmap_and_delete_originals).
git commit -m "chore: remove REQUIREMENTS.md for v[X.Y] milestone"
Confirm: "Committed: chore: remove REQUIREMENTS.md for v[X.Y] milestone"
✅ Milestone v[X.Y] [Name] complete
Shipped:
- [N] phases ([M] plans, [P] tasks)
- [One sentence of what shipped]
Archived:
- milestones/v[X.Y]-ROADMAP.md
- milestones/v[X.Y]-REQUIREMENTS.md
Summary: .planning/MILESTONES.md
Tag: v[X.Y]
---
## ▶ Next Up — [${PROJECT_CODE}] ${PROJECT_TITLE}
**Start Next Milestone** — questioning → research → requirements → roadmap
`/clear` then:
`/gsd:new-milestone`
---
<milestone_naming>
Version conventions:
- v1.0 — Initial MVP
- v1.1, v1.2 — Minor updates, new features, fixes
- v2.0, v3.0 — Major rewrites, breaking changes, new direction
Names: Short 1-2 words (v1.0 MVP, v1.1 Security, v1.2 Performance, v2.0 Redesign).
</milestone_naming>
<what_qualifies>
Create milestones for: Initial release, public releases, major feature sets shipped, before archiving planning.
Don't create milestones for: Every phase completion (too granular), work in progress, internal dev iterations (unless truly shipped).
Heuristic: "Is this deployed/usable/shipped?" If yes → milestone. If no → keep working.
</what_qualifies>
<success_criteria>
Milestone completion is successful when:
-
Pre-close artifact audit run and output shown to user
-
Deferred items recorded in STATE.md if user acknowledged
-
Known deferred items count noted in MILESTONES.md entry
-
MILESTONES.md entry created with stats and accomplishments
-
PROJECT.md full evolution review completed
-
All shipped requirements moved to Validated in PROJECT.md
-
Key Decisions updated with outcomes
-
ROADMAP.md Backlog section extracted before rewrite, re-appended after (skipped if absent)
-
ROADMAP.md reorganized with milestone grouping (overwritten in place, not deleted)
-
Roadmap archive created (milestones/v[X.Y]-ROADMAP.md)
-
Requirements archive created (milestones/v[X.Y]-REQUIREMENTS.md)
-
Safety commit made (archive files + updated ROADMAP.md) BEFORE deleting REQUIREMENTS.md
-
REQUIREMENTS.md removed via
git rm(fresh for next milestone, history preserved) -
STATE.md updated with fresh project reference
-
Git tag created (v[X.Y]) (if
git.create_tagenabled) -
Milestone commit made (includes archive files and deletion)
-
Requirements completion checked against REQUIREMENTS.md traceability table
-
Incomplete requirements surfaced with proceed/audit/abort options
-
Known gaps recorded in MILESTONES.md if user proceeded with incomplete requirements
-
RETROSPECTIVE.md updated with milestone section
-
Cross-milestone trends updated
-
User knows next step (/gsd:new-milestone)
</success_criteria>