Share the external Runner lifecycle and add strict Muse contracts (#16444)

Add the external Runner foundation with distinct Dot/Grok V6, canonical home-mode V7 and Muse V8 contracts.

Keep generated schemas and profiles synchronized. Bound default question-answer command IDs in a disjoint namespace while preserving existing IDs and durable replay. Preserve canonical migration history and add normally generated, replay-safe Muse schema milestones with literal preview-history fixtures.

Refs #16444.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-10-16 13:46:50 -05:00
1 parent 4de6335c3b
commit 2cc7992369
95 files changed
+12594 -1600

No files matched your search

@@ -1689,6 +1689,7 @@ export function nativeSessionWorkspaceScope(execution: { binding: Pick<NativeExe
function nativeProviderSessionScope(execution: NativeExecutionInput) {
switch (execution.provider.kind) {
case "muse":
case "grok_bot":
case "openai_dot": return { kind: execution.provider.kind, bindingId: execution.provider.binding.bindingId, generation: execution.provider.binding.bindingGeneration };
case "claude_managed":
@@ -5549,6 +5550,7 @@ function canonicalJson(value: unknown): string {
function runnerProviderStateFilename(execution: NativeExecutionInput): string {
switch (execution.provider.kind) {
case "muse": return "muse-provider-state.json";
case "grok_bot":
case "openai_dot":
return "dot-provider-state.json";
@@ -5584,9 +5586,10 @@ export function providerSessionIdentityFromDurableProviderState(input: {
providerSessionIdentity: null,
});
switch (input.execution.provider.kind) {
case "muse":
case "grok_bot":
case "openai_dot":
// Dot checkpoints recover the bridge only; there is no native provider thread.
// External checkpoints recover the bridge only; there is no native provider thread.
return emptyIdentity();
case "acpx": {
const descriptor = record(state.descriptor);
@@ -8658,7 +8661,7 @@ async function executePaperclipNativeSessionWithinScope(
: null;
}
const runnerExecution: NativeExecutionInput =
input.execution.schema !== "paperclip.native-execution-input.v6" && input.useRunnerd && input.runnerExecutionTarget?.kind === "remote"
input.execution.schema !== "paperclip.native-execution-input.v6" && input.execution.schema !== "paperclip.native-execution-input.v8" && input.useRunnerd && input.runnerExecutionTarget?.kind === "remote"
? {
...input.execution,
workspace: {
@@ -11431,6 +11434,9 @@ async function createRunnerdBackendWithinSessionClaim(
retainedTransition?: VerifiedWarmTransitionBinding,
): Promise<NativeSessionBackend & { bindManagedSession(session: NativeSession): NativeSession }> {
const timeController = createRunPreparationTiming(input.execution.binding.runId, "native.controller");
if (input.execution.schema === "paperclip.native-execution-input.v8") {
throw new Error("paperclip_runner_provider_unsupported");
}
let recoveryPending = retainedTransition !== undefined;
const target = input.runnerExecutionTarget ?? { kind: "local" as const };
const remoteTarget = target.kind === "remote" ? target : null;