@pmelab/gtd 24.0.0 → 24.1.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 (196) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +31 -5
  3. package/claude/hooks/access.ts +1 -1
  4. package/dist/chunks/Schema-Dh-mkwkq.mjs +25353 -0
  5. package/dist/chunks/reserved-ejn-LVYO.mjs +1388 -0
  6. package/dist/chunks/rolldown-runtime-8H4AJuhK.mjs +14 -0
  7. package/dist/chunks/steering-D-PvRC5W.mjs +16296 -0
  8. package/dist/chunks/wire-DA7q2ikx.mjs +473 -0
  9. package/dist/flows.mjs +525 -0
  10. package/dist/gtd.bundle.mjs +43339 -55575
  11. package/dist/steering.mjs +2 -0
  12. package/dist/testkit.mjs +13006 -0
  13. package/dist/wire.mjs +2 -0
  14. package/dist/workflow-kit.mjs +352 -0
  15. package/dist/workflows/feature.mjs +315 -0
  16. package/dist/workflows/fix.mjs +40 -0
  17. package/dist/workflows/review.mjs +25 -0
  18. package/dist/workflows.mjs +8 -6
  19. package/package.json +69 -8
  20. package/src/cli/Cli.test.ts +1329 -0
  21. package/src/cli/Cli.ts +1348 -0
  22. package/src/cli/Program.test.ts +2262 -0
  23. package/src/cli/Program.ts +1331 -0
  24. package/src/cli/ToolCommands.ts +43 -0
  25. package/src/cli/index.ts +14 -0
  26. package/src/edge/Edge.test.ts +1016 -0
  27. package/src/edge/Edge.ts +1225 -0
  28. package/src/edge/index.ts +16 -0
  29. package/src/emit/Emit.test.ts +425 -0
  30. package/src/emit/Emit.ts +139 -0
  31. package/src/emit/GitScript.test.ts +260 -0
  32. package/src/emit/GitScript.ts +131 -0
  33. package/src/emit/ModeContradiction.test.ts +120 -0
  34. package/src/emit/ModeContradiction.ts +66 -0
  35. package/src/emit/OutcomeScript.test.ts +238 -0
  36. package/src/emit/OutcomeScript.ts +73 -0
  37. package/src/emit/SteeringMode.test.ts +274 -0
  38. package/src/emit/SteeringMode.ts +256 -0
  39. package/src/emit/index.ts +40 -0
  40. package/src/install/ConfigScaffold.ts +19 -0
  41. package/src/install/Install.test.ts +426 -0
  42. package/src/install/Install.ts +634 -0
  43. package/src/install/Version.ts +27 -0
  44. package/src/install/index.ts +3 -0
  45. package/src/platform/CommandRunner.ts +74 -0
  46. package/src/platform/Commentary.test.ts +126 -0
  47. package/src/platform/Commentary.ts +92 -0
  48. package/src/platform/Git.test.ts +50 -0
  49. package/src/platform/Git.ts +552 -0
  50. package/src/platform/Host.ts +42 -0
  51. package/src/platform/RetainedHistory.test.ts +65 -0
  52. package/src/platform/RetainedHistory.ts +34 -0
  53. package/src/platform/Workspace.test.ts +669 -0
  54. package/src/platform/Workspace.ts +631 -0
  55. package/src/platform/WorktreeState.test.ts +162 -0
  56. package/src/platform/WorktreeState.ts +50 -0
  57. package/src/platform/index.ts +22 -0
  58. package/src/replay/Access.test.ts +53 -0
  59. package/src/replay/Access.ts +46 -0
  60. package/src/replay/Format.test.ts +20 -0
  61. package/src/replay/Format.ts +14 -0
  62. package/src/replay/Replay.test.ts +887 -0
  63. package/src/replay/Replay.ts +669 -0
  64. package/src/replay/Trailers.test.ts +117 -0
  65. package/src/replay/Trailers.ts +213 -0
  66. package/src/replay/Tree.test.ts +25 -0
  67. package/src/replay/Tree.ts +45 -0
  68. package/src/replay/index.ts +11 -0
  69. package/src/steering/Blocks.fixture.ts +6 -0
  70. package/src/steering/Blocks.test.ts +167 -0
  71. package/src/steering/Blocks.ts +321 -0
  72. package/src/steering/CodeThreads.test.ts +127 -0
  73. package/src/steering/CodeThreads.ts +197 -0
  74. package/src/steering/Edits.test.ts +19 -0
  75. package/src/steering/Edits.ts +20 -0
  76. package/src/steering/Eol.test.ts +16 -0
  77. package/src/steering/Eol.ts +2 -0
  78. package/src/steering/FORMATS.md +58 -0
  79. package/src/steering/Footnotes.test.ts +977 -0
  80. package/src/steering/Footnotes.ts +661 -0
  81. package/src/steering/Inline.fixture.ts +7 -0
  82. package/src/steering/Inline.test.ts +227 -0
  83. package/src/steering/Inline.ts +195 -0
  84. package/src/steering/MarkdownTree.test.ts +247 -0
  85. package/src/steering/MarkdownTree.ts +260 -0
  86. package/src/steering/Outline.ts +19 -0
  87. package/src/steering/SteeringFormat.test.ts +91 -0
  88. package/src/steering/SteeringFormat.ts +267 -0
  89. package/src/steering/SteeringFormats.test.ts +163 -0
  90. package/src/steering/Threads.ts +163 -0
  91. package/src/steering/contract.test.ts +264 -0
  92. package/src/steering/fixtures/code-threads/cache.stripped.ts.txt +6 -0
  93. package/src/steering/fixtures/code-threads/cache.ts.md +15 -0
  94. package/src/steering/fixtures/free-form/notes.md +12 -0
  95. package/src/steering/fixtures/free-form/notes.read.json +42 -0
  96. package/src/steering/fixtures/qa/answered.md +23 -0
  97. package/src/steering/fixtures/qa/answered.read.json +119 -0
  98. package/src/steering/fixtures/qa/requirements.md +160 -0
  99. package/src/steering/fixtures/qa/requirements.read.json +475 -0
  100. package/src/steering/fixtures/review/review.md +76 -0
  101. package/src/steering/fixtures/review/review.read.json +237 -0
  102. package/src/steering/fixtures/review/ticked.md +23 -0
  103. package/src/steering/fixtures/review/ticked.read.json +99 -0
  104. package/src/steering/fixtures/review-notes/baseline.md +14 -0
  105. package/src/steering/fixtures/review-notes/noted.md +19 -0
  106. package/src/steering/freeform.test.ts +311 -0
  107. package/src/steering/freeform.ts +148 -0
  108. package/src/steering/index.test.ts +62 -0
  109. package/src/steering/index.ts +140 -0
  110. package/src/steering/qa.test.ts +2160 -0
  111. package/src/steering/qa.ts +1104 -0
  112. package/src/steering/review.test.ts +1829 -0
  113. package/src/steering/review.ts +1180 -0
  114. package/src/step/LandStep.ts +31 -0
  115. package/src/step/RepoSnapshot.ts +29 -0
  116. package/src/step/accessRefusal.test.ts +58 -0
  117. package/src/step/accessRefusal.ts +26 -0
  118. package/src/step/index.ts +5 -0
  119. package/src/step/planStart.test.ts +202 -0
  120. package/src/step/planStart.ts +167 -0
  121. package/src/step/planStep.test.ts +104 -0
  122. package/src/step/planStep.ts +89 -0
  123. package/src/step/snapshot.fixture.ts +28 -0
  124. package/src/testkit/EmittedScriptRecognizer.test.ts +639 -0
  125. package/src/testkit/EmittedScriptRecognizer.ts +642 -0
  126. package/src/testkit/FakeGitOperations.ts +95 -0
  127. package/src/testkit/GitTiers.test.ts +11 -0
  128. package/src/testkit/GitTiers.ts +1052 -0
  129. package/src/testkit/InMemRepo.ts +467 -0
  130. package/src/testkit/Layers.test.ts +58 -0
  131. package/src/testkit/Layers.ts +241 -0
  132. package/src/testkit/StrictGitOperations.ts +31 -0
  133. package/src/testkit/TestRepo.test.ts +119 -0
  134. package/src/testkit/TestRepo.ts +274 -0
  135. package/src/testkit/cliIo.ts +36 -0
  136. package/src/testkit/index.ts +9 -0
  137. package/src/testkit/steps.ts +177 -0
  138. package/src/testkit/testkit.feature +65 -0
  139. package/src/wire/BeatDocument.test.ts +419 -0
  140. package/src/wire/BeatDocument.ts +114 -0
  141. package/src/wire/BeatPlain.test.ts +113 -0
  142. package/src/wire/BeatPlain.ts +127 -0
  143. package/src/wire/BeatStatus.test.ts +59 -0
  144. package/src/wire/BeatStatus.ts +81 -0
  145. package/src/wire/Demand.test.ts +142 -0
  146. package/src/wire/Demand.ts +108 -0
  147. package/src/wire/ExitCodes.test.ts +21 -0
  148. package/src/wire/ExitCodes.ts +16 -0
  149. package/src/wire/Glob.ts +29 -0
  150. package/src/wire/Judge.ts +22 -0
  151. package/src/wire/Land.test.ts +120 -0
  152. package/src/wire/Land.ts +75 -0
  153. package/src/wire/Select.test.ts +148 -0
  154. package/src/wire/Select.ts +78 -0
  155. package/src/wire/Sessions.test.ts +59 -0
  156. package/src/wire/Sessions.ts +39 -0
  157. package/src/wire/WireSchema.test.ts +162 -0
  158. package/src/wire/constants.ts +22 -0
  159. package/src/wire/golden/1/beat-capture.json +34 -0
  160. package/src/wire/golden/1/beat-message.json +34 -0
  161. package/src/wire/golden/1/beat-prompt.json +44 -0
  162. package/src/wire/golden/1/beat-script.json +34 -0
  163. package/src/wire/golden/1/beat-stalled.json +34 -0
  164. package/src/wire/golden/1/judge.json +14 -0
  165. package/src/wire/golden/1/land-noop.json +10 -0
  166. package/src/wire/golden/1/land.json +10 -0
  167. package/src/wire/index.ts +12 -0
  168. package/src/wire/types.ts +46 -0
  169. package/src/workflow/Diagnostic.test.ts +93 -0
  170. package/src/workflow/Diagnostic.ts +54 -0
  171. package/src/workflow/SteeringFormats.test.ts +27 -0
  172. package/src/workflow/SteeringFormats.ts +6 -0
  173. package/src/workflow/Workflow.ts +77 -0
  174. package/src/workflow/compile.test.ts +53 -0
  175. package/src/workflow/compile.ts +56 -0
  176. package/src/workflow/discovery.ts +122 -0
  177. package/src/workflow/fingerprint.test.ts +52 -0
  178. package/src/workflow/fingerprint.ts +53 -0
  179. package/src/workflow/index.ts +33 -0
  180. package/src/workflow/load.test.ts +1017 -0
  181. package/src/workflow/load.ts +836 -0
  182. package/src/workflow/skills.test.ts +109 -0
  183. package/src/workflow/skills.ts +90 -0
  184. package/src/workflow/vars.ts +33 -0
  185. package/src/workflows/feature/feature.test.ts +27 -33
  186. package/src/workflows/feature/index.ts +10 -0
  187. package/src/workflows/fix/fix.feature +80 -0
  188. package/src/workflows/fix/fix.test.ts +58 -78
  189. package/src/workflows/fix/index.ts +6 -0
  190. package/src/workflows/index.ts +2 -10
  191. package/src/workflows/review/index.ts +6 -0
  192. package/src/workflows/review/review.test.ts +85 -29
  193. package/src/workflows/review/review.ts +3 -1
  194. package/src/workflows/shared/config.fixture.ts +12 -0
  195. package/src/workflows/shared/reserved.ts +11 -0
  196. package/src/workflows/shared/workflows.steps.ts +7 -0
