refactor(tools): remove redundant limits and acknowledgements

This commit is contained in:
morluto
2026-09-29 10:53:45 +08:00
parent 7ba3580c86
commit bd0e341572
158 changed files with 599 additions and 1527 deletions
@@ -119,7 +119,7 @@ it("rejects runtime source bytes whose Evidence omits source-capture approval",
const staticEvidence = await analyzeFixture(fixture);
const contradictoryRuntime = electronRuntimeEvidence(fixture, SOURCE, {
includeWorker: false,
sourceCaptureApproved: false,
sourceIncluded: false,
});
expect(() =>
@@ -127,7 +127,7 @@ it("rejects runtime source bytes whose Evidence omits source-capture approval",
static_layers: [{ role: "application", analysis: staticEvidence }],
runtime_observations: [contradictoryRuntime],
}),
).toThrow(/source-capture approval/u);
).toThrow(/source-capture selection/u);
});
it("keeps graph omission counts unknown when a runtime section is unavailable", async () => {
@@ -219,22 +219,20 @@ const electronRuntimeEvidence = (
readonly scriptFile?: string;
readonly includeWorker?: boolean;
readonly targetId?: string;
readonly sourceCaptureApproved?: boolean;
readonly sourceIncluded?: boolean;
readonly workersUnavailable?: boolean;
} = {},
) => {
const scriptFile = options.scriptFile ?? "app.js";
const includeWorker = options.includeWorker ?? true;
const targetId = options.targetId ?? "target-main";
const sourceCaptureApproved = options.sourceCaptureApproved ?? true;
const sourceIncluded = options.sourceIncluded ?? true;
const input = inspectElectronPageInputSchema.parse({
cdp_endpoint: "http://127.0.0.1:9223",
allowed_file_roots: [root],
target_id: targetId,
approved: true as const,
observation_ms: 100,
include_script_sources: sourceCaptureApproved,
source_capture_approved: sourceCaptureApproved,
include_script_sources: sourceIncluded,
limits: {
max_frames: 200,
max_dom_nodes: 2_000,
@@ -29,7 +29,6 @@ it("does not follow or disclose symlink targets outside declared roots", async (
if (!capability.available) return;
const result = await captureProcessScenario(
parseProcessScenario({
approved: true,
executable: "/usr/bin/true",
working_directory: root,
filesystem_roots: [root],
@@ -60,7 +59,6 @@ it("does not follow or disclose symlink targets outside declared roots", async (
it("does not launch when policy denies capture", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
});
@@ -84,7 +82,6 @@ it("distinguishes timeout from cancellation and cleans both runs", async () => {
};
const timedOut = await captureProcessScenario(
parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [processFixture, "hang"],
working_directory: dirname(processFixture),
@@ -105,7 +102,6 @@ it("distinguishes timeout from cancellation and cleans both runs", async () => {
setTimeout(() => controller.abort(), 50);
const cancelled = await captureProcessScenario(
parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [processFixture, "hang"],
working_directory: dirname(processFixture),
@@ -125,7 +121,6 @@ it("captures source-owned interactive, resize, Unicode, and signal behavior", as
if (!capability.available) return;
const result = await captureProcessScenario(
parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [processFixture, "interactive"],
working_directory: dirname(processFixture),
@@ -161,7 +156,6 @@ it("dispatches scheduled events before a silent PTY produces output", async () =
if (!capability.available) return;
const result = await captureProcessScenario(
parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [processFixture, "silent-interactive"],
working_directory: dirname(processFixture),
@@ -202,7 +196,6 @@ it("samples and cleans a source-owned child and grandchild process tree", async
if (!capability.available) return;
const result = await captureProcessScenario(
parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [processFixture, "tree"],
working_directory: dirname(processFixture),
@@ -118,7 +118,6 @@ function collectionTriggers() {
function createMultiSourceScenario(root: string, script: string) {
return parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [script, "codex"],
working_directory: root,
@@ -15,7 +15,6 @@ import { processCaptureIssues } from "../../../src/domain/processCapture.fixture
function createInteractiveScenario(root: string, script: string) {
return parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [script],
working_directory: root,
@@ -307,7 +306,6 @@ it("records target loss before post-exit settlement can win the deadline race",
const script = join(root, "exit.mjs");
await writeFile(script, 'process.stdout.write("exiting\\n");\n');
const scenario = parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [script],
working_directory: root,
@@ -37,7 +37,6 @@ it("runs a login and reconnect replay machine inside process capture", async ()
].join("\n"),
);
const scenario = parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [script],
working_directory: root,
@@ -179,7 +178,6 @@ it("captures PTY, filesystem, descendants, HTTP replay, and redacts environment"
networkAccess: "external",
};
const scenario = parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [script],
working_directory: root,
@@ -6,7 +6,6 @@ import { parseProcessScenario } from "../../../src/domain/processCapture.js";
it("serves bounded HTTP and WebSocket replay on loopback", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
replay: {
@@ -38,7 +37,6 @@ it("serves bounded HTTP and WebSocket replay on loopback", async () => {
it("matches bounded HTTP scripts without persisting request secrets", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
replay: {
@@ -95,7 +93,6 @@ it("matches bounded HTTP scripts without persisting request secrets", async () =
it("consumes ordered WebSocket reconnect scripts and reports exhaustion", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
replay: {
@@ -134,7 +131,6 @@ it("consumes ordered WebSocket reconnect scripts and reports exhaustion", async
it("serializes WebSocket transition actions across rapid messages", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
replay: {
@@ -213,7 +209,6 @@ it("serializes WebSocket transition actions across rapid messages", async () =>
it("drains queued machine work before exposing finalized snapshots", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
replay: {
@@ -290,7 +285,6 @@ it("drains queued machine work before exposing finalized snapshots", async () =>
it("enforces replay duration before normalizing recorded timestamps", async () => {
const scenario = parseProcessScenario({
approved: true,
executable: "/bin/sh",
working_directory: "/tmp",
normalization: { time_bucket_ms: 60_000 },
@@ -11,7 +11,6 @@ import { parseProcessScenario } from "../../../src/domain/processCapture.js";
const buildTerminalScenario = (root: string, script: string) =>
parseProcessScenario({
approved: true,
executable: process.execPath,
arguments: [script],
working_directory: root,