Skip to content

fix(test): inject LFS faults with packed source objects - #576

Closed
forhappy wants to merge 1 commit into
codex/capsule-force-pushfrom
codex/packed-lfs-fault-fixture
Closed

forhappy wants to merge 1 commit into
codex/capsule-force-pushfrom
codex/packed-lfs-fault-fixture

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

The Git-current protocol canary stops before its LFS corruption check because it assumes the pointer blob is loose. Packed objects are valid; git repack -ad reproduces the same missing-file failure locally.

Export this small disposable fixture's source history and unpack into an empty object database for injection. Keep the original database aside and restore it in finally; verify its complete file hashes, pointer, refs and working bytes afterward. Always pack the caller fixture first so the earlier failure remains covered. The checksum-mismatch rejection and successful restored dry run remain mandatory. A healthy packed duplicate cannot mask the injected loose corruption.

Stacked on #575; draft, no merge requested. Qualification setup and documentation only; no runtime, dependency, lockfile, baseline/inventory or expected-failure changes. Requested audit benchmark reports remain excluded.

Validation:

  • Negative control: the existing method fails with FileNotFoundError after real Git repack, matching parent CI artifact 38675374883/git-current.
  • Updated packed-source mirror workflow passes 66 commands and 13 checks against the unchanged fix(push): retain and retire capsule staging #572 release, including real collaboration hooks, corruption rejection and restored publication. The receipt pins binary and harness SHA256.
  • Deliberate assertion failure after a verified checksum rejection restores all original object-file hashes and passes strict native Git fsck: 34 commands, three checks. This is failure-cleanup proof only.
  • Seventeen existing log/source-isolation tests, Python syntax, Rust formatting and whitespace checks pass.
  • Full updated-source protocol/Git-current CI remains pending; selected local proof does not establish full compatibility.

Evidence map: mirror_pre_push_batch_checks -> mirror_lfs_discovery_check -> existing run_binary/run_git and fixture-permission helper -> Git pack/unpack -> real Crab LFS discovery. The production corruption check is unchanged. Current origin/main contains the same direct loose-path read in this fixture. Main source was compared; a main binary was not separately replayed. The observed failure and red/green receipts belong to the capsule stack.

Dependency contracts: Git unpack-objects skips objects already present; Git object-directory control lets the isolated unpack avoid the original packed database. Locked gix-odb source searches packs before loose storage, so adding a loose corrupt duplicate to the original database would not prove the intended check.

Is this the best fix? The fixture establishes and verifies the required physical fault while preserving the original source layout and bytes, instead of imposing loose storage on valid user repositories or weakening the corruption expectation.

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.

1 participant