Commit graph

1476 commits

Author SHA1 Message Date
Bryan Helmkamp
16bfb84b40 Simplify MetadataStore init_run API and resume graph loading
Collapse init_run/init_run_with_records/init_run_inner into a single
init_run(run_id, files) that takes all files as a flat slice. Resume
from metadata branch now uses RunRecord's embedded graph directly
when available, falling back to graph.fabro DOT parsing for old runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:30:18 -04:00
Bryan Helmkamp
2aa6476437 Remove RunSpec + Manifest types and all remaining references
Delete run_spec.rs and manifest.rs modules. Remove write_manifest()
from the engine, update DiskLifecycle and GitLifecycle to only write
StartRecord. Remove read_manifest() from MetadataStore. Update
run_fork to only handle run.json/start.json. Convert resume.rs to
use RunRecord/StartRecord from the metadata branch. Update all tests
and integration tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:23:54 -04:00
Bryan Helmkamp
b0907ff90b Add RunRecord + StartRecord alongside RunSpec + Manifest
Introduce two new persistence types aligned to the CREATE/START lifecycle:
- RunRecord (run.json): written at CREATE with merged FabroConfig, fully
  transformed Graph, and run metadata
- StartRecord (start.json): written at START with start_time, run_branch,
  and base_sha

All readers (run_lookup, inspect, diff, pr, attach, detached_support,
start, run_fork, pull_request, run_rewind, resume) now read from the
new types first. Legacy manifest.json + spec.json are still written
for backward compatibility (removal in follow-up).

Also adds dry_run, auto_approve, no_retro fields to FabroConfig, derives
Default on LlmConfig and Graph, and updates docs + tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:06:37 -04:00
Bryan Helmkamp
ddb499c319 Remove core-engine feature flag and old execution loop
Fix parity gaps (handler errors → fail outcomes, panic.txt, goal gate
message, fail-with-no-edge message, visit limit source, terminal
completion normalization) then delete ~1,250 lines of old-path code
(LoopState, run_failed_hook, mirror_graph_attributes, execute_with_retry,
run_internal) and all cfg gating.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:49:44 -04:00
Bryan Helmkamp
a02e3533e4 Clarify visit count semantics 2026-03-24 16:40:34 -04:00
Bryan Helmkamp
a452456cd9 Simplify Context: inline HashMap in fabro-core, extension trait in fabro-workflows
Remove the ContextStore trait, InMemoryStore, and Context::with_store() from
fabro-core — put the HashMap directly in Context. Replace the duplicate
fabro-workflows Context struct with a re-export of fabro_core::Context, and
move domain accessors (fidelity, run_id, preamble, thread_id) to a
WorkflowContext extension trait. Eliminate the bridge layer (WfContextStore,
bridge_context, WorkflowContextExt) entirely since there is now one Context
type. Rename clone_context() to fork() for clarity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:26:05 -04:00
Bryan Helmkamp
f3f15967e2 Add fabro-core after_record lifecycle hook 2026-03-24 16:18:49 -04:00
Bryan Helmkamp
b536564d5e Fix CLI integration test timeout by skipping upgrade check
The dry_run_writes_jsonl_and_live_json test was timing out at 4s because
the arc() helper didn't pass --no-upgrade-check, causing every test run
to await a background GitHub API call before process exit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:45:43 -04:00
Bryan Helmkamp
668b70842e Align core adapter lifecycle with final plan 2026-03-24 15:29:16 -04:00
Bryan Helmkamp
d285965596 Implement all sub-lifecycles fully per plan specification
Fill in the previously stubbed ArtifactLifecycle and GitLifecycle, and
complete FidelityLifecycle and CircuitBreakerLifecycle with their full
behavior. Wire the orchestrator with context seeding, shared state, and
all callback orderings matching the plan.

FidelityLifecycle: use resolve_fidelity/resolve_thread_id for full
resolution chains, add preamble building via build_preamble, set
thread.{tid}.current_node key, store raw Edge for proper resolution.

