From 59932c41bb68ba37efbd37719aee8fb8534d7e12 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 26 May 2026 20:23:09 +0100 Subject: [PATCH] Fix Face artifact title link matching --- apps/worker/src/repo-face-artifact-links.ts | 12 +++++++----- scripts/smoke-repo-face-artifact-links.ts | 2 +- state/evidence.jsonl | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/worker/src/repo-face-artifact-links.ts b/apps/worker/src/repo-face-artifact-links.ts index d1b3a50..b44c8da 100644 --- a/apps/worker/src/repo-face-artifact-links.ts +++ b/apps/worker/src/repo-face-artifact-links.ts @@ -73,11 +73,13 @@ function findMentionedKnowledgebaseDocument( const normalizedContent = normalizeReferenceText(content); const markdownDocuments = documents .filter((document) => document.path.toLowerCase().endsWith(".md")) - .map((document) => ({ - document, - label: document.title?.trim() || basenameWithoutExtension(document.path), - })) - .filter((entry) => entry.label.length >= 10) + .flatMap((document) => + [...new Set([ + document.title?.trim(), + basenameWithoutExtension(document.path), + ].filter((label): label is string => Boolean(label && label.length >= 10)))] + .map((label) => ({ document, label })) + ) .sort((left, right) => right.label.length - left.label.length); return markdownDocuments.find((entry) => diff --git a/scripts/smoke-repo-face-artifact-links.ts b/scripts/smoke-repo-face-artifact-links.ts index a28d980..edc8f89 100644 --- a/scripts/smoke-repo-face-artifact-links.ts +++ b/scripts/smoke-repo-face-artifact-links.ts @@ -27,7 +27,7 @@ const documents: ArchivedSourceDocumentRecord[] = [ id: `AetheriaLore:${continuityPath}`, repoName: "AetheriaLore", path: continuityPath, - title: "Continuity Admissibility Finding", + title: continuityPath, content: "", normalizedContent: "", indexedAt: "2026-05-26T00:00:00.000Z", diff --git a/state/evidence.jsonl b/state/evidence.jsonl index b6aa4c7..3e4fc8d 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -362,3 +362,4 @@ {"ts":"2026-05-26T18:03:47Z","type":"verification","status":"ok","note":"Added repo-artifact reference rule for Face public speech: when context is not immediately visible in Discord and not easily contained, the Face must reply to the visible anchor, summarize the subject, or include a public site URL / repo:path reference. nibu/libby/bifrost dry-run passed; Nibu's SAY now cites AetheriaLore:Aetheria/Worldbuilding/Post-Elysium/Reference/Continuity Admissibility Finding.md before discussing helm continuity, and model-output inspection reported zero warnings."} {"ts":"2026-05-26T19:08:32Z","type":"verification","status":"ok","note":"Encoded Quartz/GameCult public URL rule for Face artifact references. AetheriaLore source paths under Aetheria/ should publish as https://aetheria.gamecult.org/, e.g. Continuity Admissibility Finding -> https://aetheria.gamecult.org/Worldbuilding/Post-Elysium/Reference/Continuity-Admissibility-Finding. Strict Nibu dry-run passed; parent Mind withheld SAY when the candidate line lacked the required artifact URL/reference, and model-output inspection reported zero warnings."} {"ts":"2026-05-26T19:14:30Z","type":"implementation","status":"ok","note":"Moved repo Face artifact URL resolution out of Face/Mind prompts and into deterministic worker posting. Face/Mind now only require enough artifact identity for followability; apps/worker/src/repo-face-artifact-links.ts resolves explicit repo:path refs and clear indexed markdown titles to knowledgebase URLs, currently AetheriaLore -> https://aetheria.gamecult.org/. Verified agents:repo-face-artifact-links:fixture and typecheck."} +{"ts":"2026-05-26T19:22:39Z","type":"verification","status":"ok","note":"Live archive check confirmed repo Face artifact link resolution against indexed AetheriaLore: 206 docs loaded, Continuity Admissibility Finding found, explicit AetheriaLore:path refs resolve inline to https://aetheria.gamecult.org/Worldbuilding/Post-Elysium/Reference/Continuity-Admissibility-Finding, and title-only mentions now append the same Reference URL after fixing the matcher to consider basename aliases when indexed titles are path-shaped. Verified artifact-links fixture and typecheck."}