Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Merge PR #3443: match nested TypeScript diagnostics on Windows

haelyradd527e3613a3
diff --cc scripts/hooks/stop-format-typecheck.js
index d6e002cf4,bfca2fcd2..0bab7d09c
--- a/scripts/hooks/stop-format-typecheck.js
+++ b/scripts/hooks/stop-format-typecheck.js
@@@ -265,10 -256,4 +273,12 @@@ if (require.main === module)
});
}
-module.exports = { run, parseAccumulator, isPluginClonePath, diagnosticMatchesFile };
+module.exports = {
++ diagnosticMatchesFile,
+ run,
+ parseAccumulator,
+ isPluginClonePath,
+ getTotalBudgetMs,
+ getPerBatchBudgetMs,
+};
++
diff --cc tests/hooks/stop-format-typecheck.test.js
index 2b2504ecf,98c0cfaf7..10ceca49d
--- a/tests/hooks/stop-format-typecheck.test.js
+++ b/tests/hooks/stop-format-typecheck.test.js
@@@ -13,13 -13,8 +13,15 @@@ const os = require('os')
const path = require('path');
const accumulator = require('../../scripts/hooks/post-edit-accumulator');
-const { parseAccumulator, isPluginClonePath, diagnosticMatchesFile } = require('../../scripts/hooks/stop-format-typecheck');
+const {
+ getPerBatchBudgetMs,
+ getTotalBudgetMs,
+ isPluginClonePath,
++ diagnosticMatchesFile,
+ parseAccumulator,
+} = require('../../scripts/hooks/stop-format-typecheck');
+
+
function test(name, fn) {
try {
fn();
@@@ -208,27 -203,12 +210,34 @@@ if (test('parseAccumulator ignores blan
assert.deepStrictEqual(result, ['/tmp/a.ts', '/tmp/b.ts']);
})) passed++; else failed++;
+if (test('getTotalBudgetMs honors a bounded dispatcher budget', () => {
+ assert.strictEqual(
+ getTotalBudgetMs({ ECC_STOP_FORMAT_TYPECHECK_BUDGET_MS: '210000' }),
+ 210000
+ );
+ assert.strictEqual(
+ getTotalBudgetMs({ ECC_STOP_FORMAT_TYPECHECK_BUDGET_MS: '999999' }),
+ 270000
+ );
+ assert.strictEqual(
+ getTotalBudgetMs({ ECC_STOP_FORMAT_TYPECHECK_BUDGET_MS: 'invalid' }),
+ 270000
+ );
+})) passed++; else failed++;
+
+if (test('getPerBatchBudgetMs always returns a positive child timeout', () => {
+ assert.strictEqual(getPerBatchBudgetMs(210000, 2), 105000);
+ assert.strictEqual(getPerBatchBudgetMs(210000, 210001), 1);
+ assert.strictEqual(getPerBatchBudgetMs(210000, 0), 60000);
+})) passed++; else failed++;
+
+ if (test('matches forward-slash TypeScript paths against Windows edited paths', () => {
+ const candidates = new Set(['C:\\project\\src\\broken.ts', 'src\\broken.ts']);
+ assert.strictEqual(diagnosticMatchesFile('src/broken.ts(1,14): error TS2322', candidates), true);
+ assert.strictEqual(diagnosticMatchesFile('src/other.ts(1,14): error TS2322', candidates), false);
++
+ })) passed++; else failed++;
+
if (test('stop hook clears accumulator after processing duplicates', () => {
cleanAccumFile();
fs.writeFileSync(getAccumFile(), '/nonexistent/x.ts\n/nonexistent/x.ts\n/nonexistent/y.ts\n', 'utf8');