@humanbased/crosscheck 0.14.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/AGENT.md +207 -0
- package/ISSUE.md +234 -0
- package/LICENSE +21 -0
- package/README.md +234 -0
- package/README.zh.md +169 -0
- package/assets/logo.png +0 -0
- package/assets/screenshot-watch-timing.png +0 -0
- package/assets/screenshot-watch-timing.svg +1 -0
- package/assets/screenshot-watch.png +0 -0
- package/crosscheck.config.example.yml +214 -0
- package/dist/__tests__/annotation.test.d.ts +2 -0
- package/dist/__tests__/annotation.test.d.ts.map +1 -0
- package/dist/__tests__/annotation.test.js +134 -0
- package/dist/__tests__/annotation.test.js.map +1 -0
- package/dist/__tests__/backtrace.test.d.ts +2 -0
- package/dist/__tests__/backtrace.test.d.ts.map +1 -0
- package/dist/__tests__/backtrace.test.js +280 -0
- package/dist/__tests__/backtrace.test.js.map +1 -0
- package/dist/__tests__/board.test.d.ts +2 -0
- package/dist/__tests__/board.test.d.ts.map +1 -0
- package/dist/__tests__/board.test.js +149 -0
- package/dist/__tests__/board.test.js.map +1 -0
- package/dist/__tests__/codex.test.d.ts +2 -0
- package/dist/__tests__/codex.test.d.ts.map +1 -0
- package/dist/__tests__/codex.test.js +92 -0
- package/dist/__tests__/codex.test.js.map +1 -0
- package/dist/__tests__/comment-bodies.test.d.ts +2 -0
- package/dist/__tests__/comment-bodies.test.d.ts.map +1 -0
- package/dist/__tests__/comment-bodies.test.js +75 -0
- package/dist/__tests__/comment-bodies.test.js.map +1 -0
- package/dist/__tests__/conflict-resolve.test.d.ts +2 -0
- package/dist/__tests__/conflict-resolve.test.d.ts.map +1 -0
- package/dist/__tests__/conflict-resolve.test.js +123 -0
- package/dist/__tests__/conflict-resolve.test.js.map +1 -0
- package/dist/__tests__/crosscheck-commit.test.d.ts +2 -0
- package/dist/__tests__/crosscheck-commit.test.d.ts.map +1 -0
- package/dist/__tests__/crosscheck-commit.test.js +13 -0
- package/dist/__tests__/crosscheck-commit.test.js.map +1 -0
- package/dist/__tests__/detector.test.d.ts +2 -0
- package/dist/__tests__/detector.test.d.ts.map +1 -0
- package/dist/__tests__/detector.test.js +112 -0
- package/dist/__tests__/detector.test.js.map +1 -0
- package/dist/__tests__/diagnose.test.d.ts +2 -0
- package/dist/__tests__/diagnose.test.d.ts.map +1 -0
- package/dist/__tests__/diagnose.test.js +164 -0
- package/dist/__tests__/diagnose.test.js.map +1 -0
- package/dist/__tests__/diff-hash.test.d.ts +2 -0
- package/dist/__tests__/diff-hash.test.d.ts.map +1 -0
- package/dist/__tests__/diff-hash.test.js +126 -0
- package/dist/__tests__/diff-hash.test.js.map +1 -0
- package/dist/__tests__/durations.test.d.ts +2 -0
- package/dist/__tests__/durations.test.d.ts.map +1 -0
- package/dist/__tests__/durations.test.js +26 -0
- package/dist/__tests__/durations.test.js.map +1 -0
- package/dist/__tests__/event-fields.test.d.ts +2 -0
- package/dist/__tests__/event-fields.test.d.ts.map +1 -0
- package/dist/__tests__/event-fields.test.js +50 -0
- package/dist/__tests__/event-fields.test.js.map +1 -0
- package/dist/__tests__/filter.test.d.ts +2 -0
- package/dist/__tests__/filter.test.d.ts.map +1 -0
- package/dist/__tests__/filter.test.js +21 -0
- package/dist/__tests__/filter.test.js.map +1 -0
- package/dist/__tests__/fix.test.d.ts +2 -0
- package/dist/__tests__/fix.test.d.ts.map +1 -0
- package/dist/__tests__/fix.test.js +124 -0
- package/dist/__tests__/fix.test.js.map +1 -0
- package/dist/__tests__/github-client.test.d.ts +2 -0
- package/dist/__tests__/github-client.test.d.ts.map +1 -0
- package/dist/__tests__/github-client.test.js +22 -0
- package/dist/__tests__/github-client.test.js.map +1 -0
- package/dist/__tests__/github-scan-client.test.d.ts +2 -0
- package/dist/__tests__/github-scan-client.test.d.ts.map +1 -0
- package/dist/__tests__/github-scan-client.test.js +100 -0
- package/dist/__tests__/github-scan-client.test.js.map +1 -0
- package/dist/__tests__/is-fresh-review-comment.test.d.ts +2 -0
- package/dist/__tests__/is-fresh-review-comment.test.d.ts.map +1 -0
- package/dist/__tests__/is-fresh-review-comment.test.js +86 -0
- package/dist/__tests__/is-fresh-review-comment.test.js.map +1 -0
- package/dist/__tests__/issue.test.d.ts +2 -0
- package/dist/__tests__/issue.test.d.ts.map +1 -0
- package/dist/__tests__/issue.test.js +259 -0
- package/dist/__tests__/issue.test.js.map +1 -0
- package/dist/__tests__/kickass.test.d.ts +2 -0
- package/dist/__tests__/kickass.test.d.ts.map +1 -0
- package/dist/__tests__/kickass.test.js +268 -0
- package/dist/__tests__/kickass.test.js.map +1 -0
- package/dist/__tests__/loader.test.d.ts +2 -0
- package/dist/__tests__/loader.test.d.ts.map +1 -0
- package/dist/__tests__/loader.test.js +180 -0
- package/dist/__tests__/loader.test.js.map +1 -0
- package/dist/__tests__/onboard-preservation.test.d.ts +2 -0
- package/dist/__tests__/onboard-preservation.test.d.ts.map +1 -0
- package/dist/__tests__/onboard-preservation.test.js +506 -0
- package/dist/__tests__/onboard-preservation.test.js.map +1 -0
- package/dist/__tests__/optimize.test.d.ts +2 -0
- package/dist/__tests__/optimize.test.d.ts.map +1 -0
- package/dist/__tests__/optimize.test.js +101 -0
- package/dist/__tests__/optimize.test.js.map +1 -0
- package/dist/__tests__/post-review-comment.test.d.ts +2 -0
- package/dist/__tests__/post-review-comment.test.d.ts.map +1 -0
- package/dist/__tests__/post-review-comment.test.js +44 -0
- package/dist/__tests__/post-review-comment.test.js.map +1 -0
- package/dist/__tests__/pr-lock.test.d.ts +2 -0
- package/dist/__tests__/pr-lock.test.d.ts.map +1 -0
- package/dist/__tests__/pr-lock.test.js +115 -0
- package/dist/__tests__/pr-lock.test.js.map +1 -0
- package/dist/__tests__/pr-picker.test.d.ts +2 -0
- package/dist/__tests__/pr-picker.test.d.ts.map +1 -0
- package/dist/__tests__/pr-picker.test.js +57 -0
- package/dist/__tests__/pr-picker.test.js.map +1 -0
- package/dist/__tests__/pr-status-scan.test.d.ts +2 -0
- package/dist/__tests__/pr-status-scan.test.d.ts.map +1 -0
- package/dist/__tests__/pr-status-scan.test.js +92 -0
- package/dist/__tests__/pr-status-scan.test.js.map +1 -0
- package/dist/__tests__/pr-status.test.d.ts +2 -0
- package/dist/__tests__/pr-status.test.d.ts.map +1 -0
- package/dist/__tests__/pr-status.test.js +346 -0
- package/dist/__tests__/pr-status.test.js.map +1 -0
- package/dist/__tests__/repo-picker.test.d.ts +2 -0
- package/dist/__tests__/repo-picker.test.d.ts.map +1 -0
- package/dist/__tests__/repo-picker.test.js +115 -0
- package/dist/__tests__/repo-picker.test.js.map +1 -0
- package/dist/__tests__/review-comment-body.test.d.ts +2 -0
- package/dist/__tests__/review-comment-body.test.d.ts.map +1 -0
- package/dist/__tests__/review-comment-body.test.js +54 -0
- package/dist/__tests__/review-comment-body.test.js.map +1 -0
- package/dist/__tests__/review-models.test.d.ts +2 -0
- package/dist/__tests__/review-models.test.d.ts.map +1 -0
- package/dist/__tests__/review-models.test.js +39 -0
- package/dist/__tests__/review-models.test.js.map +1 -0
- package/dist/__tests__/review-status.test.d.ts +2 -0
- package/dist/__tests__/review-status.test.d.ts.map +1 -0
- package/dist/__tests__/review-status.test.js +95 -0
- package/dist/__tests__/review-status.test.js.map +1 -0
- package/dist/__tests__/runner.test.d.ts +2 -0
- package/dist/__tests__/runner.test.d.ts.map +1 -0
- package/dist/__tests__/runner.test.js +204 -0
- package/dist/__tests__/runner.test.js.map +1 -0
- package/dist/__tests__/scan-cache.test.d.ts +2 -0
- package/dist/__tests__/scan-cache.test.d.ts.map +1 -0
- package/dist/__tests__/scan-cache.test.js +59 -0
- package/dist/__tests__/scan-cache.test.js.map +1 -0
- package/dist/__tests__/scan-client.test.d.ts +2 -0
- package/dist/__tests__/scan-client.test.d.ts.map +1 -0
- package/dist/__tests__/scan-client.test.js +30 -0
- package/dist/__tests__/scan-client.test.js.map +1 -0
- package/dist/__tests__/scan.test.d.ts +2 -0
- package/dist/__tests__/scan.test.d.ts.map +1 -0
- package/dist/__tests__/scan.test.js +115 -0
- package/dist/__tests__/scan.test.js.map +1 -0
- package/dist/__tests__/scopes.test.d.ts +2 -0
- package/dist/__tests__/scopes.test.d.ts.map +1 -0
- package/dist/__tests__/scopes.test.js +101 -0
- package/dist/__tests__/scopes.test.js.map +1 -0
- package/dist/__tests__/sha-cache.test.d.ts +2 -0
- package/dist/__tests__/sha-cache.test.d.ts.map +1 -0
- package/dist/__tests__/sha-cache.test.js +40 -0
- package/dist/__tests__/sha-cache.test.js.map +1 -0
- package/dist/__tests__/smart-switch.test.d.ts +2 -0
- package/dist/__tests__/smart-switch.test.d.ts.map +1 -0
- package/dist/__tests__/smart-switch.test.js +145 -0
- package/dist/__tests__/smart-switch.test.js.map +1 -0
- package/dist/ck.d.ts +3 -0
- package/dist/ck.d.ts.map +1 -0
- package/dist/ck.js +8 -0
- package/dist/ck.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +132 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/diagnose.d.ts +54 -0
- package/dist/commands/diagnose.d.ts.map +1 -0
- package/dist/commands/diagnose.js +294 -0
- package/dist/commands/diagnose.js.map +1 -0
- package/dist/commands/impact.d.ts +38 -0
- package/dist/commands/impact.d.ts.map +1 -0
- package/dist/commands/impact.js +210 -0
- package/dist/commands/impact.js.map +1 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +183 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/issue.d.ts +25 -0
- package/dist/commands/issue.d.ts.map +1 -0
- package/dist/commands/issue.js +445 -0
- package/dist/commands/issue.js.map +1 -0
- package/dist/commands/kickass.d.ts +59 -0
- package/dist/commands/kickass.d.ts.map +1 -0
- package/dist/commands/kickass.js +288 -0
- package/dist/commands/kickass.js.map +1 -0
- package/dist/commands/onboard.d.ts +70 -0
- package/dist/commands/onboard.d.ts.map +1 -0
- package/dist/commands/onboard.js +883 -0
- package/dist/commands/onboard.js.map +1 -0
- package/dist/commands/optimize.d.ts +16 -0
- package/dist/commands/optimize.d.ts.map +1 -0
- package/dist/commands/optimize.js +244 -0
- package/dist/commands/optimize.js.map +1 -0
- package/dist/commands/review.d.ts +2 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +118 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +243 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/scan.d.ts +94 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +276 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/serve.d.ts +9 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +402 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +89 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/watch.d.ts +9 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +902 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/config/loader.d.ts +47 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +334 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/schema.d.ts +814 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +152 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/github/client.d.ts +139 -0
- package/dist/github/client.d.ts.map +1 -0
- package/dist/github/client.js +711 -0
- package/dist/github/client.js.map +1 -0
- package/dist/github/detector.d.ts +12 -0
- package/dist/github/detector.d.ts.map +1 -0
- package/dist/github/detector.js +120 -0
- package/dist/github/detector.js.map +1 -0
- package/dist/github/merge.d.ts +9 -0
- package/dist/github/merge.d.ts.map +1 -0
- package/dist/github/merge.js +33 -0
- package/dist/github/merge.js.map +1 -0
- package/dist/github/review-status.d.ts +6 -0
- package/dist/github/review-status.d.ts.map +1 -0
- package/dist/github/review-status.js +51 -0
- package/dist/github/review-status.js.map +1 -0
- package/dist/github/webhook.d.ts +41 -0
- package/dist/github/webhook.d.ts.map +1 -0
- package/dist/github/webhook.js +50 -0
- package/dist/github/webhook.js.map +1 -0
- package/dist/lib/annotation.d.ts +23 -0
- package/dist/lib/annotation.d.ts.map +1 -0
- package/dist/lib/annotation.js +103 -0
- package/dist/lib/annotation.js.map +1 -0
- package/dist/lib/backtrace.d.ts +40 -0
- package/dist/lib/backtrace.d.ts.map +1 -0
- package/dist/lib/backtrace.js +169 -0
- package/dist/lib/backtrace.js.map +1 -0
- package/dist/lib/board.d.ts +74 -0
- package/dist/lib/board.d.ts.map +1 -0
- package/dist/lib/board.js +640 -0
- package/dist/lib/board.js.map +1 -0
- package/dist/lib/clone.d.ts +12 -0
- package/dist/lib/clone.d.ts.map +1 -0
- package/dist/lib/clone.js +30 -0
- package/dist/lib/clone.js.map +1 -0
- package/dist/lib/comment-bodies.d.ts +17 -0
- package/dist/lib/comment-bodies.d.ts.map +1 -0
- package/dist/lib/comment-bodies.js +51 -0
- package/dist/lib/comment-bodies.js.map +1 -0
- package/dist/lib/crosscheck-commit.d.ts +2 -0
- package/dist/lib/crosscheck-commit.d.ts.map +1 -0
- package/dist/lib/crosscheck-commit.js +4 -0
- package/dist/lib/crosscheck-commit.js.map +1 -0
- package/dist/lib/diff-hash.d.ts +16 -0
- package/dist/lib/diff-hash.d.ts.map +1 -0
- package/dist/lib/diff-hash.js +71 -0
- package/dist/lib/diff-hash.js.map +1 -0
- package/dist/lib/durations.d.ts +5 -0
- package/dist/lib/durations.d.ts.map +1 -0
- package/dist/lib/durations.js +39 -0
- package/dist/lib/durations.js.map +1 -0
- package/dist/lib/event-fields.d.ts +6 -0
- package/dist/lib/event-fields.d.ts.map +1 -0
- package/dist/lib/event-fields.js +20 -0
- package/dist/lib/event-fields.js.map +1 -0
- package/dist/lib/filter.d.ts +2 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +4 -0
- package/dist/lib/filter.js.map +1 -0
- package/dist/lib/fortune.d.ts +2 -0
- package/dist/lib/fortune.d.ts.map +1 -0
- package/dist/lib/fortune.js +26 -0
- package/dist/lib/fortune.js.map +1 -0
- package/dist/lib/languages.d.ts +3 -0
- package/dist/lib/languages.d.ts.map +1 -0
- package/dist/lib/languages.js +26 -0
- package/dist/lib/languages.js.map +1 -0
- package/dist/lib/log-analysis.d.ts +17 -0
- package/dist/lib/log-analysis.d.ts.map +1 -0
- package/dist/lib/log-analysis.js +72 -0
- package/dist/lib/log-analysis.js.map +1 -0
- package/dist/lib/logger.d.ts +14 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +84 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/port.d.ts +2 -0
- package/dist/lib/port.d.ts.map +1 -0
- package/dist/lib/port.js +21 -0
- package/dist/lib/port.js.map +1 -0
- package/dist/lib/pr-lock.d.ts +4 -0
- package/dist/lib/pr-lock.d.ts.map +1 -0
- package/dist/lib/pr-lock.js +91 -0
- package/dist/lib/pr-lock.js.map +1 -0
- package/dist/lib/pr-picker.d.ts +10 -0
- package/dist/lib/pr-picker.d.ts.map +1 -0
- package/dist/lib/pr-picker.js +80 -0
- package/dist/lib/pr-picker.js.map +1 -0
- package/dist/lib/pr-status.d.ts +206 -0
- package/dist/lib/pr-status.d.ts.map +1 -0
- package/dist/lib/pr-status.js +613 -0
- package/dist/lib/pr-status.js.map +1 -0
- package/dist/lib/repo-picker.d.ts +23 -0
- package/dist/lib/repo-picker.d.ts.map +1 -0
- package/dist/lib/repo-picker.js +411 -0
- package/dist/lib/repo-picker.js.map +1 -0
- package/dist/lib/review-models.d.ts +7 -0
- package/dist/lib/review-models.d.ts.map +1 -0
- package/dist/lib/review-models.js +32 -0
- package/dist/lib/review-models.js.map +1 -0
- package/dist/lib/runner.d.ts +65 -0
- package/dist/lib/runner.d.ts.map +1 -0
- package/dist/lib/runner.js +710 -0
- package/dist/lib/runner.js.map +1 -0
- package/dist/lib/scan-cache.d.ts +31 -0
- package/dist/lib/scan-cache.d.ts.map +1 -0
- package/dist/lib/scan-cache.js +112 -0
- package/dist/lib/scan-cache.js.map +1 -0
- package/dist/lib/scopes.d.ts +16 -0
- package/dist/lib/scopes.d.ts.map +1 -0
- package/dist/lib/scopes.js +37 -0
- package/dist/lib/scopes.js.map +1 -0
- package/dist/lib/sha-cache.d.ts +7 -0
- package/dist/lib/sha-cache.d.ts.map +1 -0
- package/dist/lib/sha-cache.js +44 -0
- package/dist/lib/sha-cache.js.map +1 -0
- package/dist/lib/smart-switch.d.ts +44 -0
- package/dist/lib/smart-switch.d.ts.map +1 -0
- package/dist/lib/smart-switch.js +145 -0
- package/dist/lib/smart-switch.js.map +1 -0
- package/dist/lib/verdict.d.ts +9 -0
- package/dist/lib/verdict.d.ts.map +1 -0
- package/dist/lib/verdict.js +52 -0
- package/dist/lib/verdict.js.map +1 -0
- package/dist/lib/workflow.d.ts +85 -0
- package/dist/lib/workflow.d.ts.map +1 -0
- package/dist/lib/workflow.js +116 -0
- package/dist/lib/workflow.js.map +1 -0
- package/dist/reviewers/address.d.ts +5 -0
- package/dist/reviewers/address.d.ts.map +1 -0
- package/dist/reviewers/address.js +87 -0
- package/dist/reviewers/address.js.map +1 -0
- package/dist/reviewers/claude.d.ts +12 -0
- package/dist/reviewers/claude.d.ts.map +1 -0
- package/dist/reviewers/claude.js +78 -0
- package/dist/reviewers/claude.js.map +1 -0
- package/dist/reviewers/codex.d.ts +9 -0
- package/dist/reviewers/codex.d.ts.map +1 -0
- package/dist/reviewers/codex.js +121 -0
- package/dist/reviewers/codex.js.map +1 -0
- package/dist/reviewers/conflict-resolve.d.ts +15 -0
- package/dist/reviewers/conflict-resolve.d.ts.map +1 -0
- package/dist/reviewers/conflict-resolve.js +219 -0
- package/dist/reviewers/conflict-resolve.js.map +1 -0
- package/dist/reviewers/fix.d.ts +7 -0
- package/dist/reviewers/fix.d.ts.map +1 -0
- package/dist/reviewers/fix.js +197 -0
- package/dist/reviewers/fix.js.map +1 -0
- package/get-started.md +1271 -0
- package/get-started.zh.md +1208 -0
- package/package.json +75 -0
package/AGENT.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# AGENT.md — crosscheck optimize harness
|
|
2
|
+
|
|
3
|
+
You are improving crosscheck's AI code review instructions. crosscheck runs `codex` and
|
|
4
|
+
`claude` CLIs to review pull requests automatically. Both reviewers read
|
|
5
|
+
`~/.crosscheck/instructions.md` before every review. Your job is to read the diagnostic
|
|
6
|
+
report below and produce an improved `instructions.md` that increases review quality and
|
|
7
|
+
reduces failures.
|
|
8
|
+
|
|
9
|
+
> **Note:** `crosscheck optimize` selects which agent runs you based on your local config
|
|
10
|
+
> and log history — whichever reviewer has the highest success rate, or `claude` if there
|
|
11
|
+
> is no data. The instructions you produce are reviewer-agnostic: they are read by both
|
|
12
|
+
> `claude` and `codex`, so write in plain language that both understand.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Input you will receive
|
|
17
|
+
|
|
18
|
+
1. **Diagnostic JSON** from `crosscheck diagnose --json` — error patterns, review outcomes,
|
|
19
|
+
repos seen, language signals, and suggestions.
|
|
20
|
+
2. **Current `instructions.md`** — may be empty on first run.
|
|
21
|
+
|
|
22
|
+
## Output you must produce
|
|
23
|
+
|
|
24
|
+
Respond with only the new content of `instructions.md`. No explanation, no preamble, no
|
|
25
|
+
markdown fences — just the file content. The file uses plain Markdown.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Required sections (always present)
|
|
30
|
+
|
|
31
|
+
### `## Constraints`
|
|
32
|
+
What reviewers must NOT do. Each constraint is one bullet:
|
|
33
|
+
```
|
|
34
|
+
- Do not run [specific command].
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### `## Focus`
|
|
38
|
+
What reviewers should prioritize. Free-form prose or bullets.
|
|
39
|
+
|
|
40
|
+
### `## Verdict format` (never modify this section)
|
|
41
|
+
This section must always be preserved exactly as written in the current file. If it is
|
|
42
|
+
missing from the current file, add it verbatim:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## Verdict format
|
|
46
|
+
|
|
47
|
+
On the very last line of your response, write exactly one of:
|
|
48
|
+
|
|
49
|
+
VERDICT: APPROVE
|
|
50
|
+
VERDICT: NEEDS WORK
|
|
51
|
+
VERDICT: BLOCK
|
|
52
|
+
|
|
53
|
+
Use APPROVE for no issues or trivial nits only.
|
|
54
|
+
Use NEEDS WORK for addressable issues that are not blocking.
|
|
55
|
+
Use BLOCK for security risks, data loss, broken API contracts, or correctness bugs.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Rules for the `## Constraints` section
|
|
61
|
+
|
|
62
|
+
### Add a constraint when
|
|
63
|
+
- `diagnostic.errors` contains a `command_not_found` pattern with `count >= 1` for a
|
|
64
|
+
specific command.
|
|
65
|
+
- `diagnostic.errors` contains a `timeout` pattern with `count >= 2` for a reviewer that
|
|
66
|
+
is also producing `command_not_found` entries (likely spinning on a failed tool call).
|
|
67
|
+
|
|
68
|
+
### Remove a constraint when
|
|
69
|
+
- It was previously added for a specific command but that command no longer appears in
|
|
70
|
+
`diagnostic.errors` and has not appeared for the full log period analyzed.
|
|
71
|
+
|
|
72
|
+
### Phrasing rules
|
|
73
|
+
- Use the exact command name, not a category. Write `Do not run tsc.` not `Do not run
|
|
74
|
+
TypeScript build tools.`
|
|
75
|
+
- One command per bullet. Do not combine: `Do not run tsc or npm.` → split into two.
|
|
76
|
+
- Do not restrict reading. `Do not open package.json` is wrong. Constraints are for
|
|
77
|
+
execution only.
|
|
78
|
+
- Do not restrict security analysis. Never add a constraint that would prevent a reviewer
|
|
79
|
+
from flagging a vulnerability.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Language detection → constraint mapping
|
|
84
|
+
|
|
85
|
+
Use `diagnostic.languages_detected` (list of detected language/tool identifiers) to seed
|
|
86
|
+
the initial constraints. Add the corresponding constraint only if the language is detected
|
|
87
|
+
AND a related `command_not_found` error is present OR this is the first run with no
|
|
88
|
+
existing constraints.
|
|
89
|
+
|
|
90
|
+
| Detected signal | Constraint to add |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `typescript` / `tsconfig.json` / `package.json` | `Do not run tsc.` |
|
|
93
|
+
| `nodejs` / `package.json` | `Do not run npm, npx, yarn, or pnpm.` |
|
|
94
|
+
| `jest` / `vitest` in devDependencies | `Do not run jest or vitest.` |
|
|
95
|
+
| `python` / `requirements.txt` / `pyproject.toml` | `Do not run pytest, pip, or python scripts.` |
|
|
96
|
+
| `rust` / `Cargo.toml` | `Do not run cargo build or cargo test.` |
|
|
97
|
+
| `go` / `go.mod` | `Do not run go build or go test.` |
|
|
98
|
+
| `java` / `pom.xml` | `Do not run mvn.` |
|
|
99
|
+
| `kotlin` / `gradle` / `build.gradle` | `Do not run gradle.` |
|
|
100
|
+
| `ruby` / `Gemfile` | `Do not run bundle exec or rspec.` |
|
|
101
|
+
|
|
102
|
+
Do not add constraints for languages not detected. Do not add all of the above blindly.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Rules for the `## Focus` section
|
|
107
|
+
|
|
108
|
+
### Update focus when
|
|
109
|
+
- `diagnostic.verdict_distribution.APPROVE` percentage > 80% across >= 10 reviews → reviews
|
|
110
|
+
may be too lenient → add: "Apply strict scrutiny to error handling and edge cases."
|
|
111
|
+
- `diagnostic.verdict_distribution.BLOCK` percentage > 30% across >= 10 reviews → reviews
|
|
112
|
+
may be too strict → add: "Prefer NEEDS WORK over BLOCK unless the issue causes data loss
|
|
113
|
+
or a security vulnerability."
|
|
114
|
+
- `diagnostic.repos_seen` consistently includes infrastructure repos (name contains
|
|
115
|
+
`-infra`, `-deploy`, `-k8s`) → add: "Pay extra attention to secrets, env vars, and IAM
|
|
116
|
+
permissions in infrastructure changes."
|
|
117
|
+
|
|
118
|
+
### Default focus (use when no signals override it)
|
|
119
|
+
```markdown
|
|
120
|
+
## Focus
|
|
121
|
+
|
|
122
|
+
Review for correctness, security, and maintainability. Flag issues that would cause bugs
|
|
123
|
+
in production, expose sensitive data, or make the code significantly harder to maintain.
|
|
124
|
+
Nits and style preferences should be NEEDS WORK, not BLOCK.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Quality principles
|
|
130
|
+
|
|
131
|
+
1. **Minimal** — fewer instructions produce better reviews. Each line must earn its place.
|
|
132
|
+
2. **Specific** — exact command names, concrete criteria, not vague categories.
|
|
133
|
+
3. **Evidence-based** — add only what the diagnostic shows is needed or what language
|
|
134
|
+
detection justifies.
|
|
135
|
+
4. **Reversible** — stale constraints (no matching errors in the log period) should be
|
|
136
|
+
removed, not accumulated.
|
|
137
|
+
5. **Reviewer-agnostic** — these instructions are read by both `codex` and `claude`. Write
|
|
138
|
+
them in plain language that both understand.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## What must never change
|
|
143
|
+
|
|
144
|
+
- The `## Verdict format` section content and label.
|
|
145
|
+
- Instructions that the user has manually annotated with `<!-- keep -->`.
|
|
146
|
+
- The overall Markdown structure (## headings, bullet lists).
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Worked example
|
|
151
|
+
|
|
152
|
+
### Input diagnostic (excerpt)
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"summary": { "total_reviews": 6, "successful": 3, "failed": 3, "failure_rate": 0.5 },
|
|
156
|
+
"errors": [
|
|
157
|
+
{ "pattern": "command_not_found", "command": "tsc", "count": 2, "reviewer": "codex" },
|
|
158
|
+
{ "pattern": "command_not_found", "command": "jest", "count": 1, "reviewer": "codex" },
|
|
159
|
+
{ "pattern": "base_branch_missing", "branch": "staging", "count": 2 }
|
|
160
|
+
],
|
|
161
|
+
"verdict_distribution": { "APPROVE": 2, "NEEDS_WORK": 1, "BLOCK": 0 },
|
|
162
|
+
"languages_detected": ["typescript", "nodejs"],
|
|
163
|
+
"suggestions": [
|
|
164
|
+
{ "type": "add_constraint", "instruction": "Do not run tsc.", "reason": "tsc not found ×2" },
|
|
165
|
+
{ "type": "add_constraint", "instruction": "Do not run jest.", "reason": "jest not found ×1" }
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Input current instructions.md
|
|
171
|
+
```markdown
|
|
172
|
+
## Verdict format
|
|
173
|
+
|
|
174
|
+
On the very last line of your response, write exactly one of:
|
|
175
|
+
...
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Correct output
|
|
179
|
+
```markdown
|
|
180
|
+
## Constraints
|
|
181
|
+
|
|
182
|
+
- Do not run tsc.
|
|
183
|
+
- Do not run jest.
|
|
184
|
+
- Do not run npm, npx, yarn, or pnpm.
|
|
185
|
+
|
|
186
|
+
## Focus
|
|
187
|
+
|
|
188
|
+
Review for correctness, security, and maintainability. Flag issues that would cause bugs
|
|
189
|
+
in production, expose sensitive data, or make the code significantly harder to maintain.
|
|
190
|
+
Nits and style preferences should be NEEDS WORK, not BLOCK.
|
|
191
|
+
|
|
192
|
+
## Verdict format
|
|
193
|
+
|
|
194
|
+
On the very last line of your response, write exactly one of:
|
|
195
|
+
|
|
196
|
+
VERDICT: APPROVE
|
|
197
|
+
VERDICT: NEEDS WORK
|
|
198
|
+
VERDICT: BLOCK
|
|
199
|
+
|
|
200
|
+
Use APPROVE for no issues or trivial nits only.
|
|
201
|
+
Use NEEDS WORK for addressable issues that are not blocking.
|
|
202
|
+
Use BLOCK for security risks, data loss, broken API contracts, or correctness bugs.
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Note: `Do not run npm, npx, yarn, or pnpm.` was added because `nodejs` was detected, even
|
|
206
|
+
though no npm error appeared yet — this is the language-detection pre-emptive path for
|
|
207
|
+
first-run seeding.
|
package/ISSUE.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# ISSUE.md — crosscheck issue analysis harness
|
|
2
|
+
|
|
3
|
+
You are analyzing `~/.crosscheck/logs/*.ndjson` to find bugs and improvement opportunities
|
|
4
|
+
in the crosscheck project and draft GitHub issues for `Motivation-Labs/crosscheck`.
|
|
5
|
+
|
|
6
|
+
Your job is to surface patterns that a simple error-count approach would miss: session
|
|
7
|
+
instability, tunnel failure modes, process crash loops, and reliability regressions.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Log schema
|
|
12
|
+
|
|
13
|
+
Each line in a `.ndjson` file is one JSON event with at minimum:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
{ "ts": "<ISO-8601 UTC>", "level": "info|warn|error", "event": "<name>", ...fields }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Events that matter most
|
|
20
|
+
|
|
21
|
+
| Event | Key fields | Meaning |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `session_start` | `command` | A new watch/serve process started |
|
|
24
|
+
| `session_end` | — | Process exited cleanly (graceful shutdown) |
|
|
25
|
+
| `tunnel_opened` | `url` | Tunnel is live; url is `lhr.life` or `smee.io` |
|
|
26
|
+
| `tunnel_closed` | `reconnecting: bool` | Tunnel dropped; reconnecting if true |
|
|
27
|
+
| `tunnel_error` | `message` | SSH failure; message contains "did not start within" (timeout) or "exit (code 255)" (hard exit) |
|
|
28
|
+
| `webhook_registered` | `repo` | Webhook confirmed active |
|
|
29
|
+
| `webhook_register_retry` | — | Webhook registration retrying |
|
|
30
|
+
| `webhook_error` | `message` | Webhook registration failed |
|
|
31
|
+
| `pr_received` | `repo`, `pr` | Incoming PR event |
|
|
32
|
+
| `review_started` | `reviewer`, `pr` | Review agent invoked |
|
|
33
|
+
| `review_complete` | `verdict`, `duration_ms` | Review finished |
|
|
34
|
+
| `verdict_parse_failed` | — | Agent output did not contain a parseable VERDICT line |
|
|
35
|
+
| `error` | `message` | Any runtime error |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## How to compute sessions
|
|
40
|
+
|
|
41
|
+
Split all log entries on `session_start` events. Each session is the slice of events
|
|
42
|
+
from one `session_start` up to (but not including) the next `session_start`.
|
|
43
|
+
|
|
44
|
+
For each session compute:
|
|
45
|
+
|
|
46
|
+
| Field | How |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `duration_min` | `(last_event.ts - session_start.ts)` in minutes |
|
|
49
|
+
| `clean_exit` | Session contains a `session_end` event |
|
|
50
|
+
| `tunnel_opened` | Any `tunnel_opened` event present |
|
|
51
|
+
| `tunnel_type` | `"lhr.life"` / `"smee.io"` / `"none"` from tunnel url |
|
|
52
|
+
| `tunnel_error_count` | Count of `tunnel_error` events |
|
|
53
|
+
| `ssh_timeout_count` | `tunnel_error` where message contains `"did not start within"` |
|
|
54
|
+
| `ssh_255_count` | `tunnel_error` where message contains `"255"` |
|
|
55
|
+
| `reconnect_count` | `tunnel_closed` events where `reconnecting: true` |
|
|
56
|
+
| `webhook_registered` | Any `webhook_registered` event present |
|
|
57
|
+
| `pr_received` | Any `pr_received` event present |
|
|
58
|
+
| `review_completed` | Any `review_complete` event present |
|
|
59
|
+
| `error_count` | Events where `level == "error"` |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Analysis 1 — Session stability
|
|
64
|
+
|
|
65
|
+
Compute per-session stats and then aggregate.
|
|
66
|
+
|
|
67
|
+
**Aggregate metrics to report:**
|
|
68
|
+
- Total sessions, total days covered
|
|
69
|
+
- Average / median session lifespan (minutes)
|
|
70
|
+
- % sessions with clean exit (`session_end` present)
|
|
71
|
+
- % sessions where tunnel never opened
|
|
72
|
+
- % sessions where webhook was never registered
|
|
73
|
+
- Longest and shortest session
|
|
74
|
+
|
|
75
|
+
**Thresholds that indicate a reportable problem:**
|
|
76
|
+
|
|
77
|
+
| Condition | Severity | Report type |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| avg session lifespan < 15 min across any single day | high | bug |
|
|
80
|
+
| > 40% of sessions never reach `tunnel_opened` | high | bug |
|
|
81
|
+
| > 50% of sessions have no `session_end` (abrupt death) | medium | improvement |
|
|
82
|
+
| ≥ 5 sessions in any 90-minute window all under 5 min | high | bug — rapid restart loop |
|
|
83
|
+
| > 30% of sessions have no `webhook_registered` | medium | improvement |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Analysis 2 — Tunnel reliability
|
|
88
|
+
|
|
89
|
+
**Aggregate metrics:**
|
|
90
|
+
- Count of `tunnel_opened`, `tunnel_closed`, `tunnel_error` across all sessions
|
|
91
|
+
- SSH timeout count vs SSH code-255 count (from `tunnel_error` messages)
|
|
92
|
+
- Reconnect rate: `reconnect_count / tunnel_closed_count`
|
|
93
|
+
- Terminal close rate: `tunnel_closed` where `reconnecting: false`
|
|
94
|
+
- % of sessions that never reached `tunnel_opened`
|
|
95
|
+
|
|
96
|
+
**Key insight to encode:** Sessions that accumulate many tunnel errors and reconnects
|
|
97
|
+
can still survive long — the reconnect logic is working. The real kill signal is
|
|
98
|
+
`tunnel_opened == false`, not high `tunnel_error_count`.
|
|
99
|
+
|
|
100
|
+
**Thresholds:**
|
|
101
|
+
|
|
102
|
+
| Condition | Severity | Report type |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| SSH timeout rate > 60% of tunnel errors | high | bug — connectivity or lhr.life instability |
|
|
105
|
+
| SSH code-255 rate > 20% of tunnel errors | high | bug — SSH process crash |
|
|
106
|
+
| Terminal close rate > 30% of tunnel closes | high | bug — tunnel not recovering |
|
|
107
|
+
| > 40% sessions never open a tunnel | high | bug |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Analysis 3 — Process health (crash loops)
|
|
112
|
+
|
|
113
|
+
This is distinct from tunnel failure. A process crash loop has these signatures:
|
|
114
|
+
- Rapid session restarts (≥ 5 sessions in 90 minutes)
|
|
115
|
+
- Sessions dying before `tunnel_opened` with **zero** tunnel errors
|
|
116
|
+
- `error` events containing `gh repo clone`, `Command failed`, or `ENOENT`
|
|
117
|
+
- Sessions with normal `tunnel_error_count` but very short lifespan
|
|
118
|
+
|
|
119
|
+
**What to look for:**
|
|
120
|
+
- Cluster rapid-restart windows: sessions where `duration_min < 5` AND `tunnel_opened == false`
|
|
121
|
+
AND `tunnel_error_count == 0`. These are process crashes, not connectivity failures.
|
|
122
|
+
- Extract the `error` event messages from those sessions to identify the root cause.
|
|
123
|
+
- Check if `verdict_parse_failed` or `webhook_error` events appear in the final 60 seconds
|
|
124
|
+
of abrupt-death sessions — these indicate the review or webhook path is triggering exits.
|
|
125
|
+
|
|
126
|
+
**Thresholds:**
|
|
127
|
+
|
|
128
|
+
| Condition | Severity | Report type |
|
|
129
|
+
|---|---|---|
|
|
130
|
+
| ≥ 5 sessions: duration < 5 min AND tunnel_opened=false AND tunnel_errors=0 | critical | bug — startup crash loop |
|
|
131
|
+
| `gh repo clone` in any error message | high | bug — clone failure |
|
|
132
|
+
| `verdict_parse_failed` in final 60s of > 20% abrupt-death sessions | medium | improvement — VERDICT format reliability |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## The two failure modes (always distinguish these in your report)
|
|
137
|
+
|
|
138
|
+
**Mode A — Tunnel failure:** Sessions die because SSH connectivity fails and the tunnel
|
|
139
|
+
never comes up. Signals: `ssh_timeout_count > 0` OR `ssh_255_count > 0` in failed sessions.
|
|
140
|
+
Root cause: network, lhr.life instability, or SSH configuration.
|
|
141
|
+
|
|
142
|
+
**Mode B — Process crash:** Sessions die fast with zero tunnel errors. The process exits
|
|
143
|
+
before even attempting a tunnel. Signals: `duration_min < 3`, `tunnel_opened = false`,
|
|
144
|
+
`tunnel_error_count = 0`, error messages about `gh`, `clone`, `ENOENT`, or similar.
|
|
145
|
+
Root cause: code bug, missing dependency, bad config, or file system issue.
|
|
146
|
+
|
|
147
|
+
Never combine these two modes in a single issue. They have different root causes and
|
|
148
|
+
different fixes.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Improvement opportunities (not bugs)
|
|
153
|
+
|
|
154
|
+
File an improvement issue when the system is working but data shows a reliability gap:
|
|
155
|
+
|
|
156
|
+
| Pattern | Issue title pattern | Label |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| avg session lifespan 15–30 min (should be hours) | `watch: improve session longevity — avg Xmin` | `improvement` |
|
|
159
|
+
| smee.io has 0 tunnel errors but lhr.life does not | `watch: add smee.io as automatic tunnel fallback` | `improvement` |
|
|
160
|
+
| Reconnect works but adds latency | `tunnel: reduce reconnect gap when lhr.life drops` | `improvement` |
|
|
161
|
+
| `webhook_registered` strongly predicts session survival | `watch: surface webhook status earlier in startup sequence` | `improvement` |
|
|
162
|
+
| `verdict_parse_failed` events in logs | `review: harden VERDICT line parsing — N parse failures found` | `improvement` |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Output format
|
|
167
|
+
|
|
168
|
+
For each issue you file, output exactly:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
TITLE: <concise title under 80 characters>
|
|
172
|
+
LABELS: <comma-separated: bug, improvement, priority:high, priority:low>
|
|
173
|
+
---
|
|
174
|
+
<GitHub-flavored markdown body>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Required body sections
|
|
178
|
+
|
|
179
|
+
**For bugs:**
|
|
180
|
+
```markdown
|
|
181
|
+
## Summary
|
|
182
|
+
One paragraph describing the failure pattern and impact on the user.
|
|
183
|
+
|
|
184
|
+
## Evidence from logs
|
|
185
|
+
Exact metrics from your analysis (counts, percentages, session table if relevant).
|
|
186
|
+
Use a code block for representative raw log entries — sanitize any PII or tokens.
|
|
187
|
+
|
|
188
|
+
## Failure mode
|
|
189
|
+
State clearly: Mode A (tunnel failure) or Mode B (process crash), and why.
|
|
190
|
+
|
|
191
|
+
## Reproduction signals
|
|
192
|
+
What log patterns indicate this bug is active. How to check if it's happening.
|
|
193
|
+
|
|
194
|
+
## Suggested fix direction
|
|
195
|
+
One sentence on where in the codebase to look. Do not prescribe the implementation.
|
|
196
|
+
|
|
197
|
+
## Environment
|
|
198
|
+
crosscheck version (from log entries if present), platform, date range analyzed.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**For improvements:**
|
|
202
|
+
```markdown
|
|
203
|
+
## Summary
|
|
204
|
+
One paragraph describing the opportunity and expected benefit.
|
|
205
|
+
|
|
206
|
+
## Evidence from logs
|
|
207
|
+
The metrics that surfaced this opportunity.
|
|
208
|
+
|
|
209
|
+
## Current behavior vs desired behavior
|
|
210
|
+
Two-line contrast: what happens now, what should happen instead.
|
|
211
|
+
|
|
212
|
+
## Suggested approach
|
|
213
|
+
One paragraph, high level. Do not write code.
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## What NOT to report
|
|
219
|
+
|
|
220
|
+
- Single-occurrence errors with no clear pattern
|
|
221
|
+
- Events that are expected (e.g., one `tunnel_closed` followed immediately by `tunnel_opened`)
|
|
222
|
+
- Issues already covered by an existing `crosscheck diagnose` error pattern
|
|
223
|
+
(`command_not_found`, `base_branch_missing`, `timeout`, `auth_failure`)
|
|
224
|
+
- Anything requiring access to source code you were not given — stay in the log data
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Prioritization
|
|
229
|
+
|
|
230
|
+
If you find multiple issues, report them in this order:
|
|
231
|
+
1. Startup crash loops (Mode B, critical) — they prevent any work from happening
|
|
232
|
+
2. Tunnel-never-opens rate > 40% (Mode A, high) — degrades session reliability
|
|
233
|
+
3. Short average session lifespan (< 15 min/day) — signals chronic instability
|
|
234
|
+
4. Improvement opportunities — after bugs are covered
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025–2026 Motivation Labs LLC.
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<div align="right">
|
|
2
|
+
<h5><a href="./README.zh.md">🌏 中文</a></h5>
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="./assets/logo.png" alt="crosscheck" width="160" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center"><em>Building crosscheck with crosscheck.</em></p>
|
|
10
|
+
|
|
11
|
+
# crosscheck
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="./assets/screenshot-watch.png" alt="crosscheck watch — live pipeline view" width="860" />
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
**Auto Code Review Pipeline — customizable PR → Review → Fix → Recheck loop, single-vendor or cross-vendor, zero new infrastructure.**
|
|
18
|
+
|
|
19
|
+
Define the review pipeline in `workflow.yml`: review-only, review + fix, or the full review + fix + recheck cycle. Each step runs through the `claude` or `codex` CLI against your existing subscriptions — no API keys, no per-review cost.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# 1. Install crosscheck and the agent CLIs
|
|
27
|
+
npm install -g @humanbased/crosscheck
|
|
28
|
+
npm install -g @anthropic-ai/claude-code && claude # Claude Pro/Max subscription
|
|
29
|
+
npm install -g @openai/codex && codex login --device-auth # ChatGPT Plus/Pro subscription
|
|
30
|
+
brew install gh && gh auth login # GitHub CLI
|
|
31
|
+
|
|
32
|
+
# 2. Guided setup — repos, review mode, workflow pipeline
|
|
33
|
+
crosscheck onboard
|
|
34
|
+
|
|
35
|
+
# 3. Start watching
|
|
36
|
+
crosscheck watch # personal laptop
|
|
37
|
+
crosscheck serve # always-on team server
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Commands
|
|
43
|
+
|
|
44
|
+
### `crosscheck onboard`
|
|
45
|
+
|
|
46
|
+
Interactive setup wizard. Picks repos/orgs to monitor, selects single-vendor or cross-vendor mode, configures the review pipeline, and writes `~/.crosscheck/config.yml` and `workflow.yml`.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
crosscheck onboard # guided setup
|
|
50
|
+
crosscheck onboard --personal # skip persona prompt, go straight to personal mode
|
|
51
|
+
crosscheck onboard --team # skip persona prompt, go straight to team mode
|
|
52
|
+
crosscheck onboard -y # accept all defaults non-interactively
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### `crosscheck watch`
|
|
58
|
+
|
|
59
|
+
Personal mode. Starts an SSH tunnel (localhost.run), registers GitHub webhooks, and listens for PR events. Everything self-cleans on Ctrl+C.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
crosscheck watch
|
|
63
|
+
crosscheck watch --no-backtrace # skip startup scan for unreviewed open PRs
|
|
64
|
+
crosscheck watch --reconfigure # re-run deployment setup before starting
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### `crosscheck serve`
|
|
70
|
+
|
|
71
|
+
Team mode. Binds to a fixed port — register the webhook once, cover the whole team. Designed for a mac-mini or home server.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
crosscheck serve
|
|
75
|
+
crosscheck serve --no-backtrace # skip startup scan
|
|
76
|
+
crosscheck serve --personal # personal scope this session only
|
|
77
|
+
crosscheck serve --reconfigure # re-run deployment setup
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### `crosscheck review <pr-url>`
|
|
83
|
+
|
|
84
|
+
One-shot review of a single PR. Clones, checks out, reviews, and posts the comment.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
crosscheck review https://github.com/org/repo/pull/42
|
|
88
|
+
crosscheck review <pr-url> --reviewer claude # force Claude regardless of detection
|
|
89
|
+
crosscheck review <pr-url> --reviewer codex # force Codex regardless of detection
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### `crosscheck run <pr-url>`
|
|
95
|
+
|
|
96
|
+
Runs the full configured workflow against one PR: review → fix → recheck. Same logic as `watch`/`serve`, but triggered manually.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
crosscheck run <pr-url>
|
|
100
|
+
crosscheck run <pr-url> --steps review # only the review step
|
|
101
|
+
crosscheck run <pr-url> --steps fix,recheck # skip initial review
|
|
102
|
+
crosscheck run <pr-url> --reviewer claude # override reviewer assignment
|
|
103
|
+
crosscheck run <pr-url> --dry-run # review without posting or fixing
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### `crosscheck scan`
|
|
109
|
+
|
|
110
|
+
Scans every open PR in the configured monitor scope and reports where each one is in the crosscheck workflow. Results are cached for 60 seconds.
|
|
111
|
+
|
|
112
|
+
States: `PR` (needs review) · `APPROVE` · `NEEDS_WORK` · `BLOCK` · `RECHECK` (fix applied, needs recheck)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
crosscheck scan # all open PRs, grouped stale/not-stale
|
|
116
|
+
crosscheck scan --tidy # stale actionable rows only
|
|
117
|
+
crosscheck scan --stale-after 4h # custom staleness threshold (default 24h)
|
|
118
|
+
crosscheck scan --force # bypass cache
|
|
119
|
+
crosscheck scan --json # machine-readable output
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### `crosscheck kickass`
|
|
125
|
+
|
|
126
|
+
Selects stale PRs from the operator queue and advances them — runs `scan` first, presents a multi-select picker, shows a preflight summary, then executes after confirmation.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
crosscheck kickass # interactive operator queue
|
|
130
|
+
crosscheck kickass --dry-run # preflight only — no mutations
|
|
131
|
+
crosscheck kickass --stale-after 2h # tighter staleness threshold
|
|
132
|
+
crosscheck kickass --force # bypass scan cache before picking
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Actions: `PR → CR` · `NEEDS_WORK/BLOCK → Fix` · `FIX/RECHECK → Recheck` · `APPROVE → Merge`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Configuration
|
|
140
|
+
|
|
141
|
+
### Review depth (`quality.tier`)
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
# crosscheck.config.yml
|
|
145
|
+
quality:
|
|
146
|
+
tier: balanced # fast | balanced | thorough
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
| Tier | Claude model | Codex model | Latency |
|
|
150
|
+
|---|---|---|---|
|
|
151
|
+
| `fast` | Haiku | default | ~10s |
|
|
152
|
+
| `balanced` | Sonnet (default) | default | ~30s |
|
|
153
|
+
| `thorough` | Opus | default | ~60s |
|
|
154
|
+
|
|
155
|
+
### Pipeline (`workflow.yml`)
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
steps:
|
|
159
|
+
- name: review
|
|
160
|
+
type: review
|
|
161
|
+
reviewer: auto # auto | claude | codex | origin
|
|
162
|
+
|
|
163
|
+
- name: fix
|
|
164
|
+
type: fix
|
|
165
|
+
reviewer: origin
|
|
166
|
+
when: review.verdict != 'APPROVE'
|
|
167
|
+
|
|
168
|
+
- name: recheck
|
|
169
|
+
type: recheck
|
|
170
|
+
reviewer: auto
|
|
171
|
+
when: fix.applied_count > 0
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Config snapshot
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
# ~/.crosscheck/config.yml
|
|
178
|
+
orgs:
|
|
179
|
+
- your-org
|
|
180
|
+
|
|
181
|
+
routing:
|
|
182
|
+
allowed_authors:
|
|
183
|
+
- your-github-login
|
|
184
|
+
|
|
185
|
+
mode: cross-vendor # cross-vendor | single-vendor
|
|
186
|
+
|
|
187
|
+
vendors:
|
|
188
|
+
claude:
|
|
189
|
+
enabled: true
|
|
190
|
+
codex:
|
|
191
|
+
enabled: true
|
|
192
|
+
|
|
193
|
+
quality:
|
|
194
|
+
tier: balanced
|
|
195
|
+
|
|
196
|
+
clone_protocol: ssh # ssh (default) | https
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Full reference: [get-started.md](./get-started.md)
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Requirements
|
|
204
|
+
|
|
205
|
+
| | Minimum |
|
|
206
|
+
|---|---|
|
|
207
|
+
| Node.js | 18+ |
|
|
208
|
+
| Claude Code CLI | latest — `npm install -g @anthropic-ai/claude-code` |
|
|
209
|
+
| Codex CLI | latest — `npm install -g @openai/codex` |
|
|
210
|
+
| GitHub CLI | 2.65+ — `brew install gh` |
|
|
211
|
+
|
|
212
|
+
`GITHUB_TOKEN` is derived automatically from `gh auth login`. No manual export needed.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Documentation
|
|
217
|
+
|
|
218
|
+
| | |
|
|
219
|
+
|---|---|
|
|
220
|
+
| **[get-started.md](./get-started.md)** | Full setup guide — prerequisites, all flags, complete config reference, FAQ |
|
|
221
|
+
| **[crosscheck.config.example.yml](./crosscheck.config.example.yml)** | Annotated config with every option |
|
|
222
|
+
| **[CHANGELOG.md](./CHANGELOG.md)** | Release notes |
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Contributing
|
|
227
|
+
|
|
228
|
+
Issues and PRs welcome at [github.com/humanbased-ai/crosscheck](https://github.com/humanbased-ai/crosscheck).
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
[MIT](./LICENSE) — Copyright (c) 2025–2026 HumanBased AI.
|