Commit graph

684 commits

Author SHA1 Message Date
Bryan Helmkamp
1f6cff8395 refactor: remove remaining event json indirection 2026-04-04 13:24:19 -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
Bryan Helmkamp
ffee4688eb Remove InMemoryStore, RunSnapshot, and NodeSnapshot; use RunState directly
InMemoryStore duplicated SlateStore's interface and was unused in
production. RunSnapshot/NodeSnapshot were intermediate projections that
tests consumed — replaced with RunState to eliminate the indirection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:59:24 -07:00
Bryan Helmkamp
9595cbb6c0 Remove SandboxRecordExt trait (save/load were unused in production)
The trait just wrapped serde_json + std::fs. Tests using it were testing
serialization, not sandbox behavior — deleted those and simplified the
daytona cp test to pass the record directly to reconnect.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:58:18 -07:00
Bryan Helmkamp
2ce613204e refactor(run): unify legacy dump projections 2026-04-03 14:50:12 -07:00
Bryan Helmkamp
a4e272bb34 Restore test-used save/load methods; remove file_name(), write_run_status, Conclusion::load, save_json
The prior commit over-removed methods still needed by tests. This restores
save/load/from_context on CheckpointExt, ConclusionExt, RunRecordExt, and
RunStatusRecordExt with inlined serialization (no longer using save_json).

Removed: file_name() from RunRecordExt and StartRecordExt (zero callers),
Conclusion::load (zero callers), write_run_status (zero callers),
save_json helper (replaced by inline serialization).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:51:28 -07:00
Bryan Helmkamp
3fc3daa79d Remove dead .save() methods, write_run_status, save_json, and ConclusionExt
These disk-write methods had no production callers — all data is now
persisted via events in SlateDB. Removes save_json helper, .save() from
RunRecord/StartRecord/Checkpoint traits, the entire ConclusionExt trait,
and the write_run_status function.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:38:27 -07:00
Bryan Helmkamp
9d7d942128 refactor(run): drop workflow.toml run-dir fallback
Remove the run_dir workflow.toml snapshot and the path resolver fallback
that treated a missing workflow.toml as a sibling workflow.fabro. SlateDB
and explicit workflow inputs are now the only supported sources.
2026-04-03 11:27:32 -07:00
Bryan Helmkamp
3bee108f13 Simplify: rename internal AggregateUsageTotals to UsageAccumulator, add TODO
Eliminates confusing alias (`ApiAggregateUsageTotals`) by giving the
internal accumulator struct a distinct name. Adds a TODO for removing
the OAS 3.1→3.0 patch when progenitor gains 3.1 support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:24:36 -07:00
Bryan Helmkamp
7b18a11c40 test(run): remove legacy file absence assertions
Keep the coverage focused on current store-backed behavior instead of
asserting that old run_dir debug files are missing.
2026-04-03 11:24:30 -07:00
Bryan Helmkamp
94ed91217c refactor(run): drop debug-only node artifact files
Remove API/CLI request and log artifact writes plus panic.txt now that
run state and events are store-backed. Update the direct tests to assert
returned behavior instead of on-disk debug files.
2026-04-03 11:23:14 -07:00
Bryan Helmkamp
a65941e418 refactor(run): remove file-backed attach fallback
Require attach to use SlateDB-backed run state and events instead of
falling back to progress.jsonl, status.json, and conclusion.json.
Also remove the unused disk progress logger and keep PR body plan text
store-backed so the remaining run_dir file writes can continue shrinking.
2026-04-03 11:19:23 -07:00
Bryan Helmkamp
9752bfc37c Rename fabro-api-types to fabro-api with progenitor client generation
Replace typify-only type generation with progenitor, which generates both
Rust types (in a `types` module) and a reqwest-based HTTP client from the
OpenAPI spec. Also upgrades reqwest 0.12→0.13 and rmcp 0.15→1.3 to align
dependency versions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:17:27 -07:00
Bryan Helmkamp
fdf7323948 fix(pull-request): read plan text from run state
Stop PR body generation from depending on run_dir response.md files by
loading plan node responses from RunState instead. This keeps PR body
assembly working after removing stage response file writes and adds a
regression test covering the store-only path.
2026-04-03 11:13:40 -07:00
Bryan Helmkamp
fa7f760e86 Remove redundant run_dir file writes that duplicate event-sourced data
All data in these files is already stored in SlateDB via events and
projected into RunState. No production code reads them from disk.

Removed writes: prompt.md, response.md, stdout.log, stderr.log,
script_invocation.json, script_timing.json, parallel_results.json,
provider_used.json, retro/{prompt,response,status,session}, live.json,
detached_failure.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:04:55 -07:00