[GH-ISSUE #4233] [Bug] Composite provider hides known failure and retries completed child cleanup #1663

Closed
opened 2026-10-16 21:08:44 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4233

Confirmed behavior

Related audit: #4227. Two controlled regressions against the production CompositeProvider at revision bde139c5d expose loss of child lifecycle facts.

  1. Known failure becomes unknown in public status. Open a production BinarySession through CompositeProvider, instantiate two children, and change one child's operation-health snapshot from idle to exited (connection phase, exit code 7). The other child has no operation-health snapshot. session.status().provider_operation_health returns null instead of retaining the known exited observation.
  2. Cleanup retry repeats already-completed child cleanup. Give one child a successful close and another a close that fails once, then succeeds. Retry composite close. The successful child is closed again. A non-idempotent completed child can therefore create a fresh failure during a retry intended to resolve the remaining child.

These are controlled production-boundary observations, not claims of live-engine failure. The real Ghidra verifier and selected provider lifecycle suites passed separately; those results do not establish live composite coverage.

Root causes

  • operationHealthSnapshot returns undefined immediately if any child snapshot is unavailable, before selecting known non-idle child states. Partial unknown coverage erases an observed failure.
  • Composite close retries the full child collection and does not retain successful child closure. A retry loses completed ownership transitions.

Expected behavior

  • Retain known non-idle child health even when another child's state is unknown. Continue returning unknown when only idle and unknown observations exist; unknown must not become idle.
  • Retain successful child cleanup and retry only unresolved clients. Preserve all remaining failures and existing cleanup/error contracts.
  • Add controls for all-known idle, entirely unknown, mixed idle/unknown, known failure/unknown, and partial close failure followed by successful retry.

Evidence and local work

New tests in src/application/binary/CompositeProvider.test.ts and tests/composition/analysis-sessions/compositeProvider.test.ts reproduce the two assertions before the source change: public status expected exited but was null; a completed child's close expected one call but was invoked twice. Five neighboring tests passed. Minimal owning-boundary fixes and validation are in progress; no released fix is claimed.

Originally created by @morluto on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4233 ### Confirmed behavior Related audit: #4227. Two controlled regressions against the production `CompositeProvider` at revision `bde139c5d` expose loss of child lifecycle facts. 1. **Known failure becomes unknown in public status.** Open a production `BinarySession` through `CompositeProvider`, instantiate two children, and change one child's operation-health snapshot from idle to exited (connection phase, exit code 7). The other child has no operation-health snapshot. `session.status().provider_operation_health` returns null instead of retaining the known exited observation. 2. **Cleanup retry repeats already-completed child cleanup.** Give one child a successful close and another a close that fails once, then succeeds. Retry composite close. The successful child is closed again. A non-idempotent completed child can therefore create a fresh failure during a retry intended to resolve the remaining child. These are controlled production-boundary observations, not claims of live-engine failure. The real Ghidra verifier and selected provider lifecycle suites passed separately; those results do not establish live composite coverage. ### Root causes - `operationHealthSnapshot` returns undefined immediately if any child snapshot is unavailable, before selecting known non-idle child states. Partial unknown coverage erases an observed failure. - Composite close retries the full child collection and does not retain successful child closure. A retry loses completed ownership transitions. ### Expected behavior - Retain known non-idle child health even when another child's state is unknown. Continue returning unknown when only idle and unknown observations exist; unknown must not become idle. - Retain successful child cleanup and retry only unresolved clients. Preserve all remaining failures and existing cleanup/error contracts. - Add controls for all-known idle, entirely unknown, mixed idle/unknown, known failure/unknown, and partial close failure followed by successful retry. ### Evidence and local work New tests in `src/application/binary/CompositeProvider.test.ts` and `tests/composition/analysis-sessions/compositeProvider.test.ts` reproduce the two assertions before the source change: public status expected exited but was null; a completed child's close expected one call but was invoked twice. Five neighboring tests passed. Minimal owning-boundary fixes and validation are in progress; no released fix is claimed.
Author
Owner

@morluto commented on GitHub (Oct 15, 2026):

Local owning-boundary repairs retain observed non-idle child health despite missing peer coverage and retain a Set of successfully closed clients, retrying only unresolved ownership. A mode change during retry does not reacquire cleanup authority over an already released child.

A further production regression demonstrated the related error-composition gap: when two child closes fail with explicit recovery actions, the aggregate previously replaced both instructions with generic cleanup advice (one failing assertion, six neighboring tests passed). The aggregate now preserves the distinct child recovery actions. Direct/managed one-shot cleanup wrappers likewise preserve the cleanup owner's action alongside primary diagnostics.

Controlled production tests cover public BinarySession exited status, busy/unknown versus a missing snapshot, idle/missing remaining unknown, wholly missing observations, mixed-mode partial cleanup retry, single-child typed-error identity, multiple retained resources/actions, and session liveness. The focused combined run passed 38 tests across five files. These are production-boundary checks, not a claim of real composed-engine reproduction. The separate real Ghidra verifier passed.

Patch is local, uncommitted and unreleased.

<!-- gh-comment-id:6201490927 --> @morluto commented on GitHub (Oct 15, 2026): Local owning-boundary repairs retain observed non-idle child health despite missing peer coverage and retain a Set of successfully closed clients, retrying only unresolved ownership. A mode change during retry does not reacquire cleanup authority over an already released child. A further production regression demonstrated the related error-composition gap: when two child closes fail with explicit recovery actions, the aggregate previously replaced both instructions with generic cleanup advice (one failing assertion, six neighboring tests passed). The aggregate now preserves the distinct child recovery actions. Direct/managed one-shot cleanup wrappers likewise preserve the cleanup owner's action alongside primary diagnostics. Controlled production tests cover public BinarySession exited status, busy/unknown versus a missing snapshot, idle/missing remaining unknown, wholly missing observations, mixed-mode partial cleanup retry, single-child typed-error identity, multiple retained resources/actions, and session liveness. The focused combined run passed 38 tests across five files. These are production-boundary checks, not a claim of real composed-engine reproduction. The separate real Ghidra verifier passed. Patch is local, uncommitted and unreleased.
Author
Owner

@morluto commented on GitHub (Oct 16, 2026):

Fixed on main in 0e1f0bf2d. Composite provider health now retains known non-idle child facts despite unknown peer coverage, and close retries only unresolved children.

Production composition/session regressions cover mixed health, completed-child cleanup and failed-owner recovery; no live multi-engine reproduction is claimed.

Hosted main CI is still pending; this closure is based on the implemented fix and scoped regression evidence.

<!-- gh-comment-id:6206052422 --> @morluto commented on GitHub (Oct 16, 2026): Fixed on `main` in [0e1f0bf2d](https://github.com/morluto/rea/commit/0e1f0bf2d06943e59253b8a66923a1ae6005e81e). Composite provider health now retains known non-idle child facts despite unknown peer coverage, and close retries only unresolved children. Production composition/session regressions cover mixed health, completed-child cleanup and failed-owner recovery; no live multi-engine reproduction is claimed. Hosted main CI is still pending; this closure is based on the implemented fix and scoped regression evidence.
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#1663
No description provided.