From 78dcc6a16f85ebb97ed0f97317119541bfeaa73a Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Tue, 5 May 2026 12:03:45 +0200 Subject: [PATCH] =?UTF-8?q?feat(ms-ai-architect):=20v1.12.0=20manuell=20KB?= =?UTF-8?q?-refresh=20=E2=80=94=20fjern=20launchd/cron-arkitektur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ToS-vurdering konkluderte med at autonom cron-kjøring er unødvendig kompleks for en solo-fork-and-own-plugin. Apply-fasen krever LLM-resonnering uansett, så manuell trigger fra en aktiv Claude Code-sesjon er enklere og holder pluginen klart innenfor Anthropic Consumer Terms paragraf 3 (automated access only via API key or where explicitly permitted — Claude Code CLI er eksemptert som offisielt verktøy). Lagt til: - commands/kb-update.md — ny /architect:kb-update slash-kommando som driver poll, endringsrapport, microsoft_docs_fetch-update og commit fra sesjonen. Argumenter: --skip-discover, --priorities, --dry-run, --single-commit - Catalog-entry i playground HTML for kb-update (categori: tool, 4 input-felt) Slettet (Wave 3-5 reversert, ~1500 linjer + 7 testmoduler): - scripts/install-kb-cron.mjs (cross-OS scheduler-installer) - scripts/kb-update/weekly-kb-cron.mjs (cron-orkestrator med pre-flight, lock, backup, claude -p subprocess, post-run verify, rollback) - scripts/kb-update/templates/ (4 scheduler-templates: launchd plist, systemd service+timer, Windows ps1 + README) - scripts/kb-update/lib/auth-mode.mjs (cron-spesifikk auth validation) - scripts/kb-update/lib/lock-file.mjs (PID+mtime stale-detection) - scripts/kb-update/lib/cost-estimat.mjs (pre-flight budget-cap) - 7 testmoduler under tests/kb-update/ for slettet kode - tests/test-kb-update.sh (Bash-3.2-shim, erstattet av direkte node --test) Beholdt (utility-laget fortsatt brukbart): - run-weekly-update.mjs, report-changes.mjs, build-registry.mjs, discover-new-urls.mjs (KB change-detection-pipelinen) - lib/atomic-write, lib/backup, lib/cross-platform-paths, lib/log-rotate - 4 testmoduler (42/42 tester PASS) Endret: - hooks/scripts/session-start-context.mjs: fjern kb-update-status.json-overvaaking - tests/run-e2e.sh --kb-update kaller node --test direkte i stedet for shim - README.md, CLAUDE.md: KB-vedlikehold-seksjon rewriter for manuell modell - plugin.json: 1.11.0 -> 1.12.0 - Rot README + CLAUDE.md: ms-ai-architect-versjon bumpet Schedulering er bevisst utenfor scope og overlatt til brukeren — eventuelle forks som vil ha periodisk varsling kan sette opp egen cron / launchd / GitHub Actions som kjører rapport-fasen og varsler om aa kjore /architect:kb-update i CC-sesjon. Verifisering: - bash tests/validate-plugin.sh: 219 PASS, 0 FAIL - bash tests/run-e2e.sh --kb-update: 42/42 inner + suite PASS - bash tests/run-e2e.sh --playground: 271/271 PASS (statisk + parsers) Co-Authored-By: Claude Opus 4.7 --- .claude-plugin/plugin.json | 2 +- CHANGELOG.md | 35 ++ CLAUDE.md | 27 +- README.md | 47 +- commands/kb-update.md | 119 ++++ hooks/scripts/session-start-context.mjs | 20 - playground/ms-ai-architect-playground.html | 25 +- scripts/install-kb-cron.mjs | 501 ---------------- scripts/kb-update/lib/auth-mode.mjs | 99 ---- scripts/kb-update/lib/cost-estimat.mjs | 36 -- scripts/kb-update/lib/lock-file.mjs | 166 ------ scripts/kb-update/templates/README.md | 62 -- ...aitochitta.ms-ai-architect.kb-update.plist | 55 -- .../templates/ms-ai-architect-kb-update.ps1 | 48 -- .../ms-ai-architect-kb-update.service | 19 - .../templates/ms-ai-architect-kb-update.timer | 13 - scripts/kb-update/weekly-kb-cron.mjs | 559 ------------------ tests/kb-update/test-auth-mode.test.mjs | 181 ------ tests/kb-update/test-cost-estimat.test.mjs | 82 --- tests/kb-update/test-install-cron.test.mjs | 207 ------- tests/kb-update/test-lock-file.test.mjs | 192 ------ .../test-session-start-status.test.mjs | 172 ------ .../test-template-generation.test.mjs | 98 --- .../test-weekly-kb-cron-flags.test.mjs | 126 ---- tests/run-e2e.sh | 9 +- tests/test-kb-update.sh | 44 -- tests/test-playground-v3.sh | 6 +- 27 files changed, 240 insertions(+), 2710 deletions(-) create mode 100644 commands/kb-update.md delete mode 100755 scripts/install-kb-cron.mjs delete mode 100644 scripts/kb-update/lib/auth-mode.mjs delete mode 100644 scripts/kb-update/lib/cost-estimat.mjs delete mode 100644 scripts/kb-update/lib/lock-file.mjs delete mode 100644 scripts/kb-update/templates/README.md delete mode 100644 scripts/kb-update/templates/com.fromaitochitta.ms-ai-architect.kb-update.plist delete mode 100644 scripts/kb-update/templates/ms-ai-architect-kb-update.ps1 delete mode 100644 scripts/kb-update/templates/ms-ai-architect-kb-update.service delete mode 100644 scripts/kb-update/templates/ms-ai-architect-kb-update.timer delete mode 100755 scripts/kb-update/weekly-kb-cron.mjs delete mode 100644 tests/kb-update/test-auth-mode.test.mjs delete mode 100644 tests/kb-update/test-cost-estimat.test.mjs delete mode 100644 tests/kb-update/test-install-cron.test.mjs delete mode 100644 tests/kb-update/test-lock-file.test.mjs delete mode 100644 tests/kb-update/test-session-start-status.test.mjs delete mode 100644 tests/kb-update/test-template-generation.test.mjs delete mode 100644 tests/kb-update/test-weekly-kb-cron-flags.test.mjs delete mode 100755 tests/test-kb-update.sh diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index fbc113f..878a4b8 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "ms-ai-architect", - "version": "1.11.0", + "version": "1.12.0", "description": "Microsoft AI Solution Architect - structured architecture guidance for the full Microsoft AI stack", "author": { "name": "Kjell Tore Guttormsen" diff --git a/CHANGELOG.md b/CHANGELOG.md index a37084d..57e150c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.12.0] - 2026-05-05 + +### Added — Manuell KB-refresh-arbeidsflyt + +- **`commands/kb-update.md`** — ny `/architect:kb-update` slash-kommando som driver hele KB-oppdaterings-løypen fra en aktiv Claude Code-sesjon: `run-weekly-update.mjs --force --discover` → `report-changes.mjs` → per-fil `microsoft_docs_fetch` → `Edit`-baserte oppdateringer → git commit. Argumenter: `--skip-discover`, `--priorities `, `--dry-run`, `--single-commit`. Default-prioritet: `critical,high`. Schedulering er eksplisitt utenfor scope og overlatt til brukeren. + +### Removed — launchd/cron-arkitektur (Wave 3-5 reversert) + +Etter ToS-gjennomgang (Anthropic Consumer Terms § 3 — automated access only via API key or where explicitly permitted) ble den autonome cron-arkitekturen vurdert som unødvendig kompleks for en solo-fork-and-own-plugin. Apply-fasen krever LLM-resonnering uansett, så manuell trigger fra en aktiv Claude Code-sesjon er både enklere og holder pluginen klart innenfor ToS. + +- `scripts/install-kb-cron.mjs` (~400 linjer) — cross-OS cron-installer (launchd/systemd/Windows Task Scheduler) +- `scripts/kb-update/weekly-kb-cron.mjs` (~600 linjer) — cron-orkestrator med pre-flight, lock, backup, claude -p subprocess, post-run verify, rollback +- `scripts/kb-update/templates/` — 4 scheduler-templates (`com.fromaitochitta.ms-ai-architect.kb-update.plist`, `ms-ai-architect-kb-update.{service,timer,ps1}`) + README +- `scripts/kb-update/lib/auth-mode.mjs` (~100 linjer) — `detectAuthMode` + `validateAuthForCron` (kun cron-spesifikk validering) +- `scripts/kb-update/lib/lock-file.mjs` (~120 linjer) — PID+mtime stale-detection (kun for cron-kollisjons-vern) +- `scripts/kb-update/lib/cost-estimat.mjs` (~80 linjer) — pre-flight budget-cap-logikk (kun for api-key cron-kjøringer) +- `tests/kb-update/test-{auth-mode,lock-file,cost-estimat,install-cron,session-start-status,template-generation,weekly-kb-cron-flags}.test.mjs` — 7 testmoduler for slettet kode (~68 testtilfeller) +- `tests/test-kb-update.sh` — Wave 5 Bash-3.2-shim, erstattet av direkte `node --test`-kall i `run-e2e.sh` +- `hooks/scripts/session-start-context.mjs`: `kb-update-status.json`-overvåking (Wave 3 Step 10) + ubrukt `getCacheDir`-import fjernet + +Total: ~1500+ linjer kode + 7 testmoduler ut. Beholdte utilities (`atomic-write`, `backup`, `cross-platform-paths`, `log-rotate`) er fortsatt brukbare av `run-weekly-update`-scriptet og kan gjenbrukes i fremtidige skripts. + +### Changed + +- `tests/run-e2e.sh --kb-update` kaller nå `node --test tests/kb-update/*.test.mjs` direkte (4 testmoduler, 42 tester) i stedet for `bash tests/test-kb-update.sh`-shim +- `README.md` — "Knowledge Base Maintenance"-seksjonen rewriter for manuell modell, scheduling-disclaimer lagt til +- `CLAUDE.md` — KB-ferskhet-seksjonen oppdatert, `/architect:kb-update` lagt til i kommando-tabellen + +### Notes on 1.12.0 + +- ToS-vurdering: kjøring fra aktiv Claude Code-sesjon faller innenfor "Claude Code CLI is exempted from the prohibition on automated access" per [Anthropic auth-docs](https://code.claude.com/docs/en/authentication) og Consumer Terms § 3. Apply-fasen kan ikke automatiseres innenfor pluginens scope — eventuell schedulering er forkers eget ansvar +- Forbruk: én manuell kjøring (default `--priorities critical,high`) henter ~80 Microsoft Learn-sider via `microsoft_docs_fetch` og oppdaterer 9-53 filer. Kvote-bruk avhenger av abonnementets rate-limits — typisk innenfor en daglig Pro/Max-allowance +- 42/42 KB-update-utility-tester PASS. 271/271 playground-tester uendret +- `data/change-report.json` blir værende på disk for diagnose etter hver kjøring + ## [1.11.0] - 2026-05-04 ### Added — Design-system 100%-adoption + visual upgrade diff --git a/CLAUDE.md b/CLAUDE.md index 1eb1c61..e34fe97 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,6 +43,7 @@ Tilbyr strukturert arkitekturveiledning for Microsoft AI-stakken: | `/architect:frimpact` | FRIA (Art. 27) — obligatorisk for offentlig sektor | | `/architect:conformity` | Samsvarsvurdering (Art. 43) — sjekkliste + erklæring | | `/architect:onboard` | Onboard pluginen med virksomhetsspesifikk kontekst | +| `/architect:kb-update` | Manuell KB-refresh — poller sitemaps, oppdaterer endrede filer via `microsoft_docs_fetch`, committer | ## Agenter @@ -121,25 +122,39 @@ Se `references/architecture/recommended-mcp-servers.md` for detaljer. bash tests/validate-plugin.sh ``` -#### KB-ferskhet (sitemap-basert) +#### KB-ferskhet (sitemap-basert, manuell drift) + +**Apply-fasen kjøres via slash-kommandoen** (krever aktiv Claude Code-sesjon, holder oss innenfor Anthropic Consumer Terms § 3): + +```text +/architect:kb-update # default: critical + high +/architect:kb-update --priorities critical # bare critical +/architect:kb-update --skip-discover # hopp over new-URL discovery +/architect:kb-update --dry-run # rapport uten apply +``` + +**Endringsrapport-fasen kan kjøres som rent Node-script (ingen LLM-kostnad):** + ```bash -# Ukentlig oppdatering: poll sitemaps → endringsrapport +# Poll sitemaps → endringsrapport (ingen filendringer) node scripts/kb-update/run-weekly-update.mjs --force # Med discovery av nye relevante sider node scripts/kb-update/run-weekly-update.mjs --force --discover -# Kun endringsrapport (etter polling) +# Vis rapport på nytt etter polling node scripts/kb-update/report-changes.mjs # Bygg/oppdater URL-registry fra referansefiler node scripts/kb-update/build-registry.mjs [--merge] ``` -Systemet poller Microsoft Learn sitemaps ukentlig, sammenligner `` med filenes `Last updated:` header, og genererer en prioritert endringsrapport. Session-start hook trigger bakgrunns-poll automatisk hvis >7 dager siden siste. +Systemet sammenligner Microsoft Learn sitemap-`` med filenes `Last updated:` header, og genererer en prioritert endringsrapport (critical/high/medium/low). **Match rate:** ~69% av 1342 URLer matche mot sitemaps. ~31% (mest `azure/ai-foundry/openai/`-stier) finnes ikke i sitemaps pga. Microsofts URL-restrukturering. +**Schedulering:** Pluginen schedulerer ingenting. Bruker som vil ha periodisk varsling kan sette opp egen cron / launchd / systemd / GitHub Actions som kjører `node scripts/kb-update/run-weekly-update.mjs --force --discover` (rapport-fasen, ikke apply). Apply-fasen er bevisst manuell — den krever LLM-resonnering på diff og kjører fra en åpen Claude Code-sesjon. + Legacy (deprecated): ```bash bash scripts/kb-staleness-check.sh # mtime-basert, upålitelig etter git clone @@ -177,7 +192,7 @@ claude --plugin ./plugins/ms-ai-architect Interaktiv decision-builder + rapport-viewer for Microsoft AI-beslutninger. Erstatter v2 5-stegs-pipelinen med en multi-surface-app som persisterer state og visualiserer importerte rapporter inline. Spec: v3-arkitektur dokumentert under `.claude/projects/2026-05-03-playground-v3-architecture/`. v1.10.0-utvidelser dokumentert under `.claude/projects/2026-05-03-ms-ai-architect-v1-10-playground/`. v1.11.0 leverer design-system 100%-adoption (PARALLEL-CSS-migrasjon til DS-konvensjon, inline `