Skip to content

Display specs 4/4: Let agents check a display - #410

Merged
j-asefa merged 13 commits into
mainfrom
display-specs/04-check-tool
Nov 21, 2026
Merged

j-asefa merged 13 commits into
mainfrom
display-specs/04-check-tool

Conversation

@j-asefa

@j-asefa j-asefa commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

What

Add loop_check_display alongside loop_diagram for provider-key runs and native harnesses. Agents can validate raw or fenced display lines, get a short success result with the element count, and get line and element diagnostics plus the component reference for invalid displays.

Scope

The checker uses the shared display parser and reports individual diagnostic locations within an 8,000-character budget. It counts omitted diagnostics and always includes the summary and reference. The component names and numeric reference limits come from the renderer. The checker performs no database reads or writes of its own and creates no dispatch receipt, artifact, answer, or result. The normal run access checks and outer tool activity apply. Review sessions still expose only loop_review_read. The diff has no migrations, SQL module, dependency, UI, system prompt, or API contract changes.

Verification

  • Commit 2095817676fe2ea1c58a0e2e5a138e571ea26866.
  • 144 focused tests passed across activities-integration, activities-server, fleet-work-propagation, fleet-tool-revocation, and display-spec. The native binding fixture checks schema compatibility, the catalog, correctable problems, source limits, and unchanged SQLite total_changes().
  • npm run check exited 0 with 445 contract tests.
  • check: assets passed in 0.2 s
  • check: format passed in 26.4 s
  • check: typecheck passed in 23.9 s
  • check: openapi passed in 0.9 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 167.2 s
  • check: all passed
  • npm run build exited 0.
  • npm run test:native exited 0 with 512 passing tests.
  • The provider and native harness evidence comes from fixtures. No isolated authenticated development workspace was verified for a live harness call.

Follow-up verification

On a641c608de4ce6a8a48f46ec057912c642a19558, focused tests, build, and npm run check exited 0. npm run test:native exited 0 with 512 passing tests.

  • check: assets passed in 0.2 s
  • check: format passed in 24.3 s
  • check: typecheck passed in 4.0 s
  • check: openapi passed in 0.8 s
  • check: sql-index passed in 0.2 s
  • check: contracts passed in 161.9 s
  • check: all passed

GitHub Actions run 44809034458 passed the required check and all three shards.

Loop review

GitHub Actions run 44805864989 passed the check and all three test shards. Loop review r1 32970680-763b-444e-9901-635450c307e2 completed on 2095817 with all three reviewers, one P2, one P3, and no P1/security findings. Both fixed in a641c60. The diagnostic budget preserves the summary and reference even with thousands of invalid lines or repeated long keys. Quoted, shortened fields preserve diagnostic boundaries. The fence wrapper accepts the reader’s standard closing indentation. The revised head passed 102 focused tests, the full check (445 contracts), and the build. Incident regression cases use 2,000 malformed lines and repeated 525-character keys. Both the 512-test native rerun and GitHub CI passed.

Loop review r2 54ed7c10-fa8a-4ed3-8c8c-d42ece952342 completed on a641c60 with all three reviewers, one P2, one P3, and no P1/security findings. Commit 91a978c66f85e95a37eda4ef1367879803287d15 fixes both. The native binding fixture rejects an unlabeled Markdown wrapper and accepts a spec language token with opening-line metadata and with encoded whitespace. A display at the reader's size limit still validates and the tool explains that the complete loop_reply body has its own 30,000-character limit.

On 91a978c66, 156 focused tests passed across activities integration and server, display parser and rendering, open display fences, and reply publication.

The fresh build and npm run check exited 0 (445 contracts). Both Codex reply-publication fixtures passed. The full 512-test native run above was on the preceding commit. The follow-up leaves native dispatch and the reply size threshold as before.

  • check: assets passed in 0.1 s
  • check: format passed in 22.8 s
  • check: typecheck passed in 15.9 s
  • check: openapi passed in 0.9 s
  • check: sql-index passed in 0.2 s
  • check: contracts passed in 163.2 s
  • check: all passed

