Skip to content

core/src/judge

Defined in: packages/core/src/judge.ts:267

Where a judge state is built from, beside the call’s context: the directory it runs in (its scripts are read from there), the guard’s secret-path fragments (a script under one is never read) and every known secret value (scrubbed before the state leaves).

readonly cwd: string

Defined in: packages/core/src/judge.ts:268

readonly secretPathFragments: readonly string[]

Defined in: packages/core/src/judge.ts:269

readonly secretValues: readonly string[]

Defined in: packages/core/src/judge.ts:270


judgeFilesOf(command, cwd, fragments): Record<string, string>

Defined in: packages/core/src/judge.ts:165

The contents of what command runs, by the name the judge reads them under: a file by its path as the command spells it (relative to cwd when inside it), a package script as package.json#scripts.<name>, the Makefile as Makefile. Empty when it runs nothing from disk.

string

string

readonly string[]

Record<string, string>


judgeStateOf(context, inputs): object

Defined in: packages/core/src/judge.ts:281

What the judge is asked about a call in its scope (#469): the command, where it runs, the policy, the scripts it runs, the calls before it and the refusal it follows — redacted. ⚠ The only way to build a state, so the live guard and the replay send the same thing, and nothing holds an unredacted one.

EnsoJudgeContext

JudgeStateInputs

object

command: string

cwd: string

optional denied?: object

command: string

reason: string

optional files?: Record<string, string>

policy: string

optional recentCalls?: object[]


redactJudgeState(state, secretValues): object

Defined in: packages/core/src/judge.ts:237

The state with every string redacted — the command, the files, the calls before it and the refusal. ⚠ Only this crosses to a backend.

string = ...

string = ...

{ command: string; reason: string; } = ...

string = ...

string = ...

Record<string, string> = ...

string = ...

object[] = ...

readonly string[]

object

command: string

cwd: string

optional denied?: object

command: string

reason: string

optional files?: Record<string, string>

policy: string

optional recentCalls?: object[]


redactJudgeText(text, secretValues): string

Defined in: packages/core/src/judge.ts:217

One string as the judge may see it: known secret values first, then the shapes. Markers, not deletions, so the judge still reads that something was there.

string

readonly string[]

string