Commit graph

29 commits

Author SHA1 Message Date
Bryan Helmkamp
ec7fc8d5a2 Add arc preview command for Daytona sandbox preview URLs
Provides CLI access to preview URLs for ports exposed by Daytona sandboxes.
Supports standard (URL + token + curl), signed (self-contained URL), and
--open (browser launch) modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 11:55:47 -04:00
Bryan Helmkamp
1dcad0529a Split ~/.arc/logs/ into logs/ and runs/
Per-run data now lives in ~/.arc/runs/ while daily CLI log files
stay in ~/.arc/logs/. Renames: logs_root → run_dir (RunConfig field,
Handler trait param, all handlers), logs_dir → run_dir (CLI arg,
local variables), default_logs_base → default_runs_base (path fn).
Adds DB migration 002 to rename workflow_runs.logs_dir → run_dir.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 09:40:03 -04:00
Bryan Helmkamp
54ecae9586 Write per-run tracing logs to cli.log inside each run directory
Adds a switchable tracing layer that writes to ~/.arc/logs/{run-dir}/cli.log,
so all diagnostic info for a run is co-located with its other artifacts instead
of buried in the shared daily log file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 09:30:00 -04:00
Bryan Helmkamp
53e218926f Print full ~/... paths for assets instead of sandbox-relative paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 09:14:24 -04:00
Bryan Helmkamp
5883b71efd Print captured asset paths after workflow run output
Display collected assets in an "=== Assets ===" section after the run
result, so users can see which files were captured without digging
through the logs directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 09:01:52 -04:00
Bryan Helmkamp
3a7f5cdb6c Fix unused_assignments warning in run_from_branch
Return worktree_path from the match expression instead of mutating
a pre-initialized variable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 08:20:24 -04:00
Bryan Helmkamp
08461fe603 Add MCP server support to workflow engine and Playwright demo workflow
Wire MCP server configs from workflow TOML into agent sessions so
MCP tools are available to agent stages during workflow runs.

Changes:
- run_config.rs: add mcp_servers HashMap to WorkflowRunConfig
- backend.rs: AgentApiBackend.with_mcp_servers() passes configs to SessionConfig
- run.rs: extract mcp_servers from RunConfig and pass to backend
- demo/mod.rs: add default mcp_servers field to struct literals

