feat: quality gate — score and filter knowledge entries (#198) #208

Merged
Rockachopa merged 1 commits from fix/198-quality-gate into main 2026-04-21 15:21:08 +00:00
Owner

Closes #198

Quality gate for knowledge entries — scores and filters low-value entries.

Scoring dimensions (weighted):

Dimension Weight Method
Specificity 0.3 Regex: code, dates, numbers, proper nouns vs vague words
Actionability 0.3 Regex: run/install/deploy commands, code blocks, numbered steps
Freshness 0.2 Exponential decay: 1.0 at day 0, 0.5 at ~180 days
Source Quality 0.2 Model reliability map (claude=0.9, ollama=0.6, unknown=0.5)

Usage:

from quality_gate import score_entry, filter_entries, quality_report

score = score_entry(entry)  # 0.0-1.0
filtered = filter_entries(entries, threshold=0.5)
print(quality_report(entries))

CLI:

python3 quality_gate.py knowledge/**/*.jsonl          # report
python3 quality_gate.py --threshold 0.5 --filter *.jsonl  # filter
python3 quality_gate.py --json *.jsonl                # JSON output

Tests: tests/test_quality_gate.py — 14 tests passing.

Closes #198 **Quality gate for knowledge entries** — scores and filters low-value entries. **Scoring dimensions (weighted):** | Dimension | Weight | Method | |-----------|--------|--------| | Specificity | 0.3 | Regex: code, dates, numbers, proper nouns vs vague words | | Actionability | 0.3 | Regex: run/install/deploy commands, code blocks, numbered steps | | Freshness | 0.2 | Exponential decay: 1.0 at day 0, 0.5 at ~180 days | | Source Quality | 0.2 | Model reliability map (claude=0.9, ollama=0.6, unknown=0.5) | **Usage:** ```python from quality_gate import score_entry, filter_entries, quality_report score = score_entry(entry) # 0.0-1.0 filtered = filter_entries(entries, threshold=0.5) print(quality_report(entries)) ``` **CLI:** ```bash python3 quality_gate.py knowledge/**/*.jsonl # report python3 quality_gate.py --threshold 0.5 --filter *.jsonl # filter python3 quality_gate.py --json *.jsonl # JSON output ``` **Tests:** `tests/test_quality_gate.py` — 14 tests passing.
Rockachopa added 1 commit 2026-04-21 00:31:36 +00:00
feat: quality gate — score and filter knowledge entries (#198)
Some checks failed
Test / pytest (pull_request) Failing after 34s
e1e42c3f8e
quality_gate.py:
  4-dimension scoring (0.0-1.0):
    specificity (0.3): concrete examples vs vague
    actionability (0.3): can this be used?
    freshness (0.2): exponential decay over time
    source_quality (0.2): model reliability score
  filter_entries(entries, threshold=0.5)
  quality_report() — distribution + pass rate
  CLI: --threshold, --json, --filter

tests/test_quality_gate.py: 14 tests
  specificity: specific high, vague low, empty baseline
  actionability: actionable high, abstract low
  freshness: recent high, old low, none baseline
  source: claude high, ollama low, unknown default
  entry: good high, poor low
  filter: removes low quality
Rockachopa merged commit fe94130380 into main 2026-04-21 15:21:07 +00:00
Sign in to join this conversation.