Skip to content

Add expiring agent support shell invitations - #1

Merged
losfair merged 8 commits into
AFK-surf:mainfrom
zzj3720:feat/temporary-shell-session
Sep 11, 2026
Merged

losfair merged 8 commits into
AFK-surf:mainfrom
zzj3720:feat/temporary-shell-session

Conversation

@zzj3720

@zzj3720 zzj3720 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds ssh-session: the same capabilities and request handling as ssh-shell, with additional deadline admission and active-session expiry checks. Existing ssh-shell behavior and object are unchanged.

The bootstrap now uses the generic hosted delegation API from synchronicity #148:

  • Keep only tools/session-client.py for consent, verified runtime/program downloads, local device-key generation, foreground node ownership and expiry/cleanup.
  • Print the public key and exact registration JSON. The authorized operator submits them to the new CP PUT endpoint; the managed DP signs the existing delegation record. The operator revokes through CP DELETE.
  • Delete private invitation generation, SQLite database packaging, bearer ticket storage, short-link server and their obsolete tests. No controller/node secret or CP credential is embedded in a distributed script.
  • The socket pins the controller public key; the temporary node trusts only that controller. The controller must be a named member of the hosted network.

Validation

  • Authorization/deadline C tests, capability/handler parity, six bootstrap tests and two build tests pass.
  • Canonical object checksums and capability loading passed in the previous exact-head CI; object bytes are unchanged in this bootstrap update.
  • Real macOS v0.1.10 download/checksum, local key generation, offline trust setup, online daemon startup and socket activation passed. Inspected the temporary node, stopped it with Ctrl-C, and verified removal of its temporary directory.
  • Full live CP→DP→bootstrap connection is not yet validated: the new API is not deployed. The companion PR's 343 Gleam tests, 47 DP library tests, local clippy and independent review pass; CI remains in progress.

Boundaries

No invitation/token service, persistent installation or production deployment. Short-command distribution is left to the calling application; command length is not restricted. The bootstrap prints public registration data rather than claiming that local readiness proves network admission.

The shell has OS-user privileges; it is not a sandbox. Deadline/revocation cannot undo changes or guarantee cleanup of detached descendants. Network delegation expiry/revocation and application connection shutdown are separate. Linux bootstrap behavior remains unvalidated.

Production source boundary src/, include/session-deadline.h, tools/: +237 / -4, net +233, total 241 changed lines; excludes tests/docs/CI/generated objects.

@zzj3720

zzj3720 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Updated to cf0e9e9 with canonical Docker objects/checksums and signal-safe teardown. Independent agent re-review of this exact head found no blockers (not a GitHub approval). Local authorization/deadline tests, five session-tools tests and two build tests pass. Canonical object loads and has only a shell-process capability. Fork exact-head CI passed; upstream PR check is still running. Real macOS v0.1.10 tests covered generation, consent, temporary node startup, agent SSH login and forced expiry of an active shell; test nodes, invitation secrets and grants were removed. Linux runtime and signal-driven E2E remain unverified. Production source boundary src/, include/session-deadline.h and tools/: +324 / -4, net +320, total changed 328 lines; excludes tests/docs/CI/generated binaries.

@zzj3720
zzj3720 marked this pull request as ready for review September 10, 2026 08:43
@zzj3720

zzj3720 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Added short-command delivery at fcb9a7c. make-session.py can now publish atomically into a private local store and produce an HTTPS curl-to-sh command bounded to 100 characters (74 with the documented example domain). The loopback origin is read-only, expiry-gated, no-store/no-referrer and token-log-free; a human-operated HTTPS proxy is required for public deployment. Added six tests covering expiry, malformed/missing/symlink tickets, no remote issuance, token logging, command length, private permissions, atomic collision refusal, real curl-to-sh execution and PTY consent. Full local test suite passes. macOS end-to-end with real v0.1.10 runtime (verified cached release archive), a local HTTP origin and real SSH succeeded; Ctrl-C stopped the temporary node, and test delegation/store were cleaned up. Independent full-thread re-review and exact-head CI are in progress. Production boundary unchanged: +544 / -4, net +540, total 548 changed lines. No production service has been deployed.

@zzj3720

zzj3720 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Latest clarification applied at 0a200f0: command length is advisory only. Long HTTPS bases still generate normally; actual length is printed, and ticket entropy/HTTPS validation remain intact. Independent full-thread re-review found no blockers. All local tests pass, including explicit acceptance of commands over 100 characters. Exact-head CI is pending. Updated cumulative production-source counts (same boundary): +542 / -4, net +538, total changed 546 lines.

Managed via Tart and others added 2 commits September 11, 2026 02:27
Co-authored-by: 3720 <zuozijian1994@gmail.com>
Co-authored-by: 3720 <zuozijian1994@gmail.com>
@zzj3720

zzj3720 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Updated at 531c9c0: ssh-session retains ssh-shell capabilities and request handling, including scoped SFTP/tree-write; only deadline checks and program name differ. Canonical object/checksums and security documentation are updated. Capability/handler parity regression and all local tests pass. Independent agent re-review found no blockers (not a GitHub approval). Exact-head Check sources and committed objects CI passed. Actual SFTP transfers and deadline behavior with the rebuilt object were not re-exercised. Production boundary src/, include/session-deadline.h, tools/: +537 / -4, net +533, total 541 changed lines, excluding tests/docs/CI/binaries. No merge or deployment performed.

Managed via Tart and others added 2 commits September 11, 2026 02:56
Co-authored-by: 3720 <zuozijian1994@gmail.com>
Co-authored-by: 3720 <zuozijian1994@gmail.com>
@zzj3720

zzj3720 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Latest 03b4394 removes redundant invitation/database packaging and download-server tooling in favor of hosted delegation PUT/DELETE from synchronicity #148. Only the user bootstrap remains. Independent thread-driven agent re-review found no blockers (not a GitHub approval); fixed the documented SSH destination to be device-key-specific so repeat sessions preserve host-key verification. Local tests and real macOS bootstrap/download/activation/Ctrl-C cleanup passed. Full live hosted-registration connection remains unvalidated; companion API is not deployed. Exact-head CI pending. Production boundary src/, include/session-deadline.h and tools/: +237 / -4, net +233, total 241 lines; excludes tests/docs/CI/binaries.

@losfair
losfair merged commit 2b86003 into AFK-surf:main Sep 11, 2026
1 check passed
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.

2 participants