feat: #1686 harden display status contract #1711

Merged
hongming merged 1 commits from feat/1686-display-status-contract into main 2026-05-23 07:25:26 +00:00
Owner

Summary

  • Hardens GET /workspaces/:id/display for display-configured workspaces before live DCV/session infrastructure exists.
  • Locks the display-configured unavailable response contract: available:false, reason:display_session_unavailable, status:not_configured, plus mode/protocol/resolution.
  • Switches display responses to an explicit DTO so future live-session fields are intentional.
  • Validates stored display config before reflecting it, without failing because of unrelated stored CPU sizing drift.

Comprehensive testing performed

  • workspace-server: go test ./internal/handlers -run 'TestWorkspaceDisplay|TestValidateWorkspaceCompute'
  • workspace-server: go test ./internal/handlers ./internal/router
  • workspace-server: go test ./...

Local-postgres E2E run

N/A: handler-level contract hardening only; no schema, migrations, or SQL behavior beyond the existing workspaces.compute read changed.

Staging-smoke verified or pending

Pending: PR CI will run the platform and staging checks. No staging deploy has been triggered from this feature branch.

Root-cause not symptom

#1686 Phase 2 needs a stable display status API before CP/DCV/sidecar work can attach live sessions. This PR locks the unavailable display-configured contract and prevents invalid stored display config from being reflected.

Five-Axis review walked

  • Correctness: Adds tests for display-configured unavailable, invalid stored display config, and unrelated CPU sizing drift.
  • Readability: Uses an explicit response DTO instead of ad hoc maps for display status responses.
  • Architecture: Keeps this as a backend contract slice; no session table, DCV URL, sidecar, or Canvas changes.
  • Security: Does not expose URL, credentials, or sidecar state; validates stored display config before returning fields.
  • Performance: Same single-row compute lookup; no new network or database round trip.

No backwards-compat shim / dead code added

No compatibility shim or dead code added. Existing non-display response remains unchanged.

Memory/saved-feedback consulted

No saved memory was needed for this slice. Used live #1686 comments, merged Track B PRs, and subagent exploration of backend/Canvas expectations.

## Summary - Hardens `GET /workspaces/:id/display` for display-configured workspaces before live DCV/session infrastructure exists. - Locks the display-configured unavailable response contract: `available:false`, `reason:display_session_unavailable`, `status:not_configured`, plus mode/protocol/resolution. - Switches display responses to an explicit DTO so future live-session fields are intentional. - Validates stored display config before reflecting it, without failing because of unrelated stored CPU sizing drift. ## Comprehensive testing performed - [x] `workspace-server: go test ./internal/handlers -run 'TestWorkspaceDisplay|TestValidateWorkspaceCompute'` - [x] `workspace-server: go test ./internal/handlers ./internal/router` - [x] `workspace-server: go test ./...` ## Local-postgres E2E run N/A: handler-level contract hardening only; no schema, migrations, or SQL behavior beyond the existing `workspaces.compute` read changed. ## Staging-smoke verified or pending Pending: PR CI will run the platform and staging checks. No staging deploy has been triggered from this feature branch. ## Root-cause not symptom #1686 Phase 2 needs a stable display status API before CP/DCV/sidecar work can attach live sessions. This PR locks the unavailable display-configured contract and prevents invalid stored display config from being reflected. ## Five-Axis review walked - Correctness: Adds tests for display-configured unavailable, invalid stored display config, and unrelated CPU sizing drift. - Readability: Uses an explicit response DTO instead of ad hoc maps for display status responses. - Architecture: Keeps this as a backend contract slice; no session table, DCV URL, sidecar, or Canvas changes. - Security: Does not expose URL, credentials, or sidecar state; validates stored display config before returning fields. - Performance: Same single-row compute lookup; no new network or database round trip. ## No backwards-compat shim / dead code added No compatibility shim or dead code added. Existing non-display response remains unchanged. ## Memory/saved-feedback consulted No saved memory was needed for this slice. Used live #1686 comments, merged Track B PRs, and subagent exploration of backend/Canvas expectations.
hongming added 1 commit 2026-05-23 06:58:19 +00:00
Harden display status contract
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Waiting to run
sop-checklist / review-refire (pull_request) Waiting to run
sop-tier-check / tier-check (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 13s
CI / Python Lint & Test (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 20s
E2E Chat / detect-changes (pull_request) Successful in 10s
E2E API Smoke Test / detect-changes (pull_request) Successful in 10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 9s
Harness Replays / detect-changes (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 16s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 6s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
gate-check-v3 / gate-check (pull_request) Successful in 9s
qa-review / approved (pull_request) Successful in 8s
security-review / approved (pull_request) Successful in 8s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m17s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 4s
CI / Canvas (Next.js) (pull_request) Successful in 6s
E2E Chat / E2E Chat (pull_request) Successful in 5s
Harness Replays / Harness Replays (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 11s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m26s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m49s
CI / Platform (Go) (pull_request) Successful in 5m10s
CI / all-required (pull_request) Successful in 12m56s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
sop-checklist / all-items-acked (pull_request) acked: 7/7
sop-checklist / na-declarations (pull_request) N/A: (none)
audit-force-merge / audit (pull_request) Successful in 17s
9344d014fb
hongming requested review from core-qa 2026-05-23 06:58:31 +00:00
hongming requested review from core-security 2026-05-23 06:58:31 +00:00
hongming added the tier:medium label 2026-05-23 06:58:31 +00:00
core-qa approved these changes 2026-05-23 07:04:14 +00:00
core-qa left a comment
Member

QA approval for #1686 display status contract hardening. Backend and Canvas subagent exploration found the narrow contract compatible; local backend tests passed. Awaiting CI queue before merge.

QA approval for #1686 display status contract hardening. Backend and Canvas subagent exploration found the narrow contract compatible; local backend tests passed. Awaiting CI queue before merge.
core-security approved these changes 2026-05-23 07:04:16 +00:00
core-security left a comment
Member

Security approval for #1686 display status contract hardening. The response uses an explicit DTO, does not expose DCV URL/credentials/sidecar state, and validates stored display config before reflection. Awaiting CI queue before merge.

Security approval for #1686 display status contract hardening. The response uses an explicit DTO, does not expose DCV URL/credentials/sidecar state, and validates stored display config before reflection. Awaiting CI queue before merge.
Member

/sop-ack comprehensive-testing verified local backend tests and PR CI
/sop-ack local-postgres-e2e N/A handler contract only, no schema or DB behavior change
/sop-ack staging-smoke PR staging checks passed
/sop-ack root-cause stable display status API needed before DCV/session infra
/sop-ack five-axis-review reviewed correctness readability architecture security performance
/sop-ack no-backwards-compat no shim or dead code
/sop-ack memory-consulted live issue/repo/subagent context sufficient

/sop-ack comprehensive-testing verified local backend tests and PR CI /sop-ack local-postgres-e2e N/A handler contract only, no schema or DB behavior change /sop-ack staging-smoke PR staging checks passed /sop-ack root-cause stable display status API needed before DCV/session infra /sop-ack five-axis-review reviewed correctness readability architecture security performance /sop-ack no-backwards-compat no shim or dead code /sop-ack memory-consulted live issue/repo/subagent context sufficient
hongming merged commit 221b93faec into main 2026-05-23 07:25:26 +00:00
hongming deleted branch feat/1686-display-status-contract 2026-05-23 07:25:26 +00:00
Sign in to join this conversation.
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1711