Repository navigation
fix(wiki): refining a draft leaves its confidence as the claims set it (#578) - #580
Conversation
#578) handler_refine wrote a fixed 0.85 into every refined draft and its refined_llm memo. The synthesizer sets a draft's confidence to the mean of its source claims, and the curator approves only from 0.6, so a prose rewrite put any draft past the approve threshold. The handler no longer passes a confidence to update_draft, and the memo records the draft's own confidence (ADR-1065). The handler is not registered as an MCP tool; the maintainer's store holds one refined_llm memo, from a 2026-04-14 test runner. The three new tests fail on the previous handler and pass on this one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
ZETETIC-REVIEW: APPROVE Summary
Stakes classification (Move 7)Medium: core curation-gate logic (affects Evidence gathered1. Correctness of the fix
2. Test strength (reproduced myself, not assumed)
3. Accuracy of factual claims
4. Project gates (run from the worktree,
Move 0: ledger/seen-defect checkNo completion ledger is embedded (not required by this project's PR template) and no seen-defect rationalization pattern ("unrelated," "pre-existing," "out of scope" without a filed issue) appears in the diff, PR body, or issue thread. The one open item: Path B unregistered: is explicitly deferred to a filed issue (#579), which is exactly the acceptable form under §14.3. No refusal triggered. Layer check (Move 1)Single file changed in SOLID (Move 2)No new branching, no interface change, no new type dependency. N/A: this is a value-passing removal, not a structural change. Wiring & contract drift (Move 3)No new public symbols. No signature change to Complexity (Move 5)No smell: a one-line removal and a one-argument value change. Security & hygiene (Move 6)No security-relevant surface touched. Commit message is conventional ( Non-blocking nit
VerdictAPPROVE. Fix is correct on both backends, the fail-before/pass-after claim reproduces exactly, tests are deterministic and independent, all cited facts (thresholds, "never registered," 0.4 fallback) verified against the code and git history, and all four project gates are green. |
Summary
handler_refine(mcp_server/handlers/wiki_refine.py) wrote a fixed 0.85 into every refined draft and into itsrefined_llmmemo. The synthesizer sets a draft's confidence to the mean of its source claims (0.4 when none carries one), and the curator approves only fromMIN_CONFIDENCE_APPROVE = 0.6, so a prose rewrite put any draft past the approve threshold whatever its evidence. The handler no longer passes a confidence toupdate_draft, and the memo records the draft's own confidence. Rationale in ADR-1065 (wiki/adr/cortex/1065-…, mirrored indocs/adr/).The handler is not registered as an MCP tool, so the overwrite was latent: the maintainer's PostgreSQL store holds a single
refined_llmmemo, from atest_runner_v1run on 2026-04-14 (read-only query, 2026-09-16).Closes #578
Type of change
Test plan
tests_py/handlers/test_wiki_refine_confidence.py, SQLite backend through the handlers' own composition root. It synthesizes a draft, sets it halfway between the hold and approve thresholds, refines its lead, then asserts:refined_llmmemo carries that confidence;evaluate_draftstill reports "below approve threshold" and does not approve it.assert 0.85 == 0.5for the first two); on this branch all three pass.pytest tests_py/handlers/ tests_py/core/ -k "wiki or draft or curat or adr or manifest": 723 passed.wiki/manifest.jsonordocs/adr: 207 passed.ruff check,ruff format --check: clean.scripts/check_craftsmanship.py --base origin/main: OK.pyright mcp_server/in the CI typecheck environment built fromuv.lock: 0 errors.Audit notes
wiki_get_draft,wiki_refine_draft) is defined but never registered as MCP tools. Wiring or removing it is an owner decision, tracked in [bug] wiki_get_draft and wiki_refine_draft (Path B) are defined but never registered as MCP tools #579.Coding-standards compliance
handler_refinestay in the existing baseline; the change removes one line).Breaking changes
None through the MCP surface, which does not expose the handler. A direct caller of
handler_refineno longer sees the draft's confidence set to 0.85.Reviewer checklist
🤖 Generated with Claude Code