Commit graph

1039 commits

Author SHA1 Message Date
Bryan Helmkamp
e38d3ea3ce Add tracing to DaytonaSandbox::exec_command to diagnose stall watchdog timeouts
A workflow run hung for 33 minutes in a Daytona shell command despite
a 5-minute client-side timeout in tokio::select!. The root cause is
unknown — tests confirm the select pattern works correctly. Adding
info-level tracing at method entry (with command and timeout_ms),
after process service acquisition, and in each select arm so the
next occurrence reveals exactly where execution stalls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 17:04:17 -04:00
Bryan Helmkamp
87435aef11 Preserve ts, run_id, event field order in progress.jsonl
Enable serde_json's preserve_order feature so Map uses insertion-order
IndexMap instead of sorted BTreeMap. Extract build_event_envelope()
from the on_event closure to deduplicate the envelope construction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 13:01:17 -04:00
Bryan Helmkamp
55917f4005 Add arc graph subcommand to render workflow DOT graphs as SVG/PNG
Mirrors `arc validate` workflow resolution. Shells out to `dot` (graphviz)
with friendly error if not installed. Supports --format svg|png and -o output path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 10:34:23 -04:00
Bryan Helmkamp
7dfbd53797 Print resolved graph path in arc run and arc validate
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 10:03:34 -04:00
Bryan Helmkamp
53b27ab188 Group arc doctor checks into Required / Optional / Server sections
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:59:54 -04:00
Bryan Helmkamp
ee58694cf0 Add tool call progress display to retro step
Wire ProgressUI and EventEmitter into the retro agent so it shows
stage spinners with nested tool calls, matching the look of agent
nodes in the main workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:53:40 -04:00
Bryan Helmkamp
c475b0a25e Add warning when no git remote is configured during arc init
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:40:50 -04:00
Bryan Helmkamp
3c5d8ff3e7 Add indicatif to Cargo.lock for arc doctor spinner
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:37:54 -04:00
Bryan Helmkamp
cd70962bd9 Add AbortReason to AgentError::Aborted for diagnosable abort messages
Previously, AgentError::Aborted was a bare variant that displayed as
just "Aborted", making it impossible to tell whether a session was
killed by wall clock timeout, user cancellation, or something else.
Now it carries an AbortReason (WallClockTimeout or Cancelled) so
terminal output like the retro agent failure message includes the cause.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:34:52 -04:00
Bryan Helmkamp
83ed0d42a4 Add spinner to arc doctor for immediate feedback
The command takes several seconds (especially with live probes) but
previously showed no output until fully complete. Now a braille spinner
animates while checks run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:15:56 -04:00
Bryan Helmkamp
0af7a32794 Increase retro agent limits: 20 tool rounds, 3 minute timeout
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 09:12:37 -04:00
Bryan Helmkamp
73a793bdb1 Add extracted fixed-loop DOT fixture from branch-loop tutorial
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:57:00 -04:00
Bryan Helmkamp
30d1a11ace Add arc skill install subcommand to extract built-in skills to filesystem
Embeds the arc-create-workflow skill files via include_str! and installs them
to user (~/.claude/skills/ or ~/.agents/skills/) or project-level directories.
Supports --dir (claude|agents), --for (user|project), and --force flags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:56:44 -04:00
Bryan Helmkamp
86ac0ff394 Document fixed-count loops using internal.node_visit_count
Add a new section to the branch-loop tutorial showing how to loop a node
exactly N times using a diamond gate with a visit count condition, and
cross-reference it from the context docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:50:17 -04:00
Bryan Helmkamp
9b74cad56b Add arc-create-workflow skill for generating Arc workflow DOT graphs and TOML configs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:43:47 -04:00
Bryan Helmkamp
48341306c9 Add Kilroy project acknowledgement
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:38:13 -04:00
Bryan Helmkamp
cfd7ea8c97 Update changelog and docs for installer, devcontainers, arc pr, and preflight improvements
Regenerate 2026-03-10 changelog with full commit set (installer, devcontainer
support, arc pr subcommands, --no-dotenv removal). Add 2026-03-11 changelog
for shadow branch run records and arc diff improvements. Update docs: CLI
reference (arc pr list/view/merge/close, --shortstat), devcontainers page
(replace placeholder with full content), run-configuration (devcontainer
field), checkpoints (per-node files on metadata branch), models catalog
(gemini-3.1-pro-preview-customtools). Improve preflight to show per-model
LLM checks instead of a single merged provider line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:33:04 -04:00
Bryan Helmkamp
35b6282e6d Add gemini-3.1-pro-preview-customtools to model catalog
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 08:05:00 -04:00
Bryan Helmkamp
fe8493e6f9 Skip local worktree creation for remote sandbox runs
Remote sandboxes (Daytona, Exe) clone into their own environment, so
creating a local git worktree is unnecessary. The worktree decision
previously only checked worktree_mode and git_clean, ignoring the
sandbox provider entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 07:52:39 -04:00
Bryan Helmkamp
fb7994b8da Add devcontainer field to SandboxConfiguration OpenAPI schema
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 01:18:12 -04:00
Bryan Helmkamp
d3df81c062 Add last_file_touched as third status extraction fallback
When workflow prompts tell agents to write results to a file with
embedded JSON status fields, the engine now falls back to reading the
last file the agent wrote if neither the response text nor status.json
contain extractable status fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:54:24 -04:00
Bryan Helmkamp
0bdb8e93b1 Add per-node files and run-level metadata to shadow branch
Store execution trace data (prompts, responses, status, diffs, etc.) on
the shadow branch alongside checkpoint/manifest data. This makes the
shadow branch a complete, self-contained record of each run.

