Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

refactor: remove stale runtime scaffolding

kashorinadc463908d19
diff --git a/docs/guide/packages.md b/docs/guide/packages.md
index 0ecb4028..0e574527 100644
--- a/docs/guide/packages.md
+++ b/docs/guide/packages.md
@@ -122,7 +122,7 @@ never on exact-model packages or the CLI.
@narratage/provider-whisperx-local local WhisperX service
@narratage/provider-google-vertex Vertex Gemini caption planning
@narratage/provider-hyperframes-local local Chrome rendering
-@narratage/provider-hyperframes-aws-lambda recoverable distributed rendering
+@narratage/provider-hyperframes-aws-lambda asynchronous distributed rendering
@narratage/provider-image-opencv-local local OpenCV Raster execution
@narratage/provider-media-aws-lambda synchronous AWS media execution
@narratage/provider-xiaomi-mimo official Xiaomi MiMo TTS API
@@ -131,7 +131,7 @@ never on exact-model packages or the CLI.
### Layer 6: Runtime
Domain-neutral execution ports plus replaceable deployment implementations. Runtime packages own
-queues, leases, stores, credentials and process lifecycle; they never define author syntax.
+queues, stores, credentials and process lifecycle; they never define author syntax.
```text
@narratage/runtime Scheduler, Worker and Store ports
diff --git a/docs/guide/providers.md b/docs/guide/providers.md
index 4e4a3875..56a91983 100644
--- a/docs/guide/providers.md
+++ b/docs/guide/providers.md
@@ -69,8 +69,8 @@ export function createMyServiceProvider(options: {
capability: myCapability,
returns: myResultType,
lane: "generate",
- lifecycle: "recoverable",
- endpoint: myRecoverableEndpoint,
+ lifecycle: "asynchronous",
+ endpoint: myAsyncEndpoint,
}],
});
}
@@ -81,7 +81,7 @@ Look at existing Providers for reference:
- `packages/provider-media-local/` — local process execution (ffprobe/ffmpeg)
- `packages/provider-whisperx-local/` — local HTTP service
- `packages/provider-hyperframes-local/` — local Chrome rendering
-- `packages/provider-hyperframes-aws-lambda/` — recoverable Step Functions/Lambda rendering
+- `packages/provider-hyperframes-aws-lambda/` — asynchronous Step Functions/Lambda rendering
- `packages/provider-media-aws-lambda/` — synchronous Lambda media execution over the shared ffmpeg body
- `packages/provider-xiaomi-mimo/` — immediate official TTS API without importing the MiMo model package
@@ -218,7 +218,7 @@ narratage doctor narratage.runtime.json
| `provider-whisperx-local` | Local HTTP service with a warm model, single-admit concurrency |
| `provider-google-vertex` | Cloud API: Vertex AI with project/credentials configuration |
| `provider-hyperframes-local` | Local process: Chrome rendering with worker parallelism and output probe validation |
-| `provider-hyperframes-aws-lambda` | Remote recoverable job: deterministic Step Functions submission, polling and S3 streaming |
+| `provider-hyperframes-aws-lambda` | Remote asynchronous job: Step Functions submission, polling and S3 streaming |
| `provider-image-opencv-local` | Local Python: bounded OpenCV/NumPy with locked Python environment |
| `provider-media-aws-lambda` | Remote synchronous Lambda: the same eight capabilities as local media |
| `provider-xiaomi-mimo` | Remote immediate API: exact MiMo TTS requests to persisted audio Artifacts |
diff --git a/docs/quickstart/run.md b/docs/quickstart/run.md
index 8fe817b0..33ffd68b 100644
--- a/docs/quickstart/run.md
+++ b/docs/quickstart/run.md
@@ -368,6 +368,6 @@ narratage runtime logs
narratage runtime down
```
-`runtime down` stops the Worker from claiming more leases but leaves external programs running.
+`runtime down` stops the Worker from claiming more Builds but leaves external programs running.
Use `programs down` only when those programs should also stop. Neither command cancels durable
Builds or remote Provider work. Starting the same Profile again continues unfinished dispatches.
diff --git a/docs/zh/guide/packages.md b/docs/zh/guide/packages.md
index 0b60f675..aca4bf0d 100644
--- a/docs/zh/guide/packages.md
+++ b/docs/zh/guide/packages.md
@@ -116,7 +116,7 @@ Frontend;不存在一个认识全部语法的中央解析器。
@narratage/provider-whisperx-local local WhisperX service
@narratage/provider-google-vertex Vertex Gemini caption planning
@narratage/provider-hyperframes-local local Chrome rendering
-@narratage/provider-hyperframes-aws-lambda recoverable distributed rendering
+@narratage/provider-hyperframes-aws-lambda asynchronous distributed rendering
@narratage/provider-image-opencv-local 本地 OpenCV 光栅执行
@narratage/provider-media-aws-lambda synchronous AWS media execution
@narratage/provider-xiaomi-mimo Xiaomi 官方 MiMo TTS API
@@ -124,7 +124,7 @@ Frontend;不存在一个认识全部语法的中央解析器。
### Layer 6:Runtime
-领域无关的执行端口与可替换部署实现。Runtime 包负责队列、租约、Store、凭据与进程生命周期,
+领域无关的执行端口与可替换部署实现。Runtime 包负责队列、Store、凭据与进程生命周期,
但不定义作者语法。
```text
diff --git a/docs/zh/guide/providers.md b/docs/zh/guide/providers.md
index ecb5ba25..fb73e6b9 100644
--- a/docs/zh/guide/providers.md
+++ b/docs/zh/guide/providers.md
@@ -65,8 +65,8 @@ export function createMyServiceProvider(options: {
capability: myCapability,
returns: myResultType,
lane: "generate",
- lifecycle: "recoverable",
- endpoint: myRecoverableEndpoint,
+ lifecycle: "asynchronous",
+ endpoint: myAsyncEndpoint,
}],
});
}
@@ -77,7 +77,7 @@ export function createMyServiceProvider(options: {
- `packages/provider-media-local/` — 本地进程执行(ffprobe/ffmpeg)
- `packages/provider-whisperx-local/` — 本地 HTTP 服务
- `packages/provider-hyperframes-local/` — 本地 Chrome 渲染
-- `packages/provider-hyperframes-aws-lambda/` — 可恢复的 Step Functions/Lambda 渲染
+- `packages/provider-hyperframes-aws-lambda/` — 异步 Step Functions/Lambda 渲染
- `packages/provider-media-aws-lambda/` — 通过共享 ffmpeg 执行体完成同步 Lambda 媒体操作
- `packages/provider-xiaomi-mimo/` — 不依赖 MiMo 模型包的官方即时 TTS API
diff --git a/docs/zh/quickstart/run.md b/docs/zh/quickstart/run.md
index af0f72cd..e0562a77 100644
--- a/docs/zh/quickstart/run.md
+++ b/docs/zh/quickstart/run.md
@@ -365,6 +365,6 @@ narratage runtime logs
narratage runtime down
```
-`runtime down` 只会让 Worker 停止领取新 lease,并保留外部程序;只有确实要停掉这些程序时
+`runtime down` 只会让 Worker 停止领取新 Build,并保留外部程序;只有确实要停掉这些程序时
才执行 `programs down`。两条命令都不会取消耐久 Build 或远程 Provider 工作。再次启动同一
Profile 后,会继续其中尚未完成的 dispatch。
diff --git a/packages/artifact-store-s3/src/store.ts b/packages/artifact-store-s3/src/store.ts
index d6dd45c2..ef657722 100644
--- a/packages/artifact-store-s3/src/store.ts
+++ b/packages/artifact-store-s3/src/store.ts
@@ -314,15 +314,6 @@ export function createS3ArtifactStore(
options: CreateS3ArtifactStorePackageOptions,
): S3ArtifactStore {
const prefix = normalizePrefix(options.prefix);
- const configuration = {
- bucket: options.bucket,
- prefix,
- ...(options.expectedBucketOwner === undefined ? {} : { expectedBucketOwner: options.expectedBucketOwner }),
- ...(options.region === undefined ? {} : { region: options.region }),
- ...(options.endpoint === undefined ? {} : { endpoint: options.endpoint }),
- ...(options.forcePathStyle === undefined ? {} : { forcePathStyle: options.forcePathStyle }),
- ...(options.partSizeBytes === undefined ? {} : { partSizeBytes: options.partSizeBytes }),
- };
const client = options.client ?? new AwsS3ObjectClient({
...(options.region === undefined ? {} : { region: options.region }),
...(options.endpoint === undefined ? {} : { endpoint: options.endpoint }),
diff --git a/packages/cli/README.md b/packages/cli/README.md
index 0208d17e..adbcad6a 100644
--- a/packages/cli/README.md
+++ b/packages/cli/README.md
@@ -1,35 +1,15 @@
# `@narratage/cli`
-Domain-neutral command engine for Build compilation, execution, inspection and egress.
+Domain neutral commands for checking, planning, building and inspecting Narratage projects.
-The engine implements `check`, `plan`, `build`, `status`, `builds`, `inspect`, `get`
-and `cancel`, but owns no default author vocabulary, Frontend or Provider adapter. Its caller
-must pass one explicit `CliDistribution`:
+The command engine receives one explicit `CliDistribution`. A distribution supplies the compiler,
+trusted bootstrap packages, source package discovery and the Runtime Host selected by a Runtime
+Profile. The official video executable is assembled by `@narratage/video-cli`; another domain can
+reuse this package without installing video packages.
-```ts
-type CliDistribution = {
- packageRoot?: string;
- bootstrapPackages: readonly LoadedPackage[];
- createCompiler(options): NodeCompiler;
- runtimeProfileRevision(path): Promise<string>;
- createRuntimeFromConfig(path): Promise<CliRuntime>;
-};
-```
+Source imports decide which language and component packages give the source meaning. The Runtime
+Profile separately selects the Host and environment packages allowed to execute work. The CLI does
+not invent targets, candidates or provider choices.
-A Distribution is trusted application assembly, not Core data or source-import authority. The
-official `@narratage/video-cli` selects `@narratage/compiler-markup-node` and the current video Runtime
-adapters, but no author-package aggregate. Source imports select Author and Run packages from the
-project's installed dependencies.
-Another domain can reuse this command engine without installing any video package.
-The Worker lifecycle compares only the opaque revision supplied by the Distribution; the command
-engine does not parse a Runtime Profile or know which files that Profile considers deployment input.
-
-`check` accepts any self-described Author or Run Source whose Header names a trusted Frontend.
-`plan` and `build` require a Run Source. Targets and Candidate selections may
-not be synthesized by CLI flags; they are visible Run Graph meaning.
-
-The command engine has one structured presentation seam. `check`, `plan` and `doctor` currently
-render compact human output by default; `--verbose` reveals closure identities and complete lists,
-while explicit `--json` preserves full machine-readable data without ANSI or progress prose.
-TTY capability is supplied only by the executable Distribution entrypoint. Providers, components
-and Frontends return structured facts and never print directly to the terminal.
+Human output is compact by default. `--verbose` expands details and `--json` emits machine readable
+results without presentation text.
diff --git a/packages/cli/src/output.ts b/packages/cli/src/output.ts
index 51738d9f..2a062697 100644
--- a/packages/cli/src/output.ts
+++ b/packages/cli/src/output.ts
@@ -261,7 +261,6 @@ function renderRunCheck(
view: Extract<CliPresentation, { kind: "check-run" }>,
io: CliIo,
colors: Palette,
- verbose: boolean,
): string {
const lines = [heading("success", "Run source is valid", io, colors), ""];
lines.push(...facts([
@@ -385,7 +384,7 @@ export function writeCliOutput(
: presentation.kind === "check-author"
? renderAuthorCheck(presentation, io, colors, options.verbose)
: presentation.kind === "check-run"
- ? renderRunCheck(presentation, io, colors, options.verbose)
+ ? renderRunCheck(presentation, io, colors)
: presentation.kind === "plan"
? renderPlan(presentation, io, colors, options.verbose)
: renderOperational(presentation, io, colors);
diff --git a/packages/cli/test/build-programs.test.ts b/packages/cli/test/build-programs.test.ts
index 49fed905..16c457c8 100644
--- a/packages/cli/test/build-programs.test.ts
+++ b/packages/cli/test/build-programs.test.ts
@@ -3,7 +3,6 @@ import { mkdtemp, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { createRunFrontendHostFacet } from "@narratage/run";
@@ -23,16 +22,14 @@ function distribution(
programs: readonly CliManagedProgramReport[],
): CliDistribution {
return {
- name: "test",
bootstrapPackages: [{
specifier: "@example/run-frontend",
- digest: fixtureDigest("@example/run-frontend"),
contribution: {
format: "narratage.node-package@1",
hostFacets: [createRunFrontendHostFacet({
id: "@narratage/run-markup@1",
- discover() { throw new Error("createRuntimeFromConfig is unavailable"); },
- decode() { throw new Error("createRuntimeFromConfig is unavailable"); },
+ discover() { throw new Error("createRuntime is unavailable"); },
+ decode() { throw new Error("createRuntime is unavailable"); },
})],
},
}],
@@ -48,7 +45,6 @@ function distribution(
controller: async () => ({
profile: path,
dataRoot: "/tmp",
- revision: async () => "test-revision",
worker: {
up: async () => ({ state: "stopped", profile: path, logPath: "/tmp/worker.log" }),
status: async () => ({ state: "stopped", profile: path, logPath: "/tmp/worker.log" }),
@@ -65,7 +61,7 @@ function distribution(
},
}),
doctor: async () => ({ dataRoot: "/tmp", diagnostics: [] }),
- createRuntime: async () => { throw new Error("createRuntimeFromConfig is unavailable"); },
+ createRuntime: async () => { throw new Error("createRuntime is unavailable"); },
openArchive: async () => ({ status: async () => ({}) }),
}),
} as unknown as CliDistribution;
@@ -93,7 +89,7 @@ test("a Build that cannot construct its Runtime starts no declared external prog
detail: "uv failed: no such project",
}]),
),
- /createRuntimeFromConfig/u,
+ /createRuntime is unavailable/u,
);
assert.deepEqual(calls, []);
});
@@ -102,7 +98,7 @@ test("--no-programs leaves the declared programs alone", async () => {
const calls: string[] = [];
const source = await runSource();
// Reaching the Runtime is the boundary just past the gate: the stub has no
- // createRuntimeFromConfig, so arriving there proves the down program was
+ // createRuntime, so arriving there proves the down program was
// never consulted rather than merely tolerated.
await assert.rejects(
async () => await runCli(
@@ -114,7 +110,7 @@ test("--no-programs leaves the declared programs alone", async () => {
state: { state: "down", detail: "nothing is answering" },
}]),
),
- /createRuntimeFromConfig/u,
+ /createRuntime is unavailable/u,
);
assert.deepEqual(calls, []);
});
diff --git a/packages/cli/test/source-discovery.test.ts b/packages/cli/test/source-discovery.test.ts
index c843732d..22de30de 100644
--- a/packages/cli/test/source-discovery.test.ts
+++ b/packages/cli/test/source-discovery.test.ts
@@ -3,7 +3,6 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { modulePackageAbi } from "@narratage/protocol";
import { createAuthorFrontendHostFacet } from "@narratage/elaborator";
@@ -58,11 +57,10 @@ test("third-party Frontends discover same-named ABI requirements through physica
contribution: { format: "narratage.node-package@1" as const, hostFacets: [{
abi: runFragmentHostAbi,
offers: ["@logical/shared@1"],
- identity: { contract: "example.fragment@1" },
implementation: {},
}] },
},
- ].map((item) => ({ ...item, digest: fixtureDigest(item.specifier) }));
+ ];
const discovered = await discoverSourcePackages(join(root, "build.svrun"), {
workspaceRoot: root,
packages,
diff --git a/packages/compiler-markup-node/src/index.ts b/packages/compiler-markup-node/src/index.ts
index 4d15e704..d4ca9315 100644
--- a/packages/compiler-markup-node/src/index.ts
+++ b/packages/compiler-markup-node/src/index.ts
@@ -13,7 +13,6 @@ import {
createMarkupAuthorFrontend,
installMarkupSurfaceHostFacets,
MarkupSurfaceRegistry,
- markupAuthorFrontendId,
} from "@narratage/markup";
import { TypeValidatorRegistry } from "@narratage/validation";
diff --git a/packages/compiler-node/test/compiler.test.ts b/packages/compiler-node/test/compiler.test.ts
index 8a6c3e5f..ae5900c8 100644
--- a/packages/compiler-node/test/compiler.test.ts
+++ b/packages/compiler-node/test/compiler.test.ts
@@ -94,7 +94,6 @@ test("module registration is atomic", () => {
const laboratory = { name: "example.compiler-lab", version: "1" } as const;
const resultType = { module: laboratory, name: "Result" } satisfies TypeRef;
const producer = { module: laboratory, name: "produce" } satisfies ProducerRef;
-const surfaceDigest = "surface:example.compiler-lab/result";
const resultSurface = {
name: "result", tag: "Result", mode: "structured", outputs: [],
} as const;
@@ -129,7 +128,6 @@ const fragment = sealGraphFragment({
const assetLaboratory = { name: "example.asset-lab", version: "1" } as const;
const assetType = { module: assetLaboratory, name: "Asset" } satisfies TypeRef;
-const assetSurfaceDigest = "surface:example.asset-lab/asset";
const assetSurface = {
name: "asset", tag: "Asset", mode: "structured", outputs: [assetType],
} as const;
diff --git a/packages/core/README.md b/packages/core/README.md
index ba50df0a..371b1c78 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -1,36 +1,14 @@
# `@narratage/core`
-The domain-neutral Demand compiler and verified Build state machine.
+The domain neutral graph compiler and build state machine.
-The package accepts an already resolved module closure, typed authored modules, a complete
-`narratage.graph@1` and a `narratage.build-request@1`. It verifies explicit Satisfaction and compiles the finite
-BuildPlan by traversing backwards from every Target, resolving Logical Outputs and memoizing shared
-atomic Operations by stable OperationId during compilation. The BuildPlan is frozen before any
-external Command; execution performs no Candidate selection, graph mutation or content-based
-deduplication. Durable execution is one immutable `BuildDefinition` plus fixed, append-only
-`BuildFact` values. `BuildMachine` reconstructs a disposable read/execution view and derives every
-pending Command; Commands and the materialized `BuildState` are never stored as authority.
+Core links module declarations, validates a compiled graph and walks backwards from the requested
+targets. Explicit candidate selections decide how each logical output is realized. The result is a
+finite `BuildPlan` containing only the operations needed for that build.
-Derivations bind Producer and implementation identity, input/output Record digests, Need request
-digests and the accepted event digest. Need Receipts content-address the Driver-attested Endpoint
-implementation/configuration/Runtime closure binding when present, without Core learning what that
-implementation does.
+Execution is one immutable `BuildDefinition` followed by accepted `BuildFact` values. `BuildMachine`
+reconstructs the current view, emits the next commands and accepts their results. The materialized
+`BuildState` is a disposable view rather than durable authority.
-Cross-package Types are nominal: exact module name, version and type name must match. Core checks
-their package-owned structural Schema. If the Type owner locked a semantic validator in its
-Manifest, every authored, provided, Producer or Provider Record must also carry a validation
-receipt bound to the exact Type, value digest and locked validator digest. Core verifies this
-receipt uniformly but never executes the validator; trusted Host admission lives in
-`@narratage/validation`.
-
-It does not know whether author source has tags, indentation, prose or any other syntax. It does not
-parse source, resolve package locations, execute
-implementations, access artifact bytes, select Provider endpoints or discover undeclared graph
-structure. Those responsibilities remain outside Core.
-
-For a non-video domain, the irreducible reusable base is only `@narratage/protocol` plus `@narratage/core`.
-Most source languages will also use `@narratage/elaborator` to turn modular component declarations into a
-Graph, and a Driver/Runtime package to execute Commands. `@narratage/markup`, `@narratage/run` and every
-domain contract package are optional layers; none receives Kernel privilege by being official.
-Domains that declare semantic Type validators additionally need a Host admission implementation;
-the reference one is `@narratage/validation`.
+Core does not parse source files, load packages, execute components, call providers, store artifact
+bytes or know what a video is. Those responsibilities remain in compiler and runtime packages.
diff --git a/packages/core/src/graph.ts b/packages/core/src/graph.ts
index 77ceb286..e51098dd 100644
--- a/packages/core/src/graph.ts
+++ b/packages/core/src/graph.ts
@@ -8,7 +8,6 @@ import type {
LogicalOutput,
OperationNode,
OperationResult,
- ProducerRef,
StoredValue,
TypeRef,
} from "@narratage/protocol";
diff --git a/packages/core/src/link.ts b/packages/core/src/link.ts
index f695d53d..68d350a9 100644
--- a/packages/core/src/link.ts
+++ b/packages/core/src/link.ts
@@ -1,5 +1,4 @@
import type {
- CapabilityRef,
LinkedProgram,
ModuleManifest,
ModuleRef,
@@ -15,7 +14,7 @@ import type {
} from "@narratage/protocol";
import { invariant } from "./error.js";
-import { capabilityKey, moduleKey, producerKey, sameType, typeKey } from "./reference.js";
+import { capabilityKey, moduleKey, producerKey, typeKey } from "./reference.js";
export type TypedRecordDraft = TypedRecord;
diff --git a/packages/core/src/plan.ts b/packages/core/src/plan.ts
index c128799e..cf0e544f 100644
--- a/packages/core/src/plan.ts
+++ b/packages/core/src/plan.ts
@@ -223,14 +223,13 @@ export function compileBuild(
.sort((a, b) => a.record.localeCompare(b.record));
const sortedSelections = [...selections.values()].sort((a, b) => a.output.localeCompare(b.output));
const plan = planContent(steps, goals, sortedSelections);
- validatePlanStructure(program, graph, request, plan);
+ validatePlanStructure(program, graph, plan);
return plan;
}
function validatePlanStructure(
program: LinkedProgram,
graph: CompiledGraph,
- request: BuildRequest,
plan: BuildPlan,
): void {
invariant(plan.format === "narratage.plan@1", "UNSUPPORTED_PLAN", "unsupported build plan format");
@@ -311,7 +310,7 @@ export function validatePlan(
plan: BuildPlan,
): void {
verifyBuildRequest(program, graph, request);
- validatePlanStructure(program, graph, request, plan);
+ validatePlanStructure(program, graph, plan);
}
/** Materialize selected zero-input values from their sole source of truth: the Run Graph. */
diff --git a/packages/core/test/core.test.ts b/packages/core/test/core.test.ts
index 719d5f85..17c93b3c 100644
--- a/packages/core/test/core.test.ts
+++ b/packages/core/test/core.test.ts
@@ -16,7 +16,7 @@ import type {
ValueSchema,
} from "@narratage/protocol";
-import { createGreetingBuild, producers } from "./greeting-fixture.js";
+import { createGreetingBuild } from "./greeting-fixture.js";
function onlyProducer(state: BuildState): { state: BuildState; command: InvokeProducerCommand } {
const next = reduce(state);
diff --git a/packages/core/test/demand.test.ts b/packages/core/test/demand.test.ts
index c7466287..522c721c 100644
--- a/packages/core/test/demand.test.ts
+++ b/packages/core/test/demand.test.ts
@@ -239,7 +239,7 @@ function createProgram(): LinkedProgram {
return link(closure, authored);
}
-function createImageGraph(program: LinkedProgram): CompiledGraph {
+function createImageGraph(): CompiledGraph {
return sealCompiledGraph({
outputs: [
output("image1", types.image, "p1"),
@@ -276,10 +276,7 @@ function createImageGraph(program: LinkedProgram): CompiledGraph {
});
}
-function request(
- graph: CompiledGraph,
- targets: readonly string[],
-): BuildRequest {
+function request(targets: readonly string[]): BuildRequest {
return sealBuildRequest({
targets: targets.map((outputId) => ({ output: outputId })),
});
@@ -301,12 +298,12 @@ function startSelected(
satisfactions: readonly Satisfaction[] = [],
): BuildState {
const selected = selectCandidates(graph, satisfactions);
- return start(program, selected, request(selected, targets));
+ return start(program, selected, request(targets));
}
function fixture(targets: readonly string[], satisfactions: readonly Satisfaction[] = []): BuildState {
const program = createProgram();
- const graph = createImageGraph(program);
+ const graph = createImageGraph();
return startSelected(program, graph, targets, satisfactions);
}
@@ -371,7 +368,7 @@ test("Provided state survives JSON round-trip and regenerates identical ready Co
assert.deepEqual(reduce(restored).outstanding, scheduled.outstanding);
});
-function createCaseGGraph(program: LinkedProgram, roots: "value" | "operation"): CompiledGraph {
+function createCaseGGraph(roots: "value" | "operation"): CompiledGraph {
const a1Id = roots === "value" ? "a1-value" : "a1-operation";
const a2Id = roots === "value" ? "a2-value" : "a2-operation";
return sealCompiledGraph({
@@ -405,8 +402,8 @@ function createCaseGGraph(program: LinkedProgram, roots: "value" | "operation"):
test("Case G: two single-output full-input Candidates share both upstream Values", () => {
const program = createProgram();
- const graph = createCaseGGraph(program, "value");
- const state = start(program, graph, request(graph, ["c.result"]));
+ const graph = createCaseGGraph("value");
+ const state = start(program, graph, request(["c.result"]));
assert.deepEqual(stepIds(state), ["b1", "b2", "c"]);
assert.equal(state.records.some((record) => record.id === "provided:A"), true);
assert.equal(state.records.some((record) => record.id === "provided:B"), true);
@@ -420,8 +417,8 @@ test("Case G: two single-output full-input Candidates share both upstream Values
test("Case G: shared zero-input upstream Operations appear exactly once", () => {
const program = createProgram();
- const graph = createCaseGGraph(program, "operation");
- const state = start(program, graph, request(graph, ["c.result"]));
+ const graph = createCaseGGraph("operation");
+ const state = start(program, graph, request(["c.result"]));
assert.deepEqual(stepIds(state), ["a1", "a2", "b1", "b2", "c"]);
assert.equal(state.plan.steps.filter((step) => step.id === "a1").length, 1);
assert.equal(state.plan.steps.filter((step) => step.id === "a2").length, 1);
@@ -432,7 +429,6 @@ test("Case G: shared zero-input upstream Operations appear exactly once", () =>
});
function createOperationIdentityGraph(
- program: LinkedProgram,
mode: "shared" | "distinct",
): CompiledGraph {
return sealCompiledGraph({
@@ -470,8 +466,8 @@ function createOperationIdentityGraph(
test("two Candidates that name one OperationId demand exactly one execution", () => {
const program = createProgram();
- const graph = createOperationIdentityGraph(program, "shared");
- const state = start(program, graph, request(graph, ["left", "right"]));
+ const graph = createOperationIdentityGraph("shared");
+ const state = start(program, graph, request(["left", "right"]));
assert.deepEqual(stepIds(state), ["left-operation"]);
assert.deepEqual(
state.plan.selections.map((selection) => [selection.output, selection.record]),
@@ -481,7 +477,7 @@ test("two Candidates that name one OperationId demand exactly one execution", ()
test("one independent Candidate may explicitly satisfy multiple compatible Logical Outputs", () => {
const program = createProgram();
- const graph = createOperationIdentityGraph(program, "shared");
+ const graph = createOperationIdentityGraph("shared");
const state = startSelected(program, graph, ["left", "right"], [
{ output: "left", candidate: "shared-candidate" },
{ output: "right", candidate: "shared-candidate" },
@@ -495,8 +491,8 @@ test("one independent Candidate may explicitly satisfy multiple compatible Logic
test("different OperationIds are never content-deduplicated", () => {
const program = createProgram();
- const graph = createOperationIdentityGraph(program, "distinct");
- const state = start(program, graph, request(graph, ["left", "right"]));
+ const graph = createOperationIdentityGraph("distinct");
+ const state = start(program, graph, request(["left", "right"]));
assert.deepEqual(stepIds(state), ["left-operation", "right-operation"]);
assert.deepEqual(
state.plan.steps.map((step) => step.producer),
@@ -506,7 +502,6 @@ test("different OperationIds are never content-deduplicated", () => {
});
function createProductReplacementGraph(
- program: LinkedProgram,
alternate: "shared" | "distinct",
): CompiledGraph {
const productOperation = (
@@ -575,7 +570,7 @@ const select = (outputId: string, candidateId: string): Satisfaction => ({
test("one Run-Graph instance satisfies two Logical Outputs through one shared Product", () => {
const program = createProgram();
- const graph = createProductReplacementGraph(program, "shared");
+ const graph = createProductReplacementGraph("shared");
const state = startSelected(program, graph, ["c.result"], [
select("b.C", "b.C.alternate"),
select("b.D", "b.D.alternate"),
@@ -587,7 +582,7 @@ test("one Run-Graph instance satisfies two Logical Outputs through one shared Pr
test("two explicit Run-Graph instances may separately satisfy the two outputs", () => {
const program = createProgram();
- const graph = createProductReplacementGraph(program, "distinct");
+ const graph = createProductReplacementGraph("distinct");
const state = startSelected(program, graph, ["c.result"], [
select("b.C", "b.C.alternate"),
select("b.D", "b.D.alternate"),
@@ -601,7 +596,7 @@ test("two explicit Run-Graph instances may separately satisfy the two outputs",
test("partial satisfaction keeps only the demanded projection of the default Product", () => {
const program = createProgram();
- const graph = createProductReplacementGraph(program, "shared");
+ const graph = createProductReplacementGraph("shared");
const state = startSelected(program, graph, ["c.result"], [
select("b.C", "b.C.alternate"),
]);
@@ -613,7 +608,7 @@ test("partial satisfaction keeps only the demanded projection of the default Pro
test("an unbound sibling output cannot keep an unreachable default Product alive", () => {
const program = createProgram();
- const graph = createProductReplacementGraph(program, "shared");
+ const graph = createProductReplacementGraph("shared");
const state = startSelected(program, graph, ["b.C"], [
select("b.C", "b.C.alternate"),
]);
diff --git a/packages/core/test/greeting-fixture.ts b/packages/core/test/greeting-fixture.ts
index 3346c2d9..4a3a5234 100644
--- a/packages/core/test/greeting-fixture.ts
+++ b/packages/core/test/greeting-fixture.ts
@@ -10,7 +10,6 @@ import type {
BuildState,
CapabilityRef,
CompiledGraph,
- LinkedProgram,
ModuleManifest,
ProducerRef,
TypeRef,
@@ -83,7 +82,7 @@ export const manifest: ModuleManifest = {
],
};
-export function greetingGraph(program: LinkedProgram, includeSide = false): CompiledGraph {
+export function greetingGraph(includeSide = false): CompiledGraph {
return sealCompiledGraph({
outputs: [
{
@@ -172,7 +171,7 @@ export function createGreetingBuild(options?: {
value: { kind: "inline", value: { name: "Ada" } },
});
const program = link(closure, [authored]);
- const sourceGraph = greetingGraph(program, options?.includeSideTarget ?? false);
+ const sourceGraph = greetingGraph(options?.includeSideTarget ?? false);
const graph = options?.generationRealization === "placeholder"
? sealCompiledGraph({
outputs: sourceGraph.outputs.map((item) => item.id === "generated"
diff --git a/packages/driver-node/README.md b/packages/driver-node/README.md
index 5670720b..f8022469 100644
--- a/packages/driver-node/README.md
+++ b/packages/driver-node/README.md
@@ -1,67 +1,18 @@
# `@narratage/driver-node`
-Node runtime for executing Core commands without adding workflow semantics to Core.
+Node execution of commands produced by the domain neutral Core.
-Pure static Manifest JSON parsing belongs to `@narratage/protocol`; package loading and Closure
-construction remain outside the execution Driver.
+`ProducerRegistry` installs deterministic component handlers. `EndpointRegistry` installs exact
+capability implementations. `NodeDriver.prepare()` regenerates the current commands from Core and
+classifies each as runnable or blocked; it does not search the graph or choose a candidate.
-- `ProducerRegistry` implements the host-neutral `@narratage/component-kit` Producer registrar. Deterministic
- component packages depend on that tiny structural port, not on this Node Driver.
-- `EndpointRegistry` binds an already explicit external capability to implementations that may use
- APIs, credentials, queues, local runtimes, devices or human services.
-- Registrations may declare generic scheduling resources. Provider registrations claim one shared
- Provider pool plus one exact capability lane. The environment-neutral `@narratage/runtime`
- Scheduler acquires all claims atomically across Builds; a Runtime Profile may override limits.
-- A Producer receives only its command identity and immutable typed inputs. It has no ArtifactStore,
- credentials, network, queue or store handle; external work must be emitted as a typed `Need`.
-- Endpoints match an exact `CapabilityRef` and return `TypeRef`. Multiple exact endpoints require
- `bind()`. The Registry never routes by return type alone.
-- Production-style assembly uses `applyRuntimeClosure()`: Endpoint instance, exact capability and
- return Type, declared credential slots and Profile-owned scheduling must all match.
- A low-level trusted embedding may still register one immediate Endpoint directly; recoverable
- execution uses the Runtime selection supplied by the host.
-- Long-lived external work uses `registerRecoverableEndpoint()`, not an immediate Handler. The Driver
- creates a content-addressed Operation before `start()`, persists pending checkpoints, calls
- `resume()` for an existing Operation, and replays a persisted completion without another external
- call. A recoverable Endpoint is blocked unless both its Runtime selection and an
- `OperationStore` are present.
-- Endpoint credentials are resolved only for the slots declared by that endpoint, immediately
- before `start/resume/cancel`; secret bytes never become OperationStore or Core state.
-- A pending Endpoint may publish `wakeAt`. Retryable terminal failure creates a new attempt and
- Operation id under the endpoint's finite retry policy. Build cancellation stops local polling and
- makes one best-effort call to the Endpoint's optional `cancel()` method.
-- Preview, fallback and reuse are graph-level Candidates selected before Core planning, not Endpoint
- modes. A reused value is an Existing-Value Candidate; “Pin” is only a possible host UI word for
- authoring that explicit selection.
-- Endpoint identity becomes the Receipt fulfiller; handlers return only value and operational
- metadata and cannot choose that identity themselves.
-- `TypeValidatorRegistry` is a separate exact-Type registry. Before a Command result exists, the Driver
- executes the selected Type owner's validator. Producer and Endpoint handlers cannot self-assert
- validation.
+Producer handlers receive immutable typed inputs. External work is represented by a declared Need
+and fulfilled by an exact endpoint. When several endpoints offer the same capability, the Runtime
+configuration must bind one explicitly.
-Missing Endpoints, generation latency and transient endpoint errors pause a Build without replaying
-completed Producers. Durable recovery reads the immutable Build Definition and accepted Core Facts.
+Immediate endpoints run once. Asynchronous endpoints start a task, store its handle in an
+`OperationStore`, and poll it until completion. Credentials are resolved only for slots declared by
+the selected endpoint. Cancellation is best effort and never rolls back completed work.
-`start()` and `resume()` receive the same stable Operation id. `resume(undefined)` is intentional:
-it covers a stop after submission intent was persisted but before a remote job checkpoint was saved.
-The Endpoint must use that key to find-or-submit idempotently; the Driver cannot manufacture remote
-exactly-once semantics for an API that does not provide them.
-
-`prepare()` regenerates and classifies the exact current Core commands. `executeCommand()` accepts
-only one regenerated command id, so a Scheduler cannot smuggle modified serialized command content
-into a paid Handler. `NodeDriver.run()` remains the simple serial convenience path; multi-Build and
-within-Build parallelism belong to `LocalBuildScheduler`, not to an Endpoint-specific queue.
-Callers using a recoverable Endpoint through the serial path must pass a stable Build identity as
-`run(state, { build })`; the Driver deliberately does not derive one from BuildRequest content,
-because two identical requests may still be distinct Builds. The Scheduler always supplies its
-declared Build id.
-
-Outstanding Commands are not persisted. Core regenerates them from Definition plus Facts before
-any Handler can run. The Registry never
-turns a generic speaker request into a model choice: Seedance, WhisperX or another external method
-must already be present as a specific Need in the locked BuildPlan.
-The BuildPlan itself is derived and sealed by Core from the locked CompiledGraph and BuildRequest.
-
-The Driver still does not load implementation code from a package locator. A future sandboxed executor
-must be designed and audited before third-party implementations can run. Frontend and Import Prologue
-behavior remain outside this package.
+The Driver validates returned values before offering a command result to Core. It does not load
+packages, parse source files, own the build queue or know any video vocabulary.
diff --git a/packages/driver-node/src/types.ts b/packages/driver-node/src/types.ts
index 86703816..bb5e92e3 100644
--- a/packages/driver-node/src/types.ts
+++ b/packages/driver-node/src/types.ts
@@ -1,7 +1,6 @@
import type {
BuildState,
CoreCommand,
- ProducerRef,
TypeRef,
CapabilityRef,
} from "@narratage/protocol";
diff --git a/packages/driver-node/test/driver.test.ts b/packages/driver-node/test/driver.test.ts
index c47ce993..e299aa6b 100644
--- a/packages/driver-node/test/driver.test.ts
+++ b/packages/driver-node/test/driver.test.ts
@@ -1,6 +1,5 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { reduce } from "@narratage/core";
import {
@@ -77,7 +76,7 @@ function configuredRegistry(): {
return { producers, endpoints, calls };
}
-test("Driver pauses at an unbound Need, then resumes without rerunning producers", async () => {
+test("Driver can continue a returned state after its missing Endpoint is installed", async () => {
const { producers, endpoints, calls } = configuredRegistry();
const driver = new NodeDriver({ producers, endpoints });
const paused = await driver.run(createGreetingBuild());
@@ -231,7 +230,7 @@ test("Core still owns scheduling when Driver has every implementation", async ()
assert.equal(result.status, "complete");
});
-test("a transient Handler failure pauses and can poll without replaying completed producers", async () => {
+test("a direct Driver caller can retry one failed Handler without replaying completed producers", async () => {
const { producers, endpoints, calls } = configuredRegistry();
let attempts = 0;
endpoints.registerImmediateEndpoint("example:unstable", capabilities.generation, types.generated, () => {
diff --git a/packages/driver-node/test/scheduler.test.ts b/packages/driver-node/test/scheduler.test.ts
index bcc01e5e..66cf58f0 100644
--- a/packages/driver-node/test/scheduler.test.ts
+++ b/packages/driver-node/test/scheduler.test.ts
@@ -239,10 +239,10 @@ test("independent paid commands inside one Build may fill the same resource with
record.type.name === types.generated.name).length, 2);
});
-test("a asynchronous Endpoint starts once and is polled until complete", async () => {
+test("an asynchronous Endpoint starts once and is polled until complete", async () => {
const operations = new MemoryOperationStore();
let starts = 0;
- let resumes = 0;
+ let polls = 0;
let operationId: string | undefined;
const endpoint: AsyncEndpoint = {
start({ operation }) {
@@ -251,7 +251,7 @@ test("a asynchronous Endpoint starts once and is polled until complete", async (
return { status: "pending", handle: { remoteJob: "job-1" } };
},
poll({ operation, handle }) {
- resumes += 1;
+ polls += 1;
assert.equal(operation, operationId);
assert.deepEqual(handle, { remoteJob: "job-1" });
return {
@@ -268,7 +268,7 @@ test("a asynchronous Endpoint starts once and is polled until complete", async (
.run([{ id: "video", state: createGreetingBuild() }]);
assert.equal(first?.status, "paused");
assert.equal(starts, 1);
- assert.equal(resumes, 0);
+ assert.equal(polls, 0);
assert.equal(first?.state.records.some((record) => record.id === "generated:root"), false);
const pending = first?.outcomes.find((entry) => entry.status === "pending");
assert.ok(pending?.operation);
@@ -280,13 +280,13 @@ test("a asynchronous Endpoint starts once and is polled until complete", async (
assert.equal(second?.status, "complete");
assert.equal(starts, 1);
- assert.equal(resumes, 1);
+ assert.equal(polls, 1);
assert.equal((await operations.read(pending.operation))?.status, "completed");
});
test("wakeAt prevents early polling and Runtime cancellation becomes a terminal Core failure", async () => {
const operations = new MemoryOperationStore();
- let resumes = 0;
+ let polls = 0;
let cancels = 0;
const wakeAt = Date.now() + 60_000;
const endpoint: AsyncEndpoint = {
@@ -294,7 +294,7 @@ test("wakeAt prevents early polling and Runtime cancellation becomes a terminal
return { status: "pending", handle: { remoteJob: "job-wait" }, wakeAt };
},
poll() {
- resumes += 1;
+ polls += 1;
throw new Error("wakeAt must stop early polling");
},
cancel({ handle }) {
@@ -311,7 +311,7 @@ test("wakeAt prevents early polling and Runtime cancellation becomes a terminal
const [early] = await scheduler.run([{ id: "cancel-video", state: first!.state }]);
assert.equal(early?.outcomes.at(-1)?.wakeAt, wakeAt);
- assert.equal(resumes, 0);
+ assert.equal(polls, 0);
const operation = await operations.read(operationId);
assert.ok(operation);
diff --git a/packages/driver-node/test/validation.test.ts b/packages/driver-node/test/validation.test.ts
index bed4d49a..ff756b5b 100644
--- a/packages/driver-node/test/validation.test.ts
+++ b/packages/driver-node/test/validation.test.ts
@@ -122,7 +122,7 @@ function program(): LinkedProgram {
return link(closure, []);
}
-function outputGraph(linked: LinkedProgram): CompiledGraph {
+function outputGraph(): CompiledGraph {
return sealCompiledGraph({
outputs: [
{
@@ -165,7 +165,7 @@ function outputGraph(linked: LinkedProgram): CompiledGraph {
});
}
-function outputBuild(linked: LinkedProgram, graph = outputGraph(linked)) {
+function outputBuild(linked: LinkedProgram, graph = outputGraph()) {
return start(linked, graph, sealBuildRequest({
targets: [{ output: "report" }],
}));
@@ -215,7 +215,7 @@ test("a structurally valid but semantically invalid Producer value never enters
assert.equal(result.state.records.some((record) => record.id === "measurement:root"), false);
});
-function providerGraph(linked: LinkedProgram): CompiledGraph {
+function providerGraph(): CompiledGraph {
return sealCompiledGraph({
outputs: [{
id: "measurement",
@@ -243,7 +243,7 @@ function providerGraph(linked: LinkedProgram): CompiledGraph {
async function providerBuild(measured: number) {
const linked = program();
- const graph = providerGraph(linked);
+ const graph = providerGraph();
const hosts = new ProducerRegistry();
hosts.registerProducer(requestProducer, () => ({
outputs: {},
diff --git a/packages/elaborator/test/author.test.ts b/packages/elaborator/test/author.test.ts
index 6bfaf3a9..08634e98 100644
--- a/packages/elaborator/test/author.test.ts
+++ b/packages/elaborator/test/author.test.ts
@@ -1,6 +1,5 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import {
createResolvedClosure,
diff --git a/packages/elaborator/test/fragment.test.ts b/packages/elaborator/test/fragment.test.ts
index 1a46ea03..99d92f4e 100644
--- a/packages/elaborator/test/fragment.test.ts
+++ b/packages/elaborator/test/fragment.test.ts
@@ -4,7 +4,6 @@ import { compositionTypes } from "@narratage/composition";
import { spatialTypes } from "@narratage/spatial";
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import {
createResolvedClosure,
@@ -19,7 +18,6 @@ import {
elaborateGraphFragment,
mergeFragmentContributions,
sealGraphFragment,
- verifyGraphFragment,
} from "@narratage/elaborator";
import type {
FragmentContribution,
@@ -148,7 +146,7 @@ function instance(programValue: LinkedProgram, id: string) {
});
}
-function graph(programValue: LinkedProgram, ...contributions: readonly FragmentContribution[]): CompiledGraph {
+function graph(...contributions: readonly FragmentContribution[]): CompiledGraph {
const merged = mergeFragmentContributions(
{ outputs: [], candidates: [], operations: [] },
...contributions,
@@ -164,7 +162,7 @@ test("one FragmentInstance shares its generation Operation across all exports",
audio: "opening.audio",
visual: "opening.visual",
});
- const compiled = graph(linked, contribution);
+ const compiled = graph(contribution);
const request = sealBuildRequest({
targets: [
{ output: "opening.audio" },
@@ -201,7 +199,6 @@ test("the same Fragment instance is deterministic while distinct instances never
);
const compiled = graph(
- linked,
bindAuthorFragment(opening, {
take: "opening.take",
audio: "opening.audio",
diff --git a/packages/endpoint-kit/README.md b/packages/endpoint-kit/README.md
index b6a73944..a856e7f9 100644
--- a/packages/endpoint-kit/README.md
+++ b/packages/endpoint-kit/README.md
@@ -1,16 +1,14 @@
# `@narratage/endpoint-kit`
-Host-neutral SDK for exact external capability endpoints.
+SDK for packages that fulfill exact external capabilities.
-An Endpoint is any installed implementation that fulfills one declared `Need`: a vendor API, local
-process, Lambda function, human service or device. `defineEndpointPackage()` produces its static
-Runtime Manifest, configured instance, exact offers and installation facet from one source of
-truth. It depends on no Driver, Node filesystem, queue or domain package.
+An endpoint can call a vendor API, local process, Lambda function, device or human service. An
+endpoint package declares the capabilities it fulfills, its result types, credentials and scheduling
+limits, then installs handlers into a Host registrar.
-Concrete distributions may still be named after a real provider, such as `@narratage/provider-kie`.
-Local WhisperX and HyperFrames use the same Endpoint contract without pretending to be vendors.
-Endpoint packages are trusted Host configuration and are never activated by author imports.
+Immediate endpoints return a result directly. Asynchronous endpoints implement `start`, `poll` and
+optional best effort `cancel`. Provider pool and capability lane limits control concurrency without
+changing Core demand.
-The Runtime Scheduler owns readiness and concurrency. A recoverable Endpoint owns only one external
-operation's `start/resume/cancel` law. Process, Lambda and HTTP are lower-level Transports and do not
-register capabilities by themselves.
+Endpoint packages are selected by a Runtime Profile, never activated by author imports. This package
+depends on no Node filesystem, queue implementation or video domain.
diff --git a/packages/endpoint-kit/test/endpoint.test.ts b/packages/endpoint-kit/test/endpoint.test.ts
index 8524e97d..92ce7132 100644
--- a/packages/endpoint-kit/test/endpoint.test.ts
+++ b/packages/endpoint-kit/test/endpoint.test.ts
@@ -1,6 +1,5 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import {
defineEndpointPackage,
@@ -17,10 +16,6 @@ import { credentialRef } from "@narratage/runtime";
import { capabilities, types } from "../../core/test/greeting-fixture.js";
-const implementation = {
- digest: fixtureDigest("example.provider/http-json@1"),
-} as const;
-
type CapturedRegistration = {
readonly id: string;
readonly capability: CapabilityRef;
diff --git a/packages/film/README.md b/packages/film/README.md
index 647b2f4f..fdd24d07 100644
--- a/packages/film/README.md
+++ b/packages/film/README.md
@@ -10,8 +10,8 @@ of VisualTrack and AudioTrack inputs while every Core Operation retains a fixed
port list and one atomic result.
`FilmTrackSet` is an immutable lowering value, not an author-facing workflow collection. Each append
-receives the previous set and newly added Track through explicit graph edges; their enclosing Core
-Records and Derivation bind integrity. The domain value copies no lineage digests. Final Composition
+receives the previous set and newly added Track through explicit graph edges. The domain value copies
+no lineage metadata. Final Composition
remains order-independent because the public contract canonicalizes Tracks and visual ordering
belongs to each Present's absolute stacking key.
diff --git a/packages/image-transform/README.md b/packages/image-transform/README.md
index c6f09c0b..d45cf272 100644
--- a/packages/image-transform/README.md
+++ b/packages/image-transform/README.md
@@ -7,8 +7,8 @@ BlobArtifact(image) + ImageTransformProgram -> Need -> BlobArtifact(image)
```
The result is the transformed image itself. It contains no source digest, Provider name,
-post-processing report or copied upstream metadata. Core's Derivation records the input edges and
-the Need/Receipt records the selected execution endpoint.
+post-processing report or copied upstream metadata. The graph already contains the source and
+program edges; the Runtime selects the endpoint that fulfills the explicit Need.
`gptImageDenoiseV1` applies the GPT Image cleanup profile: YCrCb NLM with luma 2,
chroma 10, 7/21 windows and 1.02 saturation recovery, followed by PNG encoding. It is now an
diff --git a/packages/markup/src/frontend.ts b/packages/markup/src/frontend.ts
index 699a7859..2d29239b 100644
--- a/packages/markup/src/frontend.ts
+++ b/packages/markup/src/frontend.ts
@@ -4,7 +4,6 @@ import {
sealRecord,
} from "@narratage/core";
import type {
- CanonicalValue,
ModuleRef,
ResolvedModule,
TypedRecord,
@@ -14,7 +13,6 @@ import type {
AuthorSourceExport,
AuthorValueRef,
GraphFragment,
- ResolvedAuthorSourceImport,
} from "@narratage/elaborator";
import { MarkupFrontendError } from "./error.js";
@@ -31,7 +29,6 @@ import type {
StructuredSurfaceHandler,
SurfaceComponentDraft,
SurfaceDecodeOutput,
- SurfaceRecordDraft,
SurfaceResolvedReference,
RegisteredSurface,
MarkupDecodeContext,
diff --git a/packages/markup/src/host-facet.ts b/packages/markup/src/host-facet.ts
index 24dd69d7..c3359f26 100644
--- a/packages/markup/src/host-facet.ts
+++ b/packages/markup/src/host-facet.ts
@@ -6,7 +6,6 @@ import type {
RegisteredSurface,
StructuredSurfaceHandler,
MarkupSurfaceRegistryLike,
- MarkupSurfaceDeclaration,
RawSurfaceDeclaration,
StructuredSurfaceDeclaration,
} from "./types.js";
diff --git a/packages/markup/src/syntax.ts b/packages/markup/src/syntax.ts
index 8df69911..d1cba398 100644
--- a/packages/markup/src/syntax.ts
+++ b/packages/markup/src/syntax.ts
@@ -1,5 +1,3 @@
-import type { SourceRange } from "@narratage/protocol";
-
import { MarkupFrontendError } from "./error.js";
import type {
MarkupSource,
diff --git a/packages/markup/src/types.ts b/packages/markup/src/types.ts
index 30a4588d..a8180b43 100644
--- a/packages/markup/src/types.ts
+++ b/packages/markup/src/types.ts
@@ -1,5 +1,4 @@
import type {
- CanonicalValue,
ModuleRef,
ResolvedModuleClosure,
SourceRange,
diff --git a/packages/markup/test/author-integration.test.ts b/packages/markup/test/author-integration.test.ts
index d279b923..05e10c46 100644
--- a/packages/markup/test/author-integration.test.ts
+++ b/packages/markup/test/author-integration.test.ts
@@ -1,6 +1,5 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import {
createResolvedClosure,
@@ -35,9 +34,6 @@ const measurementType = { module: laboratory, name: "Measurement" } satisfies Ty
const reportType = { module: laboratory, name: "Report" } satisfies TypeRef;
const measureProducer = { module: laboratory, name: "measure" } satisfies ProducerRef;
const reportProducer = { module: laboratory, name: "write-report" } satisfies ProducerRef;
-const sampleSurfaceDigest = fixtureDigest("example.text-laboratory/sample-surface@1");
-const measureSurfaceDigest = fixtureDigest("example.text-laboratory/measure-surface@1");
-const reportSurfaceDigest = fixtureDigest("example.text-laboratory/report-surface@1");
const laboratorySurfaces = [
{ name: "sample", tag: "Sample", mode: "structured", outputs: [sampleType] },
{ name: "measure", tag: "Measure", mode: "structured", outputs: [] },
diff --git a/packages/package-loader-node/README.md b/packages/package-loader-node/README.md
index 08b71d84..7ae62eaa 100644
--- a/packages/package-loader-node/README.md
+++ b/packages/package-loader-node/README.md
@@ -1,22 +1,11 @@
# `@narratage/package-loader-node`
-Installed-package selection for Node Hosts. npm or pnpm owns installation, versions and byte
-integrity. This loader imports only packages selected by Source discovery or a Runtime Profile,
-then validates the contribution boundary Narratage consumes.
+Loads installed Narratage packages selected by source discovery or a Runtime Profile.
-Exact Module Manifest dependencies (`ModuleRef + digest`) load from the selected package's installed
-dependencies. The loader neither scans unrelated dependencies for plugins nor maintains a package registry.
+The user's package manager owns installation, versions and package bytes. This loader resolves only
+the requested packages, imports their declared `narratage.activation` entry and validates the
+contribution boundary consumed by Narratage. It never scans the dependency tree for plugins and is
+not a package manager or registry.
-This package does not select an author syntax. Syntax-specific executable facets remain inert until
-an exact Host ABI installs them. `@narratage/compiler-markup-node` selects the official Markup Surface ABI;
-`@narratage/runtime-local` can load the same package's deterministic compute facets without depending on Markup.
-Run Fragment libraries use the ordinary `narratage.run-fragment-host@1` Host facet; the Loader has no
-Run-specific fragment field or interpretation branch. Author and Run Frontends likewise use the
-ordinary `narratage.source-frontend@1` Host facet; the Loader has no Frontend fields or parser registry.
-
-This package is deliberately not an npm client. Source `<import>` can select only an already installed
-author contribution. Provider and privileged Runtime packages are independently selected by a Runtime
-Profile.
-
-If `@example/cards` requires a Module exported by an installed dependency, that dependency does not
-need another Source import. Missing or digest-mismatched Module providers fail before compilation.
+Module dependencies declared by selected packages are loaded from ordinary installed dependencies.
+Syntax, components and Runtime facets remain inert until a matching Host ABI consumes them.
diff --git a/packages/protocol/README.md b/packages/protocol/README.md
index b18626e3..e70f917d 100644
--- a/packages/protocol/README.md
+++ b/packages/protocol/README.md
@@ -1,16 +1,11 @@
# `@narratage/protocol`
-Execution-free wire contracts shared by Core, Drivers and future modules. The package defines
-canonical values, module/type references, records and origins, explicit plans, Needs, Receipts,
-Derivations, events and commands. It also parses the static
-JSON representation of a Module Manifest without reading files or executing package code. It
-contains no author-source parser, Surface, runtime or video vocabulary. Source syntax belongs to the
-Frontend Host that executes it, not to the semantic Module protocol.
+Data contracts shared across package boundaries.
-Types and Producers are named by their owning `TypeRef` and `ProducerRef`. Manifests declare that
-shared vocabulary; executable validators and handlers stay in the package that owns it. Protocol
-does not assign hashes or second identities to JavaScript functions.
+This package defines module manifests, nominal references, typed values, author and run graphs,
+build plans, Core commands, command results, build facts and build state. It also parses a module
+manifest from JSON without loading executable package code.
-A Need Receipt records the exact request, selected Endpoint name and returned Record. It carries no
-Runtime snapshot, package inventory, domain lineage or renderer-specific metadata. Graph edges and
-Derivations retain facts at their actual source.
+Protocol contains no source parser, package loader, runtime, filesystem access or video vocabulary.
+Packages own their types, producers and capabilities by module name and version. Core and Hosts
+communicate through those names and the values declared here.
diff --git a/packages/protocol/src/manifest.ts b/packages/protocol/src/manifest.ts
index ed7ce652..cfd786d1 100644
--- a/packages/protocol/src/manifest.ts
+++ b/packages/protocol/src/manifest.ts
@@ -9,7 +9,6 @@ import type {
TypeDeclaration,
} from "./module.js";
import type { CapabilityRef, ModuleRef, TypeRef } from "./identity.js";
-import type { ObjectFieldSchema, ValueSchema } from "./value.js";
function object(value: unknown, path: string): Record<string, unknown> {
if (value === null || Array.isArray(value) || typeof value !== "object") {
@@ -28,21 +27,6 @@ function string(value: unknown, path: string): string {
return value;
}
-function possiblyEmptyString(value: unknown, path: string): string {
- if (typeof value !== "string") throw new Error(`${path} must be a string`);
- return value;
-}
-
-function boolean(value: unknown, path: string): boolean {
- if (typeof value !== "boolean") throw new Error(`${path} must be a boolean`);
- return value;
-}
-
-function number(value: unknown, path: string): number {
- if (typeof value !== "number" || !Number.isFinite(value)) throw new Error(`${path} must be a number`);
- return value;
-}
-
function moduleRef(value: unknown, path: string): ModuleRef {
const parsed = object(value, path);
return {
@@ -67,95 +51,6 @@ function capabilityRef(value: unknown, path: string): CapabilityRef {
};
}
-function optionalNumber(
- parsed: Record<string, unknown>,
- name: string,
- path: string,
-): { readonly [key: string]: number } {
- return parsed[name] === undefined ? {} : { [name]: number(parsed[name], `${path}.${name}`) };
-}
-
-function valueSchema(value: unknown, path: string): ValueSchema {
- const parsed = object(value, path);
- const kind = string(parsed.kind, `${path}.kind`);
- switch (kind) {
- case "null":
- case "boolean":
- return { kind };
- case "number":
- return {
- kind,
- ...(parsed.integer === undefined ? {} : { integer: boolean(parsed.integer, `${path}.integer`) }),
- ...optionalNumber(parsed, "minimum", path),
- ...optionalNumber(parsed, "maximum", path),
- } as ValueSchema;
- case "string":
- return {
- kind,
- ...(parsed.enum === undefined
- ? {}
- : { enum: array(parsed.enum, `${path}.enum`).map((item, index) => string(item, `${path}.enum[${index}]`)) }),
- ...optionalNumber(parsed, "minLength", path),
- ...optionalNumber(parsed, "maxLength", path),
- } as ValueSchema;
- case "literal":
- return { kind, value: canonicalize(parsed.value) };
- case "array":
- return {
- kind,
- items: valueSchema(parsed.items, `${path}.items`),
- ...optionalNumber(parsed, "minItems", path),
- ...optionalNumber(parsed, "maxItems", path),
- } as ValueSchema;
- case "object": {
- const rawFields = object(parsed.fields, `${path}.fields`);
- const fields: Record<string, ObjectFieldSchema> = {};
- for (const [name, rawField] of Object.entries(rawFields)) {
- const field = object(rawField, `${path}.fields.${name}`);
- Object.defineProperty(fields, name, {
- value: {
- schema: valueSchema(field.schema, `${path}.fields.${name}.schema`),
- ...(field.optional === undefined
- ? {}
- : { optional: boolean(field.optional, `${path}.fields.${name}.optional`) }),
- },
- enumerable: true,
- configurable: true,
- writable: true,
- });
- }
- return {
- kind,
- fields,
- ...(parsed.allowUnknown === undefined
- ? {}
- : { allowUnknown: boolean(parsed.allowUnknown, `${path}.allowUnknown`) }),
- };
- }
- case "oneOf":
- return {
- kind,
- variants: array(parsed.variants, `${path}.variants`).map((item, index) =>
- valueSchema(item, `${path}.variants[${index}]`),
- ),
- };
- case "blob":
- return {
- kind,
- ...(parsed.mediaTypes === undefined
- ? {}
- : {
- mediaTypes: array(parsed.mediaTypes, `${path}.mediaTypes`).map((item, index) =>
- string(item, `${path}.mediaTypes[${index}]`),
- ),
- }),
- ...optionalNumber(parsed, "maxBytes", path),
- } as ValueSchema;
- default:
- throw new Error(`${path}.kind ${kind} is unsupported`);
- }
-}
-
function dependency(value: unknown, path: string): ModuleDependency {
const parsed = object(value, path);
return {
diff --git a/packages/provider-google-vertex/README.md b/packages/provider-google-vertex/README.md
index e2d36aa1..99b6d1e5 100644
--- a/packages/provider-google-vertex/README.md
+++ b/packages/provider-google-vertex/README.md
@@ -19,7 +19,7 @@ The Runtime Profile must provide an ordinary `{ store, key }` credential referen
value is the JSON contents rather than a path, keeping filesystem authority out of the Provider.
The low-level TypeScript factory retains an environment-reference convenience for embeddings;
declarative Runtime activation has no implicit credential source. Credentials never enter author source, BuildState,
-Operation state, Prompt or Receipt metadata.
+Operation state or Prompt values.
A host may expose an ADC file through a file-backed CredentialStore, but the Provider itself does
not read arbitrary paths or ambient environment variables.
diff --git a/packages/provider-google-vertex/test/provider.test.ts b/packages/provider-google-vertex/test/provider.test.ts
index 92b25648..501d98ad 100644
--- a/packages/provider-google-vertex/test/provider.test.ts
+++ b/packages/provider-google-vertex/test/provider.test.ts
@@ -1,6 +1,5 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import {
captionGeminiCapabilities,
diff --git a/packages/provider-hyperframes-aws-lambda/README.md b/packages/provider-hyperframes-aws-lambda/README.md
index ede41aa2..26992aaf 100644
--- a/packages/provider-hyperframes-aws-lambda/README.md
+++ b/packages/provider-hyperframes-aws-lambda/README.md
@@ -1,6 +1,6 @@
# `@narratage/provider-hyperframes-aws-lambda`
-Recoverable AWS Step Functions/Lambda implementation of the exact
+Asynchronous AWS Step Functions/Lambda implementation of the exact
`@narratage/render-hyperframes#render-visual` capability.
The Endpoint stages the immutable `HyperframesDocument` with the shared
@@ -19,9 +19,8 @@ configuration.
On success the Endpoint requires HyperFrames' plan and completed-frame counts to equal the source
document, then streams the returned S3 object into the selected content-addressed ArtifactStore.
-The Runtime Profile selects the state machine and deployment settings. The generic Need Receipt
-records the selected Endpoint, request and returned value; the Provider does not repeat those facts
-as vendor metadata. Container and stream conformance stays in the explicit media
+The Runtime Profile selects the state machine and deployment settings. The Provider does not repeat
+the request or selected endpoint as vendor metadata. Container and stream conformance stays in the explicit media
inspection/mux capabilities, so the orchestrating machine does not acquire a hidden FFmpeg
dependency.
diff --git a/packages/provider-hyperframes-aws-lambda/test/provider.test.ts b/packages/provider-hyperframes-aws-lambda/test/provider.test.ts
index 4f9bc456..b9caa1cb 100644
--- a/packages/provider-hyperframes-aws-lambda/test/provider.test.ts
+++ b/packages/provider-hyperframes-aws-lambda/test/provider.test.ts
@@ -257,7 +257,7 @@ test("the Runtime adapter refuses a hardware-GPU deployment wish instead of igno
}), /does not accept browserGpu/u);
});
-test("one deterministic submission resumes and streams the exact output into the ArtifactStore", async () => {
+test("one submission is polled and streams the output into the ArtifactStore", async () => {
const request = requestNeed();
const { client, state } = fakeClient();
const { endpoint, registration } = await endpointFor(request, client);
diff --git a/packages/provider-hyperframes-local/README.md b/packages/provider-hyperframes-local/README.md
index f529a58a..73cf9cac 100644
--- a/packages/provider-hyperframes-local/README.md
+++ b/packages/provider-hyperframes-local/README.md
@@ -5,8 +5,7 @@ content-addressed dependencies declared by a `HyperframesDocument`, renders a si
HyperFrames CLI, probes the bytes, and returns a verified `RenderedVisual`. Before staging a typed
Surface it decodes the exact bytes and checks declared dimensions, still/frame timing, SDR/sRGB and
opaque/straight-alpha facts. Artifact size and SHA-256 are checked for every dependency. These are
-admission gates, not hidden output metadata. The ordinary Need Receipt records the selected Endpoint,
-request and returned value.
+admission gates, not hidden output metadata.
There are deliberately two concurrency controls:
diff --git a/packages/provider-hyperframes-local/test/provider.test.ts b/packages/provider-hyperframes-local/test/provider.test.ts
index e9d712bf..6cc80002 100644
--- a/packages/provider-hyperframes-local/test/provider.test.ts
+++ b/packages/provider-hyperframes-local/test/provider.test.ts
@@ -12,7 +12,6 @@ import { compileHyperframesDocument } from "@narratage/hyperframes";
import { renderHyperframesCapabilities, hyperframesVisualRequest } from "@narratage/render-hyperframes";
import { canonicalize } from "@narratage/protocol";
import type { CanonicalValue, Need } from "@narratage/protocol";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { createLocalHyperframesProvider } from "../src/index.js";
import { localHyperframesBrowserProgram } from "../src/program.js";
diff --git a/packages/provider-image-opencv-local/README.md b/packages/provider-image-opencv-local/README.md
index 4d46aa7c..723e266b 100644
--- a/packages/provider-image-opencv-local/README.md
+++ b/packages/provider-image-opencv-local/README.md
@@ -5,8 +5,8 @@ Local OpenCV/NumPy realization of the single `@narratage/raster` capability.
Image Transform and Image Compose lower their different author meanings to one closed RasterRequest.
One Handler stages its content-addressed inputs, and one Python interpreter shares decoding, fit,
interpolation, alpha and encoding primitives across both variants. It runs in a bounded child process
-and stores one new image Artifact. Temporary paths, OpenCV details and diagnostics
-stay inside the Endpoint/Receipt and never enter the image Product.
+and stores one new image Artifact. Temporary paths, OpenCV details and diagnostics stay inside the
+Endpoint and never enter the image Product.
The repository ships the frozen deployment environment in `services/image-opencv`. With the Runtime
Adapter's declared configuration, `programs up` runs `uv sync --frozen`; the Endpoint and program probe
diff --git a/packages/provider-image-opencv-local/test/provider.test.ts b/packages/provider-image-opencv-local/test/provider.test.ts
index 5f66d04d..540d6ddb 100644
--- a/packages/provider-image-opencv-local/test/provider.test.ts
+++ b/packages/provider-image-opencv-local/test/provider.test.ts
@@ -1,7 +1,6 @@
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { artifactTypes } from "@narratage/artifact";
import { EndpointRegistry, MemoryArtifactStore } from "@narratage/driver-node";
diff --git a/packages/provider-kie/README.md b/packages/provider-kie/README.md
index 7701169a..b0450c99 100644
--- a/packages/provider-kie/README.md
+++ b/packages/provider-kie/README.md
@@ -1,6 +1,6 @@
# `@narratage/provider-kie`
-Recoverable KIE Market Provider for the twelve explicitly selected exact models and one generic
+Asynchronous KIE Market Provider for the twelve explicitly selected exact models and one generic
background-removal capability.
This package is deployment code. Author source imports model modules such as `@narratage/seedance` or
@@ -86,9 +86,9 @@ Manifests actually imported by the author document; installing KIE does not add
1. Reference `BlobRef`s are read from the configured ArtifactStore and uploaded through KIE's file
stream API. KIE temporary URLs never enter author source or generated Product identity.
-2. `createTask` is persisted as one recoverable Operation. Because KIE does not document an
+2. A successful `createTask` response is persisted as one asynchronous Operation. Because KIE does not document an
idempotency key, an ambiguous network/5xx submission is not automatically retried.
-3. Once a `taskId` exists, Worker recovery resumes only that same task. Poll/download errors cannot create a new
+3. Once a `taskId` exists, later Worker polling continues only that same task. Poll/download errors cannot create a new
paid generation.
4. Successful result URLs are converted to short-lived download URLs, bounded while streaming,
immediately written to the configured content-addressed ArtifactStore, and removed from durable
@@ -100,7 +100,7 @@ Manifests actually imported by the author document; installing KIE does not add
The automated suite uses an adversarial fake KIE service. The credentialed smoke command is a paid
deployment test and is intentionally not run by the public repository test suite. It must be enabled
explicitly and keeps a stable Runtime directory under the operating system temporary directory so
-an interrupted paid task can resume from its SQLite checkpoint:
+an interrupted paid task can continue polling from its SQLite checkpoint:
```sh
NARRATAGE_KIE_LIVE=1 KIE_API_KEY=... pnpm smoke:kie
diff --git a/packages/provider-kie/test/live-smoke.ts b/packages/provider-kie/test/live-smoke.ts
index a6f20f0d..37ab3c00 100644
--- a/packages/provider-kie/test/live-smoke.ts
+++ b/packages/provider-kie/test/live-smoke.ts
@@ -77,7 +77,6 @@ import {
seedreamManifest,
} from "@narratage/seedream";
import { admitRecord, TypeValidatorRegistry } from "@narratage/validation";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
type SmokeCase = {
readonly key: string;
diff --git a/packages/provider-kie/test/provider.test.ts b/packages/provider-kie/test/provider.test.ts
index 8b889bf3..2dd7378d 100644
--- a/packages/provider-kie/test/provider.test.ts
+++ b/packages/provider-kie/test/provider.test.ts
@@ -87,7 +87,7 @@ test("all KIE capabilities share one asynchronous task engine and differ only by
});
});
-test("KIE uploads content-addressed references, resumes one task, and persists generated bytes", async () => {
+test("KIE uploads referenced artifacts, polls one task, and persists generated bytes", async () => {
const artifacts = new MemoryArtifactStore();
const firstFrame = await artifacts.put(new Uint8Array([1, 2, 3]), "image/png");
const requestValue = sealSeedanceRequest("seedance-2-mini", {
diff --git a/packages/provider-media-local/test/provider.test.ts b/packages/provider-media-local/test/provider.test.ts
index 017547c0..6911ac40 100644
--- a/packages/provider-media-local/test/provider.test.ts
+++ b/packages/provider-media-local/test/provider.test.ts
@@ -23,7 +23,6 @@ import {
} from "@narratage/media-pipeline";
import { canonicalize } from "@narratage/protocol";
import type { CapabilityRef, CanonicalValue, Need, TypeRef } from "@narratage/protocol";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { createLocalMediaProvider } from "../src/index.js";
import { localMediaToolchainProgram } from "../src/program.js";
diff --git a/packages/provider-whisperx-local/test/provider.test.ts b/packages/provider-whisperx-local/test/provider.test.ts
index f9c3c159..ca706660 100644
--- a/packages/provider-whisperx-local/test/provider.test.ts
+++ b/packages/provider-whisperx-local/test/provider.test.ts
@@ -9,7 +9,6 @@ import {
whisperXCapabilities,
whisperXRequestForEvidenceAudio,
} from "@narratage/whisperx";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import {
createLocalWhisperXProvider,
diff --git a/packages/provider-xiaomi-mimo/test/provider.test.ts b/packages/provider-xiaomi-mimo/test/provider.test.ts
index 82a72ee5..b908ea6e 100644
--- a/packages/provider-xiaomi-mimo/test/provider.test.ts
+++ b/packages/provider-xiaomi-mimo/test/provider.test.ts
@@ -1,6 +1,5 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { EndpointRegistry, MemoryArtifactStore } from "@narratage/driver-node";
import { generationTypes } from "@narratage/generation";
diff --git a/packages/runtime-local/src/runtime.ts b/packages/runtime-local/src/runtime.ts
index 7062b7ae..4781c67f 100644
--- a/packages/runtime-local/src/runtime.ts
+++ b/packages/runtime-local/src/runtime.ts
@@ -22,7 +22,6 @@ import type {
LocalBuildRequest,
LocalBuildSubmission,
LocalRuntime,
- EndpointPackage,
} from "./types.js";
function assert(condition: unknown, message: string): asserts condition {
@@ -51,20 +50,6 @@ async function wait(delayMs: number, signal: AbortSignal | undefined): Promise<v
});
}
-function verifyEndpointPackages(packages: readonly EndpointPackage[]): void {
- const instances = new Set<string>();
- for (const item of packages) {
- assert(item.instance.id.trim().length > 0, "Endpoint instance id is empty");
- assert(!instances.has(item.instance.id), `Endpoint instance ${item.instance.id} is configured twice`);
- instances.add(item.instance.id);
- assert(item.offers.length > 0, `${item.instance.id} binds no exact capability`);
- for (const offer of item.offers) {
- assert(offer.endpoint === item.instance.id,
- `${item.instance.id} offer points to ${offer.endpoint}, not ${item.instance.id}`);
- }
- }
-}
-
export async function createLocalRuntime(
options: CreateLocalRuntimeOptions,
): Promise<LocalRuntime> {
@@ -91,7 +76,6 @@ export async function createLocalRuntime(
builds: options.buildStore,
operations: options.operationStore,
dispatch: options.dispatchStore,
- artifacts: options.artifactStore,
},
scheduling,
implementationPackages: [...new Set(options.implementationPackages ?? [])],
diff --git a/packages/runtime-local/src/worker.ts b/packages/runtime-local/src/worker.ts
index 3c76756e..46430bc9 100644
--- a/packages/runtime-local/src/worker.ts
+++ b/packages/runtime-local/src/worker.ts
@@ -7,14 +7,16 @@ import type {
RuntimeExecutionResult,
RuntimePreparation,
RuntimeRunnableCommand,
- RuntimeWorker,
- RuntimeExecutionStores,
RuntimeWorkerRunOptions,
} from "@narratage/runtime";
import { LocalBuildScheduler } from "@narratage/runtime";
type LocalWorkerOptions = {
- readonly stores: RuntimeExecutionStores;
+ readonly stores: {
+ readonly builds: import("@narratage/runtime").BuildStore;
+ readonly operations: import("@narratage/runtime").OperationStore;
+ readonly dispatch: import("@narratage/runtime").BuildDispatchStore;
+ };
readonly scheduling: BuildSchedulerOptions;
readonly implementationPackages: readonly string[];
};
@@ -181,7 +183,7 @@ class CapacityExecutor implements RuntimeCommandExecutor {
}
}
-class DurableLocalWorker implements RuntimeWorker {
+class DurableLocalWorker {
readonly #executor: RuntimeCommandExecutor;
readonly #options: LocalWorkerOptions;
readonly #executorWithCapacity: CapacityExecutor;
@@ -313,6 +315,6 @@ class DurableLocalWorker implements RuntimeWorker {
export function createDurableLocalWorker(
executor: RuntimeCommandExecutor,
options: LocalWorkerOptions,
-): RuntimeWorker {
+) {
return new DurableLocalWorker(executor, options);
}
diff --git a/packages/runtime-local/test/local.test.ts b/packages/runtime-local/test/local.test.ts
index 069bae78..0a191d18 100644
--- a/packages/runtime-local/test/local.test.ts
+++ b/packages/runtime-local/test/local.test.ts
@@ -9,7 +9,6 @@ import {
import { tmpdir } from "node:os";
import { join } from "node:path";
import test from "node:test";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
import { FileArtifactStore } from "@narratage/artifact-store-fs";
import { EnvironmentCredentialStore } from "@narratage/credential-store-env";
@@ -139,7 +138,7 @@ test("project local runtime queues, polls and cancels work with replaceable pack
let requestCalls = 0;
let assembleCalls = 0;
let starts = 0;
- let resumes = 0;
+ let polls = 0;
let cancels = 0;
const components: ComponentPackage = {
producers: [
@@ -188,7 +187,7 @@ test("project local runtime queues, polls and cancels work with replaceable pack
return { status: "pending" as const, handle: { remoteJob: operation }, wakeAt: Date.now() };
},
poll({ handle }) {
- resumes += 1;
+ polls += 1;
assert.ok(handle);
return {
status: "completed",
@@ -225,12 +224,12 @@ test("project local runtime queues, polls and cancels work with replaceable pack
assert.equal(first.status, "queued");
assert.equal((await firstRuntime.workOnce())?.phase, "waiting");
assert.equal(starts, 1);
- assert.equal(resumes, 0);
+ assert.equal(polls, 0);
const second = await firstRuntime.status("greeting-build");
assert.equal(second.dispatch?.phase, "waiting");
assert.equal((await firstRuntime.workOnce())?.terminal, "complete");
assert.equal(starts, 1);
- assert.equal(resumes, 1);
+ assert.equal(polls, 1);
assert.equal(promptCalls, 1, "persisted Core facts stop deterministic upstream replay");
assert.equal(requestCalls, 1, "the Need request Producer is also persisted");
assert.equal(assembleCalls, 1);
@@ -244,7 +243,7 @@ test("project local runtime queues, polls and cancels work with replaceable pack
const followed = await firstRuntime.status("greeting-follow");
assert.equal(followed.dispatch?.terminal, "complete");
assert.equal(starts, 2);
- assert.equal(resumes, 2);
+ assert.equal(polls, 2);
const followedStatus = await firstRuntime.status("greeting-follow");
assert.equal(followedStatus.build?.state.status, "complete");
assert.equal(followedStatus.operations.length, 1);
diff --git a/packages/runtime-local/test/programs.test.ts b/packages/runtime-local/test/programs.test.ts
index bd291ccf..8e68cf1b 100644
--- a/packages/runtime-local/test/programs.test.ts
+++ b/packages/runtime-local/test/programs.test.ts
@@ -88,7 +88,7 @@ test("a Build capability selection ignores unrelated Programs", async () => {
assert.equal(probes, 0);
});
-test("an empty Build capability set loads no Runtime Adapter closure", async () => {
+test("an empty Build capability set loads no Runtime Adapter packages", async () => {
const configured = await project(() => ({
id: "must-not-load",
async probe() {
@@ -103,7 +103,7 @@ test("an empty Build capability set loads no Runtime Adapter closure", async ()
assert.deepEqual(result, { dataRoot: configured.root, programs: [] });
});
-function fileBackedProgram(root: string, marker: string): ManagedProgram {
+function fileBackedProgram(marker: string): ManagedProgram {
return {
id: "example",
start: { command: "sh", args: ["-c", `printf ready > ${marker}; while true; do sleep 1; done`] },
@@ -120,7 +120,7 @@ function fileBackedProgram(root: string, marker: string): ManagedProgram {
test("up starts the program once for every Endpoint that drives it, and down stops it", async () => {
const marker = join(await mkdtemp(join(tmpdir(), "narratage-marker-")), "ready");
- const { root, path, options } = await project((projectRoot) => fileBackedProgram(projectRoot, marker));
+ const { root, path, options } = await project(() => fileBackedProgram(marker));
const progress: string[] = [];
const started = await bringManagedProgramsUp(path, {
@@ -159,7 +159,7 @@ test("up starts the program once for every Endpoint that drives it, and down sto
test("concurrent up calls atomically share one Managed Program process", async () => {
const markerRoot = await mkdtemp(join(tmpdir(), "narratage-marker-concurrent-"));
const marker = join(markerRoot, "ready");
- const { root, path, options } = await project((projectRoot) => fileBackedProgram(projectRoot, marker));
+ const { root, path, options } = await project(() => fileBackedProgram(marker));
try {
const results = await Promise.all(Array.from({ length: 6 }, async () =>
await bringManagedProgramsUp(path, { ...options, maxWaitMs: 20_000 })));
diff --git a/packages/runtime/README.md b/packages/runtime/README.md
index d756231f..7b552905 100644
--- a/packages/runtime/README.md
+++ b/packages/runtime/README.md
@@ -1,44 +1,20 @@
# `@narratage/runtime`
-Environment-neutral execution and persistence ports around the domain-free Core state machine.
+Environment neutral execution and storage contracts around Core.
-The first implementation contains:
+The package defines the small ports used by a runtime:
-- `RuntimeCommandExecutor`: regenerate Core-authorized commands and execute one by identity;
-- `LocalBuildScheduler`: one authoritative, queue-free scheduler shared by multiple Builds;
-- in-process command limits plus durable Provider pool and capability-lane limits for remote work;
-- static Runtime Module facets and explicit Profile resolution;
-- exact Endpoint capability/return offers;
-- `BuildStore` for Definitions and appended Core Facts, plus a separate `OperationStore`;
-- a recoverable Endpoint lifecycle that creates an Operation before `start`, checkpoints `pending`,
- calls `resume` after a restart, and records wake, retry and terminal state;
-- a narrow `CredentialStore`/`CredentialRef` port that keeps secrets out of framework facts.
-- one host-neutral `RuntimeInfrastructurePackage` ABI that binds configured Scheduler, BuildStore,
- OperationStore, ArtifactStore and CredentialStore implementations to their selected Manifest facet;
- one configured package instance may expose several separately selected parts.
+* `BuildStore` keeps one build definition and its accepted facts.
+* `OperationStore` keeps asynchronous external work while it is being polled.
+* `BuildDispatchStore` holds the local build queue and shared capacity reservations.
+* `ArtifactStore` stores bytes addressed by their content digest.
+* `CredentialStore` resolves secrets outside source and build state.
+* `RuntimeCommandExecutor` turns the commands regenerated by Core into component or endpoint calls.
+* `LocalBuildScheduler` runs ready commands concurrently while respecting declared resource limits.
-A Runtime assembly owns the lifecycle of the configured packages passed to it and closes each once.
-Role selection grants a part one responsibility; merely being installed never grants scheduling, storage or
-credential authority. These remain trusted deployment packages, not author-importable modules.
+These contracts do not choose a filesystem, database, provider or source language. The default local
+implementation lives in `@narratage/runtime-local`; Node component and endpoint execution lives in
+`@narratage/driver-node`.
-The Scheduler does not traverse Graphs, choose Candidates, rewrite Needs or accept arbitrary
-serialized commands. Core remains the sole source of readiness and the sole Command-result admission law.
-Resources only limit how many already-authorized commands execute concurrently. Recoverable Provider
-Endpoints occupy both an explicit Provider pool and an exact capability lane while remote work is in flight.
-An Endpoint's vendor-side job system remains internal and cannot advance another Build step.
-
-`MemoryBuildStore` stores one Definition and its admitted Facts. `MemoryOperationStore` separately records a
-stable attempt identity, pending checkpoint and terminal result. The Operation id is also
-the stable key supplied to an upstream system when it supports idempotent submission.
-Changing the Build, Command, selected Endpoint or attempt changes that identity.
-Nothing in the OperationStore becomes an accepted domain fact until an Endpoint completion is
-validated by Core and appended to BuildStore. If a process stops after completion is persisted but before Core
-accepts it, the next Worker reconstructs the same result from the stored completion and does not
-call the Endpoint again.
-
-This package is an environment-neutral reference, not a durable queue. SQLite/filesystem adapters,
-environment credentials, the local follow loop, Endpoint implementations and
-`@narratage/endpoint-kit` live in separate packages. The repository already contains KIE, Vertex and
-several local media and external-program Endpoint packages. An Endpoint whose upstream API cannot look up or deduplicate the
-supplied Operation id cannot promise exactly-once remote work across the crash window; its
-`resume(undefined)` must explicitly reconcile that uncertainty.
+The scheduler never changes graph meaning. Targets and candidates are fixed before execution, and
+resource limits only control when an already selected command may run.
diff --git a/packages/runtime/src/scheduler.ts b/packages/runtime/src/scheduler.ts
index e4c69f1f..d4cf9afc 100644
--- a/packages/runtime/src/scheduler.ts
+++ b/packages/runtime/src/scheduler.ts
@@ -2,7 +2,6 @@ import { BuildMachine, buildDefinition, reduce } from "@narratage/core";
import type { BuildState } from "@narratage/protocol";
import type {
- BuildScheduler,
BuildSchedulerOptions,
RuntimeCommandExecutor,
RuntimeExecutionResult,
@@ -49,7 +48,7 @@ function buildCommandKey(build: string, command: string): string {
* across all submitted Builds,
* but never searches a Graph: every runnable command is regenerated by Core through the Executor.
*/
-export class LocalBuildScheduler implements BuildScheduler {
+export class LocalBuildScheduler {
readonly #executor: RuntimeCommandExecutor;
readonly #maxConcurrency: number;
readonly #resourceLimits: Readonly<Record<string, number>>;
diff --git a/packages/runtime/src/types.ts b/packages/runtime/src/types.ts
index 8808b23f..bedc9fae 100644
--- a/packages/runtime/src/types.ts
+++ b/packages/runtime/src/types.ts
@@ -7,7 +7,6 @@ import type {
CoreCommand,
Digest,
} from "@narratage/protocol";
-import type { BuildDispatchSnapshot, BuildDispatchStore } from "./dispatch.js";
import type { OperationSnapshot } from "./operations.js";
export type RuntimeBlockedCommand = {
@@ -36,25 +35,11 @@ export type RuntimeQueueLane = {
readonly lane: string;
};
-export type RuntimeExecutionStores = {
- readonly builds: BuildStore;
- readonly operations: import("./operations.js").OperationStore;
- readonly dispatch: BuildDispatchStore;
- readonly artifacts: ArtifactStore;
-};
-
export type RuntimeWorkerRunOptions = {
readonly idlePollMs: number;
readonly signal?: AbortSignal;
};
-export type RuntimeWorker = {
- /** Claim and advance at most one Build. Undefined means no Dispatch was ready. */
- runOnce(): Promise<BuildDispatchSnapshot | undefined>;
- /** Continue until the caller-owned process signal is aborted. */
- run(options: RuntimeWorkerRunOptions): Promise<void>;
-};
-
export type RuntimePreparation = {
readonly state: BuildState;
readonly runnable: readonly RuntimeRunnableCommand[];
@@ -173,8 +158,3 @@ export type BuildSchedulerOptions = {
/** Optional durable authority. When present, every admitted Core Fact is appended. */
readonly buildStore?: BuildStore;
};
-
-/** Internal scheduler used by an execution Runtime. */
-export type BuildScheduler = {
- run(requests: readonly ScheduledBuild[]): Promise<readonly ScheduledBuildResult[]>;
-};
diff --git a/packages/speech-alignment/README.md b/packages/speech-alignment/README.md
index bfffd66b..b95d70f6 100644
--- a/packages/speech-alignment/README.md
+++ b/packages/speech-alignment/README.md
@@ -19,12 +19,12 @@ floating-point seconds.
The locator accepts Narrative, SpeechAudioBasis and AlignedTranscriptEvidence through three explicit
graph edges. Evidence carries no authored Segment identity; the locator checks its sample windows
against the supplied Basis and performs that association locally.
-Artifact/Basis lineage stays in the upstream request edges and Derivations instead of being copied
+Artifact and Basis relationships stay in explicit upstream graph edges instead of being copied
through every evidence value.
`speechAlignmentComponent` exposes the locator as one enumerable deterministic Producer facet. Its
-identity is checked against `speechAlignmentManifest`, enters the installed implementation package
-lock and executes through the host-neutral compute port. The package depends only on public video
+identity is checked against `speechAlignmentManifest` and executes through the host-neutral compute
+port. The package depends only on public video
contracts and protocol utilities; it has no Core, Driver, Provider, Artifact, queue or credential
authority.
diff --git a/packages/store-sqlite/src/store.ts b/packages/store-sqlite/src/store.ts
index cbbb0029..28260680 100644
--- a/packages/store-sqlite/src/store.ts
+++ b/packages/store-sqlite/src/store.ts
@@ -9,7 +9,6 @@ import {
import type {
BuildDefinition,
BuildFact,
- Digest,
} from "@narratage/protocol";
import {
verifyBuildCatalogDescriptor,
diff --git a/packages/transport-aws-lambda/README.md b/packages/transport-aws-lambda/README.md
index 6c3498d2..325d9b1e 100644
--- a/packages/transport-aws-lambda/README.md
+++ b/packages/transport-aws-lambda/README.md
@@ -12,7 +12,7 @@ Endpoint-specific code owns:
- the function name, version/alias and retry semantics included in Endpoint configuration identity.
The transport always uses `RequestResponse`. Lambda `Event` invocation has its own at-least-once
-queue and no immediate result/checkpoint, so treating it as a recoverable SVML Endpoint would be
+queue and no immediate result/checkpoint, so treating it as an asynchronous Narratage Endpoint would be
misleading. An Endpoint may invoke a coordinator Lambda synchronously; that coordinator can submit
long work and return a checkpoint which the Endpoint later polls through another synchronous call.
diff --git a/packages/validation/README.md b/packages/validation/README.md
index 56228979..1aa431bb 100644
--- a/packages/validation/README.md
+++ b/packages/validation/README.md
@@ -1,29 +1,11 @@
# `@narratage/validation`
-Host-side admission for package-owned semantic Types.
+Host side semantic validation for package owned types.
-A module owns the meaning of every `TypeRef` it declares. Core always checks the Type's structural
-Schema. When structure is insufficient, the owner may also lock a pure validator implementation
-digest in its static Manifest. The reference Host registers that exact Type and implementation
-digest here.
+Core checks nominal type connections. A component package may additionally register one pure
+validator for an exact `TypeRef`. The compiler applies that validator to authored and provided
+values; `NodeDriver` applies it to component and endpoint results before offering them to Core.
-`validateValue()` runs the owner validator as a Host admission gate. `admitRecord()` applies the
-same gate to authored or externally provided Records. `NodeDriver` applies it to Producer and
-Provider results before creating a Command result. Core neither executes the validator nor learns the
-domain meaning; admitted Records carry no validation metadata through the graph.
-
-Validators are refinements, not converters. They may accept or reject a value; they may not rewrite
-it, create graph edges, select a Provider, read credentials or add author intent. Cross-package
-communication therefore remains decentralized:
-
-```text
-Type owner Manifest -> nominal Type + Schema + optional validator digest
-Producer package -> emits that exact TypeRef
-Consumer package -> accepts that exact TypeRef
-Host admission -> executes the locked validator
-Core -> verifies graph typing and structural Schema
-```
-
-The current reference registry executes trusted in-process handlers. Community validator execution
-still requires the planned code-byte verification, resource limits and sandbox/worker boundary.
-Until then only trusted installed implementations may be registered.
+Validators only accept or reject. They cannot rewrite a value, create graph edges, select an
+endpoint, read credentials or add author intent. The registry executes trusted installed handlers
+in process.
diff --git a/packages/validation/src/index.ts b/packages/validation/src/index.ts
index 7f93faae..8bcb138f 100644
--- a/packages/validation/src/index.ts
+++ b/packages/validation/src/index.ts
@@ -4,7 +4,6 @@ import {
verifyRecordStructure,
} from "@narratage/core";
import type {
- TypeValidatorContext,
TypeValidatorHandler,
TypeValidatorRegistrar,
} from "@narratage/component-kit";
diff --git a/packages/video-cli/test/packages.ts b/packages/video-cli/test/packages.ts
index 29ca7e70..1e1fdc96 100644
--- a/packages/video-cli/test/packages.ts
+++ b/packages/video-cli/test/packages.ts
@@ -31,11 +31,9 @@ import svs from "../../svs/src/activation.js";
import typographyTrack from "../../typography-track/src/activation.js";
import whisperX from "../../whisperx/src/activation.js";
import type { NodePackageContribution } from "@narratage/package-loader-node";
-import { fixtureDigest } from "../../../test/fixture-digest.js";
const bind = (specifier: string, contribution: NodePackageContribution) => ({
specifier,
- digest: fixtureDigest(specifier),
contribution,
});