Do not let OAuth projections overwrite hand-named provider entries - #1007
Conversation
|
[warden trust review] CL-6728 — verdict: approve with one should-fix (no merge, no commits per brief). What I checked: the four projection sites against exact Genuinely fine:
Should-fix (not blocking — narrow trigger, fail-closed direction):
Gaps (not covered, do not assume closed): PR-branch tests not re-run here (tree is on main; baseline |
Critic review — no blocking findingsGuards hand-named Independent verification (worktree
|
buildProviderCatalog synthesizes a resolved row when settings is null or empty; when resolved is itself codex/<slug> that row carries the live apiKey with no profile marker and ejected the real marked entry. Derive handNamed from raw settings.providers only.
115c6ed to
cd829f7
Compare
|
Warden follow-up addressed (should-fix): |
|
Critic follow-up addressed: added the |
|
Confirmed green on cd829f7.
One file-for-later, non-blocking: a whitespace-only |
|
[warden trust review] Trust-confirm cd829f7: synthetic resolved row excluded from handNamed. handNamed now derives from raw settings.providers only, so null/empty settings + resolved codex/ keeps the marked live entry (codexProfile set, live routing intact) and the persist round-trip contains no live token. Predicate unchanged, so real hand-named/keyless rows still skip projection (no over-skip); prefix-based name check means the behavior delta is exactly the synthetic row. Evidence: bun test src/config/oauth-catalog.test.ts 25 pass / 0 fail; bun test src/config/ 67 pass / 0 fail in worktree at cd829f7. Verdict: trust green, no remaining trust defect in this fix. |
Summary
OAuth profile projections for namespaced codex/ and xai/ entries no longer overwrite, orphan-sweep, or catalog-drop a persisted settings row that carries its own credential. Such a row is the operator's explicit config, not an OAuth placeholder. Credential-less namespaced rows keep the existing placeholder behavior (overlay, orphan-drop, catalog rebuild).
Note: the Linear Implementation-plan attachment could not be fetched from this lane, so this was implemented from the dispatch brief plus code.
Verification
Fixes CL-6728