@bendyline/gilde 0.1.40 → 0.1.41

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 (147) hide show
  1. package/authoring/gstack/overlays/investigate.json +1 -0
  2. package/authoring/gstack/overlays/qa-only.json +1 -0
  3. package/authoring/gstack/wave.json +12 -2
  4. package/authoring/tactical/books/accessibility-retrofit.json +188 -0
  5. package/authoring/tactical/books/apply-review-findings.json +189 -0
  6. package/authoring/tactical/books/bug-fix-tdd.json +237 -0
  7. package/authoring/tactical/books/ci-pipeline.json +168 -0
  8. package/authoring/tactical/books/codemod-sweep.json +182 -0
  9. package/authoring/tactical/books/dependency-upgrade.json +196 -0
  10. package/authoring/tactical/books/flaky-test-fix.json +238 -0
  11. package/authoring/tactical/books/hotfix-flow.json +187 -0
  12. package/authoring/tactical/books/perf-optimization.json +219 -0
  13. package/authoring/tactical/books/refactor-module.json +217 -0
  14. package/authoring/tactical/books/schema-migration.json +192 -0
  15. package/authoring/tactical/books/test-suite-backfill.json +172 -0
  16. package/authoring/tactical/books/type-safety-pass.json +185 -0
  17. package/authoring/tactical/books/ux-update.json +178 -0
  18. package/authoring/tactical/evals/accessibility-retrofit.json +230 -0
  19. package/authoring/tactical/evals/apply-review-findings.json +290 -0
  20. package/authoring/tactical/evals/bug-fix-tdd.json +221 -0
  21. package/authoring/tactical/evals/ci-pipeline.json +227 -0
  22. package/authoring/tactical/evals/codemod-sweep.json +252 -0
  23. package/authoring/tactical/evals/dependency-upgrade.json +235 -0
  24. package/authoring/tactical/evals/flaky-test-fix.json +239 -0
  25. package/authoring/tactical/evals/hotfix-flow.json +220 -0
  26. package/authoring/tactical/evals/perf-optimization.json +235 -0
  27. package/authoring/tactical/evals/refactor-module.json +241 -0
  28. package/authoring/tactical/evals/schema-migration.json +225 -0
  29. package/authoring/tactical/evals/test-suite-backfill.json +197 -0
  30. package/authoring/tactical/evals/type-safety-pass.json +221 -0
  31. package/authoring/tactical/evals/ux-update.json +206 -0
  32. package/authoring/tactical/wave.json +89 -0
  33. package/data/chat-models/de/deepseek-r1-8b-q4/manifest.json +56 -1
  34. package/data/chat-models/gl/glm-5.2-754b-q2/manifest.json +56 -0
  35. package/data/chat-models/gp/gpt-oss-120b-q4/manifest.json +73 -1
  36. package/data/chat-models/gp/gpt-oss-20b-q4/manifest.json +77 -1
  37. package/data/chat-models/index.json +1 -1
  38. package/data/chat-models/ll/llama3.2-3b-q4/manifest.json +3 -1
  39. package/data/chat-models/mi/mistral-7b-q4/manifest.json +54 -3
  40. package/data/chat-models/mi/mistral-medium-3.5-128b-q4/manifest.json +76 -1
  41. package/data/craftbook-templates/ac/accessibility-retrofit/manifest.json +5 -4
  42. package/data/craftbook-templates/ac/accessibility-retrofit/versions/2.0.0/craftbook.json +451 -0
  43. package/data/craftbook-templates/ac/accessibility-retrofit/versions/2.0.0/test.json +231 -0
  44. package/data/craftbook-templates/al/alt-text-pass/manifest.json +5 -1
  45. package/data/craftbook-templates/ap/apply-review-findings/art.json +12 -0
  46. package/data/craftbook-templates/ap/apply-review-findings/logo.webp +0 -0
  47. package/data/craftbook-templates/ap/apply-review-findings/manifest.json +23 -0
  48. package/data/craftbook-templates/ap/apply-review-findings/versions/1.0.0/craftbook.json +436 -0
  49. package/data/craftbook-templates/ap/apply-review-findings/versions/1.0.0/test.json +291 -0
  50. package/data/craftbook-templates/br/browser-qa-audit/manifest.json +5 -1
  51. package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.5/craftbook.json +438 -0
  52. package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.5/test.json +379 -0
  53. package/data/craftbook-templates/bu/bug-fix-tdd/manifest.json +3 -3
  54. package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.0/craftbook.json +545 -0
  55. package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.0/test.json +222 -0
  56. package/data/craftbook-templates/ch/changelog-cut/manifest.json +5 -1
  57. package/data/craftbook-templates/ch/changelog-writeup/manifest.json +5 -1
  58. package/data/craftbook-templates/ci/ci-pipeline/manifest.json +5 -3
  59. package/data/craftbook-templates/ci/ci-pipeline/versions/2.0.0/craftbook.json +423 -0
  60. package/data/craftbook-templates/ci/ci-pipeline/versions/2.0.0/test.json +228 -0
  61. package/data/craftbook-templates/co/codemod-sweep/art.json +12 -0
  62. package/data/craftbook-templates/co/codemod-sweep/logo.webp +0 -0
  63. package/data/craftbook-templates/co/codemod-sweep/manifest.json +23 -0
  64. package/data/craftbook-templates/co/codemod-sweep/versions/1.0.0/craftbook.json +441 -0
  65. package/data/craftbook-templates/co/codemod-sweep/versions/1.0.0/test.json +253 -0
  66. package/data/craftbook-templates/de/dependency-upgrade/art.json +12 -0
  67. package/data/craftbook-templates/de/dependency-upgrade/logo.webp +0 -0
  68. package/data/craftbook-templates/de/dependency-upgrade/manifest.json +23 -0
  69. package/data/craftbook-templates/de/dependency-upgrade/versions/1.0.0/craftbook.json +459 -0
  70. package/data/craftbook-templates/de/dependency-upgrade/versions/1.0.0/test.json +236 -0
  71. package/data/craftbook-templates/fe/feature-flag-release/manifest.json +5 -1
  72. package/data/craftbook-templates/fe/feature-flag-rollout/manifest.json +4 -1
  73. package/data/craftbook-templates/fe/feature-flag-rollout/versions/1.1.0/craftbook.json +203 -0
  74. package/data/craftbook-templates/fe/feature-flag-rollout/versions/1.1.0/test.json +165 -0
  75. package/data/craftbook-templates/fl/flaky-test-fix/art.json +12 -0
  76. package/data/craftbook-templates/fl/flaky-test-fix/logo.webp +0 -0
  77. package/data/craftbook-templates/fl/flaky-test-fix/manifest.json +24 -0
  78. package/data/craftbook-templates/fl/flaky-test-fix/versions/1.0.0/craftbook.json +534 -0
  79. package/data/craftbook-templates/fl/flaky-test-fix/versions/1.0.0/test.json +240 -0
  80. package/data/craftbook-templates/ho/hotfix-flow/manifest.json +5 -3
  81. package/data/craftbook-templates/ho/hotfix-flow/versions/2.0.0/craftbook.json +442 -0
  82. package/data/craftbook-templates/ho/hotfix-flow/versions/2.0.0/test.json +221 -0
  83. package/data/craftbook-templates/in/investigate/manifest.json +4 -1
  84. package/data/craftbook-templates/in/investigate-root-cause/manifest.json +5 -1
  85. package/data/craftbook-templates/index.json +1 -1
  86. package/data/craftbook-templates/li/live-browser-qa/manifest.json +5 -1
  87. package/data/craftbook-templates/ni/nightly-fix-sweep/art.json +12 -0
  88. package/data/craftbook-templates/ni/nightly-fix-sweep/logo.webp +0 -0
  89. package/data/craftbook-templates/ni/nightly-fix-sweep/manifest.json +23 -0
  90. package/data/craftbook-templates/ni/nightly-fix-sweep/versions/1.0.0/craftbook.json +145 -0
  91. package/data/craftbook-templates/ni/nightly-fix-sweep/versions/1.0.0/test.json +121 -0
  92. package/data/craftbook-templates/pe/perf-audit/versions/1.1.0/craftbook.json +195 -0
  93. package/data/craftbook-templates/pe/perf-audit/versions/1.1.0/test.json +165 -0
  94. package/data/craftbook-templates/pe/perf-optimization/manifest.json +3 -3
  95. package/data/craftbook-templates/pe/perf-optimization/versions/2.0.0/craftbook.json +511 -0
  96. package/data/craftbook-templates/pe/perf-optimization/versions/2.0.0/test.json +236 -0
  97. package/data/craftbook-templates/qa/qa/manifest.json +3 -1
  98. package/data/craftbook-templates/re/refactor-module/manifest.json +2 -2
  99. package/data/craftbook-templates/re/refactor-module/versions/1.0.4/craftbook.json +150 -0
  100. package/data/craftbook-templates/re/refactor-module/versions/1.0.4/test.json +95 -0
  101. package/data/craftbook-templates/re/refactor-module/versions/2.0.0/craftbook.json +509 -0
  102. package/data/craftbook-templates/re/refactor-module/versions/2.0.0/test.json +242 -0
  103. package/data/craftbook-templates/re/release-notes/manifest.json +5 -1
  104. package/data/craftbook-templates/re/release-notes/versions/1.0.3/craftbook.json +220 -0
  105. package/data/craftbook-templates/re/release-notes/versions/1.0.3/test.json +114 -0
  106. package/data/craftbook-templates/re/release-pipeline-ci/manifest.json +5 -1
  107. package/data/craftbook-templates/re/release-readiness-review/versions/1.1.0/craftbook.json +192 -0
  108. package/data/craftbook-templates/re/release-readiness-review/versions/1.1.0/test.json +113 -0
  109. package/data/craftbook-templates/ro/root-cause-investigation/manifest.json +7 -1
  110. package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.5/craftbook.json +433 -0
  111. package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.5/test.json +157 -0
  112. package/data/craftbook-templates/sc/schema-migration/manifest.json +4 -4
  113. package/data/craftbook-templates/sc/schema-migration/versions/2.0.0/craftbook.json +459 -0
  114. package/data/craftbook-templates/sc/schema-migration/versions/2.0.0/test.json +226 -0
  115. package/data/craftbook-templates/te/test-coverage-review/versions/1.2.0/craftbook.json +195 -0
  116. package/data/craftbook-templates/te/test-coverage-review/versions/1.2.0/test.json +116 -0
  117. package/data/craftbook-templates/te/test-suite-backfill/manifest.json +1 -2
  118. package/data/craftbook-templates/te/test-suite-backfill/versions/2.0.0/craftbook.json +428 -0
  119. package/data/craftbook-templates/te/test-suite-backfill/versions/2.0.0/test.json +198 -0
  120. package/data/craftbook-templates/ty/type-safety-pass/manifest.json +3 -3
  121. package/data/craftbook-templates/ty/type-safety-pass/versions/2.0.0/craftbook.json +428 -0
  122. package/data/craftbook-templates/ty/type-safety-pass/versions/2.0.0/test.json +222 -0
  123. package/data/craftbook-templates/ux/ux-update/art.json +12 -0
  124. package/data/craftbook-templates/ux/ux-update/logo.webp +0 -0
  125. package/data/craftbook-templates/ux/ux-update/manifest.json +22 -0
  126. package/data/craftbook-templates/ux/ux-update/versions/1.0.0/craftbook.json +439 -0
  127. package/data/craftbook-templates/ux/ux-update/versions/1.0.0/test.json +207 -0
  128. package/data/craftbook-templates/ve/version-bump/versions/1.1.0/craftbook.json +206 -0
  129. package/data/craftbook-templates/ve/version-bump/versions/1.1.0/test.json +95 -0
  130. package/data/gezel-templates/bo/boekwachter/versions/1.1.0/about.md +29 -0
  131. package/data/gezel-templates/bo/boekwachter/versions/1.1.0/manifest.json +16 -0
  132. package/data/gezel-templates/bu/builder/versions/1.5.0/about.md +34 -0
  133. package/data/gezel-templates/bu/builder/versions/1.5.0/manifest.json +16 -0
  134. package/data/gezel-templates/de/developer/versions/1.5.0/about.md +34 -0
  135. package/data/gezel-templates/de/developer/versions/1.5.0/manifest.json +21 -0
  136. package/data/gezel-templates/index.json +1 -1
  137. package/data/gezel-templates/re/reviewer/versions/1.4.0/about.md +49 -0
  138. package/data/gezel-templates/re/reviewer/versions/1.4.0/manifest.json +21 -0
  139. package/data/project-types/index.json +1 -1
  140. package/data/project-types/so/software-project/manifest.json +20 -0
  141. package/data/project-types/so/software-project/versions/1.0.0/about.md +3 -0
  142. package/data/project-types/so/software-project/versions/1.0.0/manifest.json +41 -0
  143. package/data/project-types/so/software-project/versions/1.0.0/mission.md +4 -0
  144. package/package.json +1 -1
  145. package/schemas/craftbook-doc.schema.json +248 -0
  146. package/schemas/craftbook-template-version.schema.json +248 -0
  147. package/schemas/craftbook-test.schema.json +200 -0
