Skip to content

Commit 08cccbf

Browse files
committed
merge(main): refresh policy finality slice
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
2 parents 2d5dae4 + 692d1fa commit 08cccbf

11 files changed

Lines changed: 345 additions & 322 deletions

docs/manage-sandboxes/recover-rebuild-sandboxes.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ For missing, unsafe, malformed, expired, mismatched, changed, or unhealthy evide
173173
Ordinary launch continues only when NemoClaw proves that no old authority or evidence can exist, or durably rotates the runtime epoch.
174174
If an old epoch might exist and cannot be durably rotated, `launch` and `connect --probe-only` stop before complete preflight or recovery.
175175
Their redacted guidance asks you to repair the current user's secure OS runtime authority and NemoClaw state permissions, then retry.
176-
If NemoClaw securely proves that both the authority and receipt are absent but cannot create new authority, ordinary `launch` can run the complete preflight without optimization; `connect --probe-only` exits nonzero because it could not publish evidence.
176+
If NemoClaw securely proves that both the authority and receipt are absent but cannot create new authority, ordinary `launch` can run the complete preflight without optimization; on Linux, `connect --probe-only` exits nonzero because it could not publish evidence.
177177
If that preflight succeeds before the lease expires, replacement evidence keeps the original start and expiry time.
178178
After expiry, a successful complete preflight starts a new 24-hour lease only when publication succeeds.
179179

@@ -190,8 +190,9 @@ Lease acceptance and publication are currently Linux-only and require a secure,
190190
It never uses caller-provided environment variables to select this authority.
191191

192192
On macOS, `launch` runs the complete preflight every time and does not publish a launch-readiness lease.
193-
`connect --probe-only` also runs the complete preflight, including recovery and probes, but exits nonzero because it cannot publish authoritative launch-readiness evidence.
194-
The publication-failure diagnostic is redacted and does not print filesystem paths or environment values.
193+
`connect --probe-only` also runs the complete preflight, including recovery and probes.
194+
After a successful probe and recovery, it prints a note that launch-readiness evidence is unavailable on this platform and exits zero.
195+
On Linux, the publication-failure diagnostic is redacted and does not print filesystem paths or environment values.
195196

196197
Infrastructure must run `connect --probe-only` as the same final numeric user that later runs `launch`.
197198
Run it after the final durable home and state volume is mounted and after policy and network provisioning is complete.

docs/reference/commands.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,16 +1273,18 @@ It validates a usable lease and exits without duplicate recovery.
12731273
Otherwise, it fences prior evidence, waits for the sandbox, verifies or repairs its in-sandbox agent process and host-side forwards, and publishes evidence only after every probe succeeds.
12741274
It rechecks the sandbox on its recorded OpenShell gateway after the readiness wait and never restarts the shared host gateway.
12751275
If an old runtime epoch might exist and cannot be durably rotated, the command exits nonzero before complete preflight or recovery and gives redacted repair guidance.
1276-
A securely absent runtime authority and receipt let ordinary `launch` run the complete preflight without optimization if new authority creation fails, but `connect --probe-only` still exits nonzero because it could not publish launch-readiness evidence.
1277-
A runtime failure and a failure to publish evidence for an otherwise healthy runtime also exit nonzero with different diagnostics.
1276+
A securely absent runtime authority and receipt let ordinary `launch` run the complete preflight without optimization if new authority creation fails, but on Linux `connect --probe-only` still exits nonzero because it could not publish launch-readiness evidence.
1277+
A runtime failure and, on Linux, a failure to publish evidence for an otherwise healthy runtime also exit nonzero with different diagnostics.
12781278

