@humanbased/crosscheck 1.2.0-beta.80 → 1.2.0-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +51 -5
  2. package/crosscheck.config.example.yml +39 -8
  3. package/dist/__tests__/board.test.js +11 -0
  4. package/dist/__tests__/board.test.js.map +1 -1
  5. package/dist/__tests__/onboard-preservation.test.js +54 -3
  6. package/dist/__tests__/onboard-preservation.test.js.map +1 -1
  7. package/dist/__tests__/review-strategy.test.js +202 -0
  8. package/dist/__tests__/review-strategy.test.js.map +1 -1
  9. package/dist/commands/onboard.d.ts +25 -3
  10. package/dist/commands/onboard.d.ts.map +1 -1
  11. package/dist/commands/onboard.js +151 -46
  12. package/dist/commands/onboard.js.map +1 -1
  13. package/dist/commands/run.d.ts.map +1 -1
  14. package/dist/commands/run.js +22 -4
  15. package/dist/commands/run.js.map +1 -1
  16. package/dist/commands/watch.d.ts.map +1 -1
  17. package/dist/commands/watch.js +38 -6
  18. package/dist/commands/watch.js.map +1 -1
  19. package/dist/config/review-strategy.json +8 -6
  20. package/dist/config/schema.d.ts +7 -5
  21. package/dist/config/schema.d.ts.map +1 -1
  22. package/dist/config/schema.js +29 -7
  23. package/dist/config/schema.js.map +1 -1
  24. package/dist/github/client.d.ts +16 -1
  25. package/dist/github/client.d.ts.map +1 -1
  26. package/dist/github/client.js +32 -1
  27. package/dist/github/client.js.map +1 -1
  28. package/dist/github/webhook.d.ts +4 -0
  29. package/dist/github/webhook.d.ts.map +1 -1
  30. package/dist/github/webhook.js.map +1 -1
  31. package/dist/lib/annotation.d.ts +7 -0
  32. package/dist/lib/annotation.d.ts.map +1 -1
  33. package/dist/lib/annotation.js +11 -1
  34. package/dist/lib/annotation.js.map +1 -1
  35. package/dist/lib/board.d.ts +3 -0
  36. package/dist/lib/board.d.ts.map +1 -1
  37. package/dist/lib/board.js +4 -2
  38. package/dist/lib/board.js.map +1 -1
  39. package/dist/lib/comment-bodies.d.ts +2 -0
  40. package/dist/lib/comment-bodies.d.ts.map +1 -1
  41. package/dist/lib/comment-bodies.js +5 -1
  42. package/dist/lib/comment-bodies.js.map +1 -1
  43. package/dist/lib/review-strategy.d.ts +34 -4
  44. package/dist/lib/review-strategy.d.ts.map +1 -1
  45. package/dist/lib/review-strategy.js +71 -24
  46. package/dist/lib/review-strategy.js.map +1 -1
  47. package/dist/lib/runner.d.ts +80 -0
  48. package/dist/lib/runner.d.ts.map +1 -1
  49. package/dist/lib/runner.js +289 -17
  50. package/dist/lib/runner.js.map +1 -1
  51. package/docs/dynamic-thoroughness.md +677 -225
  52. package/get-started.md +67 -6
  53. package/package.json +1 -1
package/get-started.md CHANGED
@@ -1119,7 +1119,8 @@ vendors:
1119
1119
 
1120
1120
  # ── Quality ───────────────────────────────────────────────────────────────────
1121
1121
  quality:
1122
- tier: balanced # fast | balanced | thorough
1122
+ mode: smart # smart (default) | fixed see Review thoroughness
1123
+ tier: balanced # fast | balanced | thorough (fallback under smart)
1123
1124
  focus: # narrows review scope (optional)
1124
1125
  - security
1125
1126
  - types
@@ -1267,13 +1268,73 @@ linear: # write review verdicts back to a Linear issue (op
1267
1268
  team_keys: [] # e.g. [IN] — required to match bare refs like IN-42
