Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

test: stop storing the names the hygiene check screens for

rpone1d2e24a68151
diff --git a/.gitignore b/.gitignore
index 4b3361ea..0b5432e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,10 @@ coverage/
*.temp
*.lock.editing
+# The forbidden-term list for the repository hygiene check. Kept out of the repository so
+# that the names it screens for are never published alongside the check itself.
+tools/forbidden-terms.local
+
# Ignore local editor state while distributing repository skill-discovery links.
.claude/*
!.claude/skills
diff --git a/tools/repository-hygiene.test.mjs b/tools/repository-hygiene.test.mjs
index 4f0294db..77a51da5 100644
--- a/tools/repository-hygiene.test.mjs
+++ b/tools/repository-hygiene.test.mjs
@@ -53,35 +53,55 @@ function lineOf(source, offset) {
return source.slice(0, offset).split("\n").length;
}
-test("source distribution outside the mounted documentation contains no customer or product brand residue", async () => {
- const brand = new RegExp(
- String.raw`\b\x65\x63\x68\x6f(?:[\s_-]+)\x70\x72\x6f\b|\b\x65\x63\x68\x6f\x70\x72\x6f\b|\bwith[-_]\x65\x63\x68\x6f\b|\b\x61\x72\x65\x75\x6d\b|\b\x6c\x6f\x6f\x6b\x73\x6d\x61\x78\b`,
- "giu",
- );
- const failures = [];
- for (const entry of await repositoryEntries()) {
- if (isMountedDocumentationPath(entry.path)) continue;
- if (brand.test(entry.path)) failures.push(`${entry.path} (path)`);
- brand.lastIndex = 0;
- if (!entry.isFile || !textExtensions.has(extname(entry.path))) continue;
- const source = await readFile(entry.child, "utf8");
- for (const match of source.matchAll(brand)) failures.push(`${entry.path}:${lineOf(source, match.index)}`);
+/**
+ * Customer names and retired internal identities are deliberately NOT written here. A check
+ * that spells out the names it exists to remove publishes the exact list a reader of this
+ * repository should never obtain, and escaping the characters only defeats grep, not a
+ * reader. Supply the list from outside the repository instead: NARRATAGE_FORBIDDEN_TERMS,
+ * comma or newline separated, or an untracked tools/forbidden-terms.local.
+ *
+ * With neither configured the check reports itself unconfigured and passes, so a fork or an
+ * outside contributor is never blocked by a list they cannot see. Whoever prepares a release
+ * is responsible for configuring it.
+ */
+function splitTerms(raw) {
+ return raw.split(/[,\n]/u).map((term) => term.trim()).filter(Boolean);
+}
+
+async function forbiddenTerms() {
+ const configured = process.env.NARRATAGE_FORBIDDEN_TERMS;
+ if (configured !== undefined) return splitTerms(configured);
+ try {
+ return splitTerms(await readFile(new URL("./forbidden-terms.local", import.meta.url), "utf8"));
+ } catch {
+ return [];
}
- assert.deepEqual(failures, [], `brand residue found:\n${failures.join("\n")}`);
-});
+}
+
+function forbiddenPattern(terms) {
+ const alternatives = terms.map((term) =>
+ term.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&").replace(/\s+/gu, "[\\s_-]+"));
+ return new RegExp(String.raw`\b(?:${alternatives.join("|")})\b`, "giu");
+}
-test("source distribution outside the mounted documentation contains no retired project identities", async () => {
- const retired = new RegExp(
- String.raw`\b\x74\x77\x69\x6e\x69\x74\b|\b\x6d\x65\x67\x6e\x65\x74\x61\b`,
- "giu",
- );
+test("source distribution outside the mounted documentation contains no forbidden terms", async (t) => {
+ const terms = await forbiddenTerms();
+ if (!terms.length) {
+ t.diagnostic("unconfigured: set NARRATAGE_FORBIDDEN_TERMS or add tools/forbidden-terms.local");
+ return;
+ }
+ const pattern = forbiddenPattern(terms);
const failures = [];
- for (const entry of await repositoryTextEntries()) {
+ for (const entry of await repositoryEntries()) {
if (isMountedDocumentationPath(entry.path)) continue;
+ pattern.lastIndex = 0;
+ if (pattern.test(entry.path)) failures.push(`${entry.path} (path)`);
+ if (!entry.isFile || !textExtensions.has(extname(entry.path))) continue;
const source = await readFile(entry.child, "utf8");
- for (const match of source.matchAll(retired)) failures.push(`${entry.path}:${lineOf(source, match.index)}`);
+ pattern.lastIndex = 0;
+ for (const match of source.matchAll(pattern)) failures.push(`${entry.path}:${lineOf(source, match.index)}`);
}
- assert.deepEqual(failures, [], `retired internal identity found:\n${failures.join("\n")}`);
+ assert.deepEqual(failures, [], `forbidden term found:\n${failures.join("\n")}`);
});
test("public repository contains no workstation paths or high-confidence secret bytes", async () => {