Skip to content

feat(knowledge): toggleable KB curation-adjustment log#229

Merged
mkreyman merged 1 commit into
masterfrom
knowledge-curation-log
Jul 1, 2026
Merged

feat(knowledge): toggleable KB curation-adjustment log#229
mkreyman merged 1 commit into
masterfrom
knowledge-curation-log

Conversation

@mkreyman

@mkreyman mkreyman commented Jul 1, 2026

Copy link
Copy Markdown
Owner

A concise, human-readable feed of KB curation adjustments — novelty-gate decisions (gate_duplicate/gate_draft) and conflict resolutions (supersede/merge/dismiss) — for analyzing the agents'-KB rollout. Distinct from the verbose immutable audit_log; this is the skimmable what did the KB change feed you turn on for a few months and off after.

2026-07-01 03:12  supersede  "XML in Elixir (xmerl)" retired for "Parsing XML in Elixir"  by=agent-7 conf=high
2026-07-01 04:00  gate_duplicate  rejected duplicate of "…" (sim=0.990)                     by=agent-3

Toggle — per-tenant, API-set + API-viewed (as requested)

tenant.settings["kb_curation_log"] (default off), following the existing knowledge_auto_extract precedent. Flip it via the admin tenant API — PATCH /api/v1/admin/tenants/:id with settings: {"kb_curation_log": true}; read it back from GET /api/v1/admin/tenants/:id. When off, KbCuration.record/4 is a no-op (a tenant lookup, no write) — zero rows, zero accumulation.

Pieces

  • kb_curation_events table (RLS) + KbCurationEvent schema.
  • KbCuration.record/4 — fire-and-forget, gated on the tenant toggle; wired at the gate (duplicate/draft) and the conflict executor (supersede/merge/dismiss). list/2 filters by kind + since, most recent first.
  • GET /api/v1/knowledge/curation-log (orchestrator+); MCP v2.30.0 knowledge_curation_log.
  • Tenant changeset validates kb_curation_log is boolean.

Tests (+18)

toggle on/off/nil no-op, enabled? reflects the setting, list filter/since/paginate/isolation, integration (supersede + dismiss log), tenant boolean validation, controller feed + role gate. Full gate green: format, credo, dialyzer, 3090 tests.

Note: 2 intermittent pre-existing async flakes in unrelated suites (capabilities token, db_error_backstop) are not introduced here — 3/4 full runs clean.

A concise, human-readable feed of KB CURATION adjustments — novelty-gate decisions
(gate_duplicate/gate_draft) and conflict resolutions (supersede/merge/dismiss) — for
analyzing the agents'-KB rollout. Distinct from the verbose immutable audit_log; the
skimmable 'what did the KB change' feed you turn on for a few months and off after.

Toggle: PER-TENANT via tenant.settings['kb_curation_log'] (default off), following the
knowledge_auto_extract precedent. Set/view via the admin tenant API (PATCH/GET
/api/v1/admin/tenants/:id) — already casts settings; added boolean validation. When off,
KbCuration.record/4 no-ops (a tenant lookup, no write) — zero rows, zero accumulation.

- kb_curation_events table (RLS); KbCurationEvent schema; KbCuration.record/4 (fire-and-
  forget, gated on the tenant toggle) wired at the gate + conflict executor; list/2
  filters by kind + since.
- GET /api/v1/knowledge/curation-log (orchestrator+); MCP v2.30.0 knowledge_curation_log.

Tests (+18). Full gate green (3090 tests, dialyzer, credo). Note: 2 intermittent
pre-existing async flakes in unrelated suites (capabilities token, db_error_backstop)
are not introduced here; 3/4 full runs clean.
@mkreyman mkreyman merged commit 224c381 into master Jul 1, 2026
9 checks passed
@mkreyman mkreyman deleted the knowledge-curation-log branch July 1, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant