@olegkoval/agent-skills 1.88.0 → 1.90.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.
Files changed (33) hide show
  1. package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +112 -20
  2. package/adapters/claude/olko-github-pr/skills/lekker-review/references/codex-workflow.md +12 -0
  3. package/adapters/claude/olko-github-pr/skills/lekker-review/references/github-post.md +3 -2
  4. package/adapters/claude/olko-github-pr/skills/lekker-review/references/output-format.md +23 -2
  5. package/adapters/claude/olko-github-pr/skills/lekker-review/references/traces.md +1 -1
  6. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/lekker-progress.mjs +106 -0
  7. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +152 -0
  8. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/run-log.mjs +27 -2
  9. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +1 -1
  10. package/package.json +1 -1
  11. package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
  12. package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
  13. package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
  14. package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
  15. package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
  16. package/plugins/olko-github-pr/skills/lekker-review/README.md +53 -0
  17. package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +112 -20
  18. package/plugins/olko-github-pr/skills/lekker-review/fix-workflow.js +21 -8
  19. package/plugins/olko-github-pr/skills/lekker-review/references/codex-workflow.md +12 -0
  20. package/plugins/olko-github-pr/skills/lekker-review/references/github-post.md +3 -2
  21. package/plugins/olko-github-pr/skills/lekker-review/references/output-format.md +23 -2
  22. package/plugins/olko-github-pr/skills/lekker-review/references/traces.md +1 -1
  23. package/plugins/olko-github-pr/skills/lekker-review/scripts/lekker-progress.mjs +106 -0
  24. package/plugins/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +152 -0
  25. package/plugins/olko-github-pr/skills/lekker-review/scripts/run-log.mjs +27 -2
  26. package/plugins/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +1 -1
  27. package/plugins/olko-github-pr/skills/lekker-review/workflow.js +79 -23
  28. package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
  29. package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
  30. package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
  31. package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
  32. package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
  33. package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
@@ -46,7 +46,7 @@ metadata:
46
46
  - multi-agent
47
47
  - workflow
48
48
  - quality
49
- argument-hint: "<github-pr-url | repo pr-number | repo pr-title | branch [ref]> [scan|medium|deep|deps] [--post] [--fix] [--base <ref>]"
49
+ argument-hint: "<github-pr-url | repo pr-number | repo pr-title | branch [ref]> [scan|medium|deep|deps] [--post] [--fix] [--base <ref>] [--risk routine|standard|elevated|critical] [--quiet-decisions]"
50
50
  ---
51
51
  <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
52
52
 
@@ -329,8 +329,30 @@ and gather the newly required Track B sources before Step 2. Branch mode uses
329
329
  Track A's merge-base diff. State final depth and whether auto-selected in the
330
330
  review header.
331
331
 
332
+ **Risk tier and model routing (every depth, after AUTO-DEPTH):** depth decides
333
+ how many agents run; the risk tier decides which model and effort each one
334
+ gets. Run `scripts/model-matrix.mjs` with the same shell-free process API as the
335
+ risk check, using `--host claude|codex` from Host selection, `--lines` as
336
+ additions+deletions without lockfiles, `--categories` as the comma-joined
337
+ `categories[].category` from the risk-paths output, and `--risk <tier>` only
338
+ when the user passed it:
339
+ `execFileSync('node', [matrixScript, '--host', HOST, '--lines', String(lines), '--categories', cats, '--', ...changedPaths])`.
340
+ Store the printed JSON as `ROUTING_RESULT` and its `routing` object as
341
+ `ROUTING`. State the tier in the review header:
342
+ `Risk tier: <tier> (<auto: reason | --risk>)`. On classifier failure, report
343
+ it in one line and leave `ROUTING` unset: every agent then keeps the
344
+ workflow's built-in default (`sonnet`, `haiku` for triage). The full matrix is in `README.md`
345
+ under "Models and effort".
346
+
347
+ **`--risk routine|standard|elevated|critical` flag:** parse and pass to
348
+ `model-matrix.mjs` as `--risk`. It overrides the detected tier, never the depth.
349
+
332
350
  **`--post` flag:** parse and store as `POST_REVIEW=true`.
333
351
 
352
+ **`--quiet-decisions` flag:** parse and store as `QUIET_DECISIONS=true`: the
353
+ saved review omits the `## 🧭 Decisions` block. The run log still records every
354
+ decision.
355
+
334
356
  **`--fix` flag:** parse and store as `FIX_MODE=true`. Fix mode needs a real
335
357
  checkout, so `--fix` forces Track A (worktree setup) to run even when
336
358
  depth=scan. If the user did NOT pass `--fix`, leave `FIX_MODE=false` for now -
@@ -431,6 +453,54 @@ at each step boundary: `context` (Step 1), `review` (Step 2), `synthesis`
431
453
  (Step 3), `fix` (Step 4), `post` (Step 5). A marker is one line of JSON; never
432
454
  skip the review because the log failed, just say `run log unavailable`.
433
455
 
456
+ **Record the first decisions.** Right after `start`, write the two decisions made
457
+ before the log existed, one call each (`what` is the value, `why` the rule that
458
+ picked it, a short phrase; `--why` is mandatory):
459
+
460
+ ```bash
461
+ node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RUN_ID> --kind depth --what <depth> --why "<AUTO-DEPTH rule | explicit>"
462
+ node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RUN_ID> --kind tier --what <tier> --why "<auto: reason | --risk>"
463
+ ```
464
+
465
+ `decide` accepts only the kinds `depth`, `tier`, `route`, `finding`, `fix` and
466
+ `post`, and rejects an empty `--what` or `--why`; a failed call is
467
+ `run log unavailable`, never a reason to stop.
468
+
469
+ ---
470
+
471
+ ## Progress line
472
+
473
+ At each milestone below, run
474
+ `node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/lekker-progress.mjs" --stage <stage> --message "<short fact>"`
475
+ (foreground, it returns in under a second; in Codex use the absolute path to
476
+ `scripts/lekker-progress.mjs` beside the selected `SKILL.md`). It prints one
477
+ status line (a boat drifting toward a lighthouse), animates only on a real
478
+ terminal, and always exits 0. It is decoration: run it after the milestone's own
479
+ output, never instead of it, and keep every count and reason in the report too.
480
+ Add `--ascii` on terminals that mis-measure emoji.
481
+
482
+ | Milestone | Stage | Message, e.g. |
483
+ | --- | --- | --- |
484
+ | Step 0 parsed the request | `start` | `owner/repo#42, medium, tier standard` |
485
+ | Step 1 context ready | `context` | `worktree ready, 4 sources` |
486
+ | Step 2 workflow started | `review` | `5 specialists + rules` |
487
+ | Step 2 verify began | `verify` | `verifying 6 findings` |
488
+ | Step 2 critic began (deep) | `critic` | `3 angles to re-examine` |
489
+ | Step 2 prove began | `prove` | `2 provers` |
490
+ | Step 3 review saved | `post` | `saved, 1 Critical, 2 Important` |
491
+ | Step 4 fixes applied | `fix` | `3 of 4 applied` |
492
+ | Step 5 posted | `post` | `5 inline comments, pending` |
493
+ | Run finished | `success` | `lgtm-with-changes, 1 Important` |
494
+ | Run failed or stopped | `failure` | `worktree setup failed` |
495
+
496
+ Every decision you write with `run-log.mjs decide` is also printed once, right
497
+ after it, with `--stage decision --message "<what>: <why>"`. That prints a
498
+ compass line without moving the boat, for example `verifier -> opus high:
499
+ elevated, migrations`, `dropped src/a.ts:12: not reachable from any caller`, or
500
+ `code smell kept as Idiomatic: duplicated tie-break, two copies disagree`. For
501
+ the workflow's bulk `decisions`, print the `route` entries as one line and each
502
+ `finding` entry on its own line.
503
+
434
504
  ---
435
505
 
436
506
  ## Depth gate
@@ -440,7 +510,7 @@ skip the review because the log failed, just say `run log unavailable`.
440
510
  | Context: issue-tracker/CI/diff/existing-reviews | always | always | always | always |
441
511
  | Context: chat/docs/framework-docs/monitoring/prior-review-memory (optional, MCP-dependent) | skip | skip | included | included + broader recall |
442
512
  | Worktree + static checks | included (`npm ci` per changed lockfile) | skip (WORKTREE_PATH=null) unless `--fix` | included | included |
443
- | Review agents | 1 deps checklist | 2 triage (haiku) + project-rules (sonnet) | 5 specialists + project-rules (sonnet) | 5 specialists + project-rules (sonnet) |
513
+ | Review agents (model and effort per risk tier, see README) | 1 deps checklist | 2 triage + project-rules | 5 specialists + project-rules | 5 specialists + project-rules |
444
514
  | Per-finding verification | none | Criticals + Importants | Criticals + Importants | Criticals + Importants |
445
515
  | Completeness critic | skip | skip | skip | included |
446
516
  | Proof-of-bug (failing test per Critical or composed-boundary Important) | skip | skip | included (max 5) | included (max 5) |
@@ -804,7 +874,8 @@ args: {
804
874
  cycle, // finding-state.mjs begin output; omit when unknown
805
875
  suppressed, // rejected/intentional findings never to re-raise
806
876
  recurringClasses, // shown in the rethink verdict
807
- testRunner: <worktree.json testRunner, null for scan>
877
+ testRunner: <worktree.json testRunner, null for scan>,
878
+ routing: ROUTING // from model-matrix.mjs; omit when unset
808
879
  }