- scan_node_files() scans nodes/ for allowlisted files (<512KB)
- Checkpoint commits now include per-node files
- init_run includes sandbox.json
- Finalize commit after workflow writes retro.json + final node files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:37:52 -04:00
Bryan Helmkamp
a2288b7598 Simplify shorten_path and format call in progress UI
Use std::path::Path::strip_prefix instead of manual string manipulation,
and simplify redundant format! wrapper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:28:33 -04:00
Bryan Helmkamp
72b96b1864 Add --shortstat flag to arc diff for compact summary output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:28:01 -04:00
Bryan Helmkamp
eff2c472ec Render parallel fan-out branches like subagent info lines
Change parallel branch entries from tool-call style (6-space indent,
spinner) to subagent info style (8-space indent, ▸ prefix, dim/static
while running). Keeps ✓/✗ glyphs on completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:20:12 -04:00
Bryan Helmkamp
5301642b63 Include uncommitted changes in arc diff for in-progress runs
Drop `HEAD` from the live diff command so `git diff {base_sha}` compares
against the working tree instead of only committed changes. Extracts
`build_live_diff_cmd` for testability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:16:30 -04:00
Bryan Helmkamp
d11d2c3c3b Show tool call paths relative to sandbox working directory
Tool output previously showed absolute sandbox paths (e.g.
write_file(/home/daytona/workspace/output/js/physics.js)) because
shorten_path() only checked the host CWD. Now ProgressUI stores the
sandbox working directory and strips it from displayed paths, producing
cleaner output like write_file(output/js/physics.js).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 00:13:58 -04:00
Bryan Helmkamp
2dadd49605 Revert "Fix verbose mode breaking terminal rendering after many tool calls"
This reverts commit f27a5e187a.
2026-03-10 23:19:27 -04:00
Bryan Helmkamp
f8bd618f97 Fix heading: "AI research and labs" -> "AI researchers and labs"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 23:13:22 -04:00
Bryan Helmkamp
aaf51756de Add AI research labs acknowledgement and reorder sections
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 23:13:02 -04:00
Bryan Helmkamp
efc3615852 Add acknowledgements page crediting StrongDM's Attractor as inspiration
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 23:12:16 -04:00
Bryan Helmkamp
9245a9987b Fix Daytona sandbox clone failing on unpushed worktree branch
When `arc run` uses a Daytona sandbox, `initialize()` re-detects the
branch from cwd — but by that point the worktree has switched HEAD to
`arc/run/{run_id}`, which was never pushed, causing the clone to fail
with HTTP 400. Pass the already-known base branch (e.g. `main`) from
the caller instead of re-detecting it inside the sandbox.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 23:11:42 -04:00
Bryan Helmkamp
ecb585d2a4 Clean up devcontainer bridge: inline trivial wrappers, fix initializeCommand bugs
- Remove `devcontainer_env()` and `resolve_devcontainer()` trivial wrappers,
  inline at call sites