12791279
Infrastructure must run the command as the same final numeric user that later runs `launch`.
12801280
Run it only after the final durable home and state volume is mounted and after policy and network provisioning is complete.
12811281
On Linux, that user also needs a secure, independently writable OS per-user runtime authority under `/run/user/<numeric-uid>`.
12821282
Do not redirect this authority with caller environment variables.
12831283
Do not use a graphical or login-session identifier as the deployment ordering boundary.
1284-
On macOS, `connect --probe-only` runs the complete preflight, including recovery and probes, but exits nonzero because it cannot publish authoritative launch-readiness evidence.
1285-
The publication-failure diagnostic is redacted and does not print filesystem paths or environment values.
1284+
On macOS, `connect --probe-only` runs the complete preflight, including recovery and probes.
1285+
After a successful probe and recovery, it prints a note that launch-readiness evidence is unavailable on this platform and exits zero.
1286+
The next `launch` runs the complete preflight.
1287+
On Linux, the publication-failure diagnostic is redacted and does not print filesystem paths or environment values.
12861288
Run it for health checks and scripted readiness probes; users continue to run only `$$nemoclaw launch <name>`.
12871289

12881290
Use [`$$nemoclaw launch <name>`](#$$nemoclaw-launch-name) when you want launch-readiness validation, an automatic fallback that runs the complete preflight, and then the agent instead of a sandbox shell.

src/lib/actions/sandbox/connect-flow.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ describe("connectSandbox flow", () => {
635635
);
636636
});
637637

638-
it("probe-only completes macOS recovery before reporting unavailable evidence (#8942)", async () => {
638+
it("probe-only completes macOS recovery and exits zero when evidence is unavailable (#9278)", async () => {
639639
const harness = createConnectHarness({
640640
readinessDecision: {
641641
kind: "fallback",
@@ -650,16 +650,16 @@ describe("connectSandbox flow", () => {
650650
readinessPublicationResult: { kind: "evidence-failed" },
651651
});
652652

653-
await expect(harness.connectSandbox("alpha", { probeOnly: true })).rejects.toThrow(
654-
"process.exit(1)",
655-
);
653+
await expect(harness.connectSandbox("alpha", { probeOnly: true })).resolves.toBeUndefined();
656654

657655
expect(harness.checkAndRecoverSpy).toHaveBeenCalledOnce();
658656
expect(harness.ensureLiveSandboxSpy).toHaveBeenCalled();
659657
expect(harness.publishLaunchReadinessSpy).toHaveBeenCalledOnce();
660-
expect(harness.errorSpy).toHaveBeenCalledWith(
661-
" Probe failed: complete probe and recovery succeeded, but launch-readiness evidence is unavailable on this platform.",
658+
expect(exitSpy).not.toHaveBeenCalled();
659+
expect(harness.logSpy).toHaveBeenCalledWith(
660+
" Note: launch-readiness evidence is unavailable on this platform; the next launch runs the complete preflight.",
662661
);
662+
expect(harness.errorSpy.mock.calls.flat().join("\n")).not.toContain("Probe failed");
663663
});
664664

665665
it("lets a public lifecycle command continue after recovery when evidence publication is unavailable (#8942)", async () => {

src/lib/actions/sandbox/connect.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,10 +1332,19 @@ export async function connectSandbox(
13321332
}
13331333
if (publication.kind === "evidence-failed") {
13341334
if (!requireLaunchReadinessPublication) return;
1335+
// A platform without a per-user runtime authority (macOS) can never
1336+
// store launch-readiness evidence. The probe and recovery still
1337+
// succeeded, and `launch` runs the complete preflight without the
1338+
// evidence, so a permanent platform gap must not turn a successful
1339+
// probe into a nonzero exit (#9278).
1340+
if (readiness.kind === "fallback" && readiness.authorityUnsupported === true) {
1341+
console.log(
1342+
" Note: launch-readiness evidence is unavailable on this platform; the next launch runs the complete preflight.",
1343+
);
1344+
return;
1345+
}
13351346
console.error(
1336-
readiness.kind === "fallback" && readiness.authorityUnsupported === true
1337-
? " Probe failed: complete probe and recovery succeeded, but launch-readiness evidence is unavailable on this platform."
1338-
: " Probe failed: complete probe and recovery succeeded, but final launch-readiness evidence could not be verified or published.",
1347+
" Probe failed: complete probe and recovery succeeded, but final launch-readiness evidence could not be verified or published.",
13391348
);
13401349
process.exit(1);
13411350
}

src/lib/security/credential-filter-secret-patterns.test.ts

Lines changed: 0 additions & 299 deletions
This file was deleted.

0 commit comments

Comments
 (0)