Skip to content

grasp: scoped reads and pending promotion reduce repeated Git reads - #17

Merged
FelineStateMachine merged 3 commits into
mainfrom
feat/grasp-promotion
Sep 4, 2026
Merged

FelineStateMachine merged 3 commits into
mainfrom
feat/grasp-promotion

Conversation

@FelineStateMachine

@FelineStateMachine FelineStateMachine commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Motivation

A historical Git retry repeatedly read immutable objects for authorization, WAL validation and promotion. The host fixture used 30 R2 GETs even with no relevant Nostr events pending. Sequential checkpoint construction also retained intermediate receipt-index nodes.

Change

  • Check relevant pending promotion work before loading packs; recheck expiry, moderation and authority after reads. Identical retries still finish interrupted promotion.
  • Pin ntig 0.2.1, its source archive and lockfile with checksums. Each buffered Git HTTP operation uses one bounded immutable read session inside the existing authority fence, including promotion. Roots remain uncached and every write reaches storage accounting.
  • Keep the two-GET advertisement path and document format limits, cache bounds and retained metadata costs.

This stacks on PR #16 without changing it. No production deployment/migration, new rates, wakes or garbage collection is included. New and existing repositories remain format 1 unless explicitly migrated separately.

Testing Completed

  • Typecheck and all 195 bindws tests pass.
  • Actual local bindws Worker + DO/R2 stock Git push/clone/fsck/incremental fetch/partial clone passes with hosting explicitly enabled and zero skipped tests.
  • Preserved backend source: 152 tests, typecheck and builds pass. Rebuilt tar contents/metadata match the supplied package; the exact supplied compressed archive stays pinned.
  • Matched correction retry: original 30 GETs / 59,569 bytes -> pending-first 23 / 47,529 -> combined 11 / 13,976, with zero PUTs/HEADs throughout. The final 11-GET count is asserted.
  • Two-GET advertisements retain accepted HEAD and hidden PR filtering. Interrupted post-root promotion recovers on identical retry. A newly moderated PR cannot reuse a committed receipt to bypass fresh authority.
  • The real host reservation adapter permits historical replay at the full owner cap with zero PUTs, rejects new metadata before publication, and preserves exact ambiguous-write reservations.
  • Fresh 260-transaction growing-tag fixture: 986 keys / 2,353,325 reserved bytes -> 757 / 2,147,926. Counts are SQL reservations, not an independent physical inventory. No existing storage is reclaimed.

The read-session default bounds retained payload to 2 MiB / 512 entries, not total request memory. Git validation still runs; the measured I/O reduction is not a production CPU or margin estimate. Retained growing-ref manifests remain material. Tenant rates and allowances are unchanged.

Responsible AI disclosure

Codex implemented and reviewed the integration with scoped subagents. Commands and isolated fixtures supply the validation evidence; deployment and migration remain separate decisions.

@FelineStateMachine FelineStateMachine changed the title grasp: pending promotion work controls pack reads grasp: scoped reads and pending promotion reduce repeated Git reads Sep 4, 2026
Base automatically changed from feat/ntig-0.2 to main September 4, 2026 22:42
@FelineStateMachine
FelineStateMachine merged commit 44f4aec into main Sep 4, 2026
1 check passed
@FelineStateMachine
FelineStateMachine deleted the feat/grasp-promotion branch September 4, 2026 22:42
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