@punks/cli 2.0.0 → 2.0.1
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/dist/data/catalog/packs.ts +3 -2
- package/dist/data/catalog/skills.ts +16 -0
- package/dist/data/catalog/tools.ts +6 -0
- package/dist/index.js +28 -4
- package/dist/skills/phases/bug-discovery-phase/REFERENCE.md +124 -0
- package/dist/skills/phases/bug-discovery-phase/SKILL.md +76 -0
- package/dist/skills/phases/bug-resolution-phase/REFERENCE.md +154 -0
- package/dist/skills/phases/bug-resolution-phase/SKILL.md +62 -0
- package/package.json +1 -1
|
@@ -55,8 +55,9 @@ export const packCatalog = [
|
|
|
55
55
|
id: "debug",
|
|
56
56
|
category: "default",
|
|
57
57
|
triggerPackages: [],
|
|
58
|
-
description:
|
|
59
|
-
|
|
58
|
+
description:
|
|
59
|
+
"Default debug pack: runtime debugging, ClawPatch bug discovery/resolution, and debug-agent workflow.",
|
|
60
|
+
skills: ["debugging-phase", "bug-discovery-phase", "bug-resolution-phase", "debug-agent"],
|
|
60
61
|
lintAssets: [],
|
|
61
62
|
hooks: [],
|
|
62
63
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "workspace-prompt-spec"],
|
|
@@ -100,6 +100,22 @@ export const skillCatalog = [
|
|
|
100
100
|
framework: null,
|
|
101
101
|
requiresTools: ["debug-agent"],
|
|
102
102
|
},
|
|
103
|
+
{
|
|
104
|
+
id: "bug-discovery-phase",
|
|
105
|
+
sourceDirectory: "skills/phases/bug-discovery-phase",
|
|
106
|
+
tier: "agnostic",
|
|
107
|
+
language: null,
|
|
108
|
+
framework: null,
|
|
109
|
+
requiresTools: ["clawpatch"],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "bug-resolution-phase",
|
|
113
|
+
sourceDirectory: "skills/phases/bug-resolution-phase",
|
|
114
|
+
tier: "agnostic",
|
|
115
|
+
language: null,
|
|
116
|
+
framework: null,
|
|
117
|
+
requiresTools: ["clawpatch"],
|
|
118
|
+
},
|
|
103
119
|
{
|
|
104
120
|
id: "docs-ingest-phase",
|
|
105
121
|
sourceDirectory: "skills/phases/docs-ingest-phase",
|
package/dist/index.js
CHANGED
|
@@ -52503,7 +52503,7 @@ var submitHarnessReport = (options9) => exports_Effect.gen(function* () {
|
|
|
52503
52503
|
|
|
52504
52504
|
// package.json
|
|
52505
52505
|
var name = "@punks/cli";
|
|
52506
|
-
var version = "2.0.
|
|
52506
|
+
var version = "2.0.1";
|
|
52507
52507
|
// src/telemetry/product.ts
|
|
52508
52508
|
var git = (cwd, args2) => {
|
|
52509
52509
|
try {
|
|
@@ -53421,8 +53421,8 @@ var packCatalog = [
|
|
|
53421
53421
|
id: "debug",
|
|
53422
53422
|
category: "default",
|
|
53423
53423
|
triggerPackages: [],
|
|
53424
|
-
description: "Default debug pack: debugging
|
|
53425
|
-
skills: ["debugging-phase", "debug-agent"],
|
|
53424
|
+
description: "Default debug pack: runtime debugging, ClawPatch bug discovery/resolution, and debug-agent workflow.",
|
|
53425
|
+
skills: ["debugging-phase", "bug-discovery-phase", "bug-resolution-phase", "debug-agent"],
|
|
53426
53426
|
lintAssets: [],
|
|
53427
53427
|
hooks: [],
|
|
53428
53428
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "workspace-prompt-spec"],
|
|
@@ -53769,6 +53769,22 @@ var skillCatalog = [
|
|
|
53769
53769
|
framework: null,
|
|
53770
53770
|
requiresTools: ["debug-agent"]
|
|
53771
53771
|
},
|
|
53772
|
+
{
|
|
53773
|
+
id: "bug-discovery-phase",
|
|
53774
|
+
sourceDirectory: "skills/phases/bug-discovery-phase",
|
|
53775
|
+
tier: "agnostic",
|
|
53776
|
+
language: null,
|
|
53777
|
+
framework: null,
|
|
53778
|
+
requiresTools: ["clawpatch"]
|
|
53779
|
+
},
|
|
53780
|
+
{
|
|
53781
|
+
id: "bug-resolution-phase",
|
|
53782
|
+
sourceDirectory: "skills/phases/bug-resolution-phase",
|
|
53783
|
+
tier: "agnostic",
|
|
53784
|
+
language: null,
|
|
53785
|
+
framework: null,
|
|
53786
|
+
requiresTools: ["clawpatch"]
|
|
53787
|
+
},
|
|
53772
53788
|
{
|
|
53773
53789
|
id: "docs-ingest-phase",
|
|
53774
53790
|
sourceDirectory: "skills/phases/docs-ingest-phase",
|
|
@@ -54057,6 +54073,12 @@ var toolCatalog = [
|
|
|
54057
54073
|
requiredBins: ["node"],
|
|
54058
54074
|
ensureCommands: []
|
|
54059
54075
|
},
|
|
54076
|
+
{
|
|
54077
|
+
id: "clawpatch",
|
|
54078
|
+
packageName: "clawpatch",
|
|
54079
|
+
requiredBins: ["node"],
|
|
54080
|
+
ensureCommands: []
|
|
54081
|
+
},
|
|
54060
54082
|
{
|
|
54061
54083
|
id: "opensrc",
|
|
54062
54084
|
packageName: "opensrc",
|
|
@@ -55322,6 +55344,8 @@ import path10 from "path";
|
|
|
55322
55344
|
|
|
55323
55345
|
// src/content/prompts.ts
|
|
55324
55346
|
var phaseSkillIds = [
|
|
55347
|
+
"bug-discovery-phase",
|
|
55348
|
+
"bug-resolution-phase",
|
|
55325
55349
|
"debugging-phase",
|
|
55326
55350
|
"delivery-phase",
|
|
55327
55351
|
"docs-ingest-phase",
|
|
@@ -57007,7 +57031,7 @@ When processing source material into routed domain knowledge:
|
|
|
57007
57031
|
"build": "fumadocs-mdx && next build",
|
|
57008
57032
|
"check": "oxlint . && oxfmt --check .",
|
|
57009
57033
|
"check-types": "fumadocs-mdx && next typegen && tsc --noEmit",
|
|
57010
|
-
"dev": "next dev --
|
|
57034
|
+
"dev": "next dev --turbopack --port=4000",
|
|
57011
57035
|
"postinstall": "fumadocs-mdx",
|
|
57012
57036
|
"start": "next start"
|
|
57013
57037
|
},
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Bug Discovery Phase Reference
|
|
2
|
+
|
|
3
|
+
## Preflight Record
|
|
4
|
+
|
|
5
|
+
Before running ClawPatch, write down the run contract in the conversation, goal
|
|
6
|
+
handoff, or local run notes:
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
repo root: <absolute path>
|
|
10
|
+
scope: <whole repo | path | feature/project selector>
|
|
11
|
+
provider: <codex|acpx|grok|opencode|pi|mock|mock-fail>
|
|
12
|
+
model: <model name or unset>
|
|
13
|
+
limit: <number or unset>
|
|
14
|
+
jobs: <number or unset>
|
|
15
|
+
state dir: <repo>/.clawpatch/
|
|
16
|
+
report path: <repo>/.clawpatch/reports/<name>.md or .json
|
|
17
|
+
dirty posture: include dirty changes? <yes|no>
|
|
18
|
+
output format: plain|json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This record is part of the phase contract. Do it before launching any long AFK
|
|
22
|
+
review so the user can understand cost, scope, state, and replay boundaries.
|
|
23
|
+
|
|
24
|
+
## Provider Warnings
|
|
25
|
+
|
|
26
|
+
Warn, but do not block, when any of these are true:
|
|
27
|
+
|
|
28
|
+
- provider is `pi`
|
|
29
|
+
- provider is `acpx` and the model or ACP config resolves to Claude
|
|
30
|
+
- provider, model, config, or environment mentions `claude`, `anthropic`, or an
|
|
31
|
+
Anthropic model family such as `claude-3`, `claude-3.5`, `claude-3-7`,
|
|
32
|
+
`claude-sonnet`, `claude-opus`, or `claude-haiku`
|
|
33
|
+
- `ANTHROPIC_API_KEY` is set
|
|
34
|
+
|
|
35
|
+
Use wording like:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Provider warning: this run appears to use Claude/Anthropic or another metered
|
|
39
|
+
route. That is allowed, but confirm the provider/model/cost boundary before
|
|
40
|
+
leaving it AFK. I will make the provider explicit in every generated command.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Do not imply Anthropic routes are banned. The operator chooses the route.
|
|
44
|
+
|
|
45
|
+
## Command Rules
|
|
46
|
+
|
|
47
|
+
Use explicit provider flags in generated ClawPatch commands. Add `--model` when
|
|
48
|
+
the model is known. Keep `--root`, `--state-dir`, `--limit`, `--jobs`, and
|
|
49
|
+
`--output` visible when they matter.
|
|
50
|
+
|
|
51
|
+
Prefer repo-local state:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
clawpatch doctor --root "$REPO" --state-dir "$REPO/.clawpatch" --provider "$PROVIDER" --model "$MODEL"
|
|
55
|
+
clawpatch status --root "$REPO" --state-dir "$REPO/.clawpatch" --plain
|
|
56
|
+
clawpatch init --root "$REPO" --state-dir "$REPO/.clawpatch"
|
|
57
|
+
clawpatch map --root "$REPO" --state-dir "$REPO/.clawpatch" --provider "$PROVIDER" --model "$MODEL"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For discovery, use `review` for normal AFK review and `ci` when the user wants
|
|
61
|
+
CI-shaped discovery:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
clawpatch review --root "$REPO" --state-dir "$REPO/.clawpatch" --provider "$PROVIDER" --model "$MODEL" --limit "$LIMIT" --jobs "$JOBS"
|
|
65
|
+
clawpatch ci --root "$REPO" --state-dir "$REPO/.clawpatch" --provider "$PROVIDER" --model "$MODEL" --limit "$LIMIT" --jobs "$JOBS" --output "$REPORT"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use `--include-dirty` only when the user wants current uncommitted work included
|
|
69
|
+
in discovery. If omitted, say dirty work was excluded or left to ClawPatch
|
|
70
|
+
defaults.
|
|
71
|
+
|
|
72
|
+
For report and ledger inspection:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
clawpatch report --root "$REPO" --state-dir "$REPO/.clawpatch" --output "$REPORT" --plain
|
|
76
|
+
clawpatch report --root "$REPO" --state-dir "$REPO/.clawpatch" --output "$REPORT_JSON" --json
|
|
77
|
+
clawpatch next --root "$REPO" --state-dir "$REPO/.clawpatch" --plain
|
|
78
|
+
clawpatch show --root "$REPO" --state-dir "$REPO/.clawpatch" --finding "$FINDING_ID" --plain
|
|
79
|
+
clawpatch status --root "$REPO" --state-dir "$REPO/.clawpatch" --plain
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Triage commands are allowed for discovery classification when no source mutation
|
|
83
|
+
is performed:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
clawpatch triage --root "$REPO" --state-dir "$REPO/.clawpatch" --finding "$FINDING_ID" --status "$STATUS"
|
|
87
|
+
clawpatch revalidate --root "$REPO" --state-dir "$REPO/.clawpatch" --provider "$PROVIDER" --model "$MODEL" --finding "$FINDING_ID" --plain
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Discovery classification should reflect what was learned from static review:
|
|
91
|
+
branch relevance, runtime-debugging need, false-positive candidacy, resolution
|
|
92
|
+
candidacy, deferral, or blockers. Use ClawPatch statuses only where they match
|
|
93
|
+
the tool's supported values. Do not claim runtime truth from ClawPatch alone.
|
|
94
|
+
|
|
95
|
+
## No-Mutation Boundary
|
|
96
|
+
|
|
97
|
+
Never run these by default in `bug-discovery-phase`:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
clawpatch fix --finding "$FINDING_ID"
|
|
101
|
+
clawpatch open-pr --patch "$PATCH_ATTEMPT_ID"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If the user asks for fixing, stop discovery and enter `$bug-resolution-phase`.
|
|
105
|
+
If a finding needs runtime reproduction, enter `$debugging-phase`. If a selected
|
|
106
|
+
finding becomes tech debt, route repo docs through `$docs-ingest-phase`; broad
|
|
107
|
+
discovery itself does not create tech-debt docs.
|
|
108
|
+
|
|
109
|
+
## Output Checklist
|
|
110
|
+
|
|
111
|
+
The final report must include:
|
|
112
|
+
|
|
113
|
+
- report path, usually `.clawpatch/reports/<run>.md` or `.json`
|
|
114
|
+
- durable ledger/state path, usually `.clawpatch/`
|
|
115
|
+
- provider, model, scope, `--limit`, `--jobs`, report path, and dirty posture
|
|
116
|
+
- command list and whether each command completed
|
|
117
|
+
- relevant finding IDs, status, severity if available, and why they matter
|
|
118
|
+
- explicit statement: ClawPatch findings are static-review candidates, not
|
|
119
|
+
proven runtime root causes
|
|
120
|
+
- next recommended phase for each important finding:
|
|
121
|
+
`$bug-resolution-phase`, `$debugging-phase`, `$docs-ingest-phase`, or none
|
|
122
|
+
|
|
123
|
+
Keep the summary concise. Preserve report and state paths so later resolution
|
|
124
|
+
goals can resume from the durable ClawPatch ledger.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-discovery-phase
|
|
3
|
+
description: >-
|
|
4
|
+
Runs AFK ClawPatch bug discovery, reporting, and triage without source
|
|
5
|
+
mutation. Use when the user asks for ClawPatch discovery, broad bug discovery,
|
|
6
|
+
bug lifecycle triage, finding ledgers, AFK bug review, or durable bug reports.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Bug Discovery Phase
|
|
10
|
+
|
|
11
|
+
`bug-discovery-phase` wraps ClawPatch discovery. It produces review state,
|
|
12
|
+
reports, and triage notes; it does not prove runtime root causes and does not
|
|
13
|
+
patch code by default.
|
|
14
|
+
|
|
15
|
+
See [REFERENCE.md](REFERENCE.md) for command patterns, provider warning wording,
|
|
16
|
+
and the full output checklist.
|
|
17
|
+
|
|
18
|
+
## Contract
|
|
19
|
+
|
|
20
|
+
- **Role:** public AFK ClawPatch discovery/report/triage phase
|
|
21
|
+
- **Owns:** ClawPatch setup checks, discovery scope, report path, durable state,
|
|
22
|
+
finding IDs, and branch-relevant triage notes
|
|
23
|
+
- **Does not own:** runtime reproduction, root-cause proof, code fixes, PRs, or
|
|
24
|
+
repo tech-debt docs
|
|
25
|
+
- **Allowed commands:** `clawpatch init`, `map`, `review`, `ci`, `report`,
|
|
26
|
+
`show`, `next`, `triage`, `status`, `doctor`, `revalidate`
|
|
27
|
+
- **Blocked by default:** `clawpatch fix --finding`, `clawpatch open-pr`
|
|
28
|
+
|
|
29
|
+
## Use When
|
|
30
|
+
|
|
31
|
+
- The user asks for broad ClawPatch review, discovery, report, triage, or status.
|
|
32
|
+
- A goal needs AFK static bug-finding before humans choose findings to resolve.
|
|
33
|
+
- Existing `.clawpatch/` state needs inspection, report generation, or triage.
|
|
34
|
+
- The desired output is a durable finding ledger, not a patch.
|
|
35
|
+
|
|
36
|
+
## Do Not Use When
|
|
37
|
+
|
|
38
|
+
- There is one concrete runtime symptom; use `$debugging-phase`.
|
|
39
|
+
- The user asks to fix a selected ClawPatch finding; use `$bug-resolution-phase`.
|
|
40
|
+
- The user wants repo tech-debt docs; route that through `$docs-ingest-phase`
|
|
41
|
+
after a selected finding is classified.
|
|
42
|
+
- The target repo, provider, or scope cannot be identified.
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
1. **Bound the run.** Record repo root, scope, provider, model, `--limit`,
|
|
47
|
+
`--jobs`, state dir, report path, dirty-worktree posture, and requested output
|
|
48
|
+
format before running ClawPatch.
|
|
49
|
+
2. **Warn on cost-sensitive routes.** Warn, but do not ban, Claude, Anthropic,
|
|
50
|
+
`acpx` resolving to Claude, `pi`, Anthropic model names, or
|
|
51
|
+
`ANTHROPIC_API_KEY`.
|
|
52
|
+
3. **Make provider explicit.** Generated goals and commands must include the
|
|
53
|
+
selected provider. Include the model when known.
|
|
54
|
+
4. **Inspect readiness.** Prefer `clawpatch doctor`, `status`, and existing
|
|
55
|
+
`.clawpatch/` state before long runs.
|
|
56
|
+
5. **Discover.** Use read-oriented ClawPatch commands: usually `init`, `map`,
|
|
57
|
+
then `review` or `ci` with explicit provider, model, limit, jobs, state dir,
|
|
58
|
+
scope, and output.
|
|
59
|
+
6. **Report and triage.** Generate a report under `.clawpatch/reports/` unless
|
|
60
|
+
the user supplied another path. Use `show`, `next`, `triage`, `status`, or
|
|
61
|
+
`revalidate` only for inspection and classification.
|
|
62
|
+
7. **Stop before mutation.** Do not run `fix --finding` or `open-pr` unless the
|
|
63
|
+
user gives a new explicit resolution request.
|
|
64
|
+
|
|
65
|
+
## Output Contract
|
|
66
|
+
|
|
67
|
+
Return:
|
|
68
|
+
|
|
69
|
+
- repo root, scope, provider, model, `--limit`, `--jobs`
|
|
70
|
+
- report path and durable ClawPatch ledger/state path
|
|
71
|
+
- commands run and validation status
|
|
72
|
+
- relevant finding IDs, statuses, and branch relevance
|
|
73
|
+
- warning that findings are static-review candidates, not proven runtime root
|
|
74
|
+
causes
|
|
75
|
+
- next action: inspect selected finding, enter `$bug-resolution-phase`, enter
|
|
76
|
+
`$debugging-phase`, or stop
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Bug Resolution Phase Reference
|
|
2
|
+
|
|
3
|
+
## Operating Model
|
|
4
|
+
|
|
5
|
+
`bug-resolution-phase` starts after a human or upstream discovery step selects one ClawPatch finding. ClawPatch is the ledger and context source; it is not treated as proof of runtime behavior and is not the default patching engine.
|
|
6
|
+
|
|
7
|
+
Default to one finding. Accept a batch only when the user bounds it and the findings share at least one concrete constraint:
|
|
8
|
+
|
|
9
|
+
- same confirmed or suspected root cause
|
|
10
|
+
- same owned file set or package boundary
|
|
11
|
+
- same validation path or failing check
|
|
12
|
+
- same contract or test coverage gap
|
|
13
|
+
|
|
14
|
+
Do not turn a broad report into an automatic repair campaign. If the request is ambiguous, ask for the finding ID or batch boundary.
|
|
15
|
+
|
|
16
|
+
## Useful ClawPatch Commands
|
|
17
|
+
|
|
18
|
+
Use commands like these for context and state:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
clawpatch show --finding <id>
|
|
22
|
+
clawpatch report
|
|
23
|
+
clawpatch triage --finding <id> --status <status> --note "<reason>"
|
|
24
|
+
clawpatch revalidate --finding <id>
|
|
25
|
+
clawpatch fix --finding <id> --dry-run
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`clawpatch fix --finding <id> --dry-run` is allowed for inspection when it clarifies the proposed patch, but do not apply it by default. `clawpatch fix --finding <id>` and `clawpatch open-pr --patch <patchAttemptId>` are explicit mutation paths and require a clear user request.
|
|
29
|
+
|
|
30
|
+
Preserve report linkage in notes and final output: finding ID, report path if known, `.clawpatch/` state path when relevant, and command outputs used for decisions.
|
|
31
|
+
|
|
32
|
+
## Classification Matrix
|
|
33
|
+
|
|
34
|
+
### `resolve-now`
|
|
35
|
+
|
|
36
|
+
Use when the finding is selected, bounded, code/docs ownership is clear, and verification is available.
|
|
37
|
+
|
|
38
|
+
Actions:
|
|
39
|
+
|
|
40
|
+
1. Inspect ClawPatch evidence and relevant source.
|
|
41
|
+
2. Optionally inspect `clawpatch fix --finding <id> --dry-run` for context only.
|
|
42
|
+
3. Patch through normal Harness/Codex edits.
|
|
43
|
+
4. Run focused tests, type checks, smoke checks, or docs validation appropriate to the touched scope.
|
|
44
|
+
5. Revalidate with `clawpatch revalidate --finding <id>` when possible.
|
|
45
|
+
6. If revalidation is unavailable or inconclusive, update triage/status with a clear note.
|
|
46
|
+
|
|
47
|
+
### `needs-runtime-debugging`
|
|
48
|
+
|
|
49
|
+
Use when the finding depends on runtime behavior, reproduction, logs, browser/CLI checks, flakiness, performance, or an observed symptom.
|
|
50
|
+
|
|
51
|
+
Actions:
|
|
52
|
+
|
|
53
|
+
1. Stop resolution edits unless a cause is already proven.
|
|
54
|
+
2. Route into `$debugging-phase`.
|
|
55
|
+
3. Pass input artifacts: finding ID, report path, source evidence, expected behavior, observed or suspected behavior, affected scenario, and any failed revalidation.
|
|
56
|
+
4. Let `$debugging-phase` own hypotheses, runtime evidence, fix, and verification.
|
|
57
|
+
|
|
58
|
+
### `tech-debt`
|
|
59
|
+
|
|
60
|
+
Use when the finding is real or plausible but too broad for selected-finding repair, needs product/architecture decisions, lacks acceptance criteria, or would require a larger spec.
|
|
61
|
+
|
|
62
|
+
Actions:
|
|
63
|
+
|
|
64
|
+
1. Classify the selected finding first. Discovery alone must not create debt docs.
|
|
65
|
+
2. Update ClawPatch triage/history with the tech-debt reason.
|
|
66
|
+
3. Run `$docs-ingest-phase` to create or update durable repo debt/docs context.
|
|
67
|
+
4. Preserve these fields in the durable context:
|
|
68
|
+
- ClawPatch finding ID
|
|
69
|
+
- ClawPatch report path or state path
|
|
70
|
+
- source evidence and affected paths
|
|
71
|
+
- classification reason
|
|
72
|
+
- human-review question
|
|
73
|
+
- why immediate resolution is unsafe or too broad
|
|
74
|
+
5. Do not write speculative architecture as current truth.
|
|
75
|
+
|
|
76
|
+
The debt context should be small and reviewable. It should point to the
|
|
77
|
+
ClawPatch report and finding instead of copying the full report. It should name
|
|
78
|
+
the human decision needed before architecture, product scope, or acceptance
|
|
79
|
+
criteria can change.
|
|
80
|
+
|
|
81
|
+
Human-review questions should be concrete, for example: "Should this contract be changed, tested, or accepted as a known limitation?"
|
|
82
|
+
|
|
83
|
+
### `false-positive`
|
|
84
|
+
|
|
85
|
+
Use when source inspection proves the finding is incorrect, stale, unreachable, already covered, or intentionally accepted behavior.
|
|
86
|
+
|
|
87
|
+
Actions:
|
|
88
|
+
|
|
89
|
+
1. Record the proof with file paths, tests, docs, or command evidence.
|
|
90
|
+
2. Run `clawpatch triage --finding <id> --status false-positive --note "<clear reason>"` or the closest supported false-positive status.
|
|
91
|
+
3. Revalidate only if it adds signal; otherwise report the triage command as the state update.
|
|
92
|
+
|
|
93
|
+
### `blocked`
|
|
94
|
+
|
|
95
|
+
Use when resolution cannot proceed because required access, artifacts, environment, owner decision, or reproduction evidence is missing.
|
|
96
|
+
|
|
97
|
+
Actions:
|
|
98
|
+
|
|
99
|
+
1. Record the blocker and the specific missing item.
|
|
100
|
+
2. Leave source unchanged unless partial safe cleanup was already verified.
|
|
101
|
+
3. Update ClawPatch triage/status when useful with a note that names the blocker.
|
|
102
|
+
4. Report the next human action.
|
|
103
|
+
|
|
104
|
+
## Parallel Batch Resolution
|
|
105
|
+
|
|
106
|
+
`parallel: true` means bounded batch findings can be resolved concurrently, not merely inspected concurrently.
|
|
107
|
+
|
|
108
|
+
Preconditions:
|
|
109
|
+
|
|
110
|
+
- The batch list is explicit.
|
|
111
|
+
- Each finding has a classification target or classification owner.
|
|
112
|
+
- File ownership is disjoint, or the batch intentionally shares one root-cause patch with one coordination owner.
|
|
113
|
+
- Validation commands are known and can be merged centrally.
|
|
114
|
+
- Shared files, generated files, lockfiles, migrations, docs, and schemas have a single owner.
|
|
115
|
+
- Every worker can state which files it may edit, which files it must not edit,
|
|
116
|
+
and which validation it must run before handoff.
|
|
117
|
+
|
|
118
|
+
Worker brief must include:
|
|
119
|
+
|
|
120
|
+
- finding IDs
|
|
121
|
+
- classification route
|
|
122
|
+
- owned files and forbidden files
|
|
123
|
+
- allowed validation commands
|
|
124
|
+
- ClawPatch context command outputs or paths
|
|
125
|
+
- merge/revalidation handoff expectations
|
|
126
|
+
- explicit note that final ClawPatch status changes are centralized unless the
|
|
127
|
+
coordinator assigns one worker to a single finding end to end
|
|
128
|
+
|
|
129
|
+
Central coordinator responsibilities:
|
|
130
|
+
|
|
131
|
+
1. Confirm no worker overwrote unrelated edits.
|
|
132
|
+
2. Review combined diff for overlap and consistency.
|
|
133
|
+
3. Run final focused validation.
|
|
134
|
+
4. Run `clawpatch revalidate --finding <id>` for each resolved finding when possible.
|
|
135
|
+
5. Update false-positive, tech-debt, or blocked statuses centrally.
|
|
136
|
+
6. Produce one final report mapping each finding to classification, changes, validation, and ClawPatch state.
|
|
137
|
+
|
|
138
|
+
If two workers discover that their findings require the same file or root-cause
|
|
139
|
+
patch, pause fan-out for that subset and consolidate under one owner. Do not let
|
|
140
|
+
parallel workers race on the same fix.
|
|
141
|
+
|
|
142
|
+
## Output Contract
|
|
143
|
+
|
|
144
|
+
Return:
|
|
145
|
+
|
|
146
|
+
- mode: `parallel: true|false`
|
|
147
|
+
- finding IDs and report/state paths used
|
|
148
|
+
- classification for each finding
|
|
149
|
+
- route taken: resolved, debugging, debt, false-positive, or blocked
|
|
150
|
+
- changes made through normal edits, if any
|
|
151
|
+
- ClawPatch commands run and resulting state
|
|
152
|
+
- verification commands and results
|
|
153
|
+
- debt/docs artifacts or debugging handoff, if created
|
|
154
|
+
- caveats, residual risk, and next human action
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-resolution-phase
|
|
3
|
+
description: >-
|
|
4
|
+
Resolves selected ClawPatch findings through classification, bounded fixes,
|
|
5
|
+
triage, docs/debt routing, and revalidation. Use when the user selects a
|
|
6
|
+
ClawPatch finding, asks for ClawPatch-backed bug resolution, or gives a
|
|
7
|
+
tightly bounded finding batch for sequential or parallel handling.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Bug Resolution Phase
|
|
11
|
+
|
|
12
|
+
## Contract
|
|
13
|
+
|
|
14
|
+
- **Role:** public ClawPatch selected-finding resolution phase
|
|
15
|
+
- **Scope:** one selected finding by default; bounded batch only when explicitly tied by root cause, owned files, validation path, or contract/test gap
|
|
16
|
+
- **Primary input:** ClawPatch finding ID plus report or `.clawpatch/` state path when available
|
|
17
|
+
- **Uses ClawPatch for:** finding context, report linkage, triage/history, optional dry-run inspection, revalidation
|
|
18
|
+
- **Does not use by default:** `clawpatch fix --finding`, `clawpatch open-pr --patch`
|
|
19
|
+
- **Patch path:** normal Harness/Codex edits unless the user explicitly requests ClawPatch patch attempts
|
|
20
|
+
- **Exit conditions:** resolved and revalidated, routed to debugging, recorded as debt, triaged false positive, or blocked with evidence
|
|
21
|
+
|
|
22
|
+
## Use When
|
|
23
|
+
|
|
24
|
+
- The user selects a ClawPatch finding for resolution.
|
|
25
|
+
- The user asks to resolve a ClawPatch finding or bounded batch.
|
|
26
|
+
- Discovery output needs follow-up classification and repair.
|
|
27
|
+
- `parallel: true` is requested for a bounded finding batch.
|
|
28
|
+
|
|
29
|
+
## Do Not Use When
|
|
30
|
+
|
|
31
|
+
- No finding is selected; use `$bug-discovery-phase` or ask for the finding ID.
|
|
32
|
+
- The work starts from a runtime symptom rather than a ClawPatch finding; use `$debugging-phase`.
|
|
33
|
+
- The user wants broad debt resolution from an existing debt artifact; use `$resolve-debt-phase`.
|
|
34
|
+
- The request is discovery/report generation only.
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
1. Read the selected finding with `clawpatch show --finding <id>` and, when useful, `clawpatch report`.
|
|
39
|
+
2. Capture finding ID, report path, source evidence, affected files, claimed behavior, and current ClawPatch status.
|
|
40
|
+
3. Classify each finding as `resolve-now`, `needs-runtime-debugging`, `tech-debt`, `false-positive`, or `blocked`.
|
|
41
|
+
4. Execute the classification route:
|
|
42
|
+
- `resolve-now`: patch through normal Harness/Codex edits, then test and revalidate.
|
|
43
|
+
- `needs-runtime-debugging`: route into `$debugging-phase` with the finding context as input artifact.
|
|
44
|
+
- `tech-debt`: after classification, run `$docs-ingest-phase` to create or update durable debt/docs context.
|
|
45
|
+
- `false-positive`: run `clawpatch triage --finding <id> --status <status> --note <reason>`.
|
|
46
|
+
- `blocked`: record blocker, missing evidence, and next human action.
|
|
47
|
+
5. Finish with centralized verification and `clawpatch revalidate --finding <id>` or a triage/status update.
|
|
48
|
+
|
|
49
|
+
## Parallel Rules
|
|
50
|
+
|
|
51
|
+
`bug-resolution-phase` may run with `parallel: true` or `parallel: false`.
|
|
52
|
+
|
|
53
|
+
- `parallel: false`: resolve one finding, or a tiny batch sequentially.
|
|
54
|
+
- `parallel: true`: only for bounded batches with explicit worker ownership.
|
|
55
|
+
- Before fan-out, prove findings are safely disjoint or intentionally share one root-cause scope.
|
|
56
|
+
- Assign owned finding IDs, files, tests, and allowed commands per worker.
|
|
57
|
+
- Workers may patch only their owned scope through normal Harness/Codex edits.
|
|
58
|
+
- Final verification, status decisions, and ClawPatch revalidation stay centralized.
|
|
59
|
+
|
|
60
|
+
## Reference
|
|
61
|
+
|
|
62
|
+
See [REFERENCE.md](REFERENCE.md) for classification rules, ClawPatch command guidance, tech-debt artifact requirements, and output format.
|