Skip to content

feat: recover unlinked live daemon registry - #127

Closed
schickling-assistant wants to merge 3 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-30-swift-lamarr-46
Closed

feat: recover unlinked live daemon registry#127
schickling-assistant wants to merge 3 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-30-swift-lamarr-46

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Closes #126.

Summary

Adds a fail-closed pty recover-live --metadata <snapshot.json> <name> path for
future daemons whose pathname socket and registry sidecars are accidentally
unlinked while their provider is still alive.

The original daemon watches for a short-lived authenticated request and:

  • validates name, daemon PID, generation, strong OS process-start token, and
    the full persisted launch shape;
  • refuses conflicting pid/metadata generations and foreign socket inodes;
  • closes only its stranded listener, rebinds in the same daemon, and republishes
    the captured metadata plus authoritative launch fields;
  • preserves the provider and already-established clients;
  • serializes recovery with shutdown and supports retry after a failed bind.

There is no process signal and no provider restart. Unsupported snapshots fail
before publishing a request.

Important applicability boundary

This does not recover daemons that were already running before this code.
Those processes have no request watcher or protocol/start-token marker and
cannot be upgraded in place. The CLI deliberately refuses their snapshots;
they must remain alive and use an existing attachment or transcript fallback.

Reproduction

https://github.com/schickling-repros/2026-07-pty-unlinked-live-daemon

Verification

  • npm run typecheck
  • npm run build
  • recovery/help/completion/disk-format focused tests: 49/49
    • bidirectional established-client continuity and provider PID liveness
    • unsupported snapshot refusal without poking the daemon
    • foreign listener refusal, removal, then successful retry
    • stale request refusal followed by fresh replacement
    • bind-race failure after listener close followed by successful retry
    • nonce-specific concurrent request removal isolation
    • filename/payload nonce binding
    • cross-session cleanup isolation
  • black-box eval probe: all 7 green markers

Paired eval: compoundingtech/evals#54 and compoundingtech/evals#55.

Posted on behalf of @schickling
field value
agent_name co2-bear
agent_session_id a078daee-6f98-4916-91a8-d21291407789
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_model unknown
runtime_profile /nix/store/mnx8agbdq3wiyb6vz63lhgscgazkrn98-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/5r69m9k2llmri3na81518zx0a7y0d3cn-agent-skills-corpus/share/agent-skills/manifest.json
worktree pty/schickling-assistant/2026-07-30-swift-lamarr-46
machine dev3
tooling_profile dotfiles@0fb7e03

myobie commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded by #128, the selected issue #126 implementation.

The two approaches are protocol-incompatible. Exact review found #127 does not provide the accepted capability/HMAC authorization, signed mutable-metadata revision binding, or private root/.recovery identity and permission binding; it also relies on a liveness probe. PR #128 now has independent semantic GREEN at exact head f70f85baa89145136a63cc9909fc2423bd3d1e7d, deterministic stale-snapshot/interrupted-publication/crash-resume/privacy regressions, and green hosted Nix and Test gates.

@myobie myobie closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recover a live daemon whose pathname socket and registry were unlinked

2 participants