feat(whoami): show the full resolution ladder - every configured scope's identity with the winner marked, not just the collapsed result #201
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#201
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?
Motivation
auth whoamicollapses the ADR 0025 resolution chain to a single winner plus aSource:label. When the rungs disagree - the #197 split-brain repo, where repo config saidclaude @ gitea.examplewhile origin + host-keyed backend saidhexajon @ codeberg.org- the collapse hides exactly the information that would have made the bug self-diagnosing. The user standing 3 scopes deep in a checkout has no way to ask "what would I be one level up, and at the user level?" short of cd-ing around and re-running whoami.Proposal
Show every rung of the ladder, winner marked, unresolvable rungs stated as such:
A healthy repo shows a boring ladder where the rungs agree; the #197 disease class shows rung 2 contradicting rung 3 on its face - no heuristic needed, the user reads the disagreement directly. This is
git config --show-origin, but for identity.Design notes
GetCredentialsWithSourcewalks exactly this chain and the source labels match 1:1. The change is to KEEP each rung's answer instead of returning only the first hit.auth login: rung 3 gained a token, rung 2 still won).madt_auth_whoamioutput, which also gives #155's dir= form a natural shape - the ladder as computed from the target dir.Related
Partially delivered by the whoami reshape landing in #200's PR (the full credential resolution chain - every configured rung with its forge URL, token source, and the winner marked - now renders on both surfaces). One deliberate gap remains, so this stays open:
The implemented output shows the four credential-resolution rungs (environment, secure backend, repo git config, global git config) from GetCredentialsWithSource. This issue's body pinned a 5-rung shape along the URL-resolution axis that also surfaces an "origin remote" rung. In the default secure-backend setup, madtea.url is not written on login (origin-derived per ADR 0025), so the forge URL's winning source is often the origin remote - which the credential rung list does not show as its own entry. Consequence: in the exact split-brain scenario this issue was meant to make self-diagnosing (repo config forge != origin host), the rung list alone does not display the origin URL as a contributing source; that contradiction is surfaced by the separate cross-check warning (from #200), not the rung list itself.
Remaining work to fully close: add the URL-resolution rungs (origin remote, and any workspace-scan step) to the rendered output so the forge-URL provenance is visible alongside the credential provenance, matching this issue's pinned example. Small, well-scoped follow-up on top of the now-landed plumbing.