Commit graph

4884 commits

Author SHA1 Message Date
Scott Werner
ccfd23104d Harden CLI run intent creation 2026-09-01 17:08:34 -04:00
Scott Werner
204dd29e73 Make CLI intent runs independent of run-tool changes 2026-09-01 16:28:58 -04:00
Scott Werner
694d1981ff Simplify the CLI run-intent create path
Quality pass over the intent-producer changes, no behavior changes
intended:

- Move the TOML->JSON scalar conversion into fabro-types as
  toml_scalar_to_json_value, next to its inverse, with typed errors and
  round-trip tests; the CLI now calls the shared helper.
- Reuse goal_layer_from_args for --goal/--goal-file resolution instead
  of a second copy of the exclusivity check and cwd anchoring.
- Delete the dead run_manifest_args helper and the test that kept it
  compiling; preflight_manifest_args is the remaining real builder.
- Make run_target_for_environment a pure (provider, cwd) -> target
  mapping using is_clone_based(), warning at the call site, and default
  the environment id from DEFAULT_ENVIRONMENT_ID instead of a literal.
- Resolve the parent run and retrieve the environment concurrently.
- Drop the ResolvedCommandSettings pass-through struct and the
  duplicated parse-error mapping in the project settings presence read.
- Share the environment/workflow-version/git test mocks from the cmd
  test support module instead of three per-file copies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-01 16:14:34 -04:00
Scott Werner
afe1133878 Fix CLI RunIntent producer CI failures 2026-09-01 16:14:34 -04:00
Scott Werner
2507a0075f Create CLI runs from immutable workflow intents 2026-09-01 16:14:34 -04:00
Scott Werner
d260ae89b5
Merge pull request #830 from fabro-sh/codex/sql-run-summary-queries
Move cross-run summaries and pull request recovery to SQLite
2026-09-01 15:19:55 -04:00
Scott Werner
f2a2630ad0 Simplify pull request recovery and summary store queries
- Load recovery candidates from the warm projection cache instead of
  replaying each run's full event history, and check dispatch
  eligibility before any I/O
- Extract the shared can_dispatch predicate used by both the recovery
  scan and the worker dispatch loop
- Drop load_durable_run_status, now identical to durable_run_status
- Share parse_stored_run_id across the three stored-id decode sites
- Reuse push_order for the canonical run ordering in list_all and
  list_by_statuses
- Replace the test-only queue clear accessor with the existing drain

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-01 14:11:53 -04:00
Scott Werner
1a2d8a9056 Move run queries and pull request recovery to SQLite 2026-09-01 14:06:06 -04:00
Scott Werner
563ca26b98
Merge pull request #829 from fabro-sh/codex/session-ownership-index
Index session ownership from creation events
2026-09-01 14:03:25 -04:00
Scott Werner
0fd4714da7
Merge pull request #825 from swerner/codex/automation-workflow-sources
Add independent workflow sources to automations
2026-09-01 12:22:20 -04:00
fabro-releases[bot]
285d485de7 Bump version to 0.343.0-nightly.0 2026-09-01 09:36:51 +00:00
Scott Werner
7a3f58c87e Tighten automation Git validation types 2026-08-31 18:02:08 -04:00
Scott Werner
5af791c812 Align remote workflow selectors with run targets 2026-08-31 17:13:20 -04:00
Scott Werner
16c4d671be
Merge pull request #826 from fabro-sh/codex/run-intent-producer-support
Add local RunIntent producer support
2026-08-31 15:00:28 -04:00
Scott Werner
bf05b01ba6 Simplify session owner lookup and migration preflight
- Drop the post-decode run_id/session_id/event-body checks in
  find_session_owner: decode_event_row already verifies every stored
  column against the decoded envelope, and the WHERE clause pins
  session_id and event_name to the requested values.
- Build the lookup query from SELECT_EVENT_COLUMNS like the sibling
  event queries instead of duplicating the column list.
- Carry the stored run_id text in the unparseable-id error instead of
  an "<invalid>" placeholder.
- Fetch applied migration versions once per migrate() and share the
  set between the session-owner preflight and the pre-migration
  snapshot; check the applied version first so steady-state startups
  skip the sqlite_master probe. Mark the preflight as removable with
  the run-history compatibility window.
