Commit graph

259 commits

Author SHA1 Message Date
Bryan Helmkamp
b6482910e5
Remove expired startup secret migrations 2026-09-05 14:05:48 -04:00
Scott Werner
a712aa4dab Reconcile runnable runs after server restart 2026-09-04 14:15:58 -04:00
Scott Werner
ab7cbeb4ae
Merge pull request #839 from fabro-sh/codex/remove-playground
Remove unsupported workflow playground
2026-09-04 11:18:00 -04:00
Scott Werner
8c0702bfac Remove obsolete playground API route assertion 2026-09-04 10:27:18 -04:00
Scott Werner
f52f2a1edb
Merge pull request #838 from fabro-sh/codex/persist-pre-start-worker-failures
Persist pre-start worker failures
2026-09-03 12:48:39 -04:00
Scott Werner
f1b569d9e6 Remove unsupported workflow playground 2026-09-03 12:04:35 -04:00
Scott Werner
c437dc012d Simplify pre-start worker failure handling
Move the "which failures can happen before Starting" classification onto
FailureReason as an exhaustive predicate and use it for every
Runnable -> Failed transition, replacing the hand-maintained allowlist.
Give the pending-cancel precedence rule a single owner shared by the
worker launch and worker exit paths.

Test cleanups: share the Notify wait loop, server record fixture, and
post-failure assertions; simplify the pre-start test runtime's hold
flag; and parameterize the slate run.failed payload helper.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 11:45:47 -04:00
Scott Werner
c5010c0b33 Simplify the Local pull-request admission check
Use the shared clone-based provider predicate and rely on the settings
resolver dropping disabled pull-request settings instead of re-checking
the enabled flag. List the new intent-lane error code in the OpenAPI
description, trim the acceptance tests to what they actually prove, and
fold the docs note into the existing requirements sentence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 11:43:29 -04:00
Scott Werner
54666632c8 Persist pre-start worker failures 2026-09-02 17:29:41 -04:00
Scott Werner
18cb752b61 Reject automatic pull requests for Local runs 2026-09-02 17:15:52 -04:00
Scott Werner
efcf8a0d93
Merge pull request #831 from fabro-sh/codex/cli-run-intent-producer
Create CLI runs from immutable workflow intents
2026-09-02 15:45:21 -04:00
Scott Werner
13f3ff867b Simplify on-demand run projection loading
Drop the unreachable active-run mismatch guard that was copied into
load_run_projection: the active-runs map is only ever inserted under the
handle's own run ID, so the check could never fire. Remove it from the two
pre-existing sites too and delete matches_run.

Trim install_in_memory_state to take only the committed projection, since
the event envelope duplicated last_seq and the inner scope only existed to
release the lock before the now-removed shared cache update. Add a From
impl so RunDatabase::build no longer hand-builds EventProjectionCache, and
rename projected_state_locked to match its projection_snapshot sibling.

In fabro-server, have reject_if_archived and ensure_run_exists read the
run summary row instead of replaying the full event history for inactive
runs; the summary is written in the same transaction as the event.

Fold the repeated store-reopen fixtures in fabro-store and fabro-server
tests into helpers, and fix a stale comment about the deleted shared
projection cache.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 11:43:17 -04:00
Scott Werner
204dd29e73 Make CLI intent runs independent of run-tool changes 2026-09-01 16:28:58 -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
c1e9364490 Load inactive run projections on demand 2026-09-01 16:06:54 -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
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
3411199103 Index session ownership from creation events 2026-08-31 14:16:58 -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
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
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
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
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
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
Scott Werner
3e6a88625c Stabilize SQLite-backed server tests 2026-08-28 15:54:23 -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
Scott Werner
f073684227 Activate atomic SQLite run history storage 2026-08-28 15:18:25 -04:00
Scott Werner
9bd499cdbe
Merge pull request #817 from fabro-sh/codex/run-record-sql-foundation
Some checks failed
Rust / Test (Linux) (push) Has been cancelled
Rust / Test (macOS) (push) Has been cancelled
Rust / Format (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Generated Docs (push) Has been cancelled
TypeScript / Typecheck (push) Has been cancelled
TypeScript / Test (push) Has been cancelled
TypeScript / Build (push) Has been cancelled
Add inactive SQL run event storage foundation
2026-08-27 16:30:05 -04:00
Scott Werner
077d020223 Simplify automation workflow-version packaging
Share the RunIntent shape between the scheduler and the API trigger via
AutomationRunMaterialized::into_run_intent, drop the pass-through
packaging wrappers and the unreachable VersionIdMismatch error, and move
the config-path and version-ID derivations onto WorkflowVersion so the
server, validator, and collector stop re-deriving them.

The collector now owns the collected sources (moving file contents
instead of cloning them), resolves the workflow location once, and shares
the not-found probe with build_run_manifest. The bundler reads a goal
file once instead of twice.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 16:29:45 -04:00
Scott Werner
57bbb923c2 Keep the RunSummaryStore name until the SQL cutover
Revert the run summary -> run record rename. The SQLite store is still
the summary read model today; it only grows an inactive events table
here. Renaming it now made the store file show as a delete plus add and
touched nine unrelated files. The final rename happens once, when the
SQL store becomes the run authority.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 15:43:56 -04:00
Scott Werner
e86dd3bea4 Move automation runs to workflow versions 2026-08-27 15:24:07 -04:00
Bryan Helmkamp
b34f2b8207
Allow Daytona snapshots from Docker images 2026-08-27 15:02:50 -04:00
Scott Werner
ff2aef4564 Simplify SQL run record store write path and test fixtures
Share one bind helper across the runs insert/upsert/update statements,
compute the next event sequence once per append, and decode stored
sequence columns through a single helper. Check the run head before
decoding events, rewrite the first-visit stage listing as a UNION ALL so
each arm uses its partial index, and share the run_events insert SQL
with the test seeder.

Collapse the duplicated in-memory pool fixture, remove two tests that
only asserted Arc sharing, and fold the fabro-db test row helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 14:59:34 -04:00
Scott Werner
b62e458289 Add inactive SQL run storage foundation 2026-08-27 13:32:01 -04:00
Scott Werner
50fed849f3 Simplify automation run-target plumbing
- Materializer derives the manifest GitContext from RunTarget::validate()
  instead of hand-building it and re-parsing the repository slug
- Drop parse_github_repository_slug and InvalidRepositorySlug, now unused
- Store reuses Automation::git_target() instead of a private duplicate
- Legacy TOML import returns the target directly rather than a tuple
- Automation target migration updates columns with a single UPDATE ... FROM
- Web: share gitTarget(), targetFromFormValues(), and one SHA validator
  across the automation form, list, detail, new, and edit views

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 18:17:22 -04:00
Scott Werner
a65c4ff779 Migrate automations to canonical run targets 2026-08-26 17:35:36 -04:00
Scott Werner
56e759d470
Merge pull request #812 from fabro-sh/codex/git-run-target-tags
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
TypeScript / Typecheck (push) Waiting to run
TypeScript / Test (push) Waiting to run
TypeScript / Build (push) Waiting to run
Add tag support to Git run targets
2026-08-26 15:20:23 -04:00