Commit graph

3107 commits

Author SHA1 Message Date
Bryan Helmkamp
2025e8303d docs file cleanup 2026-03-09 14:05:18 -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
107bf743e6 Add LocalSandboxConfiguration to OpenAPI spec
The Rust SandboxConfig struct has a `local` field that was missing from
the OpenAPI spec, causing server_config_keys_match_openapi_spec to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:35:15 -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
fb8ff0914d Move experiment workflows from tmp/ to arc/workflows/
- tmp/imagegen* → arc/workflows/imagegen/
- tmp/implement-and-simplify* → arc/workflows/implement-and-simplify/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:27:36 -04:00
Bryan Helmkamp
a03e63958b Move assets/ to docs-internal/assets/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:25:18 -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
794ddc91d1 Move pipelines/ to arc/workflows/ and update doc reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:14:55 -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
Bryan Helmkamp
743786e741 Move Dockerfile, docker-compose.yaml, and entrypoint.ts into docker/
Update build context, dockerfile path, and volume mounts in
docker-compose.yaml to account for the new location.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:09:54 -04:00
Bryan Helmkamp
33e68f7c0b Move demo/ to docs-internal/demo/ and update doc references
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:08:41 -04:00
Bryan Helmkamp
77d1de9f4f Organize scripts into bin/dev, bin/ops, and bin/agent
- tools/imagegen → bin/agent/
- scripts/name-gen.ts → bin/dev/
- scripts/generate-jwt-keys.sh → bin/ops/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:07:22 -04:00
Bryan Helmkamp
8edea9383c Rename docker-compose.demo.yaml to docker-compose.yaml
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:02:59 -04:00
Bryan Helmkamp
d79a7db4cf Move CLAUDE.md to AGENTS.md with symlink for compatibility
AGENTS.md is the canonical file; CLAUDE.md symlinks to it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:02:06 -04:00
Bryan Helmkamp
a1fea52e78 Expand CLAUDE.md with build commands, architecture, and logging/events pointers
Add build/test/lint commands for Rust and TypeScript, crate descriptions,
key design patterns, and progressive-disclosure references to the logging
and events strategy docs in docs-internal/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:01:46 -04:00
Bryan Helmkamp
c61bd806c0 Push run branch to remote before PR creation for local worktree runs
Local worktree sandbox runs never pushed the arc/run/{run_id} branch to
GitHub, causing PR creation to fail with a 422 "head invalid" error.
Remote sandbox runs already push during checkpoint, so this only fires
for GitCheckpointMode::Host.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:40:08 -04:00
Bryan Helmkamp
eb63a80356 Add base commit and branch to arc run initial output
Shows "Base: main (260a391e5b4c)" after the Worktree line in the run
header, helping users identify the starting point. Uses worktree base
SHA when available, falls back to remote base SHA for remote-only runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:31:35 -04:00
Bryan Helmkamp
5f33e01f10 Fix code quality issues found in simplify review
Extract `embed_token_in_url` and `resolve_authenticated_url` helpers
into arc-github to eliminate duplicated credential resolution + URL
authentication logic across ExeSandbox, DaytonaSandbox, and engine.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:29:01 -04:00
Bryan Helmkamp
3d21b0cd40 Extract arc-github crate; ExeSandbox owns credentials directly
Move GitHub App authentication (types, JWT signing, token creation,
credential resolution) into a new leaf crate `arc-github`. ExeSandbox
now owns `github_app` directly and resolves clone credentials on-demand,
eliminating the GitCredentialSandbox decorator and its wrapping code in
cli/run.rs. GitCloneParams simplified to a single clean `url` field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:24:10 -04:00
Bryan Helmkamp
5c53657be6 Fix code quality issues found in simplify review
- WorktreeSandbox: add missing delegations for is_remote(),
  ssh_access_command(), and origin_url() to avoid silently returning
  defaults instead of delegating to inner sandbox
