Commit graph

276 commits

Author SHA1 Message Date
Bryan Helmkamp
810e8b4227 Add Insights page with SQL workbench UI
SQL query editor with line numbers, saved queries sidebar, history,
SQL AI dialog, chart/table results toggle, and query stats bar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:38:25 -05:00
Bryan Helmkamp
4c75f2b67f Add script_absolute_cd lint rule to warn on absolute cd paths in scripts
Absolute `cd` paths in shell commands (script/tool_command attributes) silently
override the engine's worktree CWD, breaking portability across machines,
containers, and worktrees. Ported from kilroy (danshapiro/kilroy d9c1fec).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:20:13 -05:00
Bryan Helmkamp
24cff30518 Fix clippy warnings, test failures, and apply cargo fmt
- Fix 4 test failures: add unconditional fallback edges to branching.dot
  and conditions.dot to satisfy all_conditional_edges validation rule
- Fix clippy await_holding_lock: scope MutexGuard before await in
  daytona_integration.rs
- Fix clippy unnecessary_get_then_check: use contains_key in script.rs
- Fix clippy expect_fun_call: use unwrap_or_else in integration.rs
- Run cargo fmt across entire workspace

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:02:16 -05:00
Bryan Helmkamp
5dfc72316f Align failure classification with Kilroy reference implementation
Add 8 missing transient_infra patterns (crates.io registry, toolchain,
cross-device link errors), 2 structural hints (write_scope_violation
variants), and reorder heuristic priority to check transient_infra
before budget_exhausted to match Kilroy's classification behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:56:33 -05:00
Bryan Helmkamp
1e07fc0b09 Bump Anthropic max_tokens default and add per-node max_tokens override
Raise the Anthropic adapter fallback from 4096 to 16384 to prevent
truncation of large tool call JSON when the model isn't in the catalog.

Add max_tokens as a configurable DOT node attribute that flows through
SessionConfig to LLM requests, following the same pattern as
reasoning_effort. Priority: node attribute > catalog > provider default.

Ported from kilroy (danshapiro/kilroy) commits 99a5cd7 and 78fadad.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:54:23 -05:00
Bryan Helmkamp
a338f8a064 Add expandable check status rows and pending question text to Run cards
Replace simple CI dot indicators with rich check status data model
(CheckRun[] with per-check name, status, duration). Cards in Verify
and Merge columns show a full-width expandable status row with summary
icon and text. Clicking reveals individual check results. Pending
column cards now display the human-in-the-loop question above the
Answer Question button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:53:56 -05:00
Bryan Helmkamp
ebc1d5ea6a Expand failure classification patterns and add regression tests
Extract hint patterns into const arrays (TRANSIENT_INFRA_HINTS,
BUDGET_EXHAUSTED_HINTS, STRUCTURAL_HINTS) and add 28 new patterns
from Kilroy to prevent transient/budget failures from misclassifying
as deterministic. Add comprehensive regression test per pattern plus
count-guard tests to catch accidental additions/removals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:29:38 -05:00
Bryan Helmkamp
8aa56285f4 Rename remaining attractor references to arc
- AttractorError → ArcError across 30 source files
- .attractor/ → .arc/ for artifacts and skills paths
- ATTRACTOR_NODE_ID → ARC_NODE_ID env var
- attractor-rust → arc in Cargo.toml repository URLs
- attractor-spec.md → arc-spec.md with content updates
- Update server banner, test comments, README examples, and docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:11:24 -05:00
Bryan Helmkamp
99ad7ffe29 Extract server code into arc-api crate
Move HTTP server (Axum routes, JWT auth, serve CLI command, server
config) from arc-workflows into a dedicated arc-api crate. This
improves separation — arc-workflows is a pipeline engine library,
not a web server.

- Create crates/arc-api with server.rs, jwt_auth.rs, serve.rs,
  server_config.rs and their integration tests
