Commit graph

2582 commits

Author SHA1 Message Date
Bryan Helmkamp
b4045ffc3c Fix PR body rendering bugs found in PR #15 code review
Use 4-backtick fences for plan section to prevent LLM-generated
triple backticks from breaking the markdown. Fix singular/plural
grammar for stage, node, and edge counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:53:05 -04:00
Bryan Helmkamp
1846846e72 Apply rustfmt formatting and add missing newlines at end of files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:42:37 -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]
9e37e3781d Plan: Capture retro agent session artifacts (#16)
* arc(01KKA4QR49XGY9Q12STJ1FP5NK): toolchain (success)

Arc-Run: 01KKA4QR49XGY9Q12STJ1FP5NK
Arc-Completed: 2
Arc-Checkpoint: 0a616fa7672723af64754a893fc3ed42cacdcb50

* arc(01KKA4QR49XGY9Q12STJ1FP5NK): preflight_compile (success)

Arc-Run: 01KKA4QR49XGY9Q12STJ1FP5NK
Arc-Completed: 3
Arc-Checkpoint: fb89baa538b1c164ca6df514412aa54d33446d54

* arc(01KKA4QR49XGY9Q12STJ1FP5NK): preflight_lint (success)

Arc-Run: 01KKA4QR49XGY9Q12STJ1FP5NK
Arc-Completed: 4
Arc-Checkpoint: baa5b36b28d0a4cf775a5280530170878a92cb89

* arc(01KKA4QR49XGY9Q12STJ1FP5NK): implement (success)

Arc-Run: 01KKA4QR49XGY9Q12STJ1FP5NK
Arc-Completed: 5
Arc-Checkpoint: eda1f9e3f979c36927edc5af6babc8eecc38411c

* arc(01KKA4QR49XGY9Q12STJ1FP5NK): simplify (success)

Arc-Run: 01KKA4QR49XGY9Q12STJ1FP5NK
Arc-Completed: 6
Arc-Checkpoint: d7da8a2f8b410252de34588c7f191eb1687ed7e0

* arc(01KKA4QR49XGY9Q12STJ1FP5NK): verify (success)

Arc-Run: 01KKA4QR49XGY9Q12STJ1FP5NK
Arc-Completed: 7
Arc-Checkpoint: 96eacc9ed8f736a9879e3a71db6d590076f7c1b8

---------

Co-authored-by: arc <arc@local>
2026-03-09 17:06:21 -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
d7970fb7ce Truncate PR title and body to fit GitHub API limits
Use the first line of the goal as the PR title (not the full goal),
truncated to 120 chars. Truncate the PR body to 65,536 chars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:34:50 -04:00
Bryan Helmkamp
252453c81b Remove dead is_tracked function from git module
No longer used after resolve_file_ref stopped checking git tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:01:05 -04:00
Bryan Helmkamp
8f929a855c Deduplicate project docs by content
CLAUDE.md is often symlinked to AGENTS.md, causing identical content
to be loaded twice and wasting ~50% of the 32KB budget. Track seen
content in a HashSet and skip duplicates before the budget check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:58:20 -04:00
Bryan Helmkamp
f965467af0 Add structured logging to project doc discovery
INFO summary (files + total_bytes) on every call, WARN for
empty files, truncation, and budget exhaustion, DEBUG per-file
detail. Removes redundant debug! calls at call sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:54:26 -04:00
Bryan Helmkamp
0decfd30e7 Fix @file references to resolve regardless of git tracking status
Previously, resolve_file_ref only inlined @file references for files
not tracked by git, causing validation failures for committed workflow
prompt files like @prompts/simplify.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:52:00 -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
854c276bc8 Fix push_ref to disable credential helpers and improve logging
Disable the osxkeychain credential helper during programmatic pushes
so only inline URL credentials are used. This prevents potential
interference from stale stored credentials causing "Repository not
found" errors on private repos.

Also upgrade the log line to INFO with a redacted URL for better
diagnostics when pushes fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:35:09 -04:00
Bryan Helmkamp
31830c370a Fix relative paths broken by crates/ → lib/crates/ move
Add extra parent() traversal in build.rs, include_str!, and test
fixture paths that navigate from crate directories to the repo root.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:20:47 -04:00
Bryan Helmkamp
c2b40b4cfc Move packages/ to lib/packages/ and update all references
Updated: package.json workspaces, tsconfig path alias, CI workflow
paths, Dockerfile COPY, AGENTS.md, and doc references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:13:56 -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