fix(ms-ai-architect): RX-KB1 strip stale plain-Verified pipe-tails (87) + audit-deteksjon [skip-docs]

De 87 referansefilene bar en plain-text `| Verified: <dato>`-hale på **Last updated:**-linjen
i 500B-header-vinduet — usynlig for den bold-only kontrakt-stacken (kb-headers.mjs / audit
RE_VERIFIED), og claimet en verifisering judgen aldri gjorde (samme poison-klasse som de 14
bold **Verified:** MCP Spor 1 fjernet). Uhåndtert springer den også dual-Verified-fellen: R7s
insertVerifiedFields ville stemplet en bold-verdi ved siden av den plain → to motstridende
provenance-claims per fil.

- ny driver strip-stale-verified-pipe.mjs: frosset 87-manifest (18 advisor + 45 eng + 8 gov +
  16 sec), pure verdi-bevarende strip (kun ` | Verified: …`-halen; **Last updated:**-dato
  byte-eksakt), hard per-fil-invariant (linjeantall uendret, body byte-identisk, dato bevart),
  idempotent, atomicWriteSync (RX-OPS2 recovery-kontrakt).
- audit-corpus-headers.mjs: ny plain-Verified-deteksjon (RE_PLAIN_VERIFIED + plainVerifiedPipe)
  — gjør M4-blindheten synlig så en stale plain-hale ikke kan gjenoppstå stille (non-advisor scope).
- 87 filer strippet; plain Verified i vinduet 0/389; live-audit plainVerifiedPipe 0.

Mekanisme: +15 tester (12 strip + 3 audit). Suite 875→890 exit 0. validate-plugin.sh 250/0.

Utsatt → RX-KB1b: footer-dato-avvik + label-whitelist (annen dialekt, flag-to-human).
This commit is contained in:
Kjell Tore Guttormsen 2026-07-16 20:04:52 +02:00
commit 712a143e58
91 changed files with 478 additions and 87 deletions

View file

