[GH-ISSUE #2138] [Feature] Complete the upstream session evidence in headless IDA cleanup diagnostics #698

Closed
opened 2026-10-15 18:27:29 +00:00 by bsakaguchi · 2 comments
Owner

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

Before submitting

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

Area

Native analysis or decompilation (headless IDA provider)

Current limitation

#1841 adds an upstream_sessions entry to headless IDA cleanup_incomplete diagnostics. It names upstream sessions whose release REA could not confirm, each with session_id, backend and owned. To keep that PR focused on its core fix (one-shot CLI exit after retained cleanup), two refinements raised in review were deferred:

  1. Startup inventory is not used as evidence. #initialize validates only the requested owned worker in the startup idb_list. If that inventory also lists another same-input session and the first idb_close then rejects, the diagnostic falls back to the requested worker with owned: null. The peer is omitted, and the ownership REA already parsed is dropped. (review thread)
  2. Observed input paths are not reported. The post-close remaining filter keeps an entry whose session_id matches the requested database even when its input_path differs. The diagnostic drops that path, and its reason text presents the entry as a session on the private input. With mismatched or reused IDs, an operator cannot tell the unreleased worker from another database. (review thread)

Use cases

An operator or agent reads cleanup_incomplete after an interrupted headless IDA analysis to decide which upstream session to release, for example with idb_close, and which ones are external.

Desired outcome and success criteria

  • Session evidence from a successful startup inventory is retained as blocker evidence, until a later successful inventory replaces it.
  • Each observed session reports its input_path, or an explicit binding conflict when its ID matches but its path does not.
  • Tests cover a startup peer with a rejected first close, and a post-close entry with the requested ID but a different input path.

Authority boundaries and non-goals

Diagnostics only. Nothing here closes, kills or adopts upstream sessions, and successful-close validation is not weakened.

Alternatives considered

Folding these into #1841. They were deferred because each review round in that PR raised further diagnostic edge cases, while its core fix is the CLI exit.

Possible direction

Record the startup idb_list same-input entries through the same blocker-recording path used for recovery and post-close inventories, and carry input_path in UpstreamSession.

References

#1841, #1710

Originally created by @AS9929 on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2138 ### Before submitting - [x] I searched the open and closed issues and pull requests for a related proposal. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Native analysis or decompilation (headless IDA provider) ### Current limitation #1841 adds an `upstream_sessions` entry to headless IDA `cleanup_incomplete` diagnostics. It names upstream sessions whose release REA could not confirm, each with `session_id`, `backend` and `owned`. To keep that PR focused on its core fix (one-shot CLI exit after retained cleanup), two refinements raised in review were deferred: 1. **Startup inventory is not used as evidence.** `#initialize` validates only the requested owned worker in the startup `idb_list`. If that inventory also lists another same-input session and the first `idb_close` then rejects, the diagnostic falls back to the requested worker with `owned: null`. The peer is omitted, and the ownership REA already parsed is dropped. ([review thread](https://github.com/morluto/rea/pull/1841#discussion_r4246550413)) 2. **Observed input paths are not reported.** The post-close `remaining` filter keeps an entry whose `session_id` matches the requested database even when its `input_path` differs. The diagnostic drops that path, and its reason text presents the entry as a session on the private input. With mismatched or reused IDs, an operator cannot tell the unreleased worker from another database. ([review thread](https://github.com/morluto/rea/pull/1841#discussion_r4246550738)) ### Use cases An operator or agent reads `cleanup_incomplete` after an interrupted headless IDA analysis to decide which upstream session to release, for example with `idb_close`, and which ones are external. ### Desired outcome and success criteria - Session evidence from a successful startup inventory is retained as blocker evidence, until a later successful inventory replaces it. - Each observed session reports its `input_path`, or an explicit binding conflict when its ID matches but its path does not. - Tests cover a startup peer with a rejected first close, and a post-close entry with the requested ID but a different input path. ### Authority boundaries and non-goals Diagnostics only. Nothing here closes, kills or adopts upstream sessions, and successful-close validation is not weakened. ### Alternatives considered Folding these into #1841. They were deferred because each review round in that PR raised further diagnostic edge cases, while its core fix is the CLI exit. ### Possible direction Record the startup `idb_list` same-input entries through the same blocker-recording path used for recovery and post-close inventories, and carry `input_path` in `UpstreamSession`. ### References #1841, #1710
Author
Owner

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

Diagnostics & Upstream Session Tracking Review

Completing upstream_sessions evidence in headless IDA cleanup_incomplete errors aligns with REA's core rule: never drop parsed ownership facts.

  • Inventory Correlation: If idb_list during startup identifies pre-existing sessions for the same input target, retaining them in the session tracker allows cleanup_incomplete to distinguish between sessions spawned by this run versus external or orphaned peer sessions.
  • Explicit Provenance: Emitting owned: true for the active session and owned: false (or external_peer) for pre-existing sessions gives callers clear actionable signals on which IDA database locks must be cleaned up manually.
<!-- gh-comment-id:6134456698 --> @matbrgz commented on GitHub (Oct 12, 2026): ### Diagnostics & Upstream Session Tracking Review Completing `upstream_sessions` evidence in headless IDA `cleanup_incomplete` errors aligns with REA's core rule: never drop parsed ownership facts. - **Inventory Correlation:** If `idb_list` during startup identifies pre-existing sessions for the same input target, retaining them in the session tracker allows `cleanup_incomplete` to distinguish between sessions spawned by this run versus external or orphaned peer sessions. - **Explicit Provenance:** Emitting `owned: true` for the active session and `owned: false` (or `external_peer`) for pre-existing sessions gives callers clear actionable signals on which IDA database locks must be cleaned up manually.
Author
Owner

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

Verified during the bug/fix-PR audit. Fixed on main by #2814 (commit 7369b5ee6). IDA retains successful startup inventory facts, ownership, input paths and conflicting bindings through failed cleanup.

Current implementation: src/ida/IdaSessionClient.ts. Validation on macOS arm64 with Node.js 24.18.0: npm run test:local -- src/application/HermesConfigurationYaml.test.ts src/ida/IdaSessionClient.test.ts src/native/NativeMachoInspection.test.ts src/browser/PlaywrightElectronActiveProvider.test.ts passed (84 tests). This is source/provider-boundary regression coverage; no real IDA GUI session was launched for this check.

Closing because the reported behavior is already addressed on main.

<!-- gh-comment-id:6157482673 --> @morluto commented on GitHub (Oct 13, 2026): Verified during the bug/fix-PR audit. Fixed on main by #2814 (commit 7369b5ee6). IDA retains successful startup inventory facts, ownership, input paths and conflicting bindings through failed cleanup. Current implementation: `src/ida/IdaSessionClient.ts`. Validation on macOS arm64 with Node.js 24.18.0: `npm run test:local -- src/application/HermesConfigurationYaml.test.ts src/ida/IdaSessionClient.test.ts src/native/NativeMachoInspection.test.ts src/browser/PlaywrightElectronActiveProvider.test.ts` passed (84 tests). This is source/provider-boundary regression coverage; no real IDA GUI session was launched for this check. Closing because the reported behavior is already addressed on main.
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#698
No description provided.