feat(apply): add sandbox apply receipt mode #694

Merged
pdurlej merged 4 commits from codex/687-apply-sandbox into main 2026-06-02 14:41:25 +02:00
Collaborator

Canary status: missing — Forgejo PR checks must run before merge.

Summary

Implements #687 slice 2: platformctl apply --sandbox as a Tier-1 sandbox receipt mode.

  • Adds a non-mutating sandbox=True path to apply_plan.
  • Adds CLI platformctl apply --sandbox.
  • Emits a platformctl.apply.sandbox.v0 receipt and status artifact.
  • Keeps live preview-slot wiring operator-gated and executes no remote commands.

Canary Context Pack

Product story

Agents need a reversible runtime lane between read-only plan and operator-gated live apply. This PR adds the auditable skeleton for that lane without weakening existing production gates.

What changed

apply --sandbox now validates the same approved plan path, constructs a sandbox receipt for a hermes-preview-slot style target, writes status evidence, and stops before transport/runtime execution.

Why it changed

#687 requires a Tier-1 runtime sandbox mechanism before classifier/receipt layers can safely route runtime-ish actions away from direct operator interruption.

Files touched

  • control-plane/platformctl/apply.py
  • control-plane/platformctl/cli.py
  • control-plane/platformctl/tests/test_apply_phase3.py
  • control-plane/platformctl/tests/test_apply_env_file.py

Relevant context

  • #687 tiered execution implementation
  • #673 / PR #686 autonomy design
  • state/strategy/autonomy-tiered-execution-design-2026-06-02.md

Runtime evidence

No runtime mutation and no remote transport calls are made by this PR. Tests assert the sandbox path does not call the transport and does not require PLATFORMCTL_PHASE=05.

Known constraints

Live preview-slot creation, healthcheck execution, discard, and deploy wiring remain operator-gated future work.

Explicit out-of-scope

No classifier model, no live sandbox runtime, no production apply, no DB migration, no issue writer, no memory-plane persistence beyond the local event/status payload.

Requested decision

Approve this as the apply-sandbox skeleton slice; continue #687 with classifier/policy compiler next.

Merge blockers

Any failed apply tests, any remote runtime execution in sandbox mode, or any weakening of existing approval/break-glass gates.

Spec sources read

  • state/strategy/autonomy-tiered-execution-design-2026-06-02.md — sandbox mechanism contract
  • control-plane/platformctl/apply.py — apply gates/status artifact path
  • control-plane/platformctl/cli.py — CLI option registration
  • control-plane/platformctl/tests/test_apply_phase3.py — apply gate tests
  • control-plane/platformctl/tests/test_apply_env_file.py — CLI apply tests

Validation

  • PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_apply_phase3.py control-plane/platformctl/tests/test_apply_env_file.py — 119 passed
  • PYTHONPATH=control-plane python3 -m platformctl.cli validate all --json — exitCode 0

Refs #687

