ms-ai-architect/tests/kb-update
Kjell Tore Guttormsen 0390cc10ca feat(ms-ai-architect): C3.1 — keychain + Learn Platform API-klient (TDD) [skip-docs]
C3 kurs-deteksjon, fase C3.1 (spec docs/c3-course-detection-plan.md §6/§7).
Claude-frie, fil-frie infrastruktur-lag for kurs-detektoren (C3.4):

- lib/keychain.mjs: readSecret() leser én Keychain-item via `security`-CLI,
  fail-soft (manglende item / ikke-macOS → null). execImpl-DI for test.
- lib/learn-api.mjs: getToken (Entra client-credentials), paginate (async-gen,
  følger nextLink), buildApiUrl (pinner api-version), buildUpdatedAtGt (kaster
  på dato-only, canon Z — gotcha #1). Robusthetskontrakt §6: response.ok-sjekk
  (fetch kaster ikke på 4xx/5xx), AbortSignal.timeout, 429/5xx-retry som
  respekterer Retry-After, 4xx≠429 ikke-retry, fail-closed. fetchImpl/sleep-DI.

Tester (24, alle grønne): test-learn-api (token-body, buildUpdatedAtGt,
nextLink-paginering, produkt-param, alle robusthets-asserts), test-keychain,
test-courses-invariant (Claude-fri + skriver-ingen-filer). Live-probe (efemer)
grønn mot ekte Platform API m/ ekte creds: token + full-enum + inkrementell.

Intern infrastruktur (ingen brukervendt kommando/hook/atferd endret ennå —
surfacing + docs lander i C3.6). kb-update 213→237 · validate 239 · null regresjon.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 12:59:16 +02:00
..
test-atomic-write.test.mjs feat(ms-ai-architect): add lib/atomic-write for crash-safe state files [skip-docs] 2026-05-05 10:32:13 +02:00
test-authority.test.mjs feat(ms-ai-architect): Sesjon 6 - lag 3 verifisering-INN (authority-binding) 2026-06-19 22:58:10 +02:00
test-backup-restore.test.mjs feat(ms-ai-architect): C2.3 onboarding skriver scheduled_detection cadence+enabled via gated CLI (TDD) [skip-docs] 2026-06-22 14:53:03 +02:00
test-courses-invariant.test.mjs feat(ms-ai-architect): C3.1 — keychain + Learn Platform API-klient (TDD) [skip-docs] 2026-06-23 12:59:16 +02:00
test-cross-platform-paths.test.mjs feat(ms-ai-architect): add lib/cross-platform-paths for cache/log/state/backup dirs [skip-docs] 2026-05-05 10:30:31 +02:00
test-decisions-actions.test.mjs feat(ms-ai-architect): Sesjon 18 — B3 apply-path (sanitize+retire), merge→S19 [skip-docs] 2026-06-20 20:32:51 +02:00
test-decisions-io.test.mjs feat(ms-ai-architect): Sesjon 3 - decision-ledger (lag 2) + discovery-dedup 2026-06-19 21:48:03 +02:00
test-detection-schedule.test.mjs feat(ms-ai-architect): C2.3 onboarding skriver scheduled_detection cadence+enabled via gated CLI (TDD) [skip-docs] 2026-06-22 14:53:03 +02:00
test-discover-invariant.test.mjs feat(ms-ai-architect): Sesjon 3 - decision-ledger (lag 2) + discovery-dedup 2026-06-19 21:48:03 +02:00
test-kb-headers.test.mjs feat(ms-ai-architect): Sesjon 2 - registry-skjema (authority_source + course reservert) 2026-06-19 21:05:54 +02:00
test-keychain.test.mjs feat(ms-ai-architect): C3.1 — keychain + Learn Platform API-klient (TDD) [skip-docs] 2026-06-23 12:59:16 +02:00
test-launchd-plist.test.mjs feat(ms-ai-architect): Sesjon 24 — C1 Tier 2 lokal launchd-scheduler (deteksjon-only, ToS-trygt) [skip-docs] 2026-06-21 19:59:18 +02:00
test-learn-api.test.mjs feat(ms-ai-architect): C3.1 — keychain + Learn Platform API-klient (TDD) [skip-docs] 2026-06-23 12:59:16 +02:00
test-log-rotate.test.mjs feat(ms-ai-architect): add lib/log-rotate for bounded log disk use [skip-docs] 2026-05-05 10:54:50 +02:00
test-priority-unverified.test.mjs feat(ms-ai-architect): Sesjon 5 carry-forward B — datoløse filer → unverified-tier 2026-06-19 22:31:25 +02:00
test-registry-migrate.test.mjs feat(ms-ai-architect): Sesjon 2 - ai-foundry->foundry registry-remap 2026-06-19 21:09:00 +02:00
test-taxonomy.test.mjs feat(ms-ai-architect): Sesjon 19 — B3 merge-apply (cross-skill + taksonomi-persist) [skip-docs] 2026-06-20 20:54:13 +02:00
test-transform.test.mjs feat(ms-ai-architect): Sesjon 5 - transformasjonslag (lag 4, doc→KB-fil) 2026-06-19 22:31:26 +02:00
test-user-data.test.mjs feat(ms-ai-architect): C2.2 valgfritt fritekst-felt free-context.md i onboarding (TDD) [skip-docs] 2026-06-22 14:16:00 +02:00
test-verify-out.test.mjs feat(ms-ai-architect): Sesjon 4 - verifisering-ut (lag 5) + adversarial regresjonstest 2026-06-19 22:00:36 +02:00