@pmelab/gtd 28.2.0 → 29.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 (51) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +13 -4
  3. package/dist/chunks/{reserved-DeBS4Ymh.mjs → reserved-DoHUII2D.mjs} +206 -121
  4. package/dist/chunks/{tail-B2SER2Ih.mjs → tail-C6YBG5zh.mjs} +19 -12
  5. package/dist/testkit.mjs +2 -1
  6. package/dist/workflow-kit.mjs +51 -21
  7. package/dist/workflows/cleanup.mjs +2 -2
  8. package/dist/workflows/feature.mjs +247 -96
  9. package/dist/workflows/fix.mjs +2 -2
  10. package/dist/workflows/review.mjs +2 -2
  11. package/dist/workflows/rollout.mjs +1 -1
  12. package/dist/workflows.mjs +528 -262
  13. package/package.json +1 -1
  14. package/src/testkit/TestRepo.ts +3 -0
  15. package/src/testkit/index.ts +1 -1
  16. package/src/testkit/steps.ts +44 -0
  17. package/src/workflow-kit/review.test.ts +366 -8
  18. package/src/workflow-kit/review.ts +109 -26
  19. package/src/workflows/feature/feature.test.ts +313 -1
  20. package/src/workflows/feature/feature.ts +48 -43
  21. package/src/workflows/feature/one-step-land.feature +4 -0
  22. package/src/workflows/feature/refactor-first.feature +54 -24
  23. package/src/workflows/feature/refactor-review.feature +1706 -0
  24. package/src/workflows/feature/refactor.test.ts +592 -2
  25. package/src/workflows/feature/refactor.ts +160 -42
  26. package/src/workflows/feature/review.test.ts +322 -5
  27. package/src/workflows/feature/review.ts +77 -10
  28. package/src/workflows/feature/seam-rejection.feature +4 -0
  29. package/src/workflows/feature/seam.feature +3 -4
  30. package/src/workflows/feature/seam.test.ts +196 -1
  31. package/src/workflows/feature/seam.ts +23 -9
  32. package/src/workflows/feature/steps.test.ts +54 -2
  33. package/src/workflows/feature/steps.ts +45 -9
  34. package/src/workflows/feature/tier.test.ts +4 -0
  35. package/src/workflows/feature/tier.ts +2 -20
  36. package/src/workflows/shared/__fixtures__/feature-collecting-prompt.txt +97 -0
  37. package/src/workflows/shared/access.test.ts +31 -1
  38. package/src/workflows/shared/access.ts +7 -1
  39. package/src/workflows/shared/fences.ts +19 -0
  40. package/src/workflows/shared/health.ts +32 -12
  41. package/src/workflows/shared/options.test.ts +18 -0
  42. package/src/workflows/shared/options.ts +1 -0
  43. package/src/workflows/shared/prose.ts +4 -2
  44. package/src/workflows/shared/skills.test.ts +20 -1
  45. package/src/workflows/shared/skills.ts +43 -32
  46. package/src/workflows/shared/steps.ts +33 -19
  47. package/src/workflows/shared/tail.test.ts +84 -1
  48. package/src/workflows/shared/tail.ts +30 -12
  49. package/src/workflows/shared/text.test.ts +266 -3
  50. package/src/workflows/shared/text.ts +183 -69
  51. package/src/workflows/shared/vars.ts +12 -2
@@ -3,13 +3,14 @@
3
3
  Feature: a refactor-first judgment walks one fixed path to idle
4
4
 
5
5
  With GTD_FLAG_NAIVE_PASS on and GTD_FLAG_RISK_TIER off, a naive pass touching
6
- an existing non-allowlisted file is ruled refactor-first, rests at the
7
- approval gate, and is refactored before it is implemented. The flags are
6
+ an existing non-allowlisted file is ruled refactor-first, is refactored and
7
+ that refactor reviewed, and only then implemented. The flags are
8
8
  pinned so the per-flag test runs never move it off its path.
9
9
 
10
10
  Background:
11
11
  Given the shipped workflows, as gtd install scaffolds them
12
12
  And an environment variable "GTD_QUALITYREVIEWS" set to ""
13
+ And an environment variable "GTD_REFACTORQUALITYREVIEWS" set to ""
13
14
  And an environment variable "GTD_FLAG_NAIVE_PASS" set to "1"
14
15
  And an environment variable "GTD_FLAG_RISK_TIER" set to "0"
15
16
  And a file "src/calc.ts" with:
@@ -37,7 +38,7 @@ Feature: a refactor-first judgment walks one fixed path to idle
37
38
  """
38
39
  And step "design.gate.answer" changes nothing
39
40
 
40
- Scenario: a refactor-first judgment runs approval, refactor, implement and review to idle
41
+ Scenario: a refactor-first judgment runs refactor, its review, implement and review to idle
41
42
  Given step "seam.naive" writes "src/calc.ts" with:
42
43
  """
43
44
  export const add = (a: number, b: number) => a + b
@@ -48,6 +49,44 @@ Feature: a refactor-first judgment walks one fixed path to idle
48
49
  [{"id":"shape","answer":"refactor-first","p":0.9}]
