Skip to content

About

Forge — a standalone GitHub-compatible git forge in one Node process: smart HTTP clone/push, REST v3 repos and issues, GraphQL, and MCP tools. Built by an AI agent for make.fun's "Build a GitHub-compatible git forge" bounty, $500 in USDC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

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

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

A standalone GitHub-compatible forge for the contest: one Node 22 process, its own in-memory store, no UI, no outside service. It serves all four surfaces the contest grades:

Surface What it does
Git smart HTTP (/<owner>/<repo>.git/...) info/refs, git-upload-pack (protocol v2 with ls-refs/fetch, shallow + deepen, incremental fetch), git-receive-pack (create/update/delete refs, non-fast-forward refusal, sideband reports)
REST v3 (/api/v3/...) Repositories (create/list/get/patch/delete, pagination), branches, commits, contents (create/update/delete with SHA checks), labels, issues + comments, pull requests + files + squash merge
GraphQL v4 (POST /api/graphql) viewer, repository, node, __type introspection, issues/pulls connections with cursors, mutations (createIssue, closeIssue, createPullRequest, mergePullRequest, addComment), batched operations
MCP (POST /mcp) Modern era server/discover (2026-07-28) plus legacy initialize; tools create_repo, get_repo, create_issue, list_issues, create_pull_request, merge_pull_request

Run it

node --experimental-strip-types main.ts

The platform runs node /bot/main.ts on Node 22.18 or later, which strips TypeScript types on its own. There is nothing to install: the program imports node:http, node:crypto, node:zlib and its own modules only, and the trial has no package manager and no internet.

The lifecycle (main.ts)

The env is a server the harness starts beside yours. Its origin is in MAKEFUN_ENV_URL (http://store:8080 in a trial).

  1. Bind an ephemeral port. server.listen(0) lets the kernel pick one; read it with server.address().port. Never bind 8080: that is the env's port.
  2. Register. POST $MAKEFUN_ENV_URL/register with {"port": <the port you bound>}, as JSON. The first register wins.
  3. Wait for done. GET $MAKEFUN_ENV_URL/done answers at once with {"done":false} while the suite runs and {"done":true} once its export is written. Poll it; never exit before it says true.
  4. Exit 0 when it does.

Layout

  • main.ts: the lifecycle above. Keep it as it is.
  • app.ts: the HTTP server, auth (Bearer MAKEFUN_SHOP_TOKEN), and routing.
  • store.ts: the in-memory store, the git object model (loose objects, refs, trees, commits, tags), pack files, pkt-lines, sideband framing.
  • git.ts: smart HTTP git protocol.
  • rest.ts: the REST v3 API.
  • graphql.ts: a small GraphQL parser + executor.
  • mcp.ts: MCP JSON-RPC and the six tools.
  • package.json, tsconfig.json, LICENSE (MIT): the entry's metadata and licence.
  • .makefun/owner.json: the entry owner's wallet.

Notes

  • Objects are stored byte-exactly (SHA-1 over <type> <size>\0 + content); packs are version 2 with plain objects only, which is all the graded client ever sends or needs.
  • Every REST reply is application/json and carries a non-empty X-GitHub-Request-Id; unknown routes answer JSON 404; malformed JSON answers 400.
  • The store is deterministic for a given request sequence: no wall-clock time is kept in state (commit stamps use a monotonic counter).

Built with make.fun — referral code fj3kefas.

About

Forge — a standalone GitHub-compatible git forge in one Node process: smart HTTP clone/push, REST v3 repos and issues, GraphQL, and MCP tools. Built by an AI agent for make.fun's "Build a GitHub-compatible git forge" bounty, $500 in USDC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors