lastlight-core 0.34.0 → 0.35.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 (106) hide show
  1. package/config/default.yaml +100 -138
  2. package/dist/admin/routes.js +3 -0
  3. package/dist/admin/routes.js.map +1 -1
  4. package/dist/config/config.d.ts +11 -0
  5. package/dist/config/config.js +93 -30
  6. package/dist/config/config.js.map +1 -1
  7. package/dist/engine/executors/orchestrator.d.ts +13 -0
  8. package/dist/engine/executors/orchestrator.js +22 -2
  9. package/dist/engine/executors/orchestrator.js.map +1 -1
  10. package/dist/engine/github/github.d.ts +42 -0
  11. package/dist/engine/github/github.js +41 -0
  12. package/dist/engine/github/github.js.map +1 -1
  13. package/dist/engine/github/review-poster.d.ts +16 -3
  14. package/dist/engine/github/review-poster.js +3 -3
  15. package/dist/engine/github/review-poster.js.map +1 -1
  16. package/dist/engine/github/review-summary.d.ts +2 -2
  17. package/dist/engine/github/review-summary.js +1 -1
  18. package/dist/engine/github/review-summary.js.map +1 -1
  19. package/dist/engine/pr-decisions.d.ts +7 -0
  20. package/dist/engine/pr-decisions.js +84 -97
  21. package/dist/engine/pr-decisions.js.map +1 -1
  22. package/dist/engine/pr-discussion.d.ts +23 -0
  23. package/dist/engine/pr-discussion.js +55 -0
  24. package/dist/engine/pr-discussion.js.map +1 -0
  25. package/dist/engine/pr-intent.d.ts +32 -0
  26. package/dist/engine/pr-intent.js +55 -0
  27. package/dist/engine/pr-intent.js.map +1 -0
  28. package/dist/engine/pr-state.d.ts +10 -2
  29. package/dist/engine/pr-state.js +14 -2
  30. package/dist/engine/pr-state.js.map +1 -1
  31. package/dist/engine/review-spec.d.ts +2 -87
  32. package/dist/engine/review-spec.js +2 -445
  33. package/dist/engine/review-spec.js.map +1 -1
  34. package/dist/engine/review-triage.d.ts +27 -9
  35. package/dist/engine/review-triage.js +20 -7
  36. package/dist/engine/review-triage.js.map +1 -1
  37. package/dist/evals-api.d.ts +7 -0
  38. package/dist/evals-api.js +21 -0
  39. package/dist/evals-api.js.map +1 -1
  40. package/dist/sandbox/docker.d.ts +8 -0
  41. package/dist/sandbox/docker.js +25 -0
  42. package/dist/sandbox/docker.js.map +1 -1
  43. package/dist/sandbox/k8s/kubernetes-sandbox.d.ts +5 -0
  44. package/dist/sandbox/k8s/kubernetes-sandbox.js +46 -2
  45. package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
  46. package/dist/sandbox/k8s/run-agent-script.d.ts +3 -1
  47. package/dist/sandbox/k8s/run-agent-script.js +5 -2
  48. package/dist/sandbox/k8s/run-agent-script.js.map +1 -1
  49. package/dist/sandbox/resource-usage.d.ts +64 -0
  50. package/dist/sandbox/resource-usage.js +115 -0
  51. package/dist/sandbox/resource-usage.js.map +1 -0
  52. package/dist/sandbox/sandbox.d.ts +38 -0
  53. package/dist/sandbox/sandbox.js +106 -14
  54. package/dist/sandbox/sandbox.js.map +1 -1
  55. package/dist/state/execution-store.d.ts +33 -1
  56. package/dist/state/execution-store.js +54 -12
  57. package/dist/state/execution-store.js.map +1 -1
  58. package/dist/state/schema/pg.d.ts +51 -0
  59. package/dist/state/schema/pg.js +7 -1
  60. package/dist/state/schema/pg.js.map +1 -1
  61. package/dist/state/schema/sqlite.d.ts +51 -0
  62. package/dist/state/schema/sqlite.js +6 -0
  63. package/dist/state/schema/sqlite.js.map +1 -1
  64. package/dist/state/workflow-run-store.d.ts +5 -2
  65. package/dist/state/workflow-run-store.js +10 -4
  66. package/dist/state/workflow-run-store.js.map +1 -1
  67. package/dist/workflows/handlers/fanout.d.ts +29 -4
  68. package/dist/workflows/handlers/fanout.js +128 -41
  69. package/dist/workflows/handlers/fanout.js.map +1 -1
  70. package/dist/workflows/handlers/host-repo-dir.d.ts +38 -0
  71. package/dist/workflows/handlers/host-repo-dir.js +55 -0
  72. package/dist/workflows/handlers/host-repo-dir.js.map +1 -0
  73. package/dist/workflows/handlers/post-review.d.ts +9 -1
  74. package/dist/workflows/handlers/post-review.js +39 -16
  75. package/dist/workflows/handlers/post-review.js.map +1 -1
  76. package/dist/workflows/handlers/survey-units.d.ts +323 -0
  77. package/dist/workflows/handlers/survey-units.js +1211 -0
  78. package/dist/workflows/handlers/survey-units.js.map +1 -0
  79. package/dist/workflows/runner.js +42 -15
  80. package/dist/workflows/runner.js.map +1 -1
  81. package/drizzle/pg/0002_luxuriant_screwball.sql +3 -0
  82. package/drizzle/pg/meta/0002_snapshot.json +1894 -0
  83. package/drizzle/pg/meta/_journal.json +7 -0
  84. package/drizzle/sqlite/0003_first_namorita.sql +3 -0
  85. package/drizzle/sqlite/meta/0003_snapshot.json +1725 -0
  86. package/drizzle/sqlite/meta/_journal.json +7 -0
  87. package/package.json +9 -9
  88. package/skills/code-review/SKILL.md +2 -3
  89. package/skills/pr-review/SKILL.md +3 -2
  90. package/skills/pr-review/references/findings-schema.md +5 -5
  91. package/workflows/pr-review.yaml +491 -271
  92. package/workflows/prompts/review-falsify.md +17 -9
  93. package/workflows/prompts/review-select.md +113 -0
  94. package/workflows/prompts/review-site-summary.md +48 -0
  95. package/workflows/prompts/review-site.md +305 -0
  96. package/workflows/prompts/review.md +0 -60
  97. package/workflows/prompts/survey-unit.md +60 -0
  98. package/skills/adjudicate-pass/SKILL.md +0 -149
  99. package/skills/survey-pass/SKILL.md +0 -139
  100. package/workflows/prompts/review-adjudicate.md +0 -474
  101. package/workflows/prompts/survey-contract.md +0 -121
  102. package/workflows/prompts/survey-enforcement.md +0 -105
  103. package/workflows/prompts/survey-security.md +0 -162
  104. package/workflows/prompts/survey-spec.md +0 -131
  105. package/workflows/prompts/survey-state.md +0 -152
  106. package/workflows/prompts/survey-tests.md +0 -99