809
880
  ```
810
881
 
@@ -825,10 +896,10 @@ that only when a specific run needs a smaller footprint.
825
896
 
826
897
  The workflow runs three phases:
827
898
 
828
- - **Review:** deps uses the single `deps` checklist agent; scan uses `[triage-quality, triage-logic]` on `haiku`; medium/deep
899
+ - **Review:** deps uses the single `deps` checklist agent; scan uses `[triage-quality, triage-logic]`; medium/deep
829
900
  use 5 specialists (quality, implementation, simplification, conventions,
830
- test-quality) on `sonnet`. Scan, medium and deep also run `project-rules`
831
- (sonnet), which only checks the diff against each project rule. Agents receive DIFF_FILE + CONTEXT_FILE by path.
901
+ test-quality). Scan, medium and deep also run `project-rules`, which only
902
+ checks the diff against each project rule. Models come from `routing`. Agents receive DIFF_FILE + CONTEXT_FILE by path.
832
903
  All run concurrently: the stage is self-limiting at one agent per
833
904
  dimension. All reviewers run to completion before verification starts.
834
905
  Override per run with the `reviewBatchPlan` arg (e.g. `[1]` runs them
@@ -851,7 +922,7 @@ The workflow runs three phases:
851
922
  - **Critic (deep only):** completeness critic gets the full deduped finding
852
923
  list + DIFF_FILE; its findings go through verifier agents before promotion.
853
924
  - **Prove (medium/deep, worktree and an installed test runner required):**
854
- each Critical without a `rule` tag gets one prover agent (`references/agents/prover.md`, sonnet, max 5, run
925
+ each Critical without a `rule` tag gets one prover agent (`references/agents/prover.md`, `routing.prover`, max 5, run
855
926
  `maxConcurrent` at a time) that writes a test asserting the CORRECT behaviour,
856
927
  runs it in the worktree, and captures it failing because of the bug. The proof rides on the finding as
857
928
  `proof: {attempted, proven, outcome, reason, testCode?, testCommand?, redOutput?}`.
@@ -866,15 +937,29 @@ Findings have schema:
866
937
  `badCode` and `fix` are schema-required: an empty string is allowed only on
867
938
  `observation` / `idiomatic` findings.
868
939
 
869
- Model tiers: triage on `haiku`, specialists on `sonnet`, verifiers + critic +
870
- provers on `sonnet`, housekeeping on `haiku`. Only the synthesis in Step 3 runs
871
- on the session model.
940
+ Model tiers: every agent role (triage, specialist, rules, verifier, critic,
941
+ prover) takes its model and effort from `routing`, chosen by the risk tier;
942
+ see the matrix in `README.md`. Critic re-examine and critic-verify agents use
943
+ the verifier's route. Without `routing` the workflow keeps its defaults:
944
+ triage on `haiku`, everything else on `sonnet`, verifiers and provers at effort
945
+ high. Only the synthesis in Step 3 runs on the session model. The workflow
946
+ returns the routes it used as `routing`; quote them in the Review Cost block.
872
947
 
873
948
  Return value from the workflow:
874
- `{engine, findings, droppedCount, downgradedCount, hardRuleCount, proveAttemptCount, provenCount, acCoverage, coverageVerdict, mutationSlip, mockSmells, agentCount, outputTokens, turnTokensTotal}`
949
+ `{engine, findings, decisions, droppedCount, downgradedCount, hardRuleCount, proveAttemptCount, provenCount, acCoverage, coverageVerdict, mutationSlip, mockSmells, agentCount, outputTokens, turnTokensTotal}`
875
950
  `outputTokens` is this workflow's own output spend; `turnTokensTotal` is the
876
951
  whole turn's shared pool (main loop included).
877
952
 
953
+ `decisions` is `[{kind, what, why}]`: one `route` entry per role and one
954
+ `finding` entry per Critical/Important the verifier ruled on (kept, downgraded
955
+ or dropped, with its one-line reason). The workflow also `log()`s each as it is
956
+ decided, but it cannot write files, so right after it returns write them to the
957
+ run log in one call (a missing `decisions` on a host that returns none is fine):
958
+ `node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RUN_ID> --from-json <scratchpad>/decisions.json`,
959
+ with `decisions` saved to `<scratchpad>/decisions.json` first. The Codex and
960
+ revmux engines return no `decisions`; write only the `depth` and `tier`
961
+ entries for them.
962
+
878
963
  Wait for the workflow to complete before proceeding to Step 3.
879
964
 
880
965
  ### ENGINE=revmux
@@ -1226,7 +1311,10 @@ the run (review and fix) and
1226
1311
  `--artifact-url`: the newest row wins. A run that dies part-way still gets
1227
1312
  `node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" finish <RUN_ID> --status failed --note <why>`.
1228
1313
 
1229
- Then print the full review as the response.
1314
+ Then print the full review as the response. Unless `QUIET_DECISIONS=true`, or
1315
+ the run log was unavailable, it carries the `## 🧭 Decisions` block from
1316
+ `references/output-format.md`, built only from the decisions written to the run
1317
+ log, and saved in the review file with it.
1230
1318
 
1231
1319
  **Closer goes last.** The run's FINAL message (this one, or the later summary
1232
1320
  after Step 4 / 4.6 / 5 when those run) ends with `CLOSER.md_terminal` as its
@@ -1298,7 +1386,8 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1298
1386
  ```
1299
1387
  scriptPath: <scratchpad>/fix-workflow.js
1300
1388
  args: { repoSlug, prNumber, targetLabel, worktreePath, diffFile, contextFile,
1301
- promptDir, findings: [<selected findings verbatim>], acList }
1389
+ promptDir, findings: [<selected findings verbatim>], acList,
1390
+ routing: ROUTING }
1302
1391
  ```
1303
1392
  `targetLabel` is required whenever `prNumber` is null, same as the review
1304
1393
  workflow. `acList` is the acceptance criteria from `context.json`, passed as