Canary status: missing — Forgejo PR checks must run before merge. ## Summary Implements #687 slice 2: `platformctl apply --sandbox` as a Tier-1 sandbox receipt mode. - Adds a non-mutating `sandbox=True` path to `apply_plan`. - Adds CLI `platformctl apply --sandbox`. - Emits a `platformctl.apply.sandbox.v0` receipt and status artifact. - Keeps live preview-slot wiring operator-gated and executes no remote commands. ## Canary Context Pack ### Product story Agents need a reversible runtime lane between read-only plan and operator-gated live apply. This PR adds the auditable skeleton for that lane without weakening existing production gates. ### What changed `apply --sandbox` now validates the same approved plan path, constructs a sandbox receipt for a hermes-preview-slot style target, writes status evidence, and stops before transport/runtime execution. ### Why it changed #687 requires a Tier-1 runtime sandbox mechanism before classifier/receipt layers can safely route runtime-ish actions away from direct operator interruption. ### Files touched - `control-plane/platformctl/apply.py` - `control-plane/platformctl/cli.py` - `control-plane/platformctl/tests/test_apply_phase3.py` - `control-plane/platformctl/tests/test_apply_env_file.py` ### Relevant context - #687 tiered execution implementation - #673 / PR #686 autonomy design - `state/strategy/autonomy-tiered-execution-design-2026-06-02.md` ### Runtime evidence No runtime mutation and no remote transport calls are made by this PR. Tests assert the sandbox path does not call the transport and does not require `PLATFORMCTL_PHASE=05`. ### Known constraints Live preview-slot creation, healthcheck execution, discard, and deploy wiring remain operator-gated future work. ### Explicit out-of-scope No classifier model, no live sandbox runtime, no production apply, no DB migration, no issue writer, no memory-plane persistence beyond the local event/status payload. ### Requested decision Approve this as the apply-sandbox skeleton slice; continue #687 with classifier/policy compiler next. ### Merge blockers Any failed apply tests, any remote runtime execution in sandbox mode, or any weakening of existing approval/break-glass gates. ## Spec sources read - `state/strategy/autonomy-tiered-execution-design-2026-06-02.md` — sandbox mechanism contract - `control-plane/platformctl/apply.py` — apply gates/status artifact path - `control-plane/platformctl/cli.py` — CLI option registration - `control-plane/platformctl/tests/test_apply_phase3.py` — apply gate tests - `control-plane/platformctl/tests/test_apply_env_file.py` — CLI apply tests ## Validation - `PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_apply_phase3.py control-plane/platformctl/tests/test_apply_env_file.py` — 119 passed - `PYTHONPATH=control-plane python3 -m platformctl.cli validate all --json` — exitCode 0 Refs #687
feat(apply): add sandbox apply receipt mode
Some checks failed
python-ci / Python 3.12 (pull_request) Successful in 41s
python-ci / Python 3.13 (pull_request) Successful in 40s
patchwarden-client-dry-run / dry-run (pull_request) Successful in 17s
patchwarden-pr-sanity / sanity (pull_request) Failing after 4m43s
base-is-main / guard (pull_request) Successful in 1s
canary-required / collect-diff (pull_request) Successful in 4s
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 3s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 3s
platformctl plan / auto-apply scope (pull_request) Successful in 18s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 16s
python-ci / Python 3.11 (pull_request) Successful in 39s
canary-required / canary (pull_request) Successful in 12s
817b0f3cd3
Author
Collaborator

Patchwarden PR sanity

  • Status: eligible_sanity_clean
  • PR: 694
  • Commit: f81282f0cfa56e312978580cc28a1405fa8c7d5d
  • Security-sensitive label: present
  • Authority: advisory model review plus deterministic blockers only
  • 3+3 canary: still alive; this does not replace it

Deterministic findings

  • info sensitive-path-touched Sensitive path touched — control-plane/platformctl/apply.py
    • Evidence: control-plane/platformctl/apply.py
    • Next: Route through the existing 3+3/risk-tier process; model review remains advisory.

Model reviewers

global-glm / glm-5.1:cloud

  • Status: ok

  • Verdict: OK

  • low Sandbox path bypasses phase gate without explicit guard

    • Evidence: In control-plane/platformctl/apply.py, the sandbox block (line 1184+) returns before 'Gate 4: phase gate' (line ~1277). Sandbox mode skips _real_apply_enabled() check entirely.
    • Next: Consider adding an explicit comment or assertion that sandbox intentionally bypasses phase gate because it performs no runtime execution, or add a defensive check that sandbox=True implies no transport calls.

global-deepseek / deepseek-v4-pro:cloud

  • Status: ok
  • Verdict: OK
  • Findings: none

redteam / kimi-k2.6:cloud

  • Status: ok
  • Verdict: OK
  • Findings: none

Policy notes

  • GLM 5.1 + DeepSeek V4 Pro are the operator-required model mix for this bot.
  • Optional red-team model is enabled only when PLATFORMCTL_PR_SANITY_REDTEAM_MODEL is configured.
  • Auto-merge is not enabled here.
