Skip to content

id: key export/import — passphrase-wrapped identity key envelope (key-recovery slice 1) #2279

Closed

Description

@dezren39

Follow-on from the key-recovery investigation for #2060 (deliverable: PR #2278, doc/2026-10-29T11-28-18Z_investigation_key_recovery_hosted/).

Slice 1 — documented, passphrase-wrapped key export/import

The investigation's §11 lists eight buildable slices. This issue carries only the first,
because every other slice depends on it and it is the smallest honest step: today the
identity key is a raw 32-byte file at 0600 (pkgs/id/src/store.rs:58-190, KEY_FILE in
src/lib.rs:292) with no export path, so a user who loses the device loses the identity.

Scope:

  • id key export / id key import producing a versioned envelope: format header with
    KDF id + parameters (Argon2id), AEAD ciphertext of the identity secret key.
  • No server involvement: the file is the user's to store. The server never sees plaintext
    or the passphrase.
  • Refuse to import over an existing identity without an explicit replace flag.
  • Tests: round-trip, wrong passphrase, truncated/tampered envelope, parameter-floor refusal.

Explicitly out of scope (later slices, owned by the synthesis): L1 backup blob storage,
recovery sessions with veto windows, device/delegation certificates, guardian shares over
the invite channel, SSO binding records.

Trust constraint from #2060 holds: custodial keys stay rejected (LIST 7 trust model).

Open question this issue should settle: whether slices 2-8 get their own issues now or wait
for the gated synthesis. Sequencing is the synthesis's call, not this issue's.

Acceptance criteria

  • id key export / id key import produce/consume a versioned envelope (KDF id + Argon2id parameters in the header, AEAD ciphertext of the identity secret)
  • Tests pass: round-trip, wrong passphrase, truncated/tampered envelope, parameter-floor refusal
  • Import over an existing identity refuses without an explicit replace flag
  • No server involvement: plaintext and passphrase never leave the user's machine

Activity

  1. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  2. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    on Oct 29, 2026
  3. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: #2060 (key-recovery investigation, PR #2278, §11 slice 1), epic context in the body

    Notes: Smallest honest slice of the key-recovery family and the dependency for slices 2–8; well-scoped with file:line evidence (store.rs:58-190, lib.rs:292) already in the body.

    Risks: Envelope format is a one-way door — versioning and parameter floors must be right in v1 or old backups become unreadable.

    Suggested approach: Implement the envelope + CLI pair test-first; settle the slices 2–8 sequencing question on the synthesis, not here.

    🤖 Agent note · filed

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: repo-fleet-monitor run 2026-10-29T12:12Z (07:12 CDT)
    • Found via: monitor reconciliation
    • Task: Duty 2 intake enrichment — acceptance criteria appended (original body preserved verbatim above it), labels normalized, meta/enriched applied. Still-live check this pass: no merged PR or fix commit explicitly resolving this issue was found; where a queue triage task owns verification, it is named in the notes.
    • Expectation: see the effort label; done = the appended acceptance criteria are met.
    • Links: this issue
  5. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — triage verdict: CONFIRMED (still live, unblocked, foundation slice)

    Verified fresh (2026-11-03)

    • Premise intact: the investigation deliverable is on main (doc/2026-10-29T11-28-18Z_investigation_key_recovery_hosted/), and the files the body cites still exist (pkgs/id/src/store.rs, pkgs/id/src/lib.rs). A code search for a key export/import implementation in pkgs/id returns nothing — no export path exists yet, so the "user who loses the device loses the identity" gap is still open.
    • Scope notes for the builder: Argon2 appears only in pkgs/id/Cargo.lock (a transitive lock entry), not in any pkgs/id source or manifest the search can see — expect to add the Argon2id + AEAD crates as direct dependencies. The existing envelope_net.rs / envelope_outbox.rs are messaging envelopes, unrelated to this key envelope; do not reuse the name without care.
    • No blockers: slice 1 is the foundation — every later key-recovery slice depends on it, not the reverse. The body's open question (file slices 2-8 now or wait) is explicitly the gated synthesis's call, not a blocker for this slice.
    • Ordering: this is the first buildable step of the id: investigate: key recovery for hosted users — Google SSO loss vs the ID keypair #2060 key-recovery series; effort/m stands. Routing stays a build task.
  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    and removed on Nov 3, 2026
  7. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  8. 46 remaining items

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked (Drew-owned PR hard stop)
    task: 9154 (small_fix; queue repo-health-code-pilot; worker repo-worker-code; lane c8b9355e-319a-4640-8096-7ad19480d151 — OpenChamber scheduled lane)
    by: repo-worker-code

    Fresh verification: issue #2279 remains OPEN. PR #5322 remains OPEN on queue/9154-2279-key-export and is authored by dezren39 (Drew), so the standing Drew-owned PR hard stop applies. The required production-line check is now SUCCESS and CodeRabbit is NEUTRAL; this does not remove the ownership restriction. Existing checkpoint/worktree and targeted test evidence were preserved; I did not inspect or change the diff, merge, or create a competing PR.
    Resume: after 30 minutes, revalidate issue and PR. Continue only after explicit handoff or PR disposition removes the hard stop. Queue task 9154 is parked; queue/parked and status/parked mark this task, and work/assigned remains through the park.

  11. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  12. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  13. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  14. added a commit that references this issue on Nov 4, 2026
  15. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions