gsdd-cli 0.16.1 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +111 -61
  2. package/agents/README.md +1 -1
  3. package/bin/adapters/claude.mjs +8 -1
  4. package/bin/adapters/codex.mjs +5 -1
  5. package/bin/adapters/opencode.mjs +7 -1
  6. package/bin/gsdd.mjs +25 -20
  7. package/bin/lib/evidence-contract.mjs +112 -0
  8. package/bin/lib/health-truth.mjs +29 -31
  9. package/bin/lib/health.mjs +61 -106
  10. package/bin/lib/init-flow.mjs +91 -34
  11. package/bin/lib/init-runtime.mjs +46 -25
  12. package/bin/lib/init.mjs +3 -7
  13. package/bin/lib/lifecycle-preflight.mjs +333 -0
  14. package/bin/lib/lifecycle-state.mjs +476 -0
  15. package/bin/lib/manifest.mjs +24 -20
  16. package/bin/lib/phase.mjs +81 -26
  17. package/bin/lib/provenance.mjs +295 -54
  18. package/bin/lib/rendering.mjs +70 -12
  19. package/bin/lib/runtime-freshness.mjs +264 -0
  20. package/bin/lib/session-fingerprint.mjs +106 -0
  21. package/distilled/DESIGN.md +707 -13
  22. package/distilled/EVIDENCE-INDEX.md +166 -1
  23. package/distilled/README.md +44 -28
  24. package/distilled/SKILL.md +4 -4
  25. package/distilled/templates/agents.block.md +1 -1
  26. package/distilled/workflows/audit-milestone.md +50 -0
  27. package/distilled/workflows/complete-milestone.md +38 -2
  28. package/distilled/workflows/execute.md +16 -3
  29. package/distilled/workflows/map-codebase.md +15 -4
  30. package/distilled/workflows/new-milestone.md +53 -24
  31. package/distilled/workflows/new-project.md +44 -25
  32. package/distilled/workflows/pause.md +1 -1
  33. package/distilled/workflows/plan.md +187 -74
  34. package/distilled/workflows/progress.md +135 -31
  35. package/distilled/workflows/quick.md +20 -12
  36. package/distilled/workflows/resume.md +152 -65
  37. package/distilled/workflows/verify.md +55 -20
  38. package/docs/BROWNFIELD-PROOF.md +95 -0
  39. package/docs/RUNTIME-SUPPORT.md +77 -0
  40. package/docs/USER-GUIDE.md +443 -0
  41. package/docs/VERIFICATION-DISCIPLINE.md +59 -0
  42. package/docs/claude/context-monitor.md +98 -0
  43. package/docs/proof/consumer-node-cli/README.md +37 -0
  44. package/docs/proof/consumer-node-cli/ROADMAP.md +14 -0
  45. package/docs/proof/consumer-node-cli/SPEC.md +17 -0
  46. package/docs/proof/consumer-node-cli/brief.md +9 -0
  47. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md +34 -0
  48. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-SUMMARY.md +10 -0
  49. package/docs/proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md +30 -0
  50. package/package.json +26 -20
@@ -13,13 +13,26 @@ Before starting, read these files:
13
13
  4. `.planning/SPEC.md` - requirements and constraints for the phase
14
14
  5. From the SUMMARY.md loaded in step 3, if a `<judgment>` section is present - read `<anti_regression>` rules as additional verification targets: confirm that invariants listed there were not broken by execution. Read `<active_constraints>` to calibrate verification scope.
15
15
  6. The relevant codebase files - the code that was actually built
16
- 7. **Session-boundary fallback:** If the SUMMARY.md loaded in step 3 has no `<judgment>` section, check whether `.planning/.continue-here.bak` exists. If it does, read its `<judgment>` section. Treat `<anti_regression>` rules as additional verification targets and `<active_constraints>` to calibrate verification scope (same usage as step 5). After reading, run `gsdd file-op delete .planning/.continue-here.bak --missing ok` (auto-clean).
16
+ 7. **Session-boundary fallback:** If the SUMMARY.md loaded in step 3 has no `<judgment>` section, check whether `.planning/.continue-here.bak` exists. If it does, read its `<judgment>` section. Treat `<anti_regression>` rules as additional verification targets and `<active_constraints>` to calibrate verification scope (same usage as step 5). After reading, run `node .planning/bin/gsdd.mjs file-op delete .planning/.continue-here.bak --missing ok` (auto-clean).
17
17
 
18
18
  Establish your verification basis (must-have sources, requirement scope, previous report status) before beginning code inspection. Do not jump to loose file reading until this basis is explicit.
