4312fbd4: Agent Wrapper Architecture#166
Merged
Merged
Conversation
…d`" in Acceptance criteria
…ntaining" in Acceptance criteria
…--force`" in Acceptance criteria
…Acceptance criteria
…t" in Acceptance criteria
… Acceptance criteria
…ifest.toml`" in Acceptance criteria
…eady exists" in Acceptance criteria
…s not a known built-in" in Acceptance criteria
…c' into epic/4312fbd4-agent-wrapper-architecture
…itecture' into ticket/2803bf07-output-parser-strategy-external-parsers-
Wire parser/parser_command from manifest.toml into CustomWrapper::spawn. Canonical mode is unchanged. External mode spawns the wrapper with piped stdout, passes it to the parser's stdin via an OS-level pipe, and captures the parser's stdout/stderr to the log. The wrapper is reaped in a background thread so it doesn't zombie. apm validate now catches parser = external without parser_command. Unit and integration tests cover all branches.
…-' into epic/4312fbd4-agent-wrapper-architecture
…itecture' into ticket/25c92daa-mock-and-debug-built-in-wrappers-mock-ha
Register four new built-in wrappers in the dispatcher. Add WrapperContext.current_state field and wire all call sites. Create wrapper/builtin/ module structure with shared helpers. Annotate in_design and ammend to-specd transitions with outcome=success. Add per-agent instruction stubs for all four new wrappers.
…a' into epic/4312fbd4-agent-wrapper-architecture
Cross-cutting fixes flagged in the implementation review of epic
4312fbd4 (agent wrapper architecture):
- start.rs: route resolve_system_prompt through params.agent (post
frontmatter override) instead of literal "claude", so per-agent
instructions resolve correctly when agent is overridden via config
or ticket frontmatter
- start.rs: gate check_output_format_supported on the resolved
wrapper actually being the claude built-in; mock/debug agents and
custom wrappers no longer require the claude binary on PATH
- start.rs: enumerate built-ins dynamically in the not-found error
rather than the stale "{claude}" literal
- start.rs: refactor emit_deprecation_warning to take a Write so
the test asserts on captured output (the writer that production
passes is stderr.lock()), per the 6cac8518 amendment
- agents.rs: switch the configured-marker to read workers.agent and
iterate worker_profiles for per-profile labels, replacing the
legacy workers.command lookup
- validate.rs: refactor validate_agents to return (errors, warnings)
and add validate_all single-pass entry point; CLI now scans
.apm/agents/ once instead of twice per `apm validate` invocation
- validate.rs: simplify the dead-end BFS — unknown transition
targets are reported by validate_config; reachability skips them
rather than inlining a stripped resolve_outcome
- validate.rs: enumerate built-ins dynamically in the not-found
error message
- wrapper/custom.rs: default_contract_version returns CONTRACT_VERSION
so manifests without an explicit field track the current contract
on every bump; replace the tautological default test with one that
exercises the production code path
- wrapper/builtin/claude.rs: extract build_claude_args; share between
spawn_local and spawn_container; add unit tests verifying --model
and --dangerously-skip-permissions reach argv
- wrapper/builtin/debug.rs: extract DEBUG_SCRIPT const; add tests
asserting the script dumps APM_ env, emits one canonical event,
outputs prompt+message to stderr, self-cleans
- wrapper/builtin/mock_random.rs: extract pick_transition_idx; tests
cover determinism, distribution, and bounds
- wrapper/builtin/mod.rs: tests for seed_from_ctx (explicit option
path), happy_script content (impl/spec modes), sad_script content,
is_impl_mode predicate
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.
Epic: epic/4312fbd4-agent-wrapper-architecture