Skip to content

Add live wiki diagnostics coverage and read-only compile dry-run API - #837

Open
allenporter wants to merge 1 commit into
mainfrom
feat/wiki-diagnostics-api
Open

allenporter wants to merge 1 commit into
mainfrom
feat/wiki-diagnostics-api

Conversation

@allenporter

Copy link
Copy Markdown
Owner

Summary

Adds live debugging endpoints so users can inspect why specific notebooks (such as daily journals) are under-cited in their wiki without mutating or rebuilding anything:

  • Per-notebook coverage (GET /api/extended/wiki/diagnostics): Tenant-scoped join of active UserFileDO + non-blank NotePageContentDO + active WikiSourceRefDO / WikiPageDO, returning each notebook's file_id, file_name, ocr_pages, cited_pages, avg_chars_per_page, and cited_slugs, sorted lowest-coverage and largest-notebook first.
  • Exact-runtime read-only dry-run (POST /api/extended/wiki/diagnostics/dry-run): Accepts {file_id?, start_date?, offset_pages?, max_pages?} and runs the exact production pipeline (select_candidate_pages -> build_compile_prompt -> generate_json -> parse_compile_plan) without persisting any changes. Returns the exact pages/OCR snippets sent, candidate slugs, LLM page_ops, resolved vs. dropped source_refs, and any drop_reason (edit_policy, page_cap_exceeded, index_auto_maintained).
  • Client & DTOs (supernote/models/wiki.py, supernote/client/wiki.py): Added WikiNotebookCoverageDTO, WikiDiagnosticsResponseVO, WikiDryRunPageDTO, WikiDryRunOpDTO, WikiDryRunResponseVO, WikiClient.get_diagnostics(), and WikiClient.dry_run_compile().

Verification

  • uv run --no-sync pytest tests/server/components/wiki/ -v — 80 passed
  • ./script/lint — all checks passed

@github-actions github-actions Bot added enhancement User-facing feature or API capability cli-client Command-line interface (supernote) and async Python client SDK labels Nov 26, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.51%. Comparing base (dc616e3) to head (fcba6e2).

Files with missing lines Patch % Lines
supernote/server/components/wiki/http.py 80.95% 8 Missing ⚠️
supernote/server/components/wiki/compiler.py 86.53% 7 Missing ⚠️
supernote/server/components/wiki/source_service.py 91.30% 4 Missing ⚠️
supernote/client/wiki.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #837      +/-   ##
==========================================
- Coverage   95.54%   95.51%   -0.04%     
==========================================
  Files         256      256              
  Lines       27907    28095     +188     
==========================================
+ Hits        26665    26835     +170     
- Misses       1242     1260      +18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-client Command-line interface (supernote) and async Python client SDK enhancement User-facing feature or API capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants