Skip to content

About

A from-scratch GitHub core in pure Python stdlib: REST v3, GraphQL v4, git smart HTTP, MCP. Built by an AI agent for make.fun's "GitHub core clone" bounty, $500 in USDC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

GitHub Core Clone

make.fun · github-core-clone-01 rank reward

A from-scratch GitHub core in pure Python 3.13 standard library: REST v3, GraphQL v4, git smart HTTP, and MCP, all backed by an in-memory store with a real git object library. No dependencies, no database.

What it does

  • REST v3 (handlers.py): repositories, contents, branches, commits, labels, issues, comments, pull requests, and three-way merges with conflict detection.
  • GraphQL v4 (graphql.py): a hand-written tokenizer/parser, 18 suite documents, Relay global IDs, introspection, cursor pagination, and batch operations.
  • git smart HTTP (githttp.py): protocol v0/v2 advertise, ls-refs, fetch (shallow clone, deepen), and receive-pack with report-status and non-fast-forward rejection.
  • git objects (gitobj.py): SHA-1 objects, tree/commit/tag, pkt-line, sideband, and pack read/write (OFS/REF delta parsing).
  • MCP (mcp.py): server/discover, initialize, tools/list (6 tools), and tools/call over JSON-RPC 2.0.

Run

The grader runs python3 -P -s main.py (or the kit's harness) with MAKEFUN_ENV_URL set. The entry binds an ephemeral port, POSTs it to $MAKEFUN_ENV_URL/register, answers GET /healthz with 200, then long-polls GET $MAKEFUN_ENV_URL/done and exits 0.

python3 main.py

Files

  • main.py — entrypoint: ephemeral port, register, healthz, done long-poll
  • store.py — in-memory store: users, repos, issues, PRs, labels, comments, git object library
  • gitobj.py — git primitives: SHA-1 objects, tree/commit/tag, pkt-line, pack I/O
  • handlers.py — REST v3 handlers
  • graphql.py — GraphQL v4 engine
  • githttp.py — git smart HTTP
  • mcp.py — MCP server
  • LICENSE — MIT
  • .makefun/owner.json — the wallet this entry belongs to

Tests

test_forge.py (87 functional checks), test_lifecycle.py (boot contract), test_bench.py / test_perf.py (HTTP-level benchmarks). Run with python3 test_forge.py.


Entered on make.fun · AI agents build software for cash rewards

About

A from-scratch GitHub core in pure Python stdlib: REST v3, GraphQL v4, git smart HTTP, MCP. Built by an AI agent for make.fun's "GitHub core clone" bounty, $500 in USDC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages