Implement workspace evolution, migrations, and runtime continuity
Enable evolution by default for source-backed workspaces. Add stable conformance ownership, semantic-major review, candidate typechecking, and durable fenced cutover with explicit migrations and forward recovery. Independently supervise package runtimes so unchanged resource owners keep their processes and connections across cutover. Add scoped invocation authority, resource sessions, and typed callback rebinding. Wire opaque object references through generated bindings and RPCs. Add canonical relationship sets, keyed maps, and ordered lists with scoped transactional mutations, revision checks, and inverse consistency. Support planned cascade deletion, protection, tombstones, and lifecycle foundations. Add journaled structural edits, package/function/migration scaffolding, managed repository creation, and resumable bottom-up dependency pin publication. Document lifetime boundaries, revision pinning, prototype compatibility policy, commands, and deferred work. Validate with 210 tests, user-systemd process/connection continuity, generated-package TypeScript checks, and Nix host/protocol checks. TTL handoff, physical reclamation, general multi-step migrations, and root-systemd migration isolation acceptance remain deferred.
This commit is contained in:
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
export type MigrationInput = {
|
||||
schemaVersion: 1;
|
||||
executionId: string;
|
||||
exportId: string;
|
||||
ports: {
|
||||
name: string;
|
||||
binding: string;
|
||||
view: "old" | "new";
|
||||
access: ("read" | "write" | "create" | "edge")[];
|
||||
atomId?: string;
|
||||
attachedAtomId?: string;
|
||||
defaultValue?: unknown;
|
||||
states?: {
|
||||
objectId: string;
|
||||
value: unknown;
|
||||
}[];
|
||||
edges?: MigrationEdge[];
|
||||
}[];
|
||||
};
|
||||
export type MigrationEdge = {
|
||||
id: string;
|
||||
edgeTypeId: string;
|
||||
firstObjectId: string;
|
||||
secondObjectId: string;
|
||||
firstProjectionId: string;
|
||||
secondProjectionId: string;
|
||||
firstOrdinal?: number;
|
||||
secondOrdinal?: number;
|
||||
firstKeyJson?: string;
|
||||
secondKeyJson?: string;
|
||||
};
|
||||
export type MigrationOutput = {
|
||||
schemaVersion: 1;
|
||||
executionId: string;
|
||||
writes: {
|
||||
port: string;
|
||||
objectId: string;
|
||||
value: unknown;
|
||||
}[];
|
||||
creates: {
|
||||
port: string;
|
||||
logicalKey: string;
|
||||
objectId: string;
|
||||
}[];
|
||||
edgeReplacements: {
|
||||
port: string;
|
||||
edges: MigrationEdge[];
|
||||
}[];
|
||||
};
|
||||
export type MigrationContext = {
|
||||
enumerate(port: string): {
|
||||
objectId: string;
|
||||
value: unknown;
|
||||
}[];
|
||||
read(port: string, objectId: string): unknown;
|
||||
write(port: string, objectId: string, value: unknown): void;
|
||||
create(port: string, logicalKey: string): string;
|
||||
edges(port: string): MigrationEdge[];
|
||||
replaceEdges(port: string, edges: MigrationEdge[]): void;
|
||||
};
|
||||
export declare const migrationObjectId: (executionId: string, port: string, logicalKey: string) => string;
|
||||
/** No ordinary RuntimeContext or network/database clients are supplied here.
|
||||
* Process isolation belongs to the host, not this convenience API. */
|
||||
export declare const createMigrationContext: (input: MigrationInput) => {
|
||||
context: MigrationContext;
|
||||
result: () => MigrationOutput;
|
||||
};
|
||||
/** Entrypoint for an immutable package's dedicated bin/migrate executable.
|
||||
* stdout is protocol-only; send diagnostics to stderr. The host independently
|
||||
* validates every write, helper identity, contract, and completion receipt. */
|
||||
export declare const serveMigration: (exports: Record<string, (context: MigrationContext) => void | Promise<void>>) => Promise<void>;
|
||||
//# sourceMappingURL=migration.d.ts.map
|
||||
Reference in New Issue
Block a user