Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion src/lib/onboard/runtime-boundary-record-only.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";

import {
createSession,
Expand Down Expand Up @@ -115,6 +115,38 @@ describe("OnboardRuntimeBoundary record-only step/result pairing", () => {
]);
});

it("applies validated step completion results directly without compatibility diagnostics", async () => {
const { boundary, events } = createRuntimeHarness();
const compatibilitySpy = vi
.spyOn(boundary, "recordStateResultWithStepCompatibility")
.mockRejectedValue(new Error("compatibility bridge should not be used"));

try {
await boundary.recordStateResult(advanceTo("preflight"));
const completed = await boundary.recordStepCompleteWithStateResult(
"preflight",
{ sandboxName: "strict-path-sb" },
advanceTo("gateway", { metadata: { state: "preflight" } }),
);

expect(completed).toMatchObject({
sandboxName: "strict-path-sb",
machine: { state: "gateway", revision: 2 },
steps: { preflight: { status: "complete" } },
});
expect(compatibilitySpy).not.toHaveBeenCalled();
expect(events.map((event) => event.type)).toEqual([
"state.exited",
"state.entered",
"state.exited",
"state.entered",
]);
expect(events.some((event) => event.type === "state.result.skipped")).toBe(false);
} finally {
compatibilitySpy.mockRestore();
}
});

it("pairs record-only step failure with an explicit failure result", async () => {
const { boundary, events } = createRuntimeHarness();

Expand Down
2 changes: 1 addition & 1 deletion src/lib/onboard/runtime-boundary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class OnboardRuntimeBoundary {
): Promise<Session> {
await this.assertStateResultWillApply(result);
await this.getRuntime().markStepCompleteRecordOnly(stepName, updates);
return this.recordStateResultWithStepCompatibility(result);
return this.recordStateResult(result);
}

async recordStepFailedWithStateResult(
Expand Down