1268
1269
  ```
1269
1270
 
1271
+ ### Review thoroughness
1272
+
1273
+ **`quality.mode: smart` is the default.** Crosscheck classifies each PR from its
1274
+ changed-file list and adjusts model and effort to match, rather than applying one
1275
+ tier to everything. Classification runs on the already-cloned working copy, so it
1276
+ costs one `git diff` and no API call. Set `mode: fixed` to opt out.
1277
+
1278
+ | # | PR class | Detected by | Tier | Steps |
1279
+ |---|---|---|---|---|
1280
+ | 1 | Generated / vendored | every file is a lockfile or build output | — | **PR skipped** |
1281
+ | 2 | Security / data-critical | auth, crypto, payment, migration paths; `risk:T3`; hotfix→default | `thorough` | full loop |
1282
+ | 3 | Deletion-only | ≤ 5 additions with ≥ 20 deletions | `fast` | review |
1283
+ | 4 | Docs / spec | ≥ 50% Markdown | `balanced` | review |
1284
+ | 5 | Test-only | every file is a test | `fast` | review, fix |
1285
+ | 6 | Config / infra | ≥ 50% config, no source | `balanced` | full loop |
1286
+ | 7 | Trivial | ≤ 3 files, ≤ 150 lines | `fast` | review, fix |
1287
+ | 8 | Standard | everything else | `balanced` | full loop |
1288
+
1289
+ First match wins, and security sits second so it dominates every cheapening rule
1290
+ below it — a deletion that removes auth code, or a two-file migration, is never
1291
+ routed to `fast`.
1292
+
1293
+ The class's step set narrows the configured pipeline and never widens it, so a
1294
+ repo pinned to review-only with `crosscheck alter` stays review-only. Rounds past
1295
+ the first escalate on measured non-convergence: effort rises where the model
1296
+ supports it, the tier is promoted where it does not.
1297
+
1298
+ Note that classes 3 and 4 narrow to `review` alone, which also drops
1299
+ `conflict-resolve` — review-only never touches code, and auto-conflict-resolve
1300
+ is code modification. That rule normally follows an operator's explicit
1301
+ `crosscheck alter --review-only`; under smart mode the *classifier* can reach it
1302
+ too, so a docs-only or deletion-only PR with a merge conflict is reviewed but not
1303
+ auto-resolved. Set `mode: fixed` if you want auto-conflict-resolve on every PR.
1304
+
1305
+ Every comment cites the policy that produced it:
1306
+
1307
+ ```
1308
+ <!-- crosscheck: … verdict=BLOCK strategy=1.1.0 class=risky tier=thorough … -->
1309
+ ```
1310
+
1311
+ > **Leave `vendors.*.model` unset under smart mode.** An explicit model outranks
1312
+ > the strategy, so pinning one makes per-PR selection a no-op. When that happens
1313
+ > crosscheck **withholds** the tier from the comment rather than citing one that
1314
+ > did not run. `crosscheck onboard` clears the pin — and prints what it cleared —
1315
+ > when you choose smart.
1316
+
1317
+ Verify the policy is current with `npm run verify:strategy`. Full rationale:
1318
+ [docs/dynamic-thoroughness.md](./docs/dynamic-thoroughness.md).
1319
+
1270
1320
  ### Quality tiers
1271
1321
 
1272
- | Tier | Speed | Depth | Best for |
1273
- |---|---|---|---|
1274
- | `fast` | ~10s | Top issues only | High-volume repos, draft PRs |
1275
- | `balanced` | ~30s | Full review, all issues explained | Default for most teams |
1276
- | `thorough` | ~60–90s | Deep multi-pass, architecture + security | Before merging to main |
1322
+ Under `fixed`, the tier applies to every call. Under `smart`, it is the fallback
1323
+ when a PR's file list cannot be read.
1324
+
1325
+ | Tier | Claude | Codex | Cost per review | Best for |
1326
+ |---|---|---|---|---|
1327
+ | `fast` | Haiku 4.5 | GPT-5.6 Luna | $0.24 · $0.06 | High-volume repos, draft PRs |
1328
+ | `balanced` | Sonnet 5 | GPT-5.6 Terra | $0.72 · $0.58 | Default for most teams |
1329
+ | `thorough` | Opus 5 | GPT-5.6 Sol | $1.20 · $1.44 | Before merging to main |
1330
+
1331
+ Cost is output-token cost at 48k output tokens, the measured median for one
1332
+ review. A review is an agentic session, not a single call — expect 10–16 minutes
1333
+ of wall clock (median 643s, p90 984s across 43 logged runs). Tier changes depth
1334
+ and the subprocess timeout, not seconds-scale latency.
1335
+
1336
+ `claude-fable-5` is banned from review: 2× Opus 5's price for a lower coding
1337
+ benchmark score.
1277
1338
 
1278
1339
  ### Issue enrichment
1279
1340
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanbased/crosscheck",
3
- "version": "1.2.0-beta.80",
3
+ "version": "1.2.0-beta.81",
4
4
  "description": "AI code review pipeline that turns agent-written PRs into merge-ready patches",
5
5
  "bin": {
6
6
  "crosscheck": "dist/cli.js",