Skip to content

fix: make Git-submodule takeover failure-atomic - #101

Merged
ORESoftware merged 1 commit into
mainfrom
agent/harden-submodule-overtake-rollback
Aug 4, 2026
Merged

fix: make Git-submodule takeover failure-atomic#101
ORESoftware merged 1 commit into
mainfrom
agent/harden-submodule-overtake-rollback

Conversation

@ORESoftware

@ORESoftwareORESoftware commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Context

PR #96 merged the requested Git-submodule interoperability surface:

  • opt-in zed install --git-submodules[=true|false];
  • ZED_PKG_GIT_SUBMODULES and matching .cli-flags.toml metadata;
  • recursive, explicit-checkout submodule synchronization before ordinary Zed resolution;
  • zed overtake --git-submodules for importing committed Zed-package submodules into workspace/dependency authority; and
  • additive, frozen-verifiable [[git-submodule]] provenance in .zpkg.lock.

A post-merge transaction audit found one narrow migration edge: overtake committed the candidate .zpkg.toml before invoking the ordinary installer. A resolution or materialization failure could therefore leave a half-adopted root manifest even though the installer correctly rolled back its own lock and materialized tree.

Hardening in this PR

  • snapshot and parse the same exact prior root-manifest bytes;
  • verify the manifest has not changed before applying takeover intent;
  • restore the exact prior bytes when installation fails before commit;
  • remove a newly generated root manifest when none existed before takeover;
  • refuse rollback if another writer changed the candidate manifest;
  • reacquire the global install lock before rollback recovery;
  • distinguish additive Git-lock finalization failures, which occur after the ordinary install transaction commits, and retain the adopted manifest so disk intent stays aligned with installed state;
  • add focused unit coverage plus a real Git-submodule fixture whose transitive dependency cannot resolve; and
  • document the failure and reconciliation contract.

Exact-head validation

All eight pull-request workflows pass on commit 8383d8bf:

  • core CI: all nine jobs, including Ubuntu/macOS nextest and doctests, all-target Clippy, Docker install boundaries, shell/help contracts, durable-manifest recovery, and Rust/Node host-plus-OCI consumer roundtrips;
  • Nix interoperability on Ubuntu and macOS;
  • copy-mode OCI contract;
  • polyglot contract;
  • development-shell contracts;
  • repository hardening;
  • agents policy; and
  • formal review procedure.

This supersedes closed draft #98, whose history was compacted from connector-generated per-file commits into this single intentional commit without changing the four-file product tree.

Follow-up to #96 and DEN-1612.

@ORESoftware
ORESoftware marked this pull request as ready for review August 4, 2026 10:29
@linear-code

Copy link
Copy Markdown

DEN-1612

Sign up for freeto 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.

1 participant

@ORESoftware