core/src/judge
Command judge
Section titled “Command judge”JudgeStateInputs
Section titled “JudgeStateInputs”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).
Properties
Section titled “Properties”
readonlycwd:string
Defined in: packages/core/src/judge.ts:268
secretPathFragments
Section titled “secretPathFragments”
readonlysecretPathFragments: readonlystring[]
Defined in: packages/core/src/judge.ts:269
secretValues
Section titled “secretValues”
readonlysecretValues: readonlystring[]
Defined in: packages/core/src/judge.ts:270
judgeFilesOf()
Section titled “judgeFilesOf()”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.
Parameters
Section titled “Parameters”command
Section titled “command”string
string
fragments
Section titled “fragments”readonly string[]
Returns
Section titled “Returns”Record<string, string>
judgeStateOf()
Section titled “judgeStateOf()”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.
Parameters
Section titled “Parameters”context
Section titled “context”inputs
Section titled “inputs”Returns
Section titled “Returns”object
command
Section titled “command”command:
string
cwd:
string
denied?
Section titled “denied?”
optionaldenied?:object
denied.command
Section titled “denied.command”command:
string
denied.reason
Section titled “denied.reason”reason:
string
files?
Section titled “files?”
optionalfiles?:Record<string,string>
policy
Section titled “policy”policy:
string
recentCalls?
Section titled “recentCalls?”
optionalrecentCalls?:object[]
redactJudgeState()
Section titled “redactJudgeState()”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.
Parameters
Section titled “Parameters”command
Section titled “command”string = ...
string = ...
denied?
Section titled “denied?”{ command: string; reason: string; } = ...
denied.command
Section titled “denied.command”string = ...
denied.reason
Section titled “denied.reason”string = ...
files?
Section titled “files?”Record<string, string> = ...
policy
Section titled “policy”string = ...
recentCalls?
Section titled “recentCalls?”object[] = ...
secretValues
Section titled “secretValues”readonly string[]
Returns
Section titled “Returns”object
command
Section titled “command”command:
string
cwd:
string
denied?
Section titled “denied?”
optionaldenied?:object
denied.command
Section titled “denied.command”command:
string
denied.reason
Section titled “denied.reason”reason:
string
files?
Section titled “files?”
optionalfiles?:Record<string,string>
policy
Section titled “policy”policy:
string
recentCalls?
Section titled “recentCalls?”
optionalrecentCalls?:object[]
redactJudgeText()
Section titled “redactJudgeText()”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.
Parameters
Section titled “Parameters”string
secretValues
Section titled “secretValues”readonly string[]
Returns
Section titled “Returns”string
