Skip to content

docs(agent-identity): finish the write-order follow-ups from review - #3000

Merged
rdimitrov merged 4 commits into
mainfrom
docs/audit-write-order-followups
Nov 26, 2026
Merged

rdimitrov merged 4 commits into
mainfrom
docs/audit-write-order-followups

Conversation

@rdimitrov

@rdimitrov rdimitrov commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Finishes the points left from the last review of #2984, the broker's audit write order. All of them are in #2998.

  • The 503 repeat rule. implementation.md now keys it on the verified owner, as step (3) and "Error reasons" already do, with schedule setup and renewal counting too. Step (3) says only a successful open, schedule setup, or renewal by the same caller ends the minute early, and any other failure keeps it. Clients get one rule they can follow: after a 503 on an open that presented a token, refresh the token before retrying, because the code is the same whatever the cause. The write-order rows for session open and schedule setup point to the exception.

  • The deleted-host-session mark is now broker check 4 in step (3):

    • it is keyed on the host session and its incarnation, so a create with a new incarnation is never blocked;
    • it lasts 5 minutes, longer than any open holds its host session;
    • it is per replica and best effort;
    • it is also set when a scheduled run ends.

    It gets a failure-table row, maps to 404 session_not_found when mecak8s no longer has the session and to 503 identity_broker_unavailable when it does, as for a scheduled run whose session is kept, whether or not the open presented a token (no token is spent), and the failure matrix, "Error reasons", "Session end" and implementation.md's checks say so.

  • Outcomes table. ID-JAG issuance's denied covers AS-1's refusal only: a broker check that refuses a call is recorded as a denied decision, and no ID-JAG is requested. The Decision row keeps error for a failed evaluation; a refusal that supersedes an allowing decision takes its outcome from the supersede rule.

  • A converted open whose broker session closes meanwhile no longer fails as for a refused token (401 bearer_rejected). It answers 503 identity_broker_unavailable while mecak8s still has the session and 404 session_not_found once it does not. A create, fork, or clear, whose session is not saved yet, keeps 401. Client impact: a client that refreshed and retried on the 401 now gets a 503 instead, and follows the 503 rule above (refresh the token it presented, then retry); after a delete it gets 404 and stops. feat(identitybroker): record who acted, for whom, and what was decided #2985, now merged, already answers this way.

#2985, now merged, implements the matching code points (#2999), including keying the mark on incarnation and answering 404 only when the session is gone.

Checks

  • task docs passes.

Closes #2998

🤖 Generated with Claude Code

- The 503 repeat rule keys on the verified owner everywhere, says what
  keeps and ends the minute, and gives clients one rule: after a 503 on
  an open that presented a token, refresh it before retrying. The
  write-order rows for session open and schedule setup point to it.
- The deleted-host-session mark becomes broker check 4: keyed on host
  session and incarnation, 5 minutes, per replica and best effort, also
  set when a scheduled run ends. It has a failure row, maps to 404, and
  the failure matrix and error reasons say so.
- The ID-JAG outcome row drops broker-check denials, which are recorded
  as decisions, and the Decision row leaves the superseding refusal's
  error to the supersede rule.

Closes #2998

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rdimitrov and others added 2 commits November 26, 2026 14:44
An open refused with session_closed gets 404 when mecak8s no longer has the
session and 503 otherwise, as for a scheduled run whose session is kept for
its results.

Refs #2998

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An open whose broker session closes after it converted the token is refused
with session_closed, which mecak8s answers 503 while it still has the session
and 404 once it is gone, as #2985 does. A create, fork, or clear, whose
session is not saved yet, still fails as for a refused token.

Refs #2998

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@ChrisJBurns ChrisJBurns left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving: this brings the design back in line with #2985, which is now merged, so main currently has code answering 503/404 where the design still says 401. Three small text fixes, before or straight after merge; I may be wrong on any of them. Line references are at bf4b07b.

  1. The description doesn't mention the 401 → 503/404 change. A converted open whose broker session closes mid-open used to fail "as for a refused token" (401 bearer_rejected); it now answers 503 identity_broker_unavailable when mecak8s still has the session and 404 session_not_found when it doesn't, with create, fork, and clear keeping 401. That is client-visible, and only the commit message says so. Could the body state it, with its client impact?
  2. The create/fork/clear exception appears in one place only. credentials-and-lifecycle.md:258 keeps 401 for a create, fork, or clear whose session isn't saved yet, but :328 and :961 say any session_closed open gets 404 or 503 "whether or not it presented a token". The failure-matrix row at :928 also keys on "if the session was deleted", where the others say "no longer has the session". Could all three carry the exception and the same condition?
  3. Broker check 4's retry column. The row at :319 says "Retry: No", while :328 and :961 answer 503 "which the client can retry". For a session that is kept (a scheduled run that ended), each retry within the 5 minutes gets 503 again. Maybe "No; a 503 here clears once the mark lapses", or split by 404/503?

The remaining design/code differences and the ticket follow-ups are in #3001 so they don't hold this up.

…where

The client mapping, the failure matrix, and error reasons all keep 401 for a
create, fork, or clear whose session is not saved yet, and key 404 on
mecak8s no longer having the session. Broker check 4's retry column splits
the 404 from the 503, which repeats until the mark lapses.

Refs #2998

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdimitrov
rdimitrov merged commit 9849e18 into main Nov 26, 2026
37 checks passed
@rdimitrov
rdimitrov deleted the docs/audit-write-order-followups branch November 26, 2026 15:27
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.

Broker audit write order: follow-ups from the design review

2 participants