@bendyline/gilde 0.1.24 → 0.1.26
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.
- package/authoring/gstack/evals/cso.json +2 -0
- package/authoring/gstack/overlays/cso.json +1 -0
- package/authoring/gstack/wave.json +2 -2
- package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.1/craftbook.json +358 -0
- package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.1/test.json +376 -0
- package/data/craftbook-templates/de/design-system-consultation/versions/2.0.1/craftbook.json +385 -0
- package/data/craftbook-templates/de/design-system-consultation/versions/2.0.1/test.json +201 -0
- package/data/craftbook-templates/en/engineering-retrospective/versions/2.0.1/craftbook.json +353 -0
- package/data/craftbook-templates/en/engineering-retrospective/versions/2.0.1/test.json +191 -0
- package/data/craftbook-templates/ex/executive-level-review/versions/2.0.1/craftbook.json +347 -0
- package/data/craftbook-templates/ex/executive-level-review/versions/2.0.1/test.json +135 -0
- package/data/craftbook-templates/id/idea-office-hours/versions/2.0.1/craftbook.json +333 -0
- package/data/craftbook-templates/id/idea-office-hours/versions/2.0.1/test.json +141 -0
- package/data/craftbook-templates/index.json +1 -1
- package/data/craftbook-templates/pu/pull-request-review/manifest.json +1 -1
- package/data/craftbook-templates/pu/pull-request-review/versions/1.4.0/craftbook.json +179 -0
- package/data/craftbook-templates/pu/pull-request-review/versions/1.4.0/test.json +123 -0
- package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.1/craftbook.json +348 -0
- package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.1/test.json +153 -0
- package/data/craftbook-templates/se/security-architecture-review/versions/2.0.1/craftbook.json +390 -0
- package/data/craftbook-templates/se/security-architecture-review/versions/2.0.1/test.json +154 -0
- package/data/craftbook-templates/se/security-architecture-review/versions/2.0.2/craftbook.json +450 -0
- package/data/craftbook-templates/se/security-architecture-review/versions/2.0.2/test.json +154 -0
- package/data/craftbook-templates/sp/spec-authoring/versions/2.0.1/craftbook.json +391 -0
- package/data/craftbook-templates/sp/spec-authoring/versions/2.0.1/test.json +162 -0
- package/data/craftbook-templates/te/technical-documentation/versions/2.0.1/craftbook.json +343 -0
- package/data/craftbook-templates/te/technical-documentation/versions/2.0.1/test.json +174 -0
- package/package.json +1 -1
- package/schemas/craftbook-doc.schema.json +170 -0
- package/schemas/craftbook-template-version.schema.json +170 -0
- package/schemas/craftbook-test.schema.json +143 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"id": "pull-request-review",
|
|
5
5
|
"role": "maintenance-review",
|
|
6
6
|
"name": "Pull Request Review",
|
|
7
|
-
"description": "Staff-engineer-style PR review. Defaults to the open pull request for the project's checked-out branch when one exists, accepts an explicit PR number from any branch,
|
|
7
|
+
"description": "Staff-engineer-style PR review over a complete local PR corpus. Defaults to the open pull request for the project's checked-out branch when one exists, accepts an explicit PR number from any branch, reviews changed files in bounded batches with mechanical coverage accounting, verifies cross-file claims against the checkout, and produces a structured local verdict. Requires a GitHub-connected project.",
|
|
8
8
|
"tags": [
|
|
9
9
|
"review",
|
|
10
10
|
"pull-request",
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "pull-request-review",
|
|
3
|
+
"name": "Pull Request Review",
|
|
4
|
+
"description": "Review a GitHub pull request from a complete, launch-time local mirror rather than a context-sized API response. The runtime resolves the explicit PR number or current-branch PR, materializes an overview, a machine-readable changed-file manifest, one untruncated patch record per changed path, comments, and the full diff. The reviewer processes at most 25 records per activation; a mechanical coverage gate reactivates the scan with a fresh context until every changed path is accounted for. Repository symbol search and GitHub check status ground cross-file and compile/CI claims before the final local verdict.",
|
|
5
|
+
"basedOn": {
|
|
6
|
+
"name": "Gezel Code Review",
|
|
7
|
+
"url": "https://github.com/bendyline/gezel"
|
|
8
|
+
},
|
|
9
|
+
"entryStepId": "scope",
|
|
10
|
+
"triggers": [
|
|
11
|
+
"review this pr",
|
|
12
|
+
"review the current pr",
|
|
13
|
+
"review this pull request",
|
|
14
|
+
"pr review",
|
|
15
|
+
"review the github pull request"
|
|
16
|
+
],
|
|
17
|
+
"requirements": [
|
|
18
|
+
{
|
|
19
|
+
"kind": "github"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"connectors": [
|
|
23
|
+
{
|
|
24
|
+
"typeId": "github-pulls",
|
|
25
|
+
"reason": "materialize the selected pull request as a complete, chunk-readable local corpus"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"toolsets": [
|
|
29
|
+
{
|
|
30
|
+
"toolsetId": "github",
|
|
31
|
+
"optional": true,
|
|
32
|
+
"autoAllow": true,
|
|
33
|
+
"reason": "read CI/check status and perform targeted PR verification"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"paramSchema": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"number": {
|
|
40
|
+
"type": "number",
|
|
41
|
+
"title": "Pull request number",
|
|
42
|
+
"description": "Optional PR number. Leave blank to use the open PR whose head matches the project's checked-out branch."
|
|
43
|
+
},
|
|
44
|
+
"focus": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"title": "Review focus",
|
|
47
|
+
"default": "general correctness",
|
|
48
|
+
"description": "Optional area to emphasize, e.g. security, performance, or tests."
|
|
49
|
+
},
|
|
50
|
+
"intensity": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"title": "Intensity",
|
|
53
|
+
"enum": [
|
|
54
|
+
"low",
|
|
55
|
+
"medium",
|
|
56
|
+
"high"
|
|
57
|
+
],
|
|
58
|
+
"default": "medium",
|
|
59
|
+
"squisq": {
|
|
60
|
+
"control": "segmented"
|
|
61
|
+
},
|
|
62
|
+
"description": "How deep to go on each changed-file batch. Coverage remains complete at every intensity."
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"steps": [
|
|
67
|
+
{
|
|
68
|
+
"id": "scope",
|
|
69
|
+
"name": "Map the pull request corpus",
|
|
70
|
+
"description": "Read the launch-time PR overview and manifest, record the authoritative changed-file count and review batches, and capture current CI/check evidence.",
|
|
71
|
+
"prompt": "**You are reviewing PR #{{number}}, not authoring it. Never modify project source in this craftbook.** The runtime already mirrored the selected PR into `{{corpusScope}}`; this corpus, not a single live diff call, is the authoritative review surface.\n\nCall `list_artifacts({ path: \"{{corpusScope}}\", recursive: true })`. Find and read the overview Markdown record and its attached `pr-{{number}}-files.json` manifest. The manifest contains the complete changed-file list and deterministic 25-file batches. Read the overview's PR metadata and existing comments. Call `github_check_status` for the overview's head ref and record whether checks are success, failure, pending, or unknown; this is evidence, not a substitute for reviewing the diff.\n\nWrite ONE task note beginning `## Scope — PR #{{number}}`. Include title, URL, head → base, draft state, exact changed-file count, manifest path, batch count/ranges, CI/check status, existing-review themes, and 3–6 review themes weighted by focus `{{focus}}` and intensity `{{intensity}}`. Do not retype paths from memory: derive them from the manifest. End by calling `advance_task_step`.",
|
|
72
|
+
"suggestedRole": "reviewer",
|
|
73
|
+
"gate": {
|
|
74
|
+
"at": "completion",
|
|
75
|
+
"scripts": [
|
|
76
|
+
{
|
|
77
|
+
"name": "checkTaskNoteContains",
|
|
78
|
+
"scope": "standard",
|
|
79
|
+
"inputs": {
|
|
80
|
+
"pattern": "##\\s*Scope\\s*[—-]\\s*PR\\s*#{{number}}[\\s\\S]*(?:changed.file|files?)"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"onReject": "scope",
|
|
85
|
+
"maxAttempts": 3
|
|
86
|
+
},
|
|
87
|
+
"next": "scan"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "scan",
|
|
91
|
+
"name": "Review the next changed-file batch",
|
|
92
|
+
"description": "Review at most 25 previously unreviewed PR records, persist observations and exact path coverage, then let the runtime reactivate this step with a fresh context until the corpus is complete.",
|
|
93
|
+
"prompt": "Process exactly ONE bounded batch this activation; do not try to load the whole PR into context.\n\n1. Call `list_artifacts({ path: \"{{corpusScope}}/files\", recursive: true })`. Read `pr-review-coverage.json` if it exists; otherwise start `{ \"pullRequest\": {{number}}, \"reviewedFiles\": [], \"reviewedRecords\": [] }`.\n2. Choose the next at-most-25 artifact record paths not present in `reviewedRecords`. Read every selected record with `read_artifact`; each carries one complete changed-file patch and authoritative `path` frontmatter. Binary/no-patch records still count, but note that limitation.\n3. Review this batch for correctness, security, data loss, error handling, concurrency, compatibility, tests, and clarity, weighted by focus `{{focus}}` and intensity `{{intensity}}`. Append concise batch observations and candidate findings to `pr-review-observations.md`. Include exact `path:new-line` evidence from diff hunks.\n4. Before claiming that a referenced API/type/module does not exist, call `find_symbol`, `search_code`, or `grep_files` against the checkout. Treat successful CI/typecheck evidence from the Scope note as rebuttable evidence that typed APIs resolve; never allege a missing typed API without a failed symbol/search verification. Use `github_pr_file` or paginated `github_pr_diff({ path, offset })` only for targeted live confirmation when the corpus record is ambiguous.\n5. Write `pr-review-coverage.json` after the observations, adding every exact `path` you actually reviewed to `reviewedFiles` and every artifact record path you read to `reviewedRecords`. Preserve prior entries and use valid JSON. Then call `advance_task_step`.\n\nThe completion gate compares `reviewedFiles` with every per-file corpus record. If files remain, rejection is expected: it names missing paths and reactivates this step in a fresh session. Continue with the next batch. Never claim complete coverage until the gate approves.",
|
|
94
|
+
"suggestedRole": "reviewer",
|
|
95
|
+
"gate": {
|
|
96
|
+
"at": "completion",
|
|
97
|
+
"checks": [
|
|
98
|
+
{
|
|
99
|
+
"kind": "corpusCoverage",
|
|
100
|
+
"file": "pr-review-coverage.json",
|
|
101
|
+
"corpusDir": "{{corpusScope}}"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"onReject": "scan",
|
|
105
|
+
"maxAttempts": 6
|
|
106
|
+
},
|
|
107
|
+
"next": "report"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "report",
|
|
111
|
+
"name": "Synthesize the review",
|
|
112
|
+
"description": "Synthesize the complete batch ledger into a cited report, re-verifying cross-file claims and keeping CI status distinct from code-review judgment.",
|
|
113
|
+
"prompt": "The coverage gate has proved that every changed path in PR #{{number}} was reviewed. Read the Scope note, `pr-review-coverage.json`, and `pr-review-observations.md`. Re-check every critical or major candidate against the relevant workspace source with `find_symbol`, `search_code`, `grep_files`, `read_file`, or `read_files`; call `github_check_status` again if the earlier status was pending. Drop any candidate that is not supported. Do not repeat an existing PR comment unless it still needs action and you explicitly say it was already raised.\n\nCite every finding as `path:line` using a changed path and a new-side diff line. Any critical or major finding requires `request-changes`; otherwise use `approve`. CI success is evidence that the checked revision compiled/tested as configured, but it does not erase logic findings. CI unknown/pending is not itself a code defect.\n\nWrite `pr-review.md` in ONE `write_file` call using exactly this skeleton:\n\n```\n# Pull Request Review — PR #{{number}}: <title>\n\n## Summary\n<2–6 sentences: what changes, overall risk, existing-comment coverage, and CI/check status. Say \"No findings.\" when there are none.>\n\nCoverage: <reviewed count>/<changed-file count> changed files across <batch count> batches.\n\n## Findings\n| # | Severity | File | Line | Finding | Recommendation |\n|---|----------|------|------|---------|----------------|\n<one row per finding; severities: critical, major, minor, nit. Keep the header when there are no findings.>\n\n## Verdict\nVerdict: approve\n<or> Verdict: request-changes\n<one sentence of rationale>\n```\n\nDo not modify source and do not call `github_pr_comment`; the report is local. If the gate rejects, repair the named gap and rewrite the whole report. Then call `advance_task_step`.",
|
|
114
|
+
"suggestedRole": "reviewer",
|
|
115
|
+
"advanceWhen": {
|
|
116
|
+
"file": "pr-review.md",
|
|
117
|
+
"minBytes": 500
|
|
118
|
+
},
|
|
119
|
+
"gate": {
|
|
120
|
+
"at": "completion",
|
|
121
|
+
"checks": [
|
|
122
|
+
{
|
|
123
|
+
"kind": "minBytes",
|
|
124
|
+
"file": "pr-review.md",
|
|
125
|
+
"bytes": 500
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"kind": "contains",
|
|
129
|
+
"file": "pr-review.md",
|
|
130
|
+
"pattern": "#\\s+Pull Request Review\\s+[—-]\\s+PR\\s+#{{number}}",
|
|
131
|
+
"label": "PR-numbered title"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"kind": "contains",
|
|
135
|
+
"file": "pr-review.md",
|
|
136
|
+
"pattern": "Coverage:\\s*\\d+\\s*/\\s*\\d+\\s+changed files",
|
|
137
|
+
"label": "coverage summary"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"kind": "contains",
|
|
141
|
+
"file": "pr-review.md",
|
|
142
|
+
"pattern": "##\\s+Summary[\\s\\S]*##\\s+Findings[\\s\\S]*##\\s+Verdict",
|
|
143
|
+
"label": "required sections"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"kind": "contains",
|
|
147
|
+
"file": "pr-review.md",
|
|
148
|
+
"pattern": "Verdict:\\s*(approve|request-changes)",
|
|
149
|
+
"label": "verdict line"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"kind": "tableShape",
|
|
153
|
+
"file": "pr-review.md",
|
|
154
|
+
"requiredColumns": [
|
|
155
|
+
"Severity",
|
|
156
|
+
"File",
|
|
157
|
+
"Line",
|
|
158
|
+
"Finding",
|
|
159
|
+
"Recommendation"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"onReject": "report",
|
|
164
|
+
"maxAttempts": 4
|
|
165
|
+
},
|
|
166
|
+
"next": "done"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "done",
|
|
170
|
+
"name": "Deliver the verdict",
|
|
171
|
+
"description": "The complete-coverage report passed its gates. Summarize the verdict and point the user to the local evidence files.",
|
|
172
|
+
"prompt": "Read `pr-review.md` and `pr-review-coverage.json`, then write one final task note with `write_task_note`: `PR #{{number}} — Verdict: <approve|request-changes> — N findings (a critical, b major, c minor, d nit) — coverage X/X` plus a one-paragraph summary. Tell the user the full local review is at `pr-review.md`, the coverage ledger is at `pr-review-coverage.json`, and nothing was posted to GitHub. Then call `advance_task_step` to complete the task.",
|
|
173
|
+
"suggestedRole": "reviewer",
|
|
174
|
+
"terminal": true
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"version": "1.4.0",
|
|
178
|
+
"releasedAt": "2026-08-13T00:00:00Z"
|
|
179
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"title": "Complete-corpus pull request review",
|
|
4
|
+
"objective": "Verify that Pull Request Review accounts for every changed path in a chunk-readable PR corpus, verifies an API use against a late definition, finds a late-file defect, reports CI evidence separately, and writes a cited local verdict without modifying source or posting to GitHub.",
|
|
5
|
+
"tags": [
|
|
6
|
+
"external",
|
|
7
|
+
"pull-request",
|
|
8
|
+
"large-corpus",
|
|
9
|
+
"coverage"
|
|
10
|
+
],
|
|
11
|
+
"prompt": "Review the deterministic large pull-request corpus completely. Work in bounded batches, maintain pr-review-coverage.json, verify the early API call against its late definition, find the late-file authorization defect, and write pr-review.md. Do not modify source or post a GitHub comment.",
|
|
12
|
+
"setup": {
|
|
13
|
+
"projectName": "Large PR Review Eval",
|
|
14
|
+
"about": "A deterministic PR-review fixture. The registered hand-authored scenario materializes more than 100 changed-file records and more than 80 KB of patch text in the artifacts corpus.",
|
|
15
|
+
"missionObjectives": "Account for every changed path, avoid a false missing-API finding, catch the late authorization defect, and deliver a local request-changes report with exact path:line evidence.",
|
|
16
|
+
"files": [
|
|
17
|
+
{
|
|
18
|
+
"path": "src/api/use-assured-api.ts",
|
|
19
|
+
"content": "import { assuredApi } from './assured-api.js';\n\nexport function loadWidget(id: string): string {\n return assuredApi(id);\n}\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "src/api/assured-api.ts",
|
|
23
|
+
"content": "export function assuredApi(id: string): string {\n return `widget:${id}`;\n}\n"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "src/security/late-authorization.ts",
|
|
27
|
+
"content": "export function canDeleteProject(userId: string, ownerId: string): boolean {\n if (!userId) return false;\n // Regression: any authenticated user can delete another owner's project.\n return true;\n}\n"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"worker": {
|
|
31
|
+
"name": "Rina",
|
|
32
|
+
"role": "Reviewer",
|
|
33
|
+
"description": "A careful code reviewer who works through large change sets in bounded batches and verifies cross-file claims."
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"mocks": [],
|
|
37
|
+
"success": {
|
|
38
|
+
"summary": "The report covers all 120 changed files, recognizes that assuredApi exists, cites the late authorization defect, requests changes, and leaves the seeded source unchanged.",
|
|
39
|
+
"deliverables": [
|
|
40
|
+
{
|
|
41
|
+
"path": "pr-review.md",
|
|
42
|
+
"kind": "markdown-report",
|
|
43
|
+
"minBytes": 500,
|
|
44
|
+
"checks": [
|
|
45
|
+
{
|
|
46
|
+
"kind": "contains",
|
|
47
|
+
"file": "pr-review.md",
|
|
48
|
+
"pattern": "Coverage:\\s*120\\s*/\\s*120\\s+changed files",
|
|
49
|
+
"flags": "i"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"kind": "contains",
|
|
53
|
+
"file": "pr-review.md",
|
|
54
|
+
"pattern": "src/security/late-authorization\\.ts(?::|\\s*\\|\\s*)4",
|
|
55
|
+
"flags": "i"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"kind": "contains",
|
|
59
|
+
"file": "pr-review.md",
|
|
60
|
+
"pattern": "Verdict:\\s*request-changes",
|
|
61
|
+
"flags": "i"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"kind": "notContains",
|
|
65
|
+
"file": "pr-review.md",
|
|
66
|
+
"pattern": "assuredApi.{0,80}(missing|does not exist|undefined)|(?:missing|does not exist|undefined).{0,80}assuredApi",
|
|
67
|
+
"flags": "is"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "pr-review-coverage.json",
|
|
73
|
+
"kind": "json",
|
|
74
|
+
"minBytes": 500
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"unchangedFixtures": [
|
|
78
|
+
"src/api/use-assured-api.ts",
|
|
79
|
+
"src/api/assured-api.ts",
|
|
80
|
+
"src/security/late-authorization.ts"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"rubric": {
|
|
84
|
+
"artifact": {
|
|
85
|
+
"path": "pr-review.md",
|
|
86
|
+
"kind": "markdown"
|
|
87
|
+
},
|
|
88
|
+
"axes": [
|
|
89
|
+
{
|
|
90
|
+
"name": "coverage",
|
|
91
|
+
"description": "The review demonstrates complete 120-file coverage rather than reasoning from an early prefix."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "cross-file-verification",
|
|
95
|
+
"description": "The report does not allege that assuredApi is missing because its definition exists later in the corpus and checkout."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "late-defect",
|
|
99
|
+
"description": "The report finds and cites the authorization defect deliberately placed in the final changed file."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "side-effects",
|
|
103
|
+
"description": "The review remains local and source fixtures stay unchanged."
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"qualityFocus": [
|
|
108
|
+
"complete large-PR coverage",
|
|
109
|
+
"cross-file API verification",
|
|
110
|
+
"late-file defect detection",
|
|
111
|
+
"safe local-only delivery"
|
|
112
|
+
],
|
|
113
|
+
"extensions": {
|
|
114
|
+
"legacySimulators": [
|
|
115
|
+
{
|
|
116
|
+
"id": "large-pr-artifact-corpus",
|
|
117
|
+
"kind": "data-source",
|
|
118
|
+
"status": "implemented",
|
|
119
|
+
"description": "The hand-authored eval scenario seeds 120 per-file PR records totaling more than 80 KB, with an API use early, its valid definition late, and a real authorization defect in the final record."
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
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
|
+
],
|
|
18
|
+
"command": "root-cause-investigation",
|
|
19
|
+
"steps": [
|
|
20
|
+
{
|
|
21
|
+
"id": "reproduce",
|
|
22
|
+
"name": "Reproduce and bound the failure",
|
|
23
|
+
"description": "Establish a stable failing case, expected behavior, environment, and blast radius.",
|
|
24
|
+
"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. Do not merely describe what the file would contain. Re-read it before finishing this phase and repair any incomplete sections.",
|
|
25
|
+
"suggestedRole": "debugging engineer",
|
|
26
|
+
"advanceWhen": {
|
|
27
|
+
"file": "investigations/reproduction.md",
|
|
28
|
+
"minBytes": 700,
|
|
29
|
+
"sniff": "nonempty",
|
|
30
|
+
"requireChange": true,
|
|
31
|
+
"goto": "diagnose"
|
|
32
|
+
},
|
|
33
|
+
"gate": {
|
|
34
|
+
"at": "completion",
|
|
35
|
+
"checks": [
|
|
36
|
+
{
|
|
37
|
+
"kind": "minBytes",
|
|
38
|
+
"file": "investigations/reproduction.md",
|
|
39
|
+
"bytes": 700
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"kind": "sniff",
|
|
43
|
+
"file": "investigations/reproduction.md",
|
|
44
|
+
"sniff": "nonempty"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"kind": "contains",
|
|
48
|
+
"file": "investigations/reproduction.md",
|
|
49
|
+
"pattern": "^##\\s+Symptom",
|
|
50
|
+
"flags": "im",
|
|
51
|
+
"label": "Symptom section"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"kind": "contains",
|
|
55
|
+
"file": "investigations/reproduction.md",
|
|
56
|
+
"pattern": "^##\\s+Minimal reproduction",
|
|
57
|
+
"flags": "im",
|
|
58
|
+
"label": "Minimal reproduction section"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"kind": "contains",
|
|
62
|
+
"file": "investigations/reproduction.md",
|
|
63
|
+
"pattern": "^##\\s+Expected",
|
|
64
|
+
"flags": "im",
|
|
65
|
+
"label": "Expected behavior section"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"kind": "contains",
|
|
69
|
+
"file": "investigations/reproduction.md",
|
|
70
|
+
"pattern": "^##\\s+Actual",
|
|
71
|
+
"flags": "im",
|
|
72
|
+
"label": "Actual behavior section"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"kind": "contains",
|
|
76
|
+
"file": "investigations/reproduction.md",
|
|
77
|
+
"pattern": "^##\\s+Evidence",
|
|
78
|
+
"flags": "im",
|
|
79
|
+
"label": "Evidence section"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"onReject": "reproduce",
|
|
83
|
+
"maxAttempts": 3
|
|
84
|
+
},
|
|
85
|
+
"next": "diagnose"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "diagnose",
|
|
89
|
+
"name": "Prove the root cause",
|
|
90
|
+
"description": "Test competing hypotheses and identify the causal mechanism before modifying code.",
|
|
91
|
+
"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. Do not merely describe what the file would contain. Re-read it before finishing this phase and repair any incomplete sections.",
|
|
92
|
+
"suggestedRole": "root-cause analyst",
|
|
93
|
+
"advanceWhen": {
|
|
94
|
+
"file": "investigations/root-cause-analysis.md",
|
|
95
|
+
"minBytes": 1000,
|
|
96
|
+
"sniff": "nonempty",
|
|
97
|
+
"requireChange": true,
|
|
98
|
+
"goto": "fix-and-verify"
|
|
99
|
+
},
|
|
100
|
+
"gate": {
|
|
101
|
+
"at": "completion",
|
|
102
|
+
"checks": [
|
|
103
|
+
{
|
|
104
|
+
"kind": "minBytes",
|
|
105
|
+
"file": "investigations/root-cause-analysis.md",
|
|
106
|
+
"bytes": 1000
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"kind": "sniff",
|
|
110
|
+
"file": "investigations/root-cause-analysis.md",
|
|
111
|
+
"sniff": "nonempty"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"kind": "contains",
|
|
115
|
+
"file": "investigations/root-cause-analysis.md",
|
|
116
|
+
"pattern": "^##\\s+Hypotheses",
|
|
117
|
+
"flags": "im",
|
|
118
|
+
"label": "Hypotheses section"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"kind": "contains",
|
|
122
|
+
"file": "investigations/root-cause-analysis.md",
|
|
123
|
+
"pattern": "^##\\s+Experiments",
|
|
124
|
+
"flags": "im",
|
|
125
|
+
"label": "Experiments section"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"kind": "contains",
|
|
129
|
+
"file": "investigations/root-cause-analysis.md",
|
|
130
|
+
"pattern": "^##\\s+Root cause",
|
|
131
|
+
"flags": "im",
|
|
132
|
+
"label": "Root cause section"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"kind": "contains",
|
|
136
|
+
"file": "investigations/root-cause-analysis.md",
|
|
137
|
+
"pattern": "^##\\s+Causal chain",
|
|
138
|
+
"flags": "im",
|
|
139
|
+
"label": "Causal chain section"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"kind": "contains",
|
|
143
|
+
"file": "investigations/root-cause-analysis.md",
|
|
144
|
+
"pattern": "^##\\s+Blast radius",
|
|
145
|
+
"flags": "im",
|
|
146
|
+
"label": "Blast radius section"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"onReject": "diagnose",
|
|
150
|
+
"maxAttempts": 3
|
|
151
|
+
},
|
|
152
|
+
"next": "fix-and-verify"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "fix-and-verify",
|
|
156
|
+
"name": "Implement the smallest fix and verify it",
|
|
157
|
+
"description": "Correct the proven mechanism and demonstrate both regression coverage and non-regression.",
|
|
158
|
+
"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 `reports/root-cause-investigation.md` in the workspace. Do not merely describe what the file would contain. Re-read it before finishing this phase and repair any incomplete sections.",
|
|
159
|
+
"suggestedRole": "software engineer",
|
|
160
|
+
"advanceWhen": {
|
|
161
|
+
"file": "reports/root-cause-investigation.md",
|
|
162
|
+
"minBytes": 1200,
|
|
163
|
+
"sniff": "nonempty",
|
|
164
|
+
"requireChange": true,
|
|
165
|
+
"goto": "evaluate"
|
|
166
|
+
},
|
|
167
|
+
"gate": {
|
|
168
|
+
"at": "completion",
|
|
169
|
+
"checks": [
|
|
170
|
+
{
|
|
171
|
+
"kind": "minBytes",
|
|
172
|
+
"file": "reports/root-cause-investigation.md",
|
|
173
|
+
"bytes": 1200
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"kind": "sniff",
|
|
177
|
+
"file": "reports/root-cause-investigation.md",
|
|
178
|
+
"sniff": "nonempty"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"kind": "contains",
|
|
182
|
+
"file": "reports/root-cause-investigation.md",
|
|
183
|
+
"pattern": "^##\\s+Root cause",
|
|
184
|
+
"flags": "im",
|
|
185
|
+
"label": "Root cause section"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"kind": "contains",
|
|
189
|
+
"file": "reports/root-cause-investigation.md",
|
|
190
|
+
"pattern": "^##\\s+Fix",
|
|
191
|
+
"flags": "im",
|
|
192
|
+
"label": "Fix section"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"kind": "contains",
|
|
196
|
+
"file": "reports/root-cause-investigation.md",
|
|
197
|
+
"pattern": "^##\\s+Changed files",
|
|
198
|
+
"flags": "im",
|
|
199
|
+
"label": "Changed files section"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"kind": "contains",
|
|
203
|
+
"file": "reports/root-cause-investigation.md",
|
|
204
|
+
"pattern": "^##\\s+Regression coverage",
|
|
205
|
+
"flags": "im",
|
|
206
|
+
"label": "Regression coverage section"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"kind": "contains",
|
|
210
|
+
"file": "reports/root-cause-investigation.md",
|
|
211
|
+
"pattern": "^##\\s+Verification",
|
|
212
|
+
"flags": "im",
|
|
213
|
+
"label": "Verification section"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"kind": "contains",
|
|
217
|
+
"file": "reports/root-cause-investigation.md",
|
|
218
|
+
"pattern": "^##\\s+Rollback",
|
|
219
|
+
"flags": "im",
|
|
220
|
+
"label": "Rollback section"
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
"onReject": "fix-and-verify",
|
|
224
|
+
"maxAttempts": 3
|
|
225
|
+
},
|
|
226
|
+
"next": "evaluate"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"id": "evaluate",
|
|
230
|
+
"name": "Evaluate the deliverable",
|
|
231
|
+
"description": "Independently grade the observable deliverable and route it to finish, repair, or user escalation.",
|
|
232
|
+
"prompt": "Review `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\nWrite an evidence-backed review to `reviews/root-cause-investigation-review.md`. 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.",
|
|
233
|
+
"suggestedRole": "debugging reviewer",
|
|
234
|
+
"gate": {
|
|
235
|
+
"at": "completion",
|
|
236
|
+
"checks": [
|
|
237
|
+
{
|
|
238
|
+
"kind": "minBytes",
|
|
239
|
+
"file": "reviews/root-cause-investigation-review.md",
|
|
240
|
+
"bytes": 400
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"kind": "contains",
|
|
244
|
+
"file": "reviews/root-cause-investigation-review.md",
|
|
245
|
+
"pattern": "Verdict:\\s*(?:PASS|REVISE)",
|
|
246
|
+
"flags": "i",
|
|
247
|
+
"label": "explicit PASS or REVISE verdict"
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"onReject": "evaluate",
|
|
251
|
+
"maxAttempts": 3
|
|
252
|
+
},
|
|
253
|
+
"next": "repair"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "repair",
|
|
257
|
+
"name": "Repair the deliverable",
|
|
258
|
+
"description": "Fix only the concrete gaps from the latest independent review.",
|
|
259
|
+
"prompt": "Read `reviews/root-cause-investigation-review.md` and repair every failed criterion in `reports/root-cause-investigation.md`, `investigations/reproduction.md`, `investigations/root-cause-analysis.md`. Make the changes in the actual workspace files, not just in task notes or a reply. Preserve evidence that already passed. Re-run or re-check anything the reviewer found unproven. Ensure `reports/root-cause-investigation.md` is genuinely updated this turn so the repair is observable, then hand it back for independent evaluation.",
|
|
260
|
+
"suggestedRole": "software engineer",
|
|
261
|
+
"advanceWhen": {
|
|
262
|
+
"file": "reports/root-cause-investigation.md",
|
|
263
|
+
"minBytes": 1200,
|
|
264
|
+
"sniff": "nonempty",
|
|
265
|
+
"requireChange": true,
|
|
266
|
+
"goto": "evaluate"
|
|
267
|
+
},
|
|
268
|
+
"gate": {
|
|
269
|
+
"at": "completion",
|
|
270
|
+
"checks": [
|
|
271
|
+
{
|
|
272
|
+
"kind": "minBytes",
|
|
273
|
+
"file": "reports/root-cause-investigation.md",
|
|
274
|
+
"bytes": 1200
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"kind": "sniff",
|
|
278
|
+
"file": "reports/root-cause-investigation.md",
|
|
279
|
+
"sniff": "nonempty"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"kind": "contains",
|
|
283
|
+
"file": "reports/root-cause-investigation.md",
|
|
284
|
+
"pattern": "^##\\s+Root cause",
|
|
285
|
+
"flags": "im",
|
|
286
|
+
"label": "Root cause section"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"kind": "contains",
|
|
290
|
+
"file": "reports/root-cause-investigation.md",
|
|
291
|
+
"pattern": "^##\\s+Fix",
|
|
292
|
+
"flags": "im",
|
|
293
|
+
"label": "Fix section"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"kind": "contains",
|
|
297
|
+
"file": "reports/root-cause-investigation.md",
|
|
298
|
+
"pattern": "^##\\s+Changed files",
|
|
299
|
+
"flags": "im",
|
|
300
|
+
"label": "Changed files section"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"kind": "contains",
|
|
304
|
+
"file": "reports/root-cause-investigation.md",
|
|
305
|
+
"pattern": "^##\\s+Regression coverage",
|
|
306
|
+
"flags": "im",
|
|
307
|
+
"label": "Regression coverage section"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"kind": "contains",
|
|
311
|
+
"file": "reports/root-cause-investigation.md",
|
|
312
|
+
"pattern": "^##\\s+Verification",
|
|
313
|
+
"flags": "im",
|
|
314
|
+
"label": "Verification section"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"kind": "contains",
|
|
318
|
+
"file": "reports/root-cause-investigation.md",
|
|
319
|
+
"pattern": "^##\\s+Rollback",
|
|
320
|
+
"flags": "im",
|
|
321
|
+
"label": "Rollback section"
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"onReject": "repair",
|
|
325
|
+
"maxAttempts": 3
|
|
326
|
+
},
|
|
327
|
+
"next": "evaluate"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"id": "finish",
|
|
331
|
+
"name": "Finish",
|
|
332
|
+
"description": "All deterministic and reviewer criteria passed.",
|
|
333
|
+
"prompt": "The independent review passed. Read `reviews/root-cause-investigation-review.md`, then use `write_task_note` to record a concise DONE summary with the final deliverable paths (`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.",
|
|
334
|
+
"suggestedRole": "project lead",
|
|
335
|
+
"terminal": true
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"id": "needs-user",
|
|
339
|
+
"name": "Escalate unresolved concerns",
|
|
340
|
+
"description": "The bounded repair loop ended without a defensible pass.",
|
|
341
|
+
"prompt": "The deliverable did not pass after 3 review rounds. Do not claim success. Read `reviews/root-cause-investigation-review.md`, 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.",
|
|
342
|
+
"suggestedRole": "project lead",
|
|
343
|
+
"terminal": true
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
"version": "2.0.1",
|
|
347
|
+
"releasedAt": "2026-08-13T00:00:00Z"
|
|
348
|
+
}
|