Skip to content

About

GitHub-compatible git forge entry for the make.fun github-core-clone-01 bounty

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-core-clone-01 — a GitHub-compatible git forge

A standalone forge serving git smart HTTP, REST v3, GraphQL v4 and MCP from one process and its own in-memory store. No UI, no outside service, Node stdlib only.

Run

node --experimental-strip-types main.ts

main.ts is the entry <-> env lifecycle from the kit (bind an ephemeral port, register it with $MAKEFUN_ENV_URL, poll /done). The server itself is app.ts plus src/: store.ts (the forge's state, trees, commits and merges), git.ts (smart HTTP: v0/v2 advertisements, ls-refs, fetch, receive-pack), rest.ts (REST v3), graphql.ts (a small GraphQL executor for the documents gh sends) and mcp.ts (MCP over Streamable HTTP, revision 2026-07-28).

Identity

The bearer token names the scenario's viewer (adaiversen, the login the kit's seeded scenario assigns the token owner); every repository belongs to that login and any other owner reads as a 404. Global Relay ids are opaque base64url values (Repository:<databaseId>, Issue:<repo>:<number>, …) and stable across reads.

Design notes

  • Git objects are stored verbatim from the packs clients push, so clones recompute to the same SHA-1s. Packs the server sends are plain objects (no deltas) with a valid SHA-1 trailer, sideband-framed; fetch honours haves, depth and shallow boundaries.
  • Receive-pack validates fast-forwards per ref and reports ok / ng <ref> non-fast-forward per ref; a refused update still unpacks.
  • Pull requests squash-merge with a three-way conflict check against the base tip at creation; issues and pull requests share one per-repository number sequence, as on GitHub.
  • Server-made commits (contents API, squash merges) use a deterministic clock (a fixed epoch plus a per-forge counter), so the same request sequence produces the same commit SHAs.

License

MIT — see LICENSE.

About

GitHub-compatible git forge entry for the make.fun github-core-clone-01 bounty

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages