fix(ms-ai-architect): Enhet 3b — dedup dual-**Dato:** i 5 mlops-genaiops-filer (Created-relabel/drop, git-verifisert) [skip-docs]

Løser dual-header der filer bærer BÅDE **Dato:** (opprettelse) OG **Last updated:**
(endring). Ground truth 2026-07-16 + git first-commit-map (2026-04-08 for alle 5):

- 4 distinkte (**Dato:** 2026-02-04, FØR git first-commit → ekte opprettelsesdato):
  relabel **Dato:** → **Created:**, verdi byte-bevart (norsk→engelsk label-rename).
- 1 identisk (mlops-security-access-control: **Dato:**=**Last updated:**=2026-06-19,
  ETTER git first-commit → metadata-artefakt, ikke ekte opprettelsesdato): drop redundant
  **Dato:**. Relabel ville påstått falsk opprettelsesdato — drop er sannferdig.

Ny ren primitiv dropRedundantBoldField (kaster uten identisk-verdi bevis-felt),
gjenbrukt relabelHeaderDialect m/ CREATED_MAP. Manifest-drevet dedup-dato.mjs med
hard per-fil-invariant FØR skriv (relabel: 1 linje, kun label-token; drop: net -1,
Last updated bevart), atomicWriteSync, idempotent. Ingen validator håndhever lukket
feltliste → **Created:** er additiv/konform.

+15 tester (dropRedundantBoldField, CREATED_MAP-relabel, applyOp, manifest, 2 corpus-
guards) + oppdatert stale Enhet-2 carve-out-guard til post-3b-sannhet. Suite 910/910
exit 0. validate-plugin 250 PASS/0 FAIL. Datoløse dual-**Dato:**-filer 5→0.
This commit is contained in:
Kjell Tore Guttormsen 2026-07-16 20:38:24 +02:00
commit f094e242d1
9 changed files with 394 additions and 10 deletions

View file

@ -12,8 +12,10 @@
//
// DELIBERATELY OUT of Enhet 2 (carved out after ground-truth audit 2026-07-06):
// - 5 DUAL-LABEL files that carry BOTH **Dato:** (creation date) AND **Last updated:** (modified
// date) with distinct values. Relabeling would duplicate the label / destroy provenance; the
// collision-guard aborts on them by design. Deferred to a dedup unit (Enhet 3-adjacent).
// date). Relabeling would duplicate the label / destroy provenance; the collision-guard aborts
// on them by design. RESOLVED by Enhet 3b (dedup-dato.mjs, 2026-07-16): **Dato:**→**Created:**
// on the 4 with a distinct creation date, dropped on the 1 whose dates were identical — so no
// header **Dato:** remains, and Enhet 2's relabel is now a clean no-op on them.
// - 8 body/list/placeholder occurrences (advisor YYYY-MM-DD templates, ros-report [YYYY-MM-DD],
// 3 body list-items incl. [Dato]) — excluded by header-scoping + isRealDateValue.
@ -140,12 +142,17 @@ test('MANIFEST ↔ disk: committed state — English label present, no header **
}
});
test('carve-out ↔ disk: the 5 dual-label files still carry BOTH labels (untouched by Enhet 2)', () => {
test('carve-out ↔ disk: Enhet 3b resolved the 5 dual-label files — no header **Dato:**, Enhet 2 relabel is a no-op', () => {
for (const rel of DUAL_LABEL_FILES) {
const abs = join(PLUGIN_ROOT, rel);
assert.ok(existsSync(abs), `missing: ${rel}`);
const header = headerBlock(readFileSync(abs, 'utf8'));
assert.ok(header.some((l) => l.includes('**Dato:**')), `dual file lost its **Dato:** — ${rel}`);
const content = readFileSync(abs, 'utf8');
const header = headerBlock(content);
// Enhet 3b relabeled **Dato:**→**Created:** (4 distinct) or dropped it (1 identical): none remain.
assert.ok(!header.some((l) => l.includes('**Dato:**')), `header **Dato:** should be resolved by Enhet 3b — ${rel}`);
assert.ok(header.some((l) => l.startsWith('**Last updated:**')), `dual file lost **Last updated:** — ${rel}`);
// The durable Enhet-2 invariant: its Dato→Last-updated relabel never owned these (now a clean no-op).
const { applied } = relabelHeaderDialect(content, DATO_LABEL_MAP);
assert.equal(applied.length, 0, `Enhet 2 relabel must be a no-op on the carved-out ${rel}`);
}
});