- Remove server feature flag and optional deps from arc-workflows
- Update arc-cli to depend on arc-api for ServeArgs and serve_command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:51:21 -05:00
Bryan Helmkamp
771b70889b Add ServerConfig for arc.toml server configuration
Introduces server_config.rs with a TOML-based ServerConfig struct
(version + url) following the same patterns as TaskConfig.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:20:33 -05:00
Bryan Helmkamp
7f921fb82a Add drag-and-drop sortable Run cards on Runs page
Uses @dnd-kit to make cards reorderable within their column (board view)
and group (list view). Prevents accidental navigation on drag release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:16:31 -05:00
Bryan Helmkamp
3912cab183 Improve settings page with sidebar nav, section icons, and accent colors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:16:24 -05:00
Bryan Helmkamp
6d22a6c622 Rename arc-attractor crate to arc-workflows
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:05:43 -05:00
Bryan Helmkamp
4f9891427f Add hover copy button and date to session messages
Show a clipboard icon on hover below user prompts (with date)
and at the end of assistant sequences (not before tool calls).
Icon-only button, no label text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:01:56 -05:00
Bryan Helmkamp
d2234fed8f Add model label and prompt input to session pages
Show model name (e.g. Opus 4.6) right-aligned in the session
header bar. Add a pinned text input with send button at the
bottom of each session for continuing the conversation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:29:25 -05:00
Bryan Helmkamp
b5d8ad1494 Add columns/list toggle on Runs page and Settings page mockup
Runs: add a view toggle (columns vs list) with collapsible
status-grouped sections in list view.

Settings: populate with grouped panels (General, Git & VCS,
Compute, Notifications, Security) containing key/value fields
with text inputs, selects, and toggles. Hide redundant header.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:24:22 -05:00
Bryan Helmkamp
9b1bab7561 Add Arc logo icon next to heading on /start page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:13:25 -05:00
Bryan Helmkamp
e054a853dd Replace fixed starter cards with expandable category menus on /start
Three category pills (Build, Review, Fix) expand into overlay panels
with prompt options, similar to Claude.ai's starter prompt pattern.
Panel renders over the pills directly below the textarea.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:11:34 -05:00
Bryan Helmkamp
2eebb00ab1 Add Start page, session chat UI, and filtering across arc-web
- /start page with AI prompt textarea, project/branch pickers, and starter workflow cards
- /sessions/:id page with chat conversation UI (user/assistant/tool turns with progressive disclosure)
- Session sidebar with grouped history (Today, Yesterday, Previous 7 days)
- Start nav tab with sparkles icon added to app shell
- Scheduled workflows with schedule badges and pause buttons on /workflows
- Trigger filter dropdown (All/Scheduled/Manual) on /workflows
- Search bar and repository filter dropdown on /runs kanban board

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:07:19 -05:00
Bryan Helmkamp
90dc528c99 Add shadow commits for Docker and Daytona (feature parity)
- Change GitCheckpointMode::Remote to Remote(PathBuf) so both variants
  carry a repo path for MetadataStore shadow commits
- Unify init_run and shadow write logic to work with either Host or
  Remote mode, eliminating Host-only gates
- Add trailers (Arc-Run, Arc-Completed, Arc-Checkpoint) to remote
  checkpoint commits via write_file + git commit -F to avoid shell
  escaping issues with multi-line messages
- Wire up meta_branch for Daytona in run.rs (was only set for worktree)
- Fix sandbox name collisions by adding random hex suffix
- Fix pre-existing build_router() test compilation errors from JWT auth
- Add E2E tests for Host shadow branch and Daytona shadow branch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:45:48 -05:00
Bryan Helmkamp
77b7bf7481 Support unquoted bare string values in DOT parser (e.g., gpt-5.2)
Add a bare_string parser that accepts values containing hyphens and
dots like gpt-5.2-codex-spark and gemini-3-flash-preview. These are
common in kilroy DOT files for model names but were previously rejected
by arc's strict identifier parser.

All 14 kilroy DOT files now parse successfully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:09:38 -05:00
Bryan Helmkamp
6d869aa8da Add asymmetric JWT service-to-service auth between arc-web and arc-attractor
Ed25519 asymmetric JWT: arc-web signs with private key, arc-attractor verifies
with public key. Adds AuthenticatedService axum extractor to all routes, jose
dependency for TypeScript signing, and key generation script.

Startup behavior: ARC_JWT_PUBLIC_KEY set → enforce JWT auth; not set +
ARC_INSECURE_DISABLE_AUTHENTICATION=true → allow unauthenticated; neither →
refuse to start with clear error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:05:49 -05:00
Bryan Helmkamp
88f2fa245b Add kilroy DOT files and parsing compatibility tests
Copy 14 DOT workflow files from the kilroy project and add tests proving
arc can parse them. 11 files parse successfully, exercising features
including subgraphs, fan-out/fan-in, conditional routing, goal gates,
model stylesheets, and large 40+ node workflows.

3 batch test files (batch_*.dot) document a parser gap: arc requires
quoted values for strings with hyphens/dots (e.g., "gpt-5.2") while
kilroy's parser accepts them unquoted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:05:34 -05:00
Bryan Helmkamp
2a82a4e147 Change default_max_retry from 50 to 3
Aligns with the kilroy implementation of the Attractor spec. A default
of 50 retries is far too aggressive for most workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:02:30 -05:00
Bryan Helmkamp
1b26702f95 Add guardrail tests and fix config hygiene across provider system
- Add Provider::ALL constant for iterating all variants in tests
- Add catalog guardrail tests: every provider has models, provider strings
  round-trip, as_str round-trips through from_str
