31 KiB
| title | type | status | date |
|---|---|---|---|
| refactor: make git metadata sandbox-native and clarify run paths | refactor | active | 2026-04-27 |
refactor: make git metadata sandbox-native and clarify run paths
For the engineer picking this up
Fabro currently mixes three different path concepts under names that imply they are interchangeable:
- The submitter/client path used to resolve workflow source.
- The sandbox execution path.
- A repo path the Fabro server process can open with
git2.
That assumption is false for Docker and Daytona. Docker and Daytona clone into sandbox-owned workspaces, commonly /workspace, while the submitted source path may be something like /Users/... from a CLI client and may not exist on the Fabro server host. This causes metadata checkpoint writes to try to open a client path from the server process.
Greenfield app. No production deploys. Do not add compatibility shims, serde aliases, migration layers, or legacy fallback behavior. Prefer clear renames and direct deletion of stale concepts.
The metadata branch (refs/heads/fabro/meta/<run_id>) is written best-effort as a future-proofing archive. Nothing in this plan reads it at runtime — fork, rewind, and timeline all source their state from the durable run store (events and RunProjection.checkpoints). Fork-from-metadata-branch (recovering a run that was deleted from the server but still exists in git) is explicitly deferred to a future plan.
Goals
source_directorymeans the submitter-side path where run source was resolved. It is provenance/display only and may not exist on the Fabro server.working_directorymeans the sandbox execution path field on sandbox records/events, e.g./workspace; use "sandbox execution path" for the concept in prose.- Submitter-provided pre-run git context is optional. CLI submitters can report local dirty status, base SHA, and pre-run push outcome. Browser, Slack, webhook, MCP, and scheduled-job submitters usually cannot. The Fabro server never opens a submitter path.
- Runtime metadata branch writes happen through
Sandbox::exec_commandand are best-effort. - Runtime fork, rewind, and timeline source state from the durable run store, not the metadata branch. Fork/rewind git setup validates source run-branch reachability through the sandbox clone origin before execution.
- Docker, Daytona, and local worktree execution share the same git metadata behavior.
- Stale bind-mount vocabulary is removed from records, events, docs, tests, and API schemas.
- Local in-place execution is preserved only as an explicit no-checkpoints opt-out with durable state and clear fork/rewind errors.
Phase 1: Rename run path vocabulary and move pre-run git context to submitters
Primary files:
lib/crates/fabro-types/src/run.rslib/crates/fabro-types/src/run_summary.rslib/crates/fabro-types/src/run_event/run.rslib/crates/fabro-workflow/src/event.rslib/crates/fabro-workflow/src/operations/create.rslib/crates/fabro-workflow/src/pipeline/initialize.rslib/crates/fabro-server/src/run_manifest.rslib/crates/fabro-cli(CLI submitter pre-run git context)docs/public/api-reference/fabro-api.yaml
Required changes — vocabulary rename:
- Rename
RunSpec.working_directorytoRunSpec.source_directoryand change its type fromPathBuftoOption<String>. Provenance may originate on another machine, may be absent for server-originated runs, and is never opened by the server.Option<String>is more honest thanPathBufand avoids fake or normalized values. - Remove
RunSpec.host_repo_path. - Rename
RunCreatedProps.working_directorytosource_directory; sameOption<String>type. - Remove
RunCreatedProps.host_repo_path. - Add the same durable fields to
RunCreatedPropsandEvent::RunCreatedas needed for event replay:pre_run_git: Option<PreRunGitContext>,fork_source_ref: Option<ForkSourceRef>, andcheckpoints_disabled: bool.RunSpecis reconstructed fromRunCreatedPropsinfabro-store, so no newRunSpecfield may exist only in memory. - Delete
CreateRunInput.host_repo_path;operations::createshould always persistsource_directoryfrom resolved workflow context. - Rename
PreparedManifest.working_directorytosource_directoryinfabro-server::run_manifest;PreparedManifestis the server-side manifest assembled from submitted workflow source beforeRunSpecis persisted. - Rename
RunSummary.host_repo_pathtosource_directoryand switch toOption<String>. - Update
RunSummary::repository.namederivation, end to end. This is needed becausesource_directoryis now optional submitter provenance, whilerepo_origin_urlis the best server-known repository identity:- Plumb
repo_origin_urlintoRunSummary::newand intobuild_summaryinlib/crates/fabro-store/src/run_state.rsalongsidesource_directory. Today both sites only carry the path. - Derivation order: prefer
repo_origin_urlowner/repo or repo basename when present; fall back tosource_directorybasename; fall back to"unknown".
- Plumb
- Update CLI output and server summary helpers that currently expose
host_repo_path. - Regenerate and update API clients after the OpenAPI rename.
Required changes — submitter pre-run git context:
- Keep the existing git helper functions in
fabro-workflow::gitfor now; move the call sites for dirty detection (git::sync_status), base-branch push (git::branch_needs_push+git::push_branch), and base SHA capture (git::head_sha) frompipeline/initialize.rsto the CLI submit path. - Add
RunSpec.pre_run_git: Option<PreRunGitContext>. - Define
PreRunGitContextas one coherent observation of the submitter checkout. It containsdisplay_base_sha: Option<String>,local_dirty: DirtyStatus(Clean,Dirty,Unknown), andpush_outcome: PreRunPushOutcome. - Define
PreRunPushOutcomeas an enum, not anOption<bool>:NotAttempted,Succeeded { remote, branch },Failed { remote, branch, message },SkippedNoRemote, andSkippedRemoteMismatch { remote, repo_origin_url }. - Keep
PreRunGitContextgrouped rather than flattening it intoRunSpec; its fields are meaningful together as submitter-local provenance, andpush_outcomeis only meaningful in the context of the same checkout/base SHA observation. - CLI submissions populate
pre_run_gitfrom the user's source checkout. Non-CLI submitters leave itNone; the engine skips local dirty/push reporting and uses sandbox git setup output for display base SHA when available. - For CLI submissions with
repo_origin_url, use the current checkout'soriginremote for pre-run push and compare it withrepo_origin_urlusingfabro_github::normalize_repo_origin_url(cli_remote_url) == fabro_github::normalize_repo_origin_url(repo_origin_url). If it does not match or cannot be proven, skip the pre-run push, recordSkippedRemoteMismatchorSkippedNoRemote, and let sandbox clone/setup validate the runtime origin later. Fork/upstream layouts whereoriginis a user fork andrepo_origin_urlis upstream are treated as user configuration errors for this plan. pipeline/initialize.rsconsumespre_run_gitand stops callingoptions.sandbox.host_repo_path()for git work. Delete theSandboxSpec::host_repo_path()accessor in this phase.
Decisions:
- Do not keep
host_repo_pathanywhere in active run specs, summaries, events, or runtime options. If a test needs a local git path, name that fixture variablesource_directoryorrepo_diraccording to its role. - Delete both host-path entry points:
SandboxSpec::host_repo_path()currently feeds initialization/pre-run host git behavior, andRunOptions.host_repo_pathcurrently feeds runtime metadata/push behavior. Both are symptoms of the same server-local-git assumption and both go away. - The Fabro server never inspects a submitter filesystem path; pre-run git facts arrive as data on
RunSpec.
Phase 2: Remove stale bind-mount fields
Primary files:
lib/crates/fabro-types/src/sandbox_record.rslib/crates/fabro-types/src/run_event/infra.rslib/crates/fabro-workflow/src/event.rslib/crates/fabro-workflow/src/pipeline/initialize.rslib/crates/fabro-store/src/run_state.rslib/crates/fabro-sandbox/src/sandbox_spec.rsapps/fabro-webandlib/packages/fabro-api-client(consumer audit)docs/internal/events.mddocs/internal/plan-events-as-source-of-truth.md
Required changes:
- Delete
host_working_directoryandcontainer_mount_pointfromSandboxRecord. - Delete both fields from
SandboxInitializedPropsandEvent::SandboxInitialized. - Stop emitting both fields from
pipeline::initialize. - Stop storing both fields in
fabro-storeprojections. - Grep
apps/fabro-webandlib/packages/fabro-api-clientfor either field name and update consumers; do not condition removal on OpenAPI presence alone. - Update all tests and snapshots that construct sandbox records/events.
- Update docs to describe
sandbox.initialized.working_directoryas the sandbox execution path and remove host/container mount terminology.
Decision:
- Keep Docker clone metadata (
repo_cloned,clone_origin_url,clone_branch) because it describes the sandbox clone source. It does not imply host bind mounts.
Phase 3: Make metadata writes sandbox-native
Primary files:
lib/crates/fabro-workflow/src/sandbox_git.rslib/crates/fabro-workflow/src/lifecycle/git.rslib/crates/fabro-workflow/src/pipeline/finalize.rslib/crates/fabro-workflow/src/run_dump.rslib/crates/fabro-workflow/src/run_options.rslib/crates/fabro-sandbox/src/sandbox.rslib/crates/fabro-checkpoint/src/metadata.rs(deletion)
Required changes — writer interface:
- Delete
RunOptions.host_repo_path. - Stop constructing
MetadataStorein workflow runtime lifecycle code. - Add a sandbox metadata writer near
sandbox_gitwith an interface equivalent to:- input: sandbox, run id, metadata ref,
RunDump(which already includes the fullRunProjectionasrun.json), commit message, git author. - output: metadata commit SHA.
- input: sandbox, run id, metadata ref,
Required changes — writer implementation:
- Add a per-run
SandboxGitRuntimehelper nearsandbox_git, shared byGitLifecycle, finalize, and parallel checkpoint code. It owns aOnceLock/cached result for the sandbox git capability probe plus metadata degradation state. - Run the shared sandbox git capability probe once per run before the first sandbox git operation. Prefer an actual temp-index plumbing check over version parsing: under a hidden directory inside the sandbox execution path, create a temporary index, run the
read-tree --empty/hash-object -w/update-index --add --cacheinfo/write-treesequence against harmless temp data, then clean up. Do not assume/tmpor$TMPDIRis writable. - Probe failure does not convert a run to
checkpoints_disabled; that state is reserved for the explicit in-place opt-out. If the probe fails before run-branch checkpointing or fork setup, fail that operation with a clear "sandbox git unavailable" error. Metadata writes use the same cached probe result but remain best-effort: emit one warning, mark metadata degraded for the run, and skip future metadata writes. - The probe is a startup capability check, not a guarantee for the full run lifetime. If an agent removes
git, fills the disk, or otherwise breaks git after the probe passes, the real git operation fails with its concrete raw error; do not re-probe before every checkpoint. - Create a sandbox temp directory for metadata files under the sandbox execution path.
- Write every dump entry into the metadata tree binary-safely. Use local temp files plus
Sandbox::upload_file_from_localfor bytes. - The writer must include
run.json(fullRunProjectionblob) at every checkpoint commit so that future fork-from-archive (deferred from this plan) can reconstruct the projection from a metadata commit alone. - Build a temporary git index with
GIT_INDEX_FILE. - Load the previous metadata commit with
git read-tree <old_commit>when the ref exists, elsegit read-tree --empty. - Write blobs with
git hash-object -w. - Stage entries with
git update-index --add --cacheinfo. - Create the tree with
git write-tree. - Create commits with
git commit-tree, setting author/committer env fromGitAuthor. - Update
refs/heads/fabro/meta/<run_id>withgit update-ref. - Clean up temp files best-effort.
Required changes — integration:
GitLifecycle::on_run_startinitializes the metadata ref through this sandbox writer.GitLifecycle::on_checkpointwrites the snapshot through this sandbox writer and passes the returned SHA intogit_checkpointso the run-branch commit keeps theFabro-Checkpointtrailer.- After each successful metadata write, the sandbox metadata writer pushes
refs/heads/fabro/meta/<run_id>best-effort throughgit_push_ref.write_finalize_commitonly calls the writer for the final snapshot; it does not have a separate metadata push path. - Metadata write failures remain best-effort warnings and must not fail a successful workflow run. They do not affect
Checkpoint.git_commit_sha; that SHA comes from run-branch checkpoint commits. Fork/rewind require a checkpoint withgit_commit_sha, so run-branch checkpoint failures affect forkability while metadata failures only affect future fork-from-archive recovery. - Metadata write and metadata push failures share a noise budget: emit the first warning per run, mark metadata degraded, suppress repeated per-checkpoint warnings, and emit an end-of-run summary notice if metadata was degraded.
Decisions:
- Use git plumbing with a temporary index. Do not checkout the metadata branch.
- Do not mutate the sandbox worktree or real git index while writing metadata.
- Rejected alternative: relying on the first real git operation to fail was rejected because run-branch checkpointing, metadata writes, and parallel checkpoint code would each surface different failures. The shared probe gives one clear capability error and one cached best-effort degradation path.
- Delete
fabro-checkpoint::metadata::MetadataStoreentirely. The sandbox writer is the only writer. Tests that previously usedMetadataStoremigrate to either a local-sandbox-backed writer fixture or a focused test helper.
Phase 4: Converge local git behavior on sandbox exec
Primary files:
lib/crates/fabro-sandbox/src/local.rslib/crates/fabro-sandbox/src/worktree.rslib/crates/fabro-sandbox/src/sandbox.rslib/crates/fabro-workflow/src/pipeline/initialize.rslib/crates/fabro-workflow/src/lifecycle/mod.rslib/crates/fabro-cli(CLI flag for opt-out)
Required changes:
- Runtime git checkpointing always uses
Sandbox::exec_command. - Make
WorktreeSandboxthe default local provider strategy for all local runs, regardless of submitter. Local runs use an isolated worktree; this is the path that shares behavior with Docker/Daytona. - Add a CLI flag (e.g.
--in-place) for the explicit opt-out that runs against the user's source tree directly. Require an explicit paired acknowledgement flag such as--allow-no-checkpoints; when opted in, disable git checkpointing, persistcheckpoints_disabled: trueon the run, surface that state in summaries/fabro ps, and make fork/rewind errors say the run was created without checkpoints. Do notgit checkout -b fabro/run/...in the user source directory. - Ensure
WorktreeSandboxsupports the same run-branch and metadata-branch git operations as Docker/Daytona through theSandboxtrait. - Remove fallback host-side pushes from runtime git lifecycle. Push run and metadata refs from the sandbox.
- Replace
Sandbox::setup_git_for_run(&str)with a setup intent method that returnsGitRunInfo(base_sha,run_branch,base_branch) when it establishes sandbox git state:GitSetupIntent::NewRun { run_id }createsrefs/heads/fabro/run/<run_id>from the sandbox clone HEAD and returns the sandbox HEAD SHA asbase_sha.GitSetupIntent::ForkFromCheckpoint { new_run_id, source_run_id, checkpoint_sha }fetches the source run ref, createsrefs/heads/fabro/run/<new_run_id>atcheckpoint_sha, and checks it out before the first stage runs.
- Keep
GitSetupIntentrather than passing fullRunSpecinto the sandbox trait. The workflow layer derives the intent fromRunSpec.fork_source_ref, and the sandbox trait receives only the git setup data it needs. WorktreeSandboxowns local git setup. Itsinitialize/setup flow should keep the existinggit worktree addbehavior forNewRun, and add a fork path that creates the worktree branch atcheckpoint_sha; it should not delegate git setup to bareLocalSandbox.- Delete
Sandbox::host_git_dirafter the worktree migration. No runtime git operation may branch on a host-accessible repository path. Replace the currenthost_git_dirlifecycle gate with an explicit hook cwd rule: when sandbox git checkpointing is enabled, pass the sandbox execution path (sandbox.working_directory()) toHookLifecycle/WorkflowRunStarted.worktree_dir; when checkpoints are disabled, leave hook cwd unset. Do not infer hook behavior from host path accessibility. - Rename
Sandbox::git_push_branchtogit_push_ref(inlib/crates/fabro-sandbox/src/sandbox.rs, thedelegate_sandbox!macro, every implementor, and the sharedgit_push_via_exechelper). The method now pushes both run branches and metadata refs;git_push_branchis misleading. - Define
git_push_refas taking a full refspec (e.g.refs/heads/fabro/run/<id>:refs/heads/fabro/run/<id>,refs/heads/fabro/meta/<id>:refs/heads/fabro/meta/<id>) so callers control source and destination explicitly. Preserve the existingrefresh_push_credentials()call. Do not use force refspecs (+src:dst) for run or metadata refs; they are append-only/create-only by invariant, and a non-fast-forward push should fail loudly.
Decisions:
- The local source tree is never used as a server-side git repo for checkpoint metadata.
--in-place --allow-no-checkpointsis the only path where local runs forgo checkpoints. It is opt-in, persisted on the run, and visible in list/detail and fork/rewind error paths.
Phase 5: Source fork, rewind, and timeline from the durable run store
Primary files:
lib/crates/fabro-workflow/src/operations/run_git.rslib/crates/fabro-workflow/src/operations/timeline.rslib/crates/fabro-workflow/src/operations/fork.rslib/crates/fabro-workflow/src/operations/rewind.rslib/crates/fabro-workflow/src/operations/rebuild_meta.rs(deletion)lib/crates/fabro-workflow/src/operations/mod.rslib/crates/fabro-server/src/server.rslib/crates/fabro-sandbox/src/sandbox.rs
Required changes — server-local git removal:
- Stop opening
RunSpec.source_directorywithgit2. The server never opens any submitter path. - Build checkpoint timelines from
RunProjection.checkpointsdirectly. No metadata branch reads. - Replace
TimelineEntry.metadata_commit_oid(inlib/crates/fabro-workflow/src/operations/timeline.rs) withcheckpoint_seq: u32. Every consumer that previously readrun.jsonfrom a metadata commit (such as fork's historical projection reconstruction inoperations/fork.rs) instead replays events up to that seq. - Delete
rebuild_meta.rs,build_timeline_or_rebuild, andrebuild_metadata_branch. Remove theiroperations::modre-exports. Recovery from missing metadata branches is out of scope for this plan; a future fork-from-archive plan will reintroduce a recovery utility if needed.
Required changes — fork mechanics:
- Reconstruct the historical full
RunProjectionfor the source run by composingstore.list_events(source_run_id)withRunProjection::apply_events, stopping at the targetcheckpoint_seq. This becomes the new run's initial projection. - Add
RunSpec.fork_source_ref: Option<ForkSourceRef>and the matchingRunCreatedProps/event field.Nonemeans a normal run.Some(ForkSourceRef { source_run_id, checkpoint_sha })means fork/rewind setup must fetch the source run branch and branch the new run fromcheckpoint_sha; this overrides normal clone-branch checkout after the initial clone is available. - Before persisting the forked/rewound run, validate all store-local invariants: the target checkpoint has
git_commit_sha, the source run did not recordcheckpoints_disabled, and source/new run specs point at the same normalizedrepo_origin_urlusingfabro_github::normalize_repo_origin_urlon both sides. If these checks fail, return a validation-style error and do not create a new run row. - Fork-from-running is supported, but only after a checkpoint has a git SHA and its run branch is reachable. Because an in-flight source run may still be pushing the checkpoint commit, sandbox reachability validation should use a short retry/wait window before failing.
- Sandbox initialization for a forked run must, before workflow execution starts:
- Fetch
refs/heads/fabro/run/<source_run_id>from the sandbox clone'soriginremote. In this plan,originmust correspond toRunSpec.repo_origin_url; fork/rewind across different origins is unsupported and should fail validation. - Create the new run-branch
refs/heads/fabro/run/<new_run_id>pointing atcheckpoint_sha. - Check that branch out before the first stage runs.
- Fetch
- If the source run ref fetch fails or the
checkpoint_shais not reachable from the fetched source run ref after the retry window, fail sandbox initialization with a clear fork setup error and mark the new run as failed during setup. Do not silently fall back to the sandbox default branch. Directgit fetch origin <sha>fallback is out of scope for this plan; source run branches must be pushed and reachable. - Rewind continues the existing fork-then-archive behavior: create a new run id, create the new run branch at the checkpoint SHA, then archive/supersede the source run. This plan only changes the git setup mechanics; do not reintroduce rewind-in-place behavior.
- If the chosen checkpoint has no
git_commit_sha, return the existing validation-style error. - Fork creates the new run's branches/refs through the sandbox via
git_push_ref, notgit2against any server-local path.
Required changes — prefix resolution:
- Removing
host_repo_pathalso removes repo/path-scoped prefix matching. Replace prefix-scoping logic infind_run_id_by_prefix_or_storewith global prefix matching. If exactly one run matches, resolve it. If zero, return "not found." If multiple, return an ambiguity error listing each candidate (full run id, created_at, workflow name, origin URL) so the user can disambiguate.
Decisions:
- Server APIs do not require the original source checkout to exist on the Fabro server host.
- Events are the canonical source of run history at runtime; metadata branch is a write-only archive in this plan.
- Prefix ambiguity is a hard CLI error, not a silent filtering decision.
Phase 6: API, generated clients, docs, and cleanup
Primary files:
docs/public/api-reference/fabro-api.yamllib/crates/fabro-api/build.rsand generated output as requiredlib/packages/fabro-api-clientapps/fabro-weblib/crates/fabro-clidocs/internal/events.mdAGENTS.md(remove any bind-mount references in agent guidance; otherwise drop from primary files)
Required changes:
- Update OpenAPI schemas from
host_repo_pathtosource_directory. - Add API/event schemas for
pre_run_git,fork_source_ref, andcheckpoints_disabledwhereverRunSpec/RunCreatedPropsare represented. - Remove mount fields from sandbox initialized schemas if present.
- Rebuild Rust API types.
- Regenerate TypeScript API client.
- Update web and CLI consumers to display
source_directorywhere submitter provenance is wanted and sandboxworking_directorywhere execution path is wanted. - Update CLI fork output to print full run id + workflow name + origin URL when a prefix is ambiguous.
- Update
/api/v1/runs/{id}/timelineOpenAPI prose and regenerated TypeScript comments so they say the endpoint reads durable run-store checkpoints, not the metadata branch. - Update docs to state Docker and Daytona are clone-based providers and never bind-mount the source repo.
Decision:
- No API aliases or transitional duplicated fields. Break callers cleanly.
Test Plan
Focused tests:
- Submitter pre-run git context tests:
- dirty detection, base-branch push, and
display_base_shaare computed CLI-side and arrive onRunSpec.pre_run_git. pre_run_gitround-trips throughRunCreatedPropsand event replay; it is not only present in the in-memoryRunSpec.PreRunPushOutcomerecords success, failure, no-remote, and remote-mismatch cases explicitly.- non-CLI/server-created runs can leave
pre_run_gitasNone; initialize uses sandbox setup output for display base SHA when available. - CLI pre-run push uses
origin, compares withrepo_origin_urlviafabro_github::normalize_repo_origin_url, and is skipped/recorded when they do not match. - server
pipeline::initializeno longer callsgit::sync_status/branch_needs_push/push_branch/head_sha.
- dirty detection, base-branch push, and
- Sandbox git capability tests:
- shared capability probe exercises temp-index plumbing once per run under the sandbox execution path, not
/tmp. - probe result is cached by the per-run
SandboxGitRuntimeand shared by lifecycle, finalize, and parallel checkpoint paths. - missing or broken git fails run-branch checkpointing/fork setup clearly.
- metadata writer uses the same failed probe result to warn once and skip best-effort writes.
- if git or disk availability breaks after a successful probe, the real checkpoint/fork git operation reports the concrete raw error.
- shared capability probe exercises temp-index plumbing once per run under the sandbox execution path, not
- Sandbox metadata writer tests:
- creates metadata branch from an empty ref.
- appends snapshot commits while preserving prior files.
- writes
run.json(fullRunProjection) at every checkpoint commit. - returns the metadata commit SHA.
- does not change current branch, worktree files, or the real index.
- handles binary dump entries.
- pushes the metadata ref best-effort after each successful metadata write.
- metadata write/push degradation emits one warning per run, suppresses repeated checkpoint noise, and emits an end-of-run summary notice.
- Workflow lifecycle regression tests:
- Docker/Daytona-style run with
source_directory = /Users/client/projectnever opens that path on the server. - metadata write success adds
Fabro-Checkpointtrailer to the run checkpoint commit. - metadata write failure emits a single warning, does not fail the workflow, and does not remove the run-branch
git_commit_shaneeded for fork. - run-branch checkpoint failure leaves no forkable checkpoint and produces a clear fork/rewind validation error.
- Docker/Daytona-style run with
- Sandbox ref push tests:
git_push_refpushes full run and metadata refspecs, preserves credential refresh, and rejects/non-forces non-fast-forward updates.git_push_via_exec,delegate_sandbox!, Docker, Daytona, local, and worktree implementations all use the full-refspec method.
- Fork via event replay:
- fork at checkpoint seq N reconstructs the historical
RunProjectionviaRunProjection::apply_eventsover events withseq <= N. - fork succeeds without any metadata branch read.
- fork's
ForkSourceRefis optional onRunSpecand round-trips throughRunCreatedProps/event replay: absent for normal runs, present for fork/rewind-created runs, and it overrides normal clone-branch checkout. - fork setup fetches
refs/heads/fabro/run/<source_run_id>from the sandbox clone origin and createsrefs/heads/fabro/run/<new_run_id>at the checkpoint SHA before the first stage runs. - fork store-local validation fails without creating a new run row when the source run has
checkpoints_disabled, no target checkpoint SHA, or mismatchedrepo_origin_url. - fork-from-running retries briefly when the source run ref is not yet reachable, then either succeeds or fails sandbox setup clearly.
- sandbox setup fails clearly when the source run ref cannot be fetched or the checkpoint SHA is unreachable from that ref after the retry window.
- fork returns a clear error when target checkpoint has no git commit SHA.
- fork at checkpoint seq N reconstructs the historical
- Timeline and rewind:
TimelineEntryexposescheckpoint_seq(notmetadata_commit_oid).- timeline endpoint works from
RunProjection.checkpointswithout a local git repo. - rewind reuses the fork fetch + branch-from-sha mechanics, creates a new run id, and archives/supersedes the source run.
- rewind target parsing works without opening
source_directory.
- Repository summary derivation:
repo_origin_urlplumbs throughbuild_summaryandRunSummary::new; name prefers origin owner/repo, falls back tosource_directorybasename, then"unknown".- summary derivation works when
source_directoryisNone.
- Prefix resolution:
- exact-match prefix resolves to a single run.
- ambiguous prefix returns an error listing every candidate.
- zero matches returns "not found."
- Local strategy:
- default local provider run uses
WorktreeSandboxfor CLI, browser, Slack, webhook, MCP, and scheduled-job submissions and produces checkpoints. WorktreeSandboxownsGitSetupIntent::NewRunandForkFromCheckpoint; it does not delegate branch setup to bareLocalSandbox.GitSetupIntent::NewRunreturnsGitRunInfowith sandbox HEAD SHA asbase_sha, and fork setup returnsGitRunInfofor the new run branch.--in-place --allow-no-checkpointsruns persistcheckpoints_disabled: truethroughRunCreatedProps, surface that state in list/detail output, skip git checkpointing, and do not create afabro/run/...branch in the user source directory.- fork/rewind against a run with
checkpoints_disabled: truefails with an error that names the disabled-checkpoints cause. Sandbox::host_git_diris gone or unused by runtime git lifecycle code;HookLifecyclestill receives the sandbox execution path as cwd when checkpointing is enabled.
- default local provider run uses
- Naming and event tests:
- run created/projection/summary JSON uses
source_directory. - sandbox initialized JSON exposes sandbox
working_directoryand no mount fields. - repository summary name is derived from
repo_origin_urlbeforesource_directory. - timeline OpenAPI/generated client prose says run-store checkpoints, not metadata branch.
- run created/projection/summary JSON uses
Commands:
cargo build -p fabro-apicargo nextest run -p fabro-workflowcargo nextest run -p fabro-servercargo nextest run -p fabro-clicd lib/packages/fabro-api-client && bun run generatecd apps/fabro-web && bun run typecheckcargo +nightly-2026-04-14 fmt --check --allcargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings
Non-goals
- No production data migration.
- No compatibility aliases for old JSON fields.
- No server-side clone cache for metadata writes.
- No Docker bind-mount support.
- No branch mutation in the submitter source tree as a fallback.
- No fork, rewind, or timeline path that reads the metadata branch. Fork-from-archive (recovering a server-purged run from git alone) is deferred to a future plan.
- No prefix scoping by repo or origin. Ambiguous prefixes are user errors.
- No fork/rewind across different repository origins.
- No direct
git fetch origin <sha>fallback for fork/rewind in this plan. Source run branches must be pushed and reachable from the sandbox clone origin. - No GitHub repository-ID based origin matching in this plan. Origin equality is normalized URL equality, so repository renames/transfers that change normalized URLs are a known limitation; users should create new runs from the new origin or repair stored metadata in a future recovery tool.