Commit graph

787 commits

Author SHA1 Message Date
Bryan Helmkamp
e5cfeaacaa Update OpenAPI spec and TS client for stream_event SSE format
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:50:51 -04:00
Bryan Helmkamp
83fb20cb3c Fix SSE streaming format mismatch in /completions endpoint
The server was emitting Anthropic-style SSE events (content_block_delta,
message_delta, etc.) but both consumers — the arc_server provider and
run_prompt_via_server CLI — expect `event: stream_event` with serialized
StreamEvent JSON payloads. This caused streaming to silently produce no
output in server mode.

Now forwards all StreamEvent variants directly (text, tool calls,
reasoning, etc.) instead of manually mapping a subset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:47:55 -04:00
Bryan Helmkamp
041486400e Add toolchain check step before preflight in implement-and-simplify workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:47:30 -04:00
Bryan Helmkamp
eb584b88c9 Show Run ID before Logs in arc run output
Generate the run ULID early and display it before the logs directory,
then pass it into setup_worktree and setup_daytona_git instead of each
generating their own.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:35:15 -04:00
Bryan Helmkamp
9fa088b1a9 Split preflight into compile/lint/test stages with lint auto-fix loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:33:09 -04:00
Bryan Helmkamp
801a3936b4 Fix clippy::single_match lint in arc-llm SSE event handler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:29:39 -04:00
Bryan Helmkamp
105bdc04de Add e2e tests for arc exec against live LLM
Five new CLI-level tests covering file creation, shell execution,
read-only permission enforcement, JSON output format, and read+edit
multi-step tool use. All gated with #[ignore = "requires API key"].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:26:52 -04:00
Bryan Helmkamp
d568306701 Add --goal-file CLI flag to arc run for reading goal from a file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:18:49 -04:00
Bryan Helmkamp
dcc8020aac Replace commented-out Inception tests with #[cfg(feature = "quarantine")]
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:54:18 -04:00
Bryan Helmkamp
0f3931ae9f Fix daytona_asset_collection test to use current artifacts directory layout
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:51:42 -04:00
Bryan Helmkamp
28bd9616a8 Add e2e tests for ReadBeforeWriteSandbox through execute_and_emit_one_tool
Tests the full production path: execute_and_emit_one_tool → real tool executor
→ ReadBeforeWriteSandbox guard, covering write-blocked, read-then-write,
grep-then-write, edit-blocked, and new-file-allowed scenarios.

Also updates MutableMockSandbox::grep to do substring matching against
in-memory files so the grep integration test works end-to-end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:50:38 -04:00
Bryan Helmkamp
d95a9acf77 Fix daytona_cli_claude OOM by using daytona-medium snapshot (2 vCPU / 4 GiB)
The Claude CLI native binary install was getting OOM-killed (exit 137)
in the default 1 GiB sandbox. Using the daytona-medium default snapshot
also pre-includes Node, making the prereq install step a no-op.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:34:15 -04:00
Bryan Helmkamp
f6284026b1 Fix codex CLI auth: use codex login --with-api-key for credentials
Codex CLI no longer reads OPENAI_API_KEY from the environment at
runtime. It requires `codex login --with-api-key` to store credentials
via its auth system. Add a login step after ensure_cli for codex.

Also pass API keys via exec_command's env_vars parameter as belt-and-
suspenders alongside the env file, to avoid fs-to-process race conditions
in the Daytona sandbox.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:22:41 -04:00
Bryan Helmkamp
dd9bed01e5 Improve CLI backend reliability and error diagnostics
- Use `cat file | command` instead of `command < file` for stdin piping
  to avoid redirect issues in nested shell wrappers
- Include both stdout and stderr in error messages when CLI exits non-zero
  (previously only showed stderr, hiding API errors in stdout)
- Install Node 20 via nodesource + bash/curl as prerequisites for CLI tests
- Use bash instead of sh for Claude CLI install script

The codex test still fails with 401 Unauthorized — the OPENAI_API_KEY
env var isn't reaching the codex process in the sandbox despite the env
file being sourced correctly (gemini works with the same mechanism).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:06:03 -04:00
Bryan Helmkamp
59c01d62fd Fix Daytona e2e test failures and improve test reliability
- Pass GitHub App credentials in create_env() and daytona_snapshot_sandbox
  so private repo clones succeed
- Install git in sandbox before running git CLI in clone_private_repo test
- Use brynary/arc (where app is installed) instead of rust-lang/rust for
  clone_public_repo_gets_credentials test
- Fix git_checkpoint_remote_emits_events assertion: expect 1 event (work
  node only) since start is skipped and exit breaks before checkpoint
