@codexstar/bug-hunter 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +151 -0
- package/LICENSE +21 -0
- package/README.md +665 -0
- package/SKILL.md +624 -0
- package/bin/bug-hunter +222 -0
- package/evals/evals.json +362 -0
- package/modes/_dispatch.md +121 -0
- package/modes/extended.md +94 -0
- package/modes/fix-loop.md +115 -0
- package/modes/fix-pipeline.md +384 -0
- package/modes/large-codebase.md +212 -0
- package/modes/local-sequential.md +143 -0
- package/modes/loop.md +125 -0
- package/modes/parallel.md +113 -0
- package/modes/scaled.md +76 -0
- package/modes/single-file.md +38 -0
- package/modes/small.md +86 -0
- package/package.json +56 -0
- package/prompts/doc-lookup.md +44 -0
- package/prompts/examples/hunter-examples.md +131 -0
- package/prompts/examples/skeptic-examples.md +87 -0
- package/prompts/fixer.md +103 -0
- package/prompts/hunter.md +146 -0
- package/prompts/recon.md +159 -0
- package/prompts/referee.md +122 -0
- package/prompts/skeptic.md +143 -0
- package/prompts/threat-model.md +122 -0
- package/scripts/bug-hunter-state.cjs +537 -0
- package/scripts/code-index.cjs +541 -0
- package/scripts/context7-api.cjs +133 -0
- package/scripts/delta-mode.cjs +219 -0
- package/scripts/dep-scan.cjs +343 -0
- package/scripts/doc-lookup.cjs +316 -0
- package/scripts/fix-lock.cjs +167 -0
- package/scripts/init-test-fixture.sh +19 -0
- package/scripts/payload-guard.cjs +197 -0
- package/scripts/run-bug-hunter.cjs +892 -0
- package/scripts/tests/bug-hunter-state.test.cjs +87 -0
- package/scripts/tests/code-index.test.cjs +57 -0
- package/scripts/tests/delta-mode.test.cjs +47 -0
- package/scripts/tests/fix-lock.test.cjs +36 -0
- package/scripts/tests/fixtures/flaky-worker.cjs +63 -0
- package/scripts/tests/fixtures/low-confidence-worker.cjs +73 -0
- package/scripts/tests/fixtures/success-worker.cjs +42 -0
- package/scripts/tests/payload-guard.test.cjs +41 -0
- package/scripts/tests/run-bug-hunter.test.cjs +403 -0
- package/scripts/tests/test-utils.cjs +59 -0
- package/scripts/tests/worktree-harvest.test.cjs +297 -0
- package/scripts/triage.cjs +528 -0
- package/scripts/worktree-harvest.cjs +516 -0
- package/templates/subagent-wrapper.md +109 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 3.0.0 — 2026-03-10
|
|
4
|
+
|
|
5
|
+
### npm package, worktree-isolated Fixer, and cross-IDE installation
|
|
6
|
+
|
|
7
|
+
**npm global install and CLI:**
|
|
8
|
+
- New `package.json` with `@codexstar/bug-hunter` package name
|
|
9
|
+
- New `bin/bug-hunter` CLI entry point with `install`, `doctor`, and `info` commands
|
|
10
|
+
- `bug-hunter install` auto-detects Claude Code, Codex, Cursor, Kiro, and generic agents directories
|
|
11
|
+
- `bug-hunter doctor` checks environment readiness (Node.js, Context Hub, Context7, git)
|
|
12
|
+
- Install via: `npm install -g @codexstar/bug-hunter && bug-hunter install`
|
|
13
|
+
|
|
14
|
+
**Cross-IDE installation via skills.sh:**
|
|
15
|
+
- Compatible with `npx skills add codexstar69/bug-hunter` for Cursor, Windsurf, Copilot, Kiro, and Claude Code
|
|
16
|
+
- No publish step required — auto-discovered from public GitHub repo with valid SKILL.md
|
|
17
|
+
|
|
18
|
+
**Worktree-isolated Fixer dispatch (subagent/teams backends):**
|
|
19
|
+
- New `scripts/worktree-harvest.cjs` — manages git worktrees for safe, isolated Fixer execution
|
|
20
|
+
- 6 subcommands: `prepare`, `harvest`, `checkout-fix`, `cleanup`, `cleanup-all`, `status`
|
|
21
|
+
- Fixer edits happen in an isolated worktree; commits land on the fix branch without touching the user's working tree
|
|
22
|
+
- Crash recovery via `cleanup-all` with automatic stash preservation
|
|
23
|
+
- Meta-file filtering prevents `.worktree-manifest.json` and `.harvest-result.json` from polluting dirty detection
|
|
24
|
+
- `modes/fix-pipeline.md` updated with dual-path dispatch: worktree path (prepare → dispatch → harvest → cleanup) and direct path
|
|
25
|
+
- `modes/_dispatch.md` updated with Fixer worktree lifecycle diagram and CRITICAL warning about Agent tool's built-in `isolation: "worktree"`
|
|
26
|
+
- `templates/subagent-wrapper.md` updated with `{WORKTREE_RULES}` variable for Fixer isolation rules
|
|
27
|
+
- 13 new tests in `scripts/tests/worktree-harvest.test.cjs` (full suite: 25/25 passing)
|
|
28
|
+
|
|
29
|
+
**Context Hub preflight warning:**
|
|
30
|
+
- SKILL.md Step 5b now shows a visible `⚠️` warning when `chub` is not installed, with install command
|
|
31
|
+
- Previously was a silent suggestion — now impossible to miss
|
|
32
|
+
|
|
33
|
+
**SKILL.md error table:**
|
|
34
|
+
- 5 new error rows for worktree failures: prepare, harvest dirty, harvest no-manifest, cleanup, and checkout-fix errors
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2026-03-10 13:26
|
|
39
|
+
|
|
40
|
+
- `scripts/triage.cjs`: LOW-only repositories promoted into `scanOrder` so script-heavy codebases do not collapse to zero scannable files
|
|
41
|
+
- `scripts/run-bug-hunter.cjs`: `teams` backend name aligned with the documented dispatch mode
|
|
42
|
+
- `scripts/run-bug-hunter.cjs`: `code-index.cjs` treated as optional during preflight and gated only when index-backed flows are requested
|
|
43
|
+
- `scripts/run-bug-hunter.cjs`: low-confidence delta expansion now reuses the caller's configured `--delta-hops` value
|
|
44
|
+
- `scripts/tests/run-bug-hunter.test.cjs`: regressions for LOW-only triage, optional `code-index`, `teams` backend selection, and delta-hop expansion
|
|
45
|
+
|
|
46
|
+
## 2.4.0 — 2026-03-10
|
|
47
|
+
|
|
48
|
+
### Context Hub integration — curated docs with Context7 fallback
|
|
49
|
+
|
|
50
|
+
- New `scripts/doc-lookup.cjs`: hybrid documentation lookup that tries [Context Hub](https://github.com/andrewyng/context-hub) (chub) first for curated, versioned, annotatable docs, then falls back to Context7 API when chub doesn't have the library
|
|
51
|
+
- All agent prompts (hunter, skeptic, fixer, doc-lookup) updated to use `doc-lookup.cjs` as primary with `context7-api.cjs` as explicit fallback
|
|
52
|
+
- Preflight smoke test now checks `doc-lookup.cjs` first, falls back to `context7-api.cjs`
|
|
53
|
+
- `run-bug-hunter.cjs` validates both scripts exist at startup
|
|
54
|
+
- Requires `@aisuite/chub` installed globally (`npm install -g @aisuite/chub`) — optional but recommended; pipeline works without it via Context7 fallback
|
|
55
|
+
|
|
56
|
+
## 2.3.0 — 2026-03-10
|
|
57
|
+
|
|
58
|
+
### Loop mode is now on by default
|
|
59
|
+
|
|
60
|
+
- `LOOP_MODE=true` is the new default — every `/bug-hunter` invocation iterates until full CRITICAL/HIGH coverage
|
|
61
|
+
- Added `--no-loop` flag to opt out and get single-pass behavior
|
|
62
|
+
- `--loop` flag still accepted for backwards compatibility (no-op)
|
|
63
|
+
- Updated triage warnings, coverage enforcement, and all documentation to reflect the new default
|
|
64
|
+
- `/bug-hunter src/` now finds bugs, fixes them, AND loops until full coverage — zero flags needed
|
|
65
|
+
|
|
66
|
+
## 2.2.1 — 2026-03-10
|
|
67
|
+
|
|
68
|
+
### Fix: `--loop` mode now actually loops
|
|
69
|
+
|
|
70
|
+
The `--loop` flag was broken — loop mode files described a "ralph-loop" system but never called `ralph_start`, so the pipeline ran once and stopped. Fixed:
|
|
71
|
+
|
|
72
|
+
- **`modes/loop.md`**: added explicit `ralph_start` call instructions with correct `taskContent` and `maxIterations` parameters
|
|
73
|
+
- **`modes/fix-loop.md`**: same fix for `--loop --fix` combined mode, plus removed manual state file creation (handled by `ralph_start`)
|
|
74
|
+
- **`SKILL.md`**: added CRITICAL integration note requiring `ralph_start` call when `LOOP_MODE=true`
|
|
75
|
+
- Changed completion signal from `<promise>DONE</promise>` to `<promise>COMPLETE</promise>` (correct ralph-loop API)
|
|
76
|
+
- Each iteration now calls `ralph_done` to proceed instead of relying on a non-existent hook
|
|
77
|
+
|
|
78
|
+
## 2.2.0 — 2026-03-10
|
|
79
|
+
|
|
80
|
+
### Fix pipeline hardening — 12 reliability and safety optimizations
|
|
81
|
+
|
|
82
|
+
- **Rollback timeout guard**: `git revert` calls now timeout after 60 seconds; conflicts abort cleanly instead of hanging the pipeline indefinitely
|
|
83
|
+
- **Dynamic lock TTL**: single-writer lock TTL scales with queue size (`max(1800, bugs * 600)`), preventing expiry on large fix runs
|
|
84
|
+
- **Lock heartbeat renewal**: new `renew` command in `fix-lock.cjs` — fixer renews the lock after each bug fix to prevent mid-run TTL expiry
|
|
85
|
+
- **Fixer context budget**: `MAX_BUGS_PER_FIXER = 5` — large fix queues are split into sequential batches to prevent context window overflow and hallucinated patches
|
|
86
|
+
- **Cross-file dependency ordering**: when `code-index.cjs` is available, fixes are ordered by import graph (fix dependencies before dependents)
|
|
87
|
+
- **Flaky test detection**: baseline tests run twice; tests that fail non-deterministically are excluded from revert decisions
|
|
88
|
+
- **Per-bug revert granularity**: clarified one-commit-per-bug as mandatory; reverts target individual bugs, not clusters
|
|
89
|
+
- **Dynamic canary sizing**: `max(1, min(3, ceil(eligible * 0.2)))` — canary group scales with queue size instead of hardcoded 1–3
|
|
90
|
+
- **Post-fix re-scan severity floor**: fixer-introduced bugs below MEDIUM severity are logged but don't trigger `FIXER_BUG` status
|
|
91
|
+
- **Dry-run mode** (`--dry-run`): preview planned fixes without editing files — Fixer reads code and outputs unified diff previews, no git commits
|
|
92
|
+
- **Machine-readable fix report**: `.bug-hunter/fix-report.json` written alongside markdown report for CI/CD gating, dashboards, and ticket automation
|
|
93
|
+
- **Circuit breaker**: if >50% of fix attempts fail/revert (min 3 attempts), remaining fixes are halted to prevent token waste on unstable codebases
|
|
94
|
+
- **Global Phase 2 timeout**: 30-minute deadline for the entire fix execution phase; unprocessed bugs are marked SKIPPED
|
|
95
|
+
|
|
96
|
+
## 2.1.0 — 2026-03-10
|
|
97
|
+
|
|
98
|
+
### v3 security pipeline + dependency scanner reliability
|
|
99
|
+
|
|
100
|
+
- STRIDE/CWE fields in Hunter findings format, with CWE quick-reference mapping for security categories
|
|
101
|
+
- Skeptic hard-exclusion fast path (15 false-positive classes) before deep review
|
|
102
|
+
- Referee security enrichment: reachability, exploitability, CVSS 3.1, and PoC blocks for critical/high security bugs
|
|
103
|
+
- Threat model support: `--threat-model` flag, `prompts/threat-model.md`, Recon/Hunter threat-context wiring
|
|
104
|
+
- Dependency scan support: `--deps` flag and `scripts/dep-scan.cjs` output to `.bug-hunter/dep-findings.json`
|
|
105
|
+
- JSON report contract: `.bug-hunter/findings.json` plus canonical `.bug-hunter/report.md`
|
|
106
|
+
- Few-shot calibration examples for Hunter and Skeptic in `prompts/examples/`
|
|
107
|
+
- `dep-scan.cjs` lockfile-aware audits (`npm`, `pnpm`, `yarn`, `bun`) and non-zero audit exit handling so vulnerability exits are not misreported as scanner failures
|
|
108
|
+
|
|
109
|
+
## 2.0.0 — 2026-03-10
|
|
110
|
+
|
|
111
|
+
### Structural overhaul — triage pipeline + 36% token reduction
|
|
112
|
+
|
|
113
|
+
**Pipeline restructure:**
|
|
114
|
+
- Triage moved to Step 1 (after arg parse) — was running before target resolved
|
|
115
|
+
- All mode files consume triage JSON — riskMap, scanOrder, fileBudget flow downstream
|
|
116
|
+
- Recon demoted to enrichment — no longer does file classification when triage exists
|
|
117
|
+
- Step 7.0 re-audit gate removed — duplicated Referee's work
|
|
118
|
+
|
|
119
|
+
**Deduplication:**
|
|
120
|
+
- `modes/_dispatch.md` — shared dispatch patterns (18 references across modes)
|
|
121
|
+
- Mode files compressed: small 7.3→2.9KB, parallel 7.9→4.2KB, extended 7.1→3.3KB, scaled 7.3→2.7KB
|
|
122
|
+
- Skip-file patterns consolidated — single authoritative list in SKILL.md
|
|
123
|
+
- Error handling table updated with correct step references
|
|
124
|
+
|
|
125
|
+
**Dead weight removed:**
|
|
126
|
+
- FIX-PLAN.md deleted (26KB dead planning doc)
|
|
127
|
+
- README.md compressed from 8.5KB to 3.7KB
|
|
128
|
+
- code-index.cjs marked optional
|
|
129
|
+
|
|
130
|
+
**Prompt compression:**
|
|
131
|
+
- hunter.md: scope rules and security checklist compressed
|
|
132
|
+
- recon.md: output format template and "What to map" sections compressed
|
|
133
|
+
- referee.md: tiering rules, re-check section, output format compressed
|
|
134
|
+
- skeptic.md: false-positive patterns compressed to inline format
|
|
135
|
+
|
|
136
|
+
**Logic gaps fixed:**
|
|
137
|
+
- Branch-diff/staged optimization note in Step 3
|
|
138
|
+
- single-file.md: local-sequential backend support added
|
|
139
|
+
|
|
140
|
+
**Size:** 187,964 → 119,825 bytes (36% reduction, ~30K tokens)
|
|
141
|
+
|
|
142
|
+
## 1.0.0 — 2026-03-10
|
|
143
|
+
|
|
144
|
+
### Zero-token pre-recon triage (`triage.cjs`)
|
|
145
|
+
- `scripts/triage.cjs` runs before any LLM agent — 0 tokens, <2s for 2,000+ files
|
|
146
|
+
- FILE_BUDGET, strategy, and domain map decided by triage, not Recon
|
|
147
|
+
- Writes `.bug-hunter/triage.json` with strategy, fileBudget, domains, riskMap, scanOrder
|
|
148
|
+
- `local-sequential.md` with full phase-by-phase instructions
|
|
149
|
+
- Subagent wrapper template in `templates/subagent-wrapper.md`
|
|
150
|
+
- Coverage enforcement — partial audits produce explicit warnings
|
|
151
|
+
- Large codebase strategy with domain-first tiered scanning
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 codexstar69
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|