Skip to content

fix(specgit): restore delivery state after failed bootstrap - #533

Merged
LeXwDeX merged 3 commits into
devfrom
feat/530-specgit-bootstrap-rollback
Sep 3, 2026
Merged

fix(specgit): restore delivery state after failed bootstrap#533
LeXwDeX merged 3 commits into
devfrom
feat/530-specgit-bootstrap-rollback

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Closes #530

Why

A failed specgit issue can delete or rewrite .specgit.yaml before returning nonzero. That leaked partial delivery state into the next attempt and obscured the original failure.

What changed

  • Snapshot the pre-run delivery record separately from the temporary harness surface.
  • Restore and hash-verify .specgit.yaml only when init or the inner issue command fails or is interrupted.
  • Preserve successful bindings, original failure status, and diagnostics.
  • Fail closed with exit 3 and retain the forensic snapshot when record restoration cannot be verified.
  • Added isolated cases for validation, branch, push, and PR failures, success persistence, dirty/untracked records, restore mismatch, and non-rollback of commits.

Evidence

  • bash script/specgit-bootstrap.test.sh: latest parent run 74 passed, 0 failed.
  • sh -n / bash -n: passed.
  • shellcheck -s sh / shellcheck -s bash: passed.
  • Commit hooks: root lint and all 29 typecheck tasks passed.
  • DAG verification: PASS; diff arbitration: ACCEPT with no required actions.
  • The verifier observed an intermittent pre-existing macOS SIGINT fixture failure in case4b; its control worktree reproduced the same failure before this diff. All 36 new fix(specgit): restore delivery state after failed bootstrap #530 assertions passed in every run.

Checklist

  • Successful bootstrap keeps the new binding.
  • Failed bootstrap restores pre-run record bytes.
  • Branches, commits, and remote side effects are not undone.
  • specgit finish exits 0.

@LeXwDeX LeXwDeX changed the title Delivery specgit-bootstrap-rollback fix(specgit): restore delivery state after failed bootstrap Sep 3, 2026
@LeXwDeX
LeXwDeX changed the base branch from main to dev September 3, 2026 11:22
@LeXwDeX
LeXwDeX marked this pull request as ready for review September 3, 2026 12:10
@LeXwDeX
LeXwDeX merged commit 8711c13 into dev Sep 3, 2026
12 checks passed
@LeXwDeX
LeXwDeX deleted the feat/530-specgit-bootstrap-rollback branch September 3, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(specgit): restore delivery state after failed bootstrap

1 participant