49
50
  """
50
51
  And step "refactor.deriving" runs its script
52
+ When the process is driven
53
+ Then the process rests at "refactor.building"
54
+ And ".gtd/REFACTOR.md" contains "calc.ts`"
55
+
56
+ Given step "refactor.building" writes "src/calc.ts" with:
57
+ """
58
+ export const op = (a: number, b: number, sign: number) => a + sign * b
59
+ export const add = (a: number, b: number) => op(a, b, 1)
60
+ """
61
+ And step "refactor.health.check" changes nothing
62
+ And step "refactor.closing" runs its script
63
+ And step "refactor.build.review.reviewing" writes ".gtd/REVIEW.md" with:
64
+ """
65
+ # Review: abc1234
66
+
67
+ <!-- base: 0000000 -->
68
+
69
+ ## calc
70
+
71
+ - [ ] ./src/calc.ts#1-2
72
+ add built on the shared op
73
+ """
74
+ And step "refactor.build.review.closing" runs its script
75
+ When the process is driven
76
+ Then the process rests at "refactor.build.review.await-review"
77
+ And ".gtd/REFACTOR.md" does not exist
78
+
79
+ Given a file ".gtd/REVIEW.md" with:
80
+ """
81
+ # Review: abc1234
82
+
83
+ <!-- base: 0000000 -->
84
+
85
+ ## calc
86
+
87
+ - [x] ./src/calc.ts#1-2
88
+ add built on the shared op
89
+ """
51
90
  And step "build.review.reviewing" writes ".gtd/REVIEW.md" with:
52
91
  """
53
92
  # Review: abc1234
@@ -60,25 +99,9 @@ Feature: a refactor-first judgment walks one fixed path to idle
60
99
  subtract built on the shared op
61
100
  """
62
101
  And step "build.review.closing" runs its script
63
- When the process is driven
64
- Then the process rests at "seam.approve"
65
- And the resting step's content contains "src/calc.ts"
66
-
67
102
  When gtd lands
68
103
  And the process is driven
69
- Then the process rests at "refactor.building"
70
- And ".gtd/REFACTOR.md" contains "calc.ts`"
71
-
72
- Given step "refactor.building" writes "src/calc.ts" with:
73
- """
74
- export const op = (a: number, b: number, sign: number) => a + sign * b
75
- export const add = (a: number, b: number) => op(a, b, 1)
76
- """
77
- And step "refactor.health.check" changes nothing
78
- And step "refactor.closing" runs its script
79
- When the process is driven
80
104
  Then the process rests at "implement.building"
81
- And ".gtd/REFACTOR.md" does not exist
82
105
  And "src/calc.ts" contains "op(a, b, 1)"
83
106
 
84
107
  Given step "implement.building" writes "src/calc.ts" with:
@@ -116,12 +139,14 @@ Feature: a refactor-first judgment walks one fixed path to idle
116
139
  gtd(agent): design.triage → design.gate.answer
117
140
  gtd(human): design.gate.answer → seam.naive
118
141
  gtd(agent): seam.naive → seam.judge
119
- gtd(judge): seam.judge → seam.approve
120
- gtd(human): seam.approve → refactor.deriving
142
+ gtd(judge): seam.judge → refactor.deriving
121
143
  gtd(check): refactor.deriving → refactor.building
122
144
  gtd(agent): refactor.building → refactor.health.check
123
145
  gtd(check): refactor.health.check → refactor.closing
124
- gtd(check): refactor.closing → implement.building
146
+ gtd(check): refactor.closing → refactor.build.review.reviewing
147
+ gtd(agent): refactor.build.review.reviewing → refactor.build.review.await-review
148
+ gtd(human): refactor.build.review.await-review → refactor.build.review.closing
149
+ gtd(check): refactor.build.review.closing → implement.building
125
150
  gtd(agent): implement.building → implement.health.check
126
151
  gtd(check): implement.health.check → implement.closing
127
152
  gtd(check): implement.closing → build.review.reviewing
@@ -132,6 +157,11 @@ Feature: a refactor-first judgment walks one fixed path to idle
132
157
  And the commit "gtd(human): idle → unwind" has a body containing "Gtd-Var: flag_naive_pass=1"
133
158
  And the commit "gtd(human): idle → unwind" has a body containing "Gtd-Var: flag_risk_tier=0"
134
159
  And the commit "gtd(agent): seam.naive → seam.judge" has a body containing "Gtd-Kept:"
135
- And the commit "gtd(judge): seam.judge → seam.approve" has a body containing "\"answer\":\"refactor-first\""
136
- And the commit "gtd(human): seam.approve → refactor.deriving" has a body containing "Gtd-Approved: {\"step\":\"seam.approve#1\",\"name\":\"Test\",\"email\":\"test@test.com\"}"
160
+ And the commit "gtd(judge): seam.judge → refactor.deriving" has a body containing "\"answer\":\"refactor-first\""
161
+ And no commit body contains "Gtd-Approved:"
162
+ And the output lines of gtd "slices" start with:
163
+ """
164
+ refactor
165
+ feature
166
+ """
137
167
  And no commit body contains "Gtd-Workflow:"