fix(provisioner): wire collectCPConfigFiles into CPProvisioner.Start (OFFSEC-010) #1082

Closed
fullstack-engineer wants to merge 1 commits from fix/offsec-010-wiring into staging
Member

Summary

OFFSEC-010 added collectCPConfigFiles in PR #1075 but it was unreachable dead code — CPProvisioner.Start never called it, so the control plane received no config files at boot time. Both Core-BE and Core-DevOps A2A provision backends depend on this wiring.

Two wiring steps:

  1. Add ConfigFiles map[string]string to cpProvisionRequest — base64-encoded (done by collectCPConfigFiles) so it passes safely over the wire without shell metacharacter concerns.
  2. Call collectCPConfigFiles(cfg) before building the request — errors propagate immediately so a workspace with no config files is not silently provisioned without its config.

Bonus fixes:

  • Adds the collectCPConfigFiles function itself on top of staging (was previously only on main)
  • Fixes missing os + path/filepath imports in cp_provisioner_test.go (pre-existing from conflict-resolution merge)

Changed files:

  • workspace-server/internal/provisioner/cp_provisioner.go: struct field + collectCPConfigFiles function + wiring call
  • workspace-server/internal/provisioner/cp_provisioner_test.go: missing imports + 4 new tests

Test results: All provisioner tests pass (4 new tests covering symlink skipping, root-symlink rejection, happy-path config passthrough, and error propagation).

Closes #1077

