From 5244db13f9d17006c2422eaf650abeadaf9e1680 Mon Sep 17 00:00:00 2001 From: Tyler Skelton Date: Wed, 7 Oct 2026 11:16:11 -0700 Subject: [PATCH 1/4] Keep hidden checks off disk during a job; checks cannot change the work A worker refused once grepped the filesystem for the check names it was shown and found every sealed command in the refused receipt, the journal's bar_run entries and Maat's copy of its own grep output under .maat/out/. - While a job runs, every receipt, journal entry, out/ copy, capture and printed event masks hidden check commands (and the reference program). The text is held in memory and released when the work is over: the journal records each command beside the seal published before the work, and each masked receipt gets a full twin under receipts/full/, bound in the integrity ledger. Receipts on disk are never rewritten. - A passing hidden check's evidence line names the check instead of quoting it, so a truncated table cell cannot leak a prefix. - Seal-time lint L15 now catches checks that change the work (git checkout/merge/commit/reset/stash/add/rm, rm, mv, sed -i, tee or redirects into the project, package installs), always on, with no task wording exemption. Writes to mktemp dirs, /tmp and /dev/null pass. - Task checks and their preflight run in a throwaway copy of the tree, .git included (clonefile where available, dependency dirs linked, large object stores shared via alternates). About 5 ms on a bench task tree; over 20k files or 512 MB, or a .git pointer file, runs in place. --- src/bar.ts | 14 +- src/checklint.ts | 14 +- src/checkwrites.ts | 419 ++++++++++++++++++++++++++++ src/cli.tsx | 13 +- src/criteria.ts | 16 +- src/engine.ts | 97 ++++++- src/integrity.ts | 15 +- src/journal.ts | 22 +- src/receipts.ts | 77 ++++- src/scratch.ts | 272 ++++++++++++++++++ src/types.ts | 5 + src/withhold.ts | 74 +++++ test/checklint.test.ts | 6 +- test/hidden-checks-withheld.test.ts | 306 ++++++++++++++++++++ test/sharper-checks.test.ts | 32 ++- test/task-bar.test.ts | 8 +- 16 files changed, 1364 insertions(+), 26 deletions(-) create mode 100644 src/checkwrites.ts create mode 100644 src/scratch.ts create mode 100644 src/withhold.ts create mode 100644 test/hidden-checks-withheld.test.ts diff --git a/src/bar.ts b/src/bar.ts index 716f016..bf1de7f 100644 --- a/src/bar.ts +++ b/src/bar.ts @@ -19,6 +19,7 @@ import { assertionsIn, fingerprint, isTestPath, treeChanges, type TreeSnapshot } import { createHash } from "node:crypto"; import { execFileSync } from "node:child_process"; import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs"; +import { copyTree, runsInCopy } from "./scratch.js"; import { dirname, join, resolve, sep } from "node:path"; import { parse as parseYaml } from "yaml"; import type { ArchiveLike } from "./archive.js"; @@ -2177,18 +2178,21 @@ export async function runCheck(check: Check, ctx: BarContext): Promise