- Install Node 20 via nodesource and bash/curl in CLI test prerequisites
- Use bash instead of sh for Claude CLI install script
- Shorten toolbox_idle_diagnostic sleep durations to finish in ~12s
- Add nextest config with 120s per-test timeout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:51:43 -04:00
Bryan Helmkamp
7d503180bc Fix flaky multi-turn cache test by checking best ratio across all turns
Provider implicit caching (Gemini, OpenAI) is non-deterministic — cache
hits can occur on some turns but not others. Checking only the final turn
caused intermittent failures. Track the best cache ratio across all turns
instead, which still validates the adapter surfaces cached token counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:35:42 -04:00
Bryan Helmkamp
44dce81409 Fix e2e test failures and quarantine unreliable Inception provider
- Anthropic max_tokens: use model catalog limit instead of hardcoded 65536,
  fixing claude-sonnet-4-5 (max_output=64000) API errors
- OCI feature tgz: detect actual filename from registry instead of
  assuming devcontainer-feature.tgz (registries use suffixed names)
- Test LlmCodergenBackend: implement one_shot() for prompt handler support
- Quarantine all Inception/mercury-2 parity matrix tests (unreliable provider)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:24:55 -04:00
Bryan Helmkamp
36ad1606ee Update docs for tool-level hooks, server mode, and auto-PR
- hooks.mdx: add pre_tool_use/post_tool_use/post_tool_use_failure events,
  tool-specific context fields, matcher support for tool names
