managarten/packages/shared-ai/src
Till JS 59373c0d57 chore(articles): hygiene pass — shared-ai actor + lib/sync-db + metrics (#5,#7,#11)
#5 — SYSTEM_ARTICLES_IMPORT_WORKER hoisted into @mana/shared-ai
   The worker built its actor inline, bypassing the SystemSource union
   that's the blessed list for system-write principals. Now uses
   makeSystemActor(SYSTEM_ARTICLES_IMPORT_WORKER) like every other
   server-side system writer (mission-runner, projection, …).

#7 — sync-db helper hoisted out of mcp/ into lib/
   Implementation moved to apps/api/src/lib/sync-db.ts; mcp/sync-db.ts
   is a re-export shim so existing MCP imports keep working. Articles
   bulk-import + future modules import from lib/ directly — no more
   "articles depending on mcp" layering smell.

#11 — Prometheus metrics for the worker
   New counters + histogram in lib/metrics.ts under
   mana_api_articles_import_*:
     - ticks_total{result=processed|skipped|error}
     - items_total{result=extracted|error|consent_wall|cancelled}
     - extract_duration_seconds (histogram, 0.25–30s buckets)
     - jobs_completed_total{result=done}
     - pickup_gc_rows_total
   Worker tick + extractor instrumented at the right transition points.
   Steady-state pickup_gc_rows_total > 0 over time signals a stuck
   consumer somewhere — useful operator alert.

Plan: docs/plans/articles-bulk-import.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 01:06:15 +02:00
..
agents feat(comic): Mc4 — MCP + AI-Catalog für Character-System 2026-04-26 19:27:15 +02:00
guardrails feat(ai): guardrail layer — pre/post-plan + pre-execute checks 2026-04-16 15:11:34 +02:00
missions feat(agents): Agent CRUD + default bootstrap + Mission.agentId (Phase 2) 2026-04-15 20:35:49 +02:00
planner feat(shared-ai): LLM-facing task tool wrapper for runSubAgent (M3.2) 2026-04-23 19:05:09 +02:00
policy refactor(ai): dynamic tool registry — single-source catalog in shared-ai 2026-04-16 13:06:07 +02:00
tools feat(forms): M5 AI tools — 7 tools im AI_TOOL_CATALOG 2026-04-29 00:33:55 +02:00
actor.test.ts refactor(actor): identity-aware Actor for Multi-Agent Workbench (Phase 1) 2026-04-15 20:13:57 +02:00
actor.ts chore(articles): hygiene pass — shared-ai actor + lib/sync-db + metrics (#5,#7,#11) 2026-04-29 01:06:15 +02:00
field-meta.ts feat(sync): F2 — origin-gated conflict-detection 2026-04-26 21:38:56 +02:00
index.ts chore(articles): hygiene pass — shared-ai actor + lib/sync-db + metrics (#5,#7,#11) 2026-04-29 01:06:15 +02:00
llm-aliases.ts feat(llm-aliases): M5 — migrate consumers to MANA_LLM aliases 2026-04-26 21:26:03 +02:00