GitHub Actions run 44812184212 passed the required check and all three shards on 91a978c66. Full Loop review r3 560a0ff7-09b5-46a4-adbb-1d15763d9cfe completed on that commit with three reviewers, two P2s, one P3 and no P1 or security findings. Commit db591a564 fixes all three findings. A fixture API provider received the oversized-block diagnostic and completed the run. A native Pi-protocol call successfully checked a 16-Text display with over 128,000 UTF-8 bytes, and the same-sized request naming another tool received HTTP 413. The checker validates within-limit source after Markdown removes the wrapper indentation. The remaining observation about repeated table references was raised as unmeasured performance work.

Verification on db591a56472f0bee20180947de40774f95140084

The focused activities-integration, activities-server, agent-mail-native, antigravity-native, display-spec and display-spec-render fixtures passed (146 distinct tests). The fresh build and npm run check exited 0 (445 contracts).

  • check: assets passed in 0.2 s

  • check: format passed in 21.9 s

  • check: typecheck passed in 6.6 s

  • check: openapi passed in 0.8 s

  • check: sql-index passed in 0.3 s

  • check: contracts passed in 167.4 s

  • check: all passed

  • Local Vitest with --maxWorkers=1 per shard ran 3,433 tests. Shards 1 and 2 exited 1 with three and six timeouts respectively across conversation-feed-state, fleet-enrollment, fleet-handoff, and fleet-catalog-capabilities. Shard 3 exited 0 with 1,091 passing. All nine failed cases passed in targeted reruns with their original timeout. The enrollment fixture also timed out with its default limit at base 87525aed0.

  • The initial npm run test:native exited 1 with 511 passing and one ECONNRESET in the private control socket fixture. Its worker stopped making progress and was terminated so the suite could continue. The entire test/connection.node.test.ts file passed all eight tests in isolation. The fresh full native repeat with the other local suites stopped exited 0 with all 512 passing.

  • The provider and bridge observations come from fixture runs. No live provider or device was exercised.

GitHub Actions run 44819165945 passed the required check and all three shards on db591a564. Full Loop review r4 943dcf21-4818-461a-8500-e16a1d2094a2 completed on that commit with three reviewers, one P2, one P3 and no P1/security findings. Commit 0ae83afda replaces retained request strings with fixed-size SHA-256 digests while keeping request identity rejection. The checker parses a single Markdown fence through the end of a finished answer and uses the parser's preserved CRLF, so it measures the same source as the renderer. The 58 focused tests exited 0. The bridge fixture sent a large UTF-8 display through the standard MCP transport and through Pi, repeated identical arguments under one ID, and received HTTP 409 after changing those arguments. The checker and renderer fixtures both accept the open fence and apply the same size budget. Heap usage under many calls was not measured.

Verification on 0ae83afda97d59090ba975a7247a7760fcaea4bf

The 58 focused tests passed. The fresh build and npm run check both exited 0. The contract suite passed 445 tests.

  • check: assets passed in 0.1 s
  • check: format passed in 21.6 s
  • check: typecheck passed in 5.1 s
  • check: openapi passed in 1.0 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 158.9 s
  • check: all passed

All three local Vitest shards exited 0 with one worker per shard, for 1,263, 1,079 and 1,091 passing tests respectively. The first native run received SIGTERM after 252 tests passed and before the remaining tests could finish. The standalone npm run test:native rerun exited 0 with all 512 tests passing.

GitHub Actions run 44827938998 passed the required check and all three shards on 0ae83afda. Full Loop review r5 7a7c908f-11d0-4ac2-9faa-426506af37c4 completed on that commit with three reviewers, one P2, one P3 and no P1/security findings. Commit dc68ca61c returns malformed checker arguments as a correctable tool result. The API fixture sent a numeric spec, received the diagnostic, and finished the run. The checker reports the series name and both counts when a chart would drop extra values. Existing chart rendering keeps its historical behavior. An oversized malformed bridge request again receives HTTP 413. The 127 focused tests exited 0. The observation about repeated table validation remains an unmeasured performance concern.

