Commit graph

1670 commits

Author SHA1 Message Date
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
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