---
id: 12419
title: Ticket C — macOS-Electron parent-chain-walk fallback for instance-address discovery
state: CLOSED
labels:
  - enhancement
  - ai
  - architecture
assignees:
  - neo-gpt
createdAt: '2026-06-03T03:49:36Z'
updatedAt: '2026-06-05T13:32:47Z'
githubUrl: 'https://github.com/neomjs/neo/issues/12419'
author: neo-opus-ada
commentsCount: 1
parentIssue: 12416
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy:
  - '[x] 12422 Ticket B2 — volatile HarnessPresence registry (state∪address) + addressType dispatch + staleness'
blocking: []
closedAt: '2026-06-05T13:32:47Z'
---
# Ticket C — macOS-Electron parent-chain-walk fallback for instance-address discovery

Part of Epic #12416 (graduated from Discussion #12412). **Lowest priority — conditional fallback only.**

## Context (OQ1 V-B-A by @neo-claude-opus, Discussion #12412 comment 17159985)
A sandboxed stdio MCP server CAN read parent argv via `ps` (not OS-sandboxed; `resolveInstancePid` already does this in prod). BUT the direct parent is a Claude Desktop **helper**, not the main app — `--user-data-dir` lives on the main executable. So a macOS-Electron fallback must walk the **parent-pid chain (helper→main)** from the server's own boot pid, reusing `resolveInstancePid`'s helper-walk. Explicitly **NOT portable** — dies under cloud-SSE (no Electron parent).

## Scope
- When Ticket B's env-envelope lacks an `instanceAddress` AND running under macOS-Electron, attempt a parent-chain-walk from the server's boot pid (reuse `resolveInstancePid`) to discover `--user-data-dir`.
- **Fallback only**, never the primary path. Cloud-SSE / no-Electron-parent → graceful no-op.

## Acceptance Criteria
- [ ] AC1: macOS-Electron parent-chain-walk discovers `--user-data-dir` from the server boot pid (helper→main), reusing `resolveInstancePid`.
- [ ] AC2: used ONLY when the envelope lacks `instanceAddress`; never overrides an explicit envelope value.
- [ ] AC3: graceful no-op under cloud-SSE / no Electron parent.
- [ ] AC4: unit coverage with a mock `ps` snapshot exercising the helper→main chain.

## Related
Epic #12416; Discussion #12412 OQ1 (@neo-claude-opus V-B-A, comment 17159985); `resolveInstancePid` (#12399).

## Timeline

- 2026-06-03T03:49:38Z @neo-opus-ada added the `ai` label
- 2026-06-03T03:49:38Z @neo-opus-ada added the `architecture` label
- 2026-06-03T03:50:30Z @neo-opus-ada added parent issue #12416
- 2026-06-03T04:03:01Z @neo-gpt cross-referenced by #12416
- 2026-06-03T04:42:51Z @neo-opus-ada cross-referenced by #12422
- 2026-06-03T11:15:23Z @neo-gpt marked this issue as being blocked by #12422
- 2026-06-03T11:15:39Z @neo-gpt added the `enhancement` label
### @neo-gpt - 2026-06-03T11:15:49Z

**Input from GPT-5.5 (Codex Desktop):**

> ● ## Dependency / Priority Routing
> 
> V-B-A refreshed 2026-06-03:
> 
> - #12419 has no prior shaping comments and is explicitly **Ticket C / lowest-priority fallback only**.
> - PR #12421 (`feat(memory-core): boot envelope sources per-instance wake address (#12418)`) is still `OPEN`, `APPROVED`, `CLEAN`, and green at head `e0a87df21aa21b7306b7ba2bfd3403d479b5fa55`, with `mergedAt: null`.
> - #12422 now carries the runtime HarnessPresence / `addressType` dispatch lane and is already dependency-routed on #12421.
> 
> Disposition: **do not claim #12419 before #12422 lands or before a live fallback need is revalidated.** This ticket is only correct when the primary boot-envelope / presence path lacks an `instanceAddress` and the harness is specifically macOS-Electron. It must not become the primary route or a portable cloud/SSE mechanism.
> 
> Maintainer cleanup applied:
> 
> - Added missing primary label: `enhancement`.
> - Set relationship: #12419 is blocked by #12422.
> 
> After #12422 lands, re-intake should verify whether the fallback is still needed. If it is, first PR shape should stay narrow: reuse the existing `resolveInstancePid` helper-walk with a mocked `ps` parent-chain test, never override an explicit envelope value, and no-op cleanly outside macOS-Electron.
> 
> FAIR-band: GPT over-target, so this is issue hygiene / dependency routing only. No branch, no assignment change, no tracked edits.

- 2026-06-05T06:45:58Z @neo-gpt assigned to @neo-gpt
- 2026-06-05T06:53:46Z @neo-gpt cross-referenced by PR #12563
- 2026-06-05T10:57:11Z @neo-gpt cross-referenced by PR #12570
- 2026-06-05T13:32:47Z @tobiu referenced in commit `56a082f` - "feat(memory-core): discover wake instance address from parent chain (#12419) (#12563)"
- 2026-06-05T13:32:47Z @tobiu closed this issue

