Skip to content

g1t/docs/PLAN.md

1,570 lines90,950 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Initial g1t: services, event bus, intents and attempts1# g1t plan
2
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas3g1t is where people and agents ship software together: a git platform built on Cloudflare Workers and Artifacts for
Initial g1t: services, event bus, intents and attempts4the "Build the Next-Gen Git Platform on Cloudflare" competition.
5
6- Submission closes **October 14, 2026, 11:59 PM PDT**: a 5–10 minute demo
7 video, this repository (MIT) and run instructions.
8- Judging: 50% originality and quality of the prototype for agent-oriented
9 collaboration; 25% multi-agent concurrency, coordination, context
10 preservation, review and conflict handling; 25% ease of use.
11
Agents as a team: lifecycle, merge queue, billing and a new shell12## The point
13
The plan says what g1t is for without measuring it against other products14**g1t is where a team of agents ships code, with the people they work for.**
Agents as a team: lifecycle, merge queue, billing and a new shell15
The plan says what g1t is for without measuring it against other products16Hosting git is table stakes, and g1t does it the familiar way: issues,
Agents as a team: lifecycle, merge queue, billing and a new shell17branches, pull requests, review, protected branches, people working by hand.
18None of that is the selling point. The selling point is the layer above it,
19which no forge has: **you hand g1t an outcome, and a fleet of agents converges
20it onto `main`, coordinating with each other and with you, with every decision
21on the record.**
22
23Three things only g1t does, and every feature should serve one of them:
24
251. **Outcomes, not pull requests.** The unit people work in is "make onboarding
26 work offline", not branch #4012. A brief becomes a plan of issues with
27 dependencies; agents take them as they unblock; people steer the outcome
The plan says what g1t is for without measuring it against other products28 and see it converge, rather than stopping at the pull request.
Agents as a team: lifecycle, merge queue, billing and a new shell292. **Agents that work as a team.** Agents know what the others are doing, file
30 what they find instead of widening their change, ask and answer each other
31 through the forge, and defer to people. Many agents on one codebase without
32 a human refereeing collisions.
333. **`main` that only ever moves forward.** Every change lands through checks
34 in the combination it will live in (the merge queue), failures go back to the
35 agent that wrote them, and any line can answer "why is this here?"
36
Initial g1t: services, event bus, intents and attempts37## Product model
38
Issues and pull requests replace intents and attempts39g1t keeps the two things every engineer already knows, issues and pull
40requests, and changes the assumption underneath them. A forge built for
Agents as a team: lifecycle, merge queue, billing and a new shell41people expects a few changes in flight, each watched by its author. g1t
42expects dozens of agents working at once across a project, each on its own
43issue, all of which have to land on `main`. A person assigns an issue to
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent44g1t and chooses nothing else: not how many agents, and not which
Agents as a team: lifecycle, merge queue, billing and a new shell45model. An issue can still collect more than one pull request (a second
46attempt, or someone's own agent alongside g1t's), and when it does the
47issue records which one was taken.
Initial g1t: services, event bus, intents and attempts48
49| Concept | What it is |
50| --- | --- |
Fast pages, required checks on the branch, self-hosted runners, honest incidents51| **Issue** | What should change in a repo: a bug, a feature, a question. Opened by a person, an agent or an integration such as an error tracker. Carries labels, a description that may say what done means (a Definition of done: context, never a gate), comments, and every pull request made for it. What a merge needs is the default branch's required checks: workflow statuses, the same for people and agents. |
Issues and pull requests replace intents and attempts52| **Pull request** | A proposed change in its own Artifacts fork, made by an agent or a person, usually for an issue. Any number can be open for one issue. Starts as a draft; marked ready; merged or closed. |
53| **Session** | The agent's full context for a pull request: prompt, messages, tool calls, cost. Stored with the pull request and linked from every commit it produced. |
54| **Compare view** | Every pull request for an issue side by side with diff, check results, conflicts against main and against each other, and a reviewer agent's summary. |
55| **Merge** | A person or a policy picks a pull request. A per-repo merge queue lands it. The issue closes, recording which pull request resolved it; the others for that issue close as superseded, or are rebased by their agents when the issue is kept open. |
56
57Issues and pull requests share one sequence of numbers per repository, so
58`#12` names exactly one of them.
Initial g1t: services, event bus, intents and attempts59
60Features that fall out of the model:
61
62- **Why-blame.** Click a line and see the prompt and reasoning that produced
63 it, not only the commit.
Issues and pull requests replace intents and attempts64- **Overlap radar.** Pull requests that touch the same files are flagged
65 while the agents are still working, and the agents are told.
66- **Live lanes.** Watch every pull request progress in real time.
67
68## Why issues and pull requests, not something new
69
70An earlier version of this plan merged the two into one new object, an
71"issue" holding "pull requests". That was wrong, for three reasons.
Initial g1t: services, event bus, intents and attempts72
Issues and pull requests replace intents and attempts73- **Issues come from everywhere.** People file them, agents file them, and
74 Sentry files them. Most are never worked on by whoever opened them. They
75 need their own life: labels, triage, discussion, closing as not planned.
76- **"Which change did we take?" needs two objects.** When five agents each
77 propose a change, the answer has to be recorded somewhere other than the
78 five proposals. On g1t it is on the issue: `resolved by #14`.
79- **Nobody should have to learn a word to use the product.** An engineer who
80 has used any forge can use g1t on the first day, and finds the agent
81 features where they would look for them.
Rust repos service with shipping; pull requests kept in the model82
Issues and pull requests replace intents and attempts83What g1t adds to the familiar pair:
Rust repos service with shipping; pull requests kept in the model84
Agents as a team: lifecycle, merge queue, billing and a new shell85- **Several pull requests per issue is supported**, not an accident. It
86 is the exception, for a second attempt or a competing one, but when it
87 happens the issue's page lists them with their state, and merging one
88 closes the issue with that pull request recorded and the others marked
89 superseded.
Issues and pull requests replace intents and attempts90- **A pull request can be part of the work.** Merging with "keep the issue
91 open" leaves the issue and its other pull requests alone.
92- **Every pull request has a fork and a session.** See
93 [forks and branches](https://docs.g1t.sh/concepts/forks/).
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar94- **Labels need no setup.** A repository starts with the default labels
95 (`bug`, `documentation`, `enhancement`, `question`, `dependencies`,
96 `security` and the rest), each with a color and a description, on issues
97 and pull requests alike; someone with Triage makes a new one as they use
98 it. **Milestones** gather issues and pull requests under a goal and a
99 due date. Pull requests can merge into any branch; the default branch's
100 protection holds only for those into it.
Pull requests from branches101- **The developer path is unchanged.** Push a branch, open a pull request
102 from it, get review, merge. Agents get a fork per pull request instead.
Rust repos service with shipping; pull requests kept in the model103- **Both paths meet at `main`.** The same landing rules apply to a person's
Issues and pull requests replace intents and attempts104 pull request and an agent's.
Rust repos service with shipping; pull requests kept in the model105
Initial g1t: services, event bus, intents and attempts106## Converging on main
107
Issues and pull requests replace intents and attempts108Twelve issues started together will finish at different times and touch
Initial g1t: services, event bus, intents and attempts109overlapping code. Getting them all into `main` without a person refereeing
110is the hard part, and it is handled in four places.
111
1121. **Before work starts: plan the overlap away.** A project is a graph of
Issues and pull requests replace intents and attempts113 issues. A planner agent can split a large goal into issues, predict
Initial g1t: services, event bus, intents and attempts114 which files each will touch, and add a dependency where two would collide,
115 so one starts from the other's result instead of from `main`.
Issues and pull requests replace intents and attempts1162. **While agents work: overlap radar.** Each pull request's changed files and
117 symbols are tracked as it pushes. When two pull requests from different issues
Initial g1t: services, event bus, intents and attempts118 enter the same area, both agents are told what the other is doing there.
Issues and pull requests replace intents and attempts1193. **When `main` moves: the author resolves.** Every open pull request is
120 trial-merged against the new `main`. A clean merge updates the pull request
121 silently. A conflict resumes that pull request's agent with its original
Initial g1t: services, event bus, intents and attempts122 session and the incoming change, so the conflict is resolved by the agent
123 that wrote the code and still knows why.
Issues and pull requests replace intents and attempts1244. **At landing: a speculative queue.** Approved pull requests enter the
125 repo's queue. g1t builds the combined states (`main`+A, `main`+A+B, …) and runs
126 their checks in parallel. Pull requests land in order as their combined state
Initial g1t: services, event bus, intents and attempts127 passes; one that fails is ejected back to its agent and the states behind
128 it are rebuilt. `main` only ever receives a state that passed.
129
130Landing can be fully automatic: a repo policy such as "checks pass and the
Issues and pull requests replace intents and attempts131reviewer agent approves" merges without a person.
Initial g1t: services, event bus, intents and attempts132
133## Agents aware of each other
134
Issues and pull requests replace intents and attempts135Each repo keeps a live **work registry**: for every running pull request, its
136issue, a running summary of what it has done, and the files and symbols it
Initial g1t: services, event bus, intents and attempts137has touched or plans to touch. Agents use it through MCP tools; g1t also
138acts on it without being asked.
139
Issues and pull requests replace intents and attempts140- **Before starting.** When an issue is opened, or an agent is about to
141 begin a task, g1t searches open issues and running pull requests for the same
Initial g1t: services, event bus, intents and attempts142 goal (by meaning, not wording) and for the same area of code. If a match
143 exists the agent is told who is on it and how far along, and chooses: join
144 as a deliberate racer, wait for the result, or drop the task. Duplicate
Issues and pull requests replace intents and attempts145 issues are offered for merging.
Initial g1t: services, event bus, intents and attempts146- **Finding out-of-scope work.** An agent that discovers something outside
Issues and pull requests replace intents and attempts147 its issue asks the registry who works there. If another pull request owns that
Initial g1t: services, event bus, intents and attempts148 area, it **hands off**: a note, the relevant excerpt of its session, and
149 optionally commits the receiver can take. If nobody does, it opens a child
Issues and pull requests replace intents and attempts150 issue instead of widening its own change.
151- **Asking.** An agent can put a question or a request to another pull request.
Initial g1t: services, event bus, intents and attempts152 The receiver gets it at its next turn.
Issues and pull requests replace intents and attempts153- **Waiting.** An agent that needs another pull request's result parks itself.
Initial g1t: services, event bus, intents and attempts154 Its sandbox sleeps, spend stops, and it resumes from the new state when
Issues and pull requests replace intents and attempts155 that pull request merges.
Initial g1t: services, event bus, intents and attempts156- **Agents that do not cooperate.** For pushes from tools that never call
Issues and pull requests replace intents and attempts157 these tools, g1t compares the pushed change against running pull requests and
Initial g1t: services, event bus, intents and attempts158 flags near-duplicates itself.
159
160Every handoff, question and wait has a state (offered, accepted, declined,
161done), appears in the timeline, and is visible to people. A handoff declined
162twice, or two agents passing work back and forth, goes to the "needs you"
163inbox.
164
165## Review at scale
166
167Cloudflare's brief asks "how do you review everything they produce?". With
168hundreds of agents, a person cannot read every diff, so review is by
169exception.
170
Issues and pull requests replace intents and attempts171- **Evidence, not diffs.** Every pull request carries a proof bundle: checks run
Initial g1t: services, event bus, intents and attempts172 and their output, a preview URL, a plain-language summary, and the
173 behaviour that changed.
Issues and pull requests replace intents and attempts174- **Two agent reviewers.** One reviews the change against the issue. A
Initial g1t: services, event bus, intents and attempts175 second is adversarial: it tries to break the change and reports what it
176 found.
177- **Risk tiers.** Each change is scored from what it touches, how large it
Issues and pull requests replace intents and attempts178 is, and how the reviewers ruled. Low risk merges on policy; high risk goes
Initial g1t: services, event bus, intents and attempts179 to a person with the evidence already assembled.
Issues and pull requests replace intents and attempts180- **Trust is earned.** An agent's record on a path (merged, reverted, caught
Initial g1t: services, event bus, intents and attempts181 by review) raises or lowers the tier its changes land in.
Issues and pull requests replace intents and attempts182- **Sampling.** A share of auto-merged changes is sent to a person anyway,
Initial g1t: services, event bus, intents and attempts183 to keep the policy honest.
184
185## Rethinking the git primitives
186
Issues and pull requests replace intents and attempts187- **No branches for agents.** A pull request is a fork; `main` is the only
Initial g1t: services, event bus, intents and attempts188 long-lived line. There is nothing to name, clean up or go stale.
Issues and pull requests replace intents and attempts189- **Projected main.** New pull requests start from `main` plus everything already
Initial g1t: services, event bus, intents and attempts190 in the landing queue, so they are built on the state they will land on.
191- **Structural merge.** The merge engine merges by syntax tree, not by line,
192 for supported languages. Two agents adding different functions to the same
193 file do not conflict.
194- **Forkable sessions.** A session can be forked at any turn: the code as it
195 was at that moment plus the conversation up to it, continued with a
196 different instruction. Branching applies to the reasoning as well as the
197 code.
Issues and pull requests replace intents and attempts198- **Provenance in history.** Every commit records its issue, session,
199 agent, model and cost, and is signed with a key issued to that pull request. The
Initial g1t: services, event bus, intents and attempts200 history can be audited by machine.
201
202## People in the loop
203
204### Code that arrives from outside
205
206People will keep pushing with plain git, their editor, or another tool. Every
207push goes through g1t's git front end, so none of it bypasses the model.
208
Issues and pull requests replace intents and attempts209- **A push to a branch becomes a pull request.** g1t adopts it with the pusher as
210 author. A reviewer agent writes the issue it appears to serve and offers
211 to attach it to an open issue it matches. From there it gets the same
212 checks, compare view and queue as agent work.
Initial g1t: services, event bus, intents and attempts213- **A push to `main` follows repo policy.** Protected: refused with a message
214 saying which ref to push to instead, so it enters the queue. Open: accepted
215 and treated as "`main` moved", which re-verifies the queue and triggers
Issues and pull requests replace intents and attempts216 resolve-on-move for every open pull request.
Initial g1t: services, event bus, intents and attempts217- **Context is an open format.** A commit trailer names the session that
218 produced it, so any tool can attach its transcript. Commits without one are
219 shown in why-blame as "pushed by a person, no session".
Issues and pull requests replace intents and attempts220- **Approval rules.** Per repo and per path: merge automatically, require a
Initial g1t: services, event bus, intents and attempts221 named person, or require a person when the change is large or the reviewer
222 agent is unsure.
223
224### Joining work that is already running
225
226- **Every session has a live page** that works on a phone: the transcript as
227 it streams, the current diff, check results.
228- **Steer.** Send a message, pause, or redirect. Hosted agents receive it
229 immediately; a person's own Claude Code receives it at its next turn
230 through the CLI hooks.
231- **Answer.** When an agent is blocked on a question, it appears in a "needs
232 you" inbox and as a notification. The answer resumes the agent.
Issues and pull requests replace intents and attempts233- **Take over and hand back.** Check out the pull request's fork, commit by hand,
Initial g1t: services, event bus, intents and attempts234 push, and let the agent continue from there.
235
236### Planning by writing
237
238- **Brief.** Write the outcome in prose on the site, or commit it as a
Fast pages, required checks on the branch, self-hosted runners, honest incidents239 markdown file. A planner agent turns it into a project: issues, each with
240 what done means, and dependencies. The person edits the graph before anything starts.
Initial g1t: services, event bus, intents and attempts241- **Plan from their own agent.** The same operations are MCP tools, so a
242 person can plan in their own Claude Code session and create the project
243 from there.
244- **The brief stays the source of truth.** Editing it later re-plans: new
Issues and pull requests replace intents and attempts245 issues are added, obsolete ones are closed.
Initial g1t: services, event bus, intents and attempts246
247### Seeing what moved
248
Issues and pull requests replace intents and attempts249- **Project page.** The outcome, the issue graph coloured by state, and how
Fast pages, required checks on the branch, self-hosted runners, honest incidents250 many of its issues have landed with their required checks passing,
251 compared with when the project started.
Initial g1t: services, event bus, intents and attempts252- **Digest.** An agent-written summary per project and per person: what
Issues and pull requests replace intents and attempts253 merged, what is blocked on whom, which conflicts were resolved, what it
Initial g1t: services, event bus, intents and attempts254 cost.
Issues and pull requests replace intents and attempts255- **Timeline.** Every event (push, steer, check, conflict, merge) in order,
Initial g1t: services, event bus, intents and attempts256 each linked to the session and the person or agent behind it.
257
258## One session, any surface
259
260A session belongs to g1t, not to the device it started on. The browser, a
261phone and Claude Code are views of the same session.
262
263- **Browser and phone.** The site is a responsive, installable web app with
264 push notifications. Everything a person does (brief, steer, answer,
Issues and pull requests replace intents and attempts265 approve, merge) works there.
Initial g1t: services, event bus, intents and attempts266- **Claude Code.** Through `mcp.g1t.sh` and the CLI hooks, a local session is
267 a g1t session: its transcript syncs as it runs and it appears in mission
268 control like any other.
269- **Moving a session.** A local session can be sent to the cloud: a hosted
270 agent takes over the fork and the transcript and continues, so the laptop
271 can close. A hosted session can be pulled down: the CLI checks out the fork
272 and resumes it in local Claude Code with its history.
273- **Limit.** A session running only on a laptop stops when the laptop does.
274 It can be steered between turns but not continued until it is moved or the
275 laptop is back.
276
277## For people who do not write code
278
279- **Documents are first-class.** Specs, guides, policies and decisions live
280 in repos as markdown, shown in a Docs view: rendered pages, edited in the
281 browser like a document, with inline comments. "Suggest a change" is an
Issues and pull requests replace intents and attempts282 pull request and "publish" is merge, without git vocabulary.
283- **Document issues.** "Write the onboarding guide for the billing API" is
Fast pages, required checks on the branch, self-hosted runners, honest incidents284 an issue. Its Definition of done is a checklist judged by a reviewer agent
285 instead of a workflow. Agents draft and revise; people comment and approve.
Initial g1t: services, event bus, intents and attempts286- **Templates.** Product brief, RFC, decision record. A filled-in template is
287 a brief the planner can turn into a project.
288- **Explain.** Ask about any repo, project or change in plain language and
289 get an answer with links to the code and sessions behind it.
290- **Living documentation.** g1t generates "how this works" pages from the
Issues and pull requests replace intents and attempts291 code and keeps them current. When a merged change contradicts a document,
292 an issue opens to update it.
293- **See it, don't read it.** Every pull request on a deployable repo gets a
294 preview URL (Workers Builds from the pull request's fork), so an approver clicks
Initial g1t: services, event bus, intents and attempts295 through the result instead of reading a diff. Changes are also summarised
296 in plain language.
297- **Roles.** Viewer, commenter, planner, approver: a person can plan and
298 approve work without ever cloning a repo.
299
300## The macro view
301
302The hierarchy above a single repo:
303
304| Level | What it is |
305| --- | --- |
306| **Workspace** | A company or team: its people, repos, agents, budget and policies. |
307| **Initiative** | A business outcome with an owner and measurable results, e.g. "move billing to usage-based pricing". Spans any number of repos. |
Plan: Projects, the home of everything about running software308| **Outcome** | One deliverable inside an initiative: a brief and its graph of issues (shown as **Plan**). Called "project" before 2026-10-04; that name now means what [Projects](#projects) describes. |
Issues and pull requests replace intents and attempts309| **Issue / Pull request** | As above. An issue may touch several repos; a pull request for it then holds one fork per repo and they land together. |
Initial g1t: services, event bus, intents and attempts310
Agents as a team: lifecycle, merge queue, billing and a new shell311How it feeds up, and what is built:
312
313- **A workspace is the unit everything belongs to.** Repositories, people,
314 access tokens, and later projects, budgets and policies are the
315 workspace's, never a person's. An account owns nothing; its first step
316 after confirming its email is creating a workspace, and the site sends it
317 there from wherever it was going.
318- **One namespace.** Usernames and workspaces share one set of names, as on
319 Docker Hub and npm. A username is reserved for its owner's workspace, so
320 `g1t.sh/<name>` never means two things.
321- **The workspace page is the roll-up.** `g1t.sh/<workspace>` shows its
322 repositories with their open issues and pull requests, and the pull
323 requests in progress across all of them. Projects and initiatives will
324 roll up to the same page. Its own pages live under `/<workspace>/-/`
325 (people, access tokens, settings), which no repository can be named.
326- **Workspace access tokens instead of service accounts.** A workspace has
327 tokens of its own, in the same table and code path as personal ones. One
328 acts as the workspace, with a member's rights in that workspace only,
329 records who made it and when it was last used, and keeps working when
330 that person leaves. CI, integrations and automations use these.
331
Initial g1t: services, event bus, intents and attempts332### Portfolio
333
334One page answers "where is the business" across every initiative:
335
336- **Health** per initiative: on track, at risk, or blocked, derived from
Issues and pull requests replace intents and attempts337 facts (checks passing, issues stalled, questions waiting on a person),
Initial g1t: services, event bus, intents and attempts338 not self-reported.
Fast pages, required checks on the branch, self-hosted runners, honest incidents339- **Progress** as measurable results: required checks passing, issues
Issues and pull requests replace intents and attempts340 merged out of planned, and the trend since the start.
Initial g1t: services, event bus, intents and attempts341- **Forecast** from actual throughput: at the current rate, when the
Issues and pull requests replace intents and attempts342 remaining issues land.
Initial g1t: services, event bus, intents and attempts343- **Spend** in tokens and dollars against a budget, per initiative.
344- **Waiting on people**: every decision or approval a person owes, by name.
345- **Roadmap**: initiatives laid out as now, next, later, with optional
346 time-boxed cycles for teams that work in sprints.
347
348### Status without asking
349
350- **Standup.** An agent writes a daily report per initiative and one for the
Issues and pull requests replace intents and attempts351 whole workspace: what merged, what changed direction, what is at risk and
Initial g1t: services, event bus, intents and attempts352 why, what needs a person. Delivered by email or webhook.
353- **Ask.** A question box over the full event log and all sessions: "what
354 happened on the billing migration since Monday?" answers with links to the
355 sessions and commits behind each claim.
356
357### Long-running agents
358
359Work that runs for days needs supervision that does not depend on someone
360watching.
361
Issues and pull requests replace intents and attempts362- **Checkpoints.** A long pull request reports milestones against its issue, so
363 progress is visible before anything merges.
364- **Stall and drift detection.** A pull request with no meaningful progress, or
365 whose changes have wandered away from its issue, is flagged and can be
Initial g1t: services, event bus, intents and attempts366 stopped or re-briefed automatically.
Issues and pull requests replace intents and attempts367- **Budgets.** Hard limits on spend and time per pull request, project and
Initial g1t: services, event bus, intents and attempts368 initiative.
369
370### Context hub
371
372Agents working across repos and days need context that outlives any one
373session and reaches beyond the code. The context hub is one place an agent
374asks, whatever the source.
375
376| Source | What it holds | How it gets there |
377| --- | --- | --- |
378| **Memory** | Decisions, conventions, gotchas, facts about systems | Written by agents and people in g1t |
379| **Code and sessions** | The repos, and the reasoning behind every change | Already in g1t |
380| **Connected sources** | Jira and Linear tickets, Notion and Confluence pages, Google Drive documents, Slack threads, Sentry issues | Connectors, authorised per workspace |
381
382How it behaves:
383
384- **One search.** An agent asks a question and gets ranked results across
385 all sources, each labelled with where it came from, who wrote it, and how
386 fresh it is.
387- **Connected sources stay where they are.** g1t indexes them for search and
388 fetches the current version when an agent opens one. The external system
Issues and pull requests replace intents and attempts389 remains the source of truth, and a link placed on an issue ("see
Initial g1t: services, event bus, intents and attempts390 JIRA-482", a Notion URL) is pulled into the agent's starting context.
391- **Permissions carry over.** A connector only exposes what the connecting
392 account can see, and a workspace admin chooses which spaces, projects or
393 channels are included.
394- **External content is untrusted.** A ticket or page can contain text meant
395 to manipulate an agent. It is marked as reference material, never treated
396 as instructions.
397- **Documentation is separate.** Context is what agents know; documentation
398 is what people read, and it is generated from context and code.
399
400Memory is the part of the hub that g1t owns and agents write to:
401
402- **Memory is written freely.** Any agent or person adds an entry with one
403 call: a decision, a convention, a gotcha, a fact about a system. No review
404 gate. Each entry records who wrote it, from which session, and when.
405- **It is still a repository.** Each workspace has a memory repo in
406 Artifacts, so every write is a commit: versioned, attributable, and
407 revertible.
408- **It is kept healthy by an agent.** A consolidation agent merges
409 duplicates, retires entries that newer ones contradict, and flags
410 conflicts it cannot settle. People can pin an entry (agents may not change
411 it), correct it, or retract it.
412- **Agents read it.** Every session starts with the context relevant to its
Issues and pull requests replace intents and attempts413 issue, found by search, and can query more through MCP.
Initial g1t: services, event bus, intents and attempts414- **Updates are events.** A memory write or a change in a connected source
415 is an event, so "when context changes, update the affected docs" is an
416 automation, on by default.
417- **It is scoped inside the workspace.** Some context applies to the whole
418 workspace, some to one initiative, project or repo, so an agent gets what
419 applies to its work.
420- **It never crosses workspaces.** A workspace is the isolation boundary: its
421 context, sessions and private repos are invisible to every other
422 workspace, and an agent's token is bound to one workspace.
423
424## Working in g1t
425
426- **Mission control.** The signed-in home page: every running session, every
Issues and pull requests replace intents and attempts427 issue waiting on a decision, and what merged, across all repos.
Plan: Projects, the home of everything about running software428- **Outcomes.** Group issues across repos toward one result and track how
429 many are open, racing, or merged. (What [Projects](#projects) means is
430 below.)
Issues and pull requests replace intents and attempts431- **Steering.** Send a message to a running pull request, or to all pull requests on an
432 issue at once, without stopping them.
Initial g1t: services, event bus, intents and attempts433- **Automations.** Rules that start work without a person (next section).
434
435## Automations and integrations
436
Sidebar: the panels really slide437> **2026-10-03:** g1t's own `.g1t/automations` format was built and then set
438> aside at the user's request ("let's just copy GitHub Actions on that for the
439> time being"). Automation on g1t is GitHub Actions workflows in
440> `.g1t/workflows/`; the format below is kept for later.
441
Initial g1t: services, event bus, intents and attempts442An automation is **when** an event happens, **if** conditions hold, **do**
443something. They are defined as files in the repo (`.g1t/automations/`), the
444way GitHub Actions workflows are, and can also be built in the UI.
445
446### Events that can trigger one
447
448| Source | Examples |
449| --- | --- |
Issues and pull requests replace intents and attempts450| Git | push, merge, check failed, `main` moved |
451| g1t | issue opened, pull request stalled, context updated, handoff declined, budget reached |
Initial g1t: services, event bus, intents and attempts452| Time | cron schedule |
453| Integrations | Sentry issue, PagerDuty incident, Linear or Jira ticket, Slack message or mention, GitHub issue, Stripe event |
454| Anything else | a signed generic webhook, or an email to a per-repo address |
455
Issues and pull requests replace intents and attempts456**Actions**: open an issue (optionally assigning N agents to it), message
457a running pull request, update documentation, notify, call a
Initial g1t: services, event bus, intents and attempts458webhook, write back to the source system.
459
460**Example: Sentry.** A new production error arrives. The automation opens an
Issues and pull requests replace intents and attempts461issue labelled `bug`, with the stack trace, release and frequency in its
462description. Why-blame
Initial g1t: services, event bus, intents and attempts463finds the session that wrote the failing line, so the fixing agent starts
Issues and pull requests replace intents and attempts464with the original reasoning. When the fix merges, g1t comments on the Sentry
Initial g1t: services, event bus, intents and attempts465issue and resolves it.
466
467### Rules every automation obeys
468
469- **Deduplication.** The same Sentry issue firing 500 times maps to one
Issues and pull requests replace intents and attempts470 issue.
Initial g1t: services, event bus, intents and attempts471- **Limits.** Concurrency and budget caps per automation.
472- **Loop protection.** Work started by an automation cannot retrigger the
473 same automation without a person in between.
474- **External input is untrusted.** A webhook payload can contain text written
475 by an attacker. Agents started by external events run with reduced
Issues and pull requests replace intents and attempts476 permissions and cannot merge without the repo's approval rule passing.
Initial g1t: services, event bus, intents and attempts477
478**Checks** are the other half of what GitHub Actions does: build and test
Issues and pull requests replace intents and attempts479commands declared in `.g1t/checks.yaml`, run in sandboxes on every pull request
Initial g1t: services, event bus, intents and attempts480and on every combined state in the landing queue.
481
482Agents can also reach integrations directly: an agent definition lists MCP
483servers (Sentry, Linear and so on) it may use while working.
484
Plan: a repository that maintains itself, and deployments on g1t.page485## A repository that maintains itself
486
487> **2026-10-04:** the user asked for Dependabot, GitHub Advanced Security and
488> Vercel-style deployments, "so you're not having to maintain shit and you're
489> just pushing up agents that are delivering work consistently".
490
491GitHub reports problems and leaves the fix to you. In g1t, an agent opens an
492issue for each problem, writes the fix, runs its checks, links a preview and
493lands it through the queue. People only decide.
494
495### Upkeep agents
496
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar497- **Dependency updates.** The file is `dependabot.yml` version 2, read from
498 the default branch at `.g1t/dependabot.yml` (or `.yaml`), then
499 `.github/dependabot.yml` (or `.yaml`); `.g1t/` wins when both exist, and
500 an imported repository's file works unchanged. Every option is read and
501 checked, each problem reported with its line and key on the Security page
502 and as the `g1t / dependabot.yml` status on pull requests that change the
503 file; a file with problems is not acted on.
504 - **Built (2026-10-07):** version updates for npm, cargo, gomod and pip:
505 schedules (all intervals, cron and natural phrases, time zones, a
506 picked time per repository), allow, ignore, cooldown (3 days by
507 default), groups (including across directories and `group-by`),
508 versioning strategies, open-pull-requests-limit, commit-message,
509 branch names, rebase-strategy, assignees, reviewers, private
510 registries filled from workflow secrets (npm, cargo, Go proxy, Python
511 index), and the `@g1t` comment commands. Pull requests come from g1t
512 with an `updated-dependencies` commit record and land through the
513 required checks; one that fails them is closed and becomes a
514 "needs code changes" issue assigned to g1t.
515 - **Security updates follow the same file:** ignore (and comment
516 ignores), allow names, `applies-to: security-updates` groups,
517 commit-message, assignees, reviewers, labels and milestone. Cooldown
518 and the open pull request limit do not apply. The Security updates
519 switch still turns them on and off.
520 - **Labels, milestone and target-branch** are applied to version
521 updates: `dependencies` and the ecosystem's label by default, missing
522 labels created; `target-branch` updates are made from that branch and
523 merge into it.
524 - **Not done yet:** one pull request for a multi-ecosystem group
525 (it opens one per ecosystem); registries that sign in with OIDC;
526 updating vendored copies; and version updates for the other
527 ecosystems (bundler, composer, docker, github-actions, gradle, maven,
528 nuget, terraform, uv and the rest are read and checked only).
Plan: a repository that maintains itself, and deployments on g1t.page529- **Secret scanning.** Pushes are scanned for known token formats. A push
530 that adds a secret is refused with the file and line; one already in
531 history opens an issue to rotate it and remove it.
532- **Vulnerability alerts.** Dependencies are matched against the OSV
533 database. Every alert links to the issue and pull request fixing it.
534- **Code scanning.** A reviewer agent reads each pull request's diff for
535 security problems and leaves findings as review comments with a
536 suggested fix. Findings on `main` open issues.
537- **A security page per repository** lists alerts, secrets and findings,
538 with the agent work on each, like GitHub's Security tab.
539
540All of these are event sources for the existing issue → agent → checks →
541queue pipeline; they need no new kind of work.
542
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar543### The security suite (built 2026-10-07)
544
545GitHub Advanced Security's depth, in g1t's shape (services/security,
546`g1t_contracts::security_suite`, docs `guides/security/*`):
547
548- **Secret protection.** Custom patterns (repository and workspace; Rust
549 `regex`, linear time, size-limited; test strings; dry run over the
550 default branch) used by push protection, `commit_file` and history
551 scans. Bypass with a reason (false positive, used in tests, will fix
552 later), recorded on the alert and in the audit log; delegated bypass
553 (requests reviewed by owners and repository admins, through the inbox).
554 Validity checks for GitHub, GitLab, Stripe, Slack, npm, OpenAI,
555 Anthropic and SendGrid tokens, made by the repos service, which reads the
556 landed secret again: the value never leaves it except to the issuer. AWS
557 keys (need their secret key to sign) and webhook addresses (would post)
558 are the extension points left (`g1t_scan::validity::check_for`).
559- **Code scanning.** SARIF 2.1.0 uploads → alerts with fingerprints (tool
560 partial fingerprints first), fixed when no longer reported; pull request
561 uploads → line comments and the `Code scanning` commit status, gated by a
562 per-repository threshold and required like any check. Starter workflow:
563 a scanner per language present, each uploading its own category: Bandit
564 (Python), gosec (Go), ESLint + eslint-plugin-security with the SARIF
565 formatter (JS/TS), Clippy + clippy-sarif (Rust); all install from the
566 registries the runner's egress already allows. Semgrep's registry rules
567 and the Opengrep rules fork are not usable in a paid feature, so neither
568 is used. "Fix with g1t" opens an issue and runs the agent.
569- **Supply chain.** Dependency graph (direct/transitive where the lockfile
570 says, npm licenses), SPDX 2.3 SBOM, `Dependency review` status on every
571 pull request (OSV severity threshold, license deny list, summary comment).
572- **Overview.** Workspace totals, opened/closed, a daily snapshot trend,
573 coverage, repositories most in need first.
574- **Paid.** The Security and quality activation on private repositories;
575 free on public ones; the free core (secret scanning, push protection,
576 vulnerability alerts, security updates, dependency graph) free everywhere.
577
578Not built yet:
579
580- **The reviewer agent as an analysis source.** g1t's reviewer reads each
581 pull request's diff (`agent_review`), but its findings are review
582 comments, not SARIF. Next: have it emit SARIF for the security issues it
583 finds and upload them as the tool `g1t review`, so they become alerts and
584 count toward the Code scanning check.
585- **Repository security advisories.** Private advisories, draft →
586 published, with affected versions (ranges per ecosystem), severity and a
587 CVSS vector, credits, and a private fork (a `g1t/advisory/GHSA-…` working
588 copy only the advisory's collaborators can see) for the fix, merged into
589 the default branch when the advisory publishes. Published advisories
590 should feed the OSV-shaped data other g1t repositories' vulnerability
591 alerts read. CVE requests are out of scope. Needs: an `advisories` table
592 per repository, a collaborator list per advisory, the private-fork
593 visibility rule in repos, and an Advisories page on the Security tab.
594- **SARIF upload as a background job.** Uploads are read in the request
595 (10 MB encoded, 40 MB unzipped, 5,000 results); larger ones need a queue.
596
Plan: a repository that maintains itself, and deployments on g1t.page597### Deployments
598
599- **A preview for every pull request**, at
600 `<pr>--<repo>--<owner>.g1t.page`, linked on the pull request and updated
601 on each push. `main` deploys to `<repo>--<owner>.g1t.page`, and a
602 repository can add its own domain.
603- **On g1t.page, not g1t.sh,** so customer code never shares cookies or an
604 origin with the site people sign in to.
605- **Built on Workers for Platforms.** Each deployment is a user Worker in a
606 dispatch namespace; one dispatch Worker on `*.g1t.page` routes to it. The
607 build runs in the same runners as Actions. Static sites and Workers apps
608 first; container apps and databases later.
609- **Agents use the preview.** The reviewer agent opens the preview in a
610 browser, takes screenshots of what changed and attaches them to its
611 review, so an approver sees the result without reading the diff.
612- **Environments.** Preview, production and their secrets; deploy history
613 and one-click rollback.
614- **Scale to zero.** An idle branch costs neither g1t nor the customer
615 anything: a Worker runs, and is billed, only while it answers a request.
616 A preview is deleted when its pull request closes or merges, and after
617 a set number of idle days. Container apps, later, sleep when idle.
Plan: deployments are billed to the customer, never free618- **Billed to the customer, never free.** The user (2026-10-04): "we
619 should not be giving any of this available for free". Every deployment
620 is metered per workspace (requests, CPU time, deployed apps, stored
621 data), priced at Cloudflare's cost + 20% like agent usage, and drawn
622 from prepaid credit. `FREE_WHILE_BUILDING` and the free model allowance
623 do not cover deployments: a workspace without credit cannot deploy, and
624 turning deployments on says so first.
Plan: turning deployments on is a paid monthly plan625- **Turning them on is a paid plan, the way Cloudflare's is.** "Including
626 things like them even enabling the feature should have that pay like
627 Cloudflare does." Enabling deployments for a workspace starts a monthly
628 fee that includes an allowance of requests, CPU time and deployed apps;
629 usage past it is billed per unit, as Workers for Platforms bills g1t.
630 The fee and allowance are the user's to set.
631- **Recommended, off in one click.** Because enabling costs money, it is
632 never switched on without the workspace agreeing: new repositories
633 recommend it prominently. A repository can turn it off, keep only production, or
Plan: a repository that maintains itself, and deployments on g1t.page634 deploy somewhere else from its own workflows. Apps built for Cloudflare
635 (Workers, static assets, D1, KV, R2) deploy without configuration.
636
637Later, toward GitLab's DevOps breadth: environment protection rules,
638package and container registries, releases, container hosting.
639
Plan: Projects, the home of everything about running software640## Projects
641
642> **2026-10-04:** the user: "an extra dimension of Projects so it's not
643> just repositories … where a lot of things can live", "very Vercel
644> like", with dependencies across projects "the Platform Engineering /
645> Port route", and "the repository is *part* of a project: you could be
646> mirroring it from GitHub/GitLab/Bitbucket, or you could let us host it
647> for you", with room for Mercurial or anything else later.
648
649**A project is the thing you are building and running; a repository is
650where some of its code lives.** Everything that is about running software
651(deployments, environments, domains, secrets, dependencies, owners,
652health, upkeep) belongs to the project. What is about the code itself
653(branches, pull requests, review, merge rules) stays with the repository.
654That split is what lets the code live anywhere.
655
656### The model
657
658| | What it is | Like |
659| --- | --- | --- |
660| **Workspace** | The company or team. Members, billing, plans, shared secrets. | Vercel team, GitLab group, GitHub org |
661| **Group** | An optional named set of projects, one level: "Payments", "Mobile". For browsing, ownership and shared settings. | GitLab subgroup, Backstage system, Port domain |
662| **Project** | One deployable thing: a site, an API, a worker, a library. Has exactly one **source**. | Vercel project, Port service, Backstage component |
663| **Source** | Where its code is: a repository and a **root directory** in it. | Vercel's connected repo + root directory |
664| **Dependency** | Project A uses project B: calls its API, consumes its package, reads its queue. | Port relations, Backstage `dependsOn` |
665
666- **One project, one source; one repository, any number of projects.** A
667 project builds from exactly one place, which keeps it as simple as
668 Vercel's. A monorepo is several projects on one repository, each with
669 its own root directory (`apps/web`, `services/api`), and a push builds
670 only the projects whose root it touched. The common case stays 1:1, and
671 every existing repository gets a project of its own name when this
672 ships, so nobody has to set anything up.
673- **Groups are for people; dependencies are for software.** Groups decide
674 where a project shows up and who owns it. Dependencies decide what
675 happens when one changes. Neither replaces the other, and a dependency
676 can cross groups.
677
678### Sources: where the code lives
679
680A source is an adapter behind one interface (`SourcePort`: clone URL,
681branches, commits, pushes as events, pull requests if it has them):
682
683| Source | Code lives | g1t gets pushes by | Pull requests |
684| --- | --- | --- | --- |
685| **Hosted on g1t** (today) | Artifacts | its own events | g1t's, with agents, the queue, review |
686| **Mirrored** from GitHub, GitLab or Bitbucket | Both; g1t keeps a copy | the provider's webhook, then fetch | The provider's, read into g1t; agents open theirs there |
687| **Connected, not copied** | The provider only | webhook | The provider's |
688| **Later:** Mercurial, Perforce, a tarball upload | Behind the same port | per adapter | per adapter |
689
690A mirrored or connected project still gets everything that is the
691project's: previews on its pull requests (a status and a comment on
692GitHub's), production on its default branch, secrets, dependencies,
693upkeep agents. That is the on-ramp: a team keeps GitHub and gets g1t's
694deployments and agents first, and moves the code later or never.
695Bring-your-own-git is also why the project, not the repository, holds the
696URL `g1t.sh/<workspace>/<project>`.
697
698### What lives on a project
699
700| | Today it is on | Moves to the project |
701| --- | --- | --- |
702| Deployments: production, previews, build settings, root directory, framework | The repository | Yes |
703| Environments: production, preview, and custom ones (`staging`) with protection rules (required approvers, branch limits) | Nowhere yet | New, on the project |
704| Domains: `<project>--<workspace>.g1t.page`, and custom domains | The repository's name | Yes |
705| Secrets and variables | The repository | Yes. Workspace rows link to projects instead of repositories. A repository's workflows read the rows of its project (with several projects on one repository, the one marked as the repository's default). |
706| Dependencies | Nowhere | New |
707| Owners, on-call, links (docs, dashboards, runbooks) | Nowhere | New: the catalog's metadata |
708| Health: scorecards (has an owner, CI passes, dependencies current, no open security alerts, deploys within N days) | Nowhere | New |
709| Upkeep agents: dependency updates, security alerts | The plan | Scoped per project |
710| Logs and analytics of the running app | Nowhere | New: requests, errors and CPU per environment, from Workers analytics |
711| Branches, pull requests, review, merge rules, the queue, webhooks | The repository | Stay |
712
713### Dependencies: why this gets powerful
714
715Declared in the UI, or in the source as `.g1t/project.yml` (which wins
716when present, as `catalog-info.yaml` does in Backstage):
717
718```yaml
719name: web
720root: apps/web
721dependsOn:
722 - project: api # calls its HTTP API
723 as: API_URL # its URL, per environment, as a variable
724 - project: ui-kit # consumes its package
725```
726
727What g1t does with them:
728
7291. **Reference variables.** `API_URL` above resolves to `api`'s production
730 URL in production and to the matching preview in a preview, the way
731 Railway's `${{ api.URL }}` references work. No hard-coded URLs.
7322. **Preview stacks.** A pull request on `api` gets its own preview, and
733 **Preview with dependents** builds `web`'s preview pointed at it, so a
734 reviewer clicks through the whole change across projects. A change that
735 spans repositories (one issue, one fork per repository) gets one stack.
7363. **Release order.** Production deploys go out in dependency order; a
737 change set across projects lands through the queue together or not at
738 all.
7394. **Impact on every pull request.** "Changes `api`; `web` and `mobile`
740 depend on it." Agents get the graph in their context: an agent
741 changing an API opens follow-up issues on the projects that call it,
742 and reviewers see what else could break.
7435. **Upkeep across the graph.** A vulnerable package in `ui-kit` opens
744 issues, assigned to agents, on every project that consumes it.
7456. **Scorecards turn into work.** A project failing a scorecard check
746 ("no owner", "dependencies 90 days old") gets an issue an agent can fix.
747 That is the Port idea with the work done for you.
7487. **The map.** A workspace's projects as a graph, coloured by health and
749 by what is deploying now.
750
751### Pages
752
753- `g1t.sh/<workspace>`: projects first (grouped, with health and
754 production status), then repositories.
755- `g1t.sh/<workspace>/<project>`: overview (production, latest previews,
756 health, owners, dependencies both ways), **Deployments**,
757 **Environments**, **Secrets and variables**, **Logs**, **Settings**
758 (source, root directory, build, domains, groups, owners).
759- A hosted repository keeps its code pages; from a project they are its
760 **Code** tab. A repository page lists the projects built from it.
761
762### Services
763
764- `services/projects` (new): projects, groups, sources, dependencies,
765 owners, scorecards. Events `project.created`, `project.updated`,
766 `dependency.changed`.
767- `services/deployments`: keyed by project instead of repository.
768- Secrets and variables: the scope becomes workspace → project.
769- Sources: the hosted adapter wraps `services/repos`; a mirror adapter
770 per provider in `services/integrations`, which already holds those
771 connections.
772
773### Build order
774
7751. **Projects as the home of deployments and secrets**, 1:1 with every
776 existing repository: the service, the pages, deployments and secrets
777 moved to the project, `<project>--<workspace>.g1t.page`.
7782. **Dependencies:** declared in the UI and `.g1t/project.yml`, reference
779 variables, impact on pull requests and in agents' context, the map.
7803. **Preview stacks** and cross-project change sets.
7814. **Monorepos:** several projects on one repository, each with a root
782 directory, building only what a push touched.
7835. **Mirrored sources:** GitHub first, then GitLab and Bitbucket.
7846. **Groups, owners, scorecards** feeding the upkeep agents.
7857. **Environments** with protection rules; custom domains; logs.
786
Projects: what a workspace builds and runs, first on every page787**Step 1 shipped 2026-10-04:** `services/projects`; every repository a
788project of its own name; the site projects-first (workspace page of
789project cards, the project overview at `g1t.sh/<workspace>/<project>`, code
790under `/code`, the sidebar and the New project flow); deployments keyed by
791project and branch at `<project>-<workspace>.g1t.page` and
792`<project>-git-<branch>-<workspace>.g1t.page`; secrets and variables owned
793by the project.
794
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look795**Step 5, GitHub, built 2026-10-05:** one GitHub App (`g1t-sh`) for both
796sign-in and repository access. Sign-in is its user authorization with PKCE
797(identity, `src/github.rs`): accounts known by GitHub's numeric id, a
798matching verified email never linked without signing in to the account,
799new accounts behind the invite check. Repositories come through its
800installations (integrations, `src/github.rs`), copied with every branch and
801tag by the repos service (`src/mirror.rs`) as **import**, **mirror** (g1t
802follows GitHub on its push webhook) or **move to g1t** (GitHub follows g1t
803on `git.push`). A mirror is a hosted repository that keeps a full copy, so
804its project stays `hosted` and deploys like any other; the tie lives in
805integrations' `github_repos`. Not yet: previews and statuses on GitHub's own
806pull requests, comments and pull requests copied, GitLab and Bitbucket.
807
Projects: what a workspace builds and runs, first on every page808### People and search
809
810> **2026-10-04:** "pull up user profiles, using a /u/username prefix kinda
811> like DockerHub … search for users if you search that explicitly, how
812> GitHub has the aside for searching against filters … a significantly
813> stronger implementation."
814
815- **Profiles at `g1t.sh/u/<username>`**, apart from workspaces at
816 `g1t.sh/<workspace>`: who they are, their workspaces, recent work,
817 agents' sessions they steered.
818- **Search with a filter sidebar:** Projects, Code, Issues, Pull requests,
819 Users, Workspaces, each with its count; filters by workspace, language,
820 state, author, agent, label, date; qualifiers in the query
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent821 (`user:`, `is:open`, `agent:g1t`) as on GitHub. Typing `u/name`
Projects: what a workspace builds and runs, first on every page822 searches people directly, as Docker Hub does.
823
Plan: Projects, the home of everything about running software8241 and 2 serve the competition directly (multi-agent coordination across
825projects is 25% of the score); 3 is the demo's best moment if time allows.
826
Plan: the billing model827## Billing model
828
829> **2026-10-04:** "Some things just require you to have a card on file …
830> some things will be something you give us an initial amount of money
831> per month just to activate, tons of things additionally will be usage
832> based, some things will just be usage based only … at minimum a
833> breakeven with Cloudflare costs, or in some cases a value add." Stripe
834> moves to Flagon, Inc. (g1t.sh is its product). Proposed below; the
835> prices are the user's to confirm.
836
837### Four kinds of charge
838
839Every feature is exactly one of these, and the Billing page says which:
840
841| Kind | What the workspace does | Example |
842| --- | --- | --- |
843| **Free** | Nothing | Hosting code, issues, pull requests, review, the merge queue, bringing your own agent over MCP |
Prices are what g1t pays plus 20%, from the first second844| **Card on file** | Adds a card; pays only for what it uses | Previews, g1t's agents, workflow minutes |
Plan: the billing model845| **Activation** | Turns a feature on for a monthly fee that includes an allowance; usage past it is metered | Production deployments, Security and quality |
846| **Usage only** | Nothing up front; every unit is metered | Model tokens, build minutes, storage past the free amount |
847
848A card is needed before anything that can cost money starts. Nothing is
849ever switched on without the workspace choosing it.
850
851### Postpaid, with spend limits
852
853- **One Stripe customer and one subscription per workspace**, on Flagon,
854 Inc.'s account. Activations are licensed line items; every usage
855 dimension is a metered price backed by a Stripe Meter. Stripe invoices
856 monthly in arrears and charges the card on file; failed payments go
857 through Stripe's retries and emails, and g1t hears of them by webhook.
858- **Spend limits instead of prepaid credit.** A workspace sets a monthly
859 limit overall and per feature (Vercel's spend management). g1t counts
860 usage as it happens and stops starting new paid work at the limit,
861 with a warning at 50%, 80% and 100%. Prepaid top-ups go away; promotions
862 (the free model allowance) become Stripe credit on the customer.
863- **Usage reaches Stripe from billing alone.** Every service reports
864 usage to the billing service as it happens (it already records agent
865 runs and builds); billing batches them into Stripe meter events every
866 few minutes, idempotently by g1t's own ids, and keeps the ledger g1t's
867 pages show. Nothing else talks to Stripe.
868
869### Scope: workspace, then projects
870
871- A feature is turned on for the **workspace** (by an owner, with the
872 activation if it has one), then allowed for **all projects** or
873 **selected projects**.
874- Every **project** can opt out on its own page. A project with nothing
875 to deploy (no Workers config, no build script, no `index.html`) is
876 detected, says so on its Deployments page, and never builds or costs
877 anything.
878- Agents and workflows are allowed per project the same way, so a
879 workspace can keep spend to the projects that matter.
880
Plan: prices pass every Cloudflare cost through881### Prices: what it costs us, passed through
882
883> **2026-10-04, decided:** postpaid with spend limits, as Vercel and
884> Cloudflare do; no per-seat price, ever ("fuck per-seat pricing").
885> "If they're barely using them great, but if they're using the shit out
886> of them that will cost me a ton, so that cost needs to move onto them."
887
888**Every Cloudflare cost a workspace causes is metered to it.** Light use
889fits in a small free allowance; past it, each unit is charged at
890Cloudflare's price times a margin of at least 1.5, which pays for Stripe
891(about 3%), shared overhead (the site, the API, D1) and g1t itself.
Plan: the billing model892
Plan: prices pass every Cloudflare cost through893Cloudflare's prices (October 2026), and the cost per unit g1t meters:
Plan: the billing model894
Plan: prices pass every Cloudflare cost through895| What g1t meters | Cloudflare's price | Cost to g1t per unit |
896| --- | --- | --- |
897| **Sandbox minute** (agents, checks, merge queue, workflow jobs, deploy builds), standard-1: ½ vCPU, 4 GiB, 8 GB | CPU $0.00002 / vCPU-s while busy; memory $0.0000025 / GiB-s and disk $0.00000007 / GB-s while running | ≤ $0.0012 / minute (CPU counted as busy throughout, since g1t cannot see it per sandbox) |
898| **App request** (deployments) | Workers for Platforms: $0.30 / million past 20M | $0.30 / million |
899| **App CPU** | $0.02 / million CPU-ms past 60M | $0.02 / million ms |
900| **App** (a deployed script) | $0.02 / script-month past 1,000 | $0.02 / app-month |
901| **Storage** (repositories, artifacts, caches) | Artifacts $0.50 / GB-month (billing starts 2026-10-14); KV $0.50 / GB-month | $0.50 / GB-month |
902| **Git operation** (clone, fetch, push) | Artifacts $0.15 / 1,000 past 10,000 | $0.15 / 1,000 |
903| **Model tokens** | The provider's price | As charged |
904| Container egress, emails, the site's own requests | Small and shared | In the margin |
905
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas906> **2026-10-06, decided:** no per-feature quotas on the plan. "A paying
907> user should be able to push past the Git operations number, they're
908> just paying usage on it." One plan, $20 a month per workspace with $10
909> of usage included; every meter is charged from the first unit at cost +
910> 20% (builds, app requests and CPU, custom domains), drawn from the $10
911> first, then up to the spend limit, which is the only thing that stops a
912> paying workspace (with abuse protection). Projects, previews and apps
913> are not metered (Workers for Platforms' script pool makes them ~free).
914> The forge's free amounts are the same for everyone: 1 GB private storage
915> and 50,000 git operations a month; past them the plan pays and a free
916> workspace is held (pushes stop, git slowed). The table below is the
917> earlier proposal; billing's price book and g1t.sh/pricing are current.
918
Plan: prices pass every Cloudflare cost through919What a workspace pays:
920
921| Meter | Free each month | Then | Margin | For comparison |
922| --- | --- | --- | --- | --- |
Prices are what g1t pays plus 20%, from the first second923| Sandbox minutes | None (2026-10-05: charged from the first second) | Cost + 20%, by the second | 1.2× | GitHub Actions $0.008 / minute (Linux 2-core); Vercel builds $0.0035 / CPU-minute |
Plan: prices pass every Cloudflare cost through924| App requests | 1 million with Deployments | $0.50 / million | 1.7× | Vercel $0.60 / million invocations |
925| App CPU | 3 million ms with Deployments | $0.04 / million ms | 2× | Vercel active CPU about $0.036 / million ms |
926| Apps | 10 with Deployments | $0.05 / app-month | 2.5× | |
927| Storage | 1 GB | $1.00 / GB-month | 2× | GitHub LFS $0.07 / GB, but repositories are free there |
928| Git operations | 10,000 | $0.30 / 1,000 | 2× | |
929| g1t's models | | Cost + 20% | 1.2× | The provider's own price |
Prices are what g1t pays plus 20%, from the first second930| Your own model provider | | Only its sandbox minutes (the $0.10 run fee was dropped 2026-10-05) | | |
Plan: prices pass every Cloudflare cost through931| **Deployments** activation | | $5 / month, with the allowances above | covers Workers for Platforms' $25 / month across workspaces | Vercel Pro $20 per seat |
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar932| **Security and quality** activation (built 2026-10-07: price book meter `security_activation`) | | $10 / month; fixes as agent usage | | GitHub Advanced Security $49 per committer |
Plan: the billing model933
Plan: prices pass every Cloudflare cost through934A workspace that uses g1t lightly (a few agent runs, a small site)
935pays nothing or its activation; a workspace running agents all day pays
936for the sandboxes and models those agents use, with g1t's margin on
937each. Nothing in a workspace's bill is subsidised by another's.
Plan: the billing model938
939### Build order
940
9411. Stripe customer per workspace and card on file (Checkout in setup
942 mode), webhooks (invoice paid and failed, subscription changes,
943 payment method changes), the Billing page rebuilt around the four
944 kinds.
9452. One subscription per workspace with activations as items; Deployments
946 moves onto it.
Plan: prices pass every Cloudflare cost through9473. Meters for each usage dimension above, fed from billing's ledger:
948 every sandbox reports how long it ran when it stops (agents, checks,
949 the queue, workflow jobs and deploy builds alike); deployments report
950 requests, CPU and apps; repos report storage and git operations. Spend
Plan: the billing model951 limits and their warnings; prepaid credit retired.
9524. Per-workspace allow-lists of projects for each feature, and per-project
953 opt-out; "nothing to deploy" detection.
Billing accounts, terms and enterprises; g1t is no longer free9545. Turn off FREE_WHILE_BUILDING when the user says so. **Done 2026-10-05.**
955
956Shipped by 2026-10-05: sandbox seconds for every sandbox; the price book
957and its keeper (runs settled to AI Gateway's price every 15 minutes;
958Container and Workers costs checked against Cloudflare's billable usage
959and container analytics daily, with a public change log on
960g1t.sh/pricing); usage limits by trust with automatic payment near the
961limit; app traffic counted toward limits as it happens; billing accounts,
962terms and enterprises; free mode off, syntaqx comped.
963
964Still to build, in order: Stripe card-on-file without a payment (setup
965mode) and webhooks; month-end invoices for postpaid usage (and one
966invoice per enterprise); the subscription with activations as items;
967storage and git-operation meters; limit warnings by email at 50/80/100%;
968self-serve enterprise management for enterprise owners.
969
970### Accounts, terms and enterprises
971
972Every workspace is paid for by a billing account: its own (`ws_<slug>`)
973or an enterprise's (`ent_…`), which pays for several workspaces with one
974limit, one set of terms and, once invoices exist, one bill, as GitHub
975Enterprise does. Terms are standard, comped (nothing charged, usage still
976recorded at cost, paid features on) or custom (a discount, its own
977ceiling, an end date). g1t staff manage them in **sudo.g1t.sh**, a
978separate Worker behind Cloudflare Access that also verifies the Access
979token itself and allows only listed staff emails; every change is kept
980with who made it and why.
981
982### Limits: stop non-payers, never payers
983
984The limit is on usage not yet paid for, counted at cost to g1t or charge,
985whichever is more: $3 before any live payment, then twice what has been
986paid ($25 to $1,000), or what staff set. A workspace with a card on file
987is charged automatically near its limit, which both pays what it owes and
988raises the limit, so paying users are never stopped. A declined card
989stops work until paid. The owner's own spend limit always means stop.
990Test-mode payments never lower exposure or raise trust.
Plan: the billing model991
Merge Stripe Tax, the card fee on card payments, and one free workspace per person992### Tax, card fees and free workspaces (built 2026-10-08)
993
994> **2026-10-08, decided:** Stripe Tax everywhere ("so I don't fuck up on
995> taxes"); Stripe's card fee passed to the customer with the 20% markup
996> kept; one free workspace per person; no invites on free workspaces.
997
998- **Stripe Tax on every payment.** `automatic_tax` on every Checkout page
999 (plan, Security and quality, prepaying, AI credit), every subscription
1000 and every invoice g1t makes (month close, threshold, enterprise), and a
1001 tax calculation and transaction for auto-reload's off-session charge.
1002 Tax code `txcd_10103001` (SaaS, business use), every price
1003 `tax_behavior=exclusive`. Checkout always collects the billing address
1004 and tax ID and saves them on the customer. Prices on g1t are shown
1005 excluding tax. Tax is never revenue: balances and plan payments are
1006 credited without it, it is kept in `tax_and_fees`, shown as its own
1007 statement line, and as **Tax collected** on sudo's Costs. Without an
1008 address g1t does not charge: the owners are asked for one.
1009- **The card fee** (2.9% + $0.30, grossed up) is its own line on every
1010 card payment, the plan's and Security's as a monthly item; never on a
1011 bank transfer or an enterprise's invoice. On by default
1012 (`cost_settings.card_fee`). Not revenue either. Meters stay at cost +
1013 20%; models at the provider's price plus the agent rate.
1014- **One free workspace per person.** Identity asks billing
1015 (`free_workspaces`) before creating one; a second is refused with the
1016 way forward. Those who own several from before keep them.
1017- **A free workspace adds no one**: no members, invites or outside
1018 collaborators until it starts the plan; its members stay; @g1t never
1019 counts. Enforced in identity for every path (site, API, MCP).
1020- Details: docs/BILLING_OPERATIONS.md, *Tax and the card fee*.
1021
Billing: credits with a kind and expiry, discounts instead of comped, and safer charging1022### Promo codes (planned)
1023
1024Staff credits (promotional, goodwill, refund; `services/billing/src/grants.rs`,
1025docs/BILLING_OPERATIONS.md) are given one workspace at a time. Promo codes
1026give promotional credit in bulk, on redemption, through the same grants:
1027
1028- **Codes.** sudo → Credits & refunds → **New code**: the code (or one
1029 made up), the credit ($ amount), max redemptions, when the code stops
1030 working, how long each redeemed credit lasts (an expiry, as any grant),
1031 and a note. Table `promo_codes` (code, amount, max, redeemed, ends_at,
1032 credit_days, note, created_by, disabled_at) and `promo_redemptions`
1033 (code, workspace, grant id, by, at), unique on (code, workspace).
1034- **Redeeming.** An owner types it on the workspace's Billing page
1035 (`redeem_code`, owners only). One D1 batch checks the code is open, under
1036 its max and not redeemed by the workspace, counts the redemption and
1037 makes the grant (`grant_credit`, kind promotional, the code as its note),
1038 so two redemptions at once never pass the max. Wrong or used-up codes say
1039 so without telling which codes exist; redemptions are rate-limited per
1040 owner.
1041- **Seeing them.** Each code's redemptions, credit given and spent come
1042 from the grants it made, so margin needs nothing new: spent promo credit
1043 is already given away, by kind.
1044- **Not yet built** because it adds an owner-facing form, abuse limits and
1045 a second sudo form; giving credit by workspace covers launch.
1046
Initial g1t: services, event bus, intents and attempts1047## Agents and models
1048
1049### Defining an agent
1050
1051An agent is a file (`.g1t/agents/<name>.md`, or in the workspace library):
1052instructions, the harness and model to run, the tools and MCP servers it may
1053use, its sandbox image, permissions and budget. Agents take roles: planner,
1054implementer, reviewer, conflict resolver, documenter, memory consolidator.
1055Each role has a default that a repo can replace.
1056
1057### Where it runs, and on whose model
1058
1059| Option | How it works | Fits |
1060| --- | --- | --- |
1061| Hosted, g1t's model | g1t runs the sandbox and bills usage | Getting started; no keys to manage |
1062| Hosted, your API key | Same sandbox, your Anthropic, OpenAI or Google key | Teams with existing contracts |
1063| Hosted, your endpoint | Any OpenAI-compatible URL: Bedrock, Vertex, Azure, a self-hosted model | Private or fine-tuned models |
Issues and pull requests replace intents and attempts1064| Your runner | A g1t runner daemon on your own machines picks up pull requests | Code or models that may not leave your network |
Initial g1t: services, event bus, intents and attempts1065| Your own session | Local Claude Code, Cursor or any MCP client joins through `mcp.g1t.sh` | Individuals; subscription plans |
1066
1067Decisions behind this:
1068
1069- **g1t does not build its own agent loop.** It runs existing harnesses
1070 (Claude Code first, through its headless mode) behind a small runner
1071 contract: a container image, an entry command, and session events reported
1072 through the CLI. Other harnesses plug in by meeting the contract.
1073- **All hosted model traffic goes through Cloudflare AI Gateway.** That gives
1074 one place for spend tracking, budgets, rate limits, fallback and logs,
1075 whichever provider or endpoint is behind it.
Merge branch 'model-routing'1076- **Nobody has to pick a model.** A person assigns work to `g1t`, as
1077 they would assign an issue to a colleague, and **Auto** routes each job
1078 to the cheapest model that can do it (see
1079 [Routing for cost](#routing-for-cost) below). A workspace can pin a tier
1080 per kind of work instead. Each request is tagged at the gateway with the
1081 kind of work, the tier, the repository and the pull request, and each
1082 run says which model ran and why. The gateway's own dynamic routes
1083 cannot make the choice yet: they work only on its OpenAI-compatible
1084 endpoint, and the harness speaks Anthropic's.
Initial g1t: services, event bus, intents and attempts1085- **Subscriptions stay local.** A Claude subscription cannot be used by a
1086 hosted sandbox; it needs an API key. People on subscriptions use their own
1087 Claude Code session, which is a full participant.
Merge branch 'model-routing'1088- **The workspace pays.** A workspace buys AI credit by card and each
1089 agent run deducts the model at the provider's price plus the agent rate
1090 per million (weighted) tokens; on its own model key, only the agent rate,
1091 counted from the model proxy and the sandbox's own report. The billing service asks
Agents as a team: lifecycle, merge queue, billing and a new shell1092 nothing of the others: the runner asks it before starting a sandbox and
1093 is refused when there is no credit, and the sandbox reports what its run
1094 cost with a token only it holds. Where no card processor is configured
1095 nothing is charged and agents stay limited to listed accounts.
Initial g1t: services, event bus, intents and attempts1096- **Keys are secrets.** Stored in Cloudflare Secrets Store, injected into the
Issues and pull requests replace intents and attempts1097 sandbox for one pull request, never shown again.
Initial g1t: services, event bus, intents and attempts1098
Agents as a team: lifecycle, merge queue, billing and a new shell1099### Seeing a pull request through
1100
1101Assigning an issue is the only thing a person does until there is something
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent1102to merge. A pull request made by g1t goes through checks, a review
Agents as a team: lifecycle, merge queue, billing and a new shell1103by another agent, revision when either finds something, and catching up
1104when `main` moves, without anyone pressing a button. It ends as ready to
1105merge, or as "needs you" with the reason: the checks still fail after two
1106revisions, a review could not be written, or a conflict could not be
1107resolved.
1108
1109The work service decides the next step from the pull request's state and
1110claims it in one statement, so a step is taken once. The runner asks on
1111every event that could change the answer (ready, pushed, checks finished,
1112review finished, `main` moved), and on a five-minute sweep for anything
1113missed, and carries the step out in a sandbox.
1114
1115A pull request does not have to be up to date with `main` to merge,
1116unless the repository's settings require it, as on GitHub. Merging one that
1117is behind brings it up to date first (a clean merge needs no model; an
1118agent resolves a conflict) and lands it when that push arrives. With the
1119requirement on, catching up is a step of its own and the checks run again
1120on the result.
1121
1122Each repository sets its own rules, on one settings page: whether its
1123default branch takes pushes at all, how many approvals a merge needs and
1124whether an agent's counts, whether failed checks can be overridden, whether
1125a second agent reviews, and how often an agent is sent back before a person
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent1126is asked. A pull request g1t opens follows the same rules as anyone's.
Agents as a team: lifecycle, merge queue, billing and a new shell1127Pushes to a protected branch are refused in the git front end, with the
1128reason shown by git beside the branch.
1129
1130Merging is a person's decision unless the repository says otherwise. With
1131"merge automatically when ready" turned on in its settings, a ready pull
1132request lands by itself, attributed to `g1t`. That is the whole path from
1133an assigned issue to a commit on `main` with nobody in between. Required
1134human approval per path, and risk tiers, are still to come.
1135
Merge branch 'model-routing'1136### Routing for cost
1137
1138*Built (runner `route` in `services/runner/src/model-env.ts`).* The goal
1139is cost per merged change, not cost per request: a cheap attempt that
1140fails and is retried on the same model costs more than one that finishes.
1141
Merge main: Deployments panel in the About, project homepage, both sides' operations1142- **Tiers and catalogue.** `small` (Claude Haiku 5.5 since 2026-10-08,
1143 $0.10/$0.50 per million input/output up to 100k-token prompts, five
1144 times that above; it was Haiku 4.5 at $1/$5), `large` (Claude Sonnet 5.5, $2/$10) and `frontier`
Merge branch 'model-routing'1145 (Claude Opus 5.5, $4/$20). Models, names and list prices are
1146 configuration (`AGENT_ROUTING`), never code; prices there are for
1147 estimates only, runs are charged what AI Gateway priced them at.
1148- **Starting tier by job.** Catch-up, answering a question, and reviews of
1149 at most 10 files and 200 lines touching no sensitive path: small.
Merge main: Deployments panel in the About, project homepage, both sides' operations1150 Plans: small at high effort (Haiku 5.5 takes an effort level).
1151 Changes, revisions and other reviews: large. Reviews over 60 files
Merge branch 'model-routing'1152 or 3,000 lines: frontier. Labels: `architecture` frontier, `security` off
1153 small, `docs`/`documentation`/`typo` let changes and answers start small.
1154- **Escalation.** A failed (or guardrail-stopped) attempt at the same work
1155 goes one tier up; two in a row, frontier; a revision counts its rounds;
1156 a change left at low confidence sends the next attempt up.
1157- **Learning, per repository.** From the last 20 runs of the same kind:
1158 one tier down when the cheaper tier finished at least 90% of at least 5
1159 (never for sensitive or labelled work, never on a retry); one tier up
1160 when this tier failed at least half of at least 5. No new tables: it
1161 reads work's `agent_runs` (model, status, confidence).
1162- **Explained.** Every run's first step and session note is one line:
Merge main: Deployments panel in the About, project homepage, both sides' operations1163 *Used a fast model (Claude Haiku 5.5): small change, 3 files and 80
1164 lines.* Effort per kind of job (`effort` in `AGENT_ROUTING`: plan high,
1165 answer medium, update low) is sent as `CLAUDE_CODE_EFFORT_LEVEL` on
1166 g1t's tiers and named in that line.
Merge branch 'model-routing'1167- **Chosen instead.** `model_routes` rows to g1t's models name `small`,
1168 `large` or `frontier`, or nothing for Auto (Integrations → Models).
1169 A workspace's own Anthropic key with no model named is routed by Auto
1170 too.
1171- **Measured.** `scripts/ops/routing-savings.mjs` replays tasks through
1172 the router offline, priced from the catalogue, against routing before
1173 Auto and against the frontier model for everything, net of failed
1174 attempts, with cost per merged change; `--live` reads billing's runs and
1175 counted tokens. On the bundled sample (13 tasks, assumed failures): Auto
1176 costs 7% less than the frontier model for everything and about 7% more
1177 per run than routing before it, but half as much per merged change,
1178 because it finishes the hard tasks the old routing gave up on. At
1179 current prices Opus 5.5 and Sonnet 5.5 cost the same per cache read, and
1180 cache reads are most of an agent run's tokens, so moving off the
1181 frontier model saves less than its list price suggests; the fast tier
1182 and fewer failed attempts are where the money is. Run `--live` monthly
1183 and after any routing change.
1184- **A cheaper route for the simplest jobs (designed, off).** A fourth tier
1185 on Workers AI through AI Gateway (an open model, billed on Cloudflare's
1186 invoice) for classification-sized jobs: commit messages, triage,
1187 summaries. Behind the same router as a tier with its own catalogue entry
1188 and `tasks` rules, off by default. It needs the proxy to translate the
1189 harness's Anthropic requests to the gateway's OpenAI-compatible
1190 endpoint (it already does for workspaces' own OpenAI-shaped providers)
1191 and a quality bar from the savings harness before any job moves to it.
1192
Initial g1t: services, event bus, intents and attempts1193### Choosing the right agent automatically
1194
Issues and pull requests replace intents and attempts1195Because several agents can work on the same issue, every issue with more
1196than one pull request is an evaluation on real work. g1t records, per repo and per kind of issue, each
Initial g1t: services, event bus, intents and attempts1197agent's win rate, cost and time. That produces a leaderboard, and a routing
Issues and pull requests replace intents and attempts1198policy: send each new issue to the agent that wins that kind most often,
Initial g1t: services, event bus, intents and attempts1199start with the cheapest that is good enough, and escalate to a stronger one
1200when checks fail.
1201
Plan: the inbox, then channels and apps, instead of discussions1202## Talking: the inbox and channels
1203
1204Not a discussions forum. People and agents need one place to talk in real
1205time, and an app that feels like one on desktop and phone.
1206
1207**The inbox comes first.** Everything that needs a person or that they
1208follow, from people and agents: review requests, agent questions and
1209handoffs, failures, mentions, deploys. Read and unread, saved, done,
1210snoozed; ranked so what an agent is blocked on comes first; email digests
1211and push. It is the delivery layer chat needs too (who is told what, read
1212state, push), so building it first makes channels cheap.
1213
Docs: inbox threads, reasons, subscriptions, watching, email, API and MCP1214*Built:* the events service keeps it (`services/events/src/inbox.rs` and
1215`subscriptions.rs`, migrations `0005_inbox` and `0006_inbox_threads` on the
1216`g1t-events` database), writing items as events arrive from the bus; work's
1217`inbox_subject` says what each event names. Each person has one **thread**
1218per issue, pull request, workflow on a branch or deployment: new activity
1219brings it back unread with a count and its last 10 activities, and while it
1220is unread its most urgent severity is kept. Each item has a **reason**
1221(`agent`, `review_requested`, `assign`, `mention`, `ci_activity`,
1222`security_alert`, `state_change`, `author`, `comment`, `manual`,
1223`subscribed`). Who is told: `agent.asked` and `pull.stalled` (needs you,
1224closed again by `pull.resumed` and the like), `pull.review_requested`
1225(needs you, closed by `pull.review_request_removed`),
1226`issue.assigned`/`pull.assigned`, failed checks and workflows,
1227`deployment.failed` and a recovering `deployment.succeeded`, g1t's reviews
1228and finished changes, closes, reopens and merges to everyone subscribed,
1229and comments to the people mentioned and everyone subscribed. Never the
1230actor, never g1t. **Subscriptions**: authors, assignees and reviewers are
1231subscribed without a row; commenting or being mentioned subscribes; anyone
1232can subscribe, unsubscribe (still told of what is asked of them) or ignore.
1233**Watching** a repository: participating (the default), all, ignore, or
1234custom (issues, pulls, deployments, security); whoever creates a repository
1235watches it at their default, all activity unless they change it.
1236**Settings**: which reasons are also emailed (agent, review_requested and
1237mention by default) and the default watch for new repositories; email goes
1238through identity's `notify_by_email`, to a confirmed address only while the
1239person can still read the repository. **REST and MCP**: 14 operations under
1240`/notifications`, `/repos/:owner/:name/subscription` and
1241`/user/subscriptions` (scopes `notifications:read` and
1242`notifications:write`, in the Agent preset), and the `notifications` MCP
1243tool; never usable by g1t's own tokens. On the site: a bell in the top bar
1244opening a sheet with tabs (All, Needs you, Errors, Success, Info), Done,
1245Save, Snooze and Mark all read; `/inbox` with Saved, Done and a reason
1246filter; reasons and update counts on each card; a Notifications box on
1247issue and pull request pages; a Watch menu in the repository header;
Previews build from any branch; Agent in place of Ask AI; pin from the sidebar1248Settings → Notifications; a Needs you card on mission control. Agent sits
Docs: inbox threads, reasons, subscriptions, watching, email, API and MCP1249beside the bell, disabled. Still to come: security alerts (the security
Previews build from any branch; Agent in place of Ask AI; pin from the sidebar1250service publishes no event yet), email digests and push, Agent, and
Docs: inbox threads, reasons, subscriptions, watching, email, API and MCP1251channels.
Docs: the inbox, what lands in it and why, its tabs and actions1252
Plan: the inbox, then channels and apps, instead of discussions1253**Channels** (working name): workspace channels, direct messages and
1254threads, live.
1255
1256- Each channel is a Durable Object holding its WebSocket connections with
1257 hibernation, so idle channels cost nothing; history in D1, files in R2.
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent1258- Agents are members. `@g1t` in a channel starts work, answers, or
Plan: the inbox, then channels and apps, instead of discussions1259 posts a summary; agents post their questions and handoffs where people
1260 already are. A thread becomes an issue or an outcome in one action, and
1261 the agent's progress streams into that thread.
1262- Tied to the work: issues, pull requests, runs and deploys each have a
1263 thread; links unfurl into live cards (checks, agent step, preview).
1264 What a channel settles can become workspace memory, with its source.
1265- Apps: an installable PWA first (desktop and mobile, offline shell, Web
1266 Push), then native shells on the same API: Tauri for desktop (tray,
1267 deep links), React Native for iOS and Android (background
1268 notifications).
1269
1270GitHub-style Discussions are not planned: channels and threads on the
1271work replace them.
1272
Initial g1t: services, event bus, intents and attempts1273## What GitHub ships today, and where g1t differs
1274
1275GitHub's Agent HQ and Copilot app give each agent session its own git
1276worktree and branch, list sessions in a mission-control view grouped by
1277project, and let a task be assigned to several agents so their output can be
1278compared. Underneath, the unit of work is still a branch and a pull request.
1279
1280| | GitHub | g1t |
1281| --- | --- | --- |
1282| Where a session works | A worktree on one developer's machine, or a cloud sandbox | A server-side fork that any agent on any machine can join and anyone can open |
1283| Agent context | Lives in the app's session view | Stored with the repository and linked from each commit (why-blame) |
Issues and pull requests replace intents and attempts1284| Several agents on one task | Separate pull requests to compare by hand | One issue holding every pull request made for it, compared side by side, with the merged one recorded on the issue |
Initial g1t: services, event bus, intents and attempts1285| Collisions between agents | Found as merge conflicts at the end | Flagged during the work (overlap radar) |
Issues and pull requests replace intents and attempts1286| Landing changes | One pull request at a time | A merge queue that lands the chosen one and closes the rest as superseded |
Initial g1t: services, event bus, intents and attempts1287| Which agents | Those offered through a Copilot subscription | Any MCP client, plus hosted agents |
1288
1289## How agents connect
1290
12911. **Bring your own agent.** A remote MCP server at `mcp.g1t.sh` lets Claude
Issues and pull requests replace intents and attempts1292 Code (or any MCP client) list issues, claim one, get a clone URL and
Initial g1t: services, event bus, intents and attempts1293 token, report progress and submit. Adding it is one command; sign-in is a
1294 browser OAuth flow with no token to paste. The `g1t` CLI installs Claude
1295 Code hooks that upload the session transcript as the agent works.
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent12962. **g1t's agent.** Assign an issue to g1t, or many issues at
Agents as a team: lifecycle, merge queue, billing and a new shell1297 once, each to an agent of its own. g1t starts a sandbox for each
1298 (Cloudflare Containers), running a coding agent headless against its
1299 own pull request and fork.
Initial g1t: services, event bus, intents and attempts13003. **API and CLI.** Everything above is available at `api.g1t.sh` and
1301 through `g1t`.
1302
1303## Public surfaces
1304
1305| Host | What it serves |
1306| --- | --- |
1307| `g1t.sh` | The site, git over HTTPS, git over SSH |
Agents as a team: lifecycle, merge queue, billing and a new shell1308| `api.g1t.sh` | REST API, with no version in its paths, with a published OpenAPI document, cursor pagination, rate-limit headers, idempotency keys on writes, server-sent events for live pull request state, and signed webhooks |
Initial g1t: services, event bus, intents and attempts1309| `mcp.g1t.sh` | Remote MCP server over streamable HTTP |
1310
1311g1t is its own OAuth 2.1 authorization server: authorization code with PKCE,
OAuth 2.1 sign-in for MCP clients and other applications1312dynamic client registration that stores nothing (a client id encodes its
1313own registration, so the open endpoint cannot be used to fill a database),
1314discovery metadata and rotating refresh tokens. Still to come: scopes
Issues and pull requests replace intents and attempts1315per resource (`repo:read`, `repo:write`, `issue:write`, `pull:write`).
Initial g1t: services, event bus, intents and attempts1316MCP clients, the CLI (device flow) and third-party apps all use it. Access
1317tokens and SSH keys remain for git itself.
1318
Merge branch 'worktree-agent-a8385d293d42c913a'1319### Workspace aliases (internal, built 2026-10-07)
1320
1321`g1t` is the product; `flagon-io` is Flagon, Inc., the organization that
1322builds it. So nobody mistakes one for the other, `g1t.sh/g1t` leads to
1323`g1t.sh/flagon-io`. That is a workspace alias: a name g1t's staff point at
1324a workspace, kept in identity's `workspace_aliases` (migration 0029, which
1325seeds `g1t`) by the workspace's id, so it follows renames. It is not a
1326customer feature and is not documented for users; staff add and remove
1327aliases on sudo's Aliases page, with a reason, in sudo's audit log. We may
1328give other companies one for a trading name the same way.
1329
1330An alias is resolved wherever an old slug is (identity's `resolve_slug`),
1331so it costs only the not-found path: site pages 301 to the same page under
1332the workspace, the API and MCP run the call again under its slug, package
1333registries 301, and git over HTTPS is answered in place
1334(`resolve_alias`), because pushes do not follow redirects. An alias is
1335never a route, a username or a workspace's slug, and nobody can register
1336it while it exists. `@g1t` stays g1t's agent: mentions link to how the
1337agent works, never to `/g1t`.
1338
Initial g1t: services, event bus, intents and attempts1339## Architecture
1340
1341| Component | Language | Runs on | Responsibility |
1342| --- | --- | --- | --- |
Issues and pull requests replace intents and attempts1343| `crates/contracts`, `packages/contracts` | Rust, TypeScript | — | The interface of every service, the event catalogue, shared types. Services and clients depend on this, never on each other's code. |
OAuth 2.1 sign-in for MCP clients and other applications1344| `services/identity` | Rust | Worker + D1 | Accounts, workspaces and memberships, sessions, SSH keys, access tokens, device sign-in, OAuth codes and grants |
Issues and pull requests replace intents and attempts1345| `services/repos` | Rust | Worker + D1 + Artifacts | Repository registry, contents, forks, diffs, landing, git over HTTPS. Storage sits behind a `GitStore` port with an Artifacts adapter. |
1346| `services/work` | Rust | Worker + D1 | Issues, pull requests, comments, sessions; later a Durable Object per repo for the landing queue and live state |
Agents as a team: lifecycle, merge queue, billing and a new shell1347| `services/billing` | Rust | Worker + D1 + Stripe | Each workspace's agent credit: payments, the ledger of every run, and the gate on starting one |
Events service in Rust, with RFC 3339 times and accurate push events1348| `services/events` | Rust | Worker + Queues + D1 | The event bus: durable log, and one queue per subscribing service |
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent1349| `services/runner`, `crates/runner` | TypeScript, Rust | Worker + Containers | Starts a sandbox per g1t run; the program inside runs the agent harness and reports through the public API |
Social cards for every page: og.g1t.sh1350| `services/og` | TypeScript | Worker + Cache API | Social cards at `og.g1t.sh`: one PNG per page of the site and the docs (satori and resvg), looked up as an anonymous visitor, so nothing private appears on one |
Initial g1t: services, event bus, intents and attempts1351| `apps/web` | TypeScript | Worker | Server-rendered site. Holds no data; calls services over RPC. |
Issues and pull requests replace intents and attempts1352| `apps/docs` | TypeScript | Worker (static) | Documentation and the API explorer |
API and MCP server in Rust; a public index at the API root1353| `apps/api` | Rust | Worker | REST API (`api.g1t.sh`), MCP server (`mcp.g1t.sh`) and OpenAPI document, all generated from one list of operations; the OAuth endpoints |
Initial g1t: services, event bus, intents and attempts1354| `crates/sshd` | Rust | Container | Git over SSH, bridged to Artifacts |
1355| `crates/merged` | Rust | Container | Trial merges, conflict matrix, landing merges (needs real git; the Artifacts binding is read-only) |
1356| `crates/core` | Rust | native and WASM | pkt-line, packfile and diff code shared by the above and by the Worker |
Issues and pull requests replace intents and attempts1357| `crates/g1t` | Rust | user's machine | CLI: auth, SSH proxy, Claude Code hooks, issues and pull requests |
Initial g1t: services, event bus, intents and attempts1358
Issues and pull requests replace intents and attempts1359Storage: Artifacts for repositories (one fork per pull request), D1 for accounts
Initial g1t: services, event bus, intents and attempts1360and metadata, R2 for session transcripts and logs, Durable Object SQLite for
1361per-repo coordination state.
1362
1363How the services fit together:
1364
1365- **Each service is its own Worker with its own database.** It deploys,
1366 scales and fails on its own. Callers reach it through a typed RPC binding
1367 to the interface in `packages/contracts`.
1368- **Expected failures are values.** Every call returns a `Result`, so "not
1369 found" or "forbidden" crosses a service boundary as data.
1370- **Side effects travel as events.** A service publishes what happened
Issues and pull requests replace intents and attempts1371 (`git.push`, `issue.opened`, `pull.merged`, …) to the bus and does not
Initial g1t: services, event bus, intents and attempts1372 call other services to react. Each subscriber consumes from its own queue.
1373 Timelines, webhooks and automations read the same stream, which is what
1374 lets something like GitHub Actions be built on top.
1375- **Every read takes the viewer.** Authorization is decided inside the
1376 service that owns the data, not by its callers.
1377
1378The Workers runtime scales request handling on its own, so the edge layer
1379stays in TypeScript. Rust is used where there is real computation or a real
1380protocol to implement.
1381
API and MCP server, Rust identity service, registration, site redesign1382## Languages
1383
1384The site is TypeScript. Everything behind it is Rust, compiled to
API and MCP server in Rust; a public index at the API root1385WebAssembly for Workers and natively for containers and the CLI. Identity, repos, work, events and the API are all Rust. The one exception
1386is the Worker that starts sandboxes, because Cloudflare's Containers
1387library is TypeScript. Rust services speak a
API and MCP server, Rust identity service, registration, site redesign1388small JSON protocol over service bindings (`POST /rpc/<method>`), with the
1389types in `crates/contracts`.
1390
1391## Identifiers
1392
1393Every id is a [TypeID](https://github.com/jetify-com/typeid): a prefix naming
1394the kind of thing, then a UUIDv7 in lowercase base32, such as
Issues and pull requests replace intents and attempts1395`pr_01jb2k7x9hfq0b3zj0f5s2m8ra`.
API and MCP server, Rust identity service, registration, site redesign1396
1397- The prefix makes an id self-describing and stops ids of different kinds
1398 being mixed up.
1399- Ids sort by creation time as plain strings. In SQLite (D1 and Durable
1400 Objects) that keeps inserts at the end of the primary-key index instead of
1401 scattering them, and gives time-ordered paging for free.
1402- The suffix decodes to a standard UUIDv7 for any system that wants one.
1403- Ids are made by the service that creates the record, not by the database,
1404 so they work across services and can be assigned before a write.
1405
1406## Events at scale, and audit
1407
1408The current event log is a single D1 database. That is fine for a
1409prototype and wrong for the target: D1 is one writer and 10 GB. The design
1410for volume splits storage by how the data is read.
1411
1412| Tier | Store | Holds | Read by |
1413| --- | --- | --- | --- |
1414| Hot | A Durable Object per repository, with SQLite | Recent events for that repo | Timelines, live pages over WebSocket |
1415| Complete | Cloudflare Pipelines into R2 as Apache Iceberg | Every event, forever, partitioned by day and workspace | Analytics, standups, "ask", export |
1416| Audit | The same R2 store, under object lock | Who did what, from where, with which credential | Compliance, investigation |
1417
1418- **No single hot database.** Each repository's recent events live with that
1419 repository, so load spreads across as many objects as there are repos.
1420- **The complete record is files, not rows.** Iceberg on R2 has no practical
1421 size limit and is queried with SQL.
1422- **Audit is a property of every event.** The envelope carries the actor
1423 (person, agent, token or system), the credential used, the request id and
1424 the source address. Audit entries for a workspace are hash-chained, so a
1425 removed or altered entry is detectable, and are written under a retention
1426 lock.
1427- **Delivery is at least once.** Consumers are idempotent on the event id.
1428
Initial g1t: services, event bus, intents and attempts1429## Accounts and forge basics
1430
1431- Registration with email verification, sign-in, forgot password (Cloudflare
1432 Email Sending), Turnstile on public forms.
1433- GitHub sign-in, SSH keys, access tokens, active sessions.
1434- Profiles, public and private repositories, repository search (D1 full-text).
1435- Rendered README, syntax highlighting, commit history, diffs.
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1436- Transferring a repository between workspaces (by id: its git store key
1437 never moves; every service follows `repo.transferred`; old paths redirect
1438 until reused) and deleting an empty, settled workspace (its slug is
1439 tombstoned, never reissued except to the person whose username it is).
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar1440- Access: five repository roles, a workspace base permission, outside
1441 collaborators and invitations. Teams are built on it (2026-10-07): visible
1442 or secret, nested up to 8 levels (child teams inherit their parents'
1443 roles), run by maintainers and owners. A team's role on a repository is a
1444 `repo_grants` row whose principal is the team, which identity resolves
1445 into the same `RepoGrant`s on each person, so `access::can` needs nothing
1446 new: the highest role wins. `@workspace/team` mentions tell the team's
1447 people; a team asked to review either asks everyone or picks people by
1448 round robin or load balance.
1449- CODEOWNERS, read in both conventions (single-section, and sections with
1450 approval counts, optional sections and default owners) from the first of
1451 `.g1t/`, `.github/`, the root, `docs/` and `.gitlab/`. Owners are asked to
1452 review, the `g1t / codeowners` status lints a changed file, and branch
1453 protection's "Require review from code owners" holds merges, for people,
1454 agents and the queue alike, until each owning rule is approved.
Initial g1t: services, event bus, intents and attempts1455
1456## Built on Cloudflare
1457
1458| Need | Product |
1459| --- | --- |
Issues and pull requests replace intents and attempts1460| Repositories; a fork per pull request; data residency per workspace | Artifacts (forks, jurisdictions) |
Initial g1t: services, event bus, intents and attempts1461| Reacting to pushes | Artifacts event subscriptions on Queues |
Plan: a repository that maintains itself, and deployments on g1t.page1462| Preview URL per pull request; deploy on merge | Workers for Platforms on `g1t.page` |
Initial g1t: services, event bus, intents and attempts1463| Site, API, MCP, git front end | Workers |
1464| Per-repo coordination, live updates | Durable Objects |
Issues and pull requests replace intents and attempts1465| Pull request lifecycles, automations | Workflows, Cron Triggers |
Initial g1t: services, event bus, intents and attempts1466| Agent sandboxes, SSH server, merge engine | Sandbox SDK and Containers |
1467| Fast starts on large repos | ArtifactFS |
1468| Model traffic, spend, budgets | AI Gateway |
1469| Summaries, embeddings | Workers AI |
1470| Context hub search | Vectorize |
1471| Accounts and metadata | D1 |
1472| Transcripts and logs | R2 |
1473| Email, bot protection, keys | Email Sending, Turnstile, Secrets Store |
1474
Running g1t yourself: the design, a docker compose proof, and a guide to what works today1475## Running g1t yourself
1476
1477g1t.sh runs on Cloudflare, and that does not change. The core is MIT and
1478must also run on anyone's own machine with `docker compose up`. A free
1479core people can self-host is what makes paid hosting worth trusting.
1480Self-hosting never makes hosted worse: hosted code paths keep their
1481behaviour, and a self-hosted adapter sits beside the hosted one. The
1482inventory of every Cloudflare dependency, the design and the risks are in
1483[SELF_HOSTING.md](SELF_HOSTING.md).
1484
1485The approach: the Workers stay Workers, and self-hosted they run in
1486workerd, the open-source Workers runtime. D1, KV and Queues are SQLite on a
1487volume, with the same migrations. Cloudflare-only bindings are replaced
1488by stand-ins:
1489
1490- Artifacts becomes bare repositories served by `git http-backend`;
1491- Email Sending becomes SMTP, through Mailpit;
1492- services that are off answer "off" instead of failing.
1493
1494| Phase | Scope | Estimate |
1495| --- | --- | --- |
1496| 1. Core forge | Done: `deploy/self-host/` (compose, git store, binding stand-ins, smoke test) and the "Run g1t yourself" guide. Left: the API on its own port, `PUBLIC_URL` in place of hard-coded hosts, cron, pull requests in the smoke test, CI that runs it. | 1–1.5 weeks left |
1497| 2. Agents | Docker sandboxes with the same runner image, an egress allow-list proxy for guardrails, `g1t.toml`, a launcher in place of `wrangler dev` | 2–3 weeks |
1498| 3. Search, context, deployments | sqlite-vec plus an OpenAI-compatible embedder; an app host on workerd; Caddy for app and custom domains; SSH | 3–4 weeks |
1499| 4. Parity and upgrades | Code-level ports in `g1t_kit` and `@g1t/platform`, sudo without Access, online backups, released images, an upgrade test in CI | 3–4 weeks |
1500
Initial g1t: services, event bus, intents and attempts1501## The submission
1502
1503- **g1t is built on g1t.** This repository is hosted on g1t.sh, its features
Issues and pull requests replace intents and attempts1504 are opened as issues and built by racing agents, and it deploys from
Initial g1t: services, event bus, intents and attempts1505 Artifacts through Workers Builds. The history is the proof.
Issues and pull requests replace intents and attempts1506- **The demo follows one story.** A brief becomes a project; twelve issues
Initial g1t: services, event bus, intents and attempts1507 fan out to dozens of agents; agents notice each other, hand off, and
1508 resolve a conflict; reviewers triage; the queue lands everything on
1509 `main`; why-blame explains a line; the portfolio shows where it all
1510 stands. Then the same thing at a thousand agents.
1511- **Judges can try it in a minute.** Open registration on g1t.sh, one-click
1512 import of a GitHub repo, one command to connect Claude Code, a seeded demo
1513 workspace, and a single deploy command for running their own copy.
1514- **The formats are open.** The commit trailers, session format and runner
1515 contract are published so other tools can interoperate.
1516
1517## Build order
1518
Agents as a team: lifecycle, merge queue, billing and a new shell1519What is left is ordered by how much it shows the point above, not by forge
1520parity. Forge basics are done well enough; each item below should make the
1521demo's story stronger.
1522
Plan: what is done from the agent-first list, and what is next1523Done from this list: the outcome page (a plan's issues as a live graph with
1524cost and a feed of what happened), coordination you can see (agents' issues
1525and comments stand out in the feed; agents hold g1t's tools through a token
1526scoped to one repository), steering a running agent (messages delivered
1527between steps, and at the end), and recording sessions from anyone's own
Plan: integrations are in1528Claude Code (`curl -fsSL https://g1t.sh/install/claude.sh | sh`). Integrations are
1529in: a workspace's own model provider (Anthropic or any Anthropic-compatible
Prices are what g1t pays plus 20%, from the first second1530endpoint, reached through a model proxy so no sandbox holds a key; its
1531runs pay only their sandbox time), alerts from Sentry, Datadog and signed webhooks
Plan: integrations are in1532that open one issue per problem and can start an agent, and Jira and Linear
1533tickets that agents read, people import, and that hear back. Racing a
Plan: what is done from the agent-first list, and what is next1534set number of agents on one issue is dropped: choosing how many agents to
1535use is not something people should have to do.
Agents as a team: lifecycle, merge queue, billing and a new shell1536
Agents asked while not at work are woken to answer15371. ~~**Handoffs and questions between agents** as states on the outcome
1538 page.~~ Done: questions and handoffs show as waiting, read, answered,
1539 taken on or declined; since 2026-10-03 an agent asked while it is not at
1540 work is woken to answer, where before the question waited forever.
Plan: a repository that maintains itself, and deployments on g1t.page15412. **Upkeep agents** (above): dependency updates, secret scanning,
1542 vulnerability alerts, code scanning, the security page. No new
1543 infrastructure.
15443. **Deployments on `g1t.page`** (above): previews per pull request,
1545 production on merge, the reviewer agent checking the preview.
15464. **The large run, building 2 and 3.** About 20–30 issues on g1t itself,
1547 built by agents and landed through the queue, for the video: g1t built
1548 on g1t.
15495. **Polish for judges trying it in a minute:** a seeded demo workspace, the
Plan: what is done from the agent-first list, and what is next1550 empty states, and the first-run path from sign-up to an outcome landing.
Initial g1t: services, event bus, intents and attempts1551
Agents as a team: lifecycle, merge queue, billing and a new shell1552Earlier items still open, after those:
1553
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar15541. Deleting a branch once its pull request merges; risk tiers. (Approval
1555 rules per path are in, as CODEOWNERS.)
OAuth 2.1 sign-in for MCP clients and other applications15562. Scopes on OAuth grants and access tokens.
API and MCP server in Rust; a public index at the API root15573. Event storage per the design above: per-repo hot log, Iceberg on R2,
1558 hash-chained audit.
Rust repos service with shipping; pull requests kept in the model15594. CLI with Claude Code hooks to record sessions automatically.
Agents as a team: lifecycle, merge queue, billing and a new shell15605. Reviewing and catching up automatically, by policy; required reviews;
1561 risk tiers.
15626. Compare view, proof bundles; handoff between agents.
15637. Projects, mission control, steering; why-blame, digest, timeline.
15648. Context hub, portfolio; automations and integrations (Sentry first).
15659. SSH; bot protection; own keys, endpoints and runners.
156610. Large run (100+ agents across many issues), hardening, demo.
Initial g1t: services, event bus, intents and attempts1567
1568Later: code search, mirroring to GitHub, passkeys, SSH
1569on port 22 without the CLI proxy (needs the Workers inbound TCP private
1570beta).

This file's history is long; its oldest lines are credited to the oldest commit read.