- cli.mdx: add --mode and --server-url flags to arc exec
- run-configuration.mdx: add [pull_request] section
- github.mdx: add auto-PR to features table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:49:28 -04:00
Bryan Helmkamp
39b10b0a5a Update changelog for 2026-03-08 with hooks, server mode, and auto-PR
Regenerate the changelog entry to cover all commits since the last
watermark. Add changelog writing guideline to use user-facing language
instead of internal Rust names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:45:30 -04:00
Bryan Helmkamp
7cfbe5f9d1 Add PreToolUse, PostToolUse, PostToolUseFailure Hooks (#6)
* arc(01KK739V1KPSQJT6E492ZWR95G): implement (success)

Arc-Run: 01KK739V1KPSQJT6E492ZWR95G
Arc-Completed: 2
Arc-Checkpoint: 52e0f637b3c802833c0c6eb7e2e8b56aef071441

* arc(01KK739V1KPSQJT6E492ZWR95G): simplify (success)

Arc-Run: 01KK739V1KPSQJT6E492ZWR95G
Arc-Completed: 3
Arc-Checkpoint: c1d6abe508b30b269d019961988212076064fb9e

* Merge main into PR branch: integrate MCP servers with server mode dispatch

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

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:40:02 -04:00
Bryan Helmkamp
7f264e44c1 arc exec server mode via /completions proxy (#4)
* arc(01KK6WHKW0XB829BBCXH5N5G03): implement (success)

Arc-Run: 01KK6WHKW0XB829BBCXH5N5G03
Arc-Completed: 2
Arc-Checkpoint: b394706ae5111891bed4c3c20290464410a8ff23

* arc(01KK6WHKW0XB829BBCXH5N5G03): simplify (success)

Arc-Run: 01KK6WHKW0XB829BBCXH5N5G03
Arc-Completed: 3
Arc-Checkpoint: fa9fabbe6016dd6bb795a4a1711792320aa4e1b2

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:36:33 -04:00
Bryan Helmkamp
80fbeb5fcd Auto-PR on Successful Workflow Run (#3)
* arc(01KK6WHJ904CXGN0MCQFGWKMKS): implement (success)

Arc-Run: 01KK6WHJ904CXGN0MCQFGWKMKS
Arc-Completed: 2
Arc-Checkpoint: 4c3a9115be9074c7e23792c0ef9b1f0525ffc10d

* arc(01KK6WHJ904CXGN0MCQFGWKMKS): simplify (success)

Arc-Run: 01KK6WHJ904CXGN0MCQFGWKMKS
Arc-Completed: 3
Arc-Checkpoint: 7d8e8413e70eb198e14fcb676903dcc91bd21b76

* Fix merge conflicts: add pull_request to OpenAPI spec, fix clippy warning, cargo fmt

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

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:32:55 -04:00
Bryan Helmkamp
7f6f356bae TOML Config Format for MCP Servers (#2)
* arc(01KK6WHD2MEDZ0JVYTHEK9HFNF): implement (success)

Arc-Run: 01KK6WHD2MEDZ0JVYTHEK9HFNF
Arc-Completed: 2
Arc-Checkpoint: 25f71de745f9001a09e566706d62a6ac2ea6f827

* arc(01KK6WHD2MEDZ0JVYTHEK9HFNF): simplify (success)

Arc-Run: 01KK6WHD2MEDZ0JVYTHEK9HFNF
Arc-Completed: 3
Arc-Checkpoint: fed4325308110df4799171944ddb5170de59044c

* Fix Rust formatting

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

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:26:46 -04:00
Bryan Helmkamp
ff053e1e4a Fix ReadBeforeWriteSandbox (#1)
* arc(01KK60MHXX1G7Y2H0YN6HAWWZH): start (success)

Arc-Run: 01KK60MHXX1G7Y2H0YN6HAWWZH
Arc-Completed: 1
Arc-Checkpoint: be0355a55571c147ac954b15ac0d5605d63539e8

* arc(01KK60MHXX1G7Y2H0YN6HAWWZH): implement (success)

Arc-Run: 01KK60MHXX1G7Y2H0YN6HAWWZH
Arc-Completed: 2
Arc-Checkpoint: b67ee066bf67ce3c36bbdf31833e4303065de311

* arc(01KK60MHXX1G7Y2H0YN6HAWWZH): simplify (success)

Arc-Run: 01KK60MHXX1G7Y2H0YN6HAWWZH
Arc-Completed: 3
Arc-Checkpoint: 69fbd818f537771b9d7f8b43339e31fe4fa63321

* Fix formatting in cli.rs and tools.rs

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

* Fix clippy warnings after merging main

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

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:19:22 -04:00
Bryan Helmkamp
d002aa0b51 Rename arc run startarc run (#5)
* arc(01KK7524KNGTPS4090QMF87FJN): implement (success)

Arc-Run: 01KK7524KNGTPS4090QMF87FJN
Arc-Completed: 2
Arc-Checkpoint: 1ff03c704805dfe8e7c37b37f97bd06dfa0e5dc5

* Fix: restore trailing newlines stripped by previous commit

* arc(01KK7524KNGTPS4090QMF87FJN): simplify (success)

Arc-Run: 01KK7524KNGTPS4090QMF87FJN
Arc-Completed: 3
Arc-Checkpoint: 21771adfd26283a1d1e6b8a123a83a0c4277db48

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Arc Assistant <assistant@arc.dev>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:14:50 -04:00
Bryan Helmkamp
c3d23d72e9 Extract raise_on_errors helper to deduplicate diagnostic error filtering
The pattern of filtering Error-severity diagnostics, collecting messages,
and returning ArcError::Validation appeared in three places. Extract it
into validation::raise_on_errors and use prepare_from_file in run_from_branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:52:37 -04:00
Bryan Helmkamp
8ee27278dd Add conformance test to detect ServerConfig ↔ OpenAPI spec drift
Recursively compares serialized ServerConfig keys against the
OpenAPI ServerConfiguration schema properties. Also fixes 7 fields
that were missing from the spec: log, checkpoint, git.slug,
git.author, git.webhooks, sandbox.exe, sandbox.env.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:44:59 -04:00
Bryan Helmkamp
3c476772e7 Add prepare_with_file_inlining API to prevent validate/run divergence
FileInliningTransform was treated as a "custom" transform that every
caller had to remember to register manually. This caused arc validate
to break and left latent bugs in run_from_branch and SubWorkflowHandler.

Add prepare_with_file_inlining() and prepare_from_file() to WorkflowBuilder
so file inlining is a built-in concern. Rename prepare_workflow to
prepare_from_source for clarity. Fix the SubWorkflowHandler to use
prepare_from_file when reading from stack.child_dotfile paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:37:54 -04:00
Bryan Helmkamp
3fdd1ec746 Add commit watermark to /changelog skill for precise change tracking
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:37:52 -04:00
Bryan Helmkamp
5a720ddb26 Rename /runs/{id}/compare to /runs/{id}/files with pagination
Replace the RunCompare envelope (checkpoints + files + stats) with a
standard PaginatedRunFileList response containing FileDiff items,
matching the existing pagination pattern used by other endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:37:30 -04:00
Bryan Helmkamp
e73f2ab00e Add pause/unpause run endpoints
Add POST /runs/{id}/pause and POST /runs/{id}/unpause endpoints
following the cancel endpoint conventions, with paused RunStatus variant,
demo stubs, and regenerated TypeScript client.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:36:36 -04:00
Bryan Helmkamp
be358944c0 Reorganize API Reference nav: remove unused sections, nest under More
Remove Verification, Insights, and Retros groups. Move Sessions, Models,
and Administration as sub-groups under More. Add unlisted Test Model
endpoint. Hide Run Verification endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:20:35 -04:00
Bryan Helmkamp
09a2166324 Update changelog and docs for webhook listener, verbose config, optional goal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:15:52 -04:00
Bryan Helmkamp
3e47d85b16 Fix arc validate not resolving @file references
Register FileInliningTransform in validate_command so @file references
(e.g. @prompts/simplify.md) are resolved during validation, matching
the behavior in run.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:58:56 -04:00
Bryan Helmkamp
95be0206e5 Add implement-and-simplify workflow with full preflight checks
Run cargo check, clippy, and tests in preflight before starting implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:40:30 -04:00
Bryan Helmkamp
839cbc28b8 Fix stale test: goal is now optional in run config
The missing_required_fields test was not updated when goal was changed
from String to Option<String> in c143d2c8.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:11:39 -04:00
Bryan Helmkamp
0ca9a309c0 Fix clippy await_holding_lock: drop RwLock guard before await in webhook setup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:03:37 -04:00
Bryan Helmkamp
2355cd573d Simplify webhook module: deduplicate PEM decoding, extract delivery_id, remove redundant state
- Reuse jwt_auth::decode_pem_env in read_github_private_key instead of duplicating base64/PEM logic
- Extract delivery_id once at top of webhook_handler instead of 3 separate times
- Remove redundant funnel_port field from WebhookManager (derive from listener.port())
- Gate parse_event_metadata behind debug log level to avoid full JSON parse on every webhook

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:45:38 -04:00
Bryan Helmkamp
d838fda004 Add GitHub webhook listener via Tailscale funnel
Adds a webhook subsystem that receives GitHub App webhooks when configured
in server.toml with [git.webhooks] strategy = "tailscale_funnel". On startup,
it binds a local HTTP listener on a random port, exposes it via `tailscale funnel`,
and patches the GitHub App webhook URL. Incoming webhooks are verified with
HMAC-SHA256 before processing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:37:56 -04:00
Bryan Helmkamp
46d170468e Add PostToolUse hook to auto-format Rust files with cargo fmt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:03:09 -04:00
Bryan Helmkamp
18aaa75ae7 Support verbose = true in cli.toml to default verbose output on
Adds a top-level `verbose` bool to CliConfig so `arc run start` and
`arc doctor` pick it up without requiring `-v` every invocation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:01:05 -04:00
Bryan Helmkamp
ad058e604a Fix demo data to wrap goal values in Some() after making goal optional
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:59:50 -04:00
Bryan Helmkamp
c143d2c873 Make goal optional in run config TOML so it can be provided via CLI --goal
Precedence: CLI --goal > TOML goal > DOT graph attribute. Previously
the TOML goal field was required but never applied to the graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:56:41 -04:00
Bryan Helmkamp
1cd3be878a Track .claude directory and add docs skill watermark
Remove .claude from .gitignore and commit the docs skill watermark
so future /docs runs know where to start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:23:07 -04:00
Bryan Helmkamp
014ff0595b Update changelog and docs for March 7-8 changes
Regenerate March 7 changelog with sandbox.env, CLI renames, and missing
accordion items. Add March 8 changelog for sandbox reliability and @file
validation. Update reference docs for --goal, --mode flags, sandbox.env,
checkpoint exclude globs, [log] config, [git.author], and project_memory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:22:26 -04:00
Bryan Helmkamp
f4c2014026 Add custom Dockerfile and simplify imagegen workflow
Bake the imagegen script into a Daytona snapshot so the agent
can just run `imagegen <prompt> <output>` instead of manually
calling the Gemini API with curl/jq.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:20:07 -04:00
Bryan Helmkamp
aa8aab6588 Remove unused base64::Engine import in daytona integration tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:14:37 -04:00
Bryan Helmkamp
d8cd4f0c21 Upgrade CI runners to 16-core for faster Rust builds
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:14:18 -04:00
Bryan Helmkamp
fb19251e9c Fix CI: clippy warnings, formatting, and mTLS test cert version
Rust 1.94.0 introduced new clippy lints and rustls now rejects X.509 v1
certificates. This fixes all three CI jobs:

- Format: cargo fmt across the workspace
- Clippy: unnecessary_unwrap, useless_format, derivable_impls,
  type_complexity, too_many_arguments, redundant_closure, map_or
  simplification, and other new lints
- Tests: generate v3 certs (with extensions) for mTLS tests so newer
  rustls accepts them

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:07:33 -04:00
Bryan Helmkamp
97a0a9be32 Fix clippy warnings in arc-agent
- Collapse nested if statements in heredoc stripping (v4a_patch.rs)
- Pass ToolCall directly to execute_one_tool to reduce argument count (tool_execution.rs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:15:25 -04:00