@@ -1308,10 +1397,10 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1308
1397
  verdict without verified comparison evidence is downgraded automatically.
1309
1398
  In Codex, run the Fix mode section of `references/codex-workflow.md` with
1310
1399
  the same inputs, including `acList`, and result schema.
1311
- Agent selection is host-specific. Claude uses one `sonnet` fix agent per
1312
- file (never two on the same file), then a read-only `sonnet` fix-verifier per
1313
- file. Codex uses one `worker` fixer per file, then a read-only `default`
1314
- verifier per file. Every verifier reads the actual `git diff`; allow one
1400
+ Agent selection is host-specific. Claude uses one fix agent per file
1401
+ (`routing.fixer`; never two on the same file), then a read-only fix-verifier
1402
+ per file (`routing.verifier`). Codex uses one `worker` fixer per file, then a
1403
+ read-only `default` verifier per file, with the same routes. Every verifier reads the actual `git diff`; allow one
1315
1404
  retry max on a non-`good` verdict.
1316
1405
  4. Revert every group the verifier did not pass.
1317
1406
  5. Run `scripts/verify-fixes.sh <WORKTREE_PATH> <scratchpad>/fix-verify.json tests`
@@ -1354,7 +1443,9 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1354
1443
  confirm it equals `$worktree_head_sha`. Then refresh the review marker for
1355
1444
  the new sha (Step 3).
1356
1445
  8. Print the per-finding status table and append `## 🔧 Fixes applied` to the
1357
- saved review file.
1446
+ saved review file. Record each applied finding, and each one skipped, with
1447
+ `run-log.mjs decide <RUN_ID> --kind fix --what "<file:line title>" --why "<applied | skipped: reason>"`
1448
+ (or one `--from-json` call).
1358
1449
 
1359
1450
  Fix-agent tokens are additional spend: add a `Fix agents:` line to the
1360
1451
  `## 💰 Review Cost` block.
@@ -1446,7 +1537,8 @@ Follow `references/github-post.md`:
1446
1537
  - POST via `gh api repos/<REPO_SLUG>/pulls/<PR_NUMBER>/reviews` with NO
1447
1538
  `event` field (creates PENDING, visible only to you).
1448
1539
  - Verify post-condition: fetch review list, confirm PENDING state exists.
1449
- - Print count + link.
1540
+ - Print count + link, and record it with
1541
+ `run-log.mjs decide <RUN_ID> --kind post --what "<N inline comments + body>" --why "<what was left out and why, or 'all Critical/Important posted'>"`.
1450
1542
  - Observation and Idiomatic findings go in the review body, never inline.
1451
1543
  - When `CLOSER` is set, its `md_github` is the last thing in the review body.
1452
1544
  - Never submit the review programmatically.
@@ -1492,7 +1584,7 @@ so a nearby finding about a different problem still counts; read recall as an
1492
1584
  upper bound.
1493
1585
 
1494
1586
  If you maintain a persistent notes/memory system across reviews, launch ONE
1495
- background Agent with `model: 'haiku'`, passing the review file path +
1587
+ background Agent with `routing.housekeeping` (default `model: 'haiku'`), passing the review file path +
1496
1588
  repo-short-name + PR author login, instructed to follow
1497
1589
  `references/post-review.md` if you've written one for your own setup:
1498
1590
  - Log durable patterns (recurring findings, confirmed false positives) scoped
@@ -64,6 +64,18 @@ Re-read each JSON file before
64
64
  trusting it. Invalid JSON or a missing required field makes that agent result
65
65
  unavailable; do not infer what it meant from prose.
66
66
 
67
+ ## Model routing
68
+
69
+ SKILL.md runs `scripts/model-matrix.mjs --host codex` and passes its `routing`
70
+ object. Every `spawn_agent` call sets `model` and `reasoning_effort` from the
71
+ role's route and `fork_turns: "none"` (Codex requires it whenever a spawn
72
+ overrides the model). Roles: `triage` (triage dimensions), `specialist` (the
73
+ five specialists), `rules` (`project-rules`, `deps`), `verifier` (verifiers,
74
+ critic re-examine and critic-verify, fix verifiers), `critic` (completeness
75
+ critic), `prover`, `fixer`, `housekeeping`. Without `routing`, omit all three
76
+ fields so agents inherit the session model, as before. Record the route used
77
+ per agent in the `agents` receipt.
78
+
67
79
  ## Review stage
68
80
 
69
81
  Select dimensions exactly as the Claude workflow does:
@@ -153,8 +153,9 @@ an earlier run can never be merged into this one.
153
153
  1. Create the run directory once: `mktemp -d /tmp/lekker-polish.XXXXXX`, and
154
154
  use its printed path as `<POLISH_DIR>`. Copy the payload:
155
155
  `cp <PAYLOAD> <POLISH_DIR>/draft.json`.
156
- 2. Launch ONE agent (`model: 'sonnet'`; in Codex, one native agent or inline
157
- when none is available) with this brief: rewrite each `comments[].body` in
156
+ 2. Launch ONE agent on `ROUTING.polish` (model and effort; default
157
+ `model: 'sonnet'` when `ROUTING` is unset; in Codex, one native agent with
158
+ that route, or inline when none is available) with this brief: rewrite each `comments[].body` in
158
159
  `<POLISH_DIR>/draft.json` per `${SKILL_ROOT}/references/comment-voice.md`