CircuitBreakerLifecycle: add on_edge_selected with TransientInfra guard
and restart_failure_signatures tracking for loop_restart edges.

EventLifecycle: add Skipped guard in after_node (engine.rs:2080 parity),
read GitCheckpointResult for GitCommit/GitPush events in on_checkpoint,
read artifact_store count and last_git_sha in on_run_end.

HookLifecycle: add Skipped guard in after_node, add on_checkpoint for
CheckpointSaved hook.

DiskLifecycle: add on_run_start with write_manifest + write_run_status,
use write_node_status with visit-based directory naming.

GitLifecycle: full implementation — on_run_start resets last_git_sha and
inits metadata branch; on_checkpoint does shadow commit, run branch
commit, checkpoint re-save with SHA, push, and diff.patch; on_run_end
writes final.patch.

ArtifactLifecycle: full implementation — on_run_start swaps fresh store,
before_attempt records epoch, after_attempt collects assets and emits
AssetsCaptured, after_node offloads large values and syncs to sandbox.

Orchestrator: context seeding (mirror_graph_attributes, INTERNAL_RUN_ID,
INTERNAL_WORK_DIR) with is_initial_resume gating, shared state for
checkpoint_git_result/last_git_sha/artifact_store, full callback wiring.

Promote write_manifest, write_node_status, git_diff to pub(crate).
Add Clone to RunConfig. Constructor takes Arc<RunConfig> + is_resume.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:15:46 -04:00
Bryan Helmkamp
5e6eebaff8 Decompose monolithic WorkflowLifecycle into 8 focused sub-lifecycles
Split the 564-line core_adapter/lifecycle.rs into a lifecycle/ directory
with dedicated structs for each domain concern (event, hook, fidelity,
auto_status, circuit_breaker, disk, git, artifact), orchestrated by a
WorkflowLifecycle that enforces explicit per-callback ordering.

Also fixes core adapter boundary gaps:
- Handler now uses per-call snapshot/apply context bridge and real graph
  instead of STUB_GRAPH
- Executor::run() returns (Outcome, RunState) so run_via_core can
  extract the final context instead of returning an empty one
- run_via_core populates git_state on EngineServices for handlers
- Checkpoint resume gains stage_index, next_node_id fallback, and
  node_visits reconstruction for old checkpoints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:46:10 -04:00
Bryan Helmkamp
4a7433a031 Deduplicate panic formatting, backoff construction, and stub graph allocation
- Extract format_panic_message() helper, used by both engine.rs and core_adapter
- Add RetryPolicy::DEFAULT_BACKOFF const, replacing 6 identical BackoffPolicy literals
- Cache stub graph via LazyLock to avoid per-call allocation in core_adapter handler
- Replace magic "success" string with StageStatus::Success.to_string()
- Bind graph.stall_timeout() once in run_via_core instead of calling twice

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:27:31 -04:00
Bryan Helmkamp
5822ba0260 Add explicit 7-phase pipeline module with typestate lifecycle
Introduce `fabro_workflows::pipeline` module defining typed phases:
PARSE → TRANSFORM → VALIDATE → INITIALIZE → EXECUTE → RETRO → FINALIZE.

Each phase is a standalone function with `#[non_exhaustive]` input/output
types so the compiler enforces ordering. `Validated` uses private fields
with read-only accessors to guarantee immutability post-validation.

Split `engine.run_with_lifecycle()` into `prepare_sandbox()` +
`execute_graph()` (backward-compatible wrapper preserved). Rewrite
`WorkflowBuilder::prepare_inner()` and CLI `prepare_workflow()` to use
pipeline functions. `PreparedWorkflow` now carries a `Validated` with
accessor methods instead of raw `graph`/`source` fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:02:35 -04:00
Bryan Helmkamp
ba6e256874 Remove Context logs, replace with RunNotice events + tracing
Context::append_log / logs_snapshot was a write-only audit trail that
was never surfaced — not in events, CLI output, or tracing. Errors like
"checkpoint save failed" were silently swallowed.

