Commit graph

693 commits

Author SHA1 Message Date
Bryan Helmkamp
dcbc104c99 fix(store): keep shared slatedb open across run handles
After the single-DB refactor, closing one SlateRunStore could close the
shared SlateDB for every run in the process. Under shared-daemon test
load that surfaced as 500 responses with \"db is closed\" on later state,
event, and delete requests.

Make run-handle close a no-op so the shared DB lifetime stays owned by
the store/process rather than individual run handles.
2026-04-05 03:22:41 -04:00
Bryan Helmkamp
2889d5b2c2 fix(tests): isolate shared-daemon scenario helpers 2026-04-05 03:18:46 -04:00
Bryan Helmkamp
6c99e54049 fix(cli): route shared-test run lookup through server 2026-04-05 03:02:16 -04:00
Bryan Helmkamp
35180b2393 refactor(store): route test helpers through server-owned runs 2026-04-05 02:53:17 -04:00
Bryan Helmkamp
8d8c3e3637 fix(test): reduce shared-daemon cli overhead 2026-04-05 00:56:08 -04:00
Bryan Helmkamp
3642858c46 Merge remote-tracking branch 'origin/main' 2026-04-05 00:20:53 -04:00
Bryan Helmkamp
bf2b6ba701 refactor(cli): route run state through the shared server daemon
Move durable run access and execution control onto the server-backed client,
canonicalize run APIs under /api/v1/runs, and switch CLI integration tests
to a shared test daemon/storage model with shared-state-safe assertions.
2026-04-05 00:15:33 -04:00
Bryan Helmkamp
65f1efd507 test(workflow): fix watchdog event assertion
The test captures Debug output from RunEvent, which renders the event body variant name rather than the canonical envelope string. Assert on StallWatchdogTimeout so the check matches the collected output.
2026-04-04 21:42:12 -04:00
Bryan Helmkamp
8a2d00591b fix(test): remove hidden HTTP client startup overhead
Disable proxy discovery for the hot test HTTP clients so nextest no longer
pays macOS system proxy lookup on repeated reqwest client creation.

Also keep the approved OAuth loopback cleanup and replace GitHub test key
generation with a checked-in PEM fixture.
2026-04-04 21:25:51 -04:00
Bryan Helmkamp
582c78096b refactor: add run store HTTP endpoints
Define the new run-store contract in the OpenAPI spec, regenerate the
Rust and TypeScript clients, and implement the matching store and
server support for run state, event access, blobs, and stage artifacts.
2026-04-04 15:37:43 -04:00
Bryan Helmkamp
aa5047c509 Merge remote-tracking branch 'origin/main' 2026-04-04 13:33:32 -04:00
Bryan Helmkamp
94467b35cb chore: fix warnings and test stability 2026-04-04 13:31:04 -04:00
Bryan Helmkamp
1f6cff8395 refactor: remove remaining event json indirection 2026-04-04 13:24:19 -04:00
Bryan Helmkamp
3c99e98903 refactor: split POST /runs into create + start, remove context endpoint
Align the HTTP API with the CLI's existing `fabro create` / `fabro start`
separation. POST /api/v1/runs now creates a run in `submitted` status
without queuing it. A new POST /api/v1/runs/{id}/start transitions to
`queued` and notifies the scheduler. Also removes the unused
/api/v1/runs/{id}/context endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 13:02:08 -04:00
Bryan Helmkamp
1189cddd25 refactor: simplify run event representation 2026-04-04 12:59:42 -04:00
Bryan Helmkamp
ee968f336e Merge remote-tracking branch 'origin/main' 2026-04-04 12:25:28 -04:00
Bryan Helmkamp
9ba093288c refactor: rename EventEmitter to Emitter
The Event prefix is redundant since the type lives in event.rs modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:24:42 -04:00
Bryan Helmkamp
54103421cb Merge remote-tracking branch 'origin/main' 2026-04-04 12:14:23 -04:00
Bryan Helmkamp
a924b0006d Resolve main merge conflicts 2026-04-04 12:14:05 -04:00
Bryan Helmkamp
a632813a20 cleanup 2026-04-04 12:08:57 -04:00
Bryan Helmkamp
e6e0f76889 refactor: remove dead code and unnecessary clones in run event types
Remove unused RunEventHeader and AssistantUsageProps structs, simplify
identity RunNoticeLevel conversion, and return references from
event_name()/properties() instead of cloning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:08:38 -04:00
Bryan Helmkamp
cba8de4d94 Refactor assets into blob-backed artifacts 2026-04-04 12:08:15 -04:00
Bryan Helmkamp
ee50eeda79 refactor: rename workflow run events 2026-04-04 11:15:32 -04:00
Bryan Helmkamp
cf304664cc refactor: remove legacy stored event compatibility 2026-04-04 10:51:15 -04:00
Bryan Helmkamp
871bc500e4 refactor: unify workflow stored event model
Add a shared StoredEvent schema in fabro-types and switch workflow,
store, CLI, and server event handling to use it directly.

This removes the writer/reader mismatch around flattened failure data,
updates affected projections and progress rendering, and refreshes the
fixture/snapshot coverage around the canonical event shape.
2026-04-04 10:38:44 -04:00
Bryan Helmkamp
988f267268 refactor: replace artifact values with run blobs
Rename durable artifact values to raw byte blobs keyed by RunBlobId,
add the blob type in fabro-types, switch SlateRunStore to write/read/list
blob APIs, and export blobs from store dumps by UUID.
2026-04-03 23:59:27 -07:00
Bryan Helmkamp
98e93d22fc refactor: remove workflow lifecycle disk checkpoints 2026-04-03 23:49:57 -07:00
Bryan Helmkamp
5c3106e608 refactor: remove legacy node file writes from workflow handlers 2026-04-03 23:12:40 -07:00
Bryan Helmkamp
d7f4eba62e refactor: remove NodeVisitRef in favor of StageId
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:07:51 -07:00
Bryan Helmkamp
b40b145424 merge: resolve conflicts from origin/main
Merged origin/main incorporating:
- db_prefix threading in SlateRunStore for run isolation
- matches_run validation in active run cache
- NodeVisitRef type in fabro-store types
- ListRunsQuery parameter for list_runs API
- HashSet dedup in catalog listing
- Updated snapshot tests for new run directory format

