Tom Boucher c97f5debb9 fix(#2949): exclude sentinel phase ids from stage-3 next-phase candidacy (#3070)
* test(#2949): prove phase complete stage-3 admits 0.x backlog sentinels

Failing-first regression for #2949. cmdPhaseComplete's stage-3 lowest-outstanding
loop has no sentinel filter, so completing the last real phase with an unchecked
0.x backlog row present selects the sentinel as next_phase, corrupting STATE.md.
Row 1 asserts the 0.x sentinel is not selected; Row 2 guards the #2028 real-lower-
phase out-of-order behavior; Rows 3-4 cover STATE desync and the checked-sentinel
boundary.

* fix(#2949): exclude sentinel phase ids from stage-3 next-phase candidacy

cmdPhaseComplete's stage-3 lowest-outstanding-override loop (#2028) had no
sentinel filter, so completing the last real phase with an unchecked 0.x backlog
row present selected the sentinel as next_phase — comparePhaseNum("0.1","12")
=== -12 sorts it below every real phase — corrupting STATE.md and desyncing
current_phase from current_phase_name.

Add !isSentinelPhaseId(cbm[2]) to the stage-3 condition, reusing the existing
zero-caller predicate (SENTINEL_RANGES = [0, 999]) so both sentinel ranges are
excluded. A real lower-numbered outstanding phase is not a sentinel and is still
selected, preserving #2028's out-of-order-completion behavior.

Stage-3 only: PR #2815 (in-flight, #2786) covers stages 1-2; the two PRs touch
disjoint code.

* fix(#2949): compare next_phase numerically in Row 2 (handles padded/unpadded)

Row 2's assertion /09/.test(next_phase) failed because the CLI returns the
unpadded "9", not "09". Compare numerically (parseInt === 9) so the assertion
holds for either form.

* fix(#2949): mark Phase 11 complete in Row 1 so only the 0.x sentinel is unchecked

Row 1's fixture left Phase 11 unchecked, so completing Phase 12 correctly
selected Phase 11 as the real lower outstanding phase (is_last_phase=false) —
the assertion is_last_phase===true was wrong for that fixture, not the code.
Mark Phase 11 [x] so the ONLY unchecked lower row is the 0.x sentinel, which is
the actual #2949 scenario. Confirmed locally: with Phase 11 checked + the fix,
completing 12 yields is_last_phase=true, next_phase=null (sentinel excluded).

* chore(#2949): add changeset fragment

* chore(#2949): backfill changeset PR number 3070

---------

Co-authored-by: sim <sim@local>
2026-08-04 23:58:49 -04:00

GSD Core

Git. Ship. Done.

English · Português · 简体中文 · 日本語 · 한국어

A light-weight meta-prompting, context engineering, and spec-driven development system for Claude Code, OpenCode, Antigravity CLI, Kimi CLI, Kilo, Codex, Copilot, Cursor, Windsurf, and more.

npm version npm downloads Tests Discord GitHub stars License


What is GSD Core

GSD Core is a context-engineering and spec-driven development framework that drives AI coding agents (Claude Code, Codex, Antigravity CLI, Kimi CLI, Copilot, Cursor, and more) through a disciplined phase loop. It solves context rot — the quality degradation that accumulates as an AI fills its context window — by running all heavy research, planning, and execution work in fresh-context subagents while keeping your main session lean.


How it works

Each milestone repeats the same five-step loop, one phase at a time:

  1. Discuss — capture implementation decisions before anything is planned
  2. Plan — research, decompose, and verify the plan fits a fresh context window
  3. Execute — run plans in parallel waves; each executor starts with a clean 200k-token context
  4. Verify — walk through what was built; diagnose and fix before declaring done
  5. Ship — create the PR, archive the phase, repeat for the next one

Quickstart

npx @opengsd/gsd-core@latest

The installer prompts for your runtime (Claude Code, OpenCode, Antigravity CLI, Kimi CLI, Kilo, Codex, Copilot, Cursor, Windsurf, and more) and whether to install globally or locally. The installer is required for cross-runtime compatibility — do not copy files from agents/ or commands/ directly.

On another runtime or without Node.js? See Install on your runtime.

Once installed, start a new project or onboard an existing repo:

/gsd-new-project   # greenfield project
/gsd-onboard       # existing codebase

New here? Follow Your first project for a guided walkthrough from install to first shipped phase, or Onboarding an existing codebase for brownfield setup.


Documentation

What's new in 1.7.0 → docs/whats-new-1.7.0.md

Tutorials — learning by doing:

How-to guides — task-focused recipes:

Reference — authoritative facts:

Explanation — concepts and design decisions:

Full index: docs/README.md. Other languages: 日本語 · 한국어 · Português · 简体中文.


Why it works

Most AI-coding setups fail at scale because context bloat silently degrades output quality, there is no shared memory between sessions, and nothing verifies that code actually works. GSD Core solves all three: heavy work runs in fresh subagents, structured artifacts like STATE.md and CONTEXT.md survive session boundaries, and the verify step walks through what was built and generates fix plans before a phase is declared done. See docs/explanation/context-engineering.md for the full reasoning.

Troubleshooting? See docs/how-to/recover-and-troubleshoot.md.


Community

Project Platform
gsd-opencode Original OpenCode port
Discord Community support

Star History

Star History Chart

License

MIT License. See LICENSE for details.


Claude Code is powerful. GSD Core makes it reliable.

Description
No description provided
Readme MIT 77 MiB
Languages
JavaScript 82.3%
TypeScript 17.4%
Shell 0.3%