feat(knowledge): toggleable KB curation-adjustment log#229
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 immutableaudit_log; this is the skimmable what did the KB change feed you turn on for a few months and off after.Toggle — per-tenant, API-set + API-viewed (as requested)
tenant.settings["kb_curation_log"](default off), following the existingknowledge_auto_extractprecedent. Flip it via the admin tenant API —PATCH /api/v1/admin/tenants/:idwithsettings: {"kb_curation_log": true}; read it back fromGET /api/v1/admin/tenants/:id. When off,KbCuration.record/4is a no-op (a tenant lookup, no write) — zero rows, zero accumulation.Pieces
kb_curation_eventstable (RLS) +KbCurationEventschema.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/2filters bykind+since, most recent first.GET /api/v1/knowledge/curation-log(orchestrator+); MCP v2.30.0knowledge_curation_log.kb_curation_logis 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.