Skip to content

impl(pm-stack): aggregator identity registry table + owner admin actions + audit events (#1253 split 2) #9604

Closed

Description

@dezren39

Implementation split 2 of 6 from the #1253 design record (doc/2026-11-10T23-58-00Z_design_pm_stack_identity, merged in PR #8351).

Scope: Aggregator: identity registry table + owner admin actions + audit events for mapping changes.

Acceptance: a single registry table in the aggregator's store maps identity (sub, plus agent ids) to one of the four roles (owner / orchestrator / agent / read-only); mapping changes are owner-only admin actions; every change is a versioned audit event; layers cache the mapping for at most the stack token's lifetime (5 minutes).

Parent: #1253 · Epic: #1184

Activity

  1. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-a — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-a posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  2. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 13, 2026
  3. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    Released by repo-worker-code-a (outcome: free). Revalidated open, no hard-stop labels; design merged in PR #8351. Released free untouched: implementation (aggregator identity registry table + owner admin actions + audit events) is laptop worktree work and laptop transport is down tonight (laptop-agent proxy closed during CONNECT; fleet queue health fallback:true, broker exit 3; no sandbox worktree work permitted). First laptop-up lane: implement per acceptance on #9604, PR, merge, close with evidence.

  4. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 13, 2026
  5. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-b — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-b posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  6. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 14, 2026
  7. 206 remaining items

  8. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    Agent note — picked up

    Claimed task 20435 in lane any-n. Fresh GitHub verification: #9604 and parent #1253 are OPEN; no matching implementation PR exists and no hard-stop labels are present on #9604. This scheduled session has a 180-minute run window, enough for the packet’s 45-minute implementation scope. Beginning laptop-local worktree setup; no edits yet.

  9. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: in-progress — PR #11760 opened
    worker: repo-worker-code, lane any-n, task 20435

    Implementation is committed and pushed at 1b3087d944a5f879a222b88cadced458cdfda79b; PR #11760 is OPEN and currently reports CLEAN. Targeted verification passed: bun test test/identity-registry.test.ts test/access-identity.test.ts (20 passed); the earlier combined identity/access/events run passed 57 tests. bun run typecheck remains blocked because this worktree lacks the bun type definitions (TS2688, missing @types/bun). GitHub reports CodeRabbit as neutral/skipping, with no other checks listed. No merge or completion bookkeeping has been performed; sandbox backlog and sweep.log remain deferred.

  10. added a commit that references this issue on Nov 18, 2026
  11. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 agent=repo-worker-code lane=oc-code-06 state=picked-up task=20435 origin=openchamber-scheduled-lane
    Agent note — picked up

    Claimed task 20435 in lane oc-code-06 and checkpointed. Fresh verification: #9604 and parent #1253 are OPEN; #9604 has no hard-stop labels. PR #11760 is already MERGED at 3ee76147fe35c534e6707d2139f4e72b17cb2628 (2026-11-18T09:16:18Z), so this claim will close as already done; no code changes made in this occurrence.

  12. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 agent=repo-worker-code lane=oc-code-06 state=done task=20435 origin=openchamber-scheduled-lane
    Agent note — done (already merged)

    Fresh GitHub verification: #9604 remains OPEN and parent #1253 remains OPEN; PR #11760 is MERGED at 3ee76147fe35c534e6707d2139f4e72b17cb2628 (merged 2026-11-18T09:16:18Z). The implementation and targeted test results predate this claim; no edits were made in this occurrence. Closing queue task 20435 as already_done. Prior verification recorded 20 targeted identity/access tests passing; bun run typecheck was blocked by missing @types/bun (TS2688).}

  13. removed their assignment
    on Nov 20, 2026
  14. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · pickup — Lane DY (sandbox fix lane, agent archer)

    Claiming #9604 for a done-check against current main. Fresh state: PR #11760 (identity role registry) merged 2026-11-18 at 3ee76147fe, queue task 20435 closed as already_done, but the issue itself was never closed. This pass: run the identity-registry + access-identity tests first-hand on current main, audit each acceptance clause (registry mapping sub + agent ids → four roles; owner-only admin actions; versioned audit event per change; cache capped at 5 min), and close with evidence if all pass — or land the missing slice if one doesn't.

  15. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done-check — Lane DY (sandbox fix lane, agent archer)

    Verdict: #9604's acceptance is fully satisfied on current main. Closing as completed.

    The implementation landed in PR #11760 (merged 2026-11-18, merge 3ee76147fe35c534e6707d2139f4e72b17cb2628) and its queue task closed as already_done, but the issue itself was never closed. This pass re-verified everything first-hand on current main (bf322f9a4e4, laptop worktree):

    Tests: bun test test/identity-registry.test.ts test/access-identity.test.ts → 20 pass / 0 fail (362 expect() calls), run today on current main.

    Clause-by-clause audit against the issue acceptance:

    • Single registry table in the aggregator's store mapping identity (sub, plus agent ids) → one of the four roles: IdentityRegistryStore in src/identity-registry.ts — durable store file (config identityRegistryFile), roles exactly owner / orchestrator / agent / read-only, validateIdentityMapping accepts plain subs and agent:<id> identities; unmapped identity resolves to read-only (default deny). Covered by test "validates roles and supports sub and agent identities".
    • Mapping changes are owner-only admin actions: /api/admin/identity-registry (GET/POST/DELETE) in src/server.ts requires a verified Access owner (enforceAccessAuthor + kind === "drew", 403 otherwise); request-body identity/role claims never authorize. The enforcer is unit-tested, including a verified non-owner receiving 403.
    • Every change is a versioned audit event: the store bumps a monotonic revision on every set/remove; the route records an identity-mapping-changed audit event carrying that revision for both POST and DELETE. Covered by tests "persists upsert and removal with monotonic registry revisions" and "records mapping changes in the versioned audit stream".
    • Layers cache the mapping for at most the stack token's lifetime (5 minutes): IDENTITY_MAPPING_CACHE_TTL_MS = 5 * 60 * 1000; the store constructor throws if a TTL above 5 minutes is configured, and reads refresh after expiry. Covered by test "caps cache TTL at five minutes and refreshes expired mappings".

    Noted, not a gap: no HTTP-harness test boots server.ts in this project (no test imports it) — the project's testing pattern is unit-level for the enforcer and store, and both are covered. The merge-time note that bun run typecheck was blocked by missing @types/bun in that worktree stands as an environment note; it is not part of this issue's acceptance.

    Remaining #1253 splits are tracked separately: #9605 (split 3, stack-token minting) and #9608 (split 6, break-glass) stay open.

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

    effort/mMedium: expected under 1 day of workpriority/normalOrdinary priority (the default)task/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