Repository navigation
Description
kit check prints which account a CLI is logged in as. Nothing compares it to which account this repo should use — so a tool answering as the wrong identity reads as green, and its output reads as complete when it is a filtered subset.
Same shape as #500's defect 2: kit measures a fact, records it, and never asserts it.
The asymmetry, in kit's own code
kit check's services table reports identity and stops there (src/output.ts:117-121):
✓ vercel authenticated <account>
kit context check asserts other things about the same tool — but only ids from repo-local files (src/context-lock.ts:140-149): vercel.team → orgId, vercel.project → projectId, both read from .vercel/project.json. There is no field for who is logged in.
And the pattern already exists for one tool: [context.gcloud].account is an identity, declared and asserted like git.email. vercel, github (the user, as distinct from github.org) and convex have no equivalent — ContextConfig has github?: { org, remote } and vercel?: { team, project } only.
So the mechanism is built, and identity is the one thing left out of it for every tool except gcloud.
What the gap cost
Measured in a project where the CLI was logged in as a personal account with the Developer role in the team, while the repo's git author is an Owner. Developer cannot read the production environment. The failure was not an error — it was a silent subset:
vercel env lslisted four variables and looked complete. Invisible: every Production-only variable. The ones that also existed in Preview/Development showed up, which is what made the list credible.vercel env pull --environment=previewworked;--environment=productionfailed with "Production Project Environment Variable not found" — which reads as "the variable does not exist", not "you may not see it".vercel env add … productionwas refused with "Additional permissions are required to create production environment variables" — the only message that named permissions at all, and it came last.
Two contradictory conclusions were drawn in a row about whether the production build deploys the backend. The web UI settled it. Nothing in the tool chain said you are the wrong identity for this repo. After the role was raised, the same command showed the key immediately.
kit check was green throughout, and its identity line was the one place that could have said something.
Proposed
- Let
[context]declare the expected identity per repo, not only org/project:vercel.user,github.user(distinct fromgithub.org),convex.account. Red on mismatch, exactly asgit.emailbehaves today. - Report the resolved ROLE where the API exposes it, not merely that someone is authenticated.
authenticated <account> (Developer)would have ended the investigation before it started. - Point at the per-tool profile mechanism instead of global login, where kit already drives the tool:
vercel— global-config-stores,-Q <dir>per profile, or--tokengh— built in:gh auth loginper account,gh auth switchconvex— has no profiles:~/.convex/config.jsonis global and is overwritten byconvex login; the only isolation isCONVEX_DEPLOY_KEY/CONVEX_DEPLOYMENTper repogcloud— configurations;aws—AWS_PROFILE;stripe— project profiles
- The principle: when a command's output depends on the caller's role, kit must not present it as authoritative. Either the identity is asserted, or the output is labelled possibly-partial.
(4) is the part worth arguing about, because it generalises past identity: vercel env ls under a Developer, a scanner running without a token, a registry query offline — all return a subset that looks like a whole. kit's existing answer for the third case is skip with a reason. Identity deserves the same vocabulary.
Not asked for
A permission model. kit does not need to know what Developer may do — only whether the identity in front of it is the one this repo declared.
Related
- kit check reports ✓ for tools it never verified: "latest" means "on PATH", cli-lock claims a provenance it does not own, and undeclared CLIs are invisible #500 — provenance and version recorded but not verified. Same model, different field.
🤖 Generated with Claude Code
Activity
chore(memory): the assert-or-label rule, and the gate/cache split (#506)
chore(release): 6.8.0 (#516)