Repository navigation
feat(desk): serve switch targets from account options - #1101
Merged
Merged
Conversation
The Meridian strategies page read api/fixtures/switchTargets.ts: six invented accounts with known live modes, strategy labels and masked suffixes. Project the configured account options into qsl.desk.switch_targets.v1 instead. The console has no desk read for a target's live mode or deployed strategy, so both are unknown/never_read. A configured default_execution_mode or default_strategy_profile is a default, not an observation, and is never shown as the current value. Domains and the declared default execution mode come from configuration; the account suffix is masked and only emitted when a real account selector exists. Switching is not connected, so every row is switchable:false / switch_not_connected, and no stop/resume capability is claimed. Flips DESK_SOURCES.switchTargets to live; session, credentials and this endpoint are now the three live desk reads.
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. |
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. A human owner reviews and merges.
What changed
GET /api/desk/switch/targetsreturned 404, so the Meridian strategies page renderedapi/fixtures/switchTargets.ts: six invented accounts with known live modes, strategy names and masked suffixes. This projects the console's configured account options intoqsl.desk.switch_targets.v1and flipsDESK_SOURCES.switchTargetstolive.application/desk/switch_targets.js(new):switchTargetsFromConfig()reusesreadbackTargets()— the same target identity the readback routes use — anddeskSwitchTargetsResponse()gates the route withdeskAuth.worker.js: dispatchGET /api/desk/switch/targetsbefore the readback branch.frontend/src/desk/api/endpoints.ts:switchTargets: "mock"→"live".v2_asset_map.js: regenerated after the source flip.tests/desk_switch_targets_validation.mjs(new): every payload validated againstschemas/desk/switch-targets.json; covers masking, declared domains/modes, config failures, auth, method and store errors.tests/console_desk_mock_validation.mjs: source map, live fetch and forced-mock assertions updated.package.json: the new suite joinstest:operations.Deliberate honesty. The console has no desk read that observes a target's live mode or its currently deployed strategy. Both are
unknown / never_read.default_execution_modeanddefault_strategy_profileare configured defaults, not observations, so they are never presented as the current value. What is known is configuration only: target id, platform, declaredsupported_domains, declared default execution mode (only when it is in the contract vocabulary), and a masked suffix derived from a realaccount_selector. Switching is not connected in this build, so every row isswitchable: {allowed: false, reason_code: "switch_not_connected"}; no stop/resume capability is claimed without evidence.How verified
Local, on a branch from
origin/mainat9f2fc61:Not verified: I still cannot sign in to the live console (
readSessionuses an HMAC cookie signed with a Worker secret I do not hold), so the rendered strategies page needs one signed-in look after a release. The realaccount_optionspayload is also not visible here; the projection is tested against synthetic configurations that follownormalizeAccountOption(), including options without anaccount_selector.Why
The desk is a staged build:
DESK_SOURCESdefaults to fixtures until a backend route lands. #1099 proved the pattern with credentials; this is the second endpoint and the first whose data is a list of configured targets. Replacing six invented accounts with the configured list — while leaving everything unobservable visibly unknown — removes synthetic strategy names and live-mode claims from a page an operator uses to plan a switch.Risk
R1 — read-only, no new store, no auth change, no write path. One new authenticated route (
GETonly,Cache-Control: no-storeviadeskResponse); a configuration read failure is 502read_failed, never an empty healthy list. Affected:web/strategy-switch-console/**plus two test files.unknownmode/strategy instead of the fixture's confident values. That is intentional;strategyText()/modeText()already render unknown reads.switchStrategiesand the later switch steps remain mock until their backends land.