@@ -0,0 +1,433 @@
1
+ {
2
+ "id": "root-cause-investigation",
3
+ "name": "Root-Cause Investigation",
4
+ "description": "Debug systematically: reproduce the failure and find the true root cause before changing any code, then fix and verify. Enforces a no-fix-without-diagnosis discipline.",
5
+ "basedOn": {
6
+ "name": "gstack",
7
+ "url": "https://github.com/garrytan/gstack"
8
+ },
9
+ "plan": "Reproduce first, diagnose second, change code only after the evidence identifies a root cause. Keep an explicit hypothesis ledger so plausible stories cannot silently become facts. Prefer the smallest experiment that separates competing explanations. The final report must connect symptom, causal mechanism, fix, and regression proof with inspectable paths and command results.",
10
+ "entryStepId": "reproduce",
11
+ "triggers": [
12
+ "debug this",
13
+ "fix this bug",
14
+ "why is this broken",
15
+ "root cause analysis",
16
+ "investigate this error",
17
+ "investigate this bug",
18
+ "root cause this",
19
+ "why is this failing",
20
+ "figure out why it breaks",
21
+ "diagnose this incident",
22
+ "investigate this",
23
+ "find the bug",
24
+ "root cause"
25
+ ],
26
+ "command": "root-cause-investigation",
27
+ "steps": [
28
+ {
29
+ "id": "reproduce",
30
+ "name": "Reproduce and bound the failure",
31
+ "description": "Establish a stable failing case, expected behavior, environment, and blast radius.",
32
+ "prompt": "Read the request, relevant code, existing tests, logs, and configuration. Reproduce the problem with the smallest safe case you can run. Record exact inputs, expected and actual results, environment details, frequency, and whether the failure is deterministic. If it cannot be reproduced, document the attempts and the missing observation needed; do not invent a cause or edit production code.\n\nObservable handoff: write the completed result to `investigations/reproduction.md` in the workspace with `write_file`. Do not merely describe what the file would contain. Re-read it with `read_file` before finishing this phase and repair any incomplete sections.",
33
+ "suggestedRole": "debugging engineer",
34
+ "advanceWhen": {
35
+ "file": "investigations/reproduction.md",
36
+ "minBytes": 700,
37
+ "sniff": "nonempty",
38
+ "requireChange": true,
39
+ "goto": "diagnose"
40
+ },
41
+ "gate": {
42
+ "at": "completion",
43
+ "checks": [
44
+ {
45
+ "kind": "minBytes",
46
+ "file": "investigations/reproduction.md",
47
+ "bytes": 700
48
+ },
49
+ {
50
+ "kind": "sniff",
51
+ "file": "investigations/reproduction.md",
52
+ "sniff": "nonempty"
53
+ },
54
+ {
55
+ "kind": "contains",
56
+ "file": "investigations/reproduction.md",
57
+ "pattern": "^##\\s+Symptom",
58
+ "flags": "im",
59
+ "label": "Symptom section"
60
+ },
61
+ {
62
+ "kind": "contains",
63
+ "file": "investigations/reproduction.md",
64
+ "pattern": "^##\\s+Minimal reproduction",
65
+ "flags": "im",
66
+ "label": "Minimal reproduction section"
67
+ },
68
+ {
69
+ "kind": "contains",
70
+ "file": "investigations/reproduction.md",
71
+ "pattern": "^##\\s+Expected",
72
+ "flags": "im",
73
+ "label": "Expected behavior section"
74
+ },
75
+ {
76
+ "kind": "contains",
77
+ "file": "investigations/reproduction.md",
78
+ "pattern": "^##\\s+Actual",
79
+ "flags": "im",
80
+ "label": "Actual behavior section"
81
+ },
82
+ {
83
+ "kind": "contains",
84
+ "file": "investigations/reproduction.md",
85
+ "pattern": "^##\\s+Evidence",
86
+ "flags": "im",
87
+ "label": "Evidence section"
88
+ }
89
+ ],
90
+ "onReject": "reproduce",
91
+ "maxAttempts": 3
92
+ },
93
+ "next": "diagnose"
94
+ },
95
+ {
96
+ "id": "diagnose",
97
+ "name": "Prove the root cause",
98
+ "description": "Test competing hypotheses and identify the causal mechanism before modifying code.",
99
+ "prompt": "Use `investigations/reproduction.md` to form at least two plausible hypotheses. Trace the relevant execution and data paths with workspace search and file-reading tools. For each hypothesis, run a discriminating experiment and record its predicted versus observed outcome. Name the first bad state or decision, explain how it produces the symptom, and check for sibling cases. Do not change source code in this phase.\n\nObservable handoff: write the completed result to `investigations/root-cause-analysis.md` in the workspace with `write_file`. Do not merely describe what the file would contain. Re-read it with `read_file` before finishing this phase and repair any incomplete sections.",
100
+ "suggestedRole": "root-cause analyst",
101
+ "consumes": [
102
+ {
103
+ "file": "investigations/reproduction.md"
104
+ }
105
+ ],
106
+ "advanceWhen": {
107
+ "file": "investigations/root-cause-analysis.md",
108
+ "minBytes": 1000,
109
+ "sniff": "nonempty",
110
+ "requireChange": true,
111
+ "goto": "fix-and-verify"
112
+ },
113
+ "gate": {
114
+ "at": "completion",
115
+ "checks": [
116
+ {
117
+ "kind": "minBytes",
118
+ "file": "investigations/root-cause-analysis.md",
119
+ "bytes": 1000
120
+ },
121
+ {
122
+ "kind": "sniff",
123
+ "file": "investigations/root-cause-analysis.md",
124
+ "sniff": "nonempty"
125
+ },
126
+ {
127
+ "kind": "contains",
128
+ "file": "investigations/root-cause-analysis.md",
129
+ "pattern": "^##\\s+Hypotheses",
130
+ "flags": "im",
131
+ "label": "Hypotheses section"
132
+ },
133
+ {
134
+ "kind": "contains",
135
+ "file": "investigations/root-cause-analysis.md",
136
+ "pattern": "^##\\s+Experiments",
137
+ "flags": "im",
138
+ "label": "Experiments section"
139
+ },
140
+ {
141
+ "kind": "contains",
142
+ "file": "investigations/root-cause-analysis.md",
143
+ "pattern": "^##\\s+Root cause",
144
+ "flags": "im",
145
+ "label": "Root cause section"
146
+ },
147
+ {
148
+ "kind": "contains",
149
+ "file": "investigations/root-cause-analysis.md",
150
+ "pattern": "^##\\s+Causal chain",
151
+ "flags": "im",
152
+ "label": "Causal chain section"
153
+ },
154
+ {
155
+ "kind": "contains",
156
+ "file": "investigations/root-cause-analysis.md",
157
+ "pattern": "^##\\s+Blast radius",
158
+ "flags": "im",
159
+ "label": "Blast radius section"
160
+ }
161
+ ],
162
+ "onReject": "diagnose",
163
+ "maxAttempts": 3
164
+ },
165
+ "next": "fix-and-verify"
166
+ },
167
+ {
168
+ "id": "fix-and-verify",
169
+ "name": "Implement the smallest fix and verify it",
170
+ "description": "Correct the proven mechanism and demonstrate both regression coverage and non-regression.",
171
+ "prompt": "Read both investigation files. Implement the smallest maintainable change that breaks the documented causal chain. Add or strengthen a regression test that fails on the old behavior and passes with the fix. Run the focused test, relevant neighboring tests, and any proportionate static checks. Record exact changed paths and exact verification commands with exit results. If the environment prevents a check, label it unverified and explain what is needed to run it.\n\nObservable handoff: write the completed result to `{{workPath}}/reports/root-cause-investigation.md` in the project's artifacts drawer with `write_artifact`. Do not merely describe what the file would contain. Re-read it with `read_artifact` before finishing this phase and repair any incomplete sections.",
172
+ "suggestedRole": "software engineer",
173
+ "advanceWhen": {
174
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
175
+ "minBytes": 1200,
176
+ "sniff": "nonempty",
177
+ "requireChange": true,
178
+ "artifact": true,
179
+ "goto": "evaluate"
180
+ },
181
+ "gate": {
182
+ "at": "completion",
183
+ "checks": [
184
+ {
185
+ "kind": "minBytes",
186
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
187
+ "bytes": 1200,
188
+ "artifact": true
189
+ },
190
+ {
191
+ "kind": "sniff",
192
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
193
+ "sniff": "nonempty",
194
+ "artifact": true
195
+ },
196
+ {
197
+ "kind": "contains",
198
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
199
+ "pattern": "^##\\s+Root cause",
200
+ "flags": "im",
201
+ "label": "Root cause section",
202
+ "artifact": true
203
+ },
204
+ {
205
+ "kind": "contains",
206
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
207
+ "pattern": "^##\\s+Fix",
208
+ "flags": "im",
209
+ "label": "Fix section",
210
+ "artifact": true
211
+ },
212
+ {
213
+ "kind": "contains",
214
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
215
+ "pattern": "^##\\s+Changed files",
216
+ "flags": "im",
217
+ "label": "Changed files section",
218
+ "artifact": true
219
+ },
220
+ {
221
+ "kind": "contains",
222
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
223
+ "pattern": "^##\\s+Regression coverage",
224
+ "flags": "im",
225
+ "label": "Regression coverage section",
226
+ "artifact": true
227
+ },
228
+ {
229
+ "kind": "contains",
230
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
231
+ "pattern": "^##\\s+Verification",
232
+ "flags": "im",
233
+ "label": "Verification section",
234
+ "artifact": true
235
+ },
236
+ {
237
+ "kind": "contains",
238
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
239
+ "pattern": "^##\\s+Rollback",
240
+ "flags": "im",
241
+ "label": "Rollback section",
242
+ "artifact": true
243
+ }
244
+ ],
245
+ "onReject": "fix-and-verify",
246
+ "maxAttempts": 3
247
+ },
248
+ "next": "evaluate"
249
+ },
250
+ {
251
+ "id": "evaluate",
252
+ "name": "Evaluate the deliverable",
253
+ "description": "Independently grade the observable deliverable and route it to finish, repair, or user escalation.",
254
+ "prompt": "Review `{{workPath}}/reports/root-cause-investigation.md`, `investigations/reproduction.md`, `investigations/root-cause-analysis.md` against every criterion below. Inspect the underlying evidence files named by the workflow; do not grade from the author's summary alone.\n\n1. The failure is reproducible or the report explicitly stops without claiming an unproven diagnosis.\n2. Competing hypotheses were separated by recorded experiments rather than intuition.\n3. The stated root cause includes a causal chain from first bad state to observed symptom.\n4. The change is limited to that causal mechanism and covers identified sibling cases.\n5. A regression test and neighboring checks have concrete, credible results with no fabricated execution evidence.\n6. The report identifies changed files, residual risk, and a viable rollback.\n\nOpen `{{workPath}}/reports/root-cause-investigation.md` with `read_artifact`. Open `investigations/reproduction.md`, `investigations/root-cause-analysis.md` with `read_file`. Write the evidence-backed review to `{{workPath}}/reviews/root-cause-investigation-review.md` in the artifacts drawer with `write_artifact`. Give each criterion a PASS or FAIL with a concrete path, excerpt, measurement, or observed behavior. End with exactly `Verdict: PASS` or `Verdict: REVISE`. Then use `advance_task_step` for the active task: PASS routes to `finish`; REVISE routes to `repair` for review rounds 1 through 2, and the 3th REVISE routes to `needs-user`. Never route to finish while a criterion is unmet.",
255
+ "suggestedRole": "debugging reviewer",
256
+ "consumes": [
257
+ {
258
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
259
+ "artifact": true
260
+ },
261
+ {
262
+ "file": "investigations/reproduction.md"
263
+ },
264
+ {
265
+ "file": "investigations/root-cause-analysis.md"
266
+ }
267
+ ],
268
+ "gate": {
269
+ "at": "completion",
270
+ "checks": [
271
+ {
272
+ "kind": "minBytes",
273
+ "file": "{{workPath}}/reviews/root-cause-investigation-review.md",
274
+ "bytes": 400,
275
+ "artifact": true
276
+ },
277
+ {
278
+ "kind": "contains",
279
+ "file": "{{workPath}}/reviews/root-cause-investigation-review.md",
280
+ "pattern": "Verdict:\\s*(?:PASS|REVISE)",
281
+ "flags": "i",
282
+ "label": "explicit PASS or REVISE verdict",
283
+ "artifact": true
284
+ }
285
+ ],
286
+ "onReject": "evaluate",
287
+ "maxAttempts": 3
288
+ },
289
+ "next": "repair"
290
+ },
291
+ {
292
+ "id": "repair",
293
+ "name": "Repair the deliverable",
294
+ "description": "Fix only the concrete gaps from the latest independent review.",
295
+ "prompt": "Read `{{workPath}}/reviews/root-cause-investigation-review.md` with `read_artifact` and repair every failed criterion in `{{workPath}}/reports/root-cause-investigation.md`, `investigations/reproduction.md`, `investigations/root-cause-analysis.md`. Make changes on each file's declared surface (`write_artifact` for artifact inputs, `write_file` for workspace inputs), not in task notes or a reply. Preserve evidence that already passed. Re-run or re-check anything the reviewer found unproven. Ensure `{{workPath}}/reports/root-cause-investigation.md` is genuinely updated this turn so the repair is observable, then hand it back for independent evaluation.",
296
+ "suggestedRole": "software engineer",
297
+ "consumes": [
298
+ {
299
+ "file": "{{workPath}}/reviews/root-cause-investigation-review.md",
300
+ "artifact": true
301
+ },
302
+ {
303
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
304
+ "artifact": true
305
+ },
306
+ {
307
+ "file": "investigations/reproduction.md"
308
+ },
309
+ {
310
+ "file": "investigations/root-cause-analysis.md"
311
+ }
312
+ ],
313
+ "advanceWhen": {
314
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
315
+ "minBytes": 1200,
316
+ "sniff": "nonempty",
317
+ "requireChange": true,
318
+ "artifact": true,
319
+ "goto": "evaluate"
320
+ },
321
+ "gate": {
322
+ "at": "completion",
323
+ "checks": [
324
+ {
325
+ "kind": "minBytes",
326
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
327
+ "bytes": 1200,
328
+ "artifact": true
329
+ },
330
+ {
331
+ "kind": "sniff",
332
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
333
+ "sniff": "nonempty",
334
+ "artifact": true
335
+ },
336
+ {
337
+ "kind": "contains",
338
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
339
+ "pattern": "^##\\s+Root cause",
340
+ "flags": "im",
341
+ "label": "Root cause section",
342
+ "artifact": true
343
+ },
344
+ {
345
+ "kind": "contains",
346
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
347
+ "pattern": "^##\\s+Fix",
348
+ "flags": "im",
349
+ "label": "Fix section",
350
+ "artifact": true
351
+ },
352
+ {
353
+ "kind": "contains",
354
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
355
+ "pattern": "^##\\s+Changed files",
356
+ "flags": "im",
357
+ "label": "Changed files section",
358
+ "artifact": true
359
+ },
360
+ {
361
+ "kind": "contains",
362
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
363
+ "pattern": "^##\\s+Regression coverage",
364
+ "flags": "im",
365
+ "label": "Regression coverage section",
366
+ "artifact": true
367
+ },
368
+ {
369
+ "kind": "contains",
370
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
371
+ "pattern": "^##\\s+Verification",
372
+ "flags": "im",
373
+ "label": "Verification section",
374
+ "artifact": true
375
+ },
376
+ {
377
+ "kind": "contains",
378
+ "file": "{{workPath}}/reports/root-cause-investigation.md",
379
+ "pattern": "^##\\s+Rollback",
380
+ "flags": "im",
381
+ "label": "Rollback section",
382
+ "artifact": true
383
+ }
384
+ ],
385
+ "onReject": "repair",
386
+ "maxAttempts": 3
387
+ },
388
+ "next": "evaluate"
389
+ },
390
+ {
391
+ "id": "finish",
392
+ "name": "Finish",
393
+ "description": "All deterministic and reviewer criteria passed.",
394
+ "prompt": "The independent review passed. Read `{{workPath}}/reviews/root-cause-investigation-review.md` with `read_artifact`, then use `write_task_note` to record a concise DONE summary with the final deliverable paths (`{{workPath}}/reports/root-cause-investigation.md`, `investigations/reproduction.md`, `investigations/root-cause-analysis.md`) and the evidence that each acceptance criterion passed. Report DONE without starting new work.",
395
+ "suggestedRole": "project lead",
396
+ "consumes": [
397
+ {
398
+ "file": "{{workPath}}/reviews/root-cause-investigation-review.md",
399
+ "artifact": true
400
+ }
401
+ ],
402
+ "terminal": true
403
+ },
404
+ {
405
+ "id": "needs-user",
406
+ "name": "Escalate unresolved concerns",
407
+ "description": "The bounded repair loop ended without a defensible pass.",
408
+ "prompt": "The deliverable did not pass after 3 review rounds. Do not claim success. Read `{{workPath}}/reviews/root-cause-investigation-review.md` with `read_artifact`, then use `write_task_note` to record DONE_WITH_CONCERNS: the unmet criteria, what was attempted, the affected paths, and the smallest user decision or missing input needed to continue.",
409
+ "suggestedRole": "project lead",
410
+ "consumes": [
411
+ {
412
+ "file": "{{workPath}}/reviews/root-cause-investigation-review.md",
413
+ "artifact": true
414
+ }
415
+ ],
416
+ "terminal": true
417
+ }
418
+ ],
419
+ "version": "2.0.5",
420
+ "releasedAt": "2026-08-24T00:00:00.000Z",
421
+ "paramSchema": {
422
+ "type": "object",
423
+ "properties": {
424
+ "workPath": {
425
+ "type": "string",
426
+ "title": "Working folder",
427
+ "description": "Per-task working folder in the artifacts drawer. Defaults to this task's own folder so runs never collide; override with a stable name when you deliberately want runs to share files.",
428
+ "default": "{{task.dir}}"
429
+ }
430
+ }
431
+ },
432
+ "minGezelVersion": "1.26233"
433
+ }
@@ -0,0 +1,157 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "title": "Root-Cause Investigation — decimal cart total regression",
4
+ "objective": "Require the Root-Cause Investigation craftbook to reproduce a deterministic failure, identify the causal mechanism before editing, implement the smallest fix, and prove the regression test passes.",
5
+ "tags": [
6
+ "workflow",
7
+ "debugging",
8
+ "code-with-tests",
9
+ "node"
10
+ ],
11
+ "prompt": "Use the Root-Cause Investigation craftbook to diagnose the failing decimal cart-total behavior in this workspace. First reproduce it with the existing dependency-free test and preserve concrete evidence; do not edit until a causal hypothesis has been tested. Then make the smallest correct source change, keep the regression coverage, and write the craftbook's artifacts, including `tasks/eval/reports/root-cause-investigation.md`. The final report must cite the files inspected, distinguish root cause from symptom, include the exact verification command and result, and describe a safe rollback.",
12
+ "setup": {
13
+ "projectName": "Decimal cart total regression",
14
+ "about": "A tiny dependency-free Node project with one reproducible arithmetic defect. The initial test is expected to fail.",
15
+ "missionObjectives": "Restore exact cent-based addition for decimal prices without broad refactoring and leave a passing regression test plus an evidence-backed investigation report.",
16
+ "files": [
17
+ {
18
+ "path": "package.json",
19
+ "content": "{\n \"name\": \"cart-total-fixture\",\n \"private\": true,\n \"type\": \"module\"\n}\n"
20
+ },
21
+ {
22
+ "path": "src/cart-total.js",
23
+ "content": "/** Sum display-price strings and return a two-decimal total. */\nexport function cartTotal(prices) {\n const cents = prices.reduce((sum, price) => sum + parseInt(price, 10) * 100, 0);\n return (cents / 100).toFixed(2);\n}\n"
24
+ },
25
+ {
26
+ "path": "tests/cart-total.test.mjs",
27
+ "content": "import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { cartTotal } from '../src/cart-total.js';\n\ntest('keeps cents when totaling decimal display prices', () => {\n assert.equal(cartTotal(['19.99', '5.50']), '25.49');\n});\n\ntest('handles a single whole-dollar price', () => {\n assert.equal(cartTotal(['7.00']), '7.00');\n});\n"
28
+ },
29
+ {
30
+ "path": "source/incident.md",
31
+ "content": "# Incident note\n\nCheckout preview showed **$24.00** for line items **$19.99** and **$5.50**. The expected total is **$25.49**. The defect appeared after price inputs changed from integer-dollar strings to two-decimal display strings. No production data migration is in scope.\n"
32
+ },
33
+ {
34
+ "path": "tests/verify-cart-total.mjs",
35
+ "content": "import assert from 'node:assert/strict';\nimport { cartTotal } from '../src/cart-total.js';\n\nconst cases = [\n [['19.99', '5.50'], '25.49'],\n [['0.10', '0.20'], '0.30'],\n [['12.34', '0.66'], '13.00'],\n [['7.00'], '7.00'],\n [['1.01', '2.02', '3.03'], '6.06'],\n];\nfor (const [prices, expected] of cases) assert.equal(cartTotal(prices), expected, prices.join(' + '));\nconsole.log('CART_TOTAL_ORACLE_OK 5/5');\n",
36
+ "surface": "harness"
37
+ }
38
+ ],
39
+ "craftbookParams": {
40
+ "workPath": "tasks/eval"
41
+ }
42
+ },
43
+ "mocks": [],
44
+ "success": {
45
+ "summary": "The decimal regression is fixed by a diagnosed causal change, the existing test passes, and the craftbook report preserves reproducible evidence.",
46
+ "deliverables": [
47
+ {
48
+ "path": "tasks/eval/reports/root-cause-investigation.md",
49
+ "kind": "markdown-report",
50
+ "artifact": true,
51
+ "minBytes": 1200,
52
+ "checks": [
53
+ {
54
+ "kind": "contains",
55
+ "file": "tasks/eval/reports/root-cause-investigation.md",
56
+ "pattern": "^#{1,3}\\s+Root cause\\b[\\s\\S]*^#{1,3}\\s+(Fix|Changed files)\\b[\\s\\S]*^#{1,3}\\s+(Regression coverage|Verification)\\b[\\s\\S]*^#{1,3}\\s+Rollback\\b",
57
+ "flags": "im",
58
+ "label": "root cause through rollback sections"
59
+ },
60
+ {
61
+ "kind": "contains",
62
+ "file": "tasks/eval/reports/root-cause-investigation.md",
63
+ "pattern": "parseInt|truncat(?:e|ed|ion)|discard(?:s|ed)?\\s+(?:the\\s+)?(?:decimal|fractional|cent)",
64
+ "flags": "i",
65
+ "label": "causal mechanism"
66
+ },
67
+ {
68
+ "kind": "contains",
69
+ "file": "tasks/eval/reports/root-cause-investigation.md",
70
+ "pattern": "node\\s+--test\\s+tests/cart-total\\.test\\.mjs[\\s\\S]*(pass|2\\s+tests?|exit(?:ed)?\\s+0)",
71
+ "flags": "i",
72
+ "label": "verification command and result"
73
+ },
74
+ {
75
+ "kind": "citationsResolve",
76
+ "file": "tasks/eval/reports/root-cause-investigation.md",
77
+ "minCitations": 2
78
+ }
79
+ ]
80
+ }
81
+ ],
82
+ "checks": [
83
+ {
84
+ "kind": "notContains",
85
+ "file": "src/cart-total.js",
86
+ "pattern": "\\bparseInt\\s*\\(",
87
+ "label": "lossy integer parsing removed"
88
+ },
89
+ {
90
+ "kind": "sourceParses",
91
+ "file": "src/cart-total.js"
92
+ },
93
+ {
94
+ "kind": "nodeRuns",
95
+ "file": "tests/cart-total.test.mjs",
96
+ "timeoutMs": 20000
97
+ },
98
+ {
99
+ "kind": "nodeScriptPasses",
100
+ "script": "tests/verify-cart-total.mjs",
101
+ "requiredOutput": [
102
+ {
103
+ "pattern": "CART_TOTAL_ORACLE_OK 5/5",
104
+ "label": "hidden multi-case regression oracle"
105
+ }
106
+ ]
107
+ }
108
+ ],
109
+ "taskNotes": {
110
+ "minBytes": 180,
111
+ "checks": [
112
+ {
113
+ "kind": "contains",
114
+ "file": "task-notes.md",
115
+ "pattern": "\\bDONE\\b[\\s\\S]*(node\\s+--test|tests/cart-total\\.test\\.mjs)[\\s\\S]*tasks/eval/reports/root-cause-investigation\\.md",
116
+ "flags": "i",
117
+ "label": "terminal note records proof and report"
118
+ }
119
+ ],
120
+ "requireCraftbookTask": true
121
+ },
122
+ "taskGraph": {
123
+ "requireCraftbookTask": true,
124
+ "requireTerminalStep": true
125
+ },
126
+ "unchangedFixtures": [
127
+ "package.json",
128
+ "tests/cart-total.test.mjs",
129
+ "source/incident.md"
130
+ ]
131
+ },
132
+ "rubric": {
133
+ "artifact": {
134
+ "path": "tasks/eval/reports/root-cause-investigation.md",
135
+ "kind": "markdown"
136
+ },
137
+ "axes": [
138
+ {
139
+ "name": "Causal rigor",
140
+ "description": "The report explains why the observed inputs fail in this implementation and distinguishes causal evidence from guesses."
141
+ },
142
+ {
143
+ "name": "Fix discipline",
144
+ "description": "The source change is minimal, directly addresses the diagnosed mechanism, and avoids unrelated refactoring."
145
+ },
146
+ {
147
+ "name": "Verification quality",
148
+ "description": "Reproduction, regression coverage, final command result, blast radius, and rollback are concrete and auditable."
149
+ }
150
+ ]
151
+ },
152
+ "qualityFocus": [
153
+ "Diagnosis precedes source edits",
154
+ "The fix preserves decimal cents and passes the dependency-free test",
155
+ "The final report cites real workspace files and includes rollback"
156
+ ]
157
+ }
@@ -5,14 +5,14 @@
5
5
  "role": "maintenance-review",
6
6
  "category": "code-quality",
7
7
  "name": "Schema / Type Migration",
8
- "description": "Plan and execute a multi-file schema or type migration safely — changing a data model, type definition, or interface across the codebase while keeping everything compiling and consistent. Plans the migration FIRST the before/after shape, every call-site and file touched, the ordering that never leaves the tree broken, and the backout then applies the change file-by-file, then a reviewer verifies the tree still builds and nothing referencing the old shape remains. Covers find-all-references, safe edit ordering, backward-compatibility shims, codemod-style changes, and compile/test-green verification.",
8
+ "description": "Migrate a schema or data shape with the expand/contract discipline: reads accept both shapes while the data moves, the old shape is dropped only after every record is transformed, and real suite runs between stages prove no record was ever stranded.",
9
9
  "tags": [
10
- "gallery",
11
10
  "migration",
12
- "refactor",
13
11
  "schema",
14
12
  "types",
15
- "codemod"
13
+ "refactor",
14
+ "codemod",
15
+ "expand-contract"
16
16
  ],
17
17
  "maintainer": {
18
18
  "name": "Gezel"