159
160
  and write the full payload to `<POLISH_DIR>/polished.json`, same order, same
160
161
  `path`, `line` and `side`. Keep every identifier, `file:line`, number, link,
@@ -230,12 +230,33 @@ section if empty.)*
230
230
 
231
231
  ---
232
232
 
233
+ ## 🧭 Decisions
234
+
235
+ *(Why the run went the way it did. Built from the decisions written to the run
236
+ log; omit the whole section with `--quiet-decisions`, and when the run log is
237
+ unavailable.)*
238
+
239
+ - **Depth:** <depth>, <the AUTO-DEPTH rule or "explicit">
240
+ - **Tier:** <tier> (<auto: reason | --risk>)
241
+ - **Routes:** <role> <model> [<effort>] · <role> <model> [<effort>] · ... (<"risk tier routing" | "default model">)
242
+ - **Findings:** <K> kept · <D> downgraded · <X> dropped *(Critical/Important only, counted from the `finding` decisions)*
243
+ - <kept | downgraded | dropped> `<file:line>` <title>: <verifier's one-line reason>
244
+
245
+ Exact rules: one bullet per Critical/Important finding the verifier ruled on,
246
+ in the order they were decided, reason copied from the decision's `why` without
247
+ the leading outcome word. No bullets and `Findings: none verified` when no
248
+ `finding` decisions exist (for example `scan` with no Criticals, or the revmux
249
+ engine). Never add decisions that were not written to the run log.
250
+
251
+ ---
252
+
233
253
  ## 💰 Review Cost
234
254
 
