Plan: the reviewer’s call shape, observed on Vertex (#193)
Closes: #193. Branch: test/reviewer-live. Status: Done (2026-09-21) — the suite runs green on this box’s ADC
TL;DR
#192 pinned what leaves pi-workflow against faked providers and pi-ai’s
real clampThinkingLevel. Nothing has yet observed the new shape reaching
a real adapter and a real verdict coming back. This adds the observation
as a standing suite - reflection-review.live.test.ts - and pins the
plan-review log fields #192 left to the commit path.
Operator-run only, never automatic. Live suites are the same class as
plan-judge.live.test.ts, safety.live.test.ts and pi-vertex’s: the
root vitest.config.ts excludes */.live.test.ts unless
PI_TEST_LIVE=1, and only node tools/task.mjs test:live, run by hand,
sets it. validate never runs them, so neither does CI; they are not
part of the model battery (tools/model-battery, a separate operator
tool) either. Without credentials the suite is a visible skip.
Design
The registry. pi-modes' test/live-vertex.ts already builds the real
pi-vertex provider over ADC (buildLiveRegistry, liveCredentialsPresent);
pi-workflow imports it the way that file imports pi-vertex (a relative
path across packages/). It returns pi-modes' JudgeModelRegistry;
pi-workflow’s runReflectionReview takes ReviewModelRegistry
(packages/pi-workflow/model-registry.ts) - the same three members
(find, getProvider().streamSimple, getApiKeyAndHeaders), structurally
compatible, passed as never exactly as the unit suites pass their fakes.
Its getProvider().streamSimple is wrapped once more in the test to record
the options pi-workflow passed, so "on the wire as clamped" is asserted
on the object handed to pi-ai - the same seam the unit tests read, now
with a real answer behind it.
Why these three levels. pi-vertex turns its catalogue into the fields
pi-ai’s clampThinkingLevel reads (packages/pi-vertex/index.ts
thinkingLevelMap(entry): offSupported: false → off: null;
thinking: adaptive with xhigh: true → xhigh: "xhigh"; every entry
with thinking set is reasoning: true). From models.json: fable is
adaptive, offSupported: false, xhigh: true → map {off: null, xhigh:
"xhigh"}, so off clamps up to minimal and xhigh stands; sonnet is
adaptive, xhigh: false → no map, so xhigh clamps down to high and
off is allowed. The same shapes are pinned against pi-ai’s clamp in
review-thinking-wiring.test.ts (#192); here they land on the real
catalogue and a real answer. Each live call passes timeoutMs: 170_000
in deps, under the 180 s vitest timeout, so a slow model is the
review’s own unreviewed outcome, not a vitest kill. Erratum
(2026-09-21): the bound is per ask and a review makes at most two (the
nudge), so timeoutMs: 120_000 under a 260 s case bound (cold-review
catch).
Test categories. The three live cases are a contract test: the options
object handed to pi-ai (the wire this package owns) and the answer’s form
coming back. The plan_review.done case is a regression pin on fields
plan-pause.ts already ships without a handler-level assertion.
The cases (one small clean diff, describe.skipIf(!liveCredentialsPresent()),
180 s each):
| Reviewer, asked for | Level sent | Asserted |
|---|---|---|
|
|
|
|
|
reviewed; |
|
|
reviewed; |
The diff is the same fixture the unit suites use (a two-line change with an SPDX header), so a FLAGS is possible but a verdict is not optional: the assertion is on the form, not on CLEAN.
The plan-review log fields (unit, not live): plan-review-pause.test.ts
gains two cases through the real exit_plan_mode handler, and the
harness extensions they need: the Scripted union gains an optional
usage on { review } and a { review, stopReason } form; the fake
registry’s find returns a reasoning-declaring model ({ id, reasoning:
true }) so the clamp yields a level other than off; the bridge in
harness() publishes thinkingLevel: () ⇒ "high". Case one: a
{ review: CLEAN, usage } step - plan_review.done carries wanted:
"high", wantedSource: "session", level: "high", usage. Case two:
two verdict-less { review } steps (the answer, then the nudge’s answer)
- plan_review.done is unreviewed with reason naming the missing
verdict and partial equal to the second body.
Scope
| File | Change |
|---|---|
|
new; the three live cases |
|
one case: the #192 log fields on |
|
|
|
the canonical page for the suites: the |
No source change. No version bump beyond what the next release carries.
Risks
| Risk | Direction | Mitigation |
|---|---|---|
A live case fails on a real answer shape (a model that ignores the form) |
fail-closed (red |
the assertion is on the verdict line’s presence, which the #192 nudge already covers; a red run here is a finding about #192, not noise |
Cost: three fable/sonnet calls per run |
silent |
the root |
Credentials absent on a box |
fail-open on the observation (nothing is checked) |
|
Delivery
-
Branch
test/reviewer-live; commit this plan (docs:), nav entry under Active. -
The live file and the plan-review case;
task test:livefor pi-workflow green here;validategreen. -
CHANGELOG and
testing.adoc; MRCloses #193; merge; one line on #193 with the SHA and the observedusage/levelfrom the live run; plan Status → Done, nav → Archive.