[PR #6379] [MERGED] test: prefer structured assertions over recovery prose #7322

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

📋 Pull Request Information

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

Base: main ← Head: cursor/structured-recovery-assertions-0761


📝 Commits (10+)

  • a03e9d6 test: prefer structured assertions over recovery prose
  • a5793ad test: keep decoder heap negatives off the Windows reserve
  • 15f9415 test: keep the one-retry cap and deadline recovery tokens
  • 9edb7df test: keep heap, MCP, pcap, and preload recovery tokens
  • 75c2a08 test: keep shared-context and transport recovery tokens
  • 29fa60a test: keep handoff, input-check, and budget format tokens
  • 5daad73 test: bind budget floors and active deadline sources
  • 1b03710 test: bind heap MiB sources and pcap host tokens
  • f10428b test: bind the selected decoder heap to MiB and source
  • 11defa0 test: bind doctor client seconds and prlimit absolute guidance

📊 Changes

18 files changed (+539 additions, -281 deletions)

View changed files

📝 src/browser/PlaywrightElectronActiveProjection.test.ts (+8 -4)
📝 src/browser/PlaywrightScenarioEvents.sharedContext.test.ts (+4 -3)
📝 src/browser/history/CaptureFailures.test.ts (+12 -4)
📝 src/config/captureDecoderHeap.test.ts (+21 -15)
📝 src/config/mcpStartupBudgets.test.ts (+10 -13)
📝 src/config/regexMatchingDeadline.test.ts (+48 -17)
📝 src/config/regexWorkerHeapRequest.test.ts (+44 -21)
📝 src/ida/IdaSessionClient.test.ts (+9 -1)
📝 src/main/messages.test.ts (+37 -29)
📝 src/process/RegexMatcher.test.ts (+14 -20)
📝 tests/acceptance/tools/mobileGraphExamples.test.ts (+29 -9)
📝 tests/boundary/mcp/mcpDoctor.test.ts (+26 -28)
📝 tests/boundary/mcp/mcpStartupPolicy.test.ts (+76 -56)
📝 tests/boundary/mcp/processEvidenceIdentityMcp.test.ts (+112 -10)
📝 tests/boundary/pcap/pcapProvider.test.ts (+20 -8)
📝 tests/boundary/pcap/pcapProviderCrossPlatform.test.ts (+29 -8)
📝 tests/boundary/process/regexMatcher.test.ts (+28 -23)
📝 tests/boundary/providers/kuna/kunaRegexSearch.test.ts (+12 -12)

📄 Description

Summary

Tests that locked full recovery sentences now check structured fields and a few semantic tokens. Active values stay bound to their unit and source. Doctor client guidance stays bound to the policy's seconds.

Two CI failures inherited from main now follow the integrity contract. Independently rehashed or tampered process Evidence projects evidence_integrity_mismatch. An unsupported comparison operation stays invalid_request. An authenticated inventory whose coverage.status is outside complete|unknown is an integrity failure, and the reason carries that schema issue.

Change and scope

Test-only. Doctor recovery must contain startup_timeout_sec of <policy seconds> seconds. A relative prlimit must contain must be absolute and Check that REA_TSHARK_PRLIMIT_COMMAND.

Process-evidence consumers lock code, category, message, and details.reason. Wrong operation locks invalid_request, inspect_input_contract, and the issue path. The Android graph example locks evidence_integrity_mismatch and the parsed inventory issue (invalid_value, values complete|unknown, path coverage/status).

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block integration. Not applicable: no new provider, target execution, injection, mutation, or protection recovery.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test oracles for existing recovery and error projections. No production boundary moved.
  • Contribution scope fit and linked maintainer decision: not applicable (test-only, inside existing contracts).
  • CLI and MCP/tool-catalog contract: none. Oracles match the codes those surfaces already return.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • 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.

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

File What the assert locks
tests/boundary/mcp/processEvidenceIdentityMcp.test.ts Rehashed identity and a tampered digest use evidence_integrity_mismatch plus the consumer's details.reason. Wrong operation stays invalid_request with its issue path. Missing evidence_links fails at that field before closure lookup.
tests/acceptance/tools/mobileGraphExamples.test.ts Unsupported inventory coverage.status is evidence_integrity_mismatch. The reason parses as invalid_value for complete|unknown at coverage/status.
tests/boundary/mcp/mcpStartupPolicy.test.ts Doctor recovery requires startup_timeout_sec of <policy seconds> seconds, plus client guidance and that REA does not enforce that figure.
tests/boundary/mcp/mcpDoctor.test.ts expectDoctorDeadline requires that same client-seconds token.
tests/boundary/pcap/pcapProvider.test.ts A relative prlimit requires must be absolute and Check that REA_TSHARK_PRLIMIT_COMMAND.
Earlier files in the diff Structured fields and the short recovery tokens from earlier commits. Full recovery paragraphs stay removed.
  • Tests added or updated: test oracles only.
  • Remaining proof gaps: the unsupported-host pcap case does not run on this Linux host. Fixed-allowance "no runtime override" prose outside this set is unchanged. Real Hopper, Kuna, Ghidra, and browser engines were not run.

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

  • Head 97e6aca7e is based on 746a41937 (#6363), which contains 7091be291 (#6375).
  • npm run check:fast at 97e6aca7e — typecheck and lint succeeded.
  • Vitest on tests/boundary/mcp/processEvidenceIdentityMcp.test.ts and tests/acceptance/tools/mobileGraphExamples.test.ts — 31 passed.
  • Vitest on the 16 structured-assertion files — 293 passed, 1 skipped.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: unavailable. These are unit and boundary tests with fixtures.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable. Tests do not change authority or cleanup.

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/6379 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `cursor/structured-recovery-assertions-0761` --- ### 📝 Commits (10+) - [`a03e9d6`](https://github.com/morluto/rea/commit/a03e9d6fd68c6796851623c949603955e46beb3f) test: prefer structured assertions over recovery prose - [`a5793ad`](https://github.com/morluto/rea/commit/a5793ade6fcf5e981988032aa2524a7270a9e00b) test: keep decoder heap negatives off the Windows reserve - [`15f9415`](https://github.com/morluto/rea/commit/15f94150bca6a0971a250c2de5fb9280cafd72af) test: keep the one-retry cap and deadline recovery tokens - [`9edb7df`](https://github.com/morluto/rea/commit/9edb7df06d2666ccf7d21924875b0156d77c3197) test: keep heap, MCP, pcap, and preload recovery tokens - [`75c2a08`](https://github.com/morluto/rea/commit/75c2a08e726169a02624284af65d08b5fd1fb552) test: keep shared-context and transport recovery tokens - [`29fa60a`](https://github.com/morluto/rea/commit/29fa60ac3477a1ed7fdd063044e328146b1f8b82) test: keep handoff, input-check, and budget format tokens - [`5daad73`](https://github.com/morluto/rea/commit/5daad7399719f7653e55d5d4ffc1dd21108c9eb7) test: bind budget floors and active deadline sources - [`1b03710`](https://github.com/morluto/rea/commit/1b03710fcbbae942aebe70d9dac183dc4069257c) test: bind heap MiB sources and pcap host tokens - [`f10428b`](https://github.com/morluto/rea/commit/f10428bd8e19e5fcd72dc0355dd14f7e10c2c307) test: bind the selected decoder heap to MiB and source - [`11defa0`](https://github.com/morluto/rea/commit/11defa0a51f3b738cf10dbf302ab62199d36c3ab) test: bind doctor client seconds and prlimit absolute guidance ### 📊 Changes **18 files changed** (+539 additions, -281 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/PlaywrightElectronActiveProjection.test.ts` (+8 -4) 📝 `src/browser/PlaywrightScenarioEvents.sharedContext.test.ts` (+4 -3) 📝 `src/browser/history/CaptureFailures.test.ts` (+12 -4) 📝 `src/config/captureDecoderHeap.test.ts` (+21 -15) 📝 `src/config/mcpStartupBudgets.test.ts` (+10 -13) 📝 `src/config/regexMatchingDeadline.test.ts` (+48 -17) 📝 `src/config/regexWorkerHeapRequest.test.ts` (+44 -21) 📝 `src/ida/IdaSessionClient.test.ts` (+9 -1) 📝 `src/main/messages.test.ts` (+37 -29) 📝 `src/process/RegexMatcher.test.ts` (+14 -20) 📝 `tests/acceptance/tools/mobileGraphExamples.test.ts` (+29 -9) 📝 `tests/boundary/mcp/mcpDoctor.test.ts` (+26 -28) 📝 `tests/boundary/mcp/mcpStartupPolicy.test.ts` (+76 -56) 📝 `tests/boundary/mcp/processEvidenceIdentityMcp.test.ts` (+112 -10) 📝 `tests/boundary/pcap/pcapProvider.test.ts` (+20 -8) 📝 `tests/boundary/pcap/pcapProviderCrossPlatform.test.ts` (+29 -8) 📝 `tests/boundary/process/regexMatcher.test.ts` (+28 -23) 📝 `tests/boundary/providers/kuna/kunaRegexSearch.test.ts` (+12 -12) </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Tests that locked full recovery sentences now check structured fields and a few semantic tokens. Active values stay bound to their unit and source. Doctor client guidance stays bound to the policy's seconds. Two CI failures inherited from `main` now follow the integrity contract. Independently rehashed or tampered process Evidence projects `evidence_integrity_mismatch`. An unsupported comparison operation stays `invalid_request`. An authenticated inventory whose `coverage.status` is outside `complete|unknown` is an integrity failure, and the reason carries that schema issue. ## Change and scope Test-only. Doctor recovery must contain `startup_timeout_sec of <policy seconds> seconds`. A relative prlimit must contain `must be absolute` and `Check that REA_TSHARK_PRLIMIT_COMMAND`. Process-evidence consumers lock `code`, `category`, `message`, and `details.reason`. Wrong `operation` locks `invalid_request`, `inspect_input_contract`, and the issue path. The Android graph example locks `evidence_integrity_mismatch` and the parsed inventory issue (`invalid_value`, values `complete|unknown`, path `coverage`/`status`). 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. Not applicable: no new provider, target execution, injection, mutation, or protection recovery. ## Contract and boundary impact - Semantic owner and earliest changed stage: test oracles for existing recovery and error projections. No production boundary moved. - Contribution scope fit and linked maintainer decision: not applicable (test-only, inside existing contracts). - CLI and MCP/tool-catalog contract: none. Oracles match the codes those surfaces already return. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - 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. 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 | File | What the assert locks | | --- | --- | | `tests/boundary/mcp/processEvidenceIdentityMcp.test.ts` | Rehashed identity and a tampered digest use `evidence_integrity_mismatch` plus the consumer's `details.reason`. Wrong operation stays `invalid_request` with its issue path. Missing `evidence_links` fails at that field before closure lookup. | | `tests/acceptance/tools/mobileGraphExamples.test.ts` | Unsupported inventory `coverage.status` is `evidence_integrity_mismatch`. The reason parses as `invalid_value` for `complete\|unknown` at `coverage`/`status`. | | `tests/boundary/mcp/mcpStartupPolicy.test.ts` | Doctor recovery requires `startup_timeout_sec of <policy seconds> seconds`, plus client guidance and that REA does not enforce that figure. | | `tests/boundary/mcp/mcpDoctor.test.ts` | `expectDoctorDeadline` requires that same client-seconds token. | | `tests/boundary/pcap/pcapProvider.test.ts` | A relative prlimit requires `must be absolute` and `Check that REA_TSHARK_PRLIMIT_COMMAND`. | | Earlier files in the diff | Structured fields and the short recovery tokens from earlier commits. Full recovery paragraphs stay removed. | - Tests added or updated: test oracles only. - Remaining proof gaps: the unsupported-host pcap case does not run on this Linux host. Fixed-allowance "no runtime override" prose outside this set is unchanged. Real Hopper, Kuna, Ghidra, and browser engines were not run. 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 - Head `97e6aca7e` is based on `746a41937` (#6363), which contains `7091be291` (#6375). - `npm run check:fast` at `97e6aca7e` — typecheck and lint succeeded. - Vitest on `tests/boundary/mcp/processEvidenceIdentityMcp.test.ts` and `tests/acceptance/tools/mobileGraphExamples.test.ts` — 31 passed. - Vitest on the 16 structured-assertion files — 293 passed, 1 skipped. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: unavailable. These are unit and boundary tests with fixtures. - Package or release metadata impact: none. - Security, privacy, process, or containment review: not applicable. Tests do not change authority or cleanup. ## 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 - [ ] 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. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-a2836b0f-8e7d-5cf9-afd2-dc781c110761?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-a2836b0f-8e7d-5cf9-afd2-dc781c110761&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:47:02 +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#7322
No description provided.