RFC#2843 #43: backfill workspaces.template for pre-#3010 custom-template tenants (data-only; code flaw closed) #3021

Open
opened 2026-06-17 20:46:50 +00:00 by core-devops · 0 comments
Member

RFC#2843 #43 — workspaces.template backfill for pre-existing tenants

Status: CODE design flaw CLOSED; residual is a one-time DATA backfill

The re-stub trap is no longer a broken stub. Two already-merged fixes mean an empty workspaces.template no longer produces the 218-byte stub:

  1. #3010 / create-persist (workspace.go UPDATE workspaces SET template): NEW workspaces persist their template name, so restart restores it. New tenants are fully correct.
  2. Template-name normalization (runtime_registry.go strips -defaulttemplateRepoByName["claude-code"] exists): on SaaS, templateIdentityForTemplateOrRuntime("", "claude-code") falls back to the claude-code-default identity and the asset-fetcher delivers a coherent default config — NOT a stub. (Verified: runtime_registry_test.go asserts the claude-code key resolves.)

Residual (this issue). A tenant created BEFORE #3010 has template=''. On its next per-workspace restart it provisions with the runtime-default config instead of its ORIGINAL custom template — i.e. a custom-template tenant (e.g. seo-agent, platform-agent) reverts to the generic runtime identity. This is an identity regression, not a broken box, and only affects tenants whose intended template ≠ their runtime-default.

Affected set is small + known (the custom-template tenants: JRS SEO + molecules SEO = seo-agent; concierge = platform-agent; any other non-default-template tenant). Generic claude-code tenants are unaffected (default IS their template).

Fix = one-time data backfill (needs source-of-truth decision)

Set workspaces.template for each pre-#3010 custom-template row to its correct template name. Candidate authoritative sources:

  • (a) CP / org bundle — the CP holds each org's template in its create/org records; a CP-side job (or operator) pushes the name to each tenant DB.
  • (b) Live config volume — the currently-running instance's /configs/config.yaml still reflects the original template; read it before the next restart wipes it.

Source-of-truth choice + writing to prod tenant DBs is a CTO-gated call (per ops rules). Until backfilled, the runtime-default fallback keeps every box WORKING (degraded identity, not broken).

No code change required for closure

The design is correct going forward. This issue tracks the operational backfill only.

## RFC#2843 #43 — workspaces.template backfill for pre-existing tenants ### Status: CODE design flaw CLOSED; residual is a one-time DATA backfill **The re-stub trap is no longer a broken stub.** Two already-merged fixes mean an empty `workspaces.template` no longer produces the 218-byte stub: 1. **#3010 / create-persist** (`workspace.go` `UPDATE workspaces SET template`): NEW workspaces persist their template name, so restart restores it. New tenants are fully correct. 2. **Template-name normalization** (`runtime_registry.go` strips `-default` → `templateRepoByName["claude-code"]` exists): on SaaS, `templateIdentityForTemplateOrRuntime("", "claude-code")` falls back to the **claude-code-default** identity and the asset-fetcher delivers a coherent default config — NOT a stub. (Verified: `runtime_registry_test.go` asserts the `claude-code` key resolves.) **Residual (this issue).** A tenant created BEFORE #3010 has `template=''`. On its next per-workspace restart it provisions with the runtime-default config instead of its ORIGINAL custom template — i.e. a **custom-template tenant (e.g. `seo-agent`, `platform-agent`) reverts to the generic runtime identity**. This is an identity regression, not a broken box, and only affects tenants whose intended template ≠ their runtime-default. Affected set is small + known (the custom-template tenants: JRS SEO + molecules SEO = `seo-agent`; concierge = `platform-agent`; any other non-default-template tenant). Generic claude-code tenants are unaffected (default IS their template). ### Fix = one-time data backfill (needs source-of-truth decision) Set `workspaces.template` for each pre-#3010 custom-template row to its correct template name. Candidate authoritative sources: - **(a) CP / org bundle** — the CP holds each org's template in its create/org records; a CP-side job (or operator) pushes the name to each tenant DB. - **(b) Live config volume** — the currently-running instance's `/configs/config.yaml` still reflects the original template; read it before the next restart wipes it. Source-of-truth choice + writing to prod tenant DBs is a CTO-gated call (per ops rules). Until backfilled, the runtime-default fallback keeps every box WORKING (degraded identity, not broken). ### No code change required for closure The design is correct going forward. This issue tracks the operational backfill only.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#3021