@hxp-tools/godplans 0.0.0-stage → 2.0.0

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 (144) hide show
  1. package/CHANGELOG.md +1176 -0
  2. package/LICENSE +21 -0
  3. package/PROMPT.md +4006 -0
  4. package/README.md +201 -2
  5. package/assets/README.md +11 -0
  6. package/assets/hero.svg +44 -0
  7. package/assets/plan-loop.svg +62 -0
  8. package/assets/quest-map.svg +80 -0
  9. package/bin/godplans.js +93 -0
  10. package/docs/ARCHITECTURE.md +136 -0
  11. package/docs/RELEASING.md +107 -0
  12. package/evals/README.md +295 -0
  13. package/evals/cases/brownfield-cli/EXPECTATIONS +15 -0
  14. package/evals/cases/brownfield-cli/INPUT/package.json +9 -0
  15. package/evals/cases/brownfield-cli/INPUT/src/cli.js +4 -0
  16. package/evals/cases/brownfield-cli/INPUT/src/format.js +3 -0
  17. package/evals/cases/brownfield-cli/INPUT/test/cli.test.js +7 -0
  18. package/evals/cases/brownfield-cli/REQUEST.baseline.md +10 -0
  19. package/evals/cases/brownfield-cli/REQUEST.md +10 -0
  20. package/evals/cases/compliance-refusal/EXPECTATIONS +4 -0
  21. package/evals/cases/compliance-refusal/REQUEST.baseline.md +9 -0
  22. package/evals/cases/compliance-refusal/REQUEST.md +8 -0
  23. package/evals/cases/greenfield-saas/EXPECTATIONS +21 -0
  24. package/evals/cases/greenfield-saas/REQUEST.baseline.md +11 -0
  25. package/evals/cases/greenfield-saas/REQUEST.md +11 -0
  26. package/evals/cases/nested-pillars/EXPECTATIONS +12 -0
  27. package/evals/cases/nested-pillars/REQUEST.baseline.md +10 -0
  28. package/evals/cases/nested-pillars/REQUEST.md +11 -0
  29. package/evals/cases/observability-evidence/EXPECTATIONS +10 -0
  30. package/evals/cases/observability-evidence/REQUEST.baseline.md +10 -0
  31. package/evals/cases/observability-evidence/REQUEST.md +11 -0
  32. package/evals/cases/product-business/EXPECTATIONS +18 -0
  33. package/evals/cases/product-business/REQUEST.baseline.md +13 -0
  34. package/evals/cases/product-business/REQUEST.md +14 -0
  35. package/evals/cases/product-form-routing/EXPECTATIONS +13 -0
  36. package/evals/cases/product-form-routing/REQUEST.baseline.md +11 -0
  37. package/evals/cases/product-form-routing/REQUEST.md +11 -0
  38. package/evals/cases/prose-integrity/EXPECTATIONS +19 -0
  39. package/evals/cases/prose-integrity/REQUEST.baseline.md +19 -0
  40. package/evals/cases/prose-integrity/REQUEST.md +20 -0
  41. package/evals/cases/replan-preserves-history/EXPECTATIONS +9 -0
  42. package/evals/cases/replan-preserves-history/INPUT/.godplans/PLAN.mdx +115 -0
  43. package/evals/cases/replan-preserves-history/INPUT/package.json +5 -0
  44. package/evals/cases/replan-preserves-history/REQUEST.baseline.md +10 -0
  45. package/evals/cases/replan-preserves-history/REQUEST.md +10 -0
  46. package/evals/cases/stale-prepublication/EXPECTATIONS +10 -0
  47. package/evals/cases/stale-prepublication/REQUEST.baseline.md +12 -0
  48. package/evals/cases/stale-prepublication/REQUEST.md +13 -0
  49. package/evals/cases/stale-source-evidence/EXPECTATIONS +10 -0
  50. package/evals/cases/stale-source-evidence/INPUT/package.json +8 -0
  51. package/evals/cases/stale-source-evidence/REQUEST.baseline.md +11 -0
  52. package/evals/cases/stale-source-evidence/REQUEST.md +12 -0
  53. package/evals/cases/weekend-library/EXPECTATIONS +19 -0
  54. package/evals/cases/weekend-library/REQUEST.baseline.md +10 -0
  55. package/evals/cases/weekend-library/REQUEST.md +11 -0
  56. package/evals/cases-roster.txt +19 -0
  57. package/evals/external/GRADE.schema.json +39 -0
  58. package/evals/external/README.md +42 -0
  59. package/evals/external/RUBRIC.md +32 -0
  60. package/evals/metrics/context-cost.json +154 -0
  61. package/evals/outcomes/README.md +65 -0
  62. package/evals/outcomes/cases/tenant-notes-api/REQUEST.baseline.md +14 -0
  63. package/evals/outcomes/cases/tenant-notes-api/REQUEST.md +13 -0
  64. package/evals/outcomes/cases/tenant-notes-api/VERIFY.sh +13 -0
  65. package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/README.md +93 -0
  66. package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/treatment/plan/PLAN.json +547 -0
  67. package/evals/runners/claude-baseline.sh +4 -0
  68. package/evals/runners/claude-grade.sh +3 -0
  69. package/evals/runners/claude.sh +4 -0
  70. package/evals/runners/codex-baseline.sh +181 -0
  71. package/evals/runners/codex-builder.sh +96 -0
  72. package/evals/runners/codex-godaudits.sh +84 -0
  73. package/evals/runners/codex.sh +147 -0
  74. package/evals/runners/gemini-baseline.sh +4 -0
  75. package/evals/runners/gemini-grade.sh +3 -0
  76. package/evals/runners/gemini.sh +4 -0
  77. package/evals/runners/vendor-cli.sh +257 -0
  78. package/evals/runners/vendor-grade.sh +82 -0
  79. package/install.sh +323 -0
  80. package/package.json +92 -4
  81. package/requirements/skills-ref.txt +2 -0
  82. package/scripts/build-catalog.js +114 -0
  83. package/scripts/build-prompt.sh +257 -0
  84. package/scripts/context-metrics.js +118 -0
  85. package/scripts/eval-external.js +226 -0
  86. package/scripts/eval-matrix.sh +172 -0
  87. package/scripts/eval-outcome.js +143 -0
  88. package/scripts/eval.sh +321 -0
  89. package/scripts/lint-parity.js +331 -0
  90. package/scripts/lint.sh +743 -0
  91. package/scripts/outcome-summary.js +126 -0
  92. package/scripts/release-check.sh +108 -0
  93. package/scripts/release-prepare.js +41 -0
  94. package/scripts/summarize-eval.js +91 -0
  95. package/scripts/summarize-matrix.js +101 -0
  96. package/scripts/version-sync.js +65 -0
  97. package/skills/godplans/SKILL.md +192 -0
  98. package/skills/godplans/references/agent-memory.md +168 -0
  99. package/skills/godplans/references/architecture.md +189 -0
  100. package/skills/godplans/references/build.md +130 -0
  101. package/skills/godplans/references/business.md +252 -0
  102. package/skills/godplans/references/code-quality.md +165 -0
  103. package/skills/godplans/references/compliance.md +59 -0
  104. package/skills/godplans/references/database.md +157 -0
  105. package/skills/godplans/references/deploy.md +146 -0
  106. package/skills/godplans/references/discovery.md +297 -0
  107. package/skills/godplans/references/doc-set.md +243 -0
  108. package/skills/godplans/references/exemplar.md +228 -0
  109. package/skills/godplans/references/launch.md +162 -0
  110. package/skills/godplans/references/llm.md +132 -0
  111. package/skills/godplans/references/observe.md +178 -0
  112. package/skills/godplans/references/plan-format.md +340 -0
  113. package/skills/godplans/references/product.md +130 -0
  114. package/skills/godplans/references/repo.md +184 -0
  115. package/skills/godplans/references/roadmap.md +158 -0
  116. package/skills/godplans/references/security.md +156 -0
  117. package/skills/godplans/references/seo.md +133 -0
  118. package/skills/godplans/references/stack.md +133 -0
  119. package/skills/godplans/references/style-genome.md +198 -0
  120. package/skills/godplans/references/ui.md +153 -0
  121. package/skills/godplans/references/ux.md +150 -0
  122. package/skills/godplans/schemas/PLAN.schema.json +275 -0
  123. package/skills/godplans/schemas/PLAN.v1.schema.json +258 -0
  124. package/skills/godplans/scripts/plan-halflife.sh +76 -0
  125. package/skills/godplans/scripts/style-stats.py +630 -0
  126. package/skills/godplans/scripts/validate-plan.sh +1709 -0
  127. package/skills/godplans/templates/PLAN.template.mdx +269 -0
  128. package/tests/agent-memory-guidance.sh +32 -0
  129. package/tests/build-catalog.sh +81 -0
  130. package/tests/codex-runner.sh +139 -0
  131. package/tests/eval-harness.sh +377 -0
  132. package/tests/evidence-harnesses.sh +243 -0
  133. package/tests/fixtures/plan-json-v1-1.13.0.json +472 -0
  134. package/tests/install-regression.sh +246 -0
  135. package/tests/lib/plan-schema-check.js +163 -0
  136. package/tests/lint-selftest.sh +582 -0
  137. package/tests/package-contents.sh +140 -0
  138. package/tests/portable-prompt.test.sh +261 -0
  139. package/tests/release-tooling.sh +204 -0
  140. package/tests/run.sh +14 -0
  141. package/tests/script-usage.sh +37 -0
  142. package/tests/style-stats.sh +170 -0
  143. package/tests/validate-plan.sh +1970 -0
  144. package/tests/vendor-runner.sh +291 -0