@@ -0,0 +1,119 @@
1
+ {
2
+ "nodes": [
3
+ {
4
+ "title": "Move the cache to a shared directory.",
5
+ "anchor": {
6
+ "kind": "paragraph",
7
+ "line": 0
8
+ }
9
+ },
10
+ {
11
+ "title": "Where does the cache live?",
12
+ "detail": "The cache is per worktree today.",
13
+ "status": "open",
14
+ "answered": true,
15
+ "anchor": {
16
+ "kind": "question",
17
+ "index": 0
18
+ },
19
+ "body": [
20
+ {
21
+ "title": "The cache is per worktree today.",
22
+ "anchor": {
23
+ "kind": "paragraph",
24
+ "line": 6
25
+ }
26
+ }
27
+ ],
28
+ "children": [
29
+ {
30
+ "title": "In `$XDG_CACHE_HOME`",
31
+ "checked": false,
32
+ "anchor": {
33
+ "kind": "option",
34
+ "questionIndex": 0,
35
+ "index": 0
36
+ },
37
+ "body": [
38
+ {
39
+ "title": "Shared by every worktree",
40
+ "anchor": {
41
+ "kind": "paragraph",
42
+ "line": 9
43
+ }
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "title": "Next to the repository",
49
+ "checked": true,
50
+ "anchor": {
51
+ "kind": "option",
52
+ "questionIndex": 0,
53
+ "index": 1
54
+ },
55
+ "body": [
56
+ {
57
+ "title": "Survives a worktree removal",
58
+ "anchor": {
59
+ "kind": "paragraph",
60
+ "line": 11
61
+ }
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "title": "",
67
+ "checked": false,
68
+ "anchor": {
69
+ "kind": "option",
70
+ "questionIndex": 0,
71
+ "index": 2
72
+ }
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ "title": "How is it invalidated?",
78
+ "detail": "",
79
+ "status": "open",
80
+ "answered": true,
81
+ "anchor": {
82
+ "kind": "question",
83
+ "index": 1
84
+ },
85
+ "body": [],
86
+ "children": [
87
+ {
88
+ "title": "By content hash",
89
+ "checked": false,
90
+ "anchor": {
91
+ "kind": "option",
92
+ "questionIndex": 1,
93
+ "index": 0
94
+ },
95
+ "body": []
96
+ },
97
+ {
98
+ "title": "By modification time",
99
+ "checked": false,
100
+ "anchor": {
101
+ "kind": "option",
102
+ "questionIndex": 1,
103
+ "index": 1
104
+ },
105
+ "body": []
106
+ },
107
+ {
108
+ "title": "Keep both, hash wins on conflict",
109
+ "checked": true,
110
+ "anchor": {
111
+ "kind": "option",
112
+ "questionIndex": 1,
113
+ "index": 2
114
+ }
115
+ }
116
+ ]
117
+ }
118
+ ]
119
+ }
@@ -0,0 +1,160 @@
1
+ # Review note severity tiers (issue #270, T3b)
2
+
3
+ Sketch: `.gtd/TODO.md` said "work on issue 270". Issue #270: at the
4
+ `review.triage` judge rest (T3, shipped), ask four narrow questions per human
5
+ note — `security` (yes/no), `reversibility` (one-way/two-way), `blastRadius`
6
+ (local/module/contract), `newConcept` (yes/no) — in the same commit, as more
7
+ `Gtd-Judge:` trailers. Flow code, never the model, turns the answers into a
8
+ tier: security yes or one-way → `critical`; contract or new concept → `should`;
9
+ else `could`.
10
+
11
+ ## Open Questions
12
+
13
+ ### Which notes get a severity tier?
14
+
15
+ T3 already routes each note by verdict: `edit` → planning lap, `question` →
16
+ answered in place, `nit` → one batched fix, `praise` → dropped. The tier can
17
+ reroute only edits, or also pull questions and nits into a lap.
18
+
19
+ - [ ] Only `edit` notes are tiered
20
+ - critical/should edits → REQUIREMENTS.md now; could edits → TODO.md
21
+ - Questions, nits, praise route exactly as today; no severity asked for them
22
+ - A nit that renames a published API (one-way) is still fixed without a plan
23
+ - Done-when holds only if the six style notes are judged `edit`, not `nit`
24
+ - [ ] Every note but praise is tiered; the tier only escalates
25
+ - A critical/should question or nit goes to REQUIREMENTS.md instead of its T3
26
+ route
27
+ - A could question is still answered, a could nit still fixed now; only could
28
+ edits are deferred
29
+ - More judge questions per rest; a misjudged "touches auth" pulls a harmless
30
+ nit into a full lap
31
+ - [ ] Every note but praise is tiered; could also defers nits
32
+ - Same escalation as above, plus could nits go to TODO.md instead of being
33
+ fixed
34
+ - The T3 nit route then only fires for nothing — effectively retired
35
+ - Matches the done-when literally whether style notes are judged edit or nit
36
+ - [ ] _your answer_
37
+
38
+ ### What does "a lap cannot sign off with an open critical" enforce?
39
+
40
+ A critical note always goes to REQUIREMENTS.md, so the round it appears in
41
+ already cannot sign off. The fork is whether the NEXT round checks that the
42
+ critical was actually dealt with.
43
+
44
+ - [ ] Nothing extra: routing a critical into a lap is the block
45
+ - No new step, no new guard
46
+ - The next round signs off whenever the human signs off, even if the fix
47
+ missed the point
48
+ - [ ] Carry each critical into the next REVIEW.md as an item the human must tick
49
+ - The review gate refuses sign-off while any carried critical is unticked
50
+ - New visible ritual in REVIEW.md; the human, not a model, decides "resolved"
51
+ - [ ] A judge asks "is this critical resolved?" per carried critical at sign-off
52
+ - One more judge rest per signing round
53
+ - Below-floor or unanswered keeps sign-off blocked, which can loop until the
54
+ human edits again
55
+ - [ ] _your answer_
56
+
57
+ ### What happens to deferred `could` notes in `.gtd/TODO.md`?
58
+
59
+ TODO.md is the human's sketch file at `idle`. A deferred note written there mid
60
+ process gets committed onto the branch, and the next process's `unwind` only
61
+ reverts what the human adds at `idle` — not what is already committed — so
62
+ deferred notes do not reach the next triage on their own.
63
+
64
+ - [ ] Append them to TODO.md and leave them committed; the human pulls them into
65
+ a later process by hand
66
+ - Smallest build
67
+ - `.gtd/TODO.md` ships in the branch/PR unless the human deletes it
68
+ - Deferred items are only a reminder until a human re-types or re-touches them
69
+ - [ ] Append them to TODO.md, and the next ordinary start treats a committed
70
+ TODO.md as part of its sketch
71
+ - Deferred items become concerns of the next process automatically
72
+ - Changes what `unwind`/triage read for every ordinary start
73
+ - `.gtd/TODO.md` still sits in the branch until that next process
74
+ - [ ] Do not commit them: hand them back at sign-off (message or summary), tree
75
+ stays clean
76
+ - No `.gtd/` file leaks into the PR
77
+ - Deviates from the issue's "TODO.md as a deferred package"; nothing persists
78
+ unless the human copies it
79
+ - [ ] _your answer_
80
+
81
+ ## Concerns
82
+
83
+ ### 1. Severity questions at the triage rest — PRODUCT
84
+
85
+ The `review.triage` rest asks the four severity questions per tiered note (which
86
+ notes: open question above) alongside the T3 verdict, in one commit. Question
87
+ wording follows the issue: one-way covers migrations, published API shapes, file
88
+ formats, anything another system depends on by tomorrow; new concept is judged
89
+ against the code, never a glossary file, and reusing or extending an existing
90
+ concept is not new.
91
+
92
+ ### 2. Tier derivation and guard rails — PRODUCT
93
+
94
+ Flow code derives the tier: security yes OR one-way → `critical`; contract OR
95
+ new concept → `should`; else `could`. Deferring is the risky direction: an
96
+ unanswered question, truncated evidence, or `p` below `reviewSeverityMinP` makes
97
+ the note `critical`, never `could`. A human note starting with `!` is `critical`
98
+ and gets no severity questions.
99
+
100
+ ### 3. Routing by tier — PRODUCT
101
+
102
+ `critical` + `should` → `.gtd/REQUIREMENTS.md` this round, via the existing
103
+ collecting turn. `could` → `.gtd/TODO.md` as a deferred package (lifecycle: open
104
+ question above). Inside REQUIREMENTS.md: one-way doors first, then new concepts,
105
+ then the rest in note order.
106
+
107
+ ### 4. Sign-off block on criticals — PRODUCT
108
+
109
+ A round with an open critical cannot sign off (what counts as resolved: open
110
+ question above).
111
+
112
+ ### 5. `!` marker in the review format — TECHNICAL
113
+
114
+ `src/steering/review.ts` recognises the leading `!` on a human note and strips
115
+ it from the text the folding turn sees.
116
+
117
+ ### 6. New process setting `reviewSeverityMinP` — TECHNICAL
118
+
119
+ Default and fold-time recording per the answered questions below; outcomes stay
120
+ re-foldable from the recorded trailers (T7, #272), never re-asked.
121
+
122
+ ### 7. Acceptance — PRODUCT
123
+
124
+ A review with one one-way-door note, one new-concept note and six style notes
125
+ produces REQUIREMENTS.md with two entries (one-way door first) and TODO.md with
126
+ six, and sign-off stays blocked until the one-way door is resolved. Cucumber
127
+ scenarios cover it; README and `docs/` reflect the `!` marker, the new setting
128
+ and the deferral.
129
+
130
+ ## Answered Questions
131
+
132
+ ### Where does the `!` go, and on which notes?
133
+
134
+ As the first character of the human's own note text, on any note kind — pointer
135
+ note, footnote, chunk prose — stripped before folding; prefixing the pointer
136
+ path itself would break the pointer parse, and one rule for all kinds is easier
137
+ to remember.
138
+
139
+ ### Does a REQUIREMENTS.md entry show its tier?
140
+
141
+ Yes: each folded note names its tier and the answer that earned it ("critical:
142
+ one-way door", "critical: forced by `!`", "critical: judge unsure"); the issue
143
+ rejects a single score for being unauditable, so the reason must be visible.
144
+
145
+ ### What order do concerns take inside REQUIREMENTS.md?
146
+
147
+ One-way doors, then new concepts, then every other critical/should note in
148
+ document order — the issue fixes the first two; document order is the existing
149
+ tie-break.
150
+
151
+ ### What is `reviewSeverityMinP`'s default, and what does a blank value do?
152
+
153
+ `0.7`, one floor for all four questions, matching `reviewNoteActionable` and
154
+ `judgeIdenticalMinP`; a blank value makes every tiered note `critical`, the same
155
+ fail-safe a blank `reviewNoteActionable` gives (every note an `edit`).
156
+
157
+ ### What happens without a configured judge?
158
+
159
+ Same as T3: the rest surfaces to the driver, which answers the extra questions
160
+ like the verdict; no separate fallback.