@manifesto-ai/lineage
Optional history and restore extension for the runtime.
Overview
@manifesto-ai/lineage is an optional protocol extension that adds history, restore, audit, branch/head queries, and sealed records to a Manifesto app definition. It is not part of the base runtime ontology.
Current Contract Note: This page describes the Lineage v5 action handle surface. The package contract is packages/lineage/docs/lineage-SPEC.md.
Use this package when you want:
withLineage(createManifesto(...), config).activate()- seal-aware
action.<name>.submit(...args) - lineage
LineageSubmissionResultvalues withworldandreport - head, branch, world, and restore APIs on the activated runtime
getWorldSnapshot(worldId)for stored snapshot inspection by history idgetLineage()for DAG inspection- direct access to
@manifesto-ai/lineage/providerfor low-level persistence and tooling
Runtime Surface
import { createManifesto } from "@manifesto-ai/sdk";
import { createInMemoryLineageStore, withLineage } from "@manifesto-ai/lineage";
import TodoMel from "./domain/todo.mel";
import type { TodoDomain } from "./domain/todo.domain";
const lineage = withLineage(
createManifesto<TodoDomain>(TodoMel, effects),
{ store: createInMemoryLineageStore() },
).activate();What This Package Owns
withLineage()andLineageConfig- activated
LineageInstance<T> - lineage-aware
action.<name>.submit(...args)that seals before publication - lineage-owned
LineageSubmissionResultreports - inherited action handle reads such as
available(),check(), andpreview() restore,getWorld,getWorldSnapshot,getLineage,getLatestHead,getHeads,getBranches,getActiveBranch,switchActiveBranch,createBranch- history ownership plus the provider surface
Those inherited legality queries keep the base SDK meaning:
- availability is checked before dispatchability
check()returns the first failing layer, so an unavailable action yields an availability failure and does not evaluatedispatchable
Runtime Meaning
action.<name>.submit(...args) on a lineage runtime is not the base SDK write path.
It means:
- admit the typed action submission
- execute the intent through Host/Core
- seal the resulting terminal snapshot into lineage
- publish only the snapshot that becomes the new visible head
If seal commit fails, submit rejects with SubmissionFailedError and the new snapshot does not become visible.
Settled lineage results include before, after, world, outcome, and an optional report. Failed domain outcomes can still settle and seal a failed world; settlement failures reject instead of fabricating a lineage result.
Relationship to SDK
@manifesto-ai/sdk
-> createManifesto(...)
-> withLineage(...)
-> activate()SDK owns the base activation boundary. Lineage owns history once that boundary is decorated.
On a lineage runtime:
snapshot()is the app-facing runtime readinspect.canonicalSnapshot()is the current visible full internal snapshotgetWorldSnapshot(worldId)is the stored sealed full snapshot- base dispatch verbs and historical lineage commit verbs are no longer part of the runtime surface
Lineage-Backed Inspection
Use getWorldSnapshot(worldId) when a tool needs to inspect a stored world without changing the live visible runtime. Pair that stored full snapshot with @manifesto-ai/sdk/extensions for app-facing projection, explanation, and read-only simulation.
Replay tooling should also read the seal attempt's computeEnvelope. The envelope stores the exact submitted intent and full Core Context used for the transition. It is replay/accountability metadata and does not participate in world identity hashes.
Use restore(worldId) only when the product is intentionally resuming the visible runtime from that world.
The full Studio/tooling recipe is in Runtime Tooling Surface.