Skip to content

Implementation Plan: T5-P4-A1-WP1 Create BackendCmdBuilderBase with Shared Env Assembly#4088

Closed
Trecek wants to merge 2 commits into
developfrom
t5-p4-a1-wp1-create-a-single-canonical-location-for-the-shar/4014
Closed

Implementation Plan: T5-P4-A1-WP1 Create BackendCmdBuilderBase with Shared Env Assembly#4088
Trecek wants to merge 2 commits into
developfrom
t5-p4-a1-wp1-create-a-single-canonical-location-for-the-shar/4014

Conversation

@Trecek

@Trecek Trecek commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Create BackendCmdBuilderBase ABC in a new _backend_cmd_builder_base.py module that exclusively owns the eight shared env keys currently duplicated across four call sites in claude.py and codex.py. Introduce FlagVocabulary NamedTuple to capture per-backend flag structure. Wire both ClaudeCodeBackend and CodexBackend as subclasses. Demote _codex_exec_extras to a shim by having callers obtain shared keys from the base class method instead.

Closes #4014

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260611-233958-268497/.autoskillit/temp/make-plan/t5-p4-a1-wp1-create-backend-cmd-builder-base_plan_2026-06-11_234500.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 78 33.8k 2.4M 136.8k 55 124.9k 17m 58s
verify* sonnet 1 94 10.3k 555.4k 62.7k 28 41.8k 4m 39s
implement* MiniMax-M3 1 6.8M 27.8k 0 0 164 0 12m 46s
fix* sonnet 1 214 9.0k 1.5M 73.4k 66 52.5k 6m 7s
audit_impl* sonnet 1 982 11.7k 291.4k 50.6k 19 44.0k 4m 46s
prepare_pr* MiniMax-M3 1 200.0k 2.7k 0 0 14 0 1m 7s
compose_pr* MiniMax-M3 1 175.8k 1.1k 0 0 12 0 1m 45s
Total 7.2M 96.4k 4.7M 136.8k 263.2k 49m 10s

* 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 509 0.0 0.0 54.5
fix 9 165682.4 5832.3 1003.8
audit_impl 0
prepare_pr 0
compose_pr 0
Total 518 9099.5 508.2 186.0

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 78 33.8k 2.4M 124.9k 17m 58s
sonnet 3 1.3k 31.0k 2.3M 138.3k 15m 32s
MiniMax-M3 3 7.2M 31.6k 0 0 15m 39s

Trecek and others added 2 commits June 12, 2026 00:14
Create _backend_cmd_builder_base.py module with BackendCmdBuilderBase
ABC and FlagVocabulary NamedTuple. The base class exclusively owns the
eight shared env keys (MAX_MCP_OUTPUT_TOKENS, MCP_CONNECTION_NONBLOCKING,
CAMPAIGN_ID_ENV_VAR, KITCHEN_SESSION_ID_ENV_VAR, SCENARIO_STEP_NAME,
AUTOSKILLIT_ALLOWED_WRITE_PREFIX, AUTOSKILLIT_ALLOWED_WRITE_PREFIXES,
AUTOSKILLIT_CWD) previously duplicated across four call sites.

Both ClaudeCodeBackend and CodexBackend now inherit from the base and
contribute backend-specific extension points (_binary, _sandbox_default,
_env_policy, _flag_vocabulary). The _codex_exec_extras shim is preserved
for backward compat — it now handles only Codex-specific keys, while
the eight shared keys come from self._assemble_shared_env_extras().

Behavioral change: Claude's build_food_truck_cmd now forwards
CAMPAIGN_ID_ENV_VAR when present, aligning with Codex's food truck path
and Claude's skill session path (both of which already forwarded it).

Add test_backend_cmd_builder_base.py covering FlagVocabulary structure,
env assembly round-trips, config unpacking (18 fields), inheritance,
and extension points. Update execution/backends/AGENTS.md to list the
new module.
…ne exemption

Add 'claude' and 'codex' to SINGLETON_ALLOWED_MODULES for the
CLAUDE_FLAG_VOCABULARY and CODEX_FLAG_VOCABULARY module-level NamedTuple
constants introduced by BackendCmdBuilderBase inheritance wiring.

Bump execution/backends/codex.py exemption from 1060→1070 to account for
the four abstract property implementations added to CodexBackend (+5 net lines).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trecek

Trecek commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as superseded — this work already landed on develop via PR #4138 ("T5-P4-A1-WP2 Eliminate Duplicated Env-Assembly Block"). The _backend_cmd_builder_base.py ABC and FlagVocabulary NamedTuple are already present. Merging this branch would introduce regressions by reverting session_log.py to a pre-CompositeSessionLocator state.

@Trecek Trecek closed this Jul 4, 2026
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