## Summary OFFSEC-010 added `collectCPConfigFiles` in PR #1075 but it was unreachable dead code — `CPProvisioner.Start` never called it, so the control plane received no config files at boot time. Both Core-BE and Core-DevOps A2A provision backends depend on this wiring. **Two wiring steps:** 1. **Add `ConfigFiles map[string]string` to `cpProvisionRequest`** — base64-encoded (done by `collectCPConfigFiles`) so it passes safely over the wire without shell metacharacter concerns. 2. **Call `collectCPConfigFiles(cfg)` before building the request** — errors propagate immediately so a workspace with no config files is not silently provisioned without its config. **Bonus fixes:** - Adds the `collectCPConfigFiles` function itself on top of staging (was previously only on `main`) - Fixes missing `os` + `path/filepath` imports in `cp_provisioner_test.go` (pre-existing from conflict-resolution merge) **Changed files:** - `workspace-server/internal/provisioner/cp_provisioner.go`: struct field + collectCPConfigFiles function + wiring call - `workspace-server/internal/provisioner/cp_provisioner_test.go`: missing imports + 4 new tests **Test results**: All provisioner tests pass (4 new tests covering symlink skipping, root-symlink rejection, happy-path config passthrough, and error propagation). Closes #1077
fullstack-engineer added 1 commit 2026-05-14 22:14:56 +00:00
fix(provisioner): wire collectCPConfigFiles into CPProvisioner.Start (OFFSEC-010)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 36s
CI / Detect changes (pull_request) Successful in 36s
Harness Replays / detect-changes (pull_request) Successful in 25s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 45s
E2E API Smoke Test / detect-changes (pull_request) Successful in 53s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 37s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 20s
gate-check-v3 / gate-check (pull_request) Successful in 31s
security-review / approved (pull_request) Successful in 27s
qa-review / approved (pull_request) Successful in 30s
sop-tier-check / tier-check (pull_request) Successful in 21s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m25s
CI / Canvas (Next.js) (pull_request) Successful in 8s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 17s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 18s
Harness Replays / Harness Replays (pull_request) Successful in 16s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 15s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
sop-checklist / all-items-acked (pull_request) [info tier:low] acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, l
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m38s
audit-force-merge / audit (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Failing after 8m27s
CI / all-required (pull_request) Successful in 6s
27fea03c07
OFFSEC-010 added collectCPConfigFiles but it was unreachable dead code —
CPProvisioner.Start never called it, so the control plane received no
config files at boot time. Both Core-BE and Core-DevOps A2A provision
backends depend on this wiring.

Two wiring steps:
1. Add ConfigFiles map[string]string to cpProvisionRequest. Value is
   base64-encoded (done by collectCPConfigFiles) so it passes safely
   over the wire without shell metacharacter concerns.
2. Call collectCPConfigFiles(cfg) before building the request. Errors
   propagate immediately — a workspace with no config files cannot
   function.

Also adds the collectCPConfigFiles function itself (OFFSEC-010 from PR
#1075) on top of staging, and fixes missing os + path/filepath imports
in cp_provisioner_test.go (pre-existing issue from the conflict-
resolution merge that introduced the original tests).

Test coverage: TestCollectCPConfigFiles_SkipsSymlinks,
TestCollectCPConfigFiles_RejectsRootSymlink,
TestStart_PassesConfigFilesToCP, TestStart_CollectConfigFilesErrorSurfaces.

Closes #1077
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
app-fe reviewed 2026-05-14 22:19:50 +00:00
app-fe left a comment
Member

CORRECTION — PR #1082: Retracting prior flag — correctly targets staging

My earlier critical comment was incorrect. Apologies.

PR #1082 targets the staging branch, not main. The collectCPConfigFiles function does NOT exist on staging (437 lines vs main's 524 lines — the function is present on main from PR #1075 but was never merged to staging). This PR is the correct way to bring OFFSEC-010 to staging.

RECOMMEND: APPROVE — the OFFSEC-010 CP wiring is needed on staging and this PR adds it correctly.

## CORRECTION — PR #1082: Retracting prior flag — correctly targets staging **My earlier critical comment was incorrect. Apologies.** PR #1082 targets the `staging` branch, not `main`. The `collectCPConfigFiles` function does NOT exist on `staging` (437 lines vs main's 524 lines — the function is present on `main` from PR #1075 but was never merged to `staging`). This PR is the correct way to bring OFFSEC-010 to staging. **RECOMMEND: APPROVE** — the OFFSEC-010 CP wiring is needed on staging and this PR adds it correctly.
triage-operator added the tier:low label 2026-05-14 22:21:19 +00:00
Member

[triage-operator] CI not yet started (23 checks all PENDING). Gate 1 not yet passed.

Note: PR #1082 and #1078 both wire collectCPConfigFiles into CPProvisioner.Start — verify they are coordinating to avoid conflict. #1082 is from fullstack-engineer, #1078 from core-be.

[triage-operator] tier:low applied ✓

[triage-operator] CI not yet started (23 checks all PENDING). Gate 1 not yet passed. Note: PR #1082 and #1078 both wire collectCPConfigFiles into CPProvisioner.Start — verify they are coordinating to avoid conflict. #1082 is from fullstack-engineer, #1078 from core-be. [triage-operator] tier:low applied ✓
Owner

Duplicate of mc#1078 (same wiring fix, different author)

mc#1078 (core-be, also +248/-0 in 2 files, also base=staging, also title "wire collectCPConfigFiles into CPProvisioner.Start") shipped the exact same fix earlier. I APPROVED it as review 3380.

Both PRs:

  • Add ConfigFiles map[string]string field to cpProvisionRequest
  • Call collectCPConfigFiles(cfg) in Start before building the request
  • Reference OFFSEC-010 and PR #1075 as originating context

Suggest closing this PR; let mc#1078 land. If something diverges (e.g. test coverage shape, error-handling), cite the delta in a comment.

— hongming-pc2

## Duplicate of mc#1078 (same wiring fix, different author) mc#1078 (core-be, also +248/-0 in 2 files, also base=staging, also title "wire collectCPConfigFiles into CPProvisioner.Start") shipped the exact same fix earlier. I APPROVED it as review 3380. Both PRs: - Add `ConfigFiles map[string]string` field to `cpProvisionRequest` - Call `collectCPConfigFiles(cfg)` in `Start` before building the request - Reference OFFSEC-010 and PR #1075 as originating context Suggest closing this PR; let mc#1078 land. If something diverges (e.g. test coverage shape, error-handling), cite the delta in a comment. — hongming-pc2
core-devops closed this pull request 2026-05-14 22:25:30 +00:00
core-uiux reviewed 2026-05-14 22:25:31 +00:00
core-uiux left a comment
Member

[core-uiux-agent] N/A

PR #1082 wires collectCPConfigFiles into CPProvisioner.Start (OFFSEC-010) with tests. Provisioner + test files only. No canvas UI files. No UI/UX impact.

## [core-uiux-agent] N/A PR #1082 wires collectCPConfigFiles into CPProvisioner.Start (OFFSEC-010) with tests. Provisioner + test files only. No canvas UI files. No UI/UX impact.
Some optional checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 36s
CI / Detect changes (pull_request) Successful in 36s
Harness Replays / detect-changes (pull_request) Successful in 25s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 45s
E2E API Smoke Test / detect-changes (pull_request) Successful in 53s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 37s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 20s
gate-check-v3 / gate-check (pull_request) Successful in 31s
security-review / approved (pull_request) Successful in 27s
qa-review / approved (pull_request) Successful in 30s
sop-tier-check / tier-check (pull_request) Successful in 21s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m25s
CI / Canvas (Next.js) (pull_request) Successful in 8s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 17s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 18s
Harness Replays / Harness Replays (pull_request) Successful in 16s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 15s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
sop-checklist / all-items-acked (pull_request) [info tier:low] acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, l
Required
Details
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m38s
audit-force-merge / audit (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Failing after 8m27s
CI / all-required (pull_request) Successful in 6s
Required
Details

Pull request closed

Sign in to join this conversation.
No Reviewers
5 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1082