feat(autonomy): add deterministic cascade router #689
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!689
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "codex/687-cascade-router"
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
Adds the first implementation slice for #687: a pure, deterministic autonomy cascade router in
platformctl.autonomy.This PR implements only the safety-critical routing order:
The key invariant is tested: hard-stop actions never reach the classifier, even when they also look allowlisted or sandbox-eligible.
Canary Context Pack
Product story
The platform needs a low-friction autonomy gate that reduces operator interruptions without weakening irreversible safety boundaries. The router makes the hard rule structural: classifier logic is reached only after deterministic hard-stops have already been removed from the path.
What changed
platformctl.autonomywithAutonomyAction,AutonomyPolicy,AutonomyTier,AutonomyRoute, androute_action().allowlisted_capabilitiesinput so the future capability catalog can feed Tier 0 without hard dependency on #566 being merged.Why it changed
PR #686 landed the tiered execution gate design. #687 is the codex-ready implementation issue. This is the first PR in the four-PR train and intentionally keeps runtime, sandbox execution, model calls, and memory receipts out of scope.
Files touched
control-plane/platformctl/autonomy.pycontrol-plane/platformctl/tests/test_autonomy_router.pyRelevant context
Runtime evidence
No runtime mutation. No Forgejo write path except this PR. No Infisical, Ollama, Docker, or live apply calls.
Known constraints
The capability catalog is not a hard file dependency in this PR. The router accepts allowlisted capabilities as policy input so a later PR can wire the catalog without changing the cascade invariant.
Explicit out-of-scope
platformctl apply --sandboximplementation.Requested decision
Merge if the deterministic router and tests correctly establish the cascade safety property.
Merge blockers
Spec sources read
state/strategy/autonomy-tiered-execution-design-2026-06-02.md— source design from #673/#686.control-plane/platformctl/apply.py— existing apply hard-stop and break-glass gate shape.control-plane/platformctl/tests/test_apply_phase3.py— local pytest style and apply safety regression style.Validation
UV_CACHE_DIR=/private/tmp/codex-uv-cache uv run pytest platformctl/tests/test_autonomy_router.py— failed before Python startup due local uvsystem-configurationpanic.PYTHONPATH=. python3 -m pytest platformctl/tests/test_autonomy_router.py— 7 passed.PYTHONPATH=/private/tmp/platform-wt-687-cascade-router/control-plane python3 -m platformctl.cli validate all --json— exitCode 0.Refs #687
Patchwarden PR sanity
advisory_findings68963586b65a23073154d87dbde86589dcb02afbf77presentDeterministic findings
No deterministic findings.
Model reviewers
global-glm/glm-5.1:cloudStatus:
okVerdict:
NOT_OKhighfrom_mapping allows None/empty hard_stop sets, bypassing safety protectionsIn control-plane/platformctl/autonomy.py lines 119-125, AutonomyPolicy.from_mapping passes values through _normalized_set, which returns frozenset() for both None and empty iterables (lines 82-84). This means AutonomyPolicy.from_mapping({'hglobal-deepseek/deepseek-v4-pro:cloudokOKredteam/kimi-k2.6:clouderror-Policy notes
PLATFORMCTL_PR_SANITY_REDTEAM_MODELis configured.