Skip to content

Implementation Plan: T5-P4-A3-WP1 Eliminate write_guard/skill_load_guard codex backend structural defect#4085

Merged
Trecek merged 3 commits into
developfrom
t5-p4-a3-wp1-eliminate-the-structural-defect-where-write-gua/4018
Jun 12, 2026
Merged

Implementation Plan: T5-P4-A3-WP1 Eliminate write_guard/skill_load_guard codex backend structural defect#4085
Trecek merged 3 commits into
developfrom
t5-p4-a3-wp1-eliminate-the-structural-defect-where-write-gua/4018

Conversation

@Trecek

@Trecek Trecek commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add codex backend early-exit blocks to write_guard.py and skill_load_guard.py so they exit 0 immediately when AUTOSKILLIT_AGENT_BACKEND == 'codex', preventing futile PreToolUse deny attempts for a backend whose PreToolUse does not fire for apply_patch or MCP calls. Update skill_load_guard's codex_status in HOOK_REGISTRY from "fix-required" to "works-as-is" so the hook is actually registered for Codex sessions. Update module docstrings with per-backend enforcement strength tables and guards/AGENTS.md descriptions. Add 6 tests for write_guard and 3 tests for skill_load_guard.

Closes #4018

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260611-223240-312843/.autoskillit/temp/make-plan/t5_p4_a3_wp1_codex_backend_early_exit_plan_2026-06-11_223700.md

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 1 3.6k 14.6k 899.8k 78.7k 35 62.5k 10m 8s
verify* sonnet 1 86 12.9k 488.8k 66.4k 29 45.5k 6m 48s
implement* MiniMax-M3 1 2.9M 8.0k 0 0 65 0 11m 46s
audit_impl* sonnet 1 76 8.9k 342.0k 49.5k 19 33.1k 6m 23s
prepare_pr* MiniMax-M3 1 271.2k 1.9k 0 0 15 0 1m 6s
compose_pr* MiniMax-M3 1 178.1k 1.8k 0 0 13 0 51s
review_pr* sonnet 1 118 35.7k 806.6k 86.1k 44 65.8k 7m 56s
resolve_review* sonnet 1 141 9.4k 942.3k 69.2k 44 49.3k 5m 42s
Total 3.4M 93.2k 3.5M 86.1k 256.2k 50m 43s

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 132 0.0 0.0 60.8
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 0
Total 132 26360.5 1941.1 706.4

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 3.6k 14.6k 899.8k 62.5k 10m 8s
sonnet 4 421 66.9k 2.6M 193.7k 26m 51s
MiniMax-M3 3 3.4M 11.8k 0 0 13m 43s

Trecek added 3 commits June 11, 2026 22:57
…oad_guard

Codex backend enforces writes via workspace-write sandbox + post-hoc
file_changes detection (hard enforcement), making PreToolUse deny
(soft) redundant. Add early-exit blocks before the existing gates so
the guards no longer attempt futile deny attempts for codex sessions.

write_guard: insert AUTOSKILLIT_AGENT_BACKEND==codex check after the
non-headless exit, before prefix reading.

skill_load_guard: insert AUTOSKILLIT_AGENT_BACKEND==codex check after
the agent_id exemption, before the applicable_guards gate.

Update module docstrings with bypass conditions and per-backend
enforcement strength tables. Update guards/AGENTS.md descriptions to
document the new bypass paths.
…quired to works-as-is

The skill_load_guard now early-exits on codex backend via
AUTOSKILLIT_AGENT_BACKEND env var. Update its codex_status in
HOOK_REGISTRY so generate_codex_hooks_config includes it in Codex
config.toml (otherwise _SKIP_CODEX_STATUSES excludes it, making the
early-exit dead code). Also unblocks run_skill dispatch on Codex by
removing the _get_fix_required_hook_matchers blocker.

Update the Codex Compatibility Table comment to match.
…_load_guard

write_guard: add TestWriteGuardCodexBackendEarlyExit class with 6 tests
covering Write/Edit, apply_patch, Bash write commands, non-codex
enforcement baseline, no-headless precedence, and malformed-JSON
tolerance. The autouse fixture sets AUTOSKILLIT_HEADLESS=1,
AUTOSKILLIT_AGENT_BACKEND=codex, and a sample allowed prefix.

skill_load_guard: add 3 new test functions exercising the new
agent_backend parameter on _run_guard — early-exit regardless of
applicable_guards content (parametrized over 4 values), and a
non-codex baseline that confirms enforcement proceeds normally.
@Trecek Trecek added this pull request to the merge queue Jun 12, 2026
Merged via the queue into develop with commit 70461d5 Jun 12, 2026
3 checks passed
@Trecek Trecek deleted the t5-p4-a3-wp1-eliminate-the-structural-defect-where-write-gua/4018 branch June 12, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant