Lineage

Docs · view on GitHub

The factory

The factory generates trustworthy source-to-output pipelines: raw material goes in and is frozen, every claim made from it cites back to the exact lines it came from, and a person decides at named points. Give it five answers and it writes a new pipeline, with skills, a runtime, a fixture and a HOWTO, for a different kind of source material.

Lineage is one instance. Its sources are a family's recordings, photographs, documents and public records; what it builds from them is a family record (a genealogy, a timeline and an encyclopedia of the people, places, events, vessels, organizations and objects in the material), and one of that record's outputs is a printed book. The pattern is the same whether the output is a book, an encyclopedia, a report or a page.

/plugin marketplace add rexsaurus/Lineage
/plugin install factory@lineage

Then ask Claude for "a pipeline like Lineage for ". Or run the generator directly:

python plugins/factory/skills/factory/scripts/scaffold.py \
  plugins/factory/skills/factory/examples/incident-review.yaml --out /tmp/postmortem
cd /tmp/postmortem && make fixture

The pattern

sources ──► units ──► map ──► generated output
 (fixed)   (cited)   (order)  (never hand-edited)
     ▲          ▲                    ▲
   gate       gate              final sign-off

Raw material comes in and is frozen. It is cut into small units that each cite the lines they came from. The output is generated from the units in an order a person approves. Humans decide at named points. Everything the model adds that the sources don't support is quarantined until someone accepts it.

The five variables

Only these change from domain to domain:

  1. The source, and what a citation looks like. Interview audio cited by timestamp; a chat export cited by line; a paper cited by page. The citation format is how every later claim points home.
  2. The unit. The smallest piece that stands alone and can be moved without rewriting anything: a story, a decision, a timeline event, a finding. Get this right and reordering the output is a one-line change.
  3. The evidence tiers. How well a claim is supported: witnessed / told / lore; logged / stated / reconstructed; documented / asserted / disputed. Every unit declares one.
  4. The output, and what builds it. A printed book via Typst, a browsable encyclopedia, an HTML page, Markdown, or anything a shell command can produce. One record can have several outputs; Lineage's include a Familypedia, a timeline, a genealogy and a book.
  5. The gates. The points where a human decides: are these the right sources, is this the right structure, may this go out. Each has one question.

The invariants, and why each exists

These are generated for every domain and never vary, because they are what make the output trustworthy.

How to point the factory at a new domain

  1. Answer the five questions. Write them down as a spec. examples/toy-minutes.yaml is complete, with a fixture; examples/incident-review.yaml shows a non-book domain; examples/lineage.yaml is Lineage itself as five answers.
  2. Run scaffold.py <spec> --out <dir> and then make fixture in that folder. It must pass.
  3. Write the domain's own rules into <name>-policy §7. These are the mistakes this domain punishes.
  4. Replace the generic fixture with a small real one: two sources, three units, one bridge.
  5. Extend only where the domain needs it, for example audio transcription or page layout, adding scripts beside pl.py. Keep the invariants, and keep make fixture green.

What the generic runtime does not do

It cites lines of plain-text sources. Timestamps, page numbers in PDFs, and audio need a domain extension, as Lineage adds. It doesn't judge whether a unit's text is faithful to its lines. It proves that every claim points at the right lines, and leaves the reading to the human at the gate.