Commit graph

4557 commits

Author SHA1 Message Date
Scott Werner
ee4068f0ed Refresh Cargo.lock for the 0.324.0-nightly.0 workspace bump
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:51 -04:00
Scott Werner
bff790cfde Remove unused WorkflowPath::parent and is_ancestor_of
Neither method has callers anywhere in the workspace: resolve_reference
splits on '/' directly, and the path-collision validator now checks
ancestor prefixes against a path set. parent() also constructed Self
without going through validate(), so dropping it removes an unvalidated
construction path from the wire type's public API.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
fa05b3df5e Prove workflow-version ID JSON parity with the OpenAPI schema
The round-trip fixtures only used empty workflow_dependencies, so no
WorkflowVersionId value ever appeared on the wire in a fabro-api
assertion and CreateWorkflowVersionResponse had no coverage at all.
Put a real 64-hex id in the fixture, round-trip the response type, and
pin serialization to the schema's ^[0-9a-f]{64}$ pattern including
lowercase normalization of case-insensitive input.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
3be98210d9 Parse workflow version IDs case-insensitively
WorkflowVersionId bolted a lowercase-only byte scan onto BlobHash
parsing, giving the same 64-hex concept two parse behaviors across
entry points. Identity is the decoded 32-byte digest and canonical
serialization always emits lowercase, so accepting either case on
input is lossless — the stored-blob canonicality check still rejects
non-canonical bytes independently. Delegate straight to BlobHash.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
24f99d4bd6 Serialize workflow-version canonical bytes once at construction
WorkflowVersion::new serialized the whole version just to enforce the
size limit and threw the bytes away, the store re-serialized them to
write the blob, and every read re-serialized a third time for the
canonicality comparison. Cache the canonical bytes on the struct at
construction (skipped during serde) and expose them as an infallible
borrow; the now-unconstructable InvalidShape store error variant goes
away with it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
943f61c06c Return 422 for invalid workflow-version dependencies
DependencyInvalid fell through to the curated 500 even though the
OpenAPI contract promises 422 workflow_version_dependency_not_found for
an absent, invalid, or non-canonical dependency. Route it to that
response alongside DependencyNotFound; the top-level message only names
the caller-supplied path and id, so no internal chain leaks. Drop the
InvalidVersion/InvalidShape arms, which were unreachable from the only
call site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
b02c3a8250 Detect workflow path collisions hidden by sort order
The adjacent-pair scan over the byte-sorted path list missed
file/directory collisions whenever a sibling path sorted between the
ancestor and its descendant (any byte below '/' after the shared
prefix, e.g. "assets.txt" between "assets" and "assets/item.txt").
Replace it with an exhaustive ancestor-prefix lookup over a path set,
which also catches equal paths across files and workflow dependencies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
116051992c Harden workflow version validation 2026-08-13 13:46:10 -04:00
Scott Werner
6b28787f00 Rename the workflow version dependencies field to workflow_dependencies
The field's shape (WorkflowPath -> WorkflowVersionId) can only ever
hold pinned child workflow versions, so the generic name was squatting
on a word a future non-workflow dependency kind (a pinned model, tool,
or data snapshot) would want. Since the field name is part of the
canonical bytes that version IDs hash, this rename is only possible
before the first version is stored — claim the specific name now.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
ffca5c3424 Rename SettingsLayer::image_layers to environment_images
The method iterates EnvironmentImageLayer configs, but out of context
"image layers" reads as Docker image layers — a bad collision in
exactly the domain where it appears. Name it for what it yields.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
c921994393 Scope-guard the node-only reference attributes
import and stack.child_workflow are node attributes — the import
transform and manager loop only read them from nodes — but the
reference classifier matched them at any scope, unlike goal and prompt
which already carry scope guards. That meant template expansion treated
a graph- or edge-level attribute with one of those names as a live
static reference (hard error on template syntax) even though nothing
reads it there. Guard both arms to node scope so classification matches
what the engine actually consumes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
061a94ab66 Drop the stack.child_dotfile alias from the reference vocabulary
stack.child_dotfile was the original attractor-spec name for the
manager-loop child workflow path, later renamed to stack.child_workflow
with the old name kept as a backward-compatible alias. The alias was
deliberately removed in #281 (engine, manifest fallback, and docs), but
reference_kind_for_attribute — introduced the same day in #290 — was
written with the alias baked in, resurrecting it in the shared
vocabulary.