19
19
 
20
20
  If a previous `.planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md` exists, read it first and treat this as re-verification.
21
21
  </load_context>
22
22
 
23
+ <lifecycle_preflight>
24
+ Before code inspection or report writing, run:
25
+
26
+ - `node .planning/bin/gsdd.mjs lifecycle-preflight verify {phase_num} --expects-mutation phase-status`
27
+
28
+ If the preflight result is `blocked`, STOP and report the blocker instead of inferring lifecycle eligibility from prompt-local prose.
29
+
30
+ Treat the preflight as an authorization seam over shared repo truth only:
31
+ - it may authorize or reject verification
32
+ - it does not mutate `.planning/ROADMAP.md` by itself
33
+ - owned writes remain the verification artifact plus any explicit `node .planning/bin/gsdd.mjs phase-status` transition that occurs later on `passed`
34
+ </lifecycle_preflight>
35
+
23
36
  <runtime_contract>
24
37
  Verification uses the same `Runtime` and `Assurance` types as planning and execution.
25
38
  Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
@@ -75,28 +88,41 @@ Also check for orphan requirements:
75
88
  Risk classification:
76
89
  For each truth, assess: does it involve a behavioral change, UX change, or user-visible outcome without a clear, relevant acceptance criterion?
77
90
 
78
- - If yes → mark it `risk: high`. This truth will require `runtime-check` or `user-confirmation` proof in the proof contract step below. Code-evidence alone is insufficient.
79
- - If no → `risk: normal`. Code-evidence or repo-test is sufficient.
91
+ - If yes → mark it `risk: high`. This truth will require runtime-grade evidence in the evidence contract step below. `code` alone is insufficient.
92
+ - If no → `risk: normal`. `code` is the floor, and `test` is preferred when the repo has a direct automated check.
80
93
 
81
94
  This is the verifier's own internal judgment — not a field imported from the plan. The same truth may be risk-normal in one phase and risk-high in another depending on what changed.
82
95
  </must_haves>
83
96
 
84
- <proof_contract>
85
- Before beginning artifact inspection, classify each must-have truth by its required proof type. This step separates "did the artifact pass levels 1–3?" from "did the outcome have the right kind of proof?"
86
- Proof types (from SPEC.md `VerificationEvidence`):
87
- - `repo-test` — a passing automated test in the repo directly exercises this outcome
88
- - `code-evidence` — source inspection confirms the implementation is present and wired
89
- - `runtime-check` — a live execution confirms the behavior (script, curl, manual run)
90
- - `user-confirmation` — a human observer confirmed the user-visible outcome
97
+ <evidence_contract>
98
+ Before beginning artifact inspection, classify the phase closure posture and apply the fixed evidence kinds. This step separates "did the artifact pass levels 1–3?" from "did the outcome have the right kind of evidence?"
99
+
100
+ Stable evidence kinds:
101
+ - `code` — source inspection confirms the implementation is present and wired
102
+ - `test` — a passing automated check in the repo directly exercises the outcome
103
+ - `runtime` — a live execution confirms the behavior (script, curl, manual run)
104
+ - `delivery` — shipped or distributable proof exists (merged PR, packaged artifact, published doc/proof pack, release evidence)
105
+ - `human` — a human observer confirmed a visual or judgment-based outcome
106
+
107
+ Delivery posture:
108
+ - `repo_only` — the phase outcome stays inside repo truth; no shipped runtime or external delivery claim is needed
109
+ - `delivery_sensitive` — the phase claims a live behavior, shipped UX, install/release posture, or other externally consumed runtime outcome
110
+
111
+ Apply the shared `verify` matrix:
91
112
 
92
- Assign required proof type per truth using the risk classification from `<must_haves>`:
93
- - `risk: high` truths (behavioral/UX changes, user-visible outcomes without acceptance criteria) → require `runtime-check` or `user-confirmation`. Code-evidence alone is **not sufficient**.
94
- - `risk: normal` truths (structural or content changes) → `code-evidence` is sufficient. `repo-test` is always valid regardless of risk level.
113
+ | delivery_posture | required evidence | recommended evidence | cannot carry closure alone |
114
+ | -------------------- | ----------------- | -------------------------- | -------------------------- |
115
+ | `repo_only` | `code` | `test` | `human`, `delivery` |
116
+ | `delivery_sensitive` | `code`, `runtime` | `test`, `delivery`, `human` | `code`, `human` |
95
117
 
