Capsule factory + video stack (2026-04-23)
Part of LiteShip: the CZAP engine’s capsule and scene assembly. Vocabulary: GLOSSARY.md.
Landed by spec 2026-04-23-capsule-factory-video-stack-design.md (the spec itself was an internal design document; the resulting decisions live in ADRs 0007, 0008, 0009, and 0010 in this repo).
Capsule factory
packages/core/src/capsule.ts:CapsuleContract<K, In, Out, R>base type;TypeValidatorruntime check against_spineschemas.packages/core/src/assembly.ts: 7-arm catalog (pureTransform,receiptedMutation,stateMachine,siteAdapter,policyGate,cachedProjection,sceneComposition) +defineCapsulefactory + module-level registry.packages/core/src/harness/*: per-arm harness templates emit property tests, benches, docs, audit receipts.scripts/capsule-compile.ts: AST walk of everydefineCapsule(...)call, dispatches to harness templates, emitsreports/capsule-manifest.json.packages/command/src/commands/capsule-verify.ts(run viapnpm capsule:verify/ thecapsule-verifyCLI command): re-runs generated tests, checks manifest integrity.- ADR-0008 governs the catalog; adding an 8th arm requires amendment + first instance in the same PR.
Scene stack
packages/scene/:SceneContract+Track.video/audio/transition/effecthelpers + scene compiler that spawns ECS worlds + 6 canonical systems (Video/Audio/Transition/Effect/Sync/PassThroughMixer).packages/scene/src/dev/: Vite-backed browser player with HMR-reactive scene reload.- ADR-0009 commits to ECS as the scene substrate.
Assets
packages/assets/:defineAssetwrapscachedProjection, decoders for audio/video/image, analysis projections (BeatMarkerProjection,OnsetProjection,WaveformProjection,WavMetadataProjection). These run offline at build time; the liveaudio.amplitude/audio.beatboundary signals (a main-threadAnalyserNodeproducer in@czap/astro/runtime) mirror the same RMS/flux DSP at runtime.
CLI + MCP
packages/cli/: dual-audience surface. JSON receipts by default; TTY-detect for human-pretty summaries. Commands: describe / scene.{compile,render,verify,dev} / asset.{analyze,verify} / capsule.{inspect,verify,list} / gauntlet / mcp.packages/mcp-server/: thin MCP runner. Stdio default,--http=:portoptional. Dispatches tools/call through@czap/command.
Spine as Canonical Types
packages/_spine/*.d.tsis now referenced from project references + vitest aliases.packages/core/src/brands.tsre-exports branded types FROM_spine. Runtime constructors remain in the implementation packages.- ADR-0010 documents the closure of the Spine Runtime Gap.