235
255
  ```
236
256
  Depth: <📦 deps | ⚡ scan | 🔍 medium | 🔬 deep>
237
257
  Diff size: ~<N> lines (~<N> tokens)
238
- Agents run: <N total>: <breakdown, e.g. "5 reviewers (sonnet) + 6 verifiers (sonnet) + 2 provers (sonnet) + 1 critic (sonnet)">
258
+ Agents run: <N total>: <breakdown, e.g. "5 reviewers (sonnet/high) + 6 verifiers (opus/high) + 2 provers (sonnet/high) + 1 critic (opus/high)">
259
+ Risk tier: <tier> (<auto: reason | --risk>), routes from the workflow's `routing` return value
239
260
  Rule checks: <N> hard-rule finding(s) validated with rule-specific checks (omit the line when 0)
240
261
  Context sources: <the subset of issue-tracker / chat / docs / framework-docs / monitoring / CI / prior-review-memory actually used>
241
262
 
@@ -257,7 +278,7 @@ Per-MTok pricing (input/output) - verified 2026-10-15 from the claude-api refere
257
278
 
258
279
  The main-loop line uses the session model's rate from this list. When the session model is not listed, say so in the cost block rather than leaving the main loop out silently.
259
280
 
260
- Reviewer agents, verifiers, provers, and the critic all run on sonnet; triage and housekeeping on haiku. Only the main loop (context gathering + this synthesis) runs on the session model: use the session model's actual ID for that tier.
281
+ Each agent role runs on the model and effort its risk tier assigns (README "Models and effort"); price each role at its own model. Only the main loop (context gathering + this synthesis) runs on the session model: use the session model's actual ID for that tier.
261
282
 
262
283
  For the Codex engine, use the model and usage metadata actually exposed by the
263
284
  native collaboration surface. Never relabel Codex agents as Claude tiers and
@@ -6,7 +6,7 @@ points at, and copies the numbers out of, everything else.
6
6
  | Trace | Path | Written by | Kept | What it answers |
7
7
  |---|---|---|---|---|
8
8
  | Run ledger | `~/.local/state/lekker-review/runs.jsonl` | `scripts/run-log.mjs finish`, `backfill` | forever (one line per run) | how long, how many tokens, findings, drops, proofs, verdict, per engine and depth |
9
- | Run archive | `~/.local/state/lekker-review/runs/<runId>/` | `run-log.mjs start/mark/attach/finish` | 90 days (`prune`) | `run.json` with timeline, plus the run's `findings.json`, `worktree.json`, `preflight.json`, `context.json` |
9
+ | Run archive | `~/.local/state/lekker-review/runs/<runId>/` | `run-log.mjs start/mark/decide/attach/finish` | 90 days (`prune`) | `run.json` with timeline and decisions (also appended live to `timeline.jsonl`), plus the run's `findings.json`, `worktree.json`, `preflight.json`, `context.json` |
10
10
  | Dependency ledger | `~/.local/state/lekker-review/deps.json` | `scripts/deps.mjs` | forever | which optional tools were installed or skipped, versions, last upstream check |
11
11
  | Review report | `~/code-reviews/<date>-<target>-<repo>.md` | Step 3 | forever | the review as printed, including the `Review Cost` block |
12
12
  | revmux archive | `~/code-reviews/revmux-tasks/<task>/<NN-run>/` | revmux, plus `revmux.stderr.log` from `scripts/revmux-engine.sh` | forever, never edit | `events.jsonl` (agent start, degraded, retried), `agents/*.jsonl` (per-agent cost and usage), `revmux.stderr.log` (why a round degraded; rounds before 2026-10-20 have none) |
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ // One-line progress status for lekker-review: a boat drifts over a tide line toward a lighthouse.
3
+ //
4
+ // Usage: node lekker-progress.mjs --stage <stage> --message "<short fact>" [--ascii]
5
+ //
6
+ // Each call prints exactly one line and exits 0, even on bad arguments. On a TTY it first animates
7
+ // the drift on that line (at most 10 fps, under a second); anywhere else (captured tool output, a
8
+ // log) or with NO_COLOR or --ascii it prints the final frame only, with no escape codes.
9
+ // The `decision` stage prints a compass line and leaves the boat where it was.
10
+
11
+ import { pathToFileURL } from 'node:url';
12
+
13
+ export const SLOTS = 8;
14
+ export const MAX_WIDTH = 72;
15
+ const FRAME_MS = 100;
16
+
17
+ // stage -> [slot the boat reaches, mood, default message]
18
+ export const STAGES = {
19
+ start: [0, 'neutral', 'parsed the request'],
20
+ context: [1, 'neutral', 'context ready'],
21
+ review: [2, 'neutral', 'review agents started'],
22
+ verify: [3, 'neutral', 'verifying findings'],
23
+ critic: [4, 'neutral', 'completeness critic'],
24
+ prove: [5, 'neutral', 'proving bugs with tests'],
25
+ fix: [6, 'neutral', 'applying fixes'],
26
+ post: [7, 'neutral', 'posting the review'],
27
+ success: [SLOTS, 'happy', 'review saved'],
28
+ failure: [4, 'sad', 'review stopped'],
29
+ decision: [null, 'neutral', 'decision'],
30
+ };
31
+
32
+ const GLYPHS = {
33
+ false: { boat: '⛵', light: '🗼', tide: ' ~', compass: '🧭 ', neutral: '', happy: '😌', sad: '🌧️' },
34
+ true: { boat: '^', light: 'I', tide: '.', compass: '> ', neutral: '', happy: '(^o^)', sad: '(T.T)' },
35
+ };
36
+
37
+ const WIDE = [[0x1100, 0x115f], [0x231a, 0x231b], [0x23e9, 0x23ec], [0x25fd, 0x25fe], [0x2614, 0x2615],
38
+ [0x2693, 0x2693], [0x26a1, 0x26a1], [0x26f5, 0x26f5], [0x2e80, 0xa4cf], [0xac00, 0xd7a3],
39
+ [0xf900, 0xfaff], [0xfe30, 0xfe6f], [0xff00, 0xff60], [0xffe0, 0xffe6], [0x1f000, 0x1ffff]];
40
+
41
+ function cellWidth(ch) {
42
+ const cp = ch.codePointAt(0);
43
+ if (/\p{M}/u.test(ch) || cp === 0x200d || cp === 0xfe0f) return 0;
44
+ return WIDE.some(([lo, hi]) => cp >= lo && cp <= hi) ? 2 : 1;
45
+ }
46
+
47
+ export const width = (text) => [...text].reduce((n, ch) => n + cellWidth(ch), 0);
48
+
49
+ export function truncate(text, limit) {
50
+ const { out, done } = [...text].reduce((acc, ch) => {
51
+ if (acc.done) return acc;
52
+ const next = acc.used + cellWidth(ch);
53
+ return next > limit - 1 ? { ...acc, done: true } : { out: acc.out + ch, used: next, done: false };
54
+ }, { out: '', used: 0, done: false });
55
+ return done ? `${out}…` : out;
56
+ }
57
+
58
+ const oneLine = (text) => String(text ?? '').split(/\s+/).filter(Boolean).join(' ');
59
+ const fit = (line) => (width(line) <= MAX_WIDTH ? line : truncate(line, MAX_WIDTH));
60
+
61
+ function track(slot, glyphs) {
62
+ const cells = Array.from({ length: SLOTS + 1 }, (_, i) => (i === SLOTS ? glyphs.light : glyphs.tide));
63
+ return cells.map((cell, i) => (i === Math.min(slot, SLOTS) ? glyphs.boat : cell)).join('');
64
+ }
65
+
66
+ // Pure: `tick` is the boat's slot. The mood face shows once the boat has arrived.
67
+ export function frame(stage, tick, { message, ascii = false } = {}) {
68
+ const spec = STAGES[stage];
69
+ const glyphs = GLYPHS[ascii === true];
70
+ const text = oneLine(message ?? spec?.[2] ?? '');
71
+ if (!spec) return fit(`lekker: ${text || stage || 'progress'}`);
72
+ const [target, mood] = spec;
73
+ if (target === null) return fit(`${glyphs.compass}${text || spec[2]}`);
74
+ const face = tick >= target ? glyphs[mood] : '';
75
+ return fit(`${`${track(tick, glyphs)} ${face}`.trimEnd()} ${stage}: ${text}`);
76
+ }
77
+
78
+ const arg = (argv, name) => {
79
+ const i = argv.indexOf(`--${name}`);
80
+ return i === -1 ? undefined : argv[i + 1];
81
+ };
82
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
83
+
84
+ async function main(argv) {
85
+ const stage = arg(argv, 'stage') ?? '';
86
+ const message = arg(argv, 'message');
87
+ const ascii = argv.includes('--ascii') || Boolean(process.env.LEKKER_PROGRESS_ASCII);
88
+ const spec = STAGES[stage];
89
+ const animate = process.stdout.isTTY === true && !process.env.NO_COLOR && !ascii && Array.isArray(spec) && spec[0] !== null;
90
+ if (animate) {
91
+ const target = spec[0];
92
+ const slots = Array.from({ length: Math.min(3, target) }, (_, i) => target - 3 + i).filter((s) => s >= 0);
93
+ for (const slot of slots) {
94
+ process.stdout.write(`\r\x1b[2K${frame(stage, slot, { message, ascii })}`);
95
+ await sleep(FRAME_MS);
96
+ }
97
+ process.stdout.write('\r\x1b[2K');
98
+ }
99
+ const target = spec && spec[0] !== null ? spec[0] : 0;
100
+ process.stdout.write(`${frame(stage, target, { message, ascii })}\n`);
101
+ }
102
+
103
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
104
+ try { await main(process.argv.slice(2)); } catch { /* decoration must never fail a review */ }
105
+ process.exitCode = 0;
106
+ }
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+ // Model and effort per lekker agent, picked from the PR's risk tier.
3
+ //
4
+ // Depth decides how many agents run; the tier decides how strong each one is.
5
+ // Effort comes before model size: a tier escalates effort first and moves to a
6
+ // bigger model only for risky changes. Finders stay one step below the gate
7
+ // (verifier), because the verifier decides what survives. The fast models
8
+ // (haiku, luna) only ever do first-pass triage or housekeeping.
9
+ //
10
+ // node model-matrix.mjs --host claude|codex [--risk <tier>] [--lines <n>]
11
+ // [--categories auth,billing,...] -- <changed-file>...
12
+ //
13
+ // `--categories` is the comma-joined `categories[].category` list from
14
+ // risk-paths.mjs. `--lines` is additions+deletions without lockfiles.
15
+ // Prints {host, tier, tierSource, reasons, visual, routing}.
16
+ import { pathToFileURL } from 'node:url'
17
+
18
+ export const TIERS = ['routine', 'standard', 'elevated', 'critical']
19
+ export const HOSTS = ['claude', 'codex']
20
+ export const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max']
21
+
22
+ // Roles that decide whether a finding survives. Never a fast model.
23
+ export const GATE_ROLES = ['verifier', 'critic']
24
+
25
+ const r = (model, effort) => ({ model, effort })
26
+ const same = cell => [cell, cell, cell, cell]
27
+
28
+ // One row per role: [routine, standard, elevated, critical].
29
+ export const MATRIX = {
30
+ claude: {
31
+ triage: same(r('haiku', 'medium')),
32
+ specialist: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'high'), r('opus', 'xhigh')],
33
+ rules: [r('sonnet', 'medium'), r('sonnet', 'medium'), r('sonnet', 'high'), r('sonnet', 'high')],
34
+ verifier: [r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high'), r('fable', 'high')],
35
+ critic: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'high'), r('fable', 'xhigh')],
36
+ prover: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
37
+ fixer: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
38
+ polish: same(r('sonnet', 'medium')),
39
+ housekeeping: same(r('haiku', 'low')),
40
+ },
41
+ codex: {
42
+ triage: same(r('gpt-6-luna', 'medium')),
43
+ specialist: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'xhigh')],
44
+ rules: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high')],
45
+ verifier: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'high')],
46
+ critic: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'xhigh')],
47
+ prover: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high')],
48
+ fixer: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high')],
49
+ polish: same(r('gpt-6.2-sol', 'medium')),
50
+ housekeeping: same(r('gpt-6-luna', 'low')),
51
+ },
52
+ }
53
+
54
+ // A UI-only diff: Codex has a model positioned for visual reasoning.
55
+ const VISUAL_SPECIALIST = { codex: r('gpt-6.1-terra', 'high') }
56
+
57
+ export const FAST_MODELS = ['haiku', 'gpt-6-luna']
58
+
59
+ const DOC_FILE = /(^|\/)(docs?\/.*|[^/]+\.(md|mdx|txt|rst)|LICENSE[^/]*)$/i
60
+ const UI_FILE = /\.(tsx|jsx|vue|svelte|css|scss|sass|less|liquid|html)$/i
61
+ const TEST_FILE = /(^|\/)(__tests__|tests?|spec)\/|\.(test|spec)\.[a-z]+$/i
62
+ const MIGRATION_FILE = /(^|\/)migrations?\/|\.sql$/i
63
+
64
+ const CRITICAL_CATEGORIES = ['auth', 'billing']
65
+ const ELEVATED_CATEGORIES = ['ci-workflow', 'installer']
66
+ const DEEP_LINES = 800
67
+ const DEEP_FILES = 25
68
+
69
+ // Each rule: [tier, reason, test]. First match wins, so order is severity order.
70
+ const TIER_RULES = [
71
+ ['critical', 'auth or billing paths', s => s.categories.some(c => CRITICAL_CATEGORIES.includes(c))],
72
+ ['elevated', 'CI workflow or installer paths', s => s.categories.some(c => ELEVATED_CATEGORIES.includes(c))],
73
+ ['elevated', 'migrations or SQL', s => s.files.some(f => MIGRATION_FILE.test(f))],
74
+ ['elevated', `more than ${DEEP_LINES} changed lines or ${DEEP_FILES} files`, s => s.lines > DEEP_LINES || s.files.length > DEEP_FILES],
75
+ ['routine', 'documentation only', s => s.files.length > 0 && s.files.every(f => DOC_FILE.test(f))],
76
+ ]
77
+
78
+ export function tierFor({ files = [], categories = [], lines = 0, override } = {}) {
79
+ if (override !== undefined) {
80
+ if (!TIERS.includes(override)) throw new Error(`unknown risk tier "${override}"; use one of ${TIERS.join(', ')}`)
81
+ return { tier: override, tierSource: 'override', reasons: ['--risk flag'] }
82
+ }
83
+ const signals = { files, categories, lines }
84
+ const hit = TIER_RULES.find(([, , test]) => test(signals))
85
+ return hit
86
+ ? { tier: hit[0], tierSource: 'auto', reasons: [hit[1]] }
87
+ : { tier: 'standard', tierSource: 'auto', reasons: ['default'] }
88
+ }
89
+
90
+ export function isVisual(files = []) {
91
+ const code = files.filter(f => !TEST_FILE.test(f) && !DOC_FILE.test(f))
92
+ return code.length > 0 && code.every(f => UI_FILE.test(f))
93
+ }
94
+
95
+ export function routingFor(host, tier, { visual = false } = {}) {
96
+ if (!HOSTS.includes(host)) throw new Error(`unknown host "${host}"; use one of ${HOSTS.join(', ')}`)
97
+ if (!TIERS.includes(tier)) throw new Error(`unknown risk tier "${tier}"`)
98
+ const column = TIERS.indexOf(tier)
99
+ const routing = Object.fromEntries(Object.entries(MATRIX[host]).map(([role, row]) => [role, row[column]]))
100
+ return visual && VISUAL_SPECIALIST[host] ? { ...routing, specialist: VISUAL_SPECIALIST[host] } : routing
101
+ }
102
+
103
+ const ROLE_LABELS = {
104
+ triage: 'Triage (scan depth, first pass only)',
105
+ specialist: 'Specialists x5 (quality, implementation, simplification, conventions, test-quality)',
106
+ rules: 'Project rules, deps checklist',
107
+ verifier: 'Verifier, critic re-examine, fix verifier',
108
+ critic: 'Completeness critic (deep)',
109
+ prover: 'Prover (writes the failing test)',
110
+ fixer: 'Fixer (--fix)',
111
+ polish: 'Comment polish (--post)',
112
+ housekeeping: 'Housekeeping',
113
+ }
114
+ const MODEL_NAMES = {
115
+ haiku: 'Haiku', sonnet: 'Sonnet', opus: 'Opus', fable: 'Fable',
116
+ 'gpt-6-luna': 'Luna', 'gpt-6.2-sol': 'Sol', 'gpt-6.2-astra': 'Astra', 'gpt-6.1-terra': 'Terra',
117
+ }
118
+
119
+ // The README table, rendered from MATRIX so the two cannot drift
120
+ // (tests/lekker-model-matrix.test.mjs asserts README contains it).
121
+ export function matrixMarkdown() {
122
+ const cell = (c, x) => `${MODEL_NAMES[c.model]} ${c.effort} / ${MODEL_NAMES[x.model]} ${x.effort}`
123
+ const rows = Object.keys(MATRIX.claude).map(role =>
124
+ `| ${ROLE_LABELS[role]} | ${TIERS.map((_, i) => cell(MATRIX.claude[role][i], MATRIX.codex[role][i])).join(' | ')} |`)
125
+ return [`| Agent | ${TIERS.join(' | ')} |`, `| --- |${TIERS.map(() => ' --- |').join('')}`, ...rows].join('\n')
126
+ }
127
+
128
+ function parseArgs(argv) {
129
+ const sep = argv.indexOf('--')
130
+ const flags = sep === -1 ? argv : argv.slice(0, sep)
131
+ const files = sep === -1 ? [] : argv.slice(sep + 1)
132
+ const value = name => {
133
+ const i = flags.indexOf(name)
134
+ return i === -1 ? undefined : flags[i + 1]
135
+ }
136
+ const categories = (value('--categories') ?? '').split(',').map(s => s.trim()).filter(Boolean)
137
+ return { host: value('--host'), override: value('--risk'), lines: Number(value('--lines') ?? 0), categories, files }
138
+ }
139
+
140
+ function main(argv) {
141
+ const { host, override, lines, categories, files } = parseArgs(argv)
142
+ try {
143
+ const { tier, tierSource, reasons } = tierFor({ files, categories, lines, override })
144
+ const visual = isVisual(files)
145
+ console.log(JSON.stringify({ host, tier, tierSource, reasons, visual, routing: routingFor(host, tier, { visual }) }))
146
+ } catch (error) {
147
+ console.error(`model-matrix: ${error.message}`)
148
+ process.exit(2)
149
+ }
150
+ }
151
+
152
+ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) main(process.argv.slice(2))