'use strict'; const fs = require('fs'); const path = require('path'); const { execFileSync } = require('child_process'); const root = path.resolve(__dirname, '..'); const forbiddenPath = /(^|[\\/])(outputs?|messages|sessions?|logs?|knowledge-base[\\/]property-data)([\\/]|$)|(^|[\\/])(?:\.env\.local|.*\.db(?:-(?:shm|wal))?|.*\.log)$/i; const tracked = execFileSync('git', ['ls-files'], { cwd: root, encoding: 'utf8' }).split(/\r?\n/).filter(Boolean); const issues = tracked.filter(rel => forbiddenPath.test(rel)); if (issues.length) { console.error(issues.map(rel => `forbidden tracked path: ${rel}`).join('\n')); process.exit(1); } console.log(`[ok] reusable boundary is clean (${tracked.length} tracked files checked)`);