IL-1 backend abstraction layer — concrete CodingAgentBackend implementations.
| File | Purpose |
|---|---|
__init__.py |
BACKEND_REGISTRY, get_backend() factory, re-exports |
_backend_cmd_builder_base.py |
BackendCmdBuilderBase ABC (frozen dataclass), FlagVocabulary NamedTuple, SHARED_BASELINE_ENV — canonical location for shared env-assembly keys |
_composite_locator.py |
CompositeSessionLocator — single dispatch point iterating BACKEND_REGISTRY for session location |
_probe_cache.py |
ProbeResult, PROBE_CACHE_TTL, read_probe_cache, write_probe_cache — versioned probe result cache |
claude.py |
ClaudeCodeBackend (incl. validate_session_layout), ClaudeEnvPolicy, ClaudeSessionLocator, ClaudeStreamParser, ClaudeResultParser (prompt utilities moved to _claude_prompt.py) |
_claude_prompt.py |
Prompt injection utilities, session constants (_ensure_skill_prefix, _inject_completion_directive, _compose_resume_prompt, etc.), shared by claude + codex + commands |
codex.py |
CodexFlags, CodexBackend (incl. validate_session_layout, setup_session_dir agent TOML generation via _generate_agent_tomls), CodexEnvPolicy, CodexSessionLocator (parse/config moved to _codex_parse.py / _codex_config.py) |
_codex_config.py |
TOML serialization with [[key]] array-of-tables support, MCP registration (ensure_codex_mcp_registered, _serialize_toml) |
_codex_hooks.py |
Codex config.toml hook generation, sync, and upsert (generate_codex_hooks_config, sync_hooks_to_codex_config) |
_codex_parse.py |
CodexStreamParser, CodexResultParser, _scan_codex_ndjson, _CodexParseAccumulator |
codex_scenario_player.py |
CodexScenarioPlayer, make_codex_scenario_player, CodexStepRecord, CodexScenario, _load_manifest, _FakeCodexCLI, _write_shim_script — scenario replay data layer for Codex backend |
_cmd_builder.py |
CmdBuilder, CmdOrderingError — typed builder that enforces positional-before-variadic ordering by construction |
-
Create the backend module — add
execution/backends/<name>.pyimplementing theCodingAgentBackendProtocol. Include a concreteBackendCapabilitiesdataclass instance. -
Add the name constant — add
AGENT_BACKEND_<NAME>: str = "<name>"tocore/types/_type_constants_env.pyand include it inKNOWN_BACKEND_NAMES. Enforced bytest_all_backends_have_name_constantintests/arch/test_backend_coherence.py. -
Register in
BACKEND_REGISTRY— add a'<name>': <NameBackend>entry to theBACKEND_REGISTRYdict inexecution/backends/__init__.py. -
Declare hook sync and MCP registration via capability fields — populate the relevant capability fields on
BackendCapabilities(e.g.,mcp_config_capable) so that theinit-time helpers incli/_init_helpers.pyand theensure_pre_launch()protocol method discover the backend through data-driven dispatch. Do not add new conditional branches incli/_init_helpers.py. Enforced bytest_all_backends_have_init_hookintests/arch/test_backend_coherence.py(verifiescli/_init_helpers.pyimports from the execution layer — the connectivity prerequisite for capability-field dispatch). -
Populate doctor fields — set
version_check_command,process_name, andmin_versiononBackendCapabilities. Do not add a new_check_<name>_version()function. Enforced bytest_backend_doctor_coverageintests/arch/test_backend_coherence.py. -
Add a
FeatureDef— add an entry toFEATURE_REGISTRYincore/types/_type_constants_features.pywithdefault_enabled=Falseandrequires_backend_alignment=True. -
Extend test coverage — add tests to
tests/execution/backends/test_backend_registry.py,tests/contracts/test_backend_compliance.py, andtests/contracts/test_backend_protocol.py.