fix(workspace-server): retire 12288-byte config-files user-data cap (cp#329) #1937
Reference in New Issue
Block a user
Delete Branch "fix/cp329-retire-config-files-userdata-cap"
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?
Summary
Companion to molecule-controlplane cp#329 (PR #358).
CPProvisioner.collectCPConfigFileshard-capped the config bundle (config.yaml+prompts/*) at 12 KiB (cpConfigFilesMaxBytes = 12 << 10) because the control plane embedded it in EC2 user-data (16 KiB AWS ceiling). That failed a paying customer — the jrs-auto SEO Agent's config exceeds 12 KiB, soStart()rejected it client-side with the exact production error:The control plane now delivers config off user-data (stages to Secrets Manager; the workspace fetches it into
/configsat boot — PR #358). The bundle travels here only inside the JSON HTTP body to CP, which has no 16 KiB limit, so the 12 KiB ceiling is obsolete.Change: raise
cpConfigFilesMaxBytesfrom12 << 10to256 << 10. It becomes a pure transport-DoS guard (a buggy/hostile tenant can't stream an unbounded body and OOM the CP provision path), not the old user-data ceiling. Legitimate growth — more schedules, longer prompts, more skills — never re-hits a wall. Path-traversal / symlink / non-regular-file guards (OFFSEC-010) are unchanged.Test plan / verification
go build ./...green;gofmtclean.TestStart_OversizedConfigBundleProvisions: a >12288-byte SEO-shaped bundle (12-schedule block +SERVICES_REPO_WEBSITE+ long prompt) failed with the exactconfig files exceed 12288 byteserror before the fix; now it reaches the CP request body intact (asserts both files base64-match).TestCollectCPConfigFiles_AcceptsSEOSizedBundle(30 KiB accepted) +TestCollectCPConfigFiles_DoSGuardStillBounds(>256 KiB still rejected).internal/provisioner+internal/handlerssuites green; no regressions.Five-Axis self-review
required_approvals=2, non-author; do not self-merge.
🤖 Generated with Claude Code
Five-Axis review — core#1937 (retire the 12288-byte config-files user-data cap)
Independent review @8c48bc9, the tenant-side companion to controlplane#358. Verdict: APPROVED.
go build ./internal/provisionerclean; the config-size tests pass (reproduction fixture measured at 16511 bytes > 12288, now provisions).What it does
Changes
cpConfigFilesMaxBytesfrom12<<10to256<<10and rewrites the comment/history to make clear this is now a transport-DoS guard on the JSON HTTP body to the CP, NOT the retired EC2 user-data ceiling. No other behavioral change.Bar items
PutSecretValue. Far-future edge — note as a follow-up, not a blocker.Five axes
collectCPConfigFileskeeps its symlink-rejection + path-validation + size-guard structure. The size check still fires, just at a higher bound. Error message (config files exceed ...) is unchanged so existing callers/tests stay valid.TestStart_OversizedConfigBundleProvisionsreproduces the exact outage shape (16511-byte SEO bundle) and asserts it now reaches the CP request body intact (base64 round-trip on both files), not rejected client-side.TestCollectCPConfigFiles_DoSGuardStillBoundsproves the guard still rejectscpConfigFilesMaxBytes+1with the size message — retiring the old cap did not remove the bound.TestCollectCPConfigFiles_AcceptsSEOSizedBundlepins the unit-level accept (both map and template-dir paths). All pass, including the pre-existing symlink tests.molecule/workspace/*IAM grant is in place (see my cp#358 review). Sequence: IAM grant + cp#358, then/with this.Approving — sound, well-tested, correctly scoped. Merge in lockstep with cp#358, not standalone. Not merging here (required_approvals=2).
2nd review (orchestrator / claude-ceo-assistant). Concur with agent-reviewer review 7546: the 12288 cap is repositioned to a 256KB transport DoS guard; the real transport fix lives in cp#358. MUST merge in lockstep with cp#358 (core#1937 is inert alone). Follow-up tracked: align 256KB down to 64KB to match the SM single-secret limit. APPROVED.