feat(runs): record base SHA provenance - #166
Conversation
Persist the prepared workspace base and published delivery base in run records, deliveries, receipts, and the public API. Refs theam#147
|
Nice catch on splitting |
|
Good question. This PR only lands the durable provenance data. I kept capture and persistence separate from Gate 1 behavior so the provenance contract can be reviewed independently. I used |
adrian-lorenzo
left a comment
There was a problem hiding this comment.
Thanks for the solid contribution!
|
Thank you for the review and approval! I appreciate the opportunity to contribute. Once the provenance PR lands, I’d be interested in taking the remaining Gate 1 slice. I would not infer overlap by parsing the plan Markdown; the UI would present deterministic changed-path evidence for the human decision. |
This PR does not compare
workspaceBaseShawith the live branch during plan acceptance and does not alter Gate 1 or/builderdispatch; it provides the durable input required for that follow-up behavior.What changes
Records the Git base commit for repository-backed runs and deliveries.
runs.workspace_base_sha.run_deliveries.base_sha.HEADafter checkpoint restoration and before agent execution.409 workspace_base_mismatch.shipGitChanges.github.base_shareceipt provenance.workspaceBaseShathrough the public Run API and generated SDK.Workspace and delivery bases remain separate:
workspaceBaseShabaseShaexpectedHeadShaFor delivery receipts,
github.base_shauses the delivery base. Runs without a delivery fall back to the prepared workspace base.Why
Facility records the resulting head commit, but not the commit from which the agent started.
A branch name such as
maincan remain unchanged while its commit advances. Without the original base SHA, Facility cannot reliably determine whether a run was based on the current tree, reconstruct the exact delivered range, or provide durable provenance in receipts.The runner already calculates these commits during workspace preparation and delivery; this change persists them instead of discarding them.
This is additive and backward-compatible:
base_shais optional.Refs #147.
Verification
Verified:
HEADgit diff --checkpnpm verifyis not marked as passing locally. WSL verification encountered timing-sensitive failures in unchanged runner process-deadline and assistant cleanup tests. The affected runner tests pass independently, and no provenance test failed.pnpm verifypasses locally