Skip to content

test(ui-server): hold the integrated reference cell's latency to measured thresholds (#3513) - #4103

Merged
schlessera merged 7 commits into
mainfrom
test/3513-integrated-latency-thresholds
Nov 17, 2026
Merged

schlessera merged 7 commits into
mainfrom
test/3513-integrated-latency-thresholds

Conversation

@schlessera

@schlessera schlessera commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #3513

What changed

The integrated reference cell (scripts/native-proof/reference-integration.native.ts) now runs under the Git workload of #3513 on both backend tool paths. Its repository gains three incompressible 2 MiB charts. Its first turn ends with a warm read of the same source. Through every turn the parent samples GET /api/health, WebSocket ping/pong, the pool's peak physical allocation (from sysfs, never through the manager) and the pool device's block I/O. The child times each reference tool call at the model boundary. The results land in reference-integration-latency.json with kernel, btrfs-progs, Git, Bun and candidate identities, and are held to INTEGRATED_TOLERANCES.

This is the last remaining criterion of #3513. #3676 delivered allocation and reuse (case 19), and #4072 delivered EDQUOT, cancellation, crash recovery and per-step I/O. #4079 (PR #4080) removed the blocker that refused the cell's first reference_source call on hosted runners.

Why this shape

The instrument was written on test/3513-integrated-latency before #4072 merged. It is ported onto main as one commit rather than rebased, because the case-19 parts of that branch already landed through #4072's squash.

Warm-read bounds are per backend. Claude's time is the MCP call alone (2 ms). Pi's time includes its agent loop's round trip through the offline provider, about 0.7 s on any step.

Both TEMPORARY probe commits (ea71984 baseline, 639585b mutation round) are reverted on the head. The final diff touches only the four integrated-cell files.

Proof

Baseline. Draft heavy feedback run 43969834503 ran on hosted runtime_host at ea71984c3, with a TEMPORARY probe and every bound open. It ran two integrated cells per backend, and all four passed. Environment: kernel 7.0.0-1017-azure, btrfs-progs v6.6.3, Git 2.43.0, Bun 1.4.2.

Measure (worst of 4 cells) Claude Pi Bound
/api/health p95 / max 6.1 / 86.4 ms 5.3 / 14.5 ms 50 / 500 ms
WS ping/pong p95 / max 4.8 / 13.2 ms 6.3 / 14.7 ms 50 / 250 ms
cold reference_source 1,188 ms 1,264 ms 4,000 ms
warm reference_source 2 ms 744 ms 250 / 2,000 ms
first-turn peak allocation 14.7 MiB 14.7 MiB 20 MiB
health failures, lost pongs, extra source roots on warm read 0, 0, 0 0, 0, 0 0

Per-turn I/O, elapsed times and per-turn latency summaries are in each cell's reference-integration-latency.json (artifact runtime-host-proof).

Mutation receipt. Draft heavy feedback run 43979866942 completed success at 639585b87 (runtime_host checkout 639585b873614c7f54e576c727214223e274713f). In that run, each backend's integrated cell ran with the measured bounds and then with one bound set below its measured value:

Integrated reference proof passed (claude).
Integrated reference proof passed (pi).
MUTATION RECEIPT {"breach":{"coldSourceMs":100},"expected":"INTEGRATED_CLAUDE_COLD_SOURCE_ELAPSED","exit":1,"firstFailure":"INTEGRATED_CLAUDE_COLD_SOURCE_ELAPSED"}
Tolerance breach failed INTEGRATED_CLAUDE_COLD_SOURCE_ELAPSED as intended.
MUTATION RECEIPT {"breach":{"wsP95Ms":0.1},"expected":"INTEGRATED_PI_WS_LATENCY","exit":1,"firstFailure":"INTEGRATED_PI_WS_LATENCY"}
Tolerance breach failed INTEGRATED_PI_WS_LATENCY as intended.

