domain: authorization-code docs name one concept three ways (claim/redeem/consume) #79
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rosa/vernier#79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during the standards review of PR #77 (atomic authorization-code consumption, issues #49/#61).
Location: authorization-code doc comments and test names across the domain port, service, and conformance suite
Severity: Code health — ubiquitous-language drift
Problem
The authorization-code flow now names one concept three ways:
redeem_authorization_code), covering the whole exchange (binding checks + consumption + grant).consume_authorization_code) and ADR-0008's word for the single-use removal."Redeem" (the whole exchange) and "consume" (the removal step) are arguably two distinct concepts and both have written anchors; "claim" is a third, unanchored synonym for the same step "consume" names.
Suggested fix
A small
/domain-modelingpass:Related: the reviews of PR #76 noted the same kind of glossary gap for "mint"/"displace" in the password-reset confirmation flow — worth resolving in the same pass if convenient, but this issue is scoped to the authorization-code terms.
No behavior changes — documentation, naming, and glossary only. Should land after PR #77 merges, since it edits that PR's doc comments.
Agent Brief
Category: enhancement
Summary: Retire the unanchored "claim" vocabulary in the authorization-code flow in favour of the canonical redeem/consume distinction, and state that distinction in the glossary
Current behavior:
The authorization-code flow names one concept three ways. The maintainer has decided the canonical vocabulary:
redeem_authorization_code) and the glossary's existing usage.consume_authorization_code) and ADR-0008's word ("consumed on first successful redemption").consume_claims_the_code_exactly_once,consume_of_an_unknown_code_claims_nothing).The CONTEXT.md glossary's Authorization Code entry uses both canonical terms ("The Client redeems it once … and it is consumed on first use") but never states the redeem/consume distinction explicitly, and its Avoid list does not mention "claim".
Desired behavior:
"claim" no longer appears as authorization-code vocabulary anywhere in the workspace — doc comments, code comments, prose, or test names — replaced by "consume" (when naming the atomic removal) or "redeem"/"redemption" (when naming the whole exchange), whichever the sentence actually means. The glossary's Authorization Code entry defines both terms explicitly: redeem is the whole exchange, consume is the atomic single-use removal a successful redemption performs, and "claim" is listed under Avoid.
Key interfaces:
docs/agents/domain.md.AppRepositoryport's consume method doc, the domain service's redemption-path comments, and the Postgres adapter's consume comment — reword "claim" out; the winning/losing-a-race framing can stay, expressed in consume terms (e.g. "the first consume wins; concurrent redemptions find nothing").both_adapters!wrapper names — rename to consume/redeem vocabulary (e.g.consume_claims_the_code_exactly_once→ a name saying consume removes the code exactly once). Renaming these tests is expected and in scope; behaviour bodies and assertions are not.Acceptance criteria:
cimise task passes.Out of scope:
redeem_authorization_code,consume_authorization_codeare already correct).