Skip to content

Commit def6d7d

Browse files
feat(sdk): golden parity harness and query handler CJS alignment (#2302 Track A)
Golden/read-only parity tests and registry alignment, query handler fixes (check-completion, state-mutation, commit, validate, summary, etc.), and WAITING.json dual-write for .gsd/.planning readers. Refs #2341
1 parent 794f7e1 commit def6d7d

91 files changed

Lines changed: 10771 additions & 918 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/HANDOVER-GOLDEN-PARITY.md

Lines changed: 237 additions & 0 deletions
Large diffs are not rendered by default.

sdk/HANDOVER-PARITY-DOCS.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Handover: Parity exceptions doc + CJS-only matrix (next session)
2+
3+
**Status:** The deliverables described below are implemented in `sdk/src/query/QUERY-HANDLERS.md` (sections **Golden parity: coverage and exceptions** and **CJS command surface vs SDK registry**). Use that file as the canonical registry + parity reference; this handover remains useful for issue **#2302** scope and parent **#2007** links.
4+
5+
Paste this document (or `@sdk/HANDOVER-PARITY-DOCS.md`) at the start of a new chat so work continues without re-auditing issue scope.
6+
7+
## Goal for this session
8+
9+
1. **Parity “exceptions” documentation** — A clear, maintainable description of where **full JSON equality** between `gsd-tools.cjs` and `createRegistry()` is **not** expected or not attempted, and why (stubs, structural-only tests, environment-dependent fields, ordering, etc.). Map this to **#2007 / #2302** expectations: no *undocumented* gap.
10+
2. **CJS-only matrix** — A **single authoritative table**: each relevant `gsd-tools.cjs` surface (top-level command or documented cluster) → **registered in SDK** vs **permanent CLI-only** vs **alias / naming difference**, with a **one-line justification** where not registered.
11+
12+
## Parent tracking
13+
14+
- **Issue:** [gsd-build/get-shit-done#2302](https://github.com/gsd-build/get-shit-done/issues/2302) — Phase 3 SDK query parity, registry, docs (parent umbrella #2007).
15+
- **Acceptance criteria touched here:** parity coverage/exceptions documented; registry audit reflected in a **matrix** (issue wording: “every required CJS surface either has a handler or appears in the CJS-only matrix with justification”).
16+
17+
## Repo / branch
18+
19+
- **Workspace:** `D:\Repos\get-shit-done` (PBR backport); adjust path if different machine.
20+
- **Feature branch (typical):** `feat/sdk-phase3-query-layer` — confirm with `git branch` before editing.
21+
- **Upstream:** `gsd-build/get-shit-done`.
22+
23+
## What already exists (do not duplicate blindly)
24+
25+
- `sdk/src/query/QUERY-HANDLERS.md` — Registry conventions, partial “not registered” list (**graphify**, **from-gsd2**), CLI name differences (**summary-extract** vs **summary.extract**, **scaffold** vs **phase.scaffold**), **intel.update** stub, **skill-manifest --write** / mutation events, **docs-init** golden note (agent install fields), **stateExtractField** rule.
26+
- `sdk/src/golden/golden.integration.test.ts` — Source of truth for **which commands** are golden-tested and **how** (full equality vs subset vs normalized `existing_docs` vs omitted fields).
27+
- `sdk/src/golden/capture.ts``captureGsdToolsOutput()` spawns `get-shit-done/bin/gsd-tools.cjs`.
28+
- `docs/CLI-TOOLS.md` — User-facing CLI reference; should **link** to the parity exceptions + matrix (or host a short summary with pointer to `sdk/`).
29+
30+
## Deliverables (suggested shape)
31+
32+
### A) Parity exceptions section
33+
34+
Add or extend a dedicated section (prefer `QUERY-HANDLERS.md` under a heading like **"Golden parity: coverage and exceptions"**, or a new `sdk/PARITY.md` if the team wants less churn in QUERY-HANDLERS — **pick one canonical location** and link from the other).
35+
36+
Cover at least:
37+
38+
39+
| Category | Examples to document |
40+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
41+
| **Full JSON parity** | Commands where tests use `toEqual` on `sdkResult.data` vs CJS stdout JSON. |
42+
| **Structural / field subset** | Tests that compare only selected keys (e.g. `find-phase`, `roadmap.analyze`, `init.*` stable fields). |
43+
| **Normalized comparison** | e.g. `docs-init`: `existing_docs` sorted by path; `agents_installed` / `missing_agents` omitted between subprocess vs in-process. |
44+
| **Intentional stubs** | `intel.update` — spawn hint, not full refresh. |
45+
| **Conditional behavior** | `skill-manifest`: writes only with `--write`; not in `QUERY_MUTATION_COMMANDS`. |
46+
| **Environment / time** | `current-timestamp`: structure and format, not same instant. |
47+
| **Not in golden suite** | Commands registered but not (yet) covered — list as **coverage gap** or **out of scope for golden** with rationale. |
48+
49+
50+
### B) CJS-only matrix
51+
52+
Build the table by **diffing** `get-shit-done/bin/gsd-tools.cjs` `switch (command)` top-level cases against `createRegistry()` registrations in `sdk/src/query/index.ts`.
53+
54+
**Already documented as product-out-of-scope for registry:** **graphify**, **from-gsd2** / **gsd2-import**.
55+
56+
**Already documented as naming/alias differences (registered, different string):** **summary-extract****summary.extract**; top-level **scaffold****phase.scaffold**.
57+
58+
Matrix columns (suggested):
59+
60+
- **CJS command** (or subcommand pattern)
61+
- **SDK dispatch name(s)** if any
62+
- **Disposition:** Registered / CLI-only / Alias-only / Stub / N/A
63+
- **Justification** (one line) if not a straight registered parity
64+
65+
Optional: footnote that `detect-custom-files` skips multi-repo root resolution in CJS (`SKIP_ROOT_RESOLUTION`) — behavior is documented in CLI; matrix can mention if relevant.
66+
67+
## Files likely to edit
68+
69+
70+
| Path | Role |
71+
| --------------------------------- | ----------------------------------------------------------------- |
72+
| `sdk/src/query/QUERY-HANDLERS.md` | Primary home for exceptions + matrix, or link hub. |
73+
| `sdk/PARITY.md` | Optional dedicated file if QUERY-HANDLERS becomes too long. |
74+
| `docs/CLI-TOOLS.md` | Short “Parity & registry” subsection with links into `sdk/` docs. |
75+
| `sdk/HANDOVER-GOLDEN-PARITY.md` | Optional one-line pointer to new parity doc section when done. |
76+
77+
78+
## Out of scope for *this* handover session
79+
80+
- Implementing runner alignment (`GSDTools` → registry) — separate #2302 work.
81+
- Adding `@deprecated` headers to `gsd-tools.cjs` — separate task.
82+
- **CHANGELOG** — only if you batch doc work with release notes in same PR (optional).
83+
84+
## Verification
85+
86+
- No code behavior change required for pure docs; run `npm run build` in `sdk/` only if TypeScript-adjacent files were touched.
87+
- Proofread: every **CLI-only** row has a **justification**; every **exception** in golden tests appears in the exceptions doc.
88+
89+
## Success criteria
90+
91+
- A reader can answer: **“Which commands are fully golden-parity vs partial vs stub vs untested?”** without reading the whole test file.
92+
- A reader can answer: **“Which `gsd-tools` top-level commands are not registered and why?”** from one table.
93+
- **#2302** acceptance bullets on parity documentation and registry matrix are satisfied for the **documentation** slice (remaining issue items may still be open for code).
94+
95+
---
96+
97+
*Created for handoff to “parity exceptions + CJS-only matrix” session. Update when the canonical doc location or golden coverage changes.*

0 commit comments

Comments
 (0)