- GitCredentialSandbox: replace manual shell quoting with shlex::try_quote
  per project shell_quote() convention

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:03:07 -04:00
Bryan Helmkamp
0a42050ece Seal sandbox provider abstraction leaks in run.rs
Add is_remote(), ssh_access_command(), and origin_url() to the Sandbox
trait so run.rs can use trait methods instead of matching on
SandboxProvider post-construction. This removes daytona_sandbox_ref and
exe_sandbox_ref, eliminating 11 provider-checking sites that reached
through Arc<dyn Sandbox> to make provider-specific decisions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:58:06 -04:00
Bryan Helmkamp
48c0f61874 Fix code quality issues found in simplify review
- Extract `load_sandbox()` helper to deduplicate cp_command's Download/Upload arms
- Use `shlex::try_quote` in handler/command.rs shell_quote (was using less safe manual quoting)
- Call `self.resolve_path()` in ExeSandbox::upload_file_from_local instead of inlining
- Create parent dirs in download_recursive for nested files
- Use async `entry.file_type().await` instead of blocking `is_dir()` in upload_recursive
- Add missing parent directory creation in DaytonaSandbox::upload_file_from_local
- Rename `_worktree_path` to `worktree_path` (variable is used, underscore was misleading)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:44:51 -04:00
Bryan Helmkamp
fac234cef1 Update implement-and-simplify.toml to use worktree_mode config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:35:18 -04:00
Bryan Helmkamp
4f99eb435b Add [sandbox.local] worktree_mode config for local sandbox runs
Allow customizing when git worktrees are created via a new `worktree_mode`
enum (always/clean/dirty/never) in `[sandbox.local]`. Previously, worktree
creation was hardcoded to only occur on clean repos.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:25:12 -04:00
Bryan Helmkamp
e9ff7f3274 Add arc cp e2e tests and preserve worktrees for post-run access
- E2e tests for local, Docker, and Daytona sandbox backends
- Make cp::reconnect pub for integration test access
- Stop deleting worktrees after run completion so arc cp can
  access local/Docker sandbox files (prune step to come later)
- Rustfmt cleanups

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:19:31 -04:00
Bryan Helmkamp
aae1efab98 Add arc cp command for copying files to/from run sandboxes
Introduces sandbox reconnection via persisted SandboxRecord, adds
upload_file_from_local to the Sandbox trait, and migrates arc-sprites
shell quoting to shlex::try_quote.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:03:10 -04:00
Bryan Helmkamp
fc90f5988b fmt 2026-03-09 10:08:22 -04:00
Bryan Helmkamp
14a38a0145 Update docs for exe.dev maturation, assets config, pull_request CLI config, and --goal-file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 10:06:23 -04:00
Bryan Helmkamp
58e2867f19 Update changelog for 2026-03-09 with exe.dev maturation and update 2026-03-08
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 10:02:20 -04:00
Bryan Helmkamp
af668b459b Shell-quote vm_name in exe.dev cleanup command
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 10:01:18 -04:00
Bryan Helmkamp
46a110f1c0 Add CLAUDE.md instruction to use shlex::try_quote for shell quoting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:59:59 -04:00
Bryan Helmkamp
d3b7cf4a47 Close 3 exe.dev gaps: OpenAPI ExeConfig schema, preflight clone, run-branch resume
- Add `image` property to OpenAPI `ExeConfiguration` schema so the
  generated TS client gets a typed interface instead of bare `object`
- Extract `resolve_exe_clone_params()` helper and wire it into preflight
  so `--preflight --sandbox exe` tests the git clone path
- Expand `run_from_branch()` to support exe.dev: resolve sandbox provider,
  connect SSH, initialize VM, fetch+checkout the run branch, wrap with
  GitCredentialSandbox + ReadBeforeWriteSandbox, and clean up on exit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:59:08 -04:00