Replace all append_log call sites with RunNotice events (which are
automatically traced and visible in progress.jsonl / CLI). Remove the
logs field from both Context types, the Checkpoint struct, the OpenAPI
spec, and the TS client. Old checkpoints containing a logs field are
silently ignored during deserialization.

Also make git_diff return Result<String, String> with structured error
info (exit code + stderr) instead of Option<String>.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:46:08 -04:00
Bryan Helmkamp
5c33b87dce Fix core_adapter select_edge to use actual context for edge conditions
The select_edge bridge was creating an empty Context, which meant edge
conditions reading context values (e.g. context.failure_class=budget_exhausted)
would never match when using the core engine. Now snapshots the CoreContext
into a wf Context so evaluate_condition sees the real runtime state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:32:22 -04:00
Bryan Helmkamp
f7e2391535 Unify Outcome types between fabro-core and fabro-workflows
Make fabro-core's Outcome generic over a usage/metadata type parameter
(OutcomeMeta trait), allowing fabro-workflows to use core's types
directly via a type alias instead of maintaining duplicate Outcome,
StageStatus, and FailureDetail types with bidirectional conversions.

Key changes:
- Add FailureCategory enum to fabro-core (moved from fabro-workflows'
  FailureClass), with Display/FromStr/is_signature_tracked
- Add OutcomeMeta supertrait + blanket impl for the generic parameter
- Make Outcome<M>, NodeResult<M>, RunState<M>, NodeDecision<M> generic
  with default type parameter M=()
- Add Graph::Meta associated type
- Update FailureDetail with serde renames (category→"failure_class",
  signature→"failure_signature") for checkpoint backward compat
- Replace fabro-workflows' Outcome with type alias to
  fabro_core::Outcome<Option<StageUsage>>
- Add OutcomeExt extension trait for wf-specific factory methods
  (fail_classify, fail_deterministic, retry_classify, simulated, etc.)
- Delete core_adapter/outcome.rs (~170 lines of conversion functions)
- Replace FailureClass with FailureCategory throughout fabro-workflows
- Fix timeout handler to use TransientInfra category, panic handler to
  use Deterministic category

Net: -144 lines, zero-cost type unification with no runtime conversions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:24:36 -04:00
Bryan Helmkamp
c442ca62e7 Consolidate backoff/jitter into fabro-util::BackoffPolicy
Three crates independently implemented the same exponential-backoff-with-jitter
logic. Extract a single BackoffPolicy into fabro-util and have fabro-core,
fabro-workflows, and fabro-llm all use it, eliminating duplication and making
the backoff conversion in core_adapter trivial.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 05:12:48 -04:00
Bryan Helmkamp
ef37c656f0 Wire fabro-workflows to use fabro-core executor engine
Fix fabro-core semantics to match fabro-workflows (checkpoint after edge
selection, terminal callback with goal-gate result, loop restart uses edge
target with fresh context, retry-target routing for failed nodes, visit
limit >= semantics, stall token with CancellationToken, backoff jitter).

Add core_adapter module bridging fabro-workflows types to fabro-core traits:
WorkflowGraph/Node/Edge newtypes, bidirectional outcome conversion, context
bridge sharing values/logs via ContextStore, WorkflowNodeHandler with
panic/timeout protection, and full WorkflowLifecycle implementing all 8
RunLifecycle callbacks (events, hooks, fidelity, circuit breaker, checkpoints).

Add run_via_core method behind core-engine feature flag that builds and runs
the fabro-core Executor with the full adapter suite. The existing run_internal
path remains the default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:13:00 -04:00
Bryan Helmkamp
48ea05cfde Add boolean helper methods to FabroConfig and remove unnecessary clones
Add verbose_enabled(), prevent_idle_sleep_enabled(), and
upgrade_check_enabled() helpers to FabroConfig to encapsulate default
values. Update all call sites in fabro-cli to use the new helpers.
Also eliminate an unnecessary clone in SubAgentManager::run_to_completion
and use extend() instead of append()+clone() in config merging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:49:37 -04:00
Bryan Helmkamp
85094a3a4e Add fabro-core crate: generic workflow execution engine
Standalone crate with no knowledge of git, fidelity, LLMs, hooks,
sandboxes, artifacts, or disk I/O. Provides a ~55-line executor loop
with pluggable NodeHandler, Graph, and RunLifecycle traits.