@@ -0,0 +1,269 @@
1
+ ---
2
+ name: PROJECT-SLUG
3
+ plan_version: 1
4
+ status: planning
5
+ created: YYYY-MM-DD
6
+ updated: YYYY-MM-DD
7
+ mode: greenfield
8
+ product_form: PRODUCT-FORM
9
+ archetype: ARCHETYPE
10
+ archetype_confidence: ARCHETYPE-CONFIDENCE
11
+ overlays: []
12
+ public_release: PUBLIC-RELEASE-BOOLEAN
13
+ source_revision: SOURCE-REVISION-OR-NONE
14
+ input_digest: sha256:INPUT-DIGEST
15
+ validated_at: YYYY-MM-DDTHH:MM:SSZ
16
+ domains_applicable: []
17
+ domains_deferred: []
18
+ domains_excluded: []
19
+ progress:
20
+ phases_total: 0
21
+ phases_done: 0
22
+ tasks_total: 0
23
+ tasks_done: 0
24
+ ---
25
+
26
+ # PROJECT-NAME master plan
27
+
28
+ One paragraph: what this project is, for whom, and the observable definition
29
+ of done ("done means: a new user can X, Y is deployed at Z, the suite passes").
30
+
31
+ ## Scope and non-goals
32
+
33
+ In scope: the smallest first cut that proves the approach.
34
+ Non-goals: named exclusions with a word on why (deferred, out of scope, or rejected).
35
+ Scale and capacity: CALIBRATION; CAPACITY; at most N phases and N tasks; planned task appetites total N.
36
+
37
+ ## Plan provenance
38
+
39
+ Source revision: SOURCE-REVISION-OR-NONE
40
+ Input digest: sha256:INPUT-DIGEST
41
+ Validated at: YYYY-MM-DDTHH:MM:SSZ
42
+ Evidence inventory:
43
+ - `intake` = `sha256:INTAKE-DIGEST`
44
+ - [recheck] `path/to/stable-artifact` = `sha256:EVIDENCE-DIGEST`
45
+
46
+ ## Product form
47
+
48
+ Primary: web application | API or service | CLI or SDK | mobile or desktop | data or ML | infrastructure or IaC.
49
+ Vertical slice: the form-specific end-to-end path from discovery.md.
50
+ Completion evidence: the form-specific gate that proves a user-operable increment.
51
+ Secondary form: none, unless it has its own user, contract, distribution path, deliverable, and completion evidence.
52
+
53
+ ### Archetype confidence
54
+
55
+ - Primary: ARCHETYPE (score 0.00)
56
+ - Runner-up: RUNNER-UP-ARCHETYPE (score 0.00)
57
+ - Margin: N points
58
+ - Confidence: high | medium | low
59
+ - Vetoes applied: none, or the archetype and the signal that zeroed it
60
+ - Overlays: none, or the frontmatter list
61
+ - If the runner-up is right: +N tasks and +N phases; what flips in the matrix and which GP tasks appear or drop
62
+
63
+ Margin is (primary - runner-up) * 100 rounded. Confidence is high at margin 15
64
+ or more and score 0.70 or more, medium with exactly one, low with neither; the
65
+ validator recomputes both. Below a primary score of 0.45 the frontmatter
66
+ archetype is unknown. A low-confidence or below-floor archetype also appears in
67
+ Open Questions, and no assure-stage documentation row may be not-applicable
68
+ while it stands.
69
+
70
+ ## Compliance gate
71
+
72
+ Result: pass
73
+ Screened: YYYY-MM-DD against anthropic.com/legal/aup.
74
+ Account safety: unattended runs use supported workload authentication; no subscription credentials outside official clients.
75
+
76
+ ## Applicability matrix
77
+
78
+ Statuses: applicable (pass runs now), deferred (deferrable set only: seo,
79
+ launch, observe, ui, deploy; the row names the trigger and the reversibility
80
+ argument), excluded (evidence state + project-specific reason + revisit when).
81
+
82
+ An excluded cell reads: `absent:` or `by-design:`, then the reason, then
83
+ `revisit when:` and an observable predicate. `unknown:` and `hint:` are refused.
84
+
85
+ | Domain | Status | Reason |
86
+ |---|---|---|
87
+ | product | applicable | |
88
+ | business | applicable-or-excluded | state: reason; revisit when: predicate |
89
+ | architecture | applicable | |
90
+ | stack | applicable | |
91
+ | database | applicable-or-excluded | state: reason; revisit when: predicate |
92
+ | security | applicable | never excluded or deferred, scales with calibration |
93
+ | llm | applicable-or-excluded | state: reason; revisit when: predicate |
94
+ | ux | applicable-or-excluded | state: reason; revisit when: predicate |
95
+ | ui | applicable-deferred-or-excluded | excluded: state + reason + revisit when; deferred: trigger + reversibility |
96
+ | seo | applicable-deferred-or-excluded | excluded: state + reason + revisit when; deferred: trigger + reversibility |
97
+ | code-quality | applicable | never excluded or deferred, scales with calibration |
98
+ | style-genome | applicable | |
99
+ | agent-memory | applicable | |
100
+ | repo | applicable | |
101
+ | build | applicable | |
102
+ | roadmap | applicable | |
103
+ | deploy | applicable-deferred-or-excluded | excluded: state + reason + revisit when; deferred: trigger + reversibility |
104
+ | observe | applicable-deferred-or-excluded | excluded: state + reason + revisit when; deferred: trigger + reversibility |
105
+ | launch | applicable-deferred-or-excluded | excluded: state + reason + revisit when; deferred: trigger + reversibility |
106
+
107
+ One module disposition line per applicable module follows. `dropped-by` names
108
+ the layer that removed a requirement: scale, archetype, or form. A dropped ID
109
+ appears on no task.
110
+
111
+ ### Module disposition
112
+
113
+ - MODULE: landed R-XXX-n, R-XXX-n; dropped-by scale R-XXX-n (reason)
114
+
115
+ ## Decisions
116
+
117
+ Hard-to-reverse bets first. Each `### D<n>:` entry: the decision with rationale
118
+ and rejected alternatives and a structured Falsifier block (the observable
119
+ signal, failure boundary, and return-to-planning action). Hypotheses go in the
120
+ `### Assumptions ledger`; pointers to Open Questions sit in a D<n> body. No other
121
+ `###` headings belong under Decisions.
122
+
123
+ ### D1: (data-model shape / tenancy)
124
+ Falsifier:
125
+ - Signal: (metric or event and its evidence source)
126
+ - Failure boundary: (numeric threshold or observable event that kills D1)
127
+ - Replan action: return to planning and (reconsidered alternative or migration)
128
+ ### D2: (auth and ownership boundary)
129
+ Falsifier:
130
+ - Signal: (metric or event and its evidence source)
131
+ - Failure boundary: (numeric threshold or observable event that kills D2)
132
+ - Replan action: return to planning and (reconsidered alternative or migration)
133
+ ### D3: (wire format and public identifiers)
134
+ Falsifier:
135
+ - Signal: (metric or event and its evidence source)
136
+ - Failure boundary: (numeric threshold or observable event that kills D3)
137
+ - Replan action: return to planning and (reconsidered alternative or migration)
138
+ ### Assumptions ledger
139
+ Defaults taken without asking, each flagged as a hypothesis, priced in tasks and
140
+ phases, and pointed at the task that validates it.
141
+
142
+ - A1: (the default taken, and what suggested it)
143
+ - Blast radius: wrong costs +N tasks and +N phases; (what structurally changes)
144
+ - Validated by: GP-nnn
145
+
146
+ ## Requirements
147
+
148
+ ### Story 1: (role) can (capability)
149
+ R-1.1: WHEN (trigger) THE SYSTEM SHALL (observable behavior).
150
+ R-1.2: IF (condition) WHEN (trigger) THE SYSTEM SHALL (observable behavior).
151
+
152
+ Other applicable domains whose pass writes prose get `## <Domain>` sections in
153
+ Phase 4 table order: Business before Architecture, Stack through Code quality
154
+ before Style genome, and Repository, Application build, Deployment,
155
+ Observability, and Launch after Agent memory.
156
+
157
+ ## Architecture
158
+
159
+ Prose plus the diagrams that carry decisions (mermaid: graph TD with trust
160
+ boundaries, erDiagram, sequenceDiagram for the load-bearing flow). No decorative
161
+ diagrams; each one sits next to the claim it supports.
162
+
163
+ ## Style genome
164
+
165
+ Naming, file organization, error-handling idiom, comment policy, formatting
166
+ authority. Brownfield: extracted from the codebase, with file citations.
167
+
168
+ ## Agent memory
169
+
170
+ The AGENTS.md and pillar files the scaffold task emits, listed with their
171
+ one-line purposes.
172
+
173
+ ## Documentation set
174
+
175
+ This manifest covers documentation committed to this repository. Documents that
176
+ live in a wiki, an intranet, or a compliance platform are marked
177
+ present-elsewhere and are not planned here.
178
+
179
+ Catalog ids, stages, owners, and selection rules come from doc-set.md. Required
180
+ and recommended rows name the task that writes them. Not-applicable rows carry
181
+ an evidence state (absent, by-design, or present-elsewhere), a reason, and a
182
+ revisit-when predicate.
183
+
184
+ | Document | Stage | Verdict | Owner | Selected by, or reason and revisit when |
185
+ |---|---|---|---|---|
186
+ | decide.adr | decide | required | architecture | always; written by GP-nnn |
187
+ | build.readme | build | required | repo | always; written by GP-nnn |
188
+ | build.style-genome | build | required | style-genome | always; written by GP-nnn |
189
+ | assure.threat-model | assure | required-or-not-applicable | security | selecting signal and its task, or state + reason + revisit when |
190
+ | operate.runbook | operate | required-or-not-applicable | observe | selecting signal and its task, or state + reason + revisit when |
191
+ | verify.traceability | verify | not-applicable | roadmap | by-design: no external authorizer; revisit when: a contract or regulator requires an audit trail |
192
+
193
+ ## Phases
194
+
195
+ ## Phase 1: NAME
196
+
197
+ Goal: one sentence. Blocks: what this phase gates.
198
+
199
+ ### Wave 1.1
200
+
201
+ - [ ] GP-101 [W1.1] Imperative title
202
+ - Files: exact/paths.ext
203
+ - Depends on: none
204
+ - Reuses: what exists already
205
+ - Acceptance: 2-4 grep-verifiable conditions
206
+ - Verify: `exact command`
207
+ - Requirements: R-1.1, R-DOM-n
208
+
209
+ Checkpoint: the independently observable outcome of Phase 1.
210
+ Checkpoint verify: `exact command that reproves the phase outcome`
211
+
212
+ Must-haves:
213
+ - Truth: observable behavior with its manual check
214
+ - Artifact: path that must exist with what it exports
215
+ - Link: proof the pieces are wired (import, route registration, config reference)
216
+
217
+ ## Phase N: Verification
218
+
219
+ Goal: prove the built system satisfies the plan end to end.
220
+
221
+ ### Wave N.1
222
+
223
+ - [ ] GP-N01 [WN.1] Full suite, lint, build, end-to-end smoke
224
+ - Files: none (runs existing checks)
225
+ - Depends on: PRIOR-TASK-IDS (replace with comma-separated GP IDs)
226
+ - Reuses: the project's existing test, lint, build, and smoke commands
227
+ - Acceptance: suite green, lint clean, build succeeds, smoke exercises the primary journey by its real command or manual path
228
+ - Verify: `exact command chain, e.g. npm test && npm run lint && npm run build && npm run smoke`
229
+ - Requirements: R-1.1, R-CODE-n, R-SEC-n (list the load-bearing IDs; never write "all")
230
+
231
+ Checkpoint: a fresh clone passes every check with one command sequence.
232
+ Checkpoint verify: `exact full-suite and smoke command`
233
+
234
+ ## Open Questions
235
+
236
+ The only enumeration of open decisions, and only the residual ones: an unknown
237
+ that must be settled before dependent work is a flagged hypothesis in Decisions
238
+ with an R-ROAD-7 validation task scheduled ahead of it, not a question. Write
239
+ `None.` when there are none; otherwise one `### Q<n>:` entry each.
240
+
241
+ ### Q1: (the question, phrased so its answer is a decision)
242
+ - Owner: (the role that answers; say when the answer is not the agent's to give)
243
+ - Blocks: build | ship | nothing, and the boundary it blocks at
244
+ - Decide by: (date, phase start, or wave boundary; never "later")
245
+ - Why it matters: (what changes on each answer)
246
+ - Options: (a) ...; (b) ...; (c) the option from outside the shared framing
247
+ - Recommended default: (the option the plan executes on if nobody answers, and why taking it early is safe)
248
+
249
+ ## Rules for executing agents
250
+
251
+ > [!IMPORTANT]
252
+ > This plan is the source of truth. The chat is not.
253
+ >
254
+ > 1. Before any work: read the frontmatter and `## Plan provenance`, then re-derive state from disk. Recheck recorded completed or imported evidence; if material evidence drifted, change status to `planning`, record the stale evidence, and stop for replan. Otherwise refuse unless `status` is `approved` or `executing`. `planning` awaits sign-off; `done` is closed. Run `bash .godplans/validate-plan.sh .godplans/PLAN.mdx`. If status is `approved`, change it to `executing` and update the date before the first task.
255
+ > 2. Find the first unchecked task in wave order. Re-derive state from checkboxes; trust nothing remembered.
256
+ > 3. One task at a time. Respect Depends on. Tasks marked [P] may run concurrently; the validator has already proved their Files lists are disjoint from every other unchecked task in the wave, so treat [P] as the schedulable set and never widen it by hand.
257
+ > 4. Run the task's Verify command. Only after it passes, flip [ ] to [x] and update the frontmatter counters and `updated:` date in the same edit. Never batch check-offs. Regenerate the sidecar in the same batch: `bash .godplans/validate-plan.sh --allow-planning --emit-json .godplans/PLAN.json .godplans/PLAN.mdx`.
258
+ > 5. If Verify fails: the box stays unchecked. Append a `- Note (YYYY-MM-DD):` line under the task, indented two spaces like its fields, saying what happened.
259
+ > 6. Phase-boundary gate: before the first task of a new phase, run `bash .godplans/validate-plan.sh --drift-check N .godplans/PLAN.mdx`, replacing N with the completed phase. The command recomputes `[recheck]` provenance files, reruns a deterministic sample of up to three completed task Verify commands, and reruns the phase's Checkpoint verify command. Any failure returns status to `planning` and stops execution for replan.
260
+ > 7. If a deferred domain's trigger fires, or the `revisit when:` predicate of an excluded domain or a not-applicable document row comes true (a task would add what it names), return status to `planning` and run that domain's pass or reselect that document before continuing.
261
+ > 8. Scope changes are not improvised. Return status to `planning`, patch the plan (new task IDs, struck-through superseded tasks with a reason), increment `plan_version`, and obtain fresh approval before more execution.
262
+ > 9. Never renumber, reword, or uncheck a completed task.
263
+ > 10. At session end: append one line to `## Session log`: date, tasks completed, where you stopped, what is next.
264
+ > 11. Re-read the current phase before starting it; re-read Decisions before touching anything they govern.
265
+ > 12. After every task is checked and the final Verification phase passes, change status from `executing` to `done`, update the date, and run `bash .godplans/validate-plan.sh --allow-planning .godplans/PLAN.mdx` for a final structural check.
266
+
267
+ ## Session log
268
+
269
+ - YYYY-MM-DD plan created (godplans v2.0.0)
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env bash
2
+ # tests/agent-memory-guidance.sh: guard the agent-memory module against wording
3
+ # that reverses its always-load rules. Context and repo are a mandatory floor
4
+ # inside one always-loaded scope total; other always-loaded pillars are allowed
5
+ # when justified, so the module must never limit always-load to the floor.
6
+ #
7
+ # Reads the canonical module in place and writes nothing.
8
+
9
+ set -euo pipefail
10
+
11
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
12
+ MODULE="$ROOT/skills/godplans/references/agent-memory.md"
13
+
14
+ fail() {
15
+ echo "FAIL [agent-memory-guidance] $*" >&2
16
+ exit 1
17
+ }
18
+
19
+ [ -f "$MODULE" ] || fail "missing ${MODULE#"$ROOT"/}"
20
+
21
+ if grep -Fq 'only for context and repo' "$MODULE"; then
22
+ fail "agent-memory guidance forbids justified additional always-loaded pillars"
23
+ fi
24
+ if grep -Fq 'scope floor total' "$MODULE"; then
25
+ fail "agent-memory guidance uses the contradictory scope floor total name"
26
+ fi
27
+ grep -Fq 'agents/context.md and agents/repo.md at status: present with always_load: true' "$MODULE" ||
28
+ fail "agent-memory guidance lost the mandatory context and repo floor"
29
+ grep -Fq 'always-loaded scope total' "$MODULE" ||
30
+ fail "agent-memory guidance lost the total always-load budget"
31
+
32
+ echo "ok [agent-memory-guidance]"
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env bash
2
+ # The catalog generator is maintainer tooling under scripts/, outside the
3
+ # shipped skill. It must resolve the skill from its own location; count only a
4
+ # requirement id that starts a line as a definition, never a mid-sentence
5
+ # citation; and fail, leaving the validator unwritten, when a documentation-set
6
+ # owner is not a validator domain or the %known_domain table is missing.
7
+
8
+ set -euo pipefail
9
+
10
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
11
+ TMP="$(mktemp -d)"
12
+ trap 'rm -rf "$TMP"' EXIT
13
+
14
+ fail() {
15
+ echo "FAIL [build-catalog] $*" >&2
16
+ exit 1
17
+ }
18
+
19
+ [ ! -e "$ROOT/skills/godplans/scripts/build-catalog.js" ] ||
20
+ fail "the maintainer catalog generator ships inside the skill"
21
+
22
+ # Every mutation below happens in a scratch copy, never the tracked validator.
23
+ REPO="$TMP/repo"
24
+ mkdir -p "$REPO/scripts" "$REPO/skills/godplans/scripts"
25
+ cp "$ROOT/scripts/build-catalog.js" "$REPO/scripts/build-catalog.js"
26
+ cp -R "$ROOT/skills/godplans/references" "$REPO/skills/godplans/references"
27
+ cp "$ROOT/skills/godplans/scripts/validate-plan.sh" "$REPO/skills/godplans/scripts/validate-plan.sh"
28
+ VALIDATOR="$REPO/skills/godplans/scripts/validate-plan.sh"
29
+
30
+ (cd "$TMP" && node "$REPO/scripts/build-catalog.js" --check >/dev/null) ||
31
+ fail "a fresh catalog failed --check when run outside the repository root"
32
+
33
+ # Only an id that starts a line defines a requirement. A mid-sentence citation
34
+ # of the next SEC number is a cross-reference and must not raise %catalog_max;
35
+ # the same id starting a line in security.md is a definition and must.
36
+ sec_max=$(sed -n 's/^ *SEC => \([0-9][0-9]*\),$/\1/p' "$VALIDATOR")
37
+ [ -n "$sec_max" ] || fail "fixture could not read SEC from %catalog_max"
38
+ next="R-SEC-$((sec_max + 1))"
39
+ REFS="$REPO/skills/godplans/references"
40
+ cp "$REFS/business.md" "$TMP/business.md"
41
+ cp "$REFS/security.md" "$TMP/security.md"
42
+ perl -0pi -e "s/^## Plan requirements\n/## Plan requirements\n\nThis module also relies on $next from security.\n/m" "$REFS/business.md"
43
+ grep -Fq "relies on $next from" "$REFS/business.md" || fail "fixture did not add the cross-reference"
44
+ node "$REPO/scripts/build-catalog.js" --check >"$TMP/xref.out" 2>&1 ||
45
+ fail "a mid-sentence cross-reference changed the catalog: $(cat "$TMP/xref.out")"
46
+ cp "$TMP/business.md" "$REFS/business.md"
47
+ perl -0pi -e "s/^## Plan requirements\n/## Plan requirements\n\n$((sec_max + 1)). $next: A fixture requirement.\n/m" "$REFS/security.md"
48
+ grep -q "^$((sec_max + 1))\. $next:" "$REFS/security.md" || fail "fixture did not add the defining line"
49
+ if node "$REPO/scripts/build-catalog.js" --check >"$TMP/def.out" 2>&1; then
50
+ fail "a new defining line did not change the catalog"
51
+ fi
52
+ grep -Fq 'Validator catalog is stale' "$TMP/def.out" ||
53
+ fail "a new defining line was not reported as stale: $(cat "$TMP/def.out")"
54
+ cp "$TMP/security.md" "$REFS/security.md"
55
+
56
+ # Reassign the first catalog row to an owner the validator has no domain for.
57
+ DOC_SET="$REPO/skills/godplans/references/doc-set.md"
58
+ cp "$DOC_SET" "$TMP/doc-set.md"
59
+ perl -0pi -e 's/^(\|\s*`[a-z]+\.[a-z0-9-]+`\s*\|\s*(?:durable|evidence|transient)\s*\|\s*)[a-z-]+/${1}marketing/m' "$DOC_SET"
60
+ grep -q '| marketing |' "$DOC_SET" || fail "fixture did not rewrite a catalog owner"
61
+ if node "$REPO/scripts/build-catalog.js" --check >"$TMP/check.out" 2>&1; then
62
+ fail "--check accepted a documentation owner outside the validator domains"
63
+ fi
64
+ grep -Fq "owner 'marketing' is not a validator domain" "$TMP/check.out" ||
65
+ fail "unknown owner was not named: $(cat "$TMP/check.out")"
66
+ if node "$REPO/scripts/build-catalog.js" >"$TMP/write.out" 2>&1; then
67
+ fail "regeneration accepted a documentation owner outside the validator domains"
68
+ fi
69
+ cmp -s "$ROOT/skills/godplans/scripts/validate-plan.sh" "$VALIDATOR" ||
70
+ fail "a rejected catalog still rewrote the validator"
71
+
72
+ # Without the validator's domain table there is nothing to check owners against.
73
+ cp "$TMP/doc-set.md" "$DOC_SET"
74
+ perl -0pi -e 's/my %known_domain = /my %renamed_domain = /' "$VALIDATOR"
75
+ if node "$REPO/scripts/build-catalog.js" --check >"$TMP/table.out" 2>&1; then
76
+ fail "--check passed without the validator's known-domain table"
77
+ fi
78
+ grep -Fq '%known_domain' "$TMP/table.out" ||
79
+ fail "a missing known-domain table was not named: $(cat "$TMP/table.out")"
80
+
81
+ echo "ok [build-catalog]"
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
6
+ TMP="$(mktemp -d)"
7
+ trap 'rm -rf "$TMP"' EXIT
8
+
9
+ fail() {
10
+ echo "FAIL [codex-runner] $*" >&2
11
+ exit 1
12
+ }
13
+
14
+ mkdir -p "$TMP/bin" "$TMP/case" "$TMP/output"
15
+ printf '%s\n' '# evaluation request' > "$TMP/case/REQUEST.md"
16
+ printf '%s\n' '# valid plan artifact' > "$TMP/PLAN.mdx"
17
+ node -e '
18
+ const fs = require("node:fs");
19
+ const crypto = require("node:crypto");
20
+ const bytes = fs.readFileSync(process.argv[1]);
21
+ fs.writeFileSync(process.argv[2], JSON.stringify({
22
+ format: "godplans/plan-json@2",
23
+ plan_digest: "sha256:" + crypto.createHash("sha256").update(bytes).digest("hex")
24
+ }));
25
+ ' "$TMP/PLAN.mdx" "$TMP/PLAN.json"
26
+
27
+ printf '%s\n' \
28
+ '#!/usr/bin/env bash' \
29
+ 'set -euo pipefail' \
30
+ 'if [ "${1:-}" = "--version" ]; then echo "fake-codex 1.0"; exit 0; fi' \
31
+ 'work=""' \
32
+ 'last=""' \
33
+ 'while [ "$#" -gt 0 ]; do' \
34
+ ' case "$1" in' \
35
+ ' -C) work=$2; shift ;;' \
36
+ ' -o) last=$2; shift ;;' \
37
+ ' esac' \
38
+ ' shift' \
39
+ 'done' \
40
+ "sed -n '1,\$p' >/dev/null" \
41
+ 'mkdir -p "$work/.godplans"' \
42
+ 'cp "$GODPLANS_TEST_PLAN" "$work/.godplans/PLAN.mdx"' \
43
+ 'cp "$GODPLANS_TEST_SIDECAR" "$work/.godplans/PLAN.json"' \
44
+ 'if [ "${GODPLANS_FAKE_COMPANION:-0}" -eq 1 ]; then' \
45
+ ' cp "$GODPLANS_TEST_VALIDATOR" "$work/.godplans/validate-plan.sh"' \
46
+ ' chmod +x "$work/.godplans/validate-plan.sh"' \
47
+ 'fi' \
48
+ 'printf "%s\n" "evaluation complete" > "$last"' \
49
+ > "$TMP/bin/codex"
50
+ chmod +x "$TMP/bin/codex"
51
+
52
+ set +e
53
+ PATH="$TMP/bin:$PATH" \
54
+ GODPLANS_TEST_PLAN="$TMP/PLAN.mdx" \
55
+ GODPLANS_TEST_SIDECAR="$TMP/PLAN.json" \
56
+ GODPLANS_TEST_VALIDATOR="$ROOT/skills/godplans/scripts/validate-plan.sh" \
57
+ "$ROOT/evals/runners/codex.sh" "$TMP/case/REQUEST.md" "$TMP/output/missing/PLAN.mdx" \
58
+ >"$TMP/missing.out" 2>&1
59
+ missing_status=$?
60
+ set -e
61
+ [ "$missing_status" -ne 0 ] || fail "runner accepted a missing validator companion"
62
+ grep -q 'did not emit an executable validator' "$TMP/missing.out" || fail "missing companion diagnostic was absent"
63
+
64
+ PATH="$TMP/bin:$PATH" \
65
+ GODPLANS_TEST_PLAN="$TMP/PLAN.mdx" \
66
+ GODPLANS_TEST_SIDECAR="$TMP/PLAN.json" \
67
+ GODPLANS_TEST_VALIDATOR="$ROOT/skills/godplans/scripts/validate-plan.sh" \
68
+ GODPLANS_FAKE_COMPANION=1 \
69
+ GODPLANS_EVAL_MODEL=fake-model \
70
+ GODPLANS_EVAL_REASONING_EFFORT=medium \
71
+ "$ROOT/evals/runners/codex.sh" "$TMP/case/REQUEST.md" "$TMP/output/complete/PLAN.mdx"
72
+
73
+ cmp -s "$TMP/PLAN.mdx" "$TMP/output/complete/PLAN.mdx" || fail "plan artifact was not retained"
74
+ cmp -s "$TMP/PLAN.json" "$TMP/output/complete/PLAN.json" || fail "plan sidecar was not retained"
75
+ cmp -s "$ROOT/skills/godplans/scripts/validate-plan.sh" "$TMP/output/complete/validate-plan.sh" || fail "validator artifact drifted"
76
+ grep -q '^codex_version=fake-codex 1.0$' "$TMP/output/complete/RUNNER.txt" || fail "CLI version metadata is missing"
77
+ grep -q '^model=fake-model$' "$TMP/output/complete/RUNNER.txt" || fail "model metadata is missing"
78
+ grep -q '^reasoning_effort=medium$' "$TMP/output/complete/RUNNER.txt" || fail "reasoning metadata is missing"
79
+ grep -q '^usage_source=unavailable$' "$TMP/output/complete/RUNNER.txt" || fail "usage metadata fallback is missing"
80
+
81
+ # Control arm. The case carries a prior plan at INPUT/.godplans/PLAN.mdx, as the
82
+ # replan case does, and its neutral request names PLAN.md. The control's plan
83
+ # is what it wrote, never the fixture it left unchanged.
84
+ mkdir -p "$TMP/bin-base" "$TMP/control/INPUT/.godplans" "$TMP/codex-home"
85
+ printf '%s\n' 'SKILL-ARM-REQUEST' > "$TMP/control/REQUEST.md"
86
+ printf '%s\n' 'NEUTRAL-REQUEST. Write your plan to PLAN.md.' > "$TMP/control/REQUEST.baseline.md"
87
+ printf '%s\n' '# prior plan fixture' > "$TMP/control/INPUT/.godplans/PLAN.mdx"
88
+ cat > "$TMP/bin-base/codex" <<'FAKE'
89
+ #!/usr/bin/env bash
90
+ set -euo pipefail
91
+ if [ "${1:-}" = "--version" ]; then echo "fake-codex 1.0"; exit 0; fi
92
+ work=""
93
+ last=""
94
+ while [ "$#" -gt 0 ]; do
95
+ case "$1" in
96
+ -C) work=$2; shift ;;
97
+ -o) last=$2; shift ;;
98
+ esac
99
+ shift
100
+ done
101
+ cat > "$GODPLANS_TEST_PROMPT"
102
+ case "$GODPLANS_FAKE_MODE" in
103
+ plan-md) printf '%s\n' '# control plan' > "$work/PLAN.md" ;;
104
+ edit-fixture) printf '%s\n' '- control edit in place' >> "$work/.godplans/PLAN.mdx" ;;
105
+ none) ;;
106
+ esac
107
+ printf '%s\n' 'control final message' > "$last"
108
+ FAKE
109
+ chmod +x "$TMP/bin-base/codex"
110
+
111
+ run_control() {
112
+ PATH="$TMP/bin-base:$PATH" CODEX_HOME="$TMP/codex-home" \
113
+ GODPLANS_TEST_PROMPT="$TMP/control-prompt.txt" GODPLANS_FAKE_MODE=$1 \
114
+ "$ROOT/evals/runners/codex-baseline.sh" "$TMP/control/REQUEST.md" "$TMP/output/control-$1/$2"
115
+ }
116
+
117
+ run_control plan-md PLAN.mdx >/dev/null 2>&1 || fail "baseline runner failed"
118
+ grep -qx '# control plan' "$TMP/output/control-plan-md/PLAN.mdx" ||
119
+ fail "baseline runner took the INPUT fixture instead of the PLAN.md the control wrote"
120
+ grep -q 'NEUTRAL-REQUEST' "$TMP/control-prompt.txt" || fail "baseline runner did not send REQUEST.baseline.md"
121
+ if grep -qi -e godplans -e 'SKILL-ARM-REQUEST' "$TMP/control-prompt.txt"; then
122
+ fail "baseline prompt leaks the skill or the skill-arm request"
123
+ fi
124
+ grep -q '^prompt=neutral-baseline-request$' "$TMP/output/control-plan-md/RUNNER.txt" ||
125
+ fail "baseline runner did not record the neutral request"
126
+ run_control none PLAN.mdx >/dev/null 2>&1 || fail "a control that wrote no plan was reported as a runner error"
127
+ grep -qx 'control final message' "$TMP/output/control-none/PLAN.mdx" ||
128
+ fail "a control that wrote no plan was scored on the unchanged INPUT fixture"
129
+ run_control edit-fixture PLAN.mdx >/dev/null 2>&1 || fail "baseline runner failed on an in-place edit"
130
+ grep -q 'control edit in place' "$TMP/output/control-edit-fixture/PLAN.mdx" ||
131
+ fail "a control that edited the prior plan in place lost that edit"
132
+ # The refusal branch reads the same paths: a control that plans a request it
133
+ # should refuse is recorded as that plan.
134
+ rm -rf "$TMP/output/control-plan-md"
135
+ run_control plan-md RESPONSE.md >/dev/null 2>&1 || fail "baseline runner failed on a refusal case"
136
+ grep -qx '# control plan' "$TMP/output/control-plan-md/RESPONSE.md" ||
137
+ fail "a control plan written to PLAN.md for a refusal case was not recorded"
138
+
139
+ echo "ok [codex-runner]"