From 589711e29b3ad310bb346327fbcef5635fe7242e Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Fri, 10 Apr 2026 11:47:05 +0200 Subject: [PATCH] feat(ms-ai-architect): tune weekly KB cron and update README - Remove file limit (was 10, now processes all critical+high+medium) - Increase max-turns to 200 and timeout to 60min - Add medium priority to update filter - Update README KB note to reflect automated weekly updates Co-Authored-By: Claude Opus 4.6 --- plugins/ms-ai-architect/README.md | 2 +- .../ms-ai-architect/scripts/kb-update/weekly-kb-cron.mjs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/ms-ai-architect/README.md b/plugins/ms-ai-architect/README.md index fb160b4..a2d90bf 100644 --- a/plugins/ms-ai-architect/README.md +++ b/plugins/ms-ai-architect/README.md @@ -227,7 +227,7 @@ Norwegian public sector governance (Digdir, DFØ), EU AI Act (Annex III checklis BCDR planning, hybrid and edge deployment, sovereign cloud (Norway regions), network architecture, monitoring and observability. > [!NOTE] -> All reference documents were generated and verified via the Microsoft Learn MCP server. Regenerate with `/architect:generate-skills` to refresh against current documentation. Check freshness with `bash scripts/kb-staleness-check.sh`. +> All reference documents are generated and verified via the Microsoft Learn MCP server. A weekly cron job (`scripts/kb-update/weekly-kb-cron.mjs`) automatically polls Microsoft Learn sitemaps for changes, updates stale files via MCP research, and commits to the repository. Last full update: April 2026. Manual refresh: `/architect:generate-skills --update`. --- diff --git a/plugins/ms-ai-architect/scripts/kb-update/weekly-kb-cron.mjs b/plugins/ms-ai-architect/scripts/kb-update/weekly-kb-cron.mjs index 5a91893..c0f5d8d 100755 --- a/plugins/ms-ai-architect/scripts/kb-update/weekly-kb-cron.mjs +++ b/plugins/ms-ai-architect/scripts/kb-update/weekly-kb-cron.mjs @@ -18,7 +18,7 @@ const DATA_DIR = join(__dirname, 'data'); const CLAUDE_BIN = '/Users/ktg/.local/bin/claude'; const LOG_FILE = '/tmp/kb-cron.log'; -const MAX_UPDATE_FILES = 10; +const MAX_UPDATE_FILES = Infinity; function log(msg) { const ts = new Date().toISOString(); @@ -83,7 +83,7 @@ if (critical + high === 0) { // Build list of stale files (critical + high only, max MAX_UPDATE_FILES) const staleFiles = (report.files || []) - .filter(f => f.priority === 'critical' || f.priority === 'high') + .filter(f => f.priority === 'critical' || f.priority === 'high' || f.priority === 'medium') .slice(0, MAX_UPDATE_FILES); log(`Spawning Claude to update ${staleFiles.length} stale files...`); @@ -131,11 +131,12 @@ try { execFileSync(CLAUDE_BIN, [ '-p', prompt, '--model', 'sonnet', + '--permission-mode', 'acceptEdits', '--allowedTools', 'Read,Edit,Bash,Glob,Grep,mcp__microsoft-learn__microsoft_docs_search,mcp__microsoft-learn__microsoft_docs_fetch', - '--max-turns', '30', + '--max-turns', '200', ], { stdio: 'inherit', - timeout: 15 * 60 * 1000, + timeout: 60 * 60 * 1000, cwd: PLUGIN_ROOT, }); log('Claude session completed.');