Flatbread is Git-native relational content for TypeScript/JavaScript apps: flat files become a typed graph; GraphQL is one read surface, not the whole product. It's a pnpm monorepo. See CONTRIBUTING.md for the canonical onboarding path.
See CONTRIBUTING.md for full details. Quick reference:
- Install:
pnpm install(enforces pnpm viapreinstallscript) - Build:
pnpm build(builds all packages except examples via tsup) - Lint:
pnpm lint(prettier) - Lint fix (after edits):
pnpm lint:fix:fast(writes formatting repo-wide to matchpnpm lint; staged-only:pnpm lint:fix, also runs via.husky/pre-commit) - Typecheck:
pnpm typecheck - Test:
pnpm test(builds, then runs ava + vitest suites, including@flatbread/proofbounded-loop coverage). For the focused proof loop suite:pnpm -F @flatbread/proof test. Vitest packages usepnpm -F @flatbread/utils exec vitest run/pnpm -F @flatbread/codegen exec vitest run(runavoids watch mode). - Full verify:
pnpm verify(lint + typecheck + build + test) - Proof loop contract: explicit
DAG.loops[].reexecute.taskssubsets must be dependency-closed, multiple loops must have disjoint re-execution sets, andDAG.loopsmust not be combined with--converge-on. - Dev server:
pnpm play(GraphQL on port 5057, Next.js on port 3000). Fromexamples/nextjs, preferpnpm exec flatbread start -- next dev --turbopack. Useflatbread start—flatbread devis not a CLI command.
The repo uses Mergify stacks for PR management. The mergify-cli is installed via pip install mergify-cli (included in the update script). Key points:
- Use
mergify stack pushinstead ofgit pushon feature branches (the.husky/pre-pushhook will remind you). - The commit-msg hook (
.husky/commit-msg) auto-appends aChange-Idtrailer for stack tracking. - See
.agents/skills/mergify-stack/SKILL.mdfor the full workflow.
@flatbread/proofrequiresCURSOR_RIPGREP_PATH. The proof package uses@cursor/sdkwhich expects a bundled ripgrep. In Cloud Agent VMs, setexport CURSOR_RIPGREP_PATH=/usr/bin/rgto use the system ripgrep (included in the update script).- Native build scripts are approved in
pnpm-workspace.yaml. TheonlyBuiltDependencieslist allows esbuild, sharp, @swc/core, etc. to run their postinstall scripts automatically duringpnpm install. - Vitest packages run in watch mode by default. Always use
vitest run(not barevitest) to get a single run and exit. flatbreadCLI is not on PATH globally. Fromexamples/nextjs, preferpnpm exec flatbread …(local binary), ornpx flatbreadfrom a shell. Thepnpm playscript from the root handles this automatically.- Build before test. All packages must be built (
pnpm build) before running tests or starting dev servers.pnpm testhandles this automatically. - The Next.js example
devscript uses--https. This requires an SSL certificate. In headless/CI environments, run without--https:pnpm exec flatbread start -- next dev --turbopack. - Full local CI parity check:
pnpm verifyruns lint, typecheck, build, and all tests.
The repo uses weave for entity-level semantic merges. The .gitattributes file routes supported file types (.ts, .js, .json, .md, .yaml, etc.) through weave-driver, which resolves merges at the function/class/entity level instead of line-by-line.
- Binaries:
weave(CLI) andweave-driver(git merge driver), installed viacargo install --git https://github.com/Ataraxy-Labs/weave weave-cli weave-driver. The update script handles this. - Preview a merge:
weave preview <branch>— dry-run that shows which files/entities would merge cleanly or conflict. - Config:
weave setupwas already run; git configmerge.weave.driverpoints toweave-driver. No re-run needed unless the binary path changes. - Rust toolchain: Weave requires Rust >= 1.89. The update script ensures
rustup default stableis set.