Key types: CoreError, StageStatus, Outcome, Context (pluggable store),
RetryPolicy, RunState, Executor/ExecutorBuilder, StallWatchdog.

103 tests covering all milestones: foundation types, graph/handler
traits, lifecycle callbacks, executor (linear paths, terminal nodes,
goal gates, visit limits, edge selection, jumps, loop restarts,
cancellation, retry with backoff), and stall detection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:47:40 -04:00
Bryan Helmkamp
d9f9491277 Fix stale comments referencing deleted config type names
Update references to WorkflowRunConfig, ServerConfig, apply_defaults,
and deny_unknown_fields in comments and docs to reflect the FabroConfig
unification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:23:52 -04:00
Bryan Helmkamp
2aa9444d1a Unify CliConfig, ServerConfig, ProjectConfig, WorkflowRunConfig, RunDefaults into FabroConfig
Replace five config types with a single FabroConfig superset type. All
loading functions (load_cli_config, load_server_config, load_run_config,
parse_project_config) now return FabroConfig. This eliminates the
run_defaults indirection, into_run_defaults() conversion, and
apply_defaults() bridging method in favor of a single merge_overlay()
that works across all config layers (CLI → project → workflow).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:07:27 -04:00
Bryan Helmkamp
58471360a7 Merge status + cached_result into SubAgentStatus enum with data
Collapse the coupled `status` and `cached_result` fields into a single
`SubAgentStatus` enum where `Finished` carries the result, eliminating
impossible states (e.g. Completed with no cached result).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 16:19:03 -04:00
Bryan Helmkamp
67db378bd0 Remove dead selected_options field from Answer struct
The field was populated in constructors but never read by any code.
Selected keys are already carried by AnswerValue::MultiSelected(Vec<String>),
making this field redundant. Also removes the unused options parameter from
Answer::multi_selected().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 16:07:26 -04:00
Bryan Helmkamp
1b04653f32 Add SubAgentStatus enum for explicit subagent lifecycle tracking
Retain agents in the HashMap after wait/close instead of removing them,
enabling cached result retrieval, status queries, and disambiguated error
messages (never spawned vs completed vs closed vs failed).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:50:43 -04:00
Bryan Helmkamp
b461ad8d9a Add #[source] error chaining to SdkError and tool_type field to ToolCall
Preserve original error chains (reqwest, serde_json, etc.) in SdkError
via Arc<dyn Error>-backed #[source] fields on Network, RequestTimeout,
Stream, and Configuration variants. This makes production debugging of
network/TLS/DNS issues easier since error reporters can now walk the
full chain. Serde-compatible via #[serde(skip)] — message string still
carries the text for serialized forms.

Also add a `type` field to ToolCall (defaulting to "function") so
non-function tool types from providers won't be silently mishandled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:38:00 -04:00
Bryan Helmkamp
4a6b6fba08 Support "end" and "End" as exit node identifiers in graph lookup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:17:22 -04:00
Bryan Helmkamp
40ec6919d7 Attractor spec hunks 22-23: add parse_literal and quoted string support to condition parser
Add parse_literal() that strips surrounding double-quotes from condition
literal values, so `outcome="success"` and `outcome=success` behave
identically. Update the tokenizer to handle "..." as single tokens
(including spaces and escaped characters). Add BareLiteral to the
grammar comment per spec Section 10.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:16:47 -04:00
Bryan Helmkamp
588515dbf6 Attractor spec hunks 14 & 16: remove error_policy and k_of_n/quorum from parallel handler
Remove ErrorPolicy enum (continue/fail_fast/ignore) and the k_of_n/quorum
join policies from the parallel handler, leaving only wait_all and
first_success. This deletes ~180 lines of conditional logic including
FailFast early termination, the ParallelEarlyTermination event, and all
related tests and documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:59:35 -04:00
Bryan Helmkamp
b9fe1282d3 Attractor spec hunks 9-11: edge selection fallback and default_max_retries rename
- Remove any-edge fallback from select_edge() in deterministic mode; random
  mode retains it as an enhancement over the base spec
