Skip to content

gib: overlay module for on-chain git commit heads - #51

Draft
shruggr wants to merge 3 commits into
masterfrom
feat/gib-overlay
Draft

shruggr wants to merge 3 commits into
masterfrom
feat/gib-overlay

Conversation

@shruggr

@shruggr shruggr commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

New overlay module for gib (on-chain git): indexes commit heads, the 1-sat PushDrop coins with fields ["gib", origin, branch, root, identity] that carry the git commit object as an inscription. A coin's spend chain is the branch's push history, so each head is stored with its decoded commit and linked to the head it spent.

  • pkg/template/gib — decoder (lock-before/after, inscription prefix/suffix, raw or txid_vout outpoints, raw or hex identity), git commit parser with object id, reference encoder.
  • pkg/gib — topic tm_gib, lookup ls_gib, gib_heads table (SQLite/Postgres), REST under /1sat/gib (/repos, /identity/:id/repos, /repo/:origin, /repo/:origin/branches, /repo/:origin/branch/*, /heads, /head/:outpoint), BRC-24 lookup, SpendSync for burns, README + swagger fragment.
  • pkg/parse/gib.go — emits gib and gib:{origin} events (per-repo SSE feed for free).
  • cmd/server — init, status-handler lookups, admin engines, routes, event bridge gib/spend:gibq:gib (single worker, arrival order), optional JungleBus subscriber, runtime keys overlay.gib.*, admin UI panel.

Disabled by default (gib.mode: embedded or overlay.gib.enabled to turn on). Feeds from broadcasts through the stack; no JungleBus subscription required.

Consumer: gibhub.net. Design docs: gib-cli docs/plans/.

Test plan

  • go test ./pkg/template/gib ./pkg/gib ./pkg/parse ./cmd/server (decode variants/rejects, commit parsing vs git hash-object, mint → push → burn linking, spend-before-admit, block-height restamp, eviction, BRC-24 queries, REST routes, runtime config)
  • go build ./... && go vet; admin UI tsc -b
  • Smoke against a running stack once the CLI publishes real heads with the final field encoding (the decoder accepts both string and binary outpoints; confirm against the SDK PR)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

shruggr and others added 3 commits September 18, 2026 19:07
Adds the gib overlay (topic tm_gib, lookup ls_gib) that indexes commit
heads: 1-sat PushDrop coins with fields ["gib", origin, branch, root,
identity] carrying the git commit object as an inscription. Each head is
stored with its decoded commit and linked to the head it spent, so a
branch's push history is the coin's spend chain.

- pkg/template/gib: decoder (lock-before/after, inscription prefix/suffix,
  raw or string outpoints, raw or hex identity), git commit parser with
  object-id, reference encoder.
- pkg/gib: topic manager, lookup service (admission records spends of gib
  inputs; SpendSync records burns from indexer spend events), per-topic
  gib_heads table (SQLite/Postgres), REST routes under /gib (repos by
  activity or identity, repo summary, branches, branch history, heads),
  BRC-24 lookup, config, README, swagger fragment.
- pkg/parse/gib.go: parser emitting `gib` and `gib:{origin}` events.
- cmd/server: wiring (init, status-handler lookups, admin engines, routes,
  event bridge on gib/spend:gib -> q:gib, optional JungleBus subscriber),
  runtime config keys overlay.gib.*, admin UI panel.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ngine)

Signed, SPV-verifiable transactions submitted through the module engine
land in gib_heads with prev/next linked and the REST view matches.
BEEF storage is optional for the module (as for ordlock) so it can run
in library form and tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A commit is a DAG node: several heads may publish it (forks reuse the
forked commit verbatim) and its parents may live on another origin's
heads. gib_commit_parents plus a commit_sha index make both directions
queryable, so clients can walk history across repositories.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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