Context
The repo already has OpenSpec scaffolding (openspec/, .agent/workflows/openspec-*.md, two in-flight proposals) and Spec Kitty (.kittify/, one pilot mission for the org-gated signup work). What's missing is any archived spec under openspec/specs/ — nothing has ever been folded into the canonical spec set yet.
While reading the codebase end-to-end, nine runtime invariants stand out as load-bearing but unspecified anywhere reviewable:
- Sysbox-runc runtime (no
--privileged, AppArmor/seccomp unconfined)
coder user UID 1000 + docker GID 988 (parametric via var.docker_gid)
- NOPASSWD sudo posture
- In-container
dockerd started by the agent script (host socket never mounted)
- Two-volume persistence model (host bind for
/home/coder, named volume for /var/lib/docker)
- Copy-if-missing hydration from
/home/coder-files/ (because the bind mount shadows image content)
- Direct-bind single-project web routing (
ddev-router globally omitted)
- Host-aware cleanup via
null_resource.workspace_cleanup + /usr/local/bin/coder-delete-workspace-dir
- Env-sourced workspace identity (no hostname parsing)
Today these live across image/Dockerfile, user-defined-web/template.tf (+ its inlined startup_script), and prose in CLAUDE.md. A reviewer can't confirm a PR preserves them without re-reading three loosely coupled files.
Proposal
One descriptive-first OpenSpec change, add-workspace-runtime-contract, codifying the nine invariants as a single capability with ## ADDED Requirements, plus the required boot sequence and an explicit forbidden-behavior set (F-1 … F-10). The spec describes what is true today — no runtime behavior changes.
Six observed drift items are catalogued in a ## Known Drift block (informational, not enforced):
image/scripts/.ddev/global_config.yaml referenced in CLAUDE.md but missing
.ddev/commands/host/{launch,coder-routes,coder-setup} staged but never copied
coder-setup missing chmod 755
- Dual
dockerd-start models (systemd unit + manual sudo dockerd)
chmod 666 /var/run/docker.sock broader than necessary
- Single-tag image version (
VERSION) across all four templates
Each drift item becomes its own follow-up OpenSpec change after this lands.
Non-Goals
- No code changes. Nothing under
image/, */template.tf, */scripts/, or Makefile is touched.
- No CI gates added (reserved for a future proposal).
- No drift remediation in this PR.
- No
CLAUDE.md reconciliation (follows after archive).
- No
freeform template coverage (separate sibling capability later).
Draft PR
#149 (draft, ~218-line spec + supporting proposal/design/tasks + Spec Kitty mission artifacts).
openspec validate add-workspace-runtime-contract --strict is green.
The question for the maintainers
Do you want this style of governance in the repo at all?
Open to redirection on scope, format, or whether to do this at all.
Context
The repo already has OpenSpec scaffolding (
openspec/,.agent/workflows/openspec-*.md, two in-flight proposals) and Spec Kitty (.kittify/, one pilot mission for the org-gated signup work). What's missing is any archived spec underopenspec/specs/— nothing has ever been folded into the canonical spec set yet.While reading the codebase end-to-end, nine runtime invariants stand out as load-bearing but unspecified anywhere reviewable:
--privileged, AppArmor/seccomp unconfined)coderuser UID 1000 + docker GID 988 (parametric viavar.docker_gid)dockerdstarted by the agent script (host socket never mounted)/home/coder, named volume for/var/lib/docker)/home/coder-files/(because the bind mount shadows image content)ddev-routerglobally omitted)null_resource.workspace_cleanup+/usr/local/bin/coder-delete-workspace-dirToday these live across
image/Dockerfile,user-defined-web/template.tf(+ its inlinedstartup_script), and prose inCLAUDE.md. A reviewer can't confirm a PR preserves them without re-reading three loosely coupled files.Proposal
One descriptive-first OpenSpec change,
add-workspace-runtime-contract, codifying the nine invariants as a single capability with## ADDED Requirements, plus the required boot sequence and an explicit forbidden-behavior set (F-1 … F-10). The spec describes what is true today — no runtime behavior changes.Six observed drift items are catalogued in a
## Known Driftblock (informational, not enforced):image/scripts/.ddev/global_config.yamlreferenced inCLAUDE.mdbut missing.ddev/commands/host/{launch,coder-routes,coder-setup}staged but never copiedcoder-setupmissingchmod 755dockerd-start models (systemd unit + manualsudo dockerd)chmod 666 /var/run/docker.sockbroader than necessaryVERSION) across all four templatesEach drift item becomes its own follow-up OpenSpec change after this lands.
Non-Goals
image/,*/template.tf,*/scripts/, orMakefileis touched.CLAUDE.mdreconciliation (follows after archive).freeformtemplate coverage (separate sibling capability later).Draft PR
#149 (draft, ~218-line spec + supporting proposal/design/tasks + Spec Kitty mission artifacts).
openspec validate add-workspace-runtime-contract --strictis green.The question for the maintainers
Do you want this style of governance in the repo at all?
Open to redirection on scope, format, or whether to do this at all.