- Add arc-agent guardrail tests: every default_model exists in catalog,
  profile context_window matches catalog for default models
- Fix context window drift: profiles now look up catalog instead of
  hardcoding sizes, with conservative fallbacks for unknown models
- Add #[serde(deny_unknown_fields)] to config structs so typos like
  [lmm] instead of [llm] produce parse errors
- Extract DEFAULT_BASE_URL constant in OpenAI adapter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:51:31 -05:00
Bryan Helmkamp
8adbf79b12 Add 3 lint rules: all_conditional_edges, orphan_custom_outcome, condition_eval
- all_conditional_edges (ERROR): fires when a node has outgoing edges but
  all are conditional with no unconditional fallback, preventing silent
  fall-through to arbitrary edge selection.
- orphan_custom_outcome (WARNING): fires when outcome-based routing lacks
  an unconditional fallback edge, catching typos in outcome values.
- Enhanced condition_syntax rule to also validate via parse_condition(),
  catching malformed expressions that pass static checks (e.g. empty key).
- Updated integration test graph to use unconditional fallback edge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:51:15 -05:00
Bryan Helmkamp
631971d211 Return infrastructure errors as Err from ScriptHandler
Spawn failures (binary not found) and timeouts are infrastructure issues,
not domain failures. Return them as Err(AttractorError::Handler(...)) so
the engine can distinguish them from script exit-code failures and
potentially retry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:34:01 -05:00
Bryan Helmkamp
aa0be8f379 Remove brittle built_in_rules count test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:29:17 -05:00
Bryan Helmkamp
6f512c665d Fix built_in_rules count test after adding reserved keyword rule
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:28:32 -05:00
Bryan Helmkamp
cbb94ae9b2 Add Inception Labs (Mercury) provider
Register Inception Labs' Mercury diffusion LLM as a new provider using
the OpenAI-compatible adapter at api.inceptionlabs.ai. Adds mercury and
mercury-coder to the model catalog and wires up all exhaustive match
arms across arc-llm, arc-agent, and arc-attractor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:25:37 -05:00
Bryan Helmkamp
d37d2c8f49 Add run configuration and graph sub-pages under /runs/:id
Sidebar "Run Configuration" and "Workflow Graph" links now navigate to
/runs/:id/configuration and /runs/:id/graph instead of away to the
workflow detail page. Extracts CollapsibleFile into a shared component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:17:19 -05:00
Bryan Helmkamp
1245106cea Add reserved keyword node ID lint rule
Warn when DOT reserved keywords (graph, digraph, subgraph, node, edge,
strict, if) are used as node IDs since they cause silent routing failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:16:24 -05:00
Bryan Helmkamp
ea89a62768 Link Arc logo to /workflows page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:12:52 -05:00
Bryan Helmkamp
1418c976df Standardize border radius to rounded-md across all route components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:12:05 -05:00
Bryan Helmkamp
2d79362750 Unify ullm, arc-agent, arc-attractor into single arc binary
Three separate binaries are replaced by a single `arc` CLI with subcommands:
  arc llm prompt/models, arc agent, arc run, arc validate, arc serve

Extract public CLI modules (arc_llm::cli, arc_agent::cli::AgentArgs/run_with_args)
so the new arc-cli crate can dispatch to each library. Integration tests migrate
to crates/arc-cli/tests/cli.rs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:09:30 -05:00
Bryan Helmkamp
1b32e1592c Add consistent rounded-md corners to file diff containers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 17:07:26 -05:00
Bryan Helmkamp
043a5e2ef0 Add stage ID to stages URL for addressable stage navigation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 16:59:26 -05:00
Bryan Helmkamp
73d205ca13 Add collapsible headers with line counts to File components
Wrap each File in a CollapsibleFile that restores the expand/collapse
toggle and right-aligned line/loc counts. TOML defaults to collapsed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 16:53:02 -05:00
Bryan Helmkamp
615a3a2dbf Replace direct Shiki usage with @pierre/diffs File component
Use the File component from @pierre/diffs/react instead of manually
creating a Shiki highlighter instance. Register the custom DOT grammar
via attachResolvedLanguages and drop the direct shiki dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 16:49:43 -05:00
Bryan Helmkamp
664dc91bf5 Dynamically color special DOT nodes by shape in applyTheme
Add colorSpecialNodes() that injects fill/border/font colors based on
node shape (teal for Mdiamond/Msquare, amber for hexagon/diamond),
removing the need to hardcode colors in workflow DOT data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 16:45:29 -05:00
Bryan Helmkamp
854f637b60 Render stages tab as agent session with compact tool call rows
Replace stage list with single-stage agent session view showing
system prompt, assistant messages, and grouped tool calls. Tool
call/result pairs are combined into compact expandable rows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:23:53 -05:00
Bryan Helmkamp
cb98825d0b Add run detail sub-tabs: stages, usage, overview with diagram
- Add Usage tab with token/cost/runtime table per stage
- Add Stages tab with expandable event timeline per stage
- Add Overview tab with left sidebar (stages, workflow links) and
  interactive DOT diagram with zoom/pan/direction controls
