@pmelab/gtd 9.9.0 → 9.10.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 (3) hide show
  1. package/README.md +106 -69
  2. package/dist/gtd.bundle.mjs +307 -46
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -141,10 +141,19 @@ itself — the prompt never inlines it; it finds the entry commit (the one
141
141
  `unwind` reverted) and runs `git show` against it — and groups that diff into an
142
142
  ORDERED list of **concerns**, each one able to leave the test suite green on its
143
143
  own, classifying each as **product** (a user-facing/requirements decision) or
144
- **technical** (an implementation decision). It raises open questions for the
145
- product concerns only, in `.gtd/REQUIREMENTS.md`, folding EVERYTHING the entry
146
- commit added into those concerns — a scratch sketch and a hand-edited code
147
- change alike, since the unwind already reverted both; nothing is left to delete.
144
+ **technical** (an implementation decision). A concern's open point clears a
145
+ three-part bar before it's ever raised as a question: the answer must be a
146
+ genuine fork with divergent outcomes, the sketch/entry diff/history must not
147
+ already settle it, and getting it wrong must survive all the way to human
148
+ review. Anything below that bar — product or technical alike — triage decides
149
+ itself, recording the decision and a one-line rationale under
150
+ `## Answered Questions`, the same section a human-answered question lands in;
151
+ only a product point that clears the bar is raised as an open question in
152
+ `.gtd/REQUIREMENTS.md` (a technical point that clears it waits for the
153
+ architecture phase to raise it), folding EVERYTHING the entry commit added into
154
+ those concerns — a scratch sketch and a hand-edited code change alike, since the
155
+ unwind already reverted both; nothing is left to delete. When every concern
156
+ turns out to be technical, triage writes no `## Open Questions` section at all.
148
157
  A shared check+answer gate then probes `.gtd/REQUIREMENTS.md` for unanswered
149
158
  questions: each open question offers a couple of candidate answers plus a
