From 63e6f1d9ae52b77dfd514ce278576c28bfdc5b63 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Mon, 9 Nov 2026 22:34:46 +0800 Subject: [PATCH 1/2] feat(desk): serve credentials from the maintenance record 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. --- tests/console_desk_mock_validation.mjs | 17 ++-- tests/desk_credentials_validation.mjs | 96 +++++++++++++++++++ .../application/desk/credentials.js | 70 ++++++++++++++ .../frontend/src/desk/api/endpoints.ts | 2 +- web/strategy-switch-console/package.json | 2 +- web/strategy-switch-console/v2_asset_map.js | 42 ++++---- web/strategy-switch-console/worker.js | 4 + 7 files changed, 204 insertions(+), 29 deletions(-) create mode 100644 tests/desk_credentials_validation.mjs create mode 100644 web/strategy-switch-console/application/desk/credentials.js diff --git a/tests/console_desk_mock_validation.mjs b/tests/console_desk_mock_validation.mjs index 2d64fccd..93a59919 100644 --- a/tests/console_desk_mock_validation.mjs +++ b/tests/console_desk_mock_validation.mjs @@ -185,14 +185,17 @@ assert.equal(resolveMockScenario("?mock=0", "ok"), null); assert.equal(resolveMockScenario("?page=overview", "fail"), "fail"); assert.equal(resolveMockScenario("?mock=\n \n \n \n
\n \n \n