Verification on dc68ca61c4d833eaf91c1b0b474cb7435f87a35b

The 127 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with all 512 tests passing.

  • check: assets passed in 0.2 s
  • check: format passed in 23.7 s
  • check: typecheck passed in 4.6 s
  • check: openapi passed in 0.8 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 154.8 s
  • check: all passed

Local Vitest shard 1 passed 1,262 tests and exited 1 on a single five-second timeout in the fleet-enrollment fixture that also timed out on the base during r3. A targeted rerun timed out while another shard was active. With the other local suites stopped, the fixture passed in 4.43 seconds under its original limit. Local shards 2 and 3 exited 0 with 1,080 and 1,091 tests passing respectively.

GitHub Actions run 44832888289 passed the required check and all three shards on dc68ca61c. Full Loop review r6 baf436a0-e5e5-48b0-82ea-07677389ea07 completed on that commit with all three reviewers, one P2 and no P1/security findings. Commit 4a61802d1 reports table cell overflow at the element and row. The checker fixture accepts rows that fit or need padding and reports the first supplied overflow. Existing test fixtures still draw normalized tables. Inspection of the installed MCP SDK confirmed that it accepts arbitrary string request IDs. The standard MCP bridge now applies the existing Pi limit before caching and the HTTP fixture confirms rejection at 200 characters. All 127 focused tests passed. Practical effects of API checker call-ID reuse and repeated synchronous validation were not established.

Verification on 4a61802d1628e9bdbe32a3ef549eebff0ebf742c

The 127 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with all 512 tests passing.

  • check: assets passed in 0.1 s
  • check: format passed in 22.0 s
  • check: typecheck passed in 13.8 s
  • check: openapi passed in 1.0 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 155.4 s
  • check: all passed

Local Vitest ran all three shards. Shard 1 passed 1,261 tests and had assertion failures in library-route-contracts (preferences event count) and run-checkouts (Git CRLF status). Shard 2 passed 1,079 tests with a five-second timeout in fleet-directory-sync. Shard 3 passed 1,090 with a five-second timeout in fleet-handoff-http. All four failing cases passed together with one worker and with the full local suites stopped, using their original limits.

GitHub Actions run 44837050615 passed the required check and all three shards on 4a61802d1. Full Loop review r7 228ad0b7-68f3-4153-b4f8-ed27cedcdc57 completed with all three reviewers, one P2, one P3 and no P1/security findings. Commit e6371681c warns when a leaf component would omit its children. It also preserves long IDs on standard MCP and keeps fixed-size bridge cache keys. The existing identity still reaches dispatch, and Pi retains its transport limit. The checker now validates each referenced table once and counts every visit toward the existing display budgets. The fixtures confirmed leaf diagnostics, the accepted long standard MCP ID, Pi's 400 response, and one table warning for two drawn references. All 128 focused tests passed. Shared-host latency and heap use were not measured.

Verification on e6371681ca3b0ebe76309116186acfb6564974ad

The 128 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with all 512 tests passing.

  • check: assets passed in 0.2 s
  • check: format passed in 22.4 s
  • check: typecheck passed in 14.2 s
  • check: openapi passed in 0.9 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 157.0 s
  • check: all passed

All three local Vitest shards exited 0 with one worker per shard. The counts were 1,263, 1,080, and 1,092.

GitHub Actions run 44841282400 passed the required check and all three shards on e6371681c. Full Loop review r8 f6abc11e-2517-4f48-b10c-7295c32975b6 completed with all three reviewers, one P2 and no P1/security findings. Commit 2e8e40e6b hashes the original request ID code units. The Pi fixture confirmed two distinct unpaired surrogate IDs received their own results for different arguments. The checker also reports child types outside the documented Fields and Actions catalogs while preserving historical rendering. The 128 focused tests passed. Heap retention during a pending approval remains an unmeasured concern.

Verification on 2e8e40e6b337f120b4c92f53384cae19ebecdab4