@@ -18,12 +18,11 @@ botName: last-light
18
18
 
19
19
  models:
20
20
  default: anthropic/claude-sonnet-4-6
21
- # The five `pr-review.yaml` survey branches and `falsify`. SET, not an
22
- # example — see the note below: this is the measured RECALL winner for
23
- # hypothesis generation, not a cost downgrade, and leaving it unset silently
24
- # ran six Sonnet phases under every number the pipeline was tuned on. A
21
+ # The unit survey (`survey-units`), and the fall-through of `review-site`
22
+ # and `review-falsify`. SET, not an example — see the note below: this is the
23
+ # measured RECALL winner for hypothesis generation, not a cost downgrade. A
25
24
  # deployment whose `models.default` points at a non-Anthropic provider MUST
26
- # override this in its overlay `config.yaml`, or these six phases reach for a
25
+ # override this in its overlay `config.yaml`, or these phases reach for a
27
26
  # provider it has no key for.
28
27
  review-survey: anthropic/claude-haiku-4-5-20251001
29
28
  # The `triage` phase of `pr-review.yaml` — "how much review is this push
@@ -38,9 +37,11 @@ models:
38
37
  # screener: anthropic/claude-haiku-4-5-20251001 # the prompt-injection screener
39
38
  # diagnose: anthropic/claude-haiku-4-5-20251001 # the CI-failure classifier
40
39
  # pr-fix-retry: anthropic/claude-opus-4-8 # used above fix.escalateModelAfterAttempt