Bryan Helmkamp
6e1b99734e Shell-quote all script-assembled arguments with shlex::try_quote
Replace ad-hoc replace('\'', "'\\''") escaping and unquoted interpolation
with a shell_quote() helper backed by shlex::try_quote to prevent command
injection via branch names, clone URLs, image names, env vars, file paths,
and grep patterns. Covers both arc-exe (SSH transport) and arc-workflows
(Daytona sandbox).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:52:22 -04:00
Bryan Helmkamp
54de2aa651 Close 3 exe.dev gaps: ExeConfig.image, run ID tracking, preflight config
Add image field to ExeConfig so users can specify a Docker image for
exe.dev VMs via TOML config. Pass run_id to ExeSandbox for VM-to-run
correlation in sandbox_info(). Wire resolved exe config into the
preflight path for consistency with the main execution path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:28:23 -04:00
Bryan Helmkamp
740f95414a Show local time in workflow run CLI output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:57:34 -04:00
Bryan Helmkamp
381d90d8b1 Close 3 exe.dev gaps: base64 command wrapping, --ssh flag, encapsulated git clone
- Replace fragile shell escaping in exec_command with base64 encoding
  (matching Daytona's wrap_bash_command pattern)
- Add ssh_command() to ExeSandbox and wire --ssh flag support in run.rs
- Move git cloning into ExeSandbox::initialize() via GitCloneParams,
  removing clone_repo_into_exe() from run.rs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:51:44 -04:00
Bryan Helmkamp
0e73071928 Disable incremental compilation in implement-and-simplify sandbox
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:11:58 -04:00
Bryan Helmkamp
8dbbc57ce6 Disable incremental compilation in Daytona sandboxes
Ephemeral sandboxes never reuse the incremental cache, so writing it
is pure waste (~2.8 GB). Setting CARGO_INCREMENTAL=0 avoids that.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:11:22 -04:00
Bryan Helmkamp
be23369d28 Indent subagent status lines deeper than tool calls in CLI progress
Subagent lines (▸ subagent[...], ✓ subagent[...]) now render at 8-space
indent instead of 6, visually distinguishing them as children of the stage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:00:21 -04:00
Bryan Helmkamp
fc7ecde756 Add exe.dev cancellation, git cloning, and checkpointing support
- Wire up cancel_token in ExeSandbox::exec_command via tokio::select!
- Clone the local git repo into exe.dev VMs after initialization
- Add GitCredentialSandbox decorator for push credential refresh
- Enable GitCheckpointMode::Remote for exe.dev (rename daytona_* → remote_*)
- Rename setup_daytona_git → setup_remote_git (already sandbox-agnostic)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 01:54:49 -04:00
Bryan Helmkamp
e60c431a6b Fix clippy filter_next lint for Rust 1.94+
Replace `.filter(..).next_back()` with `.rfind(..)` to satisfy the
expanded `clippy::filter_next` lint on newer toolchains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 01:49:53 -04:00
Bryan Helmkamp
ac0314de2c Support [pull_request] config in cli.toml
Allow setting pull_request.enabled in ~/.arc/cli.toml so auto-PR
works when running `arc run` with a .dot file (no run.toml needed).
Cascade precedence: run.toml > cli.toml > server.toml > defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 01:35:31 -04:00
Bryan Helmkamp
bf8faf03b9 Remove preflight tests step from implement-and-simplify workflow
The cargo test preflight step is slow and unnecessary since the verify
step already runs tests after implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:28:28 -04:00
Bryan Helmkamp
dbf9a7413f Shorten token/tool labels in CLI output for brevity
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:27:57 -04:00
Bryan Helmkamp
f0ea4d2971 Fix pipe deadlock in local sandbox when child output exceeds 64KB
The old code called child.wait() before draining stdout/stderr pipes.
If the child wrote more than the OS pipe buffer, write() blocked while
the parent blocked on wait() — classic deadlock. Now we spawn concurrent
tasks to drain the pipes before waiting.

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