Existing repositories
Wayglass does not replace where your code lives. wayglass init makes a trunk in Artifacts from the repository you already have, agents work in forks of that trunk, and landed changes go back to GitHub (or wherever) with your own credentials. Nothing in the history is rewritten.
For scenario-based answers, see Git repositories, synchronization, and familiar tools, including the distinction between local access to a private source and continuous synchronization with a host, which is on the roadmap but not built.
What init does to a repository
Section titled “What init does to a repository”Run inside any git checkout, wayglass init:
- creates the project and its trunk repo in Artifacts through the Worker;
- writes
.wayglass/policy.yaml(the built-in example, unless one exists),.wayglass/config.yamland.wayglass/.gitignore, and commits only those three files, with a message that says why (chore: bring this repository under Wayglass). A dirty working tree stays yours; - pushes the current branch’s full history, plus that commit, to the trunk’s
mainwith a 15-minute write token that lives in memory only; - adds a git remote named
wayglassfor the trunk, with the same read-only credential helperwayglass cloneconfigures and a fetch refspec for the why-notes, sogit fetch wayglassworks without a token on disk; - leaves every other remote (
originon GitHub, say) alone.
Tags stay local unless you pass --tags. The trunk branch is always main: a checkout on master is pushed to main and init says so (git branch -m master main makes wayglass land fast-forward your local branch afterwards).
Before anything exists on the Worker, init checks what Artifacts would refuse and stops with nothing created:
| Exit | error.code |
Why |
|---|---|---|
| 1 | file_too_large |
A file over 32 MB somewhere in the history (Artifacts’ per-file limit). The message names the files; error.details.files lists path, size and blob hash. Remove them from history (git filter-repo) or start the trunk from a fresh history. |
| 1 | detached_head |
The trunk takes a branch; check one out first. |
| 2 | bad_source |
--from was given a URL git must not see (below). |
| 2 | usage |
--mirror names a remote the checkout does not have, or a directory was given without --from. |
Submodules travel as gitlinks and Git LFS files as their pointers; the Worker reads neither. A repository over 1 GB of objects gets a warning, since Artifacts allows 1 GB per repo.
A repository you already have checked out
Section titled “A repository you already have checked out”cd my-app # any branch; uncommitted changes are finewayglass initThe project is named after the directory (--project to choose), in the Worker’s main namespace (--jurisdiction eu for the EU one; it cannot change later). Add --tags to push tags, --public to opt the project in to the web audit view, and --mirror origin to have every wayglass land push the landed trunk to origin as well (it writes mirror: origin into .wayglass/config.yaml).
Created project my-app (trunk my-app, jurisdiction us). Wrote .wayglass/policy.yaml from the example policy. Pushed branch main at 8dd23422e385 to the trunk's main. Remote wayglass is the trunk: plain git fetch wayglass works read-only and brings the why-notes along.Next: 'wayglass agent setup' teaches coding agents the loop in AGENTS.md.Then wayglass agent setup, commit the AGENTS.md block, and agents start with wayglass intent declare.
A repository on GitHub, GitLab or any git host
Section titled “A repository on GitHub, GitLab or any git host”--from <url> clones first, with your git credentials: the ssh-agent, the credential helper, gh auth, whatever git clone would use. Wayglass never sees or stores them, so private repositories work the same as public ones.
# GitHub over HTTPS (public, or private through your credential helper)wayglass init --from https://github.com/junegunn/fzf.git
# GitHub over SSHwayglass init --from git@github.com:you/private-app.git
# GitLab, Bitbucket or self-hosted, into a directory of your choicewayglass init --from ssh://git@gitlab.com/group/project.git app --project appwayglass init --from https://git.example.com/team/repo.git --jurisdiction eu --tagsThe clone lands in a directory named after the repository (or the one you give), the project takes the same name (--project overrides), and the source stays as remote origin. A clone whose default branch is not main is renamed to main locally so the checkout, wayglass/main and wayglass land agree; origin keeps its branch name, and publish knows it.
Cloned git@github.com:spf13/cobra.git into cobra (your git credentials; origin stays there).Created project cobra (trunk cobra, jurisdiction us). Wrote .wayglass/policy.yaml from the example policy. Pushed branch main at b227eb1f3a3d to the trunk's main. Remote wayglass is the trunk: plain git fetch wayglass works read-only and brings the why-notes along.Next: cd cobra && wayglass agent setupAccepted URLs: https://host/path, ssh://[user@]host[:port]/path and the scp form user@host:path. Refused, before git runs: a value starting with -, remote helpers (ext::, fd::), git:// and http:// (no authentication), a username, password or token inside the URL (the refusal never repeats it), and local paths or file:// unless you pass --allow-local.
Follow an agent’s fork
Section titled “Follow an agent’s fork”To watch an agent’s work from your own machine, clone its fork read-only; plain git pull then keeps up with its pushes:
wayglass clone my-app --intent i83f41dd279cd my-app-i83f41dd279 && git pullwayglass clone my-app without --intent checks out the trunk with its why-notes, for review, land <intent-id> and why. Both configure the credential helper, so neither keeps a token.
Publish landed work back to GitHub
Section titled “Publish landed work back to GitHub”Agents never push to origin; they push to their forks, and approved changes land on the trunk. To put the trunk, with its why-notes, on the original remote:
wayglass publish # origin, the branch its HEAD points atwayglass publish --remote github --branch masterpublish fetches the trunk head and refs/notes/wayglass from Artifacts with a 60-second read-only token (memory only, and it checks .git afterwards), then pushes both to the remote with your own git credentials. It never forces: if the remote has commits the trunk lacks it stops with publish_rejected (exit 1) and nothing moves.
With mirror: origin in .wayglass/config.yaml (init --mirror origin), wayglass land does this after every land, so publish is the catch-up or by-hand version.
GitHub and GitLab store the notes ref but do not show it in their web views. Anyone with a clone sees the why with:
git fetch origin '+refs/notes/wayglass:refs/notes/wayglass'git log --show-notes=wayglassPull upstream changes in
Section titled “Pull upstream changes in”Commits that landed on GitHub directly (a hotfix, a dependabot merge) are a change to the trunk like any other, so they go through an intent and get their why and decision:
wayglass intent declare --goal "Bring in upstream main" \ --reason "Two hotfixes were merged on GitHub while agents worked" --path "**"git fetch origingit merge origin/main # or origin/master; resolve conflicts herewayglass push -m "merge: upstream main as of $(git rev-parse --short origin/main)"wayglass propose # the policy decides; wide paths usually go to a personwayglass land # once approvedwayglass publish # origin and the trunk agree againUntil that lands, publish keeps refusing with publish_rejected, which is the point: nothing reaches the trunk without a decision.
Not done
Section titled “Not done”- Artifacts’ own server-side
import(public HTTPS only) is not used; the local clone and push take under a minute for a few thousand commits and work for private repositories too. - The trunk branch cannot be named anything but
main.