41
- # review-adjudicate: anthropic/claude-sonnet-4-6 # the adjudication pass
42
40
  # review-summary: openai/gpt-5.4-mini # post-review's summary, written after the caps
43
41
  # review-falsify: anthropic/claude-haiku-4-5-20251001 # the probe oracle
42
+ # review-site: anthropic/claude-haiku-4-5-20251001 # a site investigator
43
+ # review-site-pair: opencode/deepseek-v4-flash # a second investigator per site (opt-in)
44
+ # review-select: anthropic/claude-sonnet-4-6 # the sites engine's selection pass
44
45
  # A per-task entry wins over `default`. `classifier`/`screener` are the cheap
45
46
  # one-shot helpers (src/engine/llm.ts); when unset they fall back to the first
46
47
  # configured provider's fast model, NOT `default`.
@@ -54,47 +55,43 @@ models:
54
55
  # each fix run costs one extra call at the default model until you pin it.
55
56
  #
56
57
  # `review-survey` is SET above, and it is the one entry in this block that is
57
- # not an example. It is the key the five survey branches of `pr-review.yaml`
58
- # declare (`model: "{{models.review-survey}}"`, one per obligation family),
59
- # and the `falsify` phase's fall-through.
58
+ # not an example. It is the model of `survey-units` (one call per unit), and
59
+ # the fall-through of `review-site` and `review-falsify`.
60
60
  #
61
- # Pinning it to Haiku 4.5 is NOT a cost downgrade, and that is the unusual
62
- # part: on review RECALL, Haiku 4.5 BEATS Sonnet 4.6 on two independent evals
63
- # — 41.2% vs 22.1% on the Martian corpus. It is the better model for
64
- # HYPOTHESIS GENERATION, which is what a survey branch does; its price is
65
- # merely what makes a five-way fan-out affordable inside the pipeline's 2–3x
66
- # budget. It is a different question from the SAYING phases (`review`,
67
- # `adjudicate`), which are not pinned here.
61
+ # Pinning it to Haiku 4.5 is NOT a cost downgrade: on review RECALL, Haiku
62
+ # 4.5 BEAT Sonnet 4.6 on two independent evals — 41.2% vs 22.1% on the
63
+ # Martian corpus — for HYPOTHESIS GENERATION, which is what a survey does.
64
+ # It is a different question from the SAYING phases (`review`, `select`),
65
+ # which are not pinned here.
68
66
  #
69
67
  # It was deliberately left unset for a long time, for the `diagnose` reason
70
68
  # above — these are Anthropic model ids, and a deployment that overrode only
71
- # `default` to another provider would find six phases reaching for a provider
72
- # it has no key for. That reason has not gone away; it is now handled the
73
- # other way round, because the cost of the unset default turned out to be
74
- # worse. Unset, all six fell through to `default` (Sonnet) SILENTLY, so an
75
- # operator who enabled the pipeline ran a configuration no measurement in
76
- # `docs/plans/deterministic-pr-levers.md` describes — every recall, cost and
77
- # latency number on record assumes Haiku surveys. A wrong-provider failure is
78
- # loud on the first run; a quietly-different model is not.
69
+ # `default` to another provider would find the survey reaching for a provider
70
+ # it has no key for. That reason has not gone away; it is handled the other
71
+ # way round, because unset, the survey fell through to `default` SILENTLY and
72
+ # an operator who enabled the pipeline ran a configuration no measurement
73
+ # describes. A wrong-provider failure is loud on the first run; a
74
+ # quietly-different model is not.
79
75
  #
80
76
  # SO: a non-Anthropic deployment must override this key in its overlay
81
77
  # `config.yaml` (a cheap, fast model of its own provider), exactly as it
82
78
  # already overrides `models.default`.
83
79
  #
84
80
  # `review-falsify` is the ORACLE's own key — the one phase that runs code.
85
- # Unset, it falls through to `review-survey` (its template is the same
86
- # `{{#if}}` pair `adjudicate` uses, so an unset key lands on the survey model
87
- # and not on `default`), which is exactly the behaviour before the key
88
- # existed. It exists so the oracle's model can be moved on its own: it was
89
- # hard-wired to `review-survey`, so asking "is a cheap model good enough at
90
- # WRITING AND RUNNING a probe?" meant moving all five survey branches too —
91
- # two variables, and therefore not a runnable experiment.
81
+ # Unset, it falls through to `review-survey` (an `{{#if}}` pair, so an unset
82
+ # key lands on the survey model and not on `default`). Not attached yet —
83
+ # see `review.analysis.probes`.
92
84
  #