- Style DOT subgraph labels and borders for dark theme
- Remove PR number and CI status from run detail header
- Add Open PR button to run detail header

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:15:05 -05:00
Bryan Helmkamp
51d58a904c Brand diff theme and reorganize run detail tabs
- Add CSS variable overrides for @pierre/diffs to match brand palette:
  navy backgrounds, mint additions, coral deletions, JetBrains Mono font
- Replace Logs tab with Overview tab as the new index route
- Move Stages to /stages sub-route
- Clean up unused imports from run-files-changed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:56:43 -05:00
Bryan Helmkamp
edf52a7c9f Add breadcrumbs, run detail tabs, and split diff view
- Add breadcrumbs to workflow detail (Workflows / title) and run detail
  (Runs / workflow / title) pages for navigation context
- Add workflow field to run data model linking runs to workflows
- Add run detail sub-route placeholders (stages, files changed, logs)
- Add split diff view on files changed tab using @pierre/diffs with
  example file diffs and wide layout
- Add shiki syntax highlighting styles and app shell wide mode support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:50:17 -05:00
Bryan Helmkamp
b2cf623007 Lighten button styles, add Run button, and widen runs page
- Restyle Create Workflow split button to lightweight border/mint style
- Add "Run" icon button to workflow detail header
- Remove max-width constraint for wide pages so runs board uses full width
- Remove unused nav items (Start, Insights)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:30:31 -05:00
Bryan Helmkamp
d980b6de12 Add collapsible code blocks and run workflow button to workflow detail
Code blocks are now expandable/collapsible with a chevron toggle, line
count, and LOC count in the header. TOML defaults collapsed, DOT
expanded. Workflow detail header gets a circular play button and
max-w-prose on the description for readability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:27:01 -05:00
Bryan Helmkamp
0f9606e9e3 Write final.patch (base_sha → HEAD) to logs_root after pipeline completes
Per-stage diff.patch files only capture incremental changes between
checkpoints. This adds a comprehensive final.patch covering all changes
from the run's base SHA to the final HEAD, written to logs_root for all
execution environments. Especially important for Daytona where the
sandbox is destroyed after the run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:15:40 -05:00
Bryan Helmkamp
9ef45204f6 Add git checkpointing for Docker and Daytona execution environments
Git checkpoint commits (stage-level snapshots, diff.patch, GitCheckpoint
events) previously only ran for Local execution. This extends support to
Docker (bind-mount uses host git, same as Local) and Daytona (runs git
commands remotely via exec_command).

- Add GitCheckpointMode enum (Host/Remote) replacing RunConfig.work_dir
- Extract git_checkpoint_host/git_diff_host helpers from inline code
- Add git_checkpoint_remote/git_diff_remote using exec_command
- Enable git_clean check for Docker alongside Local
- Add setup_daytona_git to create run branch in remote sandbox
- Switch Daytona wrap_bash_command from quote-escaping to base64 encoding
  (matches TypeScript/Python/Ruby Daytona SDKs, avoids nested quote issues)
- Add e2e tests for both Host mode and Remote mode (Daytona, live-tested)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:08:22 -05:00
Bryan Helmkamp
b218c6b280 Add syntax-highlighted DOT graph display below TOML config
Add a custom Shiki TextMate grammar for GraphViz DOT files (converted
from vscode-graphviz) and display each workflow's DOT graph source
below the TOML configuration on the definition tab.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:07:26 -05:00
Bryan Helmkamp
bc1b5d54ab Add run detail page, link run cards, and custom workflow icon colors
- Add id field to RunItem and assign IDs to all mock runs
- Create run detail page at /runs/:id with status, changes, PR, CI info
- Link run cards in both /runs kanban board and /workflows/:name/runs list
- Add per-workflow icon color with tinted border on workflow cards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 14:53:14 -05:00