96
- If the required proof type cannot be collected programmatically (e.g., runtime environment unavailable) → route that truth to `human_verification` in the report, not to `gaps`.
118
+ Rules:
119
+ - repo-only work must not invent `runtime` or `delivery` proof just to satisfy a template
120
+ - delivery-sensitive closure must not pass on prose, `code`-only inspection, or `human` confirmation without the required `runtime` evidence
121
+ - `human` evidence supports ambiguous or visual outcomes; it does not replace required `code` or `runtime` evidence
122
+ - if a required evidence kind cannot be collected, record it in `missing_evidence`; route purely human-observable follow-up to `human_verification` only when the blocking runtime/delivery requirement is already satisfied
97
123
 
98
- Note: this step does NOT replace levels 1–3. An artifact can satisfy the proof-type requirement and still fail Level 2 (substantive) or Level 3 (wired). Both checks must run.
99
- </proof_contract>
124
+ Note: this step does NOT replace levels 1–3. An artifact can satisfy the evidence-kind requirement and still fail Level 2 (substantive) or Level 3 (wired). Both checks must run.
125
+ </evidence_contract>
100
126
 
101
127
  <verification_levels>
102
128
  Check every artifact at three levels. A common failure mode is a file that exists but is still a stub.
@@ -215,6 +241,12 @@ assurance: cross_runtime_checked
215
241
  verified: 2026-03-11T12:00:00Z
216
242
  status: gaps_found
217
243
  score: 2/3 must-haves verified
244
+ delivery_posture: delivery_sensitive
245
+ evidence_contract:
246
+ required_kinds: [code, runtime]
247
+ recommended_kinds: [test, delivery, human]
248
+ observed_kinds: [code]
249
+ missing_kinds: [runtime]
218
250
  re_verification:
219
251
  previous_status: gaps_found
220
252
  previous_score: 1/3
@@ -226,7 +258,9 @@ re_verification:
226
258
  gaps:
227
259
  - truth: "Users can create a user from the page"
228
260
  status: failed
229
- proof_type: runtime-check # required proof type for this truth
261
+ required_evidence: [code, runtime]
262
+ observed_evidence: [code]
263
+ missing_evidence: [runtime]
230
264
  severity: blocker # blocker = required proof absent; warning = artifact missing but proof exists via other means
231
265
  reason: "Form submits, but route returns placeholder data"
232
266
  artifacts:
@@ -304,10 +338,11 @@ Status rules:
304
338
 
305
339
  Frontmatter guidance:
306
340
  - `phase`, `runtime`, `assurance`, `verified`, `status`, and `score` are the minimal report fields
341
+ - `delivery_posture` plus `evidence_contract.required_kinds|recommended_kinds|observed_kinds|missing_kinds` must reflect the shared verify matrix actually used for this phase
307
342
  - when gaps or human checks exist, keep them machine-readable in frontmatter — do not collapse them into prose-only body text
308
343
  - keep `re_verification`, `gaps`, and `human_verification` structured when they materially help re-verification, gap closure, or explicit human handoff
309
344
  - keep `<git_delivery_check>` in frontmatter with the observed `branch`, `commits_ahead_of_main`, and `pr_state` values from the delivery checks above
310
- - use `severity: warning` in gaps when an artifact is missing but proof exists through other means; use `severity: blocker` only when the required proof type (`runtime-check`, `repo-test`, or `user-confirmation` where mandated) could not be satisfied by any available evidence
345
+ - use `severity: warning` in gaps when an artifact is missing but required evidence still exists through other means; use `severity: blocker` only when one or more required evidence kinds in `missing_evidence` could not be satisfied
311
346
  - if verification runs in the same runtime/vendor as execution, cap frontmatter `assurance` at `self_checked`
312
347
  - if verification runs in a different runtime/vendor than execution, set frontmatter `assurance: cross_runtime_checked`
313
348
  </report_format>
@@ -346,7 +381,7 @@ If you cannot write the file (permissions, path issue), STOP and report the bloc
346
381
 
347
382
  Before any ROADMAP closure step, confirm the required phase `SUMMARY.md` still exists on disk. If `SUMMARY.md` is missing, STOP and report the blocker — do NOT treat verification as terminally successful and do NOT close ROADMAP state from conversation context alone.
348
383
 