- Fix initializeCommand Args quoting: use shlex::try_quote instead of naive join
- Fix initializeCommand silently dropping Parallel commands: now executes them
- Convert three repetitive lifecycle calls to a data-driven loop
- Use crate::millis_u64() in setup command loop for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 23:06:33 -04:00
Bryan Helmkamp
e8067740f7 Wire arc-devcontainer into sandbox creation flow
When `devcontainer = true` in TOML sandbox config, Arc now resolves
devcontainer.json from the repo, uses its Dockerfile for the Daytona
snapshot, runs lifecycle hooks (on_create, post_create, post_start)
in the sandbox, and merges devcontainer env vars under TOML env.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 22:54:59 -04:00
Bryan Helmkamp
e248fc5651 Migrate 29 CLI tests from assert_cmd/insta to declarative trycmd
Model list tests (6): exact stdout snapshots in .trycmd files, replacing
insta .snap files. Error validation tests (5): TOML with stderr-to-stdout
checking specific error messages. Doctor tests (3): TOML with env.inherit
= false for env_clear(). Validate tests (7): TOML with fs.cwd/sandbox for
file path access. Dry-run tests (6): TOML with fs.cwd/sandbox. Exec help
and no-prompt tests (2): TOML with env config.

Remaining in cli.rs: negative-assertion tests, file-system side-effect
test, tmpdir+env test, and 11 ignored API-key-dependent tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 22:42:24 -04:00
Bryan Helmkamp
bf807686f6 Fix "Git clean: false" for remote sandboxes by checking clean + pushed
Remote sandboxes clone from origin, so "clean" should mean no uncommitted
changes AND the local branch is pushed. Replaces the hardcoded `false` with
a new `ensure_clean_and_pushed` that reuses `ensure_clean` + `branch_needs_push`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 22:35:08 -04:00
Bryan Helmkamp
11c17bffab Add CLI telemetry event tracking with command sanitization and git hashing
Activate the dormant Segment-based telemetry infrastructure by wiring
lifecycle events in main.rs. Each CLI invocation now emits a "Command Run"
or "Command Error" event with sanitized args, duration, hashed repo
identifier, and CI detection.

- Add sanitize.rs: redacts sensitive CLI args (paths, values) while
  keeping flags, booleans, and numeric patterns
- Add git.rs: MD5-hashes normalized origin remote URL so HTTPS/SSH
  variants produce the same identifier
- Extend command_name to include nested subcommands (e.g. "pr create",
  "llm prompt", "system prune", "model list")
- Restructure main/main_inner to capture timing and return command name
  alongside result for telemetry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 22:32:54 -04:00