New workflow: arc/workflows/playwright-demo/
- Runs on Daytona with daytona-medium snapshot
- Configures Playwright MCP as a sandbox transport (port 3100)
- Agent browses Hacker News, takes screenshots at each step
- asset_globs captures screenshots/** into logs directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 08:05:12 -04:00
Bryan Helmkamp
a0a43611b7 Gate arc-exe behind exedev feature flag
The Exe sandbox variant, its config field, and all arc_exe usage in
arc-workflows are now behind #[cfg(feature = "exedev")]. Default CLI
builds skip arc-exe and openssh entirely. arc-api enables exedev since
its demo module constructs full SandboxConfig structs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:08:09 -04:00
Bryan Helmkamp
1d0cfb8250 Fix 4 safety bugs in arc system prune found in PR #14 code review
- Reject negative durations in parse_duration (i64 -> u64) to prevent
  future cutoff that would delete everything
- Remove orphans flag from has_explicit_filters since --orphans is
  additive, not restrictive, and shouldn't disable the 24h staleness guard
- Use parsed label_filters instead of raw args.filter.label so malformed
  labels that get silently dropped don't incorrectly disable staleness
- Replace derived Serialize with custom impl delegating to Display for
  RunStatus, fixing JSON serialization (was producing null/tagged objects
  instead of flat strings)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:41:14 -04:00
Bryan Helmkamp
832c48ce5b Improve fatal error display with colored output and workflow suggestions
Show colored "error:" prefix with cause chain for all CLI errors. When a
workflow name isn't found in a project with arc.toml, list available
workflows and suggest the closest match using Levenshtein distance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:29:01 -04:00
Bryan Helmkamp
9db3af8fc6 Move pushed branch and PR URL output to end-of-run summary
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:29:01 -04:00
Bryan Helmkamp
d61d06356e Add retro setting to project config to disable retros project-wide
Users can now set `[arc] retro = false` in arc.toml instead of passing
`--no-retro` on every `arc run` invocation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:29:01 -04:00
Bryan Helmkamp
9f86d55c74 Add workflow name resolution for arc run via project config
`arc run my-workflow` now resolves to `{arc_root}/workflows/my-workflow/workflow.toml`
when an arc.toml project config exists. Args with file extensions are passed through
unchanged, and missing workflows fall back to the literal arg.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:29:00 -04:00
arc-1e68f1[bot]
234a0b340b Improve auto-PR body (#15)
* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): toolchain (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 2
Arc-Checkpoint: 498faecda2dc4e1af5ca3928309c3259b07b391f

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): preflight_compile (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 3
Arc-Checkpoint: 7a4a66e785c31d1daa85916579bb4da6e41c3ccd

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): preflight_lint (fail)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 4
Arc-Checkpoint: 2125ff48cf4bc9e134f2c8daaae10d5f21408f6b

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): fix_lints (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 5
Arc-Checkpoint: ad003c4332d4143730eee21a5176bd374ca28860

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): preflight_lint (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 6
Arc-Checkpoint: 16c2539fc7fe5c2323464ebd50d84e809492dbdc

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): implement (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 7
Arc-Checkpoint: 07d0b619eee31bddd70565815c27b96cd0a1c7ca

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): simplify (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 8
Arc-Checkpoint: 8a60dfa4af1fb6cb339dc4ef46d911b5b23a7e17

* arc(01KKA1C8TC89GDRHJ6ZP4SNQDA): verify (success)

Arc-Run: 01KKA1C8TC89GDRHJ6ZP4SNQDA
Arc-Completed: 9
Arc-Checkpoint: 85cb349c21739879c2517215b3201567a4d92ea4

---------

Co-authored-by: arc <arc@local>
2026-03-09 16:38:44 -04:00
arc-1e68f1[bot]
d432d370c0 Improve arc system prune (#14)
* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): toolchain (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 2
Arc-Checkpoint: a38cd3755e5a5ad6a406e3557665c3ea6ba06cc7

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): preflight_compile (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 3
Arc-Checkpoint: 62150d0142e04fad46092b85e5942ac1979da51b

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): preflight_lint (fail)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 4
Arc-Checkpoint: 2a213ceb22392e2dd1e00c4e66912ed57f0972af

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): fix_lints (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 5
Arc-Checkpoint: e9d720a9e2288664ebea475c4a1445532fde3ed9

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): preflight_lint (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 6
Arc-Checkpoint: 8ef9490d981389c374970e0374ef48198fb19829

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): implement (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 7
Arc-Checkpoint: 063ba4fe9554c6e0d16aaad40c4ffc7badbd0511

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): simplify (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 8
Arc-Checkpoint: 4c1319c2a2d7c818faa460413e7993c93d30750f

* arc(01KKA1A9ZHFMWM3T9VC6HBWJ19): verify (success)

Arc-Run: 01KKA1A9ZHFMWM3T9VC6HBWJ19
Arc-Completed: 9
Arc-Checkpoint: a01dd1e93b231415be85a1925f90b6fedf1844fc

---------

Co-authored-by: arc <arc@local>
2026-03-09 16:38:35 -04:00
Bryan Helmkamp
5fb3fd485e Add project config (arc.toml) with discovery and root resolution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:28:56 -04:00
Bryan Helmkamp
7cddb14fb1 Skip push when local branch is already in sync with origin
Before worktree creation, compare local and remote ref SHAs to avoid
unnecessary pushes. When already in sync, log at INFO and print nothing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:59:59 -04:00
Bryan Helmkamp
bcbd69246b Fix clippy warning: use is_none_or instead of map_or for pull_request_draft
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:37:01 -04:00
Bryan Helmkamp
8d38f57e73 Extract blocking_push_with_timeout to deduplicate triple-nested timeout+spawn_blocking pattern
The same timeout(spawn_blocking(git_push)) pattern with a 4-arm match on
Ok(Ok(Ok(()))) appeared in 3 places. Extract a helper that flattens the
triple Result into a single BlockingPushError enum, and extract shared
push error-handling into run_git_push.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:36:15 -04:00
Bryan Helmkamp
c8e8be0bad Push current branch to origin before worktree creation
When `arc run` creates a worktree, unpushed local commits would appear
in the PR diff even though they didn't originate from the workflow run.
This pushes the user's current branch before worktree setup so the
remote base matches the local HEAD.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:30:06 -04:00
arc-1e68f1[bot]
61c7541fd5 Add Draft PR Mode Support (#13)
* arc(01KK9VW7TXZQQZPHBC08935H0C): toolchain (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 2
Arc-Checkpoint: 477c304d4b72cb390186195c5357c79d0c62a9bc

* arc(01KK9VW7TXZQQZPHBC08935H0C): preflight_compile (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 3
Arc-Checkpoint: 535652db567b6a31f1a9ae2f2aef8de306c5f447

* arc(01KK9VW7TXZQQZPHBC08935H0C): preflight_lint (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 4
Arc-Checkpoint: dae88bf9dd1765d3753691c73985b21d39841c5a

* arc(01KK9VW7TXZQQZPHBC08935H0C): implement (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 5
Arc-Checkpoint: a7d72489ba62fb15a971ff209d4713aa77892064

* arc(01KK9VW7TXZQQZPHBC08935H0C): simplify (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 6
Arc-Checkpoint: 1c1e8fa045e6d116a1dbdc83ac4677d693e0a4b2

* arc(01KK9VW7TXZQQZPHBC08935H0C): verify (fail)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 7
Arc-Checkpoint: deb4e29bc1e7b5a16a25c0b65733ba65d63875ba

* arc(01KK9VW7TXZQQZPHBC08935H0C): fixup (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 8
Arc-Checkpoint: bace62da4526e4c129766324b7263bf16ca58d57

* arc(01KK9VW7TXZQQZPHBC08935H0C): verify (success)

Arc-Run: 01KK9VW7TXZQQZPHBC08935H0C
Arc-Completed: 9
Arc-Checkpoint: a2cccac34d826070d4d861e6b598e831bea7f9fd

* Default pull request draft to true

PRs are now created as drafts by default. Users can opt out with
`draft = false` in the TOML [pull_request] config.

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

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Bryan Helmkamp <bryan@brynary.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:20:45 -04:00
arc-1e68f1[bot]
6cdb91e5fa arc system df (#11)
* arc(01KK9YGJ6EBM3XKQBZC23GQ88F): toolchain (success)

Arc-Run: 01KK9YGJ6EBM3XKQBZC23GQ88F
Arc-Completed: 2
Arc-Checkpoint: cf6f964b878309dc8d79a9aeea0fa9c7bd4cff8f

* arc(01KK9YGJ6EBM3XKQBZC23GQ88F): preflight_compile (success)

Arc-Run: 01KK9YGJ6EBM3XKQBZC23GQ88F
Arc-Completed: 3
Arc-Checkpoint: ff8dba601f46c90b5b37d78804e77c42bbc4e712

* arc(01KK9YGJ6EBM3XKQBZC23GQ88F): preflight_lint (success)

Arc-Run: 01KK9YGJ6EBM3XKQBZC23GQ88F
Arc-Completed: 4
Arc-Checkpoint: 0d6b2bd079847ef5be18f8e3100ed76fc846ded3

* arc(01KK9YGJ6EBM3XKQBZC23GQ88F): implement (success)

Arc-Run: 01KK9YGJ6EBM3XKQBZC23GQ88F
Arc-Completed: 5
Arc-Checkpoint: 4bd461b413389877d773ef248ecdd798bce43471

* arc(01KK9YGJ6EBM3XKQBZC23GQ88F): simplify (success)

Arc-Run: 01KK9YGJ6EBM3XKQBZC23GQ88F
Arc-Completed: 6
Arc-Checkpoint: c8ad93c70cc29c0dd5680a75c22292ca7bac874c

* arc(01KK9YGJ6EBM3XKQBZC23GQ88F): verify (success)

Arc-Run: 01KK9YGJ6EBM3XKQBZC23GQ88F
Arc-Completed: 7
Arc-Checkpoint: efb5421ea6bd57a350ba3606b1ab20e98142d68f

---------

Co-authored-by: arc <arc@local>
Co-authored-by: Bryan Helmkamp <bryan@brynary.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:15:27 -04:00
Bryan Helmkamp
d1523ea36f Save pull request metadata to pull_request.json after PR creation
Return a PullRequestRecord struct from maybe_open_pull_request instead
of a bare URL, persist it as JSON in the run/logs directory, and strip
markdown heading prefixes (# / ##) from generated PR titles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:09:07 -04:00
Bryan Helmkamp
56c91b1d66 Add version info (semver + git SHA + build date) to arc CLI
arc --version now shows "arc 0.1.0 (abc1234 2026-03-09)" and
arc run displays a Version line in the run header.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:04:01 -04:00
Bryan Helmkamp
e2c25cbfcd Add arc pr create command to create PRs from completed runs
Allows creating a pull request after the fact for any completed workflow
run, using the persisted manifest, conclusion, and diff from the run's
log directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:55:58 -04:00
Bryan Helmkamp
4155d4e5c5 Add user-facing output for successful git push in arc run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:40:23 -04:00
Bryan Helmkamp
34000505a9 Add Run ID and Logs path to run result summary
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:36:12 -04:00
Bryan Helmkamp
704cd00375 Fix arc validate to support TOML workflow config files
Previously, `arc validate` passed .toml files directly to the DOT parser,
causing a cryptic "grammar error: Tag" parse failure. Now it resolves the
graph path from the TOML config, matching `arc run` behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:48:16 -04:00
Bryan Helmkamp
9e3b73dbe4 Move crates/ to lib/crates/ and update all references
Updated: Cargo.toml workspace members, CI workflow paths, Dockerfile
COPY, AGENTS.md, skill mapping, and doc references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:12:35 -04:00