Flatbread 1.0.0
Flatbread 1.0
Flatbread turns files in Git into a typed relational graph. With 1.0, the project finds a new leading use case: durable memory for coding agents. All packages ship at 1.0.0 and move together from here — one version across the set, so you no longer have to match alphas.
Introducing Proof
New agent sessions forget why previous ones made particular decisions. They look at the current codebase as a lossy snapshot and try to deduce the rationale from it. Sometimes they misread the decisions themselves. Unstructured docs are no better: they go stale and contradict each other. Proof keeps that reasoning in the repository, next to the code it explains.
An agent writes an Effort, then files Issues, Findings, Decisions, Constraints, Risks, Citations, and Blobs against it. Each record is a Markdown file under .flatbread-proof/. You commit, diff, and review them like source. Next session reads them back through bounded queries.
flatbread proof writeaccepts 15 mutations covering the full record lifecycle:CreateEffort,SetEffortStatus,WriteIssue,WriteFinding,WriteDecision,WriteConstraint,WriteRisk,WriteCitation,WriteBlob,Supersede,Invalidate,ResolveIssue,AcceptDecision,MitigateRisk,SetRiskState.- Five bounded reads return digests, not raw records:
flatbread proof list,records,relations,blocking-decisions, andget. Each caps at 25 records, one hop, 50 edges, 64 KiB, with a ≤160-token summary and namedcap_reasonswhen it truncates. - Writes go through a journal. A change that touches several files either finishes in full or leaves nothing behind; if the process dies mid-write, the next run restores the earlier contents.
- Lifecycle states derive from the mutation:
WriteIssueopens,WriteDecisionproposes,WriteRiskopens.AcceptDecisionrejects every other proposed Decision in the Effort by default. - Forward edges (
derives_from,supersedes,invalidates) live in payloads; reverse projections (superseded_by,invalidated_by, etc.) materialize automatically. - Strict read-your-writes:
--strict-min-generation <token>waits server-side for a write to land, or exits nonzero withPROOF_GENERATION_WAIT_TIMEOUT. Reads never return stale data silently. flatbread proof bootstrap --verifyexits nonzero whenproofContent()or the two.gitignorelines are missing, so it runs in CI.flatbread proof cache prunetrims the read cache to 100 MiB and drops digests older than 24 hours.- Writes flow through the committed-generation bridge: with
flatbread start --watchrunning, a Proof write appears in GraphQL and Explorer without a restart.
Explorer
- When config includes
proofContent()and the prebuilt assets are present,flatbread startserves the Explorer SPA at/and Apollo Sandbox at/graphql. - An interactive force-layout canvas plots the Effort graph. Hue and silhouette encode record kind — Issue diamond, Finding circle, Decision square, Constraint slab, Risk triangle, Effort ring. Retired records dim from the edges, not the frontmatter.
- A detail drawer renders the Markdown body (GFM, sanitized) and groups relations for in-graph navigation. Click a node to open it; arrow keys move between records; Escape closes.
- Live updates stream over SSE at
/events. The top bar shows live/connecting/partial/disconnected status, journal generation, and counts of Efforts, open Issues, proposed Decisions, and live Risks. - Static deploy: drop
dist/static/on any host and pass?endpoint=https://api.example.com/graphql. Same-origin needs no query param.
Codegen
flatbread codegenwritesgenerated/graphql.tsfrom the content model plus optional.graphqldocuments. Flags:--watch,--clear-cache,--documents,--verbose,--output-dir,--output-file.- Content-model types emit with no
.graphqldocuments required:FlatbreadCollectionName,FlatbreadRecord<'Post'>,FlatbreadRelationTarget<'Post', 'authors'>,FlatbreadRelationCardinality. createFlatbreadReadApi(execute)builds per-collectionall()andfind(id)helpers with a generated default selection. They still execute GraphQL. The optional selection-string argument is experimental.- Presets:
basic(no@graphql-typed-document-node/core),operations,full(default). flatbread start --watchregenerates types on content, config, and document changes — do not runflatbread codegen --watchbeside it.
Flatbread CLI
- Commands:
flatbread start,init,codegen,proof. There is noflatbread dev. flatbread start -- <framework command>starts GraphQL first, then the framework process.flatbread start --watch -- next dev --turbopackis the Next.js path.--watchincrementally reindexes content, hot-swaps the GraphQL schema, reloads config and matchers, and refreshes codegen. Invalid edits keep the last committed generation; the loop stays up.- Default port 5057.
-H, --httpsis reserved and does nothing — the server listens over plain HTTP. -X, --execoverrides the detected package manager (npm/pnpm/yarn/bun).flatbread initwrites a config skeleton withsourceFilesystem(),transformerMarkdown(), and Post/Authorrefs.
Query interface
- Every list field takes a MongoDB-style
filter:eq,ne,in,nin,includes,excludes,lt/lte/gt/gte,exists,strictlyExists,regex,wildcard. Peer paths combine with AND. - IDs normalize:
123and"123"are the same record. Duplicates after normalization fail schema generation. - Broken
refsfail before schema build with one aggregated error listing every missing target and invalid shape. - Field overrides (
content[].overrides) change GraphQL type andresolveper field. Path syntax handlesnested.object,an.array[],an.array[]with.object.fieldNameTransformrewrites field names globally. exportCollectionsAsJson()andexportCollectionsAsCsv()produce deterministic snapshots after the same ID and ref validation. Re-exported fromflatbread.
Plugins
@flatbread/source-filesystem— globpaths,refs, and capture segments likecontent/[category]/[title].md.fetchPathsenables--watchincremental reindex.@flatbread/transformer-markdown— gray-matter frontmatter, unified/remark withgfm,externalLinks,squeezeParagraphs, customremarkPlugins/rehypePlugins. Exposes_content { raw html excerpt(length) timeToRead(speed) }and_slugfrom the filename.@flatbread/transformer-yaml— pair astransformer: [transformerMarkdown(), transformerYaml()]for mixed Markdown + YAML collections.@flatbread/resolver-svimg—createSvImgField('image', { inputDir, outputDir, srcGenerator, avif, webp })as a field override. Querysrcset,srcsetwebp,srcsetavif,placeholder,aspectratio.
Skills
- The bundled Proof skill ships at
packages/proof/skills/proof/. Install withnpx skills add …/packages/proof/skills/proof --skill proof. It teaches an agent the 15 mutations, the five bounded reads, the Citation-before-citesorder,AcceptDecision'srejectSiblings, and the strict read-your-writes contract. effort-modelinggrills a plan one question at a time, then journals Findings, Issues, Constraints, Risks, and Decisions into Proof.grill-with-effortsruns that grilling end-to-end and refuses to implement until the user commits.
Relational content for sites, docs, and internal tools
The same engine still backs sites, docs, and internal tools. Markdown and YAML files become typed collections that link to each other. A post names its authors by id, and Flatbread resolves them. You get versioned, reviewable content with joins over files, without a CMS database.
Docs
- The READMEs and
docs/positioning.mdlead with Proof: an agent's Efforts, Issues, Findings, Decisions, Constraints, Risks, Citations, and Blobs written as Markdown records in your repository. The reasoning gets committed and reviewed like code. - Relational content for sites, docs, and internal tools stays a first-class second path on the same engine. GraphQL is described as one read interface over the graph rather than as the product.
- The banner that called the whole project experimental is gone. The narrower qualifiers still hold: the generated TypeScript read API is a prototype, and its selection-string escape hatch is experimental.
Upgrading
Requires Node 20.19+. Install flatbread@^1.0.0 to update.
To adopt agent memory, add proofContent() to your flatbread.config.js, run flatbread proof bootstrap, and add the two .gitignore lines for the journal and read cache. The Proof README has the full setup.