init project

This commit is contained in:
root
2026-06-25 19:06:59 -04:00
parent c5dfee6efb
commit 5d017f533a
349 changed files with 31330 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { readFile } from 'node:fs/promises';
import path from 'node:path';
import { fail, pass, repositoryRoot, walk } from './lib.mjs';
const sourceFiles = await walk(path.join(repositoryRoot, 'src'), (file) =>
/\.(?:ts|tsx|js|jsx|css)$/.test(file),
);
const errors = [];
const prohibited = [
{ label: 'placeholder domain', pattern: /example\.(?:com|org|net)|placeholder\.(?:com|test)/i },
{ label: 'simulated submission', pattern: /simulate(?:d|Submission)|fakeSubmit/i },
{ label: 'research-only state backdoor', pattern: /[?&](?:state|scenario|fixture)=/i },
{ label: 'prototype research logger', pattern: /researchLog|prototypeLog/i },
];
for (const file of sourceFiles) {
const text = await readFile(file, 'utf8');
for (const rule of prohibited) {
if (rule.pattern.test(text))
errors.push(`${path.relative(repositoryRoot, file)} contains ${rule.label}.`);
}
}
if (errors.length > 0) fail(errors);
else
pass(
'Runtime source contains no placeholder destination, simulated submission, ' +
'or research-only backdoor.',
);