93
- # `review-adjudicate` is the adjudicate phase's own key in `pr-review.yaml` —
94
- # the RANKING pass over what the surveys found, a different task from survey
95
- # discovery, so it can be moved independently of `models.review`. Unset, it
96
- # falls through to `models.review` (the phase's template guards it), so a
97
- # deployment that never sets it keeps today's behaviour exactly.
85
+ # `review-site` and `review-select` are the `sites` review engine's keys: the
86
+ # site investigators fall through to `review-survey`, and `select` — the
87
+ # one call that merges and orders their findings — to `models.review`.
88
+ # Measured (docs/plans/pr-review-units-sites.md): cheap investigators
89
+ # (`openai/gpt-6-luna`, `opencode/deepseek-v4-flash`, medium) beat Haiku on
90
+ # recall and posted precision at ¼–½ the cost. Left UNSET here for the
91
+ # `diagnose` reason — a default must be a provider every deployment has a key
92
+ # for — so pin it in your overlay. `review-site-pair` is OFF unless set: it
93
+ # puts a second investigator, on this model, on every selected site
94
+ # (`review.analysis.siteTop`), and `select` merges what the two agree on.
98
95
 
99
96
  # Provider endpoints. Ships EMPTY — every provider keeps the endpoint baked into
100
97
  # the registry (packages/shared/src/providers.ts), which is exactly today's
@@ -444,36 +441,21 @@ review:
444
441
  # is absent from the template context rather than present-and-empty. Each
445
442
  # stage lands dark and is switched on per deployment once it is measured.
446
443
  #
447
- # What `enabled: true` adds today (WP0, the `spec` axis):
448
- # - `{{prBody}}` + `{{linkedIssues}}` — the PR body and the issues it closes
449
- # (`closingIssuesReferences`), neither of which reached a prompt before.
450
- # - `{{specObligations}}` — one obligation per acceptance criterion found in
451
- # the issue/PR body, each naming BOTH ENDS of the mechanism: the criterion
452
- # itself, and the changed files that could satisfy it with `found: false`.
453
- # A one-ended seed measures WORSE than no seed (IRIS ablation: -3), which
454
- # is why the second end is the mechanical changed-file list and never
455
- # prose.
456
- # - the split verdict: `findings.json` may carry
457
- # `verdict: { spec, standards }` and a `fail` on either axis stops the
458
- # review being an APPROVE, so a clean standards pass can no longer hide a
459
- # spec miss (issue #271 fix 7).
444
+ # What `enabled: true` adds: `facts` → `seed` → the unit survey → the `sites`
445
+ # review engine → `reconcile`, which together write the findings.json that
446
+ # `post-review` posts (the path is spelled out at `siteConcurrency` below).
447
+ # The `review` phase then runs only on a light re-review. Spec obligations —
448
+ # one per acceptance criterion in the linked issue / PR body, each naming
449
+ # BOTH ENDS (the criterion and the changed files that could satisfy it) —
450
+ # are cut into units with the facts-derived ones.
460
451
  #
461
452
  # OPERATOR-ONLY — unlike every other `review:` key, a repo may not set this.
462
453
  # It is spend, with no "more conservative" direction to clamp towards.
463
- # What `enabled: true` additionally adds from WP3 (the facts-derived families):
464
- # - a `facts` phase writing .lastlight/pr-review/facts.json (no model spend)
465
- # - a `seed` phase turning it into obligations.json + one rendered block per
466
- # family, each naming BOTH ENDS of a mechanism
467
- # - five survey branches, one per live family, each appending to its OWN
468
- # hypotheses/<family>.jsonl — no pass ever reads or rewrites another's,
469
- # which makes consensus collapse impossible by construction rather than
470
- # by instruction
471
- #
472
- # Neither phase can run where `lastlight-facts` is not resolvable. That is
454
+ # No analysis phase can run where `lastlight-facts` is not resolvable. That is
473
455
  # true of the SANDBOX IMAGE today (WP2 is what installs it); the eval harness
474
456
  # runs `--sandbox none` on the host, where it is. Set LASTLIGHT_FACTS_BIN to
