docs: reserve seam for complete capabilities

This commit is contained in:
Turtle
2026-08-09 15:34:32 +08:00
parent 27ac49e687
commit dda02250f5
966 changed files with 2166 additions and 2159 deletions

View File

@@ -70,7 +70,7 @@ function defaultProbeSeatbelt(seatbeltExec: string, timeoutMs: number): boolean
return probe.status === 0
}
/** Test seam: inject probe verdicts / a fake launcher / a platform without real runners. */
/** Test hook: inject probe verdicts / a fake launcher / a platform without real runners. */
export interface SandboxInternals {
/** Replaces `process.platform` for chain selection (exercise any platform's chain from any host). */
platform?: string
@@ -179,7 +179,7 @@ export class LocalSandboxProvider extends SandboxProvider {
probeTimeoutMs: z.natural().default(5_000),
})
/** Test seam (mirrors the bash executors' `internals`). */
/** Test hook (mirrors the bash executors' `internals`). */
internals: SandboxInternals = {}
private readonly runnerCommand: string[] | undefined
@@ -300,12 +300,12 @@ export class LocalSandboxProvider extends SandboxProvider {
}
}
/** The Landlock launcher to probe and exec (test seam over the resolved one). */
/** The Landlock launcher to probe and exec (test hook over the resolved one). */
private landlockLauncher(): string {
return this.internals.landlockLauncher ?? landlockLauncherPath()
}
/** The `sandbox-exec` executable to probe and exec (test seam over the system one). */
/** The `sandbox-exec` executable to probe and exec (test hook over the system one). */
private seatbeltExec(): string {
return this.internals.seatbeltExec ?? 'sandbox-exec'
}

View File

@@ -237,7 +237,7 @@ describe('the platform chains', () => {
it('a multi-rung chain probes a seatbelt rung like any other (the walk, not the platform table, decides)', async () => {
// The product chains reach seatbelt only as darwin's sole (unprobed)
// candidate; the chain seam exercises the probing path it would take in
// candidate; the probe chain exercises the path it would take in
// a grown chain, keeping the default seatbelt probe honest.
const exec = fakeSeatbeltExec(0)
const probeBwrap = vi.fn(() => false)
@@ -349,8 +349,8 @@ describe('probeTimeoutMs config', () => {
describe('the default seatbelt probe (sandbox-exec contract)', () => {
// The product chains reach seatbelt only unprobed (darwin's sole
// candidate), so the default probe's contract is pinned through the chain
// seam: a grown chain must probe it like any other rung.
// candidate), so the default probe's contract is pinned through the provider
// chain: a grown chain must probe it like any other rung.
it('selects the rung when the executable applies the read-only profile and exits 0', async () => {
const exec = fakeSeatbeltExec(0)
const { sandbox } = await setup({}, { chain: ['bwrap', 'seatbelt'], probeBwrap: () => false, seatbeltExec: exec })