- Restrict preferred_label and suggested_next_ids matching to unconditional
  edges only (already applied in prior work, tests added here)
- Rename default_max_retry → default_max_retries across codebase (code, docs,
  fixtures, skills) and change default from 3 to 0
- Update transitions.mdx to document edge selection cascade accurately

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:20:24 -04:00
Bryan Helmkamp
c7a6467640 Replace ContextWindowWarning with generic Warning event
Introduce a reusable Warning { kind, message, details } variant in
AgentEvent so non-fatal warnings (context window usage, deprecation,
etc.) share a single event shape. The context_window warning preserves
all original fields inside the JSON details object.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:48:26 -04:00
Bryan Helmkamp
415f14a281 Filter ProcessingEnd from subagent and workflow event forwarding
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:32:31 -04:00
Bryan Helmkamp
6070eaa733 Add ProcessingEnd event and model state transitions explicitly
Introduces Session::transition() to validate and emit events on state
changes. Processing→Idle now emits ProcessingEnd (matching the spec's
PROCESSING_END). All bare state assignments go through transition().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:32:26 -04:00
Bryan Helmkamp
538560f852 Move subagent_manager from setter to Session::new() constructor parameter
Replaces set_subagent_manager() with an Option parameter on the
constructor so the dependency is explicit at creation time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:23:23 -04:00
Bryan Helmkamp
d34e8b0291 Wire SubAgentManager into Session at CLI and workflow call sites
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:18:31 -04:00
Bryan Helmkamp
c843599c8e Clean up subagents before emitting SessionEnded in Session.close()
Matches spec shutdown order: cleanup subagents → emit SESSION_END →
transition to CLOSED. Session now holds an optional SubAgentManager
reference and calls close_all() during shutdown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:18:28 -04:00
Bryan Helmkamp
2e51ae664a Add SubAgentManager::close_all() to shut down all active subagents
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:18:22 -04:00
Bryan Helmkamp
50ef927398 Map all 5xx status codes to ServerError
Expands the HTTP status code mapping from 500-504 to 500-599 so that
uncommon 5xx codes (505, 507, etc.) are correctly classified as
retryable ServerError instead of falling through to message-based
heuristics. The existing 529 (Overloaded) handling is subsumed by
the broader range.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:10:24 -04:00
Bryan Helmkamp
476f1b9d85 Make RequestTimeout non-retryable by default
Aligns with spec update: 408 timeout errors are now non-retryable
by default. Applications can opt in to timeout retries via custom
retry logic. RequestTimeout remains failover-eligible since a
different provider may not share the same timeout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:56:22 -04:00
Bryan Helmkamp
d6fd386d16 Add ReasoningEffort enum to replace raw Option<String>
Introduces a typed ReasoningEffort enum (Low, Medium, High) with
serde, Display, and FromStr support. Updates Request, GenerateParams,
and SessionConfig to use Option<ReasoningEffort> instead of
Option<String>. Aligns with spec change removing "none" as a valid
reasoning_effort value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:50:42 -04:00
Bryan Helmkamp
2fe8e5376d Fix stale AgentProfile trait signature in README
The capabilities() method was removed from the trait but the README
still listed it with an incorrect return type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:42:09 -04:00
Bryan Helmkamp
603f56072d Default max_tool_rounds_per_input and subagent max_turns to unlimited
Align with attractor spec update: both limits now default to 0
(unlimited) instead of 200 and 50 respectively. The
max_tool_rounds_per_input loop check now guards on > 0 so that 0
means no limit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:40:09 -04:00
Bryan Helmkamp
b336e4995e Remove ProfileCapabilities, rename ProviderProfile to AgentProfile, fix layer separation
Move model facts (knowledge_cutoff, context_window) to fabro-model catalog as
source of truth. Move request-shaping (auto-thinking, 1M beta headers, Gemini
safety settings) into fabro-llm adapters. Delete ProfileCapabilities struct and
all dead code (supports_reasoning, supports_streaming, supports_parallel_tool_calls,
OpenAiProfile.reasoning_effort). Fix "powered by OpenAI" mislabeling for
Kimi/ZAI/Minimax/Inception providers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:38:05 -04:00
Bryan Helmkamp
95fffac267 Flatten LanguageModel trait + ModelInfo into struct Model
Delete the single-implementor LanguageModel trait and merge its methods
into inherent impl on a renamed Model struct. Change provider field from
String to Provider enum, eliminating constant string↔enum conversions
across the codebase. Fix Provider serde attributes so OpenAi serializes
as "openai" (not "open_ai") to match catalog.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:48:55 -04:00
Bryan Helmkamp
4711a9eb48 Redesign fabro-model with LanguageModel trait, Catalog struct, and ModelRef (#121)
Introduce OOP API for the model catalog: LanguageModel trait with blanket
impl on ModelInfo, Catalog struct with typed methods (get, list,
default_for_provider, closest, build_fallback_chain, etc.), ModelRef enum
replacing ModelId, and Provider::OpenAiCompatible variant. Migrate all
callers across the workspace to use Catalog::builtin() and remove the old
free-function API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:15:40 -04:00
Bryan Helmkamp
1e39df55e9 Fix workflow slug lookup for split and resumed runs 2026-03-23 10:23:11 -04:00
Bryan Helmkamp
fea7380c16 Preserve split run metadata across restarts 2026-03-23 10:04:49 -04:00
Bryan Helmkamp
587e5488bd Fix split run lifecycle lookup 2026-03-23 08:44:46 -04:00
Bryan Helmkamp
6fa94ee36c Fix test timeouts caused by reqwest system proxy detection on macOS
reqwest::Client::new() queries macOS SCDynamicStore for system proxy
settings, which calls CFBundleGetMainBundle() → readdir() on
target/debug/deps/. With 576K stale build artifacts accumulated in
that directory, each readdir() took 1.3s, causing 15s+ delays when
multiple test processes ran concurrently.

- Disable jsonschema default features to remove unnecessary reqwest@0.13
  and rustls-platform-verifier dependencies
- Make reqwest::Client lazy in web_search tool (OnceLock) to avoid
  constructing it during profile tests
- Mark validate_api_key_rejects_invalid_key as #[ignore] since it hits
  the live Anthropic API (3.2s per invocation)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:13:50 -04:00
Bryan Helmkamp
b59c62b33e Unify fabro run foreground to use create + start + attach (#141)
## Summary

- **Unify foreground and detach code paths**: Both `fabro run` modes now
go through the same `create_run() + start_run()` pipeline, with
foreground adding `attach_run()`. Only `--preflight` remains as a
special case.
- **Fix three bugs in create→start→attach path**: (1) `_run_engine`
crashed for `.fabro` workflows by hardcoding `run.toml` — now falls back
to `graph.fabro`; (2) `attach_run` couldn't detect crashed engines due
to zombie processes — `start_run` now returns the `Child` handle; (3)
`create_run` ignored `--run-id`.
- **Configure nextest slow-timeout profiles**: Tighten unit test timeout
to 2s slow / 4s kill, add `e2e` profile with 10s/30s. Switch CI and docs
to `cargo nextest run`.

## Test plan

- [ ] `cargo nextest run --workspace` passes with new timeout profiles
- [ ] `fabro run <workflow>` works in foreground mode (create + start +
attach)
- [ ] `fabro run --detach <workflow>` prints run ID and exits
- [ ] `fabro attach <run>` works standalone (without child handle)
- [ ] `fabro resume <run>` works for both `.toml` and `.fabro` workflows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Fabro <noreply@fabro.sh>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 22:48:09 -04:00