475
457
  # point at a specific build. A missing binary degrades to a `coverage: "none"`
476
- # envelope and the survey phases say so — it never fails the run.
458
+ # envelope and the downstream phases say so — it never fails the run.
477
459
  analysis:
478
460
  enabled: false
479
461
  # A SAFETY BOUND, not a budget — it should never bind on a real PR. The
@@ -493,9 +475,9 @@ review:
493
475
  maxSpecObligations: 40
494
476
  # The five facts-derived families are bounded PER FAMILY, not pooled:
495
477
  # contract 12, enforcement 12, state 8, security 8, tests 8 (FAMILY_CAPS in
496
- # packages/code-facts/src/seed.ts). Each family's obligations feed exactly
497
- # ONE survey branch, so the cost is per branch and a pooled cap never bound
498
- # the fattest one; and cross-family ranking prices incommensurable mechanism
478
+ # packages/code-facts/src/seed.ts). Measured on the (since removed) agent
479
+ # survey, where each family fed one branch: a pooled cap never bound the
480
+ # fattest one, and cross-family ranking prices incommensurable mechanism
499
481
  # classes against each other — measured, `contract` minted 89 across the
500
482
  # eight gate cases while `security` minted 3, and the pool went to contract.
501
483
  #
@@ -504,7 +486,10 @@ review:
504
486
  # that raising one ceiling is a bounded act rather than an unbounded one.
505
487
  maxObligations: 48
506
488
 
507
- # Which obligation BLOCK the six families are handed. `full` | `minimal`.
489
+ # Which obligation contract `lastlight-facts seed` records. `full` |
490
+ # `minimal`. Today it only changes how strictly the `discharge` post-check
491
+ # in `units-ingest` grades; the history below was measured on the (since
492
+ # removed) agent survey.
508
493
  #
509
494
  # This is a CONTROL, not a dial. On 2026-08-23 the block gained a mandatory
510
495
  # discharge contract (a `discharge` field the row can actually hold a code
@@ -535,51 +520,6 @@ review:
535
520
  # telemetry (and the clean-discharge demotion it enables at the posting
536
521
  # boundary), at the cost of the verification-report volume above.
537
522
  obligationContract: minimal
538
- # What `adjudicate` is handed, and what shape it writes back (#399).
539
- #
540
- # legacy — the shipped phase. The prompt names the files and the model
541
- # shells out to assemble them, then writes a `tier` and a
542
- # `confidence` per finding.
543
- # dossier — a deterministic `dossier` phase renders every record the
544
- # phase needs and the harness attaches it, and the model writes
545
- # typed attributes (`claim` / `category` / `fix`) from which a
546
- # pure function derives the tier. `confidence` is not asked for.
547
- #
548
- # ONE key for both halves deliberately: they move the same phase's measured
549
- # surface — its input and its output — so shipping them together costs one
550
- # comparability break with the archive instead of two, and one arm validates
551
- # both.
552
- #
553
- # What it targets, measured on the 8-case probes arm: adjudicate spends 137
554
- # bash calls across 8 adjudications (35 turns, 30 of them bash on the stress
555
- # case) re-deriving records the harness already holds — about a third of
556
- # case cost — and makes its actual judgement at the end of that transcript.
557
- #
558
- # jev — implies `dossier` (same rendering, same typed output) and
559
- # additionally runs `jev-classify`: one TypeSafe `systemOne`
560
- # call PER HYPOTHESIS (not per finding — hypotheses vastly
561
- # outnumber findings, and per-hypothesis is the volume a
562
- # System-1 primitive is for), asking only the category axis
563
- # measured at AUC 0.897 (never correctness, measured dead at
564
- # AUC 0.534). Its category is rendered into the dossier as an
565
- # ADVISORY line — Sonnet still writes every disposition
566
- # itself. Measured 2026-09-22: 260 hypotheses / 8 cases,
567
- # 83.6% agreement with Sonnet's own call on identical
568
- # evidence, $0.0053. Weakest on the rarest, highest-stakes
569
- # categories (`defect` 33%, `correctness-risk` 40% recall
570
- # against Sonnet) — that is why it annotates rather than
571
- # decides. Needs `TYPESAFE_KEY` (or `TYPESAFE_API_KEY`); its
572
- # absence degrades the phase to "no annotation", never a
573
- # failed run.
574
- #
575
- # `legacy` until an arm has run for each. An unrecognised value lands there
576
- # too.
577
- adjudicate: legacy
578
- # The TypeSafe model `jev-classify` calls, under `adjudicate: "jev"`.
579
- # `null` = the CLI's own default (`TYPESAFE_MODEL` env, else `jev-latest`).
580
- # Kept out of the `models:` map above — TypeSafe is a distinct provider
581
- # from the `provider/model` chat models that map resolves.
582
- jevModel: null
583
523
 
