mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 15:47:43 +01:00
bitbaum/hamstercheek was renamed to bitbaum/zeitkastli because its framing read as a tool for concealing assets. This repo is public and carried the same wording in test fixtures and code comments: "A box you hide outside." "HamsterCheek is a weatherproof box for valuables." "HamsterCheek allows people to hide physical items in various locations." "a hiding box" Fixture text only — no behaviour changes. Each replacement preserves what its test was actually checking: - "a hiding box" -> "a time capsule" still clears the 10-char brief floor - the one-sentence brief is still under KICKOFF_THIN_DESCRIPTION, so it is still flagged as thin - the hero-note fixture is still under 80 chars, so it still passes through publicHeroNote unchanged - site-cd.ts used "Hamster Cheek" to test slugifying a TWO-WORD display name; "Time Capsule" -> "time-capsule" keeps that exact property The comment on KICKOFF_THIN_DESCRIPTION records that the project was called HamsterCheek when the incident it describes happened, so renaming the fixtures does not quietly falsify the history they document. Verified: 181/181 unit test files pass, tsc --noEmit clean, prettier clean. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
64 lines
2.3 KiB
TypeScript
64 lines
2.3 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import {
|
|
answer,
|
|
cleanDescription,
|
|
isPublicTestArtifact,
|
|
publicHeroNote,
|
|
summarizeDescription,
|
|
} from "../../src/lib/project-display";
|
|
|
|
assert.equal(cleanDescription("Local repository imported from loki-ui"), null);
|
|
assert.equal(
|
|
cleanDescription("A weatherproof capsule you leave somewhere."),
|
|
"A weatherproof capsule you leave somewhere.",
|
|
);
|
|
|
|
assert.equal(isPublicTestArtifact("smoke-1783188931860-gh"), true);
|
|
assert.equal(isPublicTestArtifact("orangecat"), false);
|
|
|
|
const dumpAfterPitch =
|
|
"Life OS + AI agent fleet command center. MUTUAL DOGFOOD WITH ORANGECAT: KNOWN BUG — v1 entity-create from bearer-token callers hits RLS 42501.";
|
|
const pitch = publicHeroNote(dumpAfterPitch);
|
|
assert.ok(pitch);
|
|
assert.ok(!/known bug|mutual dogfood|42501/i.test(pitch), pitch);
|
|
|
|
const dumpFirst =
|
|
"KNOWN BUG — v1 entity-create hits RLS 42501 and the ORANGECAT_WEBHOOK_SECRET is unset.";
|
|
assert.equal(publicHeroNote(dumpFirst), null, "a dump that starts as a dump stays hidden");
|
|
|
|
const short = "Zeitkastli is a weatherproof capsule you leave somewhere.";
|
|
assert.equal(publicHeroNote(short), short);
|
|
|
|
const essay =
|
|
"Prime tower is a project generated by Loki, a command center for AI agent fleets, using Next.js, Tailwind CSS, and TypeScript. Extra sentences should not reach the hero.";
|
|
const summarized = publicHeroNote(essay);
|
|
assert.ok(summarized);
|
|
assert.ok(summarized!.length <= 80, summarized);
|
|
assert.equal(summarized, summarizeDescription(essay, 72));
|
|
|
|
// A phone report from 2026-08-18: "Suggested next (profile): Keep
|
|
// projects/<name>.md accu…" — an enrichment template's own placeholder,
|
|
// leaked verbatim as if it were a real next step.
|
|
assert.equal(
|
|
answer("Keep projects/<name>.md accurate and current."),
|
|
null,
|
|
"an unsubstituted <name> placeholder is not a real answer",
|
|
);
|
|
assert.equal(
|
|
answer("Wire up the <repo> CI badge"),
|
|
null,
|
|
"any bare <word> placeholder, not just <name>",
|
|
);
|
|
assert.equal(
|
|
answer("Ship the parser rewrite for datacat."),
|
|
"Ship the parser rewrite for datacat.",
|
|
"real prose with no placeholder passes through unchanged",
|
|
);
|
|
assert.equal(
|
|
answer("Support generics like List<T> in the parser"),
|
|
"Support generics like List<T> in the parser",
|
|
"a real generic-type mention is not mistaken for a placeholder (no bare <word>)",
|
|
);
|
|
|
|
console.log("✓ project-display tests passed");
|