<!-- patchwarden-pr-sanity:pdurlej/platform:PR-694 --> # Patchwarden PR sanity - Status: `eligible_sanity_clean` - PR: `694` - Commit: `f81282f0cfa56e312978580cc28a1405fa8c7d5d` - Security-sensitive label: `present` - Authority: advisory model review plus deterministic blockers only - 3+3 canary: still alive; this does not replace it ## Deterministic findings - **`info` `sensitive-path-touched`** Sensitive path touched — `control-plane/platformctl/apply.py` - Evidence: `control-plane/platformctl/apply.py` - Next: Route through the existing 3+3/risk-tier process; model review remains advisory. ## Model reviewers ### `global-glm` / `glm-5.1:cloud` - Status: `ok` - Verdict: `OK` - **`low`** Sandbox path bypasses phase gate without explicit guard - Evidence: `In control-plane/platformctl/apply.py, the sandbox block (line 1184+) returns before 'Gate 4: phase gate' (line ~1277). Sandbox mode skips _real_apply_enabled() check entirely.` - Next: Consider adding an explicit comment or assertion that sandbox intentionally bypasses phase gate because it performs no runtime execution, or add a defensive check that sandbox=True implies no transport calls. ### `global-deepseek` / `deepseek-v4-pro:cloud` - Status: `ok` - Verdict: `OK` - Findings: none ### `redteam` / `kimi-k2.6:cloud` - Status: `ok` - Verdict: `OK` - Findings: none ## Policy notes - GLM 5.1 + DeepSeek V4 Pro are the operator-required model mix for this bot. - Optional red-team model is enabled only when `PLATFORMCTL_PR_SANITY_REDTEAM_MODEL` is configured. - Auto-merge is not enabled here.
chore(ci): retrigger apply sandbox checks
Some checks failed
base-is-main / guard (pull_request) Successful in 2s
canary-required / collect-diff (pull_request) Successful in 4s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 16s
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 3s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 3s
platformctl plan / auto-apply scope (pull_request) Successful in 17s
patchwarden-pr-sanity / sanity (pull_request) Failing after 1s
python-ci / Python 3.11 (pull_request) Successful in 38s
python-ci / Python 3.12 (pull_request) Failing after 1s
python-ci / Python 3.13 (pull_request) Failing after 1s
canary-required / canary (pull_request) Failing after 1s
patchwarden-client-dry-run / dry-run (pull_request) Failing after 1s
10d90fc547
chore(ci): retry apply sandbox checks
Some checks failed
canary-required / collect-diff (pull_request) Successful in 3s
platformctl plan / auto-apply scope (pull_request) Successful in 18s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 16s
python-ci / Python 3.11 (pull_request) Successful in 39s
python-ci / Python 3.12 (pull_request) Successful in 41s
python-ci / Python 3.13 (pull_request) Successful in 41s
canary-required / canary (pull_request) Successful in 12s
base-is-main / guard (pull_request) Successful in 1s
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 3s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 3s
patchwarden-client-dry-run / dry-run (pull_request) Successful in 16s
patchwarden-pr-sanity / sanity (pull_request) Has been cancelled
5886fbf107
chore(ci): retrigger apply sandbox security lane
All checks were successful
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 4s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 4s
platformctl plan / auto-apply scope (pull_request) Successful in 17s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 16s
patchwarden-client-dry-run / dry-run (pull_request) Successful in 16s
patchwarden-pr-sanity / sanity (pull_request) Successful in 3m43s
base-is-main / guard (pull_request) Successful in 1s
canary-required / collect-diff (pull_request) Successful in 4s
python-ci / Python 3.11 (pull_request) Successful in 39s
python-ci / Python 3.12 (pull_request) Successful in 41s
python-ci / Python 3.13 (pull_request) Successful in 40s
canary-required / canary (pull_request) Successful in 12s
f81282f0cf
pdurlej approved these changes 2026-06-02 14:39:05 +02:00
pdurlej left a comment

Approved after class/security-sensitive label was applied and all Forgejo checks passed. Automated Codex operator-approved lane; no runtime/destructive action in this PR.

Approved after class/security-sensitive label was applied and all Forgejo checks passed. Automated Codex operator-approved lane; no runtime/destructive action in this PR.
pdurlej approved these changes 2026-06-02 14:41:00 +02:00
pdurlej left a comment

Approved after class/security-sensitive label was applied and all Forgejo checks passed. Automated Codex operator-approved lane; no runtime/destructive action in this PR.

Approved after class/security-sensitive label was applied and all Forgejo checks passed. Automated Codex operator-approved lane; no runtime/destructive action in this PR.
Sign in to join this conversation.
No reviewers
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
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform!694
No description provided.