150
159
  `- [ ] _your answer_` slot, and you tick exactly one per question (the gate
@@ -158,73 +167,84 @@ the plan as-is.
158
167
 
159
168
  Once the product questions are settled, `architecture.author` picks up as a
160
169
  **cold reader** — a separate machine with its own memory scope, so it does not
161
- resume the triage conversation but reads `.gtd/REQUIREMENTS.md` in full — and
162
- develops the _how_ for each settled concern, raising only technical open
163
- questions in `.gtd/ARCHITECTURE.md` (routed through that same shared
164
- check+answer gate shape, again skipping the human stop when nothing is open),
165
- deleting `.gtd/REQUIREMENTS.md` once its content is folded in. Once those are
166
- settled, `architecture.decompose` is a purely mechanical write-out — **one
167
- package file per concern**, in the settled order, with no merge/split judgement
168
- of its own (triage grouped the concerns, and `architecture.author` may already
169
- have re-merged some of them by file footprint) — handing off to the per-package
170
- build queue: each package (a set of independent tasks a single build turn fans
171
- out to parallel subagents) runs its own test loop and a per-package **agentic
172
- review** that verifies it against its own spec. A package whose work already
173
- landed (an earlier package's fix turn pulled it in) is not a dead end: the build
174
- turn records per-criterion evidence in `.gtd/SATISFIED.md` instead of
175
- implementing anything, and the package still goes through the checks and the
176
- spec review before closing out. If a queue item ever _does_ dead-end (a build
177
- turn that authors nothing stalls), the supported recovery is to write that same
178
- file yourself and `gtd land` — no hand-authored state commit.
170
+ resume the triage conversation but reads `.gtd/REQUIREMENTS.md` in full (cold
171
+ means no memory of that conversation, never no git access — it finds and reads
172
+ the entry commit from history exactly as triage did) — and develops the _how_
173
+ for each settled concern. Because it is the first state that knows the _how_, it
174
+ is also the one state allowed to re-merge concerns whose file footprints
175
+ coincide (never split), recording every merge under a `## Merged Concerns`
176
+ heading. The same three-part bar applies to every technical point here too: only
177
+ one that clears it is raised as an open question in `.gtd/ARCHITECTURE.md`;
178
+ everything below the bar, author decides itself and records under
179
+ `## Answered Questions` right alongside triage's own settled points, all of
180
+ which author treats as SETTLED regardless of whether they're product or
181
+ technical. Open questions are routed through that same shared check+answer gate
182
+ shape, again skipping the human stop when nothing is open, and
183
+ `.gtd/REQUIREMENTS.md` is deleted once its content is folded in. A process where
184
+ nothing ever clears the bar runs both phases straight through with no human stop
185
+ at all — the existing review tail, which sees the whole diff anyway, is the
186
+ veto. Once those are settled, `architecture.decompose` is a purely mechanical
187
+ write-out — **one package file per concern**, in the settled order, with no
188
+ merge/split judgement of its own (triage grouped the concerns, and
189
+ `architecture.author` may already have re-merged some of them by file footprint)
190
+ — handing off to the per-package build queue: each package (a set of independent
191
+ tasks a single build turn fans out to parallel subagents) runs its own test loop
192
+ and a per-package **agentic review** that verifies it against its own spec. A
193
+ package whose work already landed (an earlier package's fix turn pulled it in)
194
+ is not a dead end: the build turn records per-criterion evidence in
195
+ `.gtd/SATISFIED.md` instead of implementing anything, and the package still goes
196
+ through the checks and the spec review before closing out. If a queue item ever
197
+ _does_ dead-end (a build turn that authors nothing stalls), the supported
198
+ recovery is to write that same file yourself and `gtd land` — no hand-authored
199
+ state commit.
179
200
 
180
201
  The process converges on that same shared tail: an agent hands you a
181
202
  `.gtd/REVIEW.md` checkbox review of the diff — the prompt never inlines the diff
182
203
  itself; it names the commit the changes are based at and the agent runs
183
204
  `git diff` to read the range before writing the review. Each hunk is a
184
- `- [ ] ./path/to/file.ts#42` pointer with its explanation on the line(s) BELOW
185
- it, not trailing the pointer on the same line:
205
+ `- [ ] ./path/to/file.ts#42` pointer, and its explanation can either sit on the
206
+ line(s) below it or trail the pointer on the same line — both forms are equally
207
+ valid:
186
208
 
187
209
  ```
188
210
  - [ ] ./path/to/file.ts#42
189
211
  what this hunk does, with room to run to several lines
212
+ - [ ] ./path/to/file.ts#99 — a same-line note works too
190
213
  ```
191
214
 
192
- Text after the pointer token on the pointer's own line is a validation error —
193
- `gtd check`/`gtd validate`/the LSP all reject it — and, because the review
194
- gate's own emitted script runs that same check ahead of every commit, upgrading
195
- gtd mid-review leaves an already-open `.gtd/REVIEW.md` written in the old
196
- same-line form UNLANDABLE until every pointer in it is hand-edited into the new
197
- shape; there is no migration tool. If a styled `.gtd/REVIEW.md` ever comes out
198
- malformed some other way (a paragraph where a `- [ ] ./path#line` row belongs),
199
- `gtd check review` refuses the step the same way: the file stays exactly as
200
- written in the working tree, unlanded, and re-running the same prompt is the
201
- recovery — nothing is lost. While the process rests at that gate, the landing
202
- script opens a **review checkout window**: HEAD is rewound to the review base
203
- with the working tree untouched, so the whole reviewable change shows up as
204
- ordinary uncommitted changes in your editor's normal git integration (and files
205
- added during the process show up as ordinary untracked files, so discarding one
206
- deletes it — an untracked file you leave alone is not a pending change, and only
207
- actually removing it from disk counts as a deletion). The next landing's own
208
- script closes the window before it commits. Tick a box as you review each hunk
209
- (ticking just records "I read this"), and leave a **comment** to request
210
- changes: a note on a line, an inline `// TODO`-style comment in the code, or a
211
- direct code edit. A comment sends a FULL development lap, not a quick
212
- fix-and-re-review: an agent first judges whether your comment is actually
213
- actionable (a genuinely approving remark with no code edit short-circuits
214
- straight to sign-off instead), and an actionable round is re-planned from
215
- scratch through triage, architecture, and the package queue again — a hand-edit
216
- you made during review is treated as a **sketch**, the same as any other change
217
- that starts a process, not a fix the agent builds on: it is reverted out of the
218
- tree first, and your intent survives only in your own review-round commit for
219
- triage to read. There is no baseline check on the way back into planning. Only
220
- the turn that drafts the final squash message resumes the session that built the
221
- feature in the first place (the review tail is nested inside that build identity
222
- rather than sitting beside it) — an actionable round leaves that identity
223
- entirely, so it starts a fresh session like any other process. A comment is what
224
- asks for changes; landing with no comment signs off, whatever the boxes say,
225
- which collapses the whole process into one commit (a **squash finale** whose
226
- message an agent drafts). Deleting `.gtd/REVIEW.md` is refused — the guard only
227
- asks whether the step's diff deletes the file.
215
+ The one rule an explanation must follow either way: it must never itself START
216
+ with a bare `./path` token, since that parses as a second hunk pointer rather
217
+ than a note. If a styled `.gtd/REVIEW.md` ever comes out malformed some other
218
+ way (a paragraph where a `- [ ] ./path#line` row belongs), `gtd check review`
219
+ refuses the step the same way: the file stays exactly as written in the working
220
+ tree, unlanded, and re-running the same prompt is the recovery — nothing is
221
+ lost. While the process rests at that gate, the landing script opens a **review
222
+ checkout window**: HEAD is rewound to the review base with the working tree
223
+ untouched, so the whole reviewable change shows up as ordinary uncommitted
224
+ changes in your editor's normal git integration (and files added during the
225
+ process show up as ordinary untracked files, so discarding one deletes it — an
226
+ untracked file you leave alone is not a pending change, and only actually
227
+ removing it from disk counts as a deletion). The next landing's own script
228
+ closes the window before it commits. Tick a box as you review each hunk (ticking
229
+ just records "I read this"), and leave a **comment** to request changes: a note
230
+ on a line, an inline `// TODO`-style comment in the code, or a direct code edit.
231
+ A comment sends a FULL development lap, not a quick fix-and-re-review: an agent
232
+ first judges whether your comment is actually actionable (a genuinely approving
233
+ remark with no code edit short-circuits straight to sign-off instead), and an
234
+ actionable round is re-planned from scratch through triage, architecture, and
235
+ the package queue again — a hand-edit you made during review is treated as a
236
+ **sketch**, the same as any other change that starts a process, not a fix the
237
+ agent builds on: it is reverted out of the tree first, and your intent survives
238
+ only in your own review-round commit for triage to read. There is no baseline
239
+ check on the way back into planning. Only the turn that drafts the final squash
240
+ message resumes the session that built the feature in the first place (the
241
+ review tail is nested inside that build identity rather than sitting beside it)
242
+ — an actionable round leaves that identity entirely, so it starts a fresh
243
+ session like any other process. A comment is what asks for changes; landing with
244
+ no comment signs off, whatever the boxes say, which collapses the whole process
245
+ into one commit (a **squash finale** whose message an agent drafts). Deleting
246
+ `.gtd/REVIEW.md` is refused — the guard only asks whether the step's diff
247
+ deletes the file.
228
248
 
229
249
  A second entry, the same review tail's own direct entry point —
230
250
  `gtd --entry review-gate.check --var reviewBase=<commitish>` starts a brand new
@@ -1009,15 +1029,32 @@ After an agent turn at a state that declares `file:`+`mode:`, run the script:
1009
1029
  either `gtd next --json`'s own embedded `.validate` field (present at every
1010
1030
  `prompt` beat that hands over a validatable file), or, standalone,
