Skip to content

fix(http_endpoint): git pack modules get a fuel floor, not a fixed ceiling - #417

Draft
rita-aga wants to merge 2 commits into
mainfrom
claude/git-pack-fuel-floor
Draft

fix(http_endpoint): git pack modules get a fuel floor, not a fixed ceiling#417
rita-aga wants to merge 2 commits into
mainfrom
claude/git-pack-fuel-floor

Conversation

@rita-aga

@rita-aga rita-aga commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

git_upload_pack / git_receive_pack run as WASM integrations with a fixed MaxFuel. Pack emission and ingest are bulk byte-streaming — instruction count scales with repo size — so any fixed fuel ceiling silently truncates clones/pushes once a repo outgrows it. This is the recurring ARN-57 / ARN-278 / ARN-284 class: the budget was raised 20B → 100B, and temperpaw/paw-agent now exhausts even 100B on clone:

git-upload-pack ... fuel exhausted -- module exceeded instruction budget

(confirmed in production Genesis logs; clone dies with invalid index-pack output / early EOF). The persisted endpoint entity can't be PATCHed without admin scope, and a redeploy won't reset it — so raising it per-repo isn't a durable fix.

Fix

git pack modules are trusted internal modules bounded by timeout (300s) and memory (512MB), not instruction count. Give them GIT_PACK_FUEL_FLOOR = 10T that the stored MaxFuel can only raise, never lower. ~100x the last override — effectively unbounded for any realistic pack, still a runaway safety bound. Non-git endpoints are unaffected.

Tests

  • Existing git-module fuel assertions updated to the floor.
  • Added: a stored value above the floor is preserved; a non-git module's explicit fuel is untouched.
  • cargo test -p temper-server --lib http_endpoint → 21 passed.

Deploy: merge → bump the genesis submodule temper pin → redeploy genesis → verify paw-agent clone succeeds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vw8tCkfnUW8p149yUNfSEE

Greptile Summary

The PR revises the git pack fuel fix so only git_upload_pack receives a 10T minimum fuel budget, while preserving the tighter limit for client-controlled git_receive_pack.

  • Applies the fuel floor only to clone/fetch pack emission.
  • Preserves configured upload-pack budgets above the floor.
  • Keeps receive-pack and non-git endpoint fuel behavior unchanged.
  • Adds regression coverage for lower, higher, and unaffected configured budgets.

Confidence Score: 5/5

The PR appears safe to merge because the previously identified receive-pack resource-boundary issue is addressed and no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/temper-server/src/http_endpoint.rs Separates upload-pack and receive-pack fuel handling, resolving the prior concern by retaining receive-pack’s bounded 20B budget while floor-raising upload-pack.

Reviews (2): Last reviewed commit: "review(#417): scope the fuel floor to up..." | Re-trigger Greptile

rita-aga and others added 2 commits August 12, 2026 13:58
…iling

git_upload_pack/git_receive_pack are bulk byte-streaming: their instruction
count scales with repo size, so any fixed MaxFuel silently truncates
clones/pushes once a repo outgrows it — the recurring ARN-57/278/284 class
(raised 20B -> 100B, then paw-agent exhausted 100B on clone with
'fuel exhausted -- module exceeded instruction budget').

These are trusted internal modules bounded by timeout (300s) and memory
(512MB), not instruction count. Enforce GIT_PACK_FUEL_FLOOR = 10T for them:
the endpoint's stored MaxFuel can only raise it, never lower it. ~100x the
last manual override — effectively unbounded for any realistic pack while
remaining a runaway safety bound. Non-git endpoints are unaffected.

Tests: existing git-module fuel assertions updated to the floor; added
coverage that a stored value above the floor is preserved and non-git
modules are untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vw8tCkfnUW8p149yUNfSEE
Addresses codex P1 + Fable P2: receive-pack (ingest) runs unauthenticated
on CLIENT-controlled pack input ahead of the Cedar-gated write, so raising
its fuel would create an unauthenticated attacker-controlled-work surface.
The floor now applies ONLY to upload-pack (clone/fetch — work bounded by the
server's own repo size, which is the actual blocker for large-repo clones);
receive-pack keeps its tight 20B bound. Added a test locking receive-pack
out of the floor. The proper DoS control (rate-limiting the public git
endpoints) is tracked in ARN-311.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vw8tCkfnUW8p149yUNfSEE
@rita-aga
rita-aga marked this pull request as draft August 12, 2026 18:24
@rita-aga

Copy link
Copy Markdown
Collaborator Author

Holding as draft. Codex's P1 (unauthenticated public upload-pack + effectively-unbounded fuel + no admission control) is valid and I'm not shipping the fuel floor without addressing it. Proper path per ARN-278/ARN-311: either gate the floor to authenticated requests, or land admission/rate-limiting (ARN-311) first. Decoupling the katagami design work from this infra track for now.

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