[GH-ISSUE #5641] [Bug] Cancellation projection replaces incomplete retained observations with unreadable_output #3420

Closed
opened 2026-10-31 00:40:10 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @cursor[bot] on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5641

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

Service projection replaces AnalysisCancelledError with AnalysisOutputError (code: unreadable_output) when a retained observation fails the completed-result schema, and drops partialObservation.

This is the same branch as #5364 for browser scenario startup. The additional sites below were executed as source service tests with authored incomplete observations, not as live browser or Inspector sessions.

Executed on source 17f581ff75d2b6cf643a997275e3e296f6c95760 with npm run test:local and Node 24.18.0. Each new case failed before the projection change: the service returned AnalysisOutputError and partialObservation: undefined.

  • captureBrowserScenario: startup-shaped capture (cleanup: "incomplete", steps: [], no completeness) became "Browser scenario provider retained a malformed completed capture." Zod reported invalid cleanup, empty steps, and missing completeness. The exact caller reason was dropped.
  • inspectElectronPage: { kind: "electron-page-observation", inspection: { target_id }, cleanup: "incomplete" } became "Electron provider retained a malformed completed page inspection."
  • WebRuntimeService.observe / inspect: objects with the partial discriminators but not the completed schemas became "Provider retained a malformed completed execution observation." and "Provider retained malformed completed event-listener data."
  • inspectWebPage: { target, network, capture_window } with incomplete fields became "Browser provider retained a malformed completed page inspection."
  • analyzeWebBundle: { observations: [], capture: { status: "partial" } } became "Browser provider retained malformed completed bundle facts."
  • observeJavaScriptRuntime: { runtime: "partial", scripts: [] } became "Inspector retained a malformed completed runtime observation."

A successful malformed scenario result still correctly projects unreadable_output ("returned a malformed completed capture"). That control passed in the same run.

Reproduction

  1. Check out 17f581ff75d2b6cf643a997275e3e296f6c95760.
  2. Add the service tests that pass AnalysisCancelledError with the incomplete partials named above.
  3. Run:
npm run test:local -- src/application/BrowserScenarioCaptureService.test.ts src/application/javascript/ElectronObservationService.test.ts src/application/WebRuntimeService.test.ts src/application/BrowserObservationService.test.ts src/application/javascript/JavaScriptRuntimeObservationService.test.ts

Result before the projection change: 5 failed, 29 passed. The five new cancellation cases received AnalysisOutputError.

Live Chrome, Electron, CDP, and V8 Inspector sessions were not run for this report. #5364 already records a real Chrome CLI reproduction of the browser-scenario message. Frequency of the other providers hitting these branches in ordinary use: NOT_ENOUGH_INFO.

Expected behavior

Keep the primary AnalysisCancelledError, its exact cause, and the raw retained observation. Promote a retained observation to Evidence only when it satisfies the completed schema. A successful provider result that fails that schema remains unreadable_output.

Impact and scope

Callers lose cancellation and the incomplete observation, and receive non-retryable output-corruption advice. Observed at the application service boundary with authored partials. Public CLI/MCP delivery for the non-scenario operations was not executed.

REA version

Source 17f581ff75d2b6cf643a997275e3e296f6c95760, package 6.7.0.

Runtime and platform

Node.js 24.18.0; Linux 6.12.94+ x86_64. No browser binary was launched.

Target and artifact context

Authored in-memory partial observations. No external target.

Interface

Other

Earliest failure stage

Transport or result projection

Relevant output or evidence

The failing assertions compared result.error with the original AnalysisCancelledError. Received _tag: "AnalysisOutputError" and partialObservation: undefined. Browser scenario Zod paths were browser.cleanup, steps, and completeness.

Source: the instanceof AnalysisCancelledError branches that construct AnalysisOutputError for a failed completed-schema parse in:

  • src/application/BrowserScenarioCaptureService.ts
  • src/application/javascript/ElectronObservationService.ts
  • src/application/WebRuntimeService.ts
  • src/application/BrowserObservationService.ts
  • src/application/javascript/JavaScriptRuntimeObservationService.ts

Typed outcome or recovery expected

cancelled, with the original cause and partial_observation retained. Completed captures may still be wrapped as Evidence. Successful malformed results stay unreadable_output.

Analysis or suspected cause

Source-derived: these projectors parse a failure's retained observation with the completed-result schema. Schema failure plus cancellation replaces the primary error. Browser scenario partials from browserScenarioCaptureData omit completeness and can use cleanup: "incomplete" and empty steps, so that schema rejects a real startup observation. The other branches do the same replacement for any retained object that fails the completed schema.

Additional context

Related: #5364. The owned-command late-exit issues #5292, #5393, #5284, #5279, and #5287 already have regressions on this revision; this report does not reopen them. Process-table reparenting (#5206) and Windows Handle.reset (#4505) were not executed here.

Originally created by @cursor[bot] on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5641 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior Service projection replaces `AnalysisCancelledError` with `AnalysisOutputError` (`code: unreadable_output`) when a retained observation fails the completed-result schema, and drops `partialObservation`. This is the same branch as #5364 for browser scenario startup. The additional sites below were executed as source service tests with authored incomplete observations, not as live browser or Inspector sessions. Executed on source `17f581ff75d2b6cf643a997275e3e296f6c95760` with `npm run test:local` and Node 24.18.0. Each new case failed before the projection change: the service returned `AnalysisOutputError` and `partialObservation: undefined`. - `captureBrowserScenario`: startup-shaped capture (`cleanup: "incomplete"`, `steps: []`, no `completeness`) became "Browser scenario provider retained a malformed completed capture." Zod reported invalid cleanup, empty steps, and missing completeness. The exact caller reason was dropped. - `inspectElectronPage`: `{ kind: "electron-page-observation", inspection: { target_id }, cleanup: "incomplete" }` became "Electron provider retained a malformed completed page inspection." - `WebRuntimeService.observe` / `inspect`: objects with the partial discriminators but not the completed schemas became "Provider retained a malformed completed execution observation." and "Provider retained malformed completed event-listener data." - `inspectWebPage`: `{ target, network, capture_window }` with incomplete fields became "Browser provider retained a malformed completed page inspection." - `analyzeWebBundle`: `{ observations: [], capture: { status: "partial" } }` became "Browser provider retained malformed completed bundle facts." - `observeJavaScriptRuntime`: `{ runtime: "partial", scripts: [] }` became "Inspector retained a malformed completed runtime observation." A successful malformed scenario result still correctly projects `unreadable_output` ("returned a malformed completed capture"). That control passed in the same run. ### Reproduction 1. Check out `17f581ff75d2b6cf643a997275e3e296f6c95760`. 2. Add the service tests that pass `AnalysisCancelledError` with the incomplete partials named above. 3. Run: ```sh npm run test:local -- src/application/BrowserScenarioCaptureService.test.ts src/application/javascript/ElectronObservationService.test.ts src/application/WebRuntimeService.test.ts src/application/BrowserObservationService.test.ts src/application/javascript/JavaScriptRuntimeObservationService.test.ts ``` Result before the projection change: 5 failed, 29 passed. The five new cancellation cases received `AnalysisOutputError`. Live Chrome, Electron, CDP, and V8 Inspector sessions were not run for this report. #5364 already records a real Chrome CLI reproduction of the browser-scenario message. Frequency of the other providers hitting these branches in ordinary use: NOT_ENOUGH_INFO. ### Expected behavior Keep the primary `AnalysisCancelledError`, its exact cause, and the raw retained observation. Promote a retained observation to Evidence only when it satisfies the completed schema. A successful provider result that fails that schema remains `unreadable_output`. ### Impact and scope Callers lose cancellation and the incomplete observation, and receive non-retryable output-corruption advice. Observed at the application service boundary with authored partials. Public CLI/MCP delivery for the non-scenario operations was not executed. ### REA version Source `17f581ff75d2b6cf643a997275e3e296f6c95760`, package 6.7.0. ### Runtime and platform Node.js 24.18.0; Linux 6.12.94+ x86_64. No browser binary was launched. ### Target and artifact context Authored in-memory partial observations. No external target. ### Interface Other ### Earliest failure stage Transport or result projection ### Relevant output or evidence The failing assertions compared `result.error` with the original `AnalysisCancelledError`. Received `_tag: "AnalysisOutputError"` and `partialObservation: undefined`. Browser scenario Zod paths were `browser.cleanup`, `steps`, and `completeness`. Source: the `instanceof AnalysisCancelledError` branches that construct `AnalysisOutputError` for a failed completed-schema parse in: - `src/application/BrowserScenarioCaptureService.ts` - `src/application/javascript/ElectronObservationService.ts` - `src/application/WebRuntimeService.ts` - `src/application/BrowserObservationService.ts` - `src/application/javascript/JavaScriptRuntimeObservationService.ts` ### Typed outcome or recovery expected `cancelled`, with the original cause and `partial_observation` retained. Completed captures may still be wrapped as Evidence. Successful malformed results stay `unreadable_output`. ### Analysis or suspected cause Source-derived: these projectors parse a failure's retained observation with the completed-result schema. Schema failure plus cancellation replaces the primary error. Browser scenario partials from `browserScenarioCaptureData` omit `completeness` and can use `cleanup: "incomplete"` and empty `steps`, so that schema rejects a real startup observation. The other branches do the same replacement for any retained object that fails the completed schema. ### Additional context Related: #5364. The owned-command late-exit issues #5292, #5393, #5284, #5279, and #5287 already have regressions on this revision; this report does not reopen them. Process-table reparenting (#5206) and Windows `Handle.reset` (#4505) were not executed here.
Author
Owner

@matbrgz commented on GitHub (Oct 20, 2026):

Cross-referencing with canonical issue #5364 ([Bug] Cancelling browser scenario startup becomes unreadable_output and drops partial capture) and siblings #5388, #5393. All cover cancellation projection anomalies where partial observations or abort proofs are replaced by generic unreadable_output. Cataloged under Cluster BO in consolidation tracker #4330.

<!-- gh-comment-id:6297500601 --> @matbrgz commented on GitHub (Oct 20, 2026): Cross-referencing with canonical issue #5364 (`[Bug] Cancelling browser scenario startup becomes unreadable_output and drops partial capture`) and siblings #5388, #5393. All cover cancellation projection anomalies where partial observations or abort proofs are replaced by generic `unreadable_output`. Cataloged under Cluster BO in consolidation tracker #4330.
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#3420
No description provided.