Skip to content
2 min read · 350 words

Function: reproduceMandatoryDeny() ​

ts
function reproduceMandatoryDeny(options: {
  allowGitConfig: boolean;
  cwd: string;
  dotGitIsDirectory?: boolean;
  platform?: "darwin" | "linux";
}): string[];

Defined in: src/batteries/sandbox/node/fs_node.ts:361

Reproduce SRT's profile-injected mandatory-deny set for the CURRENT platform.

Parameters ​

ParameterTypeDescription
options{ allowGitConfig: boolean; cwd: string; dotGitIsDirectory?: boolean; platform?: "darwin" | "linux"; }The cwd the profile was built against, and the inputs that change the set.
options.allowGitConfigboolean-
options.cwdstring-
options.dotGitIsDirectory?boolean-
options.platform?"darwin" | "linux"-

Returns ​

string[]

The reproduced entries, in the platform's own form.

Remarks ​

THIS IS OUR REPRODUCTION, NOT SRT'S OUTPUT, and the distinction bounds what any check built on it can prove. SRT exposes no function for this set: it is injected at PROFILE GENERATION, linuxGetMandatoryDenyPaths is a non-exported local, and macGetMandatoryDenyPatterns is not re-exported from the package index. So the entries are re-derived here with the same lists upstream uses — which is why the constant-parity test diffs those lists directly, and why a drift check over this axis proves only "our inputs did not change", never "our reproduction still matches SRT".

Without it the in-process evaluator has NO mandatory denies at all, and save_media writes .bashrc or .mcp.json where the spawned shell is refused — the "one boundary, two answers" failure this reproduction exists to prevent.

FORM DIFFERS BY PLATFORM and the two are not comparable: · macOS emits GLOBS the seatbelt profile matches natively — each name resolved against the cwd plus a the subtree form subtree pattern, so it matches at any depth. · Linux emits CONCRETE PATHS from a bounded rg scan, so it is point-in-time and depth-limited; a file created afterwards, or nested deeper than mandatoryDenySearchDepth, is NOT covered there. We reproduce the cwd-rooted entries; the scan's discoveries are the profile's own.

.git/hooks and .git/config are PLATFORM-CONDITIONAL: macOS pushes hooks unconditionally and config unless allowGitConfig, while Linux pushes neither for the workspace root unless .git is a real DIRECTORY (in a worktree it is a file, and denying it would break bwrap).