[PR #6005] [MERGED] fix(mcp): name response-byte and startup ceilings in recovery #7114

Closed
opened 2026-11-01 21:45:28 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6005
Author: @morluto
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: cursor/mcp-response-startup-ceilings-8a8c


📝 Commits (6)

  • 3e279a6 fix(mcp): name response-byte and startup ceilings in recovery
  • 5808b77 fix(mcp): distinguish string ceilings and keep dossier recovery
  • 13de9bc merge: integrate main into MCP response-ceiling recovery
  • 33923c5 fix(mcp): keep retained SDK errors inside the text budget
  • 30c6b4b fix(mcp): keep export advice when a summary exceeds the response budget
  • 4e2671b style(mcp): format the SDK diagnostic preview return

📊 Changes

18 files changed (+815 additions, -55 deletions)

View changed files

📝 docs/mcp-contracts.md (+8 -5)
📝 scripts/lib/mcp-startup-probe.d.mts (+7 -0)
📝 scripts/lib/mcp-startup-probe.mjs (+71 -14)
📝 src/config/mcpResponseBudget.ts (+25 -1)
📝 src/domain/analysisErrorPresentation.ts (+8 -1)
📝 src/domain/jsonValue.ts (+1 -1)
📝 src/mcpDoctor.ts (+32 -6)
📝 src/mcpStartupPolicy.ts (+16 -0)
📝 src/server/EvidenceMcpServer.ts (+77 -11)
📝 src/server/toolResult.ts (+77 -10)
📝 src/server/toolResultEncoding.ts (+5 -1)
📝 tests/boundary/mcp/analysisViewMcp.test.ts (+3 -0)
📝 tests/boundary/mcp/largeToolResult.test.ts (+119 -2)
📝 tests/boundary/mcp/mcpDoctor.test.ts (+67 -1)
📝 tests/boundary/mcp/mcpStartupPolicy.test.ts (+189 -0)
📝 tests/boundary/mcp/sessionMcp.test.ts (+1 -1)
📝 tests/conformance/contracts/mcpResponseBudget.test.ts (+37 -1)
➕ tests/fixtures/mcpStartupProbeChild.mjs (+72 -0)

📄 Description

Summary

Refs #5910 (parent #5808). When the MCP stdio response budget is hit, recovery now names REA_MCP_MAX_RESPONSE_BYTES, the effective byte value, the 10485760 byte (10 MiB) floor, and that a change requires restarting the REA process. It names REA's reserved single-string limit (MAX_STRING_LENGTH - 1024) separately from Node's MAX_STRING_LENGTH, and says this setting raises neither.

An oversized complete get_evidence_bundle still tells the agent to call detail: summary, then inspect_analysis_view. An oversized summary does not repeat that step. It still names export_evidence_bundle, which writes the retained bundle outside one MCP frame. That remains the MCP recovery path when the overflow is a string-length limit a larger byte budget cannot raise.

Fixed MCP startup phase budgets are named when those deadlines fire: value, units, and no runtime override. Codex startup_timeout_sec of 30 seconds stays client guidance on the doctor path. REA does not enforce that figure as the doctor deadline. A binary_session timeout after the catalog uses that same sentence.

Oversized SDK validation recovery still returns parseable JSON. When a diagnostic preview of quotes or backslashes would expand past the text budget, only that preview is shortened. The error keeps reported_limits.evidence_reference.kind: "retained-evidence" when recording succeeds, and the complete diagnostic stays in retained Evidence.

Problem and expected behavior

A response that exceeds the stdio budget said to use a larger MCP response budget without naming REA_MCP_MAX_RESPONSE_BYTES, the floor, or restart. The string-ceiling branch reported REA's reserved limit as Node's ceiling. Oversized complete dossier delivery replaced the detail: summary next step with generic CLI JSON guidance.

rea mcp doctor reported an expired deadline without the effective milliseconds when the deadline fired during binary_session after initialize and the catalog. Packaged startup checks for initialize (15000 ms), tools/list (5000 ms), and first catalog (20000 ms) failed without those values on the probe path.

A quoted SDK validation diagnostic ("\\ repeated) made the replacement error's text encoding fail. The transport then removed the structured carrier and sent empty content, so the client could not read the retained-evidence reference.

An oversized get_evidence_bundle summary told MCP-only callers to use CLI JSON. export_evidence_bundle still works on the same connection, and a string-length overflow is not fixed by raising the byte budget.

Change and scope

Wording and projection, plus fitting the SDK diagnostic preview to the MCP text budget. Numeric ceilings are unchanged and no new setting was added.

  • Completed-result overflow (ToolResultDelivery) and oversized-error replacement (EvidenceMcpServer.recoverError) share one projection. Receive-buffer text names the effective REA_MCP_MAX_RESPONSE_BYTES value. String-ceiling text names REA's reserved limit and Node's actual ceiling, and says the env var does not raise either. A complete get_evidence_bundle keeps the detail: summary discovery sentence. An oversized summary drops only that sentence and keeps the same export_evidence_bundle clause. Paging or complete CLI JSON stays the next step for the other overflow paths.
  • rea mcp doctor appends the fixed doctor deadline when the deadline, an SDK request timeout, or an abort fires, including a binary_session rejection after the catalog. The effective milliseconds are the applied budget (policy default 30000 ms).
  • The packaged startup probe names the same fixed phase budgets when its initialize, tools/list, first-catalog, or doctor connect deadlines fire. Unrelated probe failures do not get that sentence.
  • JSON depth refusal names the 1000-level cap and says this release has no runtime override.
  • Oversized SDK validation recovery still records the original error. If the 256-character diagnostic_preview expands past the text budget under JSON escaping, only that preview is shortened (diagnostic_truncated: true). The wire error remains parseable JSON and keeps the retained-evidence reference.

Moonshot's 13312 byte schema budget and the compact schema depth of 10 do not fail the call; compact presentation reduces the advertisement. No new error was added for them.

Analysis-view, environment, and HTTP admission caps in the same inventory theme were left unchanged. They either truncate with an existing limitation or fail through a mixed refusal, and this PR does not spray wording into those directories.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Not applicable. This is recovery text for existing MCP budgets. It does not add a provider, target execution, injection, mutation, or protection recovery.

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP result delivery owns response-budget text (src/server/toolResult.ts, src/server/EvidenceMcpServer.ts). src/config/mcpResponseBudget.ts owns the stdio budget facts. src/server/toolResultEncoding.ts owns the reserved string limit versus Node's ceiling. src/mcpStartupPolicy.ts and src/mcpDoctor.ts own startup-deadline recovery. The packaged probe repeats that sentence because it cannot import the TypeScript module. src/domain/analysisErrorPresentation.ts owns the shared discovery and export sentences.
  • Contribution scope fit and linked maintainer decision: not applicable. Wording within the existing MCP delivery and doctor boundaries.
  • CLI and MCP/tool-catalog contract: tool and doctor failure text changes. No schema, catalog, or numeric limit change. docs/mcp-contracts.md now says the response-byte setting is read at process start and does not raise the reserved string limit or Node's ceiling.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged. Oversized results still keep an acknowledged Evidence reference when recording succeeds. The wire preview of an SDK diagnostic may be shorter than 256 characters when escaping would otherwise drop the error text; the retained record still holds the original result.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none. Skill text was not changed.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/conformance/contracts/mcpResponseBudget.test.ts, tests/boundary/mcp/largeToolResult.test.ts, tests/boundary/mcp/mcpDoctor.test.ts, tests/boundary/mcp/mcpStartupPolicy.test.ts, tests/boundary/mcp/analysisViewMcp.test.ts, plus the existing oversized-error delivery test. The quoted SDK diagnostic case in src/server/EvidenceMcpServer.test.ts is the regression for empty error content. The summary-overflow case now requires export_evidence_bundle and rejects a repeated detail: summary.
  • Base reproduction or other evidence: the analysis-view boundary test expected get_evidence_bundle and detail: summary and received only the generic CLI JSON sentence. String-ceiling text reported MCP_RESULT_STRING_LIMIT as Node's ceiling. The doctor saved a plain binary_session error when that call passed the deadline after the catalog. Source tests on 13de9bca9 failed both protocol revisions in expectEscapedSdkDiagnosticRetention because content was empty. An oversized summary's remediation stopped at CLI JSON (discussion_r4339174785).
  • User-visible CLI/MCP output (if applicable): an oversized complete bundle remediation includes get_evidence_bundle and detail: summary and REA's reserved single-string limit of <MCP_RESULT_STRING_LIMIT> plus Node's single-string ceiling of <MAX_STRING_LENGTH>. An oversized summary remediation includes export_evidence_bundle and caller-selected path, and does not repeat detail: summary. The doctor hang fixture (applied deadline 60000 ms) includes 60000 ms, no runtime override, and Codex startup_timeout_sec of 30 seconds is client guidance. A binary_session timeout after the catalog uses that same 60000 ms sentence. A quote-heavy SDK validation failure returns a resource_constraint JSON text body with evidence_reference.kind retained-evidence.
  • Remaining proof gaps: no separate live stdio capture beyond the in-memory MCP boundary tests. Moonshot compact presentation was not given a new failure. The production catalog doctor checks compare source-computed digests with this VM's already compiled server and were not re-run to green here. A string-length summary was not allocated at MAX_STRING_LENGTH; summary overflow uses the same export sentence for both constraints, and the string-ceiling facts are covered by the existing projection test.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • Merged origin/main at d8a9673fc. The only conflict was src/domain/analysisErrorPresentation.ts: fixed-allowance recovery stays first, and transport overflow still uses the detail: summary discovery sentence.
  • Re-ran npm run check:fast after the merge (typecheck and lint succeeded).
  • npx vitest run tests/conformance/contracts/mcpResponseBudget.test.ts — 7 passed.
  • npx vitest run tests/boundary/mcp/largeToolResult.test.ts — 8 passed.
  • npx vitest run tests/boundary/mcp/mcpStartupPolicy.test.ts — 10 passed, including probe phase failures, the first-catalog overrun, and unrelated failures.
  • npx vitest run tests/boundary/mcp/mcpDoctor.test.ts -t "request-flow deadline|child lifecycle" — startup deadline, binary_session deadline, and unrelated request-flow failure passed.
  • npx vitest run tests/boundary/mcp/analysisViewMcp.test.ts — 21 passed, including the oversized dossier discovery case.
  • src/domain/fixedAllowanceRemediation.test.ts (8) and tests/boundary/providers/fixedAllowanceRecovery.test.ts (2) passed after the conflict resolution.
  • After 33923c55c: npm run check:fast — typecheck and lint succeeded.
  • npm run test:focused -- src/server/EvidenceMcpServer.test.ts tests/boundary/mcp/largeToolResult.test.ts tests/boundary/mcp/analysisViewMcp.test.ts tests/conformance/contracts/mcpResponseBudget.test.ts — 40 passed, including both SDK validation retention revisions.
  • After 30c6b4b6c: npm run check:fast — typecheck and lint succeeded.
  • npm run test:local -- src/server/EvidenceMcpServer.test.ts — 4 passed, including both public stdio SDK revisions.
  • npm run test:local -- tests/conformance/contracts/mcpResponseBudget.test.ts src/server/toolResultEncoding.test.ts — 17 passed.
  • npm run test:focused -- tests/boundary/mcp/largeToolResult.test.ts tests/boundary/mcp/toolResult.test.ts tests/boundary/mcp/analysisViewMcp.test.ts — 45 passed. largeToolResult was re-run after the export assertion (8 passed).
  • Static checks on 30c6b4b6c failed oxfmt --check in src/server/EvidenceMcpServer.ts (the fitted-preview return). CI required then failed because static was a failure and the lanes that need it were skipped. 4e2671b9e wraps that ternary. Behavior is unchanged.
  • After 4e2671b9e: npm run format:check — all matched files use the correct format.
  • npm run check:fast — typecheck and lint succeeded.
  • npm run test:focused -- src/server/EvidenceMcpServer.test.ts — 4 passed.

Real provider workflows were not required. These paths are MCP delivery, doctor, and startup-probe projection.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Callers that match the old "larger MCP response budget" sentence will see the named setting instead. Callers that treated MCP_RESULT_STRING_LIMIT as Node's ceiling will see both numbers. An oversized summary now names export_evidence_bundle instead of CLI JSON alone. Limits and configuration parsing are unchanged. A quote-heavy SDK diagnostic may now include a shorter diagnostic_preview than 256 characters; diagnostic_truncated stays true and the retained record still has the original error.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. No provider behavior changed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable. Recovery text does not add authority or retain new caller data.

Author readiness

Human owner: @morluto

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
Open in Web Open in Cursor 

🔄 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/6005 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `cursor/mcp-response-startup-ceilings-8a8c` --- ### 📝 Commits (6) - [`3e279a6`](https://github.com/morluto/rea/commit/3e279a61b0d0a77735b5396495194aa5ce0cf70c) fix(mcp): name response-byte and startup ceilings in recovery - [`5808b77`](https://github.com/morluto/rea/commit/5808b7756dcfa5417f84409ce66df5e41048bf4c) fix(mcp): distinguish string ceilings and keep dossier recovery - [`13de9bc`](https://github.com/morluto/rea/commit/13de9bca986bd82f0f3c25527d054b0c04a13a0f) merge: integrate main into MCP response-ceiling recovery - [`33923c5`](https://github.com/morluto/rea/commit/33923c55cd78113783c013664d0737f8f1794d75) fix(mcp): keep retained SDK errors inside the text budget - [`30c6b4b`](https://github.com/morluto/rea/commit/30c6b4b6cc4ddbf79d245fe6d80814277a4eb2db) fix(mcp): keep export advice when a summary exceeds the response budget - [`4e2671b`](https://github.com/morluto/rea/commit/4e2671b9e4a26518cf4f30e075d207907fe8bcda) style(mcp): format the SDK diagnostic preview return ### 📊 Changes **18 files changed** (+815 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-contracts.md` (+8 -5) 📝 `scripts/lib/mcp-startup-probe.d.mts` (+7 -0) 📝 `scripts/lib/mcp-startup-probe.mjs` (+71 -14) 📝 `src/config/mcpResponseBudget.ts` (+25 -1) 📝 `src/domain/analysisErrorPresentation.ts` (+8 -1) 📝 `src/domain/jsonValue.ts` (+1 -1) 📝 `src/mcpDoctor.ts` (+32 -6) 📝 `src/mcpStartupPolicy.ts` (+16 -0) 📝 `src/server/EvidenceMcpServer.ts` (+77 -11) 📝 `src/server/toolResult.ts` (+77 -10) 📝 `src/server/toolResultEncoding.ts` (+5 -1) 📝 `tests/boundary/mcp/analysisViewMcp.test.ts` (+3 -0) 📝 `tests/boundary/mcp/largeToolResult.test.ts` (+119 -2) 📝 `tests/boundary/mcp/mcpDoctor.test.ts` (+67 -1) 📝 `tests/boundary/mcp/mcpStartupPolicy.test.ts` (+189 -0) 📝 `tests/boundary/mcp/sessionMcp.test.ts` (+1 -1) 📝 `tests/conformance/contracts/mcpResponseBudget.test.ts` (+37 -1) ➕ `tests/fixtures/mcpStartupProbeChild.mjs` (+72 -0) </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Refs #5910 (parent #5808). When the MCP stdio response budget is hit, recovery now names `REA_MCP_MAX_RESPONSE_BYTES`, the effective byte value, the 10485760 byte (10 MiB) floor, and that a change requires restarting the REA process. It names REA's reserved single-string limit (`MAX_STRING_LENGTH - 1024`) separately from Node's `MAX_STRING_LENGTH`, and says this setting raises neither. An oversized complete `get_evidence_bundle` still tells the agent to call `detail: summary`, then `inspect_analysis_view`. An oversized summary does not repeat that step. It still names `export_evidence_bundle`, which writes the retained bundle outside one MCP frame. That remains the MCP recovery path when the overflow is a string-length limit a larger byte budget cannot raise. Fixed MCP startup phase budgets are named when those deadlines fire: value, units, and no runtime override. Codex `startup_timeout_sec` of 30 seconds stays client guidance on the doctor path. REA does not enforce that figure as the doctor deadline. A `binary_session` timeout after the catalog uses that same sentence. Oversized SDK validation recovery still returns parseable JSON. When a diagnostic preview of quotes or backslashes would expand past the text budget, only that preview is shortened. The error keeps `reported_limits.evidence_reference.kind: "retained-evidence"` when recording succeeds, and the complete diagnostic stays in retained Evidence. ## Problem and expected behavior A response that exceeds the stdio budget said to use a larger MCP response budget without naming `REA_MCP_MAX_RESPONSE_BYTES`, the floor, or restart. The string-ceiling branch reported REA's reserved limit as Node's ceiling. Oversized complete dossier delivery replaced the `detail: summary` next step with generic CLI JSON guidance. `rea mcp doctor` reported an expired deadline without the effective milliseconds when the deadline fired during `binary_session` after initialize and the catalog. Packaged startup checks for initialize (15000 ms), tools/list (5000 ms), and first catalog (20000 ms) failed without those values on the probe path. A quoted SDK validation diagnostic (`"\\` repeated) made the replacement error's text encoding fail. The transport then removed the structured carrier and sent empty `content`, so the client could not read the retained-evidence reference. An oversized `get_evidence_bundle` summary told MCP-only callers to use CLI JSON. `export_evidence_bundle` still works on the same connection, and a string-length overflow is not fixed by raising the byte budget. ## Change and scope Wording and projection, plus fitting the SDK diagnostic preview to the MCP text budget. Numeric ceilings are unchanged and no new setting was added. - Completed-result overflow (`ToolResultDelivery`) and oversized-error replacement (`EvidenceMcpServer.recoverError`) share one projection. Receive-buffer text names the effective `REA_MCP_MAX_RESPONSE_BYTES` value. String-ceiling text names REA's reserved limit and Node's actual ceiling, and says the env var does not raise either. A complete `get_evidence_bundle` keeps the `detail: summary` discovery sentence. An oversized summary drops only that sentence and keeps the same `export_evidence_bundle` clause. Paging or complete CLI JSON stays the next step for the other overflow paths. - `rea mcp doctor` appends the fixed doctor deadline when the deadline, an SDK request timeout, or an abort fires, including a `binary_session` rejection after the catalog. The effective milliseconds are the applied budget (policy default 30000 ms). - The packaged startup probe names the same fixed phase budgets when its initialize, tools/list, first-catalog, or doctor connect deadlines fire. Unrelated probe failures do not get that sentence. - JSON depth refusal names the 1000-level cap and says this release has no runtime override. - Oversized SDK validation recovery still records the original error. If the 256-character `diagnostic_preview` expands past the text budget under JSON escaping, only that preview is shortened (`diagnostic_truncated: true`). The wire error remains parseable JSON and keeps the retained-evidence reference. Moonshot's 13312 byte schema budget and the compact schema depth of 10 do not fail the call; compact presentation reduces the advertisement. No new error was added for them. Analysis-view, environment, and HTTP admission caps in the same inventory theme were left unchanged. They either truncate with an existing limitation or fail through a mixed refusal, and this PR does not spray wording into those directories. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. Not applicable. This is recovery text for existing MCP budgets. It does not add a provider, target execution, injection, mutation, or protection recovery. ## Contract and boundary impact - Semantic owner and earliest changed stage: MCP result delivery owns response-budget text (`src/server/toolResult.ts`, `src/server/EvidenceMcpServer.ts`). `src/config/mcpResponseBudget.ts` owns the stdio budget facts. `src/server/toolResultEncoding.ts` owns the reserved string limit versus Node's ceiling. `src/mcpStartupPolicy.ts` and `src/mcpDoctor.ts` own startup-deadline recovery. The packaged probe repeats that sentence because it cannot import the TypeScript module. `src/domain/analysisErrorPresentation.ts` owns the shared discovery and export sentences. - Contribution scope fit and linked maintainer decision: not applicable. Wording within the existing MCP delivery and doctor boundaries. - CLI and MCP/tool-catalog contract: tool and doctor failure text changes. No schema, catalog, or numeric limit change. `docs/mcp-contracts.md` now says the response-byte setting is read at process start and does not raise the reserved string limit or Node's ceiling. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: unchanged. Oversized results still keep an acknowledged Evidence reference when recording succeeds. The wire preview of an SDK diagnostic may be shorter than 256 characters when escaping would otherwise drop the error text; the retained record still holds the original result. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Skill text was not changed. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/conformance/contracts/mcpResponseBudget.test.ts`, `tests/boundary/mcp/largeToolResult.test.ts`, `tests/boundary/mcp/mcpDoctor.test.ts`, `tests/boundary/mcp/mcpStartupPolicy.test.ts`, `tests/boundary/mcp/analysisViewMcp.test.ts`, plus the existing oversized-error delivery test. The quoted SDK diagnostic case in `src/server/EvidenceMcpServer.test.ts` is the regression for empty error content. The summary-overflow case now requires `export_evidence_bundle` and rejects a repeated `detail: summary`. - Base reproduction or other evidence: the analysis-view boundary test expected `get_evidence_bundle and detail: summary` and received only the generic CLI JSON sentence. String-ceiling text reported `MCP_RESULT_STRING_LIMIT` as Node's ceiling. The doctor saved a plain `binary_session` error when that call passed the deadline after the catalog. Source tests on `13de9bca9` failed both protocol revisions in `expectEscapedSdkDiagnosticRetention` because `content` was empty. An oversized summary's remediation stopped at CLI JSON (`discussion_r4339174785`). - User-visible CLI/MCP output (if applicable): an oversized complete bundle remediation includes `get_evidence_bundle and detail: summary` and `REA's reserved single-string limit of <MCP_RESULT_STRING_LIMIT>` plus `Node's single-string ceiling of <MAX_STRING_LENGTH>`. An oversized summary remediation includes `export_evidence_bundle` and `caller-selected path`, and does not repeat `detail: summary`. The doctor hang fixture (applied deadline 60000 ms) includes `60000 ms`, `no runtime override`, and `Codex startup_timeout_sec of 30 seconds is client guidance`. A `binary_session` timeout after the catalog uses that same 60000 ms sentence. A quote-heavy SDK validation failure returns a `resource_constraint` JSON text body with `evidence_reference.kind` `retained-evidence`. - Remaining proof gaps: no separate live stdio capture beyond the in-memory MCP boundary tests. Moonshot compact presentation was not given a new failure. The production catalog doctor checks compare source-computed digests with this VM's already compiled server and were not re-run to green here. A string-length summary was not allocated at `MAX_STRING_LENGTH`; summary overflow uses the same export sentence for both constraints, and the string-ceiling facts are covered by the existing projection test. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - Merged `origin/main` at `d8a9673fc`. The only conflict was `src/domain/analysisErrorPresentation.ts`: fixed-allowance recovery stays first, and transport overflow still uses the `detail: summary` discovery sentence. - Re-ran `npm run check:fast` after the merge (typecheck and lint succeeded). - `npx vitest run tests/conformance/contracts/mcpResponseBudget.test.ts` — 7 passed. - `npx vitest run tests/boundary/mcp/largeToolResult.test.ts` — 8 passed. - `npx vitest run tests/boundary/mcp/mcpStartupPolicy.test.ts` — 10 passed, including probe phase failures, the first-catalog overrun, and unrelated failures. - `npx vitest run tests/boundary/mcp/mcpDoctor.test.ts -t "request-flow deadline|child lifecycle"` — startup deadline, `binary_session` deadline, and unrelated request-flow failure passed. - `npx vitest run tests/boundary/mcp/analysisViewMcp.test.ts` — 21 passed, including the oversized dossier discovery case. - `src/domain/fixedAllowanceRemediation.test.ts` (8) and `tests/boundary/providers/fixedAllowanceRecovery.test.ts` (2) passed after the conflict resolution. - After `33923c55c`: `npm run check:fast` — typecheck and lint succeeded. - `npm run test:focused -- src/server/EvidenceMcpServer.test.ts tests/boundary/mcp/largeToolResult.test.ts tests/boundary/mcp/analysisViewMcp.test.ts tests/conformance/contracts/mcpResponseBudget.test.ts` — 40 passed, including both SDK validation retention revisions. - After `30c6b4b6c`: `npm run check:fast` — typecheck and lint succeeded. - `npm run test:local -- src/server/EvidenceMcpServer.test.ts` — 4 passed, including both public stdio SDK revisions. - `npm run test:local -- tests/conformance/contracts/mcpResponseBudget.test.ts src/server/toolResultEncoding.test.ts` — 17 passed. - `npm run test:focused -- tests/boundary/mcp/largeToolResult.test.ts tests/boundary/mcp/toolResult.test.ts tests/boundary/mcp/analysisViewMcp.test.ts` — 45 passed. `largeToolResult` was re-run after the export assertion (8 passed). - Static checks on `30c6b4b6c` failed `oxfmt --check` in `src/server/EvidenceMcpServer.ts` (the fitted-preview return). `CI required` then failed because `static` was a failure and the lanes that need it were skipped. `4e2671b9e` wraps that ternary. Behavior is unchanged. - After `4e2671b9e`: `npm run format:check` — all matched files use the correct format. - `npm run check:fast` — typecheck and lint succeeded. - `npm run test:focused -- src/server/EvidenceMcpServer.test.ts` — 4 passed. Real provider workflows were not required. These paths are MCP delivery, doctor, and startup-probe projection. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Callers that match the old "larger MCP response budget" sentence will see the named setting instead. Callers that treated `MCP_RESULT_STRING_LIMIT` as Node's ceiling will see both numbers. An oversized summary now names `export_evidence_bundle` instead of CLI JSON alone. Limits and configuration parsing are unchanged. A quote-heavy SDK diagnostic may now include a shorter `diagnostic_preview` than 256 characters; `diagnostic_truncated` stays true and the retained record still has the original error. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. No provider behavior changed. - Package or release metadata impact: none. - Security, privacy, process, or containment review: not applicable. Recovery text does not add authority or retain new caller data. ## Author readiness Human owner: @morluto - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-2aca8f4f-974a-5e06-9485-c829eacb8a8c?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-2aca8f4f-974a-5e06-9485-c829eacb8a8c&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:28 +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#7114
No description provided.