feat(ms-ai-architect): C2.2 valgfritt fritekst-felt free-context.md i onboarding (TDD) [skip-docs]

Spor C / C2.2 (#3, akseptanse K3): fanger et fritt prosa-felt i onboarding og
overflater det (kappet) ambient i hver sesjon.

- lib/user-data.mjs: FREE_CONTEXT_FILE (utenfor ORG_FILES — valgfri, teller ikke
  mot fullføring), collapseProse() surfacer fri kontekst som ÉTT felt uansett
  markdown-struktur (ingen stille drop), capValue() ekstrahert (DRY).
- session-start-context.mjs: leser free-context.md valgfritt (ingen count++).
- onboarding-agent.md: ny Phase 6 (valgfri); onboard.md: prosess/Task/status.
- 11 agenter: uniform 6. bullet (grep 11/11).
- Tester FØR kode: user-data 25/25 (+9), test-hooks 11/11 (+1 K3-ambient).

Gates: validate 239/0/0 · kb-update 200 · kb-eval 100 · kb-integrity 192/192
(220 baseline-warns) · discovery 13/13 · gitleaks 3 pre-eksisterende.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-06-22 14:16:00 +02:00
commit 8ff73b7fe3
18 changed files with 225 additions and 11 deletions

View file

@ -14,6 +14,7 @@ import {
import {
resolveOrgDir,
ORG_FILES,
FREE_CONTEXT_FILE,
buildOrgSummary,
} from '../../scripts/kb-update/lib/user-data.mjs';
@ -130,6 +131,16 @@ function readOrgFiles(dir) {
}
}
}
// Optional free-prose context (C2.2): read it for the ambient summary, but
// do NOT count it — it is optional and must not affect onboarding completeness.
const fp = join(dir, FREE_CONTEXT_FILE);
if (existsSync(fp)) {
try {
files[FREE_CONTEXT_FILE] = readFileSync(fp, 'utf8');
} catch {
// Unreadable — skip; advisory only
}
}
}
return { files, count };
}