The probe required each breached cell to exit non-zero and to fail first on the named assertion, and it would have failed the job otherwise. Restored, both cells pass under the measured bounds. The final head differs from 639585b87 only by the revert of the probe (the breach override and the cell loop).

Typecheck and lint pass locally (tsc --noEmit, bun run lint). The integrated cell needs owned Btrfs loop devices, which this host cannot attach, so it has no local run. Its evidence is the two hosted runs above.

{"version":1,"kind":"brain-check-pr-receipt","head":"3587bbbffb2ad08a8ac6cb88ef01cd1e15ec67cb","base":"origin/main","mode":"focused","startedAt":"2026-11-17T00:16:47.467Z","finishedAt":"2026-11-17T00:18:38.046Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":17529.080801},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":206.17150599999877},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":143.39665400000013},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":24.26394100000107},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":92657.24038199999}]}

Checklist

  • Focused local preflight/behavioral receipts and complete selected hosted proof passed; actual head/base/job checkout evidence is in Proof.
  • Acceptance criteria from the issue are all met, or the gap is named below.
  • The PR and completed/advanced issues have verified release milestones under docs/process/github.md.
  • A changeset is included, or this changes nothing a consumer can see. (Proof scripts only.)
  • No personal data anywhere in the diff — the leakage gate covers the whole tree.
  • The integration contract index or relevant component is updated in this same commit, or nothing in the machine surface moved.
  • Docs under docs/ reflect the change, or nothing documented moved. (scripts/native-proof/README.md updated.)
  • A fail-closed guard added or changed answers the proportionate-containment checklist in this body, or no guard changed.
  • Provider history stays append-only: the provider-history guard passes, or nothing on a turn's path changed. (The cell's existing provider-history assertions are unchanged.)

Anything left open

Nothing for #3513. With #3676 and #4072, this meets the last criterion.

Collisions (bun scripts/collisions.ts --json --pr 4103 at 3587bbb): closure only with #3054, #3056, #3059, #3069, #3581, #3622, #4036, #4102, #4104, #4106, #4112, #4113 and #4115. #4002 also edits scripts/native-proof/README.md, in a different section. No direct code-path collision.

🤖 Generated with Claude Code

schlessera and others added 2 commits November 16, 2026 20:47
…egrated reference cell (#3513)

The integrated cell's repository gains three incompressible charts, its first
turn ends with a warm read of the same source, and the parent samples
/api/health, WebSocket ping/pong, the pool's sysfs peak allocation and the
pool device's block I/O through every turn on both backends. The child times
each reference tool call at the model boundary. The measurements land in
reference-integration-latency.json and are held to INTEGRATED_TOLERANCES.

The cell also makes its artifact tree readable on exit, so the receipt upload
survives the app's owner-only data, and prints the app's warnings into the
job log.

Ported from the instrument branch onto main after #4072 and #4079.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ence cell's baseline (#3513)

Reverted before the PR is ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera schlessera added this to the 0.45.0 milestone Nov 16, 2026
schlessera and others added 3 commits November 16, 2026 23:28
…ed reference cell's baseline (#3513)"

This reverts commit ea71984.
…osted baseline (#3513)

INTEGRATED_TOLERANCES now comes from the hosted runtime_host baseline: two
integrated cells per backend at ea71984 (draft heavy feedback run
43969834503). Each bound records the worst measured value beside it. The warm
source bound is per backend, because Pi's model-boundary time includes its
agent loop's round trip through the offline provider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll's tolerances (#3513)

Each backend's integrated cell runs once with the measured bounds, which must
pass, and once with one bound set below its measured value, which must fail
first on that bound's named assertion. Reverted before the PR is ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera
schlessera marked this pull request as ready for review November 17, 2026 00:23
@schlessera
schlessera merged commit 40779d4 into main Nov 17, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-server: qualify allocation and latency across repository acquisition and managed worktrees

1 participant