- Restore session_by_id_key as a #[cfg(test)] helper so tests stop
  hand-rolling the legacy reverse-index key shape.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 14:59:38 -04:00
Scott Werner
3411199103 Index session ownership from creation events 2026-08-31 14:16:58 -04:00
Scott Werner
011876edd1 Harden local RunIntent target observation 2026-08-31 14:08:35 -04:00
Scott Werner
0b46e1d735 Simplify local RunIntent producer support
Share canonicalize_location and resolve_existing_workflow_location
between the local package resolver and the version collector, drop the
redundant package-root pre-check and the PackageFileReadError enum in
favor of anyhow context, and read HEAD's SHA from git2 instead of a
separate rev-parse subprocess.

Make GitRunTargetObservation a plain struct, replace the repo-info
tuple with a named struct, tighten the closure view trait, avoid
deep-cloning the root workflow during collected validation, remove the
unused into_closure accessor, and dedupe test helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 14:08:35 -04:00
Scott Werner
52ff7b2ef2 Add local RunIntent producer support 2026-08-31 14:08:35 -04:00
Scott Werner
b4165a3b4e Update workflow source migration test version 2026-08-31 13:55:02 -04:00
Scott Werner
b7d32b9e83 Renumber automation workflow source migration 2026-08-31 13:51:07 -04:00
Scott Werner
39c018c430 Harden automation workflow source handling 2026-08-31 13:45:08 -04:00
Scott Werner
b61d309aa3
Merge pull request #827 from fabro-sh/codex/run-intent-registration-spine
Add RunIntent registration support
2026-08-31 13:44:08 -04:00
Scott Werner
7514e676e0 Prove workflow version registration order 2026-08-31 13:24:25 -04:00
Scott Werner
05fb173767
Merge pull request #823 from fabro-sh/codex/sqlite-run-history-activation
Activate atomic SQLite run history storage
2026-08-31 12:53:11 -04:00
Scott Werner
c68e67c841 Harden SQLite activation and run history consistency 2026-08-31 12:19:16 -04:00
Scott Werner
637d6a0d84 Simplify workflow version registration client and tests
Move the content-derived id check into create_workflow_version so every
caller gets it, drop the redundant expected_id parameter from
register_workflow_versions, and collapse the duplicated httpmock setups
and ordering machinery in the client tests. Use in-scope imports and the
neighbouring reader idiom in the server intent tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 10:20:58 -04:00
fabro-releases[bot]
3a5c683fbf Bump version to 0.342.0-nightly.0 2026-08-31 09:41:11 +00:00
Scott Werner
305381e2c2 Simplify automation workflow-source materialization
Collapse the role-paired materializer error variants into
`Credentials`/`Checkout` tagged with a `CheckoutRole`, route both
checkouts through one resolve-then-prepare helper, and replace the
test-only clone-URL field on the production materializer with a
`GitRemote` resolver seam. A workflow source in the target's repository
now reuses the already-resolved credentials instead of minting a second
token.

Also inline the one-line workflow-source normalizer, drop the `as_str`
wrapper on the new kind enum, remove the unused migration constant, move
rather than clone scheduler fields, and deduplicate the web form's
ref-validity rule and per-kind copy into a single table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 13:17:15 -04:00
Scott Werner
03f81d1f25 Add independent workflow sources to automations 2026-08-30 13:14:11 -04:00
Scott Werner
dbe2e7564e
Merge pull request #828 from fabro-sh/codex/automation-environment-selector
Add environment selector to automations
2026-08-30 12:58:33 -04:00
Scott Werner
ed2da065ec Drop unused CREATABLE_PROVIDERS import from the environment form
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 12:36:30 -04:00
Scott Werner
7c261f2ae6 Move environment provider helpers into a lib module
Importing them from the environment form component pulled headlessui
Disclosure into the automation form, which the automations-new test mocks
without it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 12:30:58 -04:00
Scott Werner
88dae80c6d Consolidate automation environment helpers and trim redundant work
- Share the clone-based provider predicate and provider label between the
  automation form and environment settings instead of duplicating them
- Hoist repeated environments query state in the new-automation route
- Normalize empty environment ids to None so validation needs one check
- Merge the scheduler's record/clear error helpers and skip the clearing
  write when no error is stored
