feat minor session-10 feat/phase-2g-bundle
AI Agent git-import/068377df · 112 days ago · Apr 5, 2026 · Diff

feat(session-10): Streams 0 + 3 — Netlify scheduler and MCP consolidation tools

Stream 0 — Netlify Scheduled Function (consolidation-scheduler.mjs) - Runs hourly; for each hosted user with consolidation_enabled=true whose (last_pass_at + interval_minutes) <= now, POSTs to bridge with a fresh 5-min service JWT - isUserDue / signServiceJwt exported and unit-tested; runScheduler fully DI for testing - Shadow-log mode (BILLING_ENFORCE !== 'true'): logs intent without calling bridge or mutating DB (safe default for staging) - billing-logic.mjs: consolidation_enabled, consolidation_last_pass_at, consolidation_interval_minutes fields in normalizeBillingUser + defaultUserRecord - netlify.toml: [functions] block with esm bundler - 31 tests in test/consolidation-scheduler.test.mjs

Stream 3 — MCP consolidation tools (mcp/tools/memory.mjs) - consolidation_history: returns last N 'consolidation' memory events via mm.list - consolidation_settings: read/write daemon section of config/local.yaml via js-yaml; validates interval_minutes ∈ [1, 43200], rejects llm_model with path separators or shell metacharacters - memory_consolidate: hosted routing — detects KNOWTATION_HUB_URL / config.hub_url, routes to POST /api/v1/memory/consolidate with Bearer token; returns HUB_TOKEN_REQUIRED when env var missing; falls back to local consolidateMemory otherwise - registerMemoryTools now accepts opts={} for DI (loadConfig, fetchFn, consolidateMemory, createMemoryManager, fs, resolveConfigPath) - 20 tests in test/mcp-memory-consolidation.test.mjs

Test suite: 1046 passing, 0 failing (up from 995 after Stream 1)

sha256:28f5a5f41d71e8e3ed432dfae788e3e09edb6ad43413a035d55fcc87f473f70f sha
sha256:bfd13471aa8172117abb405133184b77e8e82e39c25266eb829b21224277f4c6 snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:28f5a5f41d71e8e3ed432dfae788e3e09edb6ad43413a035d55fcc87f473f70f --body "your comment"