Skip to content

id(serve): build the seitan admission path so ServerConfig::freshness() reaches a live admit check (split from #5119) #8487

Closed

Description

@dezren39

Split from #5119 (task 14074) — the one acceptance item explicitly re-scoped there by lane code-u (2026-11-11T02:03Z note) and confirmed by lane code-m on merge of PR #8413.

Verified state

Scope

Design and build the minimum serving admission path that id serve runs:

  1. Decide where seitan proofs arrive (protocol message / endpoint / hub op) and where invites are registered and held.
  2. Decide which world an admitted invite joins, and the failure behavior for unknown/expired invites.
  3. Call Invite::admit from that path with ServerConfig::freshness() as the window (no-config behavior unchanged).
  4. Record the design decisions on this issue before/with the implementation.

Acceptance

Activity

  1. developing-today commented on Nov 11, 2026

    @developing-today
    Contributor
  2. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 11, 2026
  3. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    state: triaged
    task: 14857
    lane: code-u
    outcome: design_recorded_implementation_split

    Design: seitan admission path for id serve (task 14857, lane code-u)

    Grounded in the current tree (origin/main 53cf63a): seitan::Invite::admit(&mut self, proof, now_ms, window) in pkgs/id/src/seitan/admit.rs; ServerConfig::freshness() in pkgs/id/src/server_config/mod.rs; the StartedServerConfig load in pkgs/id/src/commands/serve.rs whose doc comment already names "the freshness window in seitan admission" as the remaining consumer; the serve_pull_policy accessor pair (serve.rs:1155 + tests at :3733) as the established pattern for consuming config in serve; the axum web surface in pkgs/id/src/web/routes.rs (admin-secret-gated POST /api/world/invite, POST /api/identity/register); and Directory::verify_account / DirectoryEntry::AccountVerified in pkgs/id/src/directory.rs, persisted in the directory.jsonl beside the groups log that server-config provisioning already uses (server_config_directory_path, serve.rs:1075).

    Decisions

    1. Where proofs arrive. Two new routes on the existing serve web surface (axum router in web/routes.rs):

      • POST /api/seitan/invite — registration, gated by the same admin-secret check that gates POST /api/world/invite (minting without the secret is refused, per the routes.rs:2031 test idiom). Body: {token, world, expires_ms}. The server builds Invite::create(token, now_ms, expires_ms) and stores it; the response carries only the invite ID. The token is never stored (Invite::create keeps only ID + public key + expiry, by construction) and never logged.
      • POST /api/seitan/admit — unauthenticated; the signed proof is the credential. Body: {message, signature} (the seitan::Proof fields, base64 or hex per the router's existing body idioms).
    2. Where invites are registered/held. A registry in the serve process, next to StartedServerConfig: Mutex<HashMap<InviteId, RegisteredInvite { world: String, invite: Invite }>>, owned by the same state the web router serves. v1 is in-memory only: a restart drops unredeemed invites, which then refuse as unknown (decision 4). That is acceptable for v1 because invites are short-lived (expiry + a minutes-scale freshness window) and re-registration is one admin call; persistence is a named follow-up if operations ever need it, not v1 scope.

    3. Which world an admitted invite joins. The world named at registration — exactly one, bound into the registry entry, never taken from the proof (the proof's fields carry no world, and letting the joiner choose would defeat the binding). The membership change an admission posts is directory-level, per admit.rs's contract ("the caller then posts the membership change for it"): the admitted uid must name an existing account in the server's Directory (created by provisioning or /api/identity/register), and admission appends AccountVerified for it via Directory::verify_account into the server-config directory journal. World-session membership is a separate existing mechanism (world_session invites) and is out of scope here.

    4. Failure behavior (handler order matters — checks that do not consume run before admit):

      • Unparseable proof → 400, malformed.
      • Parsed invite ID with no registry entry (never registered, or dropped by a restart) → 404, unknown_invite. Nothing consumed.
      • uid naming no directory account → 403, unknown_account. Checked from the parsed fields before calling admit, so the invite is not consumed and the joiner can retry once the account exists.
      • Invite::admit refuses → 403 with the Reject reason (revoked / expired / used / stale / from_future / bad_key / bad_signature). A refused accept uses nothing up (guaranteed by admit itself).
      • Success → append AccountVerified first, then 200 {uid, eldest_seqno, world}. If the directory append fails after a successful admit, respond 500 and log loudly: the invite stays consumed in memory (single-use safety wins over retry convenience, matching the seitan mod.rs threat notes).
      • Revocation for v1 is restart-scoped (registry drop) plus expiry; a revoke route is out of v1 scope.
    5. The freshness window. A serve_freshness_window(started: Option<&StartedServerConfig>) -> Duration accessor mirroring serve_pull_policy: started.config.freshness().window() when a config is loaded, seitan::DEFAULT_WINDOW (5 min) when none is — so no-config behavior is unchanged by construction, and Freshness::window()'s inviter/world/server precedence is preserved for the levels ServerConfig::freshness() sets. The admit handler passes this window to every Invite::admit call; there is no other window source.

    Implementation shape (follow-on task)

    Split

    This task (task 14857) records the design (acceptance item 1 of the packet). The implementation is enqueued as a follow-on fix task carrying this design verbatim as its brief; it is effort/l-sized (router state plumbing in a 2,500+ line routes.rs, directory append ordering, five integration tests) and should not be rushed into the same claim as the design it depends on.

  4. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    state: done
    task: 14857
    lane: code-u
    outcome: triaged_design_recorded

    Task 14857 (design stage for issue #8487) is complete: the design is recorded in the comment above (6786323656). The implementation is queued as task 14862 ("Implement #8487: seitan admission path for id serve per the recorded design", same dedupe key, revived from task 14857) carrying the design as its brief, including the acceptance tail: check off the #798 brief line-76 item and close #5119 on merge.

  5. added and removed on Nov 11, 2026
  6. 18 remaining items

  7. added
    work/assignedQueue worker lifecycle state
    and removed on Nov 11, 2026
  8. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — state: parked (CI wait) — lane any-b, task 14862.

    Fresh revalidation 2026-11-11: PR #8529 OPEN at head 19f9912, no labels/hard-stops; both Codex findings carry disposition replies (4534012970 -> fixed, reply 4534118980; 4534012963 -> reply 4534119187 with follow-up issue #8538), even though the Codex summary flag still reads unresolved. Checks: 6 pending / 1 skipping, none failed. Parked on CI per the resume plan: merge on green, then the #798 line-76 checkoff, close #5119, and complete task 14862 as fixed_merged.

  9. 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 11, 2026
  10. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. added a commit that references this issue on Nov 11, 2026
  12. dezren39 commented on Nov 11, 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

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilotstatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions