@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,196 @@
1
+ {
2
+ "id": "dependency-upgrade",
3
+ "name": "Upgrade a Dependency",
4
+ "description": "Upgrade dependencies in reviewable stages with proof at every step: a green suite before any bump, smallest-risk-first ordering, call-site adaptations at their real locations, a real suite run between stages, and an honest revert for anything that cannot go green.",
5
+ "category": "code-quality",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "dependencies",
9
+ "upgrade",
10
+ "maintenance",
11
+ "supply-chain",
12
+ "tests",
13
+ "quality"
14
+ ],
15
+ "triggers": [
16
+ "upgrade the dependencies",
17
+ "bump the deps",
18
+ "update this package",
19
+ "dependency upgrade"
20
+ ],
21
+ "about": "Upgrade dependencies the way a careful maintainer would, with each claim mechanically verified. This is the applying sibling of the report-only Dependency Audit: where that book tells you what is risky, this one moves the versions. First SURVEY: read the real dependency state (manifest, lockfile, installed packages, or a vendored tree the repository documents), run the suite so green-before-any-bump is a recorded receipt, and read each candidate's breaking-change surface from what exists LOCALLY - changelogs and READMEs inside node_modules, or the repository's own upgrade notes. Release notes are never invented; a candidate whose changes cannot be read locally is staged conservatively and marked unknown. Then UPGRADE stage by stage, smallest-risk-first: apply the version change at its real location, adapt the call sites it breaks, and run the suite before the next stage begins. A stage that cannot go green is reverted and recorded with the reason, never forced through; a major that needs real design work is deferred honestly. Then VERIFY the final tree green and record a concrete rollback path. Finally an independent reviewer grades the whole chain against fixed criteria, and their REVISE verdict routes the work back automatically with concrete findings. Needs a project whose tests run via `npm run test`. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
22
+ "doc": {
23
+ "paramSchema": {
24
+ "type": "object",
25
+ "properties": {
26
+ "scope": {
27
+ "type": "string",
28
+ "title": "What to upgrade",
29
+ "description": "A single dependency, a patch-level sweep, or a named major upgrade. Leave empty to survey and pick the safest valuable set.",
30
+ "default": ""
31
+ }
32
+ }
33
+ },
34
+ "capabilityFloor": "medium",
35
+ "diffpackCapable": true,
36
+ "commands": [
37
+ {
38
+ "scope": "script",
39
+ "name": "test",
40
+ "reason": "each upgrade stage must leave the suite green - the gates read real run receipts"
41
+ }
42
+ ],
43
+ "runModes": {
44
+ "scheduled": "supported"
45
+ }
46
+ },
47
+ "workflow": {
48
+ "plan": "Survey the real dependency state and stage the work smallest-risk-first (green-suite receipt before any bump) -> execute stage by stage with the suite run between stages and honest reverts -> verify the final tree green and record the rollback path -> enforced independent review.",
49
+ "maxGateAttempts": 4,
50
+ "maxReviewRounds": 3,
51
+ "phases": [
52
+ {
53
+ "id": "survey",
54
+ "name": "Survey the dependency state",
55
+ "description": "Read the real dependency state and each candidate's locally-readable breaking-change surface, record the green baseline, and stage the work smallest-risk-first.",
56
+ "suggestedRole": "dependency auditor",
57
+ "capabilityFloor": "medium",
58
+ "prompt": "The upgrade scope: {{scope}}\n\nEstablish the REAL dependency state before changing anything. Read `package.json` (and the lockfile if one exists), run `list_packages`, and work out how this project consumes each dependency - registry installs, or a vendored tree the repository documents. Then run the suite with `run_package_script` (`test`) and record that it is green BEFORE any bump. If the suite is already red, record the failure honestly and stop - never upgrade on top of a red suite. If the command needs first-use approval, say so and wait rather than guessing.\n\nFor each upgrade candidate, read its breaking-change surface from what is available LOCALLY: changelogs and READMEs inside `node_modules/`, or the repository's own upgrade notes for vendored code. Never invent release notes you did not read - a candidate whose changes you cannot read locally gets staged conservatively and marked unknown. Order the stages smallest-risk-first: patches before minors before majors, one dependency (or one tightly-coupled group) per stage. If nothing is worth upgrading here, record that finding honestly and stop.\n\nWrite `{{workPath}}/survey.md` with exactly these sections: `## Current state` (what is installed, from the real manifest and lockfile), `## Candidates` (each candidate with its current and target version and where you read its notes), `## Breaking-change notes` (what actually changes, only from sources you read, each cited with a backtick path), `## Stage plan` (numbered stages, smallest-risk-first, with the reason for the order).",
59
+ "output": {
60
+ "path": "{{workPath}}/survey.md",
61
+ "minBytes": 600,
62
+ "requiredPatterns": [
63
+ {
64
+ "pattern": "^##\\s+Current state",
65
+ "label": "Current state section"
66
+ },
67
+ {
68
+ "pattern": "^##\\s+Candidates",
69
+ "label": "Candidates section"
70
+ },
71
+ {
72
+ "pattern": "^##\\s+Breaking-change notes",
73
+ "label": "Breaking-change notes section"
74
+ },
75
+ {
76
+ "pattern": "^##\\s+Stage plan",
77
+ "label": "Stage plan section"
78
+ }
79
+ ],
80
+ "additionalChecks": [
81
+ {
82
+ "kind": "citationsResolve",
83
+ "file": "{{workPath}}/survey.md",
84
+ "minCitations": 2,
85
+ "artifact": true
86
+ },
87
+ {
88
+ "kind": "commandEvidence",
89
+ "script": "test",
90
+ "expect": "pass",
91
+ "label": "green before any bump"
92
+ }
93
+ ]
94
+ }
95
+ },
96
+ {
97
+ "id": "upgrade",
98
+ "name": "Execute the stages",
99
+ "description": "Apply each stage at its real location, adapt the call sites it breaks, and run the suite between stages; revert and record any stage that cannot go green.",
100
+ "suggestedRole": "software engineer",
101
+ "capabilityFloor": "medium",
102
+ "prompt": "Read `{{workPath}}/survey.md` and execute its stage plan one stage at a time. For each stage: apply the version change at its real location - edit the manifest and run `npm_install` for registry dependencies, or replace the vendored tree exactly as the repository's convention documents for vendored ones - then adapt every call site the change breaks at its real location with `read_file` plus `write_file`/`replace_in_file`, and run the suite with `run_package_script` (`test`) before starting the next stage. Never begin a stage while the previous one is red.\n\nA stage that cannot go green gets REVERTED - put the manifest, lockfile, and touched files back exactly as they were - and recorded with the concrete failure, never forced through by weakening tests or pinning over the breakage. A major that turns out to need real design work is deferred honestly, not hacked through. If every stage had to be reverted, record that outcome honestly and stop.\n\nWrite `{{workPath}}/change-notes.md` with exactly these sections: `## Stages executed` (each stage with its suite result), `## Files touched` (backtick path per line), `## Adaptations` (each call-site change and why the new version needs it), `## Reverted stages` (each with the concrete failure that forced the revert, or 'none').",
103
+ "output": {
104
+ "path": "{{workPath}}/change-notes.md",
105
+ "minBytes": 700,
106
+ "requiredPatterns": [
107
+ {
108
+ "pattern": "^##\\s+Stages executed",
109
+ "label": "Stages executed section"
110
+ },
111
+ {
112
+ "pattern": "^##\\s+Files touched",
113
+ "label": "Files touched section"
114
+ },
115
+ {
116
+ "pattern": "^##\\s+Adaptations",
117
+ "label": "Adaptations section"
118
+ },
119
+ {
120
+ "pattern": "^##\\s+Reverted stages",
121
+ "label": "Reverted stages section"
122
+ }
123
+ ],
124
+ "additionalChecks": [
125
+ {
126
+ "kind": "citationsResolve",
127
+ "file": "{{workPath}}/change-notes.md",
128
+ "minCitations": 2,
129
+ "artifact": true
130
+ }
131
+ ]
132
+ }
133
+ },
134
+ {
135
+ "id": "verify",
136
+ "name": "Verify and record the rollback",
137
+ "description": "Re-run the whole suite on the final tree, spot-check the adaptations, and record a concrete rollback path.",
138
+ "suggestedRole": "software engineer",
139
+ "capabilityFloor": "medium",
140
+ "prompt": "Prove the result with fresh eyes. Re-run the whole suite with `run_package_script` (`test`) - it must be green on the final tree; if it is not, go back and fix or revert before verifying again. Re-read `{{workPath}}/change-notes.md` and spot-check each adaptation at its real location with `read_file`. Then record the rollback path: exactly which manifest and lockfile entries (or vendored files) to restore, and in what order, to return to the pre-upgrade state. Anything you could not actually run gets labeled unverified, never claimed.\n\nWrite `{{workPath}}/verification.md` with exactly these sections: `## Suite` (the full-suite command and its result), `## Adaptations verified` (which call sites you re-opened and what you confirmed), `## Rollback` (the concrete revert steps), `## Result` (upgraded and green, or what remains unverified and why).",
141
+ "output": {
142
+ "path": "{{workPath}}/verification.md",
143
+ "minBytes": 450,
144
+ "requiredPatterns": [
145
+ {
146
+ "pattern": "^##\\s+Suite",
147
+ "label": "Suite section"
148
+ },
149
+ {
150
+ "pattern": "^##\\s+Adaptations verified",
151
+ "label": "Adaptations verified section"
152
+ },
153
+ {
154
+ "pattern": "^##\\s+Rollback",
155
+ "label": "Rollback section"
156
+ },
157
+ {
158
+ "pattern": "^##\\s+Result",
159
+ "label": "Result section"
160
+ }
161
+ ],
162
+ "additionalChecks": [
163
+ {
164
+ "kind": "commandEvidence",
165
+ "script": "test",
166
+ "expect": "pass",
167
+ "label": "the whole suite is green on the upgraded tree (verified run receipt)"
168
+ }
169
+ ]
170
+ }
171
+ }
172
+ ],
173
+ "review": {
174
+ "artifactPath": "{{workPath}}/verification.md",
175
+ "relatedPaths": [
176
+ "{{workPath}}/survey.md",
177
+ "{{workPath}}/change-notes.md"
178
+ ],
179
+ "reviewPath": "{{workPath}}/review.md",
180
+ "reviewerRole": "dependency reviewer",
181
+ "repairRole": "software engineer",
182
+ "minReviewBytes": 400,
183
+ "enforce": {
184
+ "fixStepId": "repair"
185
+ },
186
+ "criteria": [
187
+ "The stages in change-notes.md were real and ordered smallest-risk-first, matching the plan in survey.md or explaining every deviation.",
188
+ "Green between stages is receipts, not claims: the suite was genuinely run before the first bump and between stages - judged from the recorded runs, not the author's summary.",
189
+ "Breaking-change notes cite sources that were genuinely read locally; nothing is presented as a release note that was invented.",
190
+ "Every adaptation cites a real file, and the change at that site matches what the new version actually requires - open the touched files; do not grade from change-notes.md alone.",
191
+ "Stages that could not go green were reverted and recorded with concrete reasons; majors that need design work were deferred honestly, not hacked through.",
192
+ "verification.md records a concrete, runnable rollback path and the final suite run is green - judged from the recorded run receipts."
193
+ ]
194
+ }
195
+ }
196
+ }
@@ -0,0 +1,238 @@
1
+ {
2
+ "id": "flaky-test-fix",
3
+ "name": "Fix a Flaky Test",
4
+ "description": "Hunt down an intermittently failing test and make it deterministic: reproduce the flake with real recorded runs, isolate the nondeterminism mechanism, remove it at the real site — never by deleting, skipping, or retrying the test — and prove stability with three consecutive green runs.",
5
+ "category": "code-quality",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "flaky-test",
9
+ "deflake",
10
+ "tests",
11
+ "nondeterminism",
12
+ "ci",
13
+ "debugging",
14
+ "quality"
15
+ ],
16
+ "triggers": [
17
+ "fix this flaky test",
18
+ "deflake",
19
+ "test fails intermittently",
20
+ "fails in CI but passes locally",
21
+ "intermittent test failure"
22
+ ],
23
+ "about": "Deflake a test the way a senior engineer would: by removing the nondeterminism, never by hiding it. First REPRODUCE statistically — run the real suite repeatedly with `run_package_script` until the intermittent failure is recorded in run receipts the gates can verify, and note the failure signature and the conditions it appears under (full suite versus alone, ordering, concurrency, timing). Then ISOLATE the mechanism with a targeted experiment — run the test alone versus in the suite, reorder, repeat — until you can name the defect site: the shared state, missing await, unseeded randomness, time dependence, or leaked resource that lets one run differ from the next. Then FIX at that real site with isolation or cleanup that covers every test — and never delete the test, skip it, weaken its assertion, widen a timeout, or wrap it in retries: those make the dashboard green while the bug ships. Finally PROVE stability: three consecutive green suite runs, read from real run receipts rather than the author's claims, then an independent reviewer checks that the mechanism itself was removed and a REVISE verdict routes the work back automatically with concrete findings. Needs a project whose tests run via `npm run test`. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
24
+ "doc": {
25
+ "paramSchema": {
26
+ "type": "object",
27
+ "properties": {
28
+ "scope": {
29
+ "type": "string",
30
+ "title": "Flaky test to fix",
31
+ "description": "The flaky test, failure message, or suite area to chase. Leave empty when the task description already carries it.",
32
+ "default": ""
33
+ }
34
+ }
35
+ },
36
+ "capabilityFloor": "medium",
37
+ "diffpackCapable": true,
38
+ "commands": [
39
+ {
40
+ "scope": "script",
41
+ "name": "test",
42
+ "reason": "Statistical reproduction and the consecutive-green stability proof read real run receipts — the gates verify recorded runs, not claims."
43
+ }
44
+ ],
45
+ "runModes": {
46
+ "nightShift": "supported"
47
+ }
48
+ },
49
+ "workflow": {
50
+ "plan": "Reproduce the flake with recorded suite runs -> isolate the nondeterminism mechanism with a targeted experiment -> remove it at the real site (never skip, retry, or widen timeouts) -> prove stability with three consecutive green runs -> enforced independent review.",
51
+ "maxGateAttempts": 4,
52
+ "maxReviewRounds": 3,
53
+ "phases": [
54
+ {
55
+ "id": "reproduce",
56
+ "name": "Reproduce the flake with recorded runs",
57
+ "description": "Run the suite repeatedly until the intermittent failure is a recorded fact, and characterize when it appears.",
58
+ "suggestedRole": "debugging engineer",
59
+ "capabilityFloor": "medium",
60
+ "prompt": "The flaky test to fix: {{scope}}\n\nEstablish the flake as a recorded fact before theorizing. Find how this project runs its tests (`list_package_scripts`, then read the test layout). Run the suite with `run_package_script` (`test`) repeatedly — several runs if needed — until the intermittent failure is recorded, and keep the passing runs on record too: the pass/fail mix IS the evidence. Note the exact failure signature (test name, assertion, message) and the conditions it appears under — full suite versus alone, ordering, concurrency, timing, environment. If the command needs first-use approval, say so and wait rather than guessing. If the failure refuses to appear after many runs, record every run honestly and what you varied between them; do not fabricate a failing run.\n\nWrite `{{workPath}}/flake-evidence.md` with exactly these sections: `## Symptom` (which test fails, and how often out of how many runs), `## Runs observed` (each run and its outcome, with the failing output quoted from a real run), `## Failure signature` (the exact assertion and message), `## Suspected class` (ordering, shared state, timing, or environment — with the observation that points there). Cite the real test and source files with backtick paths.",
61
+ "output": {
62
+ "path": "{{workPath}}/flake-evidence.md",
63
+ "minBytes": 500,
64
+ "requiredPatterns": [
65
+ {
66
+ "pattern": "^##\\s+Symptom",
67
+ "label": "Symptom section"
68
+ },
69
+ {
70
+ "pattern": "^##\\s+Runs observed",
71
+ "label": "Runs observed section"
72
+ },
73
+ {
74
+ "pattern": "^##\\s+Failure signature",
75
+ "label": "Failure signature section"
76
+ },
77
+ {
78
+ "pattern": "^##\\s+Suspected class",
79
+ "label": "Suspected class section"
80
+ }
81
+ ],
82
+ "additionalChecks": [
83
+ {
84
+ "kind": "citationsResolve",
85
+ "file": "{{workPath}}/flake-evidence.md",
86
+ "minCitations": 2,
87
+ "artifact": true
88
+ },
89
+ {
90
+ "kind": "commandEvidence",
91
+ "script": "test",
92
+ "expect": "fail",
93
+ "label": "at least one recorded failing run of the suite"
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ {
99
+ "id": "isolate",
100
+ "name": "Isolate the mechanism",
101
+ "description": "Pin the nondeterminism with a targeted experiment and name the defect site. No fixes yet.",
102
+ "suggestedRole": "root-cause analyst",
103
+ "capabilityFloor": "medium",
104
+ "prompt": "Read `{{workPath}}/flake-evidence.md`, then pin the MECHANISM with a targeted experiment, not a guess. Good experiments: run the failing test alone versus in the full suite; temporarily reorder or comment out neighboring tests (and restore them afterwards); repeat runs to confirm the pattern is what you think it is. Read the test and the code under test until you can name the defect site precisely — the shared module state, missing await, unseeded randomness, time or filesystem dependence, or leaked resource that makes the outcome depend on anything besides the code under test. Check siblings: which neighboring tests share the same hazard? Undo every temporary experiment edit before finishing, and make no fix in this phase. If the experiments stay inconclusive, record what each one showed and ruled out — an honest unknown beats a confident guess.\n\nWrite `{{workPath}}/diagnosis.md` with exactly these sections: `## Mechanism` (the nondeterminism, named concretely), `## Experiment` (what you ran and what each variation showed), `## Defect site` (file and symbol, with backtick paths), `## Siblings checked` (neighboring tests that share or escape the hazard). Every path you cite must be real.",
105
+ "output": {
106
+ "path": "{{workPath}}/diagnosis.md",
107
+ "minBytes": 600,
108
+ "requiredPatterns": [
109
+ {
110
+ "pattern": "^##\\s+Mechanism",
111
+ "label": "Mechanism section"
112
+ },
113
+ {
114
+ "pattern": "^##\\s+Experiment",
115
+ "label": "Experiment section"
116
+ },
117
+ {
118
+ "pattern": "^##\\s+Defect site",
119
+ "label": "Defect site section"
120
+ },
121
+ {
122
+ "pattern": "^##\\s+Siblings checked",
123
+ "label": "Siblings checked section"
124
+ }
125
+ ],
126
+ "additionalChecks": [
127
+ {
128
+ "kind": "citationsResolve",
129
+ "file": "{{workPath}}/diagnosis.md",
130
+ "minCitations": 2,
131
+ "artifact": true
132
+ }
133
+ ]
134
+ }
135
+ },
136
+ {
137
+ "id": "fix",
138
+ "name": "Remove the nondeterminism",
139
+ "description": "Make the outcome deterministic at the real site — isolation, cleanup, awaits, seeding — never masking.",
140
+ "suggestedRole": "software engineer",
141
+ "capabilityFloor": "medium",
142
+ "prompt": "Read `{{workPath}}/diagnosis.md` and remove the nondeterminism at the defect site it names. There is no prescribed output path for source changes — edit the actual files from the diagnosis with `read_file` plus `write_file`/`replace_in_file`. The right shapes: cleanup or isolation that runs for EVERY test (a beforeEach/afterEach reset, a fresh instance per test), an explicit await on work that was racing, seeded or injected randomness and time, releasing leaked resources. NEVER delete or skip the flaky test, never weaken its assertion, and never mask the flake with retries or widened timeouts — the test must still assert exactly what it asserted. A one-off reset inside the failing test alone is not cleanup; future tests inherit the same hazard, so fix it at the level every test shares. Cover the sibling hazards the diagnosis flagged. Re-run the suite with `run_package_script` (`test`) while you work.\n\nWrite `{{workPath}}/fix-notes.md` with exactly these sections: `## Problem` (one paragraph naming the mechanism), `## Change` (what you altered and why the outcome can no longer depend on order, timing, or luck), `## Files touched` (backtick path per line), `## Regression coverage` (why the flake cannot silently return — what fails if the cleanup is removed), `## Risk` (anything unverified, honestly), `## How to verify` (the exact commands a person runs).",
143
+ "output": {
144
+ "path": "{{workPath}}/fix-notes.md",
145
+ "minBytes": 700,
146
+ "requiredPatterns": [
147
+ {
148
+ "pattern": "^##\\s+Problem",
149
+ "label": "Problem section"
150
+ },
151
+ {
152
+ "pattern": "^##\\s+Change",
153
+ "label": "Change section"
154
+ },
155
+ {
156
+ "pattern": "^##\\s+Files touched",
157
+ "label": "Files touched section"
158
+ },
159
+ {
160
+ "pattern": "^##\\s+Regression coverage",
161
+ "label": "Regression coverage section"
162
+ },
163
+ {
164
+ "pattern": "^##\\s+Risk",
165
+ "label": "Risk section"
166
+ },
167
+ {
168
+ "pattern": "^##\\s+How to verify",
169
+ "label": "How to verify section"
170
+ }
171
+ ],
172
+ "additionalChecks": [
173
+ {
174
+ "kind": "citationsResolve",
175
+ "file": "{{workPath}}/fix-notes.md",
176
+ "minCitations": 2,
177
+ "artifact": true
178
+ }
179
+ ]
180
+ }
181
+ },
182
+ {
183
+ "id": "validate-stability",
184
+ "name": "Prove stability",
185
+ "description": "Three consecutive green suite runs, read from real receipts — one green run means nothing for a flake.",
186
+ "suggestedRole": "software engineer",
187
+ "capabilityFloor": "medium",
188
+ "prompt": "Prove the fix holds under repetition — one green run means nothing for a flake. Run the full suite with `run_package_script` (`test`) at least THREE times in a row; every run must be green, and the runs must be real receipts, not claims. If any run fails, the mechanism is not gone: record the failure honestly and route back through the evidence rather than re-rolling until you get lucky. Compare against `{{workPath}}/flake-evidence.md`: the once-flaky test must be present and passing in every run.\n\nWrite `{{workPath}}/validation.md` with exactly these sections: `## Runs` (each run and its result, in order), `## Result` (stability confirmed with the receipts, or what remains unstable and why).",
189
+ "output": {
190
+ "path": "{{workPath}}/validation.md",
191
+ "minBytes": 300,
192
+ "requiredPatterns": [
193
+ {
194
+ "pattern": "^##\\s+Runs",
195
+ "label": "Runs section"
196
+ },
197
+ {
198
+ "pattern": "^##\\s+Result",
199
+ "label": "Result section"
200
+ }
201
+ ],
202
+ "additionalChecks": [
203
+ {
204
+ "kind": "commandEvidence",
205
+ "script": "test",
206
+ "expect": "pass",
207
+ "minRuns": 3,
208
+ "label": "three consecutive green suite runs (verified run receipts)"
209
+ }
210
+ ]
211
+ }
212
+ }
213
+ ],
214
+ "review": {
215
+ "artifactPath": "{{workPath}}/validation.md",
216
+ "relatedPaths": [
217
+ "{{workPath}}/flake-evidence.md",
218
+ "{{workPath}}/diagnosis.md",
219
+ "{{workPath}}/fix-notes.md"
220
+ ],
221
+ "reviewPath": "{{workPath}}/review.md",
222
+ "reviewerRole": "test reliability reviewer",
223
+ "repairRole": "software engineer",
224
+ "minReviewBytes": 400,
225
+ "enforce": {
226
+ "fixStepId": "repair"
227
+ },
228
+ "criteria": [
229
+ "flake-evidence.md records real runs with at least one genuine failure quoted from run output and names the conditions the failure appeared under — not a summary of a hunch.",
230
+ "diagnosis.md names a concrete nondeterminism mechanism and a defect site that exists in this codebase, supported by a targeted experiment whose causal story actually explains the observed pass/fail pattern.",
231
+ "The change removes the mechanism at that site — open the touched files and check it is isolation, cleanup, awaited work, or seeded inputs at the level every test shares, not a one-off patch inside the failing test.",
232
+ "No masking: the once-flaky test still exists and still asserts what it asserted — open the test file and compare its assertion against flake-evidence.md's failure signature; it gained no skip, retry loop, or widened timeout.",
233
+ "validation.md's three consecutive green runs are backed by real run receipts with the once-flaky test present and passing — judged from the recorded runs, not the author's claims.",
234
+ "fix-notes.md names every touched file with paths that exist, explains why the flake cannot silently return, and states residual risk honestly."
235
+ ]
236
+ }
237
+ }
238
+ }
@@ -0,0 +1,187 @@
1
+ {
2
+ "id": "hotfix-flow",
3
+ "name": "Hotfix Flow",
4
+ "description": "Stop a live failure with the smallest change that fixes it at the real site: reproduce with the least machinery that demonstrates the failure, patch minimally with the proper repair recorded as follow-up, validate with a rollback path, and pass an enforced review of the blast radius.",
5
+ "category": "code-quality",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "hotfix",
9
+ "bug-fix",
10
+ "tdd",
11
+ "release",
12
+ "patch",
13
+ "regression",
14
+ "incident",
15
+ "minimal-diff",
16
+ "rollback"
17
+ ],
18
+ "triggers": [
19
+ "hotfix this bug",
20
+ "urgent production fix",
21
+ "expedited patch",
22
+ "fix the live defect",
23
+ "out-of-band fix",
24
+ "emergency fix",
25
+ "stop the bleeding"
26
+ ],
27
+ "about": "The minimal-diff bug fix for when something is broken NOW. Urgency is not an excuse for guesswork, so the ordering still holds — but every step is sized for an emergency. First REPRODUCE with the LEAST machinery that honestly demonstrates the failure: the command the incident names, a few-line probe, a focused test only when it costs minutes — never new test infrastructure at midnight. A hotfix aimed at an unreproduced defect is a coin flip. Then PATCH: the smallest change at the real defect site that stops the failure, with refactors, renames, and the proper deeper repair explicitly deferred into a written Follow-up rather than attempted under pressure — the debt is recorded, not denied. Then VALIDATE: re-run the exact reproduction, exercise the immediate neighborhood cheaply, state plainly what was and was not verified, and write the rollback path before anyone needs it. Finally an independent reviewer grades the whole chain — blast radius counted in the touched files, evidence concrete, rollback runnable, debt recorded — and a REVISE verdict routes the work back automatically with findings. Deliberately requires no test suite or npm commands: it works on projects where nothing is runnable but the failure itself, which is exactly where hotfixes happen. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
28
+ "doc": {
29
+ "paramSchema": {
30
+ "type": "object",
31
+ "properties": {
32
+ "scope": {
33
+ "type": "string",
34
+ "title": "Incident to hotfix",
35
+ "description": "The incident, bug report, or failing behavior to hotfix. Leave empty when the task description already carries it.",
36
+ "default": ""
37
+ }
38
+ }
39
+ },
40
+ "capabilityFloor": "small",
41
+ "diffpackCapable": true
42
+ },
43
+ "workflow": {
44
+ "plan": "Reproduce with the least machinery that demonstrates the failure -> smallest change that stops the bleeding at the real defect site (proper repair deferred to Follow-up) -> re-run the reproduction and record a rollback path -> enforced independent review of blast radius and honesty.",
45
+ "maxGateAttempts": 4,
46
+ "maxReviewRounds": 3,
47
+ "phases": [
48
+ {
49
+ "id": "reproduce",
50
+ "name": "Reproduce with the least machinery",
51
+ "description": "Establish the failure cheaply and concretely: a command, a probe, or a focused test — whatever demonstrates it fastest.",
52
+ "suggestedRole": "incident responder",
53
+ "capabilityFloor": "small",
54
+ "prompt": "The incident to hotfix: {{scope}}\n\nEstablish the failure with the LEAST machinery that honestly demonstrates it — this is an emergency, not the time to build test infrastructure. Read the incident report and the involved source with `read_file`. Choose the cheapest real reproduction: the command or entry point the report names, a few-line probe script, or a focused test only when the project already has an obvious test layout and it costs minutes. When a script-execution tool such as `run_nodejs_script` is wired this turn, actually run the reproduction and capture the output — the error text, the stack line, the wrong value. When no execution surface is available, say so plainly and pin the failure by reading the code to the exact line instead; never present a run you did not perform. Do not fix anything in this phase. If you cannot reproduce or locate the failure at all, record every attempt honestly rather than inventing a cause.\n\nWrite `{{workPath}}/repro.md` with exactly these sections: `## Symptom` (what is breaking, in the reporter's words), `## Repro command` (the exact command or probe that demonstrates it), `## Expected`, `## Actual` (the captured output or observed behavior — quote real text, and label anything you could not execute), `## Evidence` (the involved files with backtick paths, down to the line or symbol where the failure surfaces).",
55
+ "output": {
56
+ "path": "{{workPath}}/repro.md",
57
+ "minBytes": 500,
58
+ "requiredPatterns": [
59
+ {
60
+ "pattern": "^##\\s+Symptom",
61
+ "label": "Symptom section"
62
+ },
63
+ {
64
+ "pattern": "^##\\s+Repro command",
65
+ "label": "Repro command section"
66
+ },
67
+ {
68
+ "pattern": "^##\\s+Expected",
69
+ "label": "Expected section"
70
+ },
71
+ {
72
+ "pattern": "^##\\s+Actual",
73
+ "label": "Actual section"
74
+ },
75
+ {
76
+ "pattern": "^##\\s+Evidence",
77
+ "label": "Evidence section"
78
+ }
79
+ ],
80
+ "additionalChecks": [
81
+ {
82
+ "kind": "citationsResolve",
83
+ "file": "{{workPath}}/repro.md",
84
+ "minCitations": 2,
85
+ "artifact": true
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "id": "patch",
92
+ "name": "Smallest change that stops the bleeding",
93
+ "description": "Fix the cause at the real defect site with the minimum blast radius; defer the proper repair into Follow-up.",
94
+ "suggestedRole": "software engineer",
95
+ "capabilityFloor": "small",
96
+ "prompt": "Read `{{workPath}}/repro.md`, find the defect site it points at, and stop the bleeding with the SMALLEST change that fixes the cause. There is no prescribed output path for source changes — edit the actual files with `read_file` plus `write_file`/`replace_in_file`. Hotfix discipline: touch only what stopping THIS failure requires — no refactors, no renames, no drive-by cleanup, no new abstractions. When the proper repair is bigger than the emergency allows, make the safe narrow change now and write the proper repair into Follow-up instead of attempting it. Never special-case the exact reproduction input just to silence it, and never hide the failure behind a blanket try/catch that swallows the error instead of preventing it. Re-check the reproduction as you work.\n\nWrite `{{workPath}}/fix-notes.md` with exactly these sections: `## Problem` (one paragraph), `## Change` (what you altered and why it stops the failure at its cause), `## Files touched` (backtick path per line), `## Risk` (what this patch could still break and anything you did not verify — be honest), `## How to verify` (the exact commands or checks a person runs to confirm), `## Follow-up` (the deferred proper fix and the debt this patch leaves, plus the backport note when other branches or releases need it).",
97
+ "output": {
98
+ "path": "{{workPath}}/fix-notes.md",
99
+ "minBytes": 700,
100
+ "requiredPatterns": [
101
+ {
102
+ "pattern": "^##\\s+Problem",
103
+ "label": "Problem section"
104
+ },
105
+ {
106
+ "pattern": "^##\\s+Change",
107
+ "label": "Change section"
108
+ },
109
+ {
110
+ "pattern": "^##\\s+Files touched",
111
+ "label": "Files touched section"
112
+ },
113
+ {
114
+ "pattern": "^##\\s+Risk",
115
+ "label": "Risk section"
116
+ },
117
+ {
118
+ "pattern": "^##\\s+How to verify",
119
+ "label": "How to verify section"
120
+ },
121
+ {
122
+ "pattern": "^##\\s+Follow-up",
123
+ "label": "Follow-up section"
124
+ }
125
+ ],
126
+ "additionalChecks": [
127
+ {
128
+ "kind": "citationsResolve",
129
+ "file": "{{workPath}}/fix-notes.md",
130
+ "minCitations": 2,
131
+ "artifact": true
132
+ }
133
+ ]
134
+ }
135
+ },
136
+ {
137
+ "id": "validate",
138
+ "name": "Re-run the reproduction and record rollback",
139
+ "description": "Prove the failure is gone, be explicit about what was and was not verified, and write the escape route.",
140
+ "suggestedRole": "software engineer",
141
+ "capabilityFloor": "small",
142
+ "prompt": "Prove the patch did its one job, and write down the escape route. Read `{{workPath}}/repro.md` and re-run the EXACT reproduction it records — the failure must be gone. Exercise the immediate neighborhood the cheapest honest way you can (the same entry point on a healthy input, an existing script, a small probe) so the patch did not trade one failure for another. Anything you could not actually run is recorded as unverified, never claimed — and when no execution surface is available this turn, verify by re-reading the changed code against the reproduction and say plainly that the run itself is still owed. Then record the rollback: exactly how to undo this patch fast if it goes wrong after shipping.\n\nWrite `{{workPath}}/validation.md` with exactly these sections: `## Repro re-run` (the command and what happened, or the honest record of why it could not run), `## Result` (what is fixed, what was verified, what remains unverified), `## Rollback` (the concrete, runnable way to revert this patch — the exact files to restore or the commit to revert, plus any step that must accompany it).",
143
+ "output": {
144
+ "path": "{{workPath}}/validation.md",
145
+ "minBytes": 400,
146
+ "requiredPatterns": [
147
+ {
148
+ "pattern": "^##\\s+Repro re-run",
149
+ "label": "Repro re-run section"
150
+ },
151
+ {
152
+ "pattern": "^##\\s+Result",
153
+ "label": "Result section"
154
+ },
155
+ {
156
+ "pattern": "^##\\s+Rollback",
157
+ "label": "Rollback section"
158
+ }
159
+ ]
160
+ }
161
+ }
162
+ ],
163
+ "review": {
164
+ "artifactPath": "{{workPath}}/validation.md",
165
+ "relatedPaths": [
166
+ "{{workPath}}/repro.md",
167
+ "{{workPath}}/fix-notes.md"
168
+ ],
169
+ "reviewPath": "{{workPath}}/review.md",
170
+ "reviewerRole": "incident reviewer",
171
+ "repairRole": "software engineer",
172
+ "minReviewBytes": 400,
173
+ "enforce": {
174
+ "fixStepId": "repair"
175
+ },
176
+ "criteria": [
177
+ "repro.md is concrete and honest: it quotes real captured output from a run that actually happened, or explicitly records that execution was unavailable and pins the failure to a line in the source — never an invented run.",
178
+ "The change is genuinely minimal: open every file fix-notes.md names and count the blast radius — nothing rode along beyond what stopping this one failure requires (no refactor, rename, or cleanup).",
179
+ "The patch fixes the cause at the real defect site rather than special-casing the reproduction input or swallowing the error with a blanket catch.",
180
+ "validation.md re-ran the original reproduction and the failure is gone — or states plainly what could not be run and why; nothing is claimed verified that was not.",
181
+ "The Rollback section is a real, runnable path: the exact files or commit to revert plus any accompanying step, not a vague instruction to undo the change.",
182
+ "The Follow-up section records the deferred proper fix and the debt this patch leaves, with a backport note when other branches or releases need it.",
183
+ "Every file path cited across repro.md, fix-notes.md, and validation.md exists in this project."
184
+ ]
185
+ }
186
+ }
187
+ }