The engine only reads stack.child_workflow, so a graph using the alias
silently does nothing at runtime while validation treats it as live:
workflow-version validation would demand a dependency pin for a child
that never spawns, and the manifest bundler would bundle its target.
Finish what #281 started and drop the alias.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
a49478c1e7 Unify the workflow graph reference walkers
The manifest bundler and workflow-version validation each maintained
their own walk over the graph reference vocabulary (goal files, inline
goal/prompt templates, imports, child workflows, @-file attributes), so
a new reference-bearing attribute had to be added twice or the two
would drift. Add fabro_template::visit_graph_references as the single
per-graph walker — it validates that file references are template-free
and emits typed events — and rewrite both consumers on top of it,
keeping their own IO, resolution, and recursion.

Same for dockerfiles: SettingsLayer::image_layers[_mut] is now the one
definition of where images live in a settings layer, replacing the
three hand-rolled traversals in the run compiler, manifest bundler, and
workflow-version validation.

Behavior note: the manifest bundler now also follows
stack.child_dotfile (already in the shared vocabulary and treated as a
child-workflow reference by workflow-version validation); nothing in
the engine emits or reads that attribute today.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
7bf40373f9 Split workflow version wire type from semantic validation
Move the WorkflowVersion wire type and its structural invariants (file
count and size limits, entrypoint presence, unique keys, path
collisions, canonical form) into fabro-types, so fabro-api replaces the
generated schema type without pulling graph parsing or the template
engine into every API consumer. The wire shape is unchanged.

fabro-workflow-version keeps the expensive graph/config/template
validation behind a ValidatedWorkflowVersion newtype and now owns
WorkflowVersionStore: put only accepts validated versions and get still
re-validates blobs read from shared storage. fabro-store goes back to
being domain-agnostic persistence.

Move the static-reference attribute vocabulary (ReferenceKind,
AttributeScope, reference_kind_for_attribute) to fabro_types::graph and
template-syntax validation to fabro-template, so fabro-graphviz no
longer depends on the template engine.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
f1ddf7a26d Simplify workflow version validation and supporting types
- Validate WorkflowVersion structure once at construction so
  canonical_bytes only serializes and enforces the size limit
- Collapse the three pairwise path-collision loops into one over the
  combined file and dependency keys
- Make WorkflowPath::is_ancestor_of allocation-free and remove unused
  resolve_from_root and error accessors
- Parse WorkflowVersionId via serde into/try_from, delegating length and
  charset checks to RunBlobId
- Derive ReferenceKind's Display with strum instead of a hand-written
  match
- Drop the fabro-workflow static_reference re-export shim; consumers
  import from fabro-graphviz directly
- Collapse duplicate JSON-rejection arms in the workflow-versions
  handler

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:46:10 -04:00
Scott Werner
88a3d8ce75 Add immutable workflow version resource 2026-08-13 13:46:10 -04:00
fabro-releases[bot]
d5b3da87fc Bump version to 0.324.0-nightly.0 2026-08-13 09:41:35 +00:00
Scott Werner
3226d845bc
Merge pull request #726 from fabro-sh/codex/extract-working-tree-collector
Some checks are pending
Rust / Format (push) Waiting to run
Rust / Clippy (push) Waiting to run
Rust / Generated Docs (push) Waiting to run
Rust / Test (Linux) (push) Waiting to run
Rust / Test (macOS) (push) Waiting to run
Extract workflow bundling from manifest assembly
2026-08-12 14:01:31 -04:00
Scott Werner
04f45b7c6b Restore lexical root path normalization and simplify bundler internals
Route the root workflow through collect_workflow_entry so relative root
arguments are lexically normalized before reading, matching the pre-refactor
behavior: `..` segments no longer resolve through symlinks to a file other
than the one the manifest key names, and `~`-prefixed references are
rejected again. Adds a symlink regression test for the root argument.

