feat(enrich): thin-page enrichment proposes expansions for stub pages#403
Open
claytonlin1110 wants to merge 2 commits into
Open
feat(enrich): thin-page enrichment proposes expansions for stub pages#403claytonlin1110 wants to merge 2 commits into
claytonlin1110 wants to merge 2 commits into
Conversation
adds kb.enrich_page plus vouch enrich-page / enrich-pages: scores a page against enrichment.min_body_chars / enrichment.min_citations in config.yaml and, for a qualifying thin page, drafts an addition synthesized strictly from approved, non-retracted claims already in the kb (reusing kb.synthesize's rendering so every added sentence carries a resolvable [claim_id] citation). the addition is appended to the page's existing body and filed via propose_page with slug_hint set to the existing page id -- nothing is ever written durably, only proposed. enrich-pages batches this over all thin pages with --dry-run / --limit, mirroring compile.py's propose-never-approve shape. closes vouchdev#309
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4 tasks
kb.capabilities' host_compat block read openclaw.compat.pluginApi from
openclaw.plugin.json, but the manifest deliberately excludes a
top-level "openclaw" key (test_openclaw_plugin_manifest.py's
dead-dialect-fields check) -- so _load_host_compat() always returned
{}, failing the vouchdev#237 drift tests unconditionally. package.json is the
one place openclaw.compat.pluginApi actually lives; point the reader
(and the mirroring test fixture) there instead.
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.
summary
implements #309: a maintenance pass that finds thin pages (stub title + one-line body, few or no
claims/sources) and drafts an enriched revision synthesized strictly from related approved material already in the kb.kb.enrich_page(+ mcp/jsonl/cli registration across all four surfaces,src/vouch/enrich.py) scores one page againstenrichment.min_body_chars/enrichment.min_citations(config.yaml, sane defaults, overridable per-invocation). a page is thin whenlen(page.body)is under the char threshold orlen(page.claims) + len(page.sources)is under the citation threshold.synthesize.synthesize(feat:kb.synthesize— answer-mode retrieval over the review-gated KB #222) against the page's title+body as query, rather than re-deriving clauses fromcontext.build_context_packdirectly — this keeps the "every sentence traces to an approved claim" invariant identical between the two features and only pulls approved, non-retracted claims.claims/sources.propose_pagewithslug_hintset to the existing page id, landing as a pending proposal — nothing is written durably without a humankb.approve. mirrorscompile.py's propose-never-approve shape, including a distinctpage-enricheractor so self-approval stays blocked by the default gate.vouch enrich-pagesbatches this overkb.list_pages(), with--dry-run,--min-body-chars,--min-citations,--limit,--json; one page's rejection (e.g. a page kind's required fields tightened since last approval) is recorded as a skip rather than sinking the batch.docs/enrich.md+ CHANGELOG entry.test plan
tests/test_enrich_page.py— thin-page selection (both thresholds), above-threshold / no-related-claim skips, the propose-not-write invariant (proposal then approve revises the existing page, not a duplicate), dry-run, every-sentence-has-a-resolvable-citation, config load (present/default/bad-value fallback), batch dry-run +--limit, audit event, capabilities/HANDLERS parity, jsonl wire (success + clean missing-page error)ruff check src testscleanmypy srcclean (no new errors beyond the pre-existingsandbox.pywin32 / missing-jinja2gaps on this machine)pytest(enrich, synthesize, compile, storage, capabilities) green aside from two pre-existing, unrelated failures confirmed present on a pristineupstream/testcheckout too (thehost_compat/openclaw-manifest tests, andtest_jsonl_kb_compile_files_proposals's use of acatstub llm_cmd, which doesn't exist as a Windows shell built-in)🤖 Generated with Claude Code