349
- After writing VERIFICATION.md, if `status: passed`, run `gsdd phase-status {phase_num} done` to close the phase entry in `.planning/ROADMAP.md`. Execute is the primary owner of ROADMAP status, but execute can be interrupted before its state_updates run. Verify is the terminal workflow and must close the ROADMAP entry when it confirms the phase is complete. If the helper cannot update ROADMAP.md (path issue, missing phase, invalid state), STOP and report the blocker — do NOT complete verification without closing the phase.
384
+ After writing VERIFICATION.md, if `status: passed`, run `node .planning/bin/gsdd.mjs phase-status {phase_num} done` to close the phase entry in `.planning/ROADMAP.md`. Execute is the primary owner of ROADMAP status, but execute can be interrupted before its state_updates run. Verify is the terminal workflow and must close the ROADMAP entry when it confirms the phase is complete. If the helper cannot update ROADMAP.md (path issue, missing phase, invalid state), STOP and report the blocker — do NOT complete verification without closing the phase.
350
385
  </persistence>
351
386
 
352
387
  <success_criteria>
@@ -365,7 +400,7 @@ Verification is done when all of these are true:
365
400
  - [ ] Verification explicitly reviewed SUMMARY `<handoff>` and `<deltas>` content
366
401
  - [ ] Status is one of `passed`, `gaps_found`, or `human_needed`
367
402
  - [ ] The required phase `SUMMARY.md` still exists before any ROADMAP closure on passed status
368
- - [ ] If status is `passed`, ROADMAP.md phase entry is `[x]` via `gsdd phase-status`
403
+ - [ ] If status is `passed`, ROADMAP.md phase entry is `[x]` via `node .planning/bin/gsdd.mjs phase-status`
369
404
  - [ ] The developer was informed of the result and recommended next step
370
405
  - [ ] Related failures grouped by concern, not returned as a flat symptom list
371
406
  - [ ] Requirements coverage chain completed (collect, restate, map, report, check orphans)
