Skip to content

feat(onboarding): add explicit resumable connection setup - #289

Merged
abruption merged 9 commits into
mainfrom
abruption/v110-onboarding-211-20261009
Oct 9, 2026
Merged

abruption merged 9 commits into
mainfrom
abruption/v110-onboarding-211-20261009

Conversation

@abruption

@abruption abruption commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #211. Add an explicit, resumable session-peer setup flow while retaining the existing manual commands and lightweight local/SSH CLI.

  • Offer local/SSH/Relay choices and guidance for the original installation manager. No dependency install, manager switch, Node.js prerequisite, native approval, or service change is implicit.
  • Relay interactive and action-based paths reuse browser/headless login, named enrollment, private invitation pairing, foreground receiver startup, and authenticated probe/list readiness primitives. Every mutation requires separate consent or --apply; setup never sends a test message.
  • Build one-peer/one-target policies with list as the default, an explicit optional send permission, exact target/home/executable selection and pre-apply revalidation. Create private files exclusively or reuse an identical policy; never broaden or overwrite a different policy.
  • Retain the original enrollment UUID, origin, key identity and full registration payload durably before network access. Resume uses the existing Control operation receipt reconciliation. Changed intent/payload is refused; captured original payload and validated login are used for the actual request.
  • Inventory never constructs Store or initializes/migrates state. Approved initialization also refuses incomplete or lost prior identity/database state, including retained journals and lost active rotated keys. Empty private directories remain valid fresh installations.
  • Document the workflow and boundaries in English, Korean, Japanese and Simplified Chinese.

Type

  • feat
  • fix
  • docs
  • chore / refactor / test / perf

Checklist

  • Dependency-free local/SSH setup paths exercise the existing command dispatch in isolated tests.
  • Real-host SSH: not run for this feature.
  • Target discovery and dry-run metadata preflight never post a message; fixtures cover stale/ambiguous selections.
  • Commits follow Conventional Commits.
  • Four-language paired-device documentation updated; standalone regenerated and checked.
  • No credentials, private keys, invitation secrets or real session identifiers in the diff. All test data is private fixture data.

Verified against

macOS arm64 / Python 3.13.7, isolated optional Relay/MCP test environment. No actual Claude/Codex/Antigravity message, public Control request, browser login, installation rollout or live service change was performed.

  • Focused new setup plus existing Control suites: 41 tests PASS, including an owned loopback TLS invitation/pair/probe/list exchange with a fake native endpoint.
  • Documentation tests: 32 PASS.
  • tools/generate_session_peer.py --check and git diff --check: PASS.
  • Strict full suite at 306bc37855f29e17e7d130ce2d49cb6a88e41b6c: 823 tests PASS / 12 skips using -X dev -W error::ResourceWarning. The suite emitted the previously observed asyncio incoming-connection/teardown assertion diagnostic during existing Relay tests while unittest still finished with zero failures. It is disclosed rather than treated as a clean zero-diagnostic execution; prior exact-head suites at daaa096 and 6899b0b passed without that diagnostic.
  • Independent read-only source/fixture review: complete. Findings about exact enrollment payload retention, truthful existing-identity reporting, and retained artifacts after loss of keys/DB are addressed. The pre-PR delta was independently checked with 39 focused tests. The final automatic-review pairing fix at 306bc37855f29e17e7d130ce2d49cb6a88e41b6c was independently accepted after a bounded read-only delta review and 41 focused tests PASS; no additional confirmed scoped blocker was found.

Notes

  • Automatic review finding about prematurely retaining invalid pairing input is addressed: validate shape/expiry/certificate/route plus local recovery/key refusals before persisting intent; resolve auto to the advertised route. Only a potentially attempted valid pairing intent is immutable. Added malformed/expired/unavailable-route → corrected input and locally revoked-key regression tests. The invitation is read once for validation and its retained digest.

  • Private setup.json is protected 0600 recovery material; it retains certificate and operation data, but never login tokens or invitation secrets. Do not publish it. Native exactly-once delivery and the frozen handoff contract are unchanged.

  • The existing authenticated enrollment API must already support operation UUID receipt reconciliation. This PR does not change Control protocol or deploy a hosted service.

  • Inventory's immutable SQLite view is diagnostic and checkpointed, not current authorization. Live pre-mutation state validation reads existing metadata without initialization. Known service files and receiver locks are reported; arbitrary service discovery is explicitly incomplete. No service installation/autostart is offered. Existing systemd/launchd management remains separate.

  • Client readiness is authenticated metadata/probe evidence, not a message ACK, model consumption, native agent approval or availability guarantee. Interrupted invitation creation requires manual reconciliation; expired login requires explicit re-login while retaining the original enrollment intent. Cancellation does not roll back a committed operation or cancel an original message.

  • Relay setup remains Unix/Python 3.11+ with optional extras. Windows native Relay setup, real headless/browser Control approval, actual agent delivery, real-host SSH and production service acceptance were not validated here.

  • This isolated branch starts from 10a9cef; sibling v1.1.0 PRs are separate. Shared parser/generated and paired-device documentation changes require integration verification before any merge. No merge, release, deployment or live experiment is part of this PR.

@abruption abruption added this to the v1.1.0 milestone Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T00:44:33.149650Z daaa096 PR opened
🔒 Security Review ✅ Completed 2026-10-09T00:44:49.862802Z daaa096 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: daaa096731

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread session_peer_relay/setup.py Outdated
Comment on lines +371 to +375
intent = {'invitationDigest': digest(path), 'device': invitation['device'], 'route': args.route}
if saved and saved != intent:
raise Rejected('setup_pairing_intent_changed')
work.saved['pairing'] = intent
work.phase('pair', 'pending')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate invitations before pinning the pairing intent

When the first pairing attempt uses an expired/malformed invitation or selects a route absent from the invitation, this code persists that digest and route before pair() performs its local validation. The attempt then fails without any network mutation, but a replacement invitation or corrected --route is rejected as setup_pairing_intent_changed, while cancel does not clear the intent, permanently blocking normal setup for this initialized state. Validate the invitation and requested route before saving the pairing intent, reserving the immutable pending state for attempts that can actually begin pairing.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the new commit: validate invitation shape, expiry, certificate/key fields and advertised route before saving any pairing intent. Resolve auto to the actual supported direct/relay route before effect; invalid local inputs leave no retained pairing intent, while possibly attempted valid intents remain fenced. The file is read once so validation and retained digest describe the same input. Added malformed/expired/unavailable-route → corrected valid invitation regression; focused setup/core/Control tests 40 PASS. No uncertain operation is reset or automatically retried.

@abruption
abruption merged commit 75cfb4f into main Oct 9, 2026
28 checks passed
@abruption
abruption deleted the abruption/v110-onboarding-211-20261009 branch October 9, 2026 05:47
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.

1 participant