Skip to content

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.).

guest, untrustedgit pushgit-remote-wbhost: wb-hostdref filterX07, existingpack scannernew: size capsreceive-packunpacks to quarantinepre-receive checknew: ref checkslanding.gitif passed2 GiB delta: stoppedrefused push: no objects

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.

The issue asked about the check alone. The spike found that it can’t bound memory, so the options are what to combine.

The Go scanner caps object sizes before git sees them. The check repeats git’s late ref checks while the objects are in quarantine. The cleanup stays for the rare late failure.

What the issue proposed.

Cap sizes, leave the ref checks to git and the cleanup.

D. Scanner and a reftable landing repository

Section titled “D. Scanner and a reftable landing repository”

Store refs in git’s newer reftable format, which has no file names to clash.

RequirementA. BothB. CheckC. ScannerD. Reftable
SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped. memory, CPU and disk cappedmemory and size capsmemory opensize capssize limits
SEC03-no-host-execSEC03-no-host-exec: No host code execution via returned workNothing the agent produces executes on the host without an explicit user action; returned changes to files the host may later execute are flagged. returned work runs nothing on the hostrepository hooks offkeptunchangedkept
FR03-work-as-branchFR03-work-as-branch: Work returns as a branchThe agent never writes to the host working tree. work returns as a branchconsistent refsconsistent refsclashes acceptedhalf a push applied
NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it. refusals name the rulesays which check refusedrule in the loggit’s messagegit’s own text
NFR07-maintainabilityNFR07-maintainability: MaintainabilityMost code is cross-platform Go. fuzzing for every parserone new targetnone newone new targetone new target
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-receive hook refuses the push.
  • pre-receive hook: 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.