Also:
- collect_workflow_entry/collect_workflow_location return the manifest key,
  so bundle() no longer recomputes the root key
- hold one FilesystemTemplateStore on the bundler instead of rebuilding it
  per template reference
- drop the unused Clone derive on WorkflowScanInput
- replace the hand-rolled JSON literal in the characterization test with an
  insta snapshot per the testing strategy
- share one write_file fixture helper between the lib and bundler test
  modules
- remove the bundler git-push test; the bundler has no git code path, so the
  test could not fail

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 13:44:18 -04:00
Scott Werner
4383ce408d
Merge pull request #743 from fabro-sh/codex/rename-blob-hash
Rename RunBlobId to BlobHash
2026-08-12 12:29:48 -04:00
Scott Werner
62ed7cb8a2 Rename RunBlobId to BlobHash 2026-08-12 11:33:41 -04:00
Scott Werner
0a40061783
Merge pull request #741 from fabro-sh/codex/share-global-blob-store
Share one blob store across run handles
2026-08-12 11:32:32 -04:00
Scott Werner
2ee6109006 Warn on malformed blob keys and drop structural sharing test
Skipping a malformed key under blobs/sha256 during listing now emits a
warn! so operators get a signal when the CAS namespace contains garbage,
matching the projection-cache warmup skip path. Also removes the
runs_share_database_blob_store test, which asserted Arc pointer identity
of internal wiring rather than any observable behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 11:26:35 -04:00
Scott Werner
f773a24758 Simplify run handle construction and blob store test fixtures
- Collapse RunDatabase::open_writer/open_reader wrappers into one
  pub(crate) build, with a Database::open_run_database helper that
  gathers the shared-store dependencies in one place
