Repository navigation
feat(desk): serve /api/desk/credentials from the credential maintenance record - #1099
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Pigbibi
force-pushed
the
feat/desk-credentials-live
branch
from
November 9, 2026 14:41
ff79637 to
a821ba0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a821ba0912
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The desk credentials page read a fixture while the console already held the real expiry record. Project that record into qsl.desk.credentials.v1 instead of inventing a new store, so the page stops showing synthetic phases. The projection is read-only and adds no source: it calls the existing credential_maintenance_read command and maps one record. Verified metadata is the only honest source label, so `source` stays operator_provided. Phases follow the desk vocabulary, not the maintenance one: the contract has no 14-day bucket and the UI already folds 14 into 30 (normalizeCredentialPhase), so the backend applies the same rule. Anything outside both vocabularies is reported as unknown rather than coerced into a neighbouring bucket, and a missing expiry is unknown/never_read rather than "does not expire". Flipping credentials to live is the first desk endpoint whose backend has landed; session stays the other live source.
Review finding: finalizeCredentialMaintenance() persists last_rotated_at in the same row, but the desk projection always returned null, so a surface that renders "Never rotated" would have claimed no rotation had ever happened. Read the column in the maintenance projection and forward it, keeping null only when no timestamp is recorded.
Pigbibi
force-pushed
the
feat/desk-credentials-live
branch
from
November 9, 2026 15:28
6b87bd8 to
183c06b
Compare
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI assistance
Claude (WorkBuddy agent) wrote the change, ran the local checks and prepared this description. No part of it was generated without a human owner reviewing the diff.
What changed
/api/desk/credentialsreturned 404, so the Meridian desk's credentials surface renderedapi/fixtures/credentials.ts— three synthetic accounts with invented phases. The console already holds the real record (credential_maintenance_metadata, served bycredentialMaintenanceCommand), so this projects it into the desk contract instead of adding a store.web/strategy-switch-console/application/desk/credentials.js(new):credentialPhase,credentialExpiry,credentialItems,deskCredentialsResponse. Read-only, one record, no broker I/O.worker.js: dispatchGET /api/desk/credentialsthroughdeskAuth, before the readback branch.frontend/src/desk/api/endpoints.ts:credentials: "mock"→"live".v2_asset_map.js: regenerated bynpm run sync:v2-assetsafter the source flip.tests/desk_credentials_validation.mjs(new): vocabulary, expiry, failure and method cases, each payload validated againstschemas/desk/credentials.json.tests/console_desk_mock_validation.mjs: the source map assertion now reads session + credentials live, and the forced-scenario block asserts zero network calls instead of a fixed call count.package.json: the new suite joinstest:operations.Deliberate choices:
credentialMaintenance.jsbuckets 14 days, butschemas/desk/common.jsonhas no 14 and the UI already folds it (frontend/src/desk/credentials/model.ts,normalizeCredentialPhase:"14" → "30"). I first extended the schema, then reverted it once the type check showed that existing rule: the backend mirrors the UI rule instead of changing the contract. A phase outside both vocabularies isunknown, never a neighbouring bucket.unknown/never_read, not{status: "none"}. No expiry on file is not proof the credential never expires.sourcestaysoperator_provided. The module says the expiry is operator-supplied and does not attest broker validity; the projection does not upgrade it.read_failed; the endpoint never returns an empty healthy list.How verified
Local, from a fresh clone of
mainatc2cf60b0:Not verified, and the review should weigh it: I could not sign in to the live console.
readSessionis an HMAC cookie signed with a Worker secret I do not hold, so the desk pages cannot be observed end-to-end from here. Everything above is contract- and unit-level; the rendered strip still needs one signed-in look after deploy.Why
The desk is a staged build: ten of eleven endpoints still read fixtures (
DESK_SOURCES), and the home page therefore shows numbers that do not exist. This is the first endpoint whose backend already existed, so it is the cheapest place to prove the pattern: project a real record, keep the guard satisfied, leave everything unprovable visibly unknown.Risk
R1 — read-only, no new store, no auth change, no write path. Affected:
web/strategy-switch-console/**(worker route + asset map) and two test files. Compatibilities to note:deskAuthstill requires an allowed session anddeskResponsekeepsCache-Control: no-store.