fix(phase3-step9): consolidated review fast-follow (I2 + I4 + M1 + M2 + M4)#20
Merged
fix(phase3-step9): consolidated review fast-follow (I2 + I4 + M1 + M2 + M4)#20
Conversation
Adds 5th permission_gate test exercising the network_domains branch (codec_agent_runner.py:109-113), which previously had no coverage. Asserts PermissionViolation with reason='domain_not_authorized' and needed=<domain> when action.network_call=True and the domain is absent from both per-agent and global grants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PHASE3-STEP9-PLAN.md Task 10 Step 2 prescribed adding codec-agent-runner to a _MONITORED_SERVICES list, but that list does not exist — heartbeat probes are HTTP-only and codec-observer (also a PM2 daemon) is already absent from the existing services dict. AGENTS.md §3 documents the intentional deferral; this docstring closes the loop in code so future agents reading codec_heartbeat.py see the rationale without rediscovering it from the plan. No behavior change; PM2 autorestart remains the supervision contract for codec-agent-runner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…RESUMED chains with subsequent run emits
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidated fast-follow PR addressing all 5 deferred items from the Phase 3 Step 9 code review (PR #19). Merged into a single PR per user request to keep workflow simple.
What this fixes
step_budget_exhaustedmapped toblocked_on_permission(semantic mismatch — there's no permission to grant)pausedwith reason. NewPOST /api/agents/{id}/extend_budgetendpoint bumps the current checkpoint's budget viastate.jsonoverrides (plan stays immutable; tamper check intact).AGENT_RESUMEDemit had nocorrelation_id, orphaned from subsequent_run_agentchain_run_agent(agent_id, cid=None)now accepts optional cid; daemon mintsrecovery_cidonce and threads it through both the audit emit AND the new_run_agentinvocation.permission_gatehad no test fordomain_not_authorizedpathtest_permission_gate_blocks_domain_not_in_grants.check_system_health()docstring documenting that PM2autorestart: trueis the supervision contract for daemons. No behavior change.PermissionManifest.read_pathsdeclared butpermission_gateonly enforceswrite_paths(asymmetry undocumented)Actionfield + LLM prompt update — out of scope for Step 9).Tests
test_agent_runner.py: 33 → 36 tests (+1 from M1, +1 from I4, +3 from I2 minus 2 not added)test_agent_runner.py + test_agent_plan.pysuite: 67 passed, 0 new failuresFiles changed
codec_agent_runner.pytests/test_agent_runner.pyroutes/agents.py/extend_budgetendpoint +ExtendBudgetBodymodelcodec_heartbeat.pyProvenance
This PR consolidates outputs from 5 side-chat sessions that the user spawned via review-feedback chips. The user requested I wrap the work cleanly in this main session — so all 5 side-chats' output is folded here, with I2 (which paused awaiting design confirmation) implemented per side-chat #3's recommended option 2 (state.json override, plan stays immutable).
Test plan
tests/test_agent_runner.py + test_agent_plan.py→ 67 passed🤖 Generated with Claude Code