Preserved from feature branch:
- NodeAsset struct and exports
- StageId-based node references in run state
- make_run_dir as pub for cross-crate access
- Thread-spawn approach in handler test_default for tokio safety
- parse_run_id handles YYYYMMDD-ULID directory format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 20:46:09 -07:00
Bryan Helmkamp
e645c68be5 fix: serialize run.running with workflow lifecycle events
Move run.running emission onto the event emitter path so it cannot race
past sandbox.initialized or run.started via a direct store append. This
keeps event ordering deterministic for CLI consumers and snapshot tests.
2026-04-03 19:35:51 -07:00
Bryan Helmkamp
cd8747b340 refactor: derive durable run paths from run IDs
Move durable run metadata and path derivation onto RunId, simplify the
Slate catalog/index format, and carry the storage-specific run directory
through workflow creation so detached and lookup flows stay aligned.

Also update affected CLI snapshots and test helpers to match the new
run discovery behavior.
2026-04-03 19:15:39 -07:00
Bryan Helmkamp
f495141eae chore: fix cli lint and snapshot drift 2026-04-03 18:11:33 -07:00
Bryan Helmkamp
2d781e419b refactor: introduce StageId 2026-04-03 18:00:29 -07:00
Bryan Helmkamp
541a32f823 Narrow fabro-cli helper visibility 2026-04-03 17:47:51 -07:00
Bryan Helmkamp
b0e6117122 Derive run metadata from RunId 2026-04-03 17:46:44 -07:00
Bryan Helmkamp
efa4670d9e fix: resolve fabro-workflow nextest timeouts and regressions 2026-04-03 17:45:47 -07:00
Bryan Helmkamp
d490dbe4fa refactor: simplify run storage and retire sqlite metadata 2026-04-03 17:24:51 -07:00
Bryan Helmkamp
91d789a9f3 Use # as SlateDB key separator instead of /
File paths in node asset keys contain / (e.g. src/main.rs), which
conflicted with the / segment separator. Using # eliminates the
ambiguity — the filename is always the trailing segment after the
last #, so embedded slashes parse correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:39:24 -07:00
Bryan Helmkamp
4c4d8482e3 Rename fabro_store::RunState to RunProjection
Clarifies that this type is an event-sourced projection of run history,
distinct from fabro_core::ExecutionState which tracks live execution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:37:19 -07:00
Bryan Helmkamp
f410e2dfdd Rename fabro_core::RunState to ExecutionState
Resolves the name collision with fabro_store::RunState. The core type
represents live in-memory execution state (current node, visits, context),
while the store type is an event-sourced projection of a full run record.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:34:24 -07:00
Bryan Helmkamp
f1d5e53ba1 Remove NodeOutcomeRecord alias; embed CatalogRecord in RunSummary
NodeOutcomeRecord was a duplicate alias for Outcome<Option<StageUsage>>
which fabro-workflow already calls Outcome. Inline the type instead.

RunSummary duplicated CatalogRecord's four fields. Use #[serde(flatten)]
to embed CatalogRecord directly, eliminating the duplication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:31:44 -07:00
Bryan Helmkamp
4557ec0ff4 Merge remote-tracking branch 'origin/main' 2026-04-03 16:25:17 -07:00
Bryan Helmkamp
0e1798a69f Remove dead code, double-Arc, and back-compat shims
- Remove RunStoreHandle type alias (double-Arc); use SlateRunStore directly
- Remove RunState::list_node_ids (test-only, inline in tests)
- Remove SlateRunStore::list_assets and scan_prefix (test-only)
- Remove RuntimeState::ensure_runtime_dir/ensure_artifact_values_dir (test-only)
- Remove read_dot_source and its 4 tests (reads files no longer written)
- Remove back-compat modules transform/vars/stylesheet; update integration test
- Remove unused InvalidTransition/ParseRunStatusError re-exports
- Fix crate::vars import to crate::transforms::variable_expansion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:24:44 -07:00
Bryan Helmkamp
2338320156 refactor(run): remove vestigial run dir params 2026-04-03 16:16:53 -07:00
Bryan Helmkamp
79e48ddaea Fix clippy warnings in fabro-workflow
- run_dump: take &Path instead of PathBuf by value in path helpers
- test_support: remove empty no-op persist_run_artifacts_for_tests
- agent.rs: use u32::try_from instead of as u32 cast
- retro.rs: remove unnecessary let binding
- pull_request.rs: use NodeState::default() instead of Default::default()
- execute/tests.rs: replace bool::then in filter_map with filter+map

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 15:52:49 -07:00
Bryan Helmkamp
bb70face17 lint 2026-04-03 15:41:46 -07:00
Bryan Helmkamp
41bf15133d refactor(run): remove dead legacy cleanup paths 2026-04-03 15:40:16 -07:00
Bryan Helmkamp
e543efafb4 test(run): remove unused temp dirs 2026-04-03 15:25:12 -07:00
Bryan Helmkamp
19bbd34184 refactor(run): remove legacy checkpoint and stage dir I/O 2026-04-03 15:23:45 -07:00