Skip to content

feat(seal): claim published Seals into your workspace after openadapt login - #2395

Merged
abrichr merged 4 commits into
mainfrom
claude/quickstart-seal-claim
Nov 21, 2026
Merged

abrichr merged 4 commits into
mainfrom
claude/quickstart-seal-claim

Conversation

@abrichr

@abrichr abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member

Quickstart v2, slice "claim", launcher half (design: openadapt-internal#248). Cloud half: OpenAdaptAI/openadapt-cloud#523, behind LOCAL_SEAL_CLAIMS_ENABLED (off). Launcher only: nothing under packages/flow changes, so Flow 3.4.0 is unaffected.

What changes

  • openadapt login is now a command. Only openadapt setup login worked before ("No such command 'login'"), although the design and the dashboard checklist name openadapt login. It passes every argument to openadapt-flow login.
  • Claim after login. When login exits 0, the launcher asks GET /api/local-seal-claims/status (bounded to 1 s).
    • Only if Cloud answers {"enabled": true} and there is something to claim does it sign and send the claim. It then prints one line: Your 2 published runs are in your workspace: <host>/dashboard.
    • It never raises and never changes login's exit code.
    • When the flag is off, it prints nothing.
  • openadapt seal claim [RUN_DIR...] does the same on demand. It also takes run folders, or a quickstart folder, published before this change.
  • Which Seals. seal publish (and so the quickstart's publish) notes each upload in published-seals.json next to the Seal key (~/.openadapt/seal, or $OPENADAPT_SEAL_HOME).
    • The file is mode 0600 and holds the id, origin, seal_sha256, key id and run folder. No delete token.
    • Only Seals published to the Cloud you signed in to, and signed by this computer's current key, are claimed. Seals signed by a replaced key are skipped, with a plain line.
    • seal unpublish removes the entry. Claimed entries are marked, so later logins send nothing.
    • If Cloud reports some ids gone, they are dropped and the rest are claimed.
  • Proof. The Seal key signs openadapt.local-seal-claim/v1\0 followed by canonical JSON of the challenge, the origin and each id with its digest. The ingest token goes only to the host you logged in to. tests/test_seal_claim.py pins the exact bytes, with the same vector as Cloud's test.

Tests

  • tests/test_seal_claim.py (21 tests) runs against a fake Cloud that verifies the signature the way the real route does. It covers the 0600 note without the token, origin and key filtering, the wrong key, a Seal another workspace holds, a bad token, silence when the flag is off, never raising after login, no repeat claim, dropping Seals that are gone, unpublish forgetting, older run folders, the login argv detection, and the hook running only after exit 0.
  • Full launcher suite: 2164 passed, 8 skipped. Ruff is clean.

End to end

Real launcher against Cloud #523 in mock mode, with isolated homes, a null keyring and no browser: cli-e2e.txt. Home greeting screenshot: desktop.

Overlaps

#2357 and #2365 also edit cli.py and seal_publish.py. My edits there are small: a seal claim branch, a login command, the post-login hook in _invoke_flow, one call in upload() and one in unpublish(). I'll rebase on whichever lands first. No CHANGELOG or CAPABILITIES entry until Cloud's flag is on in production.

Do not merge without the coordinator.

… login

openadapt seal publish now notes each upload next to the Seal key
(published-seals.json, mode 0600, no delete token). After openadapt login
succeeds, the launcher asks Cloud whether it takes Seal claims and, if so,
claims this computer's Seals for that Cloud with a signature by the Seal
key over a challenge Cloud minted for the workspace. It prints one line
and never changes login's result. openadapt seal claim [RUN_DIR...] does
the same on demand and takes folders published before the note existed.

Cloud keeps the routes behind LOCAL_SEAL_CLAIMS_ENABLED; with it off the
status route answers false and nothing more is sent.
unpublish removes the Seal from the local note. When Cloud reports some
ids gone, the claim drops them and claims the rest. Claimed Seals are
marked, so a later login sends nothing.
The design and the dashboard's first-run checklist name openadapt login, but
only openadapt setup login existed. The new command passes every argument to
openadapt-flow login, then claims this computer's published Seals.
…tination rule

The claim after login takes only Seals with provenance synthetic-tutorial;
any other Seal is claimed only by an explicit openadapt seal claim. Both
paths apply the destination rule login applies before a token is sent, with
the same --destination-kind and --trusted-host.
@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 81ba08a

openadapt login is a real command that forwards every argument to openadapt-flow login. After exit 0, after_login applies resolve_destination_policy (the same --destination-kind and --trusted-host rule as login) before any claim request or token use. An untrusted http:// host makes no network call. The status probe is a 1-second unauthenticated GET and is silent when the flag is off. The automatic claim takes only unclaimed Seals with provenance synthetic-tutorial; any other Seal needs an explicit openadapt seal claim. The signed bytes are openadapt.local-seal-claim/v1\0 plus the same canonical JSON Cloud verifies (pinned to the same vector). The local note is mode 0600 and never stores the delete token. Failures after login do not change login's exit code. Nothing under packages/flow changes. A nit: the login help still says "Seals this computer published" are claimed, which is broader than the quickstart-only automatic path; the implementation is the tighter of the two. Do not merge without the coordinator.

Pointer: openadapt-internal#211

@abrichr
abrichr merged commit 22e66fc into main Nov 21, 2026
48 of 49 checks passed
@abrichr
abrichr deleted the claude/quickstart-seal-claim branch November 21, 2026 14:44
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