@ -45,6 +45,14 @@ const RE_STATUS = /\*\*Status:\*\*\s*\S/i;
const RE_VERIFIED = /\*\*Verified:\*\*\s*([^|\n]*)/;
const RE_CLEAN_DATE = /^\d{4}-\d{2}(-\d{2})?$/;
// PLAIN (non-bold) `Verified:` in the header window — the RX-KB1 poison class: a `| Verified:
// <date>` tail on the **Last updated:** line, claiming a verification the judge never made and
// INVISIBLE to the bold-only RE_VERIFIED above (this blindness was M4). The `[^*]` guard keeps
// a bold `**Verified:**` from matching (its 'V' is preceded by '*'). Surfaced as a separate
// signal so a stale plain tail can never silently re-enter the corpus (strip-stale-verified-
// pipe.mjs removes the current 87; this detects any reappearance within the non-advisor scope).
const RE_PLAIN_VERIFIED = /(?:^|[^*])Verified:/m;
/** Audit a single file's content. Pure. */
function auditContent(content) {
const head = content.slice(0, HEADER_REGION_BYTES);
@ -74,6 +82,7 @@ function auditContent(content) {
lastUpdatedEnglish: RE_LAST_UPDATED.test(content),
dialect,
verified,
plainVerified: RE_PLAIN_VERIFIED.test(head),
};
}
@ -95,6 +104,7 @@ export function auditHeaders(paths, readFile = (p) => readFileSync(p, 'utf8')) {
verifiedNonDate: 0,
verifiedPipe: 0,
verifiedDuplicate: 0,
plainVerifiedPipe: 0,
missingTitle: 0,
missingStatus: 0,
missingEnglishLastUpdated: 0,
@ -120,6 +130,7 @@ export function auditHeaders(paths, readFile = (p) => readFileSync(p, 'utf8')) {
if (r.verified.pipe) aggregate.verifiedPipe++;
if (r.verified.duplicateWithinHeaderRegion) aggregate.verifiedDuplicate++;
}
if (r.plainVerified) aggregate.plainVerifiedPipe++;
if (!r.title) aggregate.missingTitle++;
if (!r.status) aggregate.missingStatus++;
if (!r.lastUpdatedEnglish) aggregate.missingEnglishLastUpdated++;
@ -172,6 +183,7 @@ function main(argv) {
console.log(`Corpus header audit — ${a.files} non-advisor reference files`);
console.log(` Verified header present: ${a.verifiedPresent} (date: ${a.verifiedDate}, stale non-date: ${a.verifiedNonDate})`);
console.log(` Verified pipe rows: ${a.verifiedPipe}, duplicates within 500B: ${a.verifiedDuplicate}`);
console.log(` Plain (non-bold) Verified tails (RX-KB1 poison class): ${a.plainVerifiedPipe}`);
console.log(` Missing English Last updated: ${a.missingEnglishLastUpdated}`);
console.log(` Missing Status: ${a.missingStatus}`);
console.log(` Missing title: ${a.missingTitle}`);

View file

@ -0,0 +1,239 @@
#!/usr/bin/env node
// strip-stale-verified-pipe.mjs — RX-KB1 (2026-07-16, FØR R7). Strip the stale plain
// `| Verified: <date>` pipe-tail from the **Last updated:** line on the 87 reference files
// that carry it inside the top-500-byte header window.
//
// WHY. The bold-label frontmatter contract (lib/kb-headers.mjs) and the audit
// (audit-corpus-headers.mjs RE_VERIFIED) recognise provenance ONLY as a bold **Verified:**
// field the judge writes. These 87 files instead carry a PLAIN-TEXT `| Verified: MCP <date>`
// tail appended to the Last updated line — invisible to that stack, and claiming a
// verification the judge never performed. It is the same poison class as the 14 bold
// `**Verified:** MCP` labels Spor 1 removed. Left in place it also springs the "dual-Verified
// trap": R7's insertVerifiedFields would stamp a bold value ALONGSIDE the surviving plain one,
// leaving two contradictory provenance claims per file. Stripping restores an honest
// never-verified state (the judge can later fill a bold field) and preserves the authored
// **Last updated:** date byte-exact, so no freshness fact is lost. Aligns with the contract;
// does not violate it (the plain tail is not a contract-recognised field).
//
// SCOPE. All 87 files that carry the tail (ground truth 2026-07-16): 18 advisor + 45
// engineering + 8 governance + 16 security. NB: this deliberately INCLUDES the 18 advisor
// files — the false-provenance claim is equally dishonest there, and this is a value-neutral
// honesty fix, not a header-contract mutation (advisor stays out of the audit's mutation/scan
// scope, a separate pre-existing design choice). The audit's plain-Verified DETECTION added in
// this same session stays within its existing non-advisor scope.
//
// The dual dialect in the corpus: 85× `| Verified: MCP <date>`, 2× `| Verified: <date>`.
// Verified is always the final tail on the line (nothing follows it), so the strip removes
// from the ` | Verified:` separator to end-of-line.
//
// INVARIANT (asserted per file BEFORE any write; throws → aborts the whole run, writes nothing):
// - exactly one `| Verified:` tail existed in the header and is gone
// - `**Last updated:**` survives with its date byte-exact
// - total line count unchanged (the line is edited in place, never removed)
// - the body (from the first `## `/`---`) is byte-identical
// Idempotent: a re-run finds no tail and is a no-op. Value-preserving: no date is derived,
// rewritten, or reconciled — only the unverifiable claim is dropped.
//
// Recovery contract: writes are crash-safe (atomicWriteSync tmp+rename — a reader sees the old
// file or the new one, never a partial); an interrupted run is recovered by re-running
// (idempotent, per-file, no cross-file state).
//
// Usage: node scripts/kb-update/strip-stale-verified-pipe.mjs [--dry]
import { readFileSync, existsSync, realpathSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { atomicWriteSync } from './lib/atomic-write.mjs';
const __dirname = dirname(fileURLToPath(import.meta.url));
const PLUGIN_ROOT = join(__dirname, '..', '..');
// Header region = lines above the first `## `/`---` (mirrors transform.mjs headerEndIndex /
// dedup-plain-header.mjs). Confines the edit to the header so a body "Verified:" is never hit.
function splitHeaderBody(content) {
const lines = content.split('\n');
let i = 0;
for (; i < lines.length; i++) {
if (/^##\s/.test(lines[i]) || /^---\s*$/.test(lines[i])) break;
}
return { header: lines.slice(0, i).join('\n'), body: lines.slice(i).join('\n') };
}
// The pipe-tail on the **Last updated:** line: from the ` | ` separator through end of line.
// Lazy capture of the Last updated prefix so group 1 stops at the separator; `[ \t]*` eats the
// space before the pipe so the result has no trailing whitespace.
const RE_TAIL = /^(\*\*Last updated:\*\*.*?)[ \t]*\|[ \t]*Verified:[^\n]*$/im;
/**
* Strip the stale plain Verified pipe-tail from the Last updated line. Pure no I/O.
* Operates only on the header region; the body is returned unchanged.
* @param {string} content
* @returns {string}
*/
export function stripVerifiedPipe(content) {
const { header, body } = splitHeaderBody(content);
const newHeader = header.replace(RE_TAIL, '$1');
if (newHeader === header) return content; // idempotent / no tail
return newHeader + (body ? '\n' + body : '');
}
// Assert the hard per-file invariant. Throws (aborting the run) on any breach.
function assertInvariant(rel, oldC, newC) {
const o = oldC.split('\n');
const n = newC.split('\n');
if (n.length !== o.length) {
throw new Error(`ABORT ${rel}: line count changed (was ${o.length}, now ${n.length}) — tail strip must edit in place`);
}
const oldH = splitHeaderBody(oldC);
const newH = splitHeaderBody(newC);
if (oldH.body !== newH.body) throw new Error(`ABORT ${rel}: body not byte-identical`);
if (/\bVerified:/.test(newH.header)) throw new Error(`ABORT ${rel}: a Verified label remains in the header`);
// The Last updated date must survive byte-exact.
const dateOf = (h) => (/\*\*Last updated:\*\*\s*([\d-]+)/i.exec(h) || [])[1] || null;
const oldDate = dateOf(oldH.header);
const newDate = dateOf(newH.header);
if (!newDate || newDate !== oldDate) {
throw new Error(`ABORT ${rel}: Last updated date not preserved (was ${JSON.stringify(oldDate)}, now ${JSON.stringify(newDate)})`);
}
// Only the tail was removed: newC must be oldC with exactly the matched tail excised.
if (!oldC.startsWith(newH.header)) {
// The header shrank only by the tail; everything else identical.
const reOld = oldH.header.replace(RE_TAIL, '$1');
if (reOld !== newH.header) throw new Error(`ABORT ${rel}: header changed beyond the Verified tail`);
}
}
function run({ dry }) {
const planned = [];
const skipped = [];
const missing = [];
for (const rel of MANIFEST) {
const abs = join(PLUGIN_ROOT, rel);
if (!existsSync(abs)) { missing.push(rel); continue; }
const old = readFileSync(abs, 'utf8');
const out = stripVerifiedPipe(old);
if (out === old) { skipped.push(rel); continue; } // idempotent: already stripped
assertInvariant(rel, old, out);
planned.push({ rel, out });
}
if (missing.length) {
console.error(`ABORT — ${missing.length} manifest target(s) not found (corpus drift):`);
missing.forEach((m) => console.error(' ' + m));
process.exit(1);
}
if (planned.length + skipped.length !== MANIFEST.length) {
throw new Error(`ABORT — accounted ${planned.length + skipped.length} ≠ manifest ${MANIFEST.length}`);
}
console.log(`Manifest: ${MANIFEST.length} | to strip: ${planned.length} | already stripped (skipped): ${skipped.length}`);
if (dry) {
console.log('\n(dry run — no writes)');
for (const p of planned) console.log(` ~ ${p.rel}`);
return;
}
for (const p of planned) atomicWriteSync(join(PLUGIN_ROOT, p.rel), p.out);
console.log(`\nWrote ${planned.length} files.`);
}
// Frozen manifest — the 87 reference files carrying a plain `| Verified: <date>` tail on the
// **Last updated:** line within the top-500-byte header window (ground truth 2026-07-16,
// re-measured at session start per the premiss-verification duty). Sorted, diff-stable.
export const MANIFEST = [
'skills/ms-ai-advisor/references/architecture/security.md',
'skills/ms-ai-advisor/references/copilot-extensibility/adaptive-cards-copilot-responses.md',
'skills/ms-ai-advisor/references/copilot-extensibility/copilot-api-rate-limiting-resilience.md',
'skills/ms-ai-advisor/references/copilot-extensibility/copilot-connectors-design-patterns.md',
'skills/ms-ai-advisor/references/copilot-extensibility/copilot-extensibility-security-patterns.md',
'skills/ms-ai-advisor/references/copilot-extensibility/copilot-orchestration-multi-agent.md',
'skills/ms-ai-advisor/references/copilot-extensibility/copilot-studio-localization-globalization.md',
'skills/ms-ai-advisor/references/copilot-extensibility/declarative-agents-fundamentals.md',
'skills/ms-ai-advisor/references/copilot-extensibility/declarative-agents-grounding-strategies.md',
'skills/ms-ai-advisor/references/copilot-extensibility/m365-copilot-plugins-ecosystem.md',
'skills/ms-ai-advisor/references/copilot-extensibility/mcp-protocol-copilot-studio.md',
'skills/ms-ai-advisor/references/copilot-extensibility/power-automate-copilot-integration.md',
'skills/ms-ai-advisor/references/copilot-extensibility/sharepoint-copilot-agents.md',
'skills/ms-ai-advisor/references/prompt-engineering/error-handling-and-fallback-prompting.md',
'skills/ms-ai-advisor/references/prompt-engineering/few-shot-learning-techniques.md',
'skills/ms-ai-advisor/references/prompt-engineering/multimodal-prompt-design.md',
'skills/ms-ai-advisor/references/prompt-engineering/real-time-reasoning-performance.md',
'skills/ms-ai-advisor/references/prompt-engineering/role-playing-and-persona-techniques.md',
'skills/ms-ai-engineering/references/agent-orchestration/agent-autonomy-and-control-governance.md',
'skills/ms-ai-engineering/references/agent-orchestration/agent-evaluation-testing-frameworks.md',
'skills/ms-ai-engineering/references/agent-orchestration/agent-memory-and-context-management.md',
'skills/ms-ai-engineering/references/agent-orchestration/agent-to-agent-a2a-protocol.md',
'skills/ms-ai-engineering/references/agent-orchestration/agent-to-agent-communication.md',
'skills/ms-ai-engineering/references/agent-orchestration/computer-using-agents-cua.md',
'skills/ms-ai-engineering/references/agent-orchestration/foundry-workflows-visual-orchestration.md',
'skills/ms-ai-engineering/references/agent-orchestration/multi-agent-orchestration-patterns.md',
'skills/ms-ai-engineering/references/agent-orchestration/semantic-kernel-agents-implementation.md',
'skills/ms-ai-engineering/references/agent-orchestration/tool-use-and-function-calling-patterns.md',
'skills/ms-ai-engineering/references/azure-ai-services/ai-services-api-best-practices.md',
'skills/ms-ai-engineering/references/azure-ai-services/ai-services-enterprise-architecture.md',
'skills/ms-ai-engineering/references/azure-ai-services/ai-services-monitoring-logging.md',
'skills/ms-ai-engineering/references/azure-ai-services/ai-services-networking-security.md',
'skills/ms-ai-engineering/references/azure-ai-services/ai-services-vs-foundry-tools-selection.md',
'skills/ms-ai-engineering/references/azure-ai-services/azure-ai-vision-image-analysis.md',
'skills/ms-ai-engineering/references/azure-ai-services/azure-ai-vision-ocr-processing.md',
'skills/ms-ai-engineering/references/azure-ai-services/content-understanding-multimodal-analysis.md',
'skills/ms-ai-engineering/references/azure-ai-services/document-intelligence-prebuilt-models.md',
'skills/ms-ai-engineering/references/azure-ai-services/language-services-custom-text-classification.md',
'skills/ms-ai-engineering/references/azure-ai-services/language-services-question-answering.md',
'skills/ms-ai-engineering/references/azure-ai-services/language-services-text-analytics.md',
'skills/ms-ai-engineering/references/azure-ai-services/speech-services-speech-to-text.md',
'skills/ms-ai-engineering/references/azure-ai-services/speech-services-text-to-speech.md',
'skills/ms-ai-engineering/references/azure-ai-services/translator-document-translation.md',
'skills/ms-ai-engineering/references/rag-architecture/agentic-rag-patterns.md',
'skills/ms-ai-engineering/references/rag-architecture/azure-ai-search-setup.md',
'skills/ms-ai-engineering/references/rag-architecture/citation-tracking.md',
'skills/ms-ai-engineering/references/rag-architecture/contextual-retrieval.md',
'skills/ms-ai-engineering/references/rag-architecture/graphrag-knowledge-graphs.md',
'skills/ms-ai-engineering/references/rag-architecture/hierarchical-rag-patterns.md',
'skills/ms-ai-engineering/references/rag-architecture/hybrid-search-configuration.md',
'skills/ms-ai-engineering/references/rag-architecture/metadata-management-filtering.md',
'skills/ms-ai-engineering/references/rag-architecture/multi-index-federation.md',
'skills/ms-ai-engineering/references/rag-architecture/multimodal-rag.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-caching-optimization.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-context-windows.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-core-patterns.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-document-preprocessing.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-hallucination-mitigation.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-iterative-refinement.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-query-understanding.md',
'skills/ms-ai-engineering/references/rag-architecture/rag-security-rbac.md',
'skills/ms-ai-engineering/references/rag-architecture/semantic-ranker-reranking.md',
'skills/ms-ai-engineering/references/rag-architecture/vector-indexing-techniques.md',
'skills/ms-ai-governance/references/monitoring-observability/custom-dashboards-ai-operations.md',
'skills/ms-ai-governance/references/monitoring-observability/model-performance-drift-detection.md',
'skills/ms-ai-governance/references/monitoring-observability/response-quality-metrics-rag.md',
'skills/ms-ai-governance/references/norwegian-public-sector-governance/copyright-ai-training-data-norway.md',
'skills/ms-ai-governance/references/responsible-ai/bias-detection-mitigation-strategies.md',
'skills/ms-ai-governance/references/responsible-ai/content-safety-implementation.md',
'skills/ms-ai-governance/references/responsible-ai/responsible-ai-policy-development.md',
'skills/ms-ai-governance/references/responsible-ai/stakeholder-communication-ai-decisions.md',
'skills/ms-ai-security/references/ai-security-engineering/ai-incident-response-procedures.md',
'skills/ms-ai-security/references/ai-security-engineering/ai-threat-modeling-stride.md',
'skills/ms-ai-security/references/ai-security-engineering/data-leakage-prevention-ai.md',
'skills/ms-ai-security/references/ai-security-engineering/defender-threat-protection-ai-services.md',
'skills/ms-ai-security/references/ai-security-engineering/entra-agent-id-zero-trust.md',
'skills/ms-ai-security/references/ai-security-engineering/output-validation-grounding-verification.md',
'skills/ms-ai-security/references/ai-security-engineering/owasp-llm-top10-azure-mitigations.md',
'skills/ms-ai-security/references/ai-security-engineering/security-copilot-integration.md',
'skills/ms-ai-security/references/cost-optimization/multi-model-strategy-costs.md',
'skills/ms-ai-security/references/cost-optimization/observability-cost-reduction.md',
'skills/ms-ai-security/references/performance-scalability/async-processing-patterns.md',
'skills/ms-ai-security/references/performance-scalability/connection-pooling-patterns.md',
'skills/ms-ai-security/references/performance-scalability/gpu-compute-sizing.md',
'skills/ms-ai-security/references/performance-scalability/model-distillation-performance.md',
'skills/ms-ai-security/references/performance-scalability/rate-limit-management.md',
'skills/ms-ai-security/references/performance-scalability/regional-deployment-latency.md',
];
const isMain = (() => {
try {
return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url));
} catch {
return false;
}
})();
if (isMain) run({ dry: process.argv.includes('--dry') });

View file

@ -1,6 +1,6 @@
# Security for Microsoft AI Solutions
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Category:** Solution Architecture & Advisory
**Status:** Established Practice

View file

@ -1,6 +1,6 @@
# Adaptive Cards for Rich Copilot Responses
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# API Rate Limiting and Resilience Patterns
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Copilot Connectors - Implementation Patterns
**Last updated:** 2026-04 | Verified: MCP 2026-04-10
**Last updated:** 2026-04
**Status:** GA (Synced Connectors) / Early Access Preview (Federated Connectors)
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Security Patterns for Copilot Extensions
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Multi-Agent Orchestration in Copilot
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Generally Available (GA)
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Localization and Globalization in Copilot
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Declarative Agents - Design and Implementation
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Grounding Strategies for Declarative Agents
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# M365 Copilot Plugins - Ecosystem and Distribution
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Model Context Protocol (MCP) in Copilot Studio
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Generally Available (GA)
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Power Automate and Copilot Studio Integration
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# SharePoint and OneDrive Copilot Agents
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Copilot Extensibility & Integration

View file

@ -1,6 +1,6 @@
# Error Handling and Fallback Prompting Strategies
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Prompt Engineering & LLM Optimization

View file

@ -1,6 +1,6 @@
# Few-Shot and Zero-Shot Learning Techniques
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Prompt Engineering & LLM Optimization

View file

@ -1,6 +1,6 @@
# Multimodal Prompt Design with Images and Text
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Prompt Engineering & LLM Optimization

View file

@ -1,6 +1,6 @@
# Real-Time Reasoning and Performance Optimization
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA (`gpt-realtime` og `gpt-realtime-1.5` er GA-modeller; «preview»-suffikset gjelder nå kun de eldre `gpt-4o-realtime-preview`-modellene)
**Category:** Prompt Engineering & LLM Optimization

View file

@ -1,6 +1,6 @@
# Role-Playing and Persona-Based Prompting
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Prompt Engineering & LLM Optimization

View file

@ -1,6 +1,6 @@
# Agent Autonomy and Control - Governance Framework
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Agent Evaluation and Testing Frameworks
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA (Azure AI Evaluation SDK), Preview (Agent-specific evaluators)
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Agent Memory and Context Management Strategies
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA (Managed Memory in Foundry Agent Service: Preview)
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Agent2Agent (A2A) Protocol — Åpen Standard for Agent-Interoperabilitet
**Last updated:** 2026-06-18 | Verified: 2026-06-18
**Last updated:** 2026-06-18
**Status:** Stabil (protokollspesifikasjon v1.0) / Preview (Microsofts A2A-SDK + Agent Framework A2A-pakker)
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Agent-to-Agent Communication Protocols
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Computer-Using Agents (CUA)
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Copilot Studio — GA (2026-05-07); Foundry Agent Service — Preview (sep 2025)
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Foundry Workflows — Visuell Multi-Agent Orkestrering
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Public Preview (announced MS Ignite november 2025)
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Multi-Agent Orchestration Patterns and Topologies
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Semantic Kernel and Microsoft Agent Framework - Implementation Patterns
**Last updated:** 2026-06-18 | Verified: 2026-06-18
**Last updated:** 2026-06-18
**Status:** GA — Microsoft Agent Framework 1.0 (3. apr 2026), orchestration patterns GA
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Tool Use and Function Calling - Advanced Patterns
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Agent Orchestration & Automation
**Type:** reference

View file

@ -1,6 +1,6 @@
# Azure AI Services - API Design and Best Practices
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,5 +1,5 @@
# Azure AI Services - Enterprise Architecture Patterns
**Last updated:** 2026-06-19 | Verified: MCP 2026-06
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Azure AI Services - Monitoring, Logging and Diagnostics
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Azure AI Services - Networking, Security and Private Endpoints
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Type:** reference
**Source:** https://learn.microsoft.com/security/benchmark/azure/baselines/cognitive-services-security-baseline

View file

@ -1,6 +1,6 @@
# Azure AI Services vs Foundry Tools - Platform Selection Guide
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Azure AI Vision - Image Analysis and Tagging
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA (Generally Available)
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Azure AI Vision - OCR and Document Processing
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA
**Type:** reference
**Source:** https://learn.microsoft.com/python/api/overview/azure/ai-vision-imageanalysis-readme

View file

@ -1,6 +1,6 @@
# Content Understanding - Multimodal Analysis and Video Intelligence
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Preview (GA for core features, Limited Access for face description)
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Document Intelligence - Prebuilt Models for Forms and Invoices
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Type:** reference
**Source:** https://learn.microsoft.com/azure/ai-services/document-intelligence/model-overview

View file

@ -1,6 +1,6 @@
# Language Services - Custom Text Classification and NER
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA — avvikles 31. mars 2029
**Type:** reference
**Source:** https://learn.microsoft.com/azure/ai-services/language-service/custom-text-classification/overview

View file

@ -1,6 +1,6 @@
# Language Services - Question Answering and Knowledge Mining
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA — avvikles 31. mars 2029
**Type:** reference
**Source:** https://learn.microsoft.com/azure/ai-services/language-service/question-answering/overview

View file

@ -1,6 +1,6 @@
# Language Services - Text Analytics for Sentiment and Key Phrases
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (deler avvikles 2029-03-31)
**Type:** reference
**Source:** https://learn.microsoft.com/azure/ai-services/language-service/personally-identifiable-information/overview

View file

@ -1,6 +1,6 @@
# Speech Services - Speech-to-Text and Real-time Transcription
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Speech Services - Text-to-Speech and Neural Voices
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Type:** reference
**Source:** https://learn.microsoft.com/azure/ai-services/speech-service/personal-voice-overview

View file

@ -1,6 +1,6 @@
# Translator Service - Document Translation and Multi-language Support
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (General Availability) + Preview features
**Category:** Azure AI Services (Foundry Tools)
**Type:** reference

View file

@ -1,6 +1,6 @@
# Agentic RAG Patterns — Agent-styrt retrieval
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Type:** reference
**Source:** https://learn.microsoft.com/azure/search/agentic-retrieval-overview
**Status:** GA (Semantic Kernel); Azure AI Search agentic retrieval **delvis GA via REST `2026-04-01`** (verifisert 2026-06-19) — GA-overflaten returnerer ekstraktiv grounding-data (`activity` + `references`), ikke syntetiserte svar, med GA-kildetypene `searchIndex`/`azureBlob`/`indexedOneLake`/`web`. **Answer synthesis, ikke-minimal reasoning effort (LLM query planning på low/medium) og multi-turn messages forblir preview (`2026-05-01-preview`).** Azure- og Foundry-portalen gir kun preview-tilgang til agentic retrieval

View file

@ -1,6 +1,6 @@
# Azure AI Search - Configuration and Deployment
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Citation Tracking and Source Attribution
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (classic RAG); agentic retrieval delvis GA via REST `2026-04-01` — grounding-overflaten (`references` + `activity`-log) er GA, mens LLM query planning (ikke-minimal reasoning effort) + answer synthesis + multi-turn messages forblir preview (`2026-05-01-preview`); portal/Foundry preview
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Contextual Retrieval — Kontekstuell berikelse av chunks
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA (custom skill pattern), Preview (agentic retrieval)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# GraphRAG - Knowledge Graphs and Relationship Extraction
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Preview
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Hierarchical RAG Patterns — Multi-nivå retrieval
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (index projections), Preview (agentic retrieval)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Hybrid Search - Full-Text and Vector Combined
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Metadata Management and Filtered Search
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Multi-Index Federation and Cross-Search
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (single-index), Not supported (native cross-index)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Multimodal RAG — Bilder, tabeller og dokumenter i RAG
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (Document Intelligence, Content Understanding), Preview (multimodal embeddings)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# RAG Caching and Performance Optimization
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# RAG Context Windows and Long-Context Models
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# RAG Core Patterns and Architecture
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Document Preprocessing and Pipeline Automation
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# RAG Hallucination Mitigation Strategies
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA (groundedness-deteksjon, RAG-mønstre) · Preview (groundedness correction/mitigating-feature, api-version 2024-09-15-preview)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Iterative RAG and Multi-Turn Refinement
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Query Understanding and Expansion
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# RAG Security - RBAC, Filtering, and Access Control
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** Preview (native ACL/RBAC), GA (security filters)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Semantic Ranker and Reranking Models
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (core), Preview (query rewrite, prerelease models)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,6 +1,6 @@
# Vector Indexing - Techniques and Configuration
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA (Hybrid search), Preview (Scalar quantization)
**Category:** RAG Architecture & Semantic Search
**Type:** reference

View file

@ -1,7 +1,7 @@
# Custom Dashboards for AI Operations
**Category:** Monitoring & Observability
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Brukes av:** Cosmo Skyberg, Microsoft AI Solution Architect
**Type:** reference
**Source:** https://learn.microsoft.com/azure/azure-monitor/visualize/workbooks-overview

View file

@ -1,6 +1,6 @@
# Model Performance Monitoring and Drift Detection
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Monitoring & Observability
**Type:** reference

View file

@ -1,6 +1,6 @@
# Response Quality Metrics and Evaluation for RAG Systems
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Monitoring & Observability
**Type:** reference

View file

@ -1,6 +1,6 @@
# Opphavsrett og AI-treningsdata i Norge
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** Under endring - norsk implementering av DSM-direktivet og AI Act pågår
**Category:** Norwegian Public Sector AI Governance
**Type:** reference

View file

@ -1,6 +1,6 @@
# Bias Detection and Mitigation - Practical Approaches
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Responsible AI & Governance
**Type:** reference

View file

@ -1,6 +1,6 @@
# Content Safety and Harm Mitigation - Azure Implementation
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Responsible AI & Governance
**Type:** reference

View file

@ -1,6 +1,6 @@
# Responsible AI Policy Development - Creating Organizational Standards
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Responsible AI & Governance
**Type:** reference

View file

@ -1,6 +1,6 @@
# Stakeholder Communication - Explaining AI Decisions to Non-Technical Audiences
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Responsible AI & Governance
**Type:** reference

View file

@ -1,6 +1,6 @@
# AI Incident Response and Breach Handling Procedures
**Last updated:** 2026-05 | Verified: MCP 2026-05
**Last updated:** 2026-05
**Status:** Established Practice
**Category:** AI Security Engineering
**Type:** reference

View file

@ -1,6 +1,6 @@
# AI Threat Modeling Using STRIDE Framework
**Last updated:** 2026-05 | Verified: MCP 2026-05
**Last updated:** 2026-05
**Status:** Established Practice
**Category:** AI Security Engineering
**Type:** reference

View file

@ -1,7 +1,7 @@
# Data Leakage Prevention in AI Contexts
**Category:** AI Security Engineering
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Målgruppe:** Enterprise AI architects og security teams
**Type:** reference
**Source:** https://learn.microsoft.com/security/benchmark/azure/mcsb-v2-artificial-intelligence-security

View file

@ -1,6 +1,6 @@
# Defender for Cloud — AI threat protection
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA (AI applications) · Preview (AI agents, fra 2026-02-02)
**Category:** AI Security Engineering — Threat Detection & Monitoring
**Type:** reference

View file

@ -1,7 +1,7 @@
# Microsoft Entra Agent ID — Zero Trust for AI-agentidentiteter
**Category:** AI Security Engineering
**Last updated:** 2026-06-19 | Verified: MCP 2026-06
**Last updated:** 2026-06-19
**Status:** Public Preview, utvidet etter Ignite 2025 (50+ nye/oppdaterte artikler i Entra Agent ID-portføljen; opt-out er midlertidig — vil bli obligatorisk for nye agenter) *(Verified MCP 2026-06)*
**Målgruppe:** Arkitekter som skal sikre AI-agenter med dedikerte identiteter og Zero Trust-prinsipper
**Type:** reference

View file

@ -1,6 +1,6 @@
# Output Validation, Grounding Verification, and Fact-Checking
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** GA
**Category:** AI Security Engineering
**Type:** reference

View file

@ -1,6 +1,6 @@
# OWASP LLM Top 10 (2025) — Azure-tiltak for LLM04/06/08/09
**Last updated:** 2026-06-24 | Verified: MCP 2026-06-24
**Last updated:** 2026-06-24
**Status:** Referanse (OWASP 2025 + Azure-tiltak)
**Category:** AI Security Engineering — Threat Modeling & Controls
**Type:** reference

View file

@ -1,7 +1,7 @@
# Microsoft Security Copilot — AI-drevet sikkerhetsoperasjonsplattform
**Category:** AI Security Engineering
**Last updated:** 2026-06-19 | Verified: MCP 2026-06
**Last updated:** 2026-06-19
**Målgruppe:** Sikkerhetsarkitekter og SOC-ledere som vurderer AI-assistert sikkerhetsoperasjon
**Type:** reference
**Source:** https://learn.microsoft.com/copilot/security/agents-overview

View file

@ -1,6 +1,6 @@
# Multi-Model Strategy: Cost-Performance Trade-offs
**Last updated:** 2026-06-19 | Verified: MCP 2026-06
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Cost Optimization & FinOps for AI
**Type:** reference

View file

@ -1,6 +1,6 @@
# Observability and Monitoring Cost Optimization
**Last updated:** 2026-06-19 | Verified: MCP 2026-06
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Cost Optimization & FinOps for AI
**Type:** reference

View file

@ -1,6 +1,6 @@
# Asynchronous Processing Patterns
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Performance & Scalability
**Type:** reference

View file

@ -1,6 +1,6 @@
# Connection Pooling Patterns
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Performance & Scalability
**Type:** reference

View file

@ -1,6 +1,6 @@
# GPU and Compute Sizing for AI
**Last updated:** 2026-06-24 | Verified: MCP 2026-06
**Last updated:** 2026-06-24
**Status:** GA
**Category:** Performance & Scalability
**Type:** reference

View file

@ -1,6 +1,6 @@
# Model Distillation for Performance
**Last updated:** 2026-04 | Verified: MCP 2026-04
**Last updated:** 2026-04
**Status:** GA
**Category:** Performance & Scalability
**Type:** reference

View file

@ -1,6 +1,6 @@
# Rate Limit Management
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Performance & Scalability
**Type:** reference

View file

@ -1,6 +1,6 @@
# Regional Deployment for Latency Reduction
**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19
**Last updated:** 2026-06-19
**Status:** GA
**Category:** Performance & Scalability
**Type:** reference

View file

@ -33,6 +33,13 @@ const V_PIPE =
'# T\n\n**Sist oppdatert:** 2026-06-17 | **Verified:** MCP 2026-06-17\n\n---\n\n' +
'## A\n\ntekst\n';
// PLAIN (non-bold) Verified pipe-tail on the **Last updated:** line — the 87-file RX-KB1
// shape. Invisible to the bold-only RE_VERIFIED (verified stays null), which is exactly the
// M4 blindness; the audit must surface it via a SEPARATE plainVerified signal.
const V_PLAIN_PIPE =
'# T\n\n**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19\n\n---\n\n' +
'## A\n\ntekst\n';
// Base-field gap: no **Status:** at all.
const NO_STATUS =
'# T\n\n**Category:** x\n**Last updated:** 2026-06\n\n---\n\n## A\n\ntekst\n';
@ -128,6 +135,28 @@ test('auditHeaders — conformant file raises no flags; aggregate counts add up
assert.equal(r.aggregate.missingTitle, 0);
});
test('auditHeaders — plain (non-bold) Verified pipe-tail is surfaced, though bold RE_VERIFIED is blind to it', () => {
const r = auditHeaders(['p.md'], reader({ 'p.md': V_PLAIN_PIPE }));
const f = r.files['p.md'];
assert.equal(f.verified, null, 'bold-only RE_VERIFIED does not see the plain tail (M4)');
assert.equal(f.plainVerified, true, 'the plain tail IS surfaced by the new signal');
assert.equal(r.aggregate.plainVerifiedPipe, 1);
});
test('auditHeaders — a bold **Verified:** is NOT counted as plainVerified', () => {
// both the header-bold and pipe-bold fixtures must leave plainVerified false
const r = auditHeaders(['a.md', 'd.md'], reader({ 'a.md': V_NONDATE, 'd.md': V_PIPE }));
assert.equal(r.files['a.md'].plainVerified, false);
assert.equal(r.files['d.md'].plainVerified, false);
assert.equal(r.aggregate.plainVerifiedPipe, 0);
});
test('auditHeaders — a clean file with no Verified at all has plainVerified false', () => {
const r = auditHeaders(['f.md'], reader({ 'f.md': CLEAN }));
assert.equal(r.files['f.md'].plainVerified, false);
assert.equal(r.aggregate.plainVerifiedPipe, 0);
});
test('auditHeaders — an unreadable file is reported, not thrown', () => {
const r = auditHeaders(['x.md'], () => { throw new Error('ENOENT'); });
assert.equal(r.files['x.md'].error !== undefined, true);

View file

@ -0,0 +1,111 @@
// tests/kb-update/test-strip-stale-verified-pipe.test.mjs
// TDD for RX-KB1 — strip the stale plain `| Verified: MCP <date>` pipe-tail from the
// **Last updated:** line across the 87 reference files that carry it in the top-500-byte
// header window. This is the same poison class as the 14 bold `**Verified:** MCP` labels
// Spor 1 already removed: a plain-text "Verified" claim the judge never made, invisible to
// the bold-only contract stack (kb-headers.mjs / audit RE_VERIFIED). "Strip" = remove ONLY
// the ` | Verified: …` tail, preserving `**Last updated:** <date>` byte-exact; the citation,
// the date, and the whole body stay untouched. Value-preserving, idempotent, one line edited
// in place (never removed).
//
// The two dialect variants in the real corpus (ground truth 2026-07-16):
// 85× `**Last updated:** <date> | Verified: MCP <date>`
// 2× `**Last updated:** <date> | Verified: <date>` (no "MCP")
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { stripVerifiedPipe, MANIFEST } from '../../scripts/kb-update/strip-stale-verified-pipe.mjs';
// A reference-shaped fixture: bold header with the plain Verified pipe-tail, then a body that
// itself mentions "Verified:" and even "| Verified:" in prose (must never be touched).
const FIXTURE = [
'# Azure AI Search — RAG Setup',
'**Type:** reference',
'**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19',
'**Category:** RAG',
'',
'---',
'',
'## Innhold',
'',
'A body line mentioning Verified: yesterday and a | Verified: pipe — must be left alone.',
'',
].join('\n');
// ── stripVerifiedPipe (pure) ─────────────────────────────────────────────────
test('stripVerifiedPipe: removes the `| Verified: MCP <date>` tail, keeps Last updated byte-exact', () => {
const out = stripVerifiedPipe(FIXTURE);
const header = out.split('\n---')[0];
assert.ok(header.includes('**Last updated:** 2026-06-19'), 'Last updated + date preserved');
assert.ok(!/Verified:/.test(header), 'no Verified label remains in the header');
assert.ok(!/\|\s*$/.test(header.split('\n')[2]), 'no dangling pipe/whitespace after strip');
assert.equal(header.split('\n')[2], '**Last updated:** 2026-06-19', 'exact stripped line');
});
test('stripVerifiedPipe: strips the non-MCP `| Verified: <date>` variant too', () => {
const nonMcp = FIXTURE.replace('| Verified: MCP 2026-06-19', '| Verified: 2026-06-18');
const out = stripVerifiedPipe(nonMcp);
const header = out.split('\n---')[0];
assert.equal(header.split('\n')[2], '**Last updated:** 2026-06-19', 'non-MCP tail stripped, date kept');
assert.ok(!/Verified:/.test(header), 'no Verified label remains');
});
test('stripVerifiedPipe: one line edited in place — total line count unchanged', () => {
const out = stripVerifiedPipe(FIXTURE);
assert.equal(out.split('\n').length, FIXTURE.split('\n').length, 'no line added or removed');
});
test('stripVerifiedPipe: body is byte-identical (only the header line changes)', () => {
const out = stripVerifiedPipe(FIXTURE);
const bodyOf = (c) => c.slice(c.indexOf('\n---'));
assert.equal(bodyOf(out), bodyOf(FIXTURE), 'body untouched');
});
test('stripVerifiedPipe: never touches a "Verified:" or "| Verified:" in the body', () => {
const out = stripVerifiedPipe(FIXTURE);
assert.ok(out.includes('mentioning Verified: yesterday and a | Verified: pipe'), 'body prose intact');
});
test('stripVerifiedPipe: idempotent — a second pass is a no-op', () => {
const once = stripVerifiedPipe(FIXTURE);
assert.equal(stripVerifiedPipe(once), once);
});
test('stripVerifiedPipe: no pipe-tail present → unchanged (clean Last updated)', () => {
const clean = FIXTURE.replace(' | Verified: MCP 2026-06-19', '');
assert.equal(stripVerifiedPipe(clean), clean);
});
test('stripVerifiedPipe: leaves the citation date byte-exact even if it differs from the Verified date', () => {
// Last updated 2026-06-24, Verified MCP 2026-06 (the drift the review flagged) — the strip
// keeps the authored Last updated date and simply drops the unverifiable Verified claim.
const drift = FIXTURE.replace('**Last updated:** 2026-06-19 | Verified: MCP 2026-06-19',
'**Last updated:** 2026-06-24 | Verified: MCP 2026-06');
const out = stripVerifiedPipe(drift);
assert.equal(out.split('\n')[2], '**Last updated:** 2026-06-24');
});
// ── MANIFEST (frozen ground truth 2026-07-16) ────────────────────────────────
test('MANIFEST: exactly the 87 plain-Verified files, no duplicates', () => {
assert.equal(MANIFEST.length, 87, 'frozen count');
assert.equal(new Set(MANIFEST).size, 87, 'no duplicates');
});
test('MANIFEST: per-skill breakdown 18/45/8/16 (advisor/engineering/governance/security)', () => {
const bySkill = (skill) => MANIFEST.filter((p) => p.startsWith(`skills/${skill}/`)).length;
assert.equal(bySkill('ms-ai-advisor'), 18);
assert.equal(bySkill('ms-ai-engineering'), 45);
assert.equal(bySkill('ms-ai-governance'), 8);
assert.equal(bySkill('ms-ai-security'), 16);
});
test('MANIFEST: every entry is a plugin-relative references .md path', () => {
for (const p of MANIFEST) {
assert.match(p, /^skills\/ms-ai-[a-z]+\/references\/.+\.md$/, `bad path: ${p}`);
}
});
test('MANIFEST: sorted (deterministic, diff-stable)', () => {
const sorted = [...MANIFEST].sort();
assert.deepEqual(MANIFEST, sorted, 'manifest must be sorted');
});