Skip to content

test(experiments): route the turn-surface live collector over the measured bridge tools - #4035

Merged
schlessera merged 2 commits into
mainfrom
test/3886-turn-surface-catalogue-subset
Nov 15, 2026
Merged

schlessera merged 2 commits into
mainfrom
test/3886-turn-surface-catalogue-subset

Conversation

@schlessera

@schlessera schlessera commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #3886

What changed

The retained #587 live collector (scripts/measure-turn-surface-live.ts) now routes over the core tools, the eight brain-ui bridge tools that createBrainUiMcpServer registered at the measured source (380ad6eaf), and the frozen skills. Every later bridge tool is excluded by name through measuredRoutingTools in scripts/turn-surface-classifier.ts. The bridge now registers 41 tools, so before this change the catalogue was 25 core + 41 bridge + 16 skills = 82 entries, and wideRoutingRequest refused every routed arm. With the filter it is 25 + 8 + 16 = 49. The 64-entry guard is unchanged, but it now names the bound and the catalogue size (Invalid routing catalogue: 82 tool and skill entries exceed the 64-entry bound), and empty catalogues get their own message. The collector also fails if one of the eight measured bridge tools is no longer listed.

Why this shape

This follows the maintainer's 2026-11-11 ruling on the issue (option 3: a reviewed subset). The pinned list matches the archived native catalogue's bridgeLoadedSchemaNames (measurement archive at 48227b09) and the createBrainUiMcpServer source at 380ad6eaf, which registered only show_block, get_current_location, the four ask_user* tools, request_image_mask and query_activity. Raising the bound (option 1) would give it no measured meaning. Shortlisting (option 2) would change the design #587 measured. Core brain tools are left unfiltered, as the issue scope says. They grew from 8 at the measured source to 25, so the 15 slots of headroom left under the bound now come from core.

Prior work: #4021 (#3788) did not resolve this. On origin/main eb3c53ac2 the experiment still failed on cell 2 with turn_error_or_missing_raw_usage, and the fixture's bridge still lists 41 tools.

Proof

Failing-first (on origin/main eb3c53ac2, before the change):

  • bun run test ./experiments/turn-surface-fixture-live.test.ts → (fail) whole live collector indexes, routes, claims, executes and drains all four arms keylessly: 2/20 hint rep1 quote-card excluded, error: turn_error_or_missing_raw_usage.
  • New bound test against the old guard → Expected substring: "Invalid routing catalogue: 65 tool and skill entries exceed the 64-entry bound", Received message: "Invalid routing catalogue".

After: bun run test ./experiments/turn-surface-classifier.test.ts ./experiments/turn-surface-fixture-live.test.ts → 7 pass, 0 fail. The receipt assertions in turn-surface-fixture-live.test.ts are unchanged.

Mutations (each restored, tree clean afterwards):

  1. Drop the measuredRoutingTools call in the collector → the live-collector test fails again with turn_error_or_missing_raw_usage. The cell's private error file reads Invalid routing catalogue: 82 tool and skill entries exceed the 64-entry bound.
  2. Swap the by-name filter for a truncation (tools.slice(0, core + 8)) → (fail) the live collector routes over the measured bridge tools only, excluded by name on toEqual.
  3. Truncate an over-bound catalogue silently instead of throwing → (fail) a catalogue over the 64-entry bound is refused by name, never truncated: Received function did not throw.
  4. Remove the missing-measured-tool check → the subset test fails: Expected substring: "Measured bridge routing tools missing: show_block", Received function did not throw.

Root tsc --noEmit: clean. It needed NODE_OPTIONS=--max-old-space-size=12288 locally because the default heap aborted.

bun run check:pr --base origin/main
{"version":1,"kind":"brain-check-pr-receipt","head":"4570672077284cd77104a8c89b7f3b35c3c8acaa","base":"origin/main","mode":"focused","startedAt":"2026-11-15T19:39:33.155Z","finishedAt":"2026-11-15T19:40:58.773Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12923.299192999999},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":129.20517499999914},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":98.74039999999877},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.72941400000127},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":72433.01144399999}]}

Checklist

  • Focused local preflight/behavioral receipts passed. Hosted proof runs on confirmation.
  • Acceptance criteria from the issue are all met.
  • The PR and experiments: the turn-surface live collector refuses every routed arm once the bridge roster passes the 64-entry catalogue bound #3886 carry milestone 0.45.0.
  • No changeset: experiment harness only, nothing a consumer can see.
  • No personal data in the diff.
  • Nothing in the machine surface moved.
  • Nothing documented moved. docs/decisions/turn-surface-routing.md describes a provider rerun at the measured source, which this does not touch.
  • Guard checklist: the 64-entry check is a research-harness input bound, not a product security guard. It triggers only when a wide routing catalogue exceeds 64 entries or is empty, and restricts one offline/live collector run. It refuses instead of truncating because a truncated question would measure something Spike: route each turn's tool and skill surface through Jev, so unneeded definitions stay out of the prompt #587 never measured. It clears once the catalogue fits. The cause is in the thrown message, which the collector writes to the cell's private error file. The new missing-tool check has the same scope. Nothing outside scripts/measure-turn-surface-live.ts calls either.
  • Provider history: nothing on a production turn's path changed.

Anything left open

Nothing. Collisions: see the comment below.

🤖 Generated with Claude Code

…sured bridge tools (#3886)

The retained #587 live collector built its routing catalogue from every
registered bridge tool. The bridge now registers 41, so core plus bridge
plus skills passed the 64-entry bound in wideRoutingRequest and every
routed arm was refused before the classifier ran.

Following the 2026-11-11 ruling (option 3), the collector now routes over
the eight bridge tools registered at the measured source, filtered by
name, and fails when one of them is no longer listed. The 64-entry guard
is unchanged and now names the bound and the catalogue size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera schlessera added this to the 0.45.0 milestone Nov 15, 2026
@schlessera schlessera added type: test Coverage, harness or proof work with no behaviour change. area: ci CI workflows, the gates they run, release scripts, packaging. labels Nov 15, 2026
@schlessera

Copy link
Copy Markdown
Owner Author

Collisions at head 4570672077284cd77104a8c89b7f3b35c3c8acaa (bun scripts/collisions.ts --json --pr 4035): no path or unknown reports. There are closure-only overlaps with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4018, #4022, #4024, #4028, #4030, #4032 and #4034, which share affected workspaces or categories but no files.

@schlessera
schlessera marked this pull request as ready for review November 15, 2026 23:03
@schlessera
schlessera merged commit 849751e into main Nov 15, 2026
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, the gates they run, release scripts, packaging. type: test Coverage, harness or proof work with no behaviour change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

experiments: the turn-surface live collector refuses every routed arm once the bridge roster passes the 64-entry catalogue bound

1 participant