Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(gate): distinguish TAP diagnostics [I1,C7]
Corey Olsonc00eec5ebcb1
diff --git a/src/gate.js b/src/gate.jsindex bc473aa3..47f45324 100644--- a/src/gate.js+++ b/src/gate.js@@ -202,11 +202,14 @@ export function sandboxBlockedScanner(root) {/** Read one line, retaining only the current failed TAP record's permission and code fields. */return (raw) => {const line = raw.trim().replace(/^#\s*/u, '');- if (/^(?:Error: |PermissionError: )/u.test(line)) {+ const indent = raw.length - raw.trimStart().length;+ // Node's TAP reporter prints test-console output as comments and assertion details+ // as indented YAML. Neither is a standalone gate diagnostic, even when it contains+ // text that looks exactly like an operating-system denial.+ if (indent === 0 && !raw.startsWith('#') && /^(?:Error: |PermissionError: )/u.test(line)) {const direct = permissionOperation(root, line.replace(/^Error: /u, ''));if (direct) return direct.operation;}- const indent = raw.length - raw.trimStart().length;if (/^(?:not )?ok \d+\b/u.test(line)) {failureIndent = /^not ok /u.test(line) ? indent : null;fieldIndent = null; permission = null; code = null;diff --git a/test/submit-gate.test.js b/test/submit-gate.test.jsindex 87205998..50a6bc96 100644--- a/test/submit-gate.test.js+++ b/test/submit-gate.test.js@@ -837,6 +837,22 @@ test('a sandbox-blocked gate asks the person [I1,C7]', async (t) => {assert.equal(ordinary.code, 1);assert.match(ordinary.out, /ERR_ASSERTION/u);assert.doesNotMatch(ordinary.out + ordinary.err, /SANDBOX_BLOCKED/u);+ const printedDiagnostic = `Error: EACCES: permission denied, open '${outside}'`;+ put(box.root, 'test/permission.test.js', prefix + `test('ordinary assertion prints a permission-looking diagnostic', () => { console.error(${JSON.stringify(printedDiagnostic)}); assert.equal(1, 2); });\n`);+ commitAll(box);+ const printedAssertion = box.run('gate');+ assert.equal(printedAssertion.code, 1);+ assert.doesNotMatch(printedAssertion.out + printedAssertion.err, /SANDBOX_BLOCKED/u);+ assert.match(printedAssertion.out, /ERR_ASSERTION/u);+ assert.match(printedAssertion.out, /# Error: EACCES: permission denied/u, 'TAP retains the test diagnostic as a comment');+ const multilineDiagnostic = `ordinary assertion detail\nError: EACCES: permission denied, open '${outside}'`;+ put(box.root, 'test/permission.test.js', prefix + `test('multiline assertion detail contains a permission-looking line', () => { assert.fail(${JSON.stringify(multilineDiagnostic)}); });\n`);+ commitAll(box);+ const multilineAssertion = box.run('gate');+ assert.equal(multilineAssertion.code, 1);+ assert.doesNotMatch(multilineAssertion.out + multilineAssertion.err, /SANDBOX_BLOCKED/u);+ assert.match(multilineAssertion.out, /ERR_ASSERTION/u);+ assert.match(multilineAssertion.out, /Error: EACCES: permission denied/u);put(box.root, 'test/permission.test.js', denied);commitAll(box);} finally { chmodSync(directory, 0o700); }