584
524
  # Which D2 minting rules `lastlight-facts seed` runs beyond the original
585
525
  # four. A comma-list; the valid tokens are `all-in-diff` (contract
@@ -594,35 +534,57 @@ review:
594
534
  # typo'd arm is loud rather than silently running baseline.
595
535
  mint: all-in-diff,registrations
596
536
 
597
- # RECORDED, NOT CONSUMED. The fan-out's branch list in `pr-review.yaml` is
598
- # the authority (five branches; `tests` has no seeder and no branch), and
599
- # nothing reads this key to pick or drop branches — it exists so the value
600
- # an operator believed they set is on the record. A previous design DID
601
- # consume a count (defaulted to 3 against six families, never recording
602
- # which three ran), which is exactly why the branch list is now the one
603
- # authority.
604
- surveyPasses: 6
605
537
 
606
- # How many of those families run AT ONCE (WP11c).
538
+ # How many `site-review` investigators run AT ONCE.
607
539
  #
608
540
  # A CEILING the run clamps again per backend, never the effective value. On
609
541
  # the shipped default backend (gondolin) each agent session is a QEMU
610
542
  # micro-VM inside the harness process, so it pins to 1 and this key changes
611
- # nothing at all until that is measured; `none` and `docker` take it as
612
- # written.
613
- #
614
- # Six because the six families write six disjoint, append-only
615
- # `hypotheses/<family>.jsonl` and never read each other's — there was never
616
- # an ordering constraint between them, only a scheduler that ran one DAG
617
- # node at a time. Chained, they were 851s of a 29-minute review (49% of the
618
- # wall clock); concurrent, they cost the slowest single family.
619
- #
620
- # Lower it to bound provider rate-limit pressure or memory, NOT to bound
621
- # spend: six passes cost the same in tokens either way.
622
- surveyConcurrency: 6
543
+ # nothing at all until that is measured; `none` takes it up to 16 (a
544
+ # paired top-8 fan-out) and `docker` up to 6. Lower it to bound provider rate-limit pressure or memory, NOT to
545
+ # bound spend: the investigators cost the same in tokens either way.
546
+ # `surveyConcurrency` is still read as its old name.
547
+ siteConcurrency: 6
548
+
549
+ # How many vote-ranked sites get an investigator (1–8). Top 5 put 16 of 25
550
+ # gold-mapped rows inside a selected site on the Martian audit, top 8 put
551
+ # 21, for ~2 more investigators per PR. Setting `models.review-site-pair`
552
+ # puts a SECOND investigator on every selected site (a different model:
553
+ # two models' blind spots are disjoint), so the sessions double.
554
+ siteTop: 5
555
+
556
+ # The analysis path (docs/plans/pr-review-units-sites.md): `facts` and
557
+ # `seed`, then the unit survey — `lastlight-facts units` (deterministic
558
+ # units: a symbol, a module, the PR), ONE bounded, non-agentic model call
559
+ # per unit on `models.review-survey`, and `lastlight-facts units-ingest`,
560
+ # which writes `hypotheses/<family>.jsonl` — then the `sites` engine: the
561
+ # rows are only a VOLUME signal, `lastlight-facts sites --plan` ranks the
562
+ # places they point at (distinct-unit votes, span ≤ 60, test files
563
+ # skipped), one investigator per top-5 site writes grounded findings (the
564
+ # `site-review` fan-out, model `models.review-site`, else review-survey),
565
+ # `merge` pools them and `select` (one agent call, model
566
+ # `models.review-select`, else review) merges duplicates and orders them by
567
+ # importance. Every row is filed `internal`. `survey-units` reads and writes
568
+ # the workspace from the harness, so config load REFUSES `enabled: true` on
569
+ # the kubernetes backend (no host checkout).
570
+ # Unit calls in flight at once in `survey-units`. No backend
571
+ # clamp — they are HTTP requests from the harness, not sandboxes — so lower
572
+ # it only to ease provider rate limits. Spend is the same either way.
573
+ surveyUnitConcurrency: 16
574
+ # The WHOLE-PHASE deadline on `survey-units`, in seconds — one
575
+ # AbortController over every unit call. A unit not finished by then is
576
+ # recorded `ok: false` ("phase deadline") and `units-ingest` records each
577
+ # obligation it owned as unanswered; the phase itself still succeeds, so a
578
+ # slow provider degrades the survey rather than failing the review.
579
+ surveyUnitsTimeoutSeconds: 600
623
580
 