The 128 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with 512 tests passing.

  • check: assets passed in 0.2 s
  • check: format passed in 22.1 s
  • check: typecheck passed in 4.9 s
  • check: openapi passed in 0.8 s
  • check: sql-index passed in 0.2 s
  • check: contracts passed in 148.4 s
  • check: all passed

All three local Vitest shards exited 0 with one worker per shard. The counts were 1,263, 1,080, and 1,092. In GitHub Actions run 44844745093 attempt 1, the required check had one failure in library-route-contracts: runCheckout projects a captured Git checkout without internal capture coordination received a different capture ID and timestamp from the expected snapshot. That case passed locally in isolation, and the full local check had already passed. The required check passed on attempt 2 on the unchanged commit, and all three test shards passed on attempt 1.

GitHub Actions run 44844745093 is green. Full Loop review r9 1ff9afd4-dbd1-4e1b-978b-c15be544ff19 completed with all three reviewers, one reported P2 and no P1/security findings. The near-limit tests cited used different inputs. The installed Markdown parser preserves internal CRLF. The new exact-input fixture confirms the checker and renderer both accept the same indented CRLF fence at the limit and reject the same fence above it. Commit f48472fab also fixes the separately confirmed leading BOM case by following Remark's fence detection. The test exercises both versions of the same source with and without a BOM. All 118 focused tests passed. The existing repeated chart validation path was observed without a measured latency impact.

Verification on f48472fab98e05d2d8c0286db1c42c42a6b35910

The 118 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with 512 tests passing.

  • check: assets passed in 0.2 s
  • check: format passed in 24.2 s
  • check: typecheck passed in 2.4 s
  • check: openapi passed in 0.9 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 157.7 s
  • check: all passed

Local Vitest shard 1 passed 1,262 tests and exited 1 on a single five-second timeout in fleet-enrollment: resumes a published but unconfirmed member only with fresh consent and its locally issued inactive grant. The enrollment case passed in 4.40 seconds with other local suites stopped and the original five-second timeout. Local shards 2 and 3 exited 0 with 1,080 and 1,092 tests passing respectively.

GitHub Actions run 44848869056 passed the required check and all three shards on f48472fab. Full Loop review r10 5d758135-f95c-4dbe-a4b3-8772af389a09 completed with all three reviewers, one P3 and no P1/P2/security findings. Commit 498c39f7a accepts valid Actions with other drawn children. The exact-input fixture confirmed the checker accepts an Actions group with Text and a LinkButton and the renderer draws both. The checker reuses each validated chart as it does a table and continues charging the display budgets per reference. All 119 focused tests passed. Latency under repeated calls was not measured.

Verification on 498c39f7a05c7bfef5ffdc34429d370127aa7079

The 119 focused tests passed. The fresh build and npm run check exited 0 (445 contracts).

  • check: assets passed in 0.2 s
  • check: format passed in 24.0 s
  • check: typecheck passed in 3.9 s
  • check: openapi passed in 1.0 s
  • check: sql-index passed in 0.3 s
  • check: contracts passed in 153.3 s
  • check: all passed

Local Vitest shard 1 passed 1,262 tests and exited 1 on the five-second fleet-enrollment timeout also seen on the base during r3. That fixture passed in 4.40 seconds in isolation with its original timeout. Local shards 2 and 3 exited 0. The initial native run exited 1 with 511 passes and one failure at the orphan-cleanup assertion in heavy-command.node.test.ts. That case passed in isolation in 248 ms. The standalone full native rerun exited 0 with all 512 tests passing.

GitHub Actions run 44853134922 passed the required check and all three shards on 498c39f7a. Full Loop review r11 b0f5b37a-91b8-4666-aaf9-95398eaa4902 completed with all three reviewers, one P2, one P3 and no P1/security findings. Commit 1cb5d029a returns a retry message promptly for native display checks received during an approval. The fixture sent a large Pi request while another call awaited approval, observed the retry message before its 1.5-second client timeout, and verified that the run still awaited approval. The checker uses submitted line numbers for patch diagnostics, and exact-input tests show a standalone fence in a quote or list item passes and renders. All 130 focused tests passed. Aggregate heap impact was not measured.

Verification on 1cb5d029ac59127e4ad72694904ffd92d6c2ae5c

The 130 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with 512 tests passing.

  • check: assets passed in 0.2 s
  • check: format passed in 22.1 s
  • check: typecheck passed in 4.0 s
  • check: openapi passed in 0.7 s
  • check: sql-index passed in 0.2 s
  • check: contracts passed in 151.9 s
  • check: all passed

Local Vitest shard 1 passed 1,262 tests and exited 1 on a single five-second timeout in fleet-enrollment: resumes a published but unconfirmed member only with fresh consent and its locally issued inactive grant. The enrollment fixture passed in 4.27 seconds in isolation with its original five-second timeout. Local shards 2 and 3 exited 0 with 1,082 and 1,092 tests passing respectively.

GitHub Actions run 44856495244 passed the required check and all three shards on 1cb5d029a. Full Loop review r12 47bedb97-b658-4fa4-8606-8c660f81b11a completed on that commit with all three reviewers, two P3s and no P1/P2/security findings. Commit 62496f8b4 splits the display-check quota from the ordinary native tool quota while comparing duplicate IDs across both caches. The Pi fixture filled the display-check quota, observed the rejection of a fresh check and of a cross-tool reused ID, and then reached approval with a fresh ordinary tool request. The checker gives nested wrappers up to 524,288 submitted characters and tells the agent to submit raw patch lines if it exceeds that cap. The same nested input that exceeded the former wrapper cap now passes the checker and renderer. The extracted display still has a 65,536-character limit. All 130 focused tests passed.

Verification on 62496f8b4eda759ed80b1540b0ad3881f04aeff7

The 130 focused tests passed. The fresh build and npm run check exited 0 (445 contracts). The full native suite exited 0 with 512 tests passing.

  • check: assets passed in 0.2 s
  • check: format passed in 20.7 s
  • check: typecheck passed in 2.2 s
  • check: openapi passed in 0.7 s
  • check: sql-index passed in 0.2 s
  • check: contracts passed in 154.6 s
  • check: all passed

Local Vitest shard 1 passed 1,262 tests and exited 1 on the five-second enrollment fixture refuses expired or rebound ceremonies and a changed local directory. It also timed out on the base during r3. The enrollment fixture passed in 3.84 seconds in isolation under its original timeout. Local shards 2 and 3 exited 0 with 1,082 and 1,092 tests passing respectively.

GitHub Actions run 44859537575 passed the required check and all three shards on 62496f8b4. Full Loop review r13 4cc40c5b-e85e-47ef-882d-8ef341d5a572 completed on 62496f8b4. All three reviewers completed. There were no P1, P3, or security findings. The one P2 documents a transport trade-off under the handoff review rule.

The native bridge caps the complete JSON request at 512 KiB. The checker separately caps submitted text at 524,288 UTF-16 code units and extracted display source at 65,536. A fixture with 16 CJK text elements passed the checker as 146,101 bytes of raw Pi request JSON. The same patches with a heavily nested quote wrapper passed the direct checker and measured 609,395 bytes in the Pi envelope. That wrapper exceeds the native bridge body limit. Native callers can send just the JSON Patch lines in spec while keeping the nested formatting in the published answer. A fully escaped raw source at the reader limit takes at most 393,216 bytes before ordinary envelope overhead. This keeps the full raw display budget usable while bounding bytes buffered and parsed before tool selection. Rounds 3, 4, 11 and 12 traced both sides of this trade-off. The 512 KiB bridge cap is retained and the boundary is recorded in the handoff. Aggregate memory under repeated calls and real harness behavior remain unmeasured.

The reviewed commit satisfies the handoff merge gate with the P2 documented and all CI jobs passing. This follow-up changes the PR description and handoff ledger only.

j-asefa and others added 13 commits November 20, 2026 19:29
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@j-asefa
j-asefa merged commit 2c6057d into main Nov 21, 2026
4 checks passed
@j-asefa
j-asefa deleted the display-specs/04-check-tool branch November 21, 2026 03:25
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.

1 participant