Can Wraith Box refuse a bad push before any of it reaches the landing repository, and before it uses up the host's memory?
Answered 2026-10-05. Decided 2026-10-06: A, scanner and check, with fixed caps. The decision and its reasons are in the I74I74 (closed): X26-pre-receive-check: Push checks before the quarantine landsS08-workspace-and-git caps the compressed size of a push (receive.maxInputSize). comment that starts Decision (2026-10-06):. Source: X26-pre-receive-checkX26-pre-receive-check: Push checks before the quarantine landsCan a pre-receive check that Wraith Box owns, never the repository, refuse a push whose objects inflate past a cap, and repeat the ref checks git only runs in update(), so a refused push leaves nothing in landing.git… (I74I74 (closed): X26-pre-receive-check: Push checks before the quarantine landsS08-workspace-and-git caps the compressed size of a push (receive.maxInputSize).). Changes S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem. and S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…. I102I102 (closed): X28-git-alloc-limit: git's allocation cap against delta bombsX26-pre-receive-check (#74) found that a small pack makes receive-pack allocate a delta's declared result before any hook runs (2 GiB from an 8 KiB pack), and that macOS refuses ulimit -v and -d on the git child. later answered the open point on the scanner’s scope: GIT_ALLOC_LIMIT makes git refuse each oversized allocation itself, and the scanner no longer holds an entry (X28-git-alloc-limitX28-git-alloc-limit: git's allocation cap against delta bombsDoes GITALLOCLIMIT in receive-pack's environment make both host gits refuse each delta bomb of X26-pre-receive-check before allocating its result?, B102-git-alloc-limitB102-git-alloc-limit: Can git itself refuse a push that asks for too much memory, so the pack scanner gets simpler?Yes, with conditions.).
Figure 1. A push after X26-pre-receive-checkX26-pre-receive-check: Push checks before the quarantine landsCan a pre-receive check that Wraith Box owns, never the repository, refuse a push whose objects inflate past a cap, and repeat the ref checks git only runs in update(), so a refused push leaves nothing in landing.git…. The scanner (new) refuses an object too large before git sizes a buffer for it. Git unpacks the rest into a quarantine directory, and the pre-receive check (new) refuses bad refs while the objects are still there. A refused push then leaves nothing in landing.git.
Options
Section titled “Options”The issue asked about the check alone. The spike found that it can’t bound memory, so the options are what to combine.
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified Without a check, git refused ten bad pushes only after moving their objects into the landing repository: a ref too long for the file system, a component too long for its lock file, three stale or wrong old IDs, three directory/file clashes, two case clashes. With the check, all were refused and nothing was left. Same results with git 2.56.0 and Apple git 2.54.0. Source: X26-pre-receive-checkX26-pre-receive-check: Push checks before the quarantine landsCan a pre-receive check that Wraith Box owns, never the repository, refuse a push whose objects inflate past a cap, and repeat the ref checks git only runs in update(), so a refused push leaves nothing in landing.git…, “Cases”,
results/run1-homebrew.txtandrun2-apple.txt. - verified Git accepted three pushes that leave refs inconsistent on a case-insensitive disk (a packed-ref directory clash,
DIR/ybesidedir/x,MAINbeside a packedmain). The check refused them. Source: same. - verified Delta results of 256 MiB to 2 GiB from 8 KiB packs took 271 to 2,063 MiB of memory in git, before the hook ran. The scanner refused each in 0.03 s. Source: X26-pre-receive-checkX26-pre-receive-check: Push checks before the quarantine landsCan a pre-receive check that Wraith Box owns, never the repository, refuse a push whose objects inflate past a cap, and repeat the ref checks git only runs in update(), so a refused push leaves nothing in landing.git…, “Memory while git unpacks”.
- verified
ulimit -vandulimit -dfail on macOS 27.0.1 with “Invalid argument”. Source: same. - verified A leftover lock file still fails a push after the check passed, leaving objects, so the cleanup stays. Source: X26-pre-receive-checkX26-pre-receive-check: Push checks before the quarantine landsCan a pre-receive check that Wraith Box owns, never the repository, refuse a push whose objects inflate past a cap, and repeat the ref checks git only runs in update(), so a refused push leaves nothing in landing.git…, “Cases”.
- verified A check for objects no ref reaches refused a normal thin push on its second push. It stays out of the recommendation. Source:
results/run3-thin-homebrew.txtandrun4-thin-apple.txt. - verified Cost: the check alone 0.01 to 0.02 s on a one-commit push, 1.1 to 1.2 s on the Go repository’s whole history. The scanner reads about 0.8 GB of inflated data per second. Source: X26-pre-receive-checkX26-pre-receive-check: Push checks before the quarantine landsCan a pre-receive check that Wraith Box owns, never the repository, refuse a push whose objects inflate past a cap, and repeat the ref checks git only runs in update(), so a refused push leaves nothing in landing.git…, “Cost”.
- verified The spike’s scanner held each entry with no limit on its wire bytes: a blob of size 1 followed by 512 MiB of empty zlib blocks took its heap to 2,055 MiB. S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem. then capped wire bytes per entry and per pack, and after X28-git-alloc-limitX28-git-alloc-limit: git's allocation cap against delta bombsDoes GITALLOCLIMIT in receive-pack's environment make both host gits refuse each delta bomb of X26-pre-receive-check before allocating its result? the scanner doesn’t hold an entry at all. Source: the code review of PR88PR88 (merged): docs(spike): X26-pre-receive-check result: pack scanner and pre-receive checkResult of spike X26-pre-receive-check., at spike commit
077a8da. - inferred Without
receive.unpackLimit=1, small pushes go tounpack-objects --strict, which keeps their trees and commits in memory. A pack header declaring 10 million objects costsindex-packabout 500 MiB, so the count cap is 1,000,000. Source: the security review of PR88PR88 (merged): docs(spike): X26-pre-receive-check result: pack scanner and pre-receive checkResult of spike X26-pre-receive-check., from reading git. Not measured here, and S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq… adds a case for each. - assumed That the delta layouts tried cover how git allocates while unpacking. The peak was measured, not derived from git’s source. The conformance case in S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq… checks it again on every release.
- assumed That the
wb-git-receivesandbox profile (X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w…) can allow the check program to run. Not built yet. I67I67 (closed): wb-hostd can't read the user's repository under its sandbox profile (S08 upload-pack)Found in the review of #65 (X23-sandboxed-daemons result). is the related open issue for the fetch side.
What this unblocks
Section titled “What this unblocks”- The git gateway in
wb-hostd, towards V1-M4-claude-end-to-endV1-M4-claude-end-to-end: `wb claude` end to endGit round trip with carry-in, landing and flagging, the model credential, the terminal records and the session summary, wb diff and wb land, on a sealed image.. S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem. has no open point left on push sizes. - I41I41 (closed): S08-workspace-and-git: which git data reaches the guest, and host git as a parserS08-workspace-and-git says how bytes move, but not which data the guest may get or how much the host trusts its own git when it parses guest data: item 6: the landing size cap must also cover objects that successful pushes leave unreachable.
Details and glossary
Why the check alone can’t bound memory. A pack stores most objects as deltas: “take that object, copy these ranges”. The start of each delta says how big the result will be, and git allocates that much to apply it, while it unpacks. A hook runs only after unpacking. A delta of a few kilobytes of copy instructions can ask for gigabytes. The scanner reads those size fields as the pack streams in and refuses before git sees the entry.
Why the cleanup stays. Some failures happen inside git’s final ref update, after the objects moved: a lock file left by a crashed process, a disk error. The check can’t foresee those, so the existing repack-and-prune after a refused push remains.
Glossary
- Quarantine: a temporary directory git unpacks a push into. Git deletes it if a
pre-receivehook refuses the push. pre-receivehook: a program git runs once per push after unpacking, before updating refs. Here it comes from a directory Wraith Box owns, never from the repository.- Delta: an object stored as copy instructions against another object.
- Thin pack: a push whose deltas use objects the receiver already has.
- Reftable: a newer git format that stores refs in one file instead of one file per ref.