1011
1031
  `gtd validate`'s own plain-text output — both resolve the exact same script from
1012
- one shared resolver. Exit 0 means the file is well-formed — proceed to
1013
- `gtd land`. A non-zero exit means the script's own captured output IS a
1014
- complete, ready-to-send fix prompt (an instruction plus the findings, see
1015
- `src/Emit.ts`'s `failurePromptWrapper`): send it back to the same agent session
1016
- verbatim, and cap how many fix attempts you allow yourself — the driver owns
1017
- that retry count, not gtd. Landing never TRUSTS that you validated, either: the
1018
- emitted `land` script carries the same format/validate commands ahead of its own
1019
- commit and fails without committing when they fail, so a malformed file is never
1020
- captured whether or not you ran the validate script first.
1032
+ one shared resolver. This field is now populated even at a FIRST-WRITE beat,
1033
+ before the steering file exists at all: the script itself carries a leading
1034
+ `[ -f <file> ] || exit 0` guard rather than gtd checking existence ahead of
1035
+ time, so a driver's `while [ -n "$gtd_validate" ]` repair loop is armed from the
1036
+ very first turn at a state, not just the second and later ones. Exit 0 means the
1037
+ file is well-formed (or genuinely doesn't exist yet) — proceed to `gtd land`. A
1038
+ non-zero exit usually means the script's own captured output IS a complete,
1039
+ ready-to-send fix prompt (an instruction plus the findings, see `src/Emit.ts`'s
1040
+ `failurePromptWrapper`): send it back to the same agent session verbatim, and
1041
+ cap how many fix attempts you allow yourself — the driver owns that retry count,
1042
+ not gtd. Landing never TRUSTS that you validated, either: the emitted `land`
1043
+ script carries the same format/validate commands ahead of its own commit and
1044
+ fails without committing when they fail, so a malformed file is never captured
1045
+ whether or not you ran the validate script first.
1046
+
1047
+ A non-zero exit can ALSO mean something the fix loop cannot fix: a mode whose
1048
+ `format:` command breaks its own validator, a config bug gtd detects by
1049
+ formatting a canonical sample and re-checking it before the real file's own
1050
+ findings are ever reported. That message is unmistakably different — it says
1051
+ this is a CONFIGURATION BUG, not the steering file, and tells the agent to stop
1052
+ and end its turn rather than edit anything. gtd's exit-code contract stays
1053
+ closed at five numbers (below), so nothing distinguishes the two cases at the
1054
+ process level — a driver's fix loop is still the CORRECT thing to run in both
1055
+ cases, it just can never win a contradiction: its 3-attempt cap is what ends
1056
+ one, not a fix. Reading the message text before re-prompting is what keeps an
1057
+ agent from thrashing on a document it cannot fix.
1021
1058
 
1022
1059
  ### Failure taxonomy and recovery
1023
1060