624
581
  # ── WP4: `prepare` (the affordance) + `falsify` (the oracle) ──────────────
625
582
  #
583
+ # NOT ATTACHED to the sites engine yet: the three probe phases skip whatever
584
+ # this says, because nothing reads their output
585
+ # (docs/plans/pr-review-units-sites.md, stage 5). The keys stay so the
586
+ # re-attachment is a wiring change, not a config one.
587
+ #
626
588
  # A SECOND switch under an already-gated block, and TRI-STATE — the middle
627
589
  # value is the point of it.
628
590
  #
@@ -633,9 +595,8 @@ review:
633
595
  # with `--no-install`, so it writes a real `env.json`
634
596
  # (`install: "skipped"`, `installed` still read off the
635
597
  # filesystem) and `falsify` gets the fact its prompt is written
636
- # against: it already branches on `installed: false`, records
637
- # what it cannot run as `unprobed` with a reason, and those
638
- # hypotheses SURVIVE to adjudication. The oracle was written
598
+ # against: it already branches on `installed: false` and
599
+ # records what it cannot run as `unprobed` with a reason. The oracle was written
639
600
  # for the zero-install world; one shared gate was all that kept
640
601
  # it out of one. Seconds of CPU, no package manager, no test
641
602
  # suite, no `postinstall` from a pull request head.
@@ -695,6 +656,12 @@ review:
695
656
  # five-line existence gate, not a validator — v2's full quote validator was
696
657
  # overkill and cost 2.4x for a worse result.
697
658
  probeRounds: 2
659
+ # At most this many hypotheses go in front of `falsify`, `null` for no cap.
660
+ # `lastlight-facts probe-plan` derives the owed set (a derived-Critical row,
661
+ # or a survey's own `needsProbe`), ranks it and cuts it here. Provisional:
662
+ # under the unit survey 16–25 rows were owed on the 1587 cases. The
663
+ # micro-falsify eval is what should move this number.
664
+ maxProbes: 8
698
665
  # The WHOLE-PHASE ceiling on `falsify`, across every round. It had none at
699
666
  # all until the oracle could run without an install, and `probeRounds` was
700
667
  # never a budget: a round count bounds how many times the loop may go round,
@@ -703,11 +670,6 @@ review:
703
670
  # construction (a differential `git` run, a copied pure function under plain
704
671
  # `node`) and whose real cost is model latency.
705
672
  falsifyTimeoutSeconds: 600
706
- # The WHOLE-PHASE ceiling on `jev-classify`, under `adjudicate: "jev"`.
707
- # Each call is a TypeSafe `systemOne` round trip (~100ms typically) but the
708
- # phase makes one per hypothesis and a case can carry dozens; 120s covers
709
- # a slow provider day without threatening the falsify-sized budget above.
710
- jevTimeoutSeconds: 120
711
673
  # The attention boundary (WP6b). Preserving internal recall and spending a
712
674
  # human's attention are two different budgets; conflating them is how a
713
675
  # recall-first reviewer becomes unreadable.
@@ -1439,6 +1439,9 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
1439
1439
  outputTokens: r.outputTokens,
1440
1440
  apiDurationMs: r.apiDurationMs,
1441
1441
  stopReason: r.stopReason,
1442
+ cpuSeconds: r.cpuSeconds,
1443
+ peakMemoryBytes: r.peakMemoryBytes,
1444
+ memoryLimitBytes: r.memoryLimitBytes,
1442
1445
  // Already parsed objects on the way out of the store — passed through as
1443
1446
  // they are. Re-parsing them would throw, and the old helper's `catch`
1444
1447
  // swallowed that into `undefined`, silently emptying the panel.