- Guard the environment backfill with a cheap existence query
- Drop an unneeded id clone and a no-op migrator comment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 12:25:16 -04:00
Scott Werner
e87130ae23 Require a server-managed environment for automations
Automations now store an environment_id that must reference an enabled
Docker or Daytona environment. Each trigger fire resolves the current
environment definition and snapshots its settings into the run, and
deleting an environment still referenced by an automation is rejected
with a conflict.

Existing automations are backfilled conservatively: a compatible
environment named default is selected when present, otherwise the sole
compatible environment. Anything ambiguous is left incomplete and cannot
run until an operator selects an environment in the web UI.

Scheduler failures are recorded on the automation as last_error and
cleared after the next successful scheduled run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 09:58:13 -04:00
Scott Werner
1a1c5ab29d Add RunIntent registration support 2026-08-28 20:40:38 -04:00
Scott Werner
0574c818cf Share activation backup helpers and trim run-history residue
Hoist the SQLite backup/integrity helpers duplicated between the blob and
run-history activation migrations into one shared module, drop the
write-only recent-events buffer and other dead state left behind by the
SQLite cutover, reuse existing helpers for projection bootstrap, sequence
allocation, catalog keys, and test pool construction, and collapse the
tombstone and activation-marker plumbing to single statements.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 17:20:05 -04:00
fabro-releases[bot]
775b62b500 Bump version to 0.339.0-nightly.1 2026-08-28 20:41:40 +00:00
Bryan Helmkamp
9dd47a8cd3
Merge pull request #819 from fabro-sh/codex/daytona-image-snapshots
Allow Daytona snapshots from Docker images
2026-08-28 16:24:55 -04:00
Bryan Helmkamp
5ebf3ebd35
Model the Daytona snapshot source as an enum
`DaytonaSnapshotSettings` carried two independent `Option`s (`image` and
`dockerfile`) that every consumer had to re-validate. Replace them with a
single `source: DaytonaSnapshotSource { Image, Dockerfile }` so the
both-set and neither-set states are unrepresentable at the sandbox layer.
This removes four unreachable error arms in `canonical_manifest` and
`create_snapshot_params`, the `.filter(...)` guard in `initialize`, and
the presence guard in `daytona_config_from_environment`. The
mutual-exclusion rule now lives only in fabro-config, which owns the
`image.docker` / `image.dockerfile` keys the old messages named.

Merge `ImageSnapshotManifest` into `SnapshotManifest` via a flattened
`SourceManifest` enum. The dockerfile case serializes to the same bytes
as before, so existing snapshot names are unchanged; the pinned identity
test still passes. Pin the image-case identity as well so a future
manifest change cannot silently orphan image snapshots.

Fold `validate_daytona_image_settings` into the existing Daytona arm of
`validate_provider_capabilities`; both callers already invoke it right
after `resolve_environment_fields`, so error order is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 16:19:56 -04:00
Scott Werner
3e6a88625c Stabilize SQLite-backed server tests 2026-08-28 15:54:23 -04:00
Bryan Helmkamp
ccca32ea42
Merge pull request #815 from fabro-sh/code-review-calibration
Install the code-review workflow and first repository review rules
2026-08-28 15:51:01 -04:00
Bryan Helmkamp
85a0b70c98
Merge pull request #822 from fabro-sh/fix-nested-blob-resolution
Hydrate nested structured blob references
2026-08-28 15:47:46 -04:00
Scott Werner
aa9c468d3e Wait for SQLite writer lock when deleting runs 2026-08-28 15:46:13 -04:00
Scott Werner
5cd69e9c66
Merge pull request #820 from fabro-sh/codex/automation-run-intent
Move automation runs to workflow versions and RunIntent
2026-08-28 15:43:31 -04:00
Bryan Helmkamp
15a1188bb9
Keep engine fix in separate pull request 2026-08-28 15:32:01 -04:00
Bryan Helmkamp
a125596681
Resolve nested blobs concurrently 2026-08-28 15:31:21 -04:00
Scott Werner
f073684227 Activate atomic SQLite run history storage 2026-08-28 15:18:25 -04:00
Bryan Helmkamp
5485bb1e93
Hydrate nested structured blob references 2026-08-28 15:15:39 -04:00
Bryan Helmkamp
c2ac1a8500
Fix large parallel review inputs 2026-08-28 15:07:39 -04:00