@@ -0,0 +1,95 @@
1
+ # Brownfield Proof
2
+
3
+ This is the strongest tracked public proof for Workspine's release-floor claim: a real brownfield-style consumer repo that used the shipped workflow contract, hit a real failure, and recovered through the same `plan -> execute -> verify` loop.
4
+
5
+ ## What this proves
6
+
7
+ In a fresh consumer repo, Workspine produced:
8
+
9
+ - durable planning artifacts
10
+ - runnable workflow entry surfaces
11
+ - a concrete phase plan
12
+ - a real execution summary
13
+ - a failed verification
14
+ - a real fix
15
+ - a successful re-verification
16
+
17
+ That proves the repo-native delivery contract is not just conceptual.
18
+
19
+ ## Public proof pack
20
+
21
+ Open the tracked proof pack:
22
+
23
+ - [Consumer proof pack index](proof/consumer-node-cli/README.md)
24
+
25
+ Key exported artifacts:
26
+
27
+ - [brief.md](proof/consumer-node-cli/brief.md)
28
+ - [SPEC.md](proof/consumer-node-cli/SPEC.md)
29
+ - [ROADMAP.md](proof/consumer-node-cli/ROADMAP.md)
30
+ - [01-01-PLAN.md](proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md)
31
+ - [01-01-SUMMARY.md](proof/consumer-node-cli/phases/01-foundation/01-01-SUMMARY.md)
32
+ - [01-VERIFICATION.md](proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md)
33
+
34
+ ## The worked flow
35
+
36
+ ### 1. Initialize a fresh consumer repo
37
+
38
+ The exported proof pack comes from a new non-framework project that used the shipped `gsdd init` flow.
39
+
40
+ The generated surface included:
41
+
42
+ - portable `.agents/skills/gsdd-*`
43
+ - consumer `.planning/` state
44
+ - a Codex-native checker adapter
45
+ - a compact consumer `AGENTS.md`
46
+
47
+ ### 2. Plan real work
48
+
49
+ The consumer brief required a named greeting:
50
+
51
+ - `node index.js --name Ada` should print `Hello, Ada!`
52
+
53
+ That requirement is preserved in the exported [brief](proof/consumer-node-cli/brief.md), [spec](proof/consumer-node-cli/SPEC.md), and [phase plan](proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md).
54
+
55
+ ### 3. Execute and hit a real miss
56
+
57
+ The first implementation missed the named-greeting requirement:
58
+
59
+ - `node index.js --name Ada` returned `Hello, world!`
60
+
61
+ That miss is preserved in the exported [verification report](proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md).
62
+
63
+ ### 4. Verify, fix, and re-verify
64
+
65
+ The consumer repo then followed the same framework contract to:
66
+
67
+ - identify the failed requirement
68
+ - update the implementation and test path
69
+ - re-run verification
70
+ - close with a passing result
71
+
72
+ The final passing behavior is:
73
+
74
+ - `node index.js --name Ada` returns `Hello, Ada!`
75
+
76
+ ## Why this matters
77
+
78
+ This proof is stronger than a polished README claim because it shows the exact behavior Workspine is trying to preserve:
79
+
80
+ - plan from durable artifacts
81
+ - execute against real repo state
82
+ - let verification catch a real miss
83
+ - recover without losing the thread
84
+
85
+ That is the release-floor claim in practice.
86
+
87
+ ## What this does not prove
88
+
89
+ This proof does not claim:
90
+
91
+ - equal runtime ergonomics across every supported runtime
92
+ - parity validation on Cursor, Copilot, or Gemini CLI
93
+ - enterprise-hardening or orchestration-platform behavior
94
+
95
+ Those are outside the current proof floor.
@@ -0,0 +1,77 @@
1
+ # Runtime Support Matrix
2
+
3
+ Workspine is a repo-native delivery spine with portable multi-runtime workflow surfaces, but the proof bar is not the same for every runtime today.
4
+
5
+ This matrix is the release-floor truth surface.
6
+
7
+ ## Support tiers
8
+
9
+ ### Directly validated
10
+
11
+ The workflow contract has direct repo proof for these runtimes:
12
+
13
+ - **Claude Code**
14
+ - **Codex CLI**
15
+ - **OpenCode**
16
+
17
+ These are the strongest public runtime claims.
18
+
19
+ ### Same core workflow
20
+
21
+ These runtimes use the same portable workflow surfaces, but they do not carry equal runtime proof or equal ergonomics today:
22
+
23
+ - **Cursor**
24
+ - **GitHub Copilot**
25
+ - **Gemini CLI**
26
+
27
+ ### Fallback / manual use
28
+
29
+ Any tool that can read the generated markdown workflows can still use the framework manually, but that is outside the current native-proof story.
30
+
31
+ ## Current runtime surfaces
32
+
33
+ | Runtime | Current claim | Entry surface | Notes |
34
+ | --- | --- | --- | --- |
35
+ | Claude Code | Directly validated | `.claude/skills/`, `.claude/commands/`, `.claude/agents/` | Native surface was a mandatory Phase 32 validation target; installed generated files are freshness-checked locally |
36
+ | OpenCode | Directly validated | `.opencode/commands/`, `.opencode/agents/` | Native command and checker path; installed generated files are freshness-checked locally |
37
+ | Codex CLI | Directly validated | `.agents/skills/gsdd-*` plus `.codex/agents/gsdd-plan-checker.toml` | Portable skill entry, native checker adapter, mandatory Phase 32 validation target |
38
+ | Cursor | Same core workflow | `.agents/skills/gsdd-*` | Skills-native path; generated skill files are freshness-checked locally, but the runtime is not claimed as parity-validated |
39
+ | GitHub Copilot | Same core workflow | `.agents/skills/gsdd-*` | Skills-native path; generated skill files are freshness-checked locally, but the runtime is not claimed as parity-validated |
40
+ | Gemini CLI | Same core workflow | `.agents/skills/gsdd-*` | Skills-native path; governance is optional, generated skill files are freshness-checked locally, and parity is not claimed |
41
+
42
+ ## Generated-surface freshness
43
+
44
+ The authored source contract stays in `distilled/workflows/*`. Generated runtime-facing files are trusted only through deterministic rendering:
45
+
46
+ - `gsdd health` compares any installed generated surfaces under `.agents/skills/`, `.claude/`, `.opencode/`, and `.codex/` against current render output.
47
+ - `gsdd update` regenerates drifted generated surfaces from the authored workflow and delegate sources.
48
+ - Missing generated surfaces are not treated as drift unless the corresponding runtime surface is actually installed locally.
49
+
50
+ ## What stays portable
51
+
52
+ The portable invariant for this release is the workflow contract:
53
+
54
+ - planning
55
+ - checking and revision loops
56
+ - execution discipline
57
+ - verification
58
+ - handoff and durable repo artifacts
59
+
60
+ ## What does not stay equal yet
61
+
62
+ This release does **not** claim that every runtime has:
63
+
64
+ - the same native adapter richness
65
+ - the same invocation ergonomics
66
+ - the same validation depth
67
+ - the same checker/orchestration mechanics
68
+
69
+ Portable contract does not mean equal UX everywhere.
70
+
71
+ ## Proof references
72
+
73
+ - `README.md`
74
+ - `docs/BROWNFIELD-PROOF.md`
75
+ - `docs/proof/consumer-node-cli/README.md`
76
+ - `docs/VERIFICATION-DISCIPLINE.md`
77
+ - `gsdd health` / `gsdd update`