Repositories
Connecting GitHub, GitLab or a self-hosted Gitea to a workflow, the push webhook CodeBook registers and repairs, creating a repository, and why opening pull requests is a per-station grant.
An engineering agent with a story and no repository is a writing exercise. Connecting one is what makes the Development station real.
Connecting
Connect a repository from the workflow's header. The panel has a tab per host. GitHub is connected and its repositories approved in Bookbag for the organization; GitLab and Gitea connections belong to the workspace. Each workflow chooses which connected repositories it follows. Once connected, the workflow's engineering agents can read the code.
| Host | What you give it |
|---|---|
| GitHub | Connect the Bookbag GitHub App in the organization’s Bookbag repository settings, then approve the repositories products may use. Choose an approved repository in CodeBook. |
| GitLab | A personal access token with the api scope. Self-managed GitLab takes its own API base URL. |
| Gitea / Forgejo | The host’s API address ending in /api/v1 and a repository access token. |
Organization owners, administrators and platform administrators can open Manage in Bookbag from the GitHub tab to approve repositories and set their Writable switch. Other members choose from the repositories already approved for them.
Reading needs no separate station write grant. An authorized station worker can read the connected repository — which is what lets QA and Security review the same code the engineer changed.
Connecting starts the analysis
Historical behavior. Earlier releases analyzed connected repositories and updated a CodeBook System Map on pushes. The old workspace System Map link now opens a MadeBook card that takes you to Connected apps. Connecting a repository today makes it available to the workflow for repository work.
The former analyzer was measured at 200,000 and 250,000 files. Its coverage and limits are preserved under large repositories. For the current ownership and the planned handover of development knowledge, see connected products.
Push webhooks
Repository webhooks keep pull request state current. Bookbag SSO verifies GitHub App deliveries and forwards them to CodeBook. CodeBook registers a hook for GitLab and Gitea/Forgejo connections.
| Host | Events | Address |
|---|---|---|
| GitHub | pull requests, reviews, checks, deployments and pushes through Bookbag | Bookbag SSO’s configured GitHub App webhook |
| GitLab | push, merge request and pipeline events | https://<your CodeBook address>/api/kanban/git/webhook |
| Gitea / Forgejo | pull_request, pull_request_sync, pull_request_review, push, status |
the same CodeBook address |
GitHub/Bookbag and Gitea deliveries use HMAC-SHA256 over the raw body; GitLab uses its configured token. Invalid authentication is refused before the delivery changes repository state.
CodeBook-owned hooks registered before are repaired. Hooks CodeBook installed earlier were registered without push and at an address that did not answer. Once a minute, up to five repositories per pass, CodeBook reads each older hook and, if it is one of CodeBook's, updates it in place to today's address and events, keeping every event it already had. A hook CodeBook finds at one of its own addresses but never stored is adopted. It never creates a hook and never deletes one, and a hook at the stored id that points anywhere else is someone else's and is left alone. The old address, https://<your CodeBook address>/kanban/git/webhook, is also forwarded, so a hook added by hand there keeps working.
The workflow repository panel lists hooks that need attention. It reports missing permissions, a deleted hook, an unexpected destination or a host error. When available, an organization administrator can choose Re-register webhook. Replacing a token with sufficient permissions lets the next repair pass try again.
Starting a new repository
GitLab and Gitea / Forgejo offer Start a new repository as well as choosing one that exists. For GitHub, create the repository at GitHub and approve it in Bookbag, then select it on the workflow. On GitLab and Gitea / Forgejo, CodeBook asks the host to create it — private unless you ask for public — with a first commit, because an agent's first pull request branches from the default branch and a repository with no commits has none. The new repository is put on the workflow in the same step. An invalid name is refused before the host is asked, and a host's refusal is shown in the host's own words.
Creating a repository is a person's act. No agent and no model call can create one.
CodeBook does not host code
Your code lives in your repository host — GitHub, GitLab or a Gitea — and CodeBook reaches it through that host's API. The host remains the system of record. Proof runs can check out the repository on the execution machine.
A Gitea or Forgejo you run
A Gitea or Forgejo you host yourself is connected from its own tab: give its API address, ending in /api/v1, and an access token created in that host under Settings → Applications with repository read and write. CodeBook does not ship or start a Gitea of its own.
CodeBook uses the host’s native branch and atomic multi-file commit APIs. An edit to the same file during a run conflicts instead of overwriting the other writer. Draft pull requests use the host’s [WIP] title convention; CodeBook checks that the host actually marked the new request as a draft. If the host has removed that draft prefix, the new request is closed with an explanation. Commit statuses and reviews come from the native REST APIs, and text patches are read separately from the changed-file list. The factory’s merge setting also applies to supported Gitea and GitLab connections.
Webhook registration reads the existing hooks before creating one. If that read fails or cannot be completed within its safety limit, registration stops; it does not guess that no hook exists.
Check the repository setup
Open Factory dashboard → Repositories to see the repository instructions and the MadeBook card for the former Repository report. For runnable checks, open Factory settings → Proof runs and review the repository recipe. On the story, inspect the proof command, commit and result. Repository proof runs
Writing is per station
Changing the code is a separate permission, and it lives on the station, not on the agent:
Open draft pull requests — a switch under the station's Permissions, off by default. Commits to a new branch in the connected repository and opens a draft pull request. Never merges.
This means the same agent can open pull requests from Development and not from Code review. It also means granting it is a deliberate act against one station rather than a property somebody's agent quietly carries around the factory.
What an agent does with it
With the permission, an engineering agent commits to a new branch and opens a draft pull request linked to the card. Without it, it reads the repository and proposes — which is a perfectly good way to run the station while you are still learning what its output looks like.
It works on a new branch, and it never merges.
Start without it
The honest sequence for a new workflow:
- Staff Development without the permission. Read what it proposes.
- Tighten the skill and the station's instructions where the proposals are wrong.
- Allow draft pull requests.
- Keep a
Human reviewstation before Done regardless.
Repository memory
Keep project conventions and test procedures in the repository’s instructions, such as AGENTS.md. Keep a run’s result and tested commit on its CodeBook story. The former Primary repository memory editor has been retired. Factory settings → Memory & knowledge opens the MadeBook connection card during the development-knowledge transition.
Next
Pull requests — how the card tracks what the agent opened.