[PR #7469] [MERGED] fix(mcp): summarize copied browser observations in input declarations #7857

Closed
opened 2026-11-05 01:48:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7469
Author: @gensokyo-dev
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/4973-claude-full-schema


📝 Commits (1)

  • b16fc6b fix(mcp): summarize copied browser observations in input declarations

📊 Changes

8 files changed (+158 additions, -66 deletions)

View changed files

📝 docs/mcp-contracts.md (+13 -2)
➕ src/contracts/inputObservationPresentation.test.ts (+70 -0)
📝 src/contracts/inputSchemaPresentation.ts (+32 -18)
📝 src/contracts/toolSchemaMetadata.ts (+1 -1)
📝 src/domain/browserScenarioDiffValues.ts (+8 -6)
📝 src/domain/webCaptureDiffSchemas.ts (+6 -3)
📝 tests/boundary/mcp/browserComparisonInput.test.ts (+19 -9)
📝 tests/boundary/mcp/toolSchemaValidity.test.ts (+9 -27)

📄 Description

Summary

Refs #4973 and its closed duplicate #4081. Full-profile compare_web_captures advertised 168,631 bytes, exceeding the reported Claude Desktop 65,536-byte per-tool gate. It now advertises 9,463 bytes by declaring copied complete producer observations as object operands. Analyst-authored normalization rules stay explicit; canonical validation still rejects incomplete or malformed observations before comparison.

Change and boundary

The capture-input owners mark complete normalized observations. The shared schema presentation owner handles only those marked schema positions; no depth-based or catalog-wide fitter is added. Property guidance is passed into its owning renderer so parent description fallback cannot overwrite the abbreviated-observation notice. CLI/MCP continue using the same complete canonical inputs and pure comparators; source values, Evidence, coverage, defaults and unknowns are unchanged. Only this input declaration changes among 229 tools; all other tool declarations and this tool's output are identical to base.

Scope decision: not applicable, ordinary presentation fix within existing boundaries. No new provider, target authority, configuration changes or cleanup policy. Generated catalogs remain ignored build artifacts; owning docs describe the advertisement/runtime distinction.

Executed validation

Base: b8cdbdf0ef2c479919cfed2c217b5710c2c294db; head: b16fc6b5e278f964ef333d4ff12e0c6cdd6e332f.

  • The actual SDK tools/list regression fails on base: 168,631 > 65,536. Final focused suites: 110 passed, covering full/compact catalog validity, SDK conversion, both comparison families, canonical malformed-input rejection before effects, complete inline Evidence/selectors, draft-07/2020-12 and literal metadata preservation. An initial 3-test failure exposed parent guidance overwriting the new notice; the owner was corrected and all 110 passed.
  • npm run check:fast passed serially: 51.328 s elapsed / 54.874 s CPU / 3802.38 MiB sampled family RSS. npm run docs:check passed. Final edits after these gates only clarify documentation/comments.
  • Real Chrome 156.0.8078.4 on Linux, isolated profile and authored loopback page: two actual inspect_web_page calls observe before/after text and an added article (DOM 11 → 13 nodes). The same unchanged capture pair (SHA-256 561fb9b82d4f6a2cb20e7811f0937254ace1ccabf40d350b9cbdaba09c9515b6) was replayed on pristine base and fixed builds: four valid MCP comparisons, two CLI comparisons and one malformed-payload control per lane. Complete normalized results, Evidence IDs, parameters, analysis profiles and source links match across CLI/MCP and revisions. Self-comparison preserves overall unknown with DOM unchanged; the modified page reports changed. The real production MCP server rejects the partial observation and keeps its advertised catalog stable after materialization.
  • The literal client-size gate replay changes from rejecting this tool to admitting it. This is a measured SDK advertisement and replayed gate, not a native Claude Desktop run.
Completed-task costs and limits

The replay task includes fresh MCP discovery/materialization, warm repeats, two fresh CLI processes and the negative control. Base → fixed: 34.220 → 28.892 s elapsed; 35.461 → 31.319 s CPU; 1389.50 → 1343.39 MiB sampled family RSS. First MCP operation includes materialization (24.427 → 21.413 s); remaining warm operations range 11–20 → 12–49 ms. This single ordered pair has uncontrolled filesystem cache/host load and supports no causal speedup claim. No new cache was introduced.

All 229 projected name/description/input declarations total 1,024,207 → 865,039 UTF-8 JSON bytes; comparison arguments and replies are unchanged. Model-token usage was not measured, and byte savings alone do not establish token savings. Fixture acquisition is separate (46.179 s / 38.048 s CPU / 2065.55 MiB family RSS). Checks are pinned to two CPUs; family RSS samples every 100 ms can double-count shared pages and miss short peaks. No resource guard fired.

Remaining scope and compatibility

No input API or configuration migration. Partial observation payloads may pass the intentionally abbreviated advertisement but still fail the unchanged canonical runtime schema. Native Claude Desktop on Windows/macOS was unavailable; its model behavior and the separate screenshot string-argument report remain unverified. inspect_analysis_view remains byte-identical and oversized at 85,954 bytes; this patch does not claim to resolve every full-profile client limit or close all of #4973. No new live browser scenario capture was recorded; both scenario comparison and full normalization constraints ran through the SDK regression.

CI run 40476314311 completed on exact main b8cdbdf0ef2c479919cfed2c217b5710c2c294db: 7 successful / 4 failed / 7 cancelled / 19 skipped jobs. Static checks, build, docs, real-browser verification and Linux x64 native-package baseline passed. Source has 17 failed / 20,788 passed / 15 skipped; all 17 failure names reproduce on pristine main (17 failed / 49 passed). Shard 3 has 10 failed / 1,872 passed / 15 skipped; all ten reproduce on pristine main (10 failed / 99 filtered/skipped), covering browser cleanup, ledger history, TOML configuration, model-parent identity and native plist defaults. Portable/required jobs aggregate these same failures. Seven fail-fast cancellations are unverified coverage, not passes. No failure unique to this patch was found. Greptile completed on this head with 5/5, no actionable findings. Codex review quota is exhausted; that review is unavailable, not passed. The requester authorizes ready status and administrative bypass of unrelated-main CI/readiness failures; that is not a declaration that human review occurred.

Author readiness

Human owner: @gensokyo-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7469 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/4973-claude-full-schema` --- ### 📝 Commits (1) - [`b16fc6b`](https://github.com/morluto/rea/commit/b16fc6b5e278f964ef333d4ff12e0c6cdd6e332f) fix(mcp): summarize copied browser observations in input declarations ### 📊 Changes **8 files changed** (+158 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-contracts.md` (+13 -2) ➕ `src/contracts/inputObservationPresentation.test.ts` (+70 -0) 📝 `src/contracts/inputSchemaPresentation.ts` (+32 -18) 📝 `src/contracts/toolSchemaMetadata.ts` (+1 -1) 📝 `src/domain/browserScenarioDiffValues.ts` (+8 -6) 📝 `src/domain/webCaptureDiffSchemas.ts` (+6 -3) 📝 `tests/boundary/mcp/browserComparisonInput.test.ts` (+19 -9) 📝 `tests/boundary/mcp/toolSchemaValidity.test.ts` (+9 -27) </details> ### 📄 Description ## Summary Refs #4973 and its closed duplicate #4081. Full-profile `compare_web_captures` advertised 168,631 bytes, exceeding the reported Claude Desktop 65,536-byte per-tool gate. It now advertises **9,463 bytes** by declaring copied complete producer observations as object operands. Analyst-authored normalization rules stay explicit; canonical validation still rejects incomplete or malformed observations before comparison. ## Change and boundary The capture-input owners mark complete normalized observations. The shared schema presentation owner handles only those marked schema positions; no depth-based or catalog-wide fitter is added. Property guidance is passed into its owning renderer so parent description fallback cannot overwrite the abbreviated-observation notice. CLI/MCP continue using the same complete canonical inputs and pure comparators; source values, Evidence, coverage, defaults and unknowns are unchanged. Only this input declaration changes among **229 tools**; all other tool declarations and this tool's output are identical to base. Scope decision: not applicable, ordinary presentation fix within existing boundaries. No new provider, target authority, configuration changes or cleanup policy. Generated catalogs remain ignored build artifacts; owning docs describe the advertisement/runtime distinction. ## Executed validation Base: `b8cdbdf0ef2c479919cfed2c217b5710c2c294db`; head: `b16fc6b5e278f964ef333d4ff12e0c6cdd6e332f`. - The actual SDK `tools/list` regression fails on base: **168,631 > 65,536**. Final focused suites: **110 passed**, covering full/compact catalog validity, SDK conversion, both comparison families, canonical malformed-input rejection before effects, complete inline Evidence/selectors, draft-07/2020-12 and literal metadata preservation. An initial 3-test failure exposed parent guidance overwriting the new notice; the owner was corrected and all 110 passed. - `npm run check:fast` passed serially: **51.328 s elapsed / 54.874 s CPU / 3802.38 MiB sampled family RSS**. `npm run docs:check` passed. Final edits after these gates only clarify documentation/comments. - Real **Chrome 156.0.8078.4** on Linux, isolated profile and authored loopback page: two actual `inspect_web_page` calls observe before/after text and an added article (DOM 11 → 13 nodes). The same unchanged capture pair (SHA-256 `561fb9b82d4f6a2cb20e7811f0937254ace1ccabf40d350b9cbdaba09c9515b6`) was replayed on pristine base and fixed builds: **four valid MCP comparisons, two CLI comparisons and one malformed-payload control per lane**. Complete normalized results, Evidence IDs, parameters, analysis profiles and source links match across CLI/MCP and revisions. Self-comparison preserves overall `unknown` with DOM `unchanged`; the modified page reports `changed`. The real production MCP server rejects the partial observation and keeps its advertised catalog stable after materialization. - The literal client-size gate replay changes from rejecting this tool to admitting it. This is a measured SDK advertisement and replayed gate, **not a native Claude Desktop run**. <details><summary>Completed-task costs and limits</summary> The replay task includes fresh MCP discovery/materialization, warm repeats, two fresh CLI processes and the negative control. Base → fixed: **34.220 → 28.892 s elapsed; 35.461 → 31.319 s CPU; 1389.50 → 1343.39 MiB sampled family RSS**. First MCP operation includes materialization (24.427 → 21.413 s); remaining warm operations range 11–20 → 12–49 ms. This single ordered pair has uncontrolled filesystem cache/host load and supports **no causal speedup claim**. No new cache was introduced. All 229 projected name/description/input declarations total **1,024,207 → 865,039 UTF-8 JSON bytes**; comparison arguments and replies are unchanged. Model-token usage was not measured, and byte savings alone do not establish token savings. Fixture acquisition is separate (46.179 s / 38.048 s CPU / 2065.55 MiB family RSS). Checks are pinned to two CPUs; family RSS samples every 100 ms can double-count shared pages and miss short peaks. No resource guard fired. </details> ## Remaining scope and compatibility No input API or configuration migration. Partial observation payloads may pass the intentionally abbreviated advertisement but still fail the unchanged canonical runtime schema. Native Claude Desktop on Windows/macOS was unavailable; its model behavior and the separate screenshot string-argument report remain unverified. `inspect_analysis_view` remains byte-identical and oversized at 85,954 bytes; this patch does not claim to resolve every full-profile client limit or close all of #4973. No new live browser scenario capture was recorded; both scenario comparison and full normalization constraints ran through the SDK regression. CI run [40476314311](https://github.com/morluto/rea/actions/runs/40476314311) completed on exact main `b8cdbdf0ef2c479919cfed2c217b5710c2c294db`: **7 successful / 4 failed / 7 cancelled / 19 skipped jobs**. Static checks, build, docs, real-browser verification and Linux x64 native-package baseline passed. Source has 17 failed / 20,788 passed / 15 skipped; all 17 failure names reproduce on pristine main (17 failed / 49 passed). Shard 3 has 10 failed / 1,872 passed / 15 skipped; all ten reproduce on pristine main (10 failed / 99 filtered/skipped), covering browser cleanup, ledger history, TOML configuration, model-parent identity and native plist defaults. Portable/required jobs aggregate these same failures. Seven fail-fast cancellations are unverified coverage, not passes. No failure unique to this patch was found. Greptile completed on this head with **5/5, no actionable findings**. Codex review quota is exhausted; that review is unavailable, not passed. The requester authorizes ready status and administrative bypass of unrelated-main CI/readiness failures; that is not a declaration that human review occurred. ## Author readiness Human owner: @gensokyo-dev - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-05 01:48:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7857
No description provided.