Bryan Helmkamp
b864c1fa94 Add trycmd --help tests for each visible CLI subcommand
Covers run, validate, cp, preview, ssh, model, doctor, init, install,
pr, and system. Each test verifies --help exits 0 and produces output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 22:10:28 -04:00
Bryan Helmkamp
1b4c6cb903 Detect unsupported COPY/ADD in devcontainer base Dockerfiles
Daytona's Rust SDK doesn't support uploading build context files, so
COPY/ADD instructions referencing local files fail at build time with
confusing errors. Detect this early in resolve() and return a clear
UnsupportedCopyAdd error. Multi-stage COPY --from= and ADD http(s)://
are still allowed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 22:09:30 -04:00
Bryan Helmkamp
7e2e61a4a7 Convert field-by-field and contains() tests to insta inline snapshots
Replace verbose assertion chains with insta snapshots across 4 crates:
- arc-devcontainer: 3 generate_layer tests (contains → assert_snapshot)
- arc-llm catalog: 7 model info tests (field-by-field → assert_debug_snapshot)
- arc-llm types: 2 usage serialization tests (contains → assert_snapshot)
- arc-util telemetry: 3 track serialization tests (per-key → assert_snapshot)

Snapshots now cover all fields (aliases, family, training, cache costs, etc.)
that were previously unasserted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 21:24:27 -04:00
Bryan Helmkamp
b5e57419a7 Convert check_report.rs render tests to insta inline snapshots
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 21:15:53 -04:00
Bryan Helmkamp
bd96b94acf Introduce insta snapshot testing for arc-devcontainer and arc-cli
Replace assert_eq!/contains() chains with insta::assert_snapshot! in
dockerfile unit tests (11 inline snapshots) and CLI model/help tests
(7 file-based snapshots), making test output easier to read and update.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 21:09:15 -04:00
Bryan Helmkamp
490dc2e5eb Fix __send_analytics to delete event file on deserialization failure
The file was only deleted after successful deserialization + send.
Wrap the read/deserialize/send in an async block so remove_file
runs regardless of where the error occurs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 20:50:44 -04:00
Bryan Helmkamp
2735e1fc9b Bump version to 0.2.0 2026-03-10 20:37:47 -04:00
Bryan Helmkamp
992a920f72 Send telemetry via detached subprocess to survive CLI exit
Replace tokio::spawn fire-and-forget with a detached subprocess pattern:
send() serializes Track to ~/.arc/tmp/, spawns `arc __send_analytics <path>`
with ARC_TELEMETRY=off, and the child sends to Segment then cleans up the file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 20:18:35 -04:00
Bryan Helmkamp
8909eafbf3 Simplify PR commands: rename fields, use constant, parallelize list
- Rename PullRequestDetail fields from user_wrapper/head_wrapper/
  base_wrapper to user/head/base (serde renames no longer needed)
- Make GITHUB_API_BASE_URL public, replace hardcoded strings in pr.rs
- Replace opaque 5-tuple with PrRow struct in pr_list_from
- Parallelize GitHub API calls in pr_list using futures::join_all

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 19:54:38 -04:00
Bryan Helmkamp
9d966d3a08 Add arc pr list/view/merge/close subcommands
Add PR lifecycle commands that operate on workflow runs via their
pull_request.json records. Each loads the PR record from a run directory
and calls the GitHub API: list scans all runs and fetches live state,
view shows details, merge supports squash/merge/rebase, close sets
state to closed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 19:38:11 -04:00
Bryan Helmkamp
7ad187a78f Add signoff resource to verification system
Signoffs are stamps of approval for (control, repository, commit SHA)
tuples, enabling external tools and humans to mark a control as
pass/fail/pending for a specific commit. Adds OpenAPI spec, demo
handlers with 5 fixtures, route registration, and regenerated TS client.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 19:32:33 -04:00
Bryan Helmkamp
0d9b300aaf Remove --no-dotenv flag, always load ~/.arc/.env, never load ./.env
The local .env loading was unnecessary since arc install writes all
config to ~/.arc/.env. Simplifies dotenv behavior to unconditionally
load from the home directory only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 19:26:43 -04:00
Bryan Helmkamp
fc77a2fb24 Gate --mode and --server-url CLI args behind server feature
When compiled without the server feature, these args are useless since
there is no server to delegate to. Wraps the CLI fields, parser,
resolve_mode, build_server_client, and related tests in cfg(feature =
"server"), with standalone-only fallback paths in each command handler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 19:16:59 -04:00