- Stop fetching the blob store on open_run's active-cache hit path
- Share a raw-db test fixture between the two BlobStore raw-key tests
- Evict the cached writer in open_run_reader_is_read_only so the test
  exercises the real reader construction path

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:51:19 -04:00
Scott Werner
10499e707c Share one blob store across run handles 2026-08-10 15:32:47 -04:00
Scott Werner
996c7ade80 Retry code analysis 2026-08-07 08:48:10 -04:00
Scott Werner
7971c80fd4 Retry code analysis 2026-08-06 16:44:48 -04:00
Scott Werner
227e520400 Simplify workflow bundling extraction 2026-08-06 16:21:10 -04:00
Scott Werner
17bc48acf1 Merge remote-tracking branch 'origin/main' into codex/extract-working-tree-collector 2026-08-06 16:01:24 -04:00
fabro-releases[bot]
0abf2297c0 Bump version to 0.316.0-nightly.0
Some checks failed
Rust / Format (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Generated Docs (push) Has been cancelled
Rust / Test (Linux) (push) Has been cancelled
Rust / Test (macOS) (push) Has been cancelled
2026-08-05 10:08:51 +00:00
Scott Werner
8c95011fbf Rename bundler intermediates as records 2026-08-04 15:49:48 -04:00
Scott Werner
2ff54bfc1b Model bundle collection as workflow bundler 2026-08-04 15:41:50 -04:00
Bryan Helmkamp
751824b9f2
Merge pull request #715 from fabro-sh/feat/async-pr-create
Some checks failed
Rust / Format (push) Waiting to run
Rust / Clippy (push) Waiting to run
Rust / Generated Docs (push) Waiting to run
Rust / Test (Linux) (push) Waiting to run
Rust / Test (macOS) (push) Waiting to run
TypeScript / Typecheck (push) Has been cancelled
TypeScript / Test (push) Has been cancelled
TypeScript / Build (push) Has been cancelled
Make pull request creation durable and asynchronous
2026-08-04 15:10:03 -04:00
Bryan Helmkamp
6dfe1c49d2
Merge remote-tracking branch 'origin/main' into feat/async-pr-create
# Conflicts:
#	lib/foundation/fabro-api/src/lib.rs
#	lib/foundation/fabro-client/src/client.rs
2026-08-04 15:04:24 -04:00
Bryan Helmkamp
646d7e8a29
Merge pull request #721 from fabro-sh/fix/interrupt-steering-task-reminder
Keep task reminders transactional across interrupts
2026-08-04 14:59:19 -04:00
Scott Werner
afd06bf560 Rename collector to workflow bundle 2026-08-04 14:54:56 -04:00
Bryan Helmkamp
5c6289df80
Simplify async pull request creation
Structural cleanup of the durable pull request creation feature, from a
three-agent review (reuse, quality, efficiency) of the branch:

- Move the supervisor out of handler/ into server/pull_request_supervisor.rs,
  collapse its double bookkeeping into one task-id map, and fold the five
  copy-pasted failure arms into attempt_pull_request_creation.
- Tag pull_request.failed events with the creation id they resolve, so a
  publish-stage failure can never fail an unrelated explicit creation. The
  reducer gains PullRequestCreation::succeed/fail transition methods.
- Scan pending creations through a narrow projection-cache accessor instead
  of materializing every run summary, raise the scan interval to 30s (notify
  covers the live path), and cap retries for runs whose worker cannot even
  record a failure.
- Answer "creation already pending" POSTs before taking the per-run create
  lock, which a worker can hold for the whole creation.
- Replace the hand-rolled per-run lock map with fabro_store::KeyedMutex.
- Reuse cheap Arc'd projections (cached_run_projection) on the poll endpoint
  and in the worker instead of deep-cloning run summaries and diffs.
- Merge ExistingPullRequest into fabro_github::CreatedPullRequest and
  extract one reconcile_existing_pull_request helper for both call sites.
- Give the client poll loop a 15-minute deadline; document that Retry-After
  and the poll interval are the same constant.
- Resolve a wedged pending creation (run already has a pull request) as a
  durable failure instead of skipping it forever.
- Tests: shared wait_for_pull_request_creation helper, a pinned generation-
  failure assertion, and a new pipeline test proving reconciliation adopts
  an existing PR without an LLM call or create request.

Verified: cargo build --workspace, cargo nextest run --workspace (7,767
passed), nightly clippy -D warnings, fmt --check, insta (no pending), bun
typecheck in fabro-api-client.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 14:51:29 -04:00
Scott Werner
0e703a7770 Simplify working-tree collector and manifest assembly
Apply cleanup review findings on the collector extraction:

- Deduplicate the lexical path-normalization loop: normalize_absolute_path
  now delegates to lexically_normalize_access_path, and it plus
  manifest_path_from_absolute live in working_tree.rs so the module
  dependency points one way (projection -> collector). Drop the redundant
  re-normalization in collect_bundled_file.
- Extract collect_bundled_template_includes to replace the copy-pasted
  goal/prompt template-closure sequence, seed_config_document for the
  duplicated config seeding, and read_source_input for the duplicated
  config reader closures (with the user-settings is_file check hoisted).
- Replace ~100 lines of trivial getters on the Collected* output structs
  with pub(super) fields; keep the CollectedPath newtype encapsulated.
- Assemble the manifest by value, moving collected sources into the wire
  types instead of deep-copying every file a second time; drop two full
  DraftDocument clones that only satisfied the borrow checker; stop
  recomputing manifest paths per file in template-dependency verification.
- Resolve the root workflow once in assemble_current_manifest, removing an
  unreachable duplicate error path; flatten single-use CollectionNamespace
  into a finalize_documents free function.

No behavior change; fabro-manifest tests, clippy, and fmt pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 14:45:28 -04:00
Bryan Helmkamp
9c152ccddf
refactor(agent): simplify task reminder staging and test fixtures
Stage the pending task reminder as a Message and add
Message::to_llm_message so durable history and the round-staged turn
share one turn-to-wire conversion. Replace the one-off
BlockingAfterFirstOutputProvider with request capture and an
EventsThenPending variant on ScriptedStreamProvider, add a shared
make_session_with_provider_and_tools helper, and assert the reminder
tests against task_reminder::TASK_REMINDER_TEXT instead of a
substring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 14:20:32 -04:00
Bryan Helmkamp
120f0fa80b
Merge pull request #725 from fabro-sh/codex/fireworks-kimi-k3-fast
Add Fireworks Kimi K3 and Kimi K3 Fast support
2026-08-04 14:03:23 -04:00
Scott Werner
9f13611e83 Extract working-tree collection from manifest assembly 2026-08-04 13:59:48 -04:00
Bryan Helmkamp
4dddbcee75
Merge pull request #720 from fabro-sh/codex/add-qwen3-8-max-openrouter
Add Qwen3.8 Max to OpenRouter
2026-08-04 13:56:58 -04:00
Bryan Helmkamp
2b29dddb33
feat(models): add Fireworks Kimi K3 Fast 2026-08-04 13:55:48 -04:00
Bryan Helmkamp
5ed32c1d20
Merge pull request #724 from zaibon/fix/doctor-health-timeout
fix(cli): raise doctor health check timeout to 1s
2026-08-04 11:59:42 -04:00
Bryan Helmkamp
6ce418a415
Merge pull request #723 from fabro-sh/remove-pre-run-push-outcome
Remove the recorded pre-run push outcome while preserving the push
2026-08-04 11:45:32 -04:00
Christophe de Carvalho
8b25001985 fix(cli): raise doctor health check timeout to 1s
250ms was too aggressive: a server that was reachable but slightly slow
to answer /health made `fabro doctor` report a failed health check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 16:43:42 +01:00
fabro-releases[bot]
f5ed1bd0c9 Bump version to 0.315.0-nightly.0 2026-08-04 10:11:51 +00:00
Bryan Helmkamp
6760172879
Merge pull request #722 from fabro-sh/codex/move-input-scalar-coercion
Move input scalar coercion to shared types
2026-08-03 21:59:16 -04:00
Scott Werner
5305dca6c2 Regenerate TypeScript client without push outcome models
Regenerates the Axios client from the reduced OpenAPI spec and removes
the six stale pre-run-push-outcome model files the generator leaves
behind, along with their barrel and generator-manifest entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 19:27:33 -04:00
Scott Werner
3d77d371c6 Remove the recorded pre-run push outcome, keep the push
The manifest builder's best-effort pre-run push converted every result
into a PreRunPushOutcome that was serialized into GitContext, expanded
into five OpenAPI union arms, and generated into API clients — but no
production path ever read it; every field read was a test.

Delete the concept while preserving the behavior:

- Drop the PreRunPushOutcome enum and GitContext.push_outcome from
  fabro-types; GitContext keeps origin_url, branch, optional sha, and
  dirty, which remain real execution inputs and provenance.
- Rename the manifest outcome builder to push_manifest_branch_best_effort,
  a side-effect-only helper with the same decision rules: skip without an
  origin, skip on configured-repository mismatch, skip when the branch is
  already synced, otherwise push noninteractively and discard the result
  without failing manifest creation or logging raw Git stderr.
- Prove the push through repository state instead of the deleted enum: a
  branch ahead of a local bare origin is pushed during manifest build, a
  mismatched configured repository is not, and a failing remote helper
  still cannot fail manifest creation.
- Remove push_outcome from GitContext in OpenAPI, delete the five-arm
  union schemas, and drop the fabro-api type replacement and re-export.
- Keep one regression proving historical run.created events with a nested
  push_outcome still deserialize through ordinary unknown-field tolerance
  and reserialize to the reduced shape. No migration or event rewrite.

Old JSON carrying the removed field stays readable. Newly generated
clients omit a field older servers required, so new-client-to-old-server
compatibility is intentionally not promised for this pre-1.0 contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 19:27:33 -04:00