fix(platformctl): whitelist smoke subprocess environment #656
No reviewers
Labels
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/platform!656
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "codex/210-smoke-env-whitelist"
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?
Canary status: missing — fire canary 3+3 manually before merge
Summary
Stops
platformctl healthsmoke checks from passing the full Codex/runner process environment intotests/smoke.sh.Closes #210
Canary Context Pack
Product story
Smoke checks need enough environment to reach the expected Tailnet hosts, but they should not inherit unrelated provider tokens or agent credentials.
What changed
_smoke_env()now builds an explicit allowlist:PATH,HOME,USER,PLATFORMCTL_SMOKE_SSH_USER,PLATFORMCTL_SMOKE_REMOTE_MODE, and required host env vars.PLATFORMCTL_SMOKE_REMOTE_MODE=skipbehavior is preserved.Why it changed
Issue #210 requires restricting smoke subprocess environment inheritance so arbitrary secret-like environment variables are not passed to
tests/smoke.sh.Files touched
control-plane/platformctl/health.pycontrol-plane/platformctl/tests/test_health_phase3.pyRelevant context
run_smokehealth command tests.Runtime evidence
No production/runtime mutation. Local unit tests and module validation only.
Known constraints
This preserves the current required host/env validation and does not change
tests/smoke.shbehavior beyond env input narrowing.Explicit out-of-scope
Requested decision
Approve if smoke subprocesses now receive only the intended environment fields.
Merge blockers
Spec sources read
https://git.pdurlej.com/pdurlej/platform/issues/210— issue scope and acceptance criteria.control-plane/platformctl/health.py—run_smokeand_smoke_envimplementation.control-plane/platformctl/tests/test_health_phase3.py— existing health/smoke tests.tests/smoke.sh— smoke env var usage.Validation
UV_CACHE_DIR=/private/tmp/codex-uv-cache uv run pytest platformctl/tests/test_health_phase3.py -k 'smoke_env or run_smoke'— 5 passed.UV_CACHE_DIR=/private/tmp/codex-uv-cache uv run pytest platformctl/tests/test_health_phase3.py platformctl/tests/test_pr_sanity.py— 49 passed.PYTHONPATH=control-plane UV_CACHE_DIR=/private/tmp/codex-uv-cache uv run --project control-plane python -m platformctl.cli validate all --json— exitCode 0.Patchwarden PR sanity
advisory_findings656cd8f71fefd11f559a50c48c47e45262efea33251presentDeterministic findings
No deterministic findings.
Model reviewers
global-glm/glm-5.1:cloudStatus:
okVerdict:
OKmediumSmoke subprocess may need env vars not in allowlistcontrol-plane/platformctl/health.py lines 35-126: _SMOKE_BASE_ENV_KEYS only includes PATH, HOME, USER plus PLATFORMCTL_SMOKE_* and PLATFORMCTL_*_SSH_HOST vars. PR states 'No live smoke execution' tested and canary status is 'missing'global-deepseek/deepseek-v4-pro:cloudStatus:
okVerdict:
NOT_OKhighSSH agent socket not passed to smoke subprocess may break authenticationIn control-plane/platformctl/health.py, _smoke_env() builds an allowlist containing only PATH, HOME, USER, PLATFORMCTL_SMOKE_SSH_USER, PLATFORMCTL_SMOKE_REMOTE_MODE, and the two required SSH host vars. The diff shows no inclusion of SSH_AUTmediumMissing canary evidence before mergePR description states 'Canary status: missing — fire canary 3+3 manually before merge'. The change modifies the environment passed to a subprocess that performs health checks, which could cause runtime failures not caught by unit tests. MerlowPATH and HOME may be absent in restricted environmentIn control-plane/platformctl/health.py, the new _smoke_env() uses a conditional dict comprehension: {key: value for key in _SMOKE_BASE_ENV_KEYS if (value := os.environ.get(key))}. If PATH or HOME are not set in the parent environment, theyredteam/kimi-k2.6:clouderror-Policy notes
PLATFORMCTL_PR_SANITY_REDTEAM_MODELis configured.