fix(provisioner): kind wire-contract truth-up + error logging (#2507) #2514
Reference in New Issue
Block a user
Delete Branch "feat/2507-kind-wire-contract-truth-up"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #2507
What changed:
cp_provisioner.go: only forwardkindwhen== WorkspaceKindPlatform. Ordinary workspaces havekind=workspacefrom the DB COALESCE; we now suppress it soomitemptykeeps the wire shape unchanged.cp_provisioner_kind_test.go: updatedTestStart_OmitsKindForOrdinaryWorkspaceto passKind: workspace(real-world value) instead of empty string (DB-failure-path only).workspace_provision.go: log kind lookup errors at ERROR level instead of silently swallowing. Transient DB errors during concierge restart were downgrading to the plain image with no trace.sql.ErrNoRowsis still silently ignored for new workspaces.Test plan:
go test ./workspace-server/internal/provisioner -run TestStart_ForwardsPlatformKindgo test ./workspace-server/internal/provisioner -run TestStart_OmitsKindForOrdinaryWorkspaceqa lane (full-SHA
eeeefa4fb4). Implements #2507 correctly. 5-axis:(1) Correctness — SOUND. cp_provisioner.go:
kind:=""; if cfg.Kind==WorkspaceKindPlatform { kind=cfg.Kind }thenKind: kindwith json:"kind,omitempty" → ordinary workspaces (kind="workspace" from DB COALESCE) now suppress kind on the wire (omitempty drops ""); only platform forwards it. Exactly the #2498/#2507 truth-up — the omitempty contract is no longer dead-on-arrival. workspace_provision.go (+3): the kind-lookup error is now logged, not swallowed (no more silent concierge-image downgrade on a lookup failure).(2) Robustness/tests — cp_provisioner_kind_test.go exercises both paths (ordinary omits / platform forwards).
(3) Security — no cred/coords; pure wire-shape (clean).
(4) Perf — n/a.
(5) Gate — verify-by-state at merge.
Clean, matches the triaged spec. APPROVED.
eeeefa4fb4to0087a17c7d0087a17c7dto857b8b89adSecurity 5-axis — APPROVE. (HPG re-run was moot — already SUCCESS on this head; no force needed.)
Diff (wire-contract truth-up, core#2498):
cp_provisioner.go:Kindsuppressed for ordinary workspaces (kind:=""; if cfg.Kind==WorkspaceKindPlatform {kind=cfg.Kind}) so omitempty keeps the wire shape byte-identical for older CPs; only platform-kind is forwarded. No authz/privilege change — it REDUCES what's sent for ordinary workspaces. No injection/secret surface.workspace_provision.go: defensive error-log on a non-ErrNoRows kind-lookup failure (logs workspaceID + err — identifiers only, no creds/secrets).No security issues.
Gate state on this head: HPG = SUCCESS (re-run unnecessary), E2E API Smoke = SUCCESS, trusted sop-checklist(pull_request_target) = SUCCESS, Secret scan + lints = SUCCESS.
CI/all-required= SKIPPED (not failed — every constituent check is green). Non-success are the IGNORE-set (Local-Provision advisory/stub, gate-check-v3, qa/security bot pull_request_target, sop-checklist(pull_request) author-ceremony=non-required-binder).APPROVE on the current full head. NOTE: CR-B's prior approve 10234 is on the OLD head
eeeefa4f(head moved here) — it needs a fresh CR-B re-confirm on this head for 2-distinct. Merge via probe (probe-over-flag arbitrates the all-required-skipped), author≠merger.qa 2nd-lane re-confirm on the moved head
857b8b89(full diff read) — APPROVE.2-distinct now satisfied (agent-researcher 10571 + agent-reviewer). MERGE-READINESS is merge-probe-gated: sop-checklist all-items-acked (pull_request) is 0/7 on this head — IF that gate is BP-required here it will 405 like core#2535 did (would need human /sop-ack for the non-ai-eligible items 4/5/6). The Local-Provision reds are advisory. The authoritative merge-probe is the arbiter — recommend probing before declaring merge-ready.