Skip to content

Implementation Plan: T5-P4-A1-WP1 BackendCmdBuilderBase ABC and FlagVocabulary#4091

Merged
Trecek merged 5 commits into
developfrom
t5-p4-a1-wp1-create-a-single-canonical-location-for-the-shar/4014-2
Jun 12, 2026
Merged

Implementation Plan: T5-P4-A1-WP1 BackendCmdBuilderBase ABC and FlagVocabulary#4091
Trecek merged 5 commits into
developfrom
t5-p4-a1-wp1-create-a-single-canonical-location-for-the-shar/4014-2

Conversation

@Trecek

@Trecek Trecek commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Create BackendCmdBuilderBase as a @dataclass(frozen=True, slots=True) ABC in a new module _backend_cmd_builder_base.py within execution/backends/. This ABC owns the canonical definition of the eight shared env keys that both ClaudeCodeBackend and CodexBackend currently duplicate. Both backends inherit from it. _codex_exec_extras is demoted to a shim that derives the two always-on shared keys from the base class without calling the full _assemble_shared_env_extras() (which also reads ambient env vars — not appropriate for the include_session_baseline path). FlagVocabulary NamedTuple captures per-backend CLI flag metadata.

Requirements

Conflict Resolution Decisions

The following files had merge conflicts that were automatically resolved.

Closes #4014

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260612-083826-983233/.autoskillit/temp/make-plan/t5_p4_a1_wp1_backend_cmd_builder_base_plan_2026-06-12_090000.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 1.3k 38.2k 2.5M 141.0k 72 150.9k 17m 12s
verify* sonnet 1 1.3k 19.3k 672.1k 74.1k 36 74.3k 7m 33s
implement* MiniMax-M3 1 10.5M 29.0k 0 0 174 0 24m 36s
audit_impl* sonnet 1 1.4k 14.0k 333.0k 66.0k 18 46.5k 7m 46s
prepare_pr* MiniMax-M3 1 211.4k 2.6k 0 0 13 0 1m 3s
compose_pr* MiniMax-M3 1 176.9k 1.4k 0 0 12 0 41s
review_pr* sonnet 1 132 36.2k 983.5k 98.3k 44 79.2k 9m 54s
resolve_review* sonnet 1 613 46.1k 7.6M 137.3k 167 235.5k 19m 30s
Total 10.9M 187.0k 12.1M 141.0k 586.5k 1h 28m

* 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 527 0.0 0.0 55.1
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 97 78401.9 2428.3 475.4
Total 624 19322.5 939.9 299.6

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 1.3k 38.2k 2.5M 150.9k 17m 12s
sonnet 4 3.5k 115.7k 9.6M 435.6k 44m 44s
MiniMax-M3 3 10.9M 33.1k 0 0 26m 21s

Trecek and others added 5 commits June 12, 2026 09:22
Create BackendCmdBuilderBase as the shared ABC for both ClaudeCodeBackend
and CodexBackend. The base owns the eight shared env keys (MAX_MCP_OUTPUT_TOKENS,
MCP_CONNECTION_NONBLOCKING, plus six conditional keys) and the
_assemble_shared_env_extras helper, eliminating the ~30 lines of inline
env-assembly duplication that lived in each backend's build_skill_session_cmd
and build_food_truck_cmd methods.

FlagVocabulary NamedTuple captures per-backend CLI flag metadata. SHARED_BASELINE_ENV
becomes the canonical 2-key MappingProxyType source; _claude_prompt's
_SESSION_BASELINE_ENV is now a downstream alias.

CodexBackend's _codex_exec_extras is correctly demoted to a shim that uses
SHARED_BASELINE_ENV (not _assemble_shared_env_extras) for the
include_session_baseline path, preserving the static 2-key contract for
resume sessions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
After pre-commit auto-formatting collapsed some whitespace, codex.py ended
up at 1058 lines (well under 1060). No need to bump the cap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… all callers

Private-named symbols _MAX_MCP_OUTPUT_TOKENS_VALUE and _SESSION_BASELINE_ENV
were listed in __all__ in _claude_prompt.py, contradicting __all__'s public-API
semantics. The canonical definitions already live in _backend_cmd_builder_base.py.

Migrate all callers (claude.py, codex.py, commands.py, execution/__init__.py,
and 5 test files) to import SHARED_BASELINE_ENV from the canonical location.
Remove the legacy aliases and __all__ from _claude_prompt.py per the
"No Backward Compatibility Hacks" rule.

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

The docstring claimed "Unpack all SkillSessionConfig fields" but backend_override
is intentionally excluded — it is consumed upstream at the headless layer before
command builders are invoked. Clarify this in the docstring so future readers
can verify completeness without guessing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…unt guard

test_fields: replace isinstance() checks with value equality assertions —
type correctness is already guaranteed by NamedTuple; value assertions catch
wrong values that isinstance lets through.

test_all_eight_keys: add assert len(result) == 8 to enforce the count the test
name advertises, preventing extra unexpected keys from going undetected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trecek Trecek added this pull request to the merge queue Jun 12, 2026
Merged via the queue into develop with commit 485b074 Jun 12, 2026
3 checks passed
@Trecek Trecek deleted the t5-p4-a1-wp1-create-a-single-canonical-location-for-the-shar/4014-2 branch June 12, 2026 17:22
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