Skip to content

Add source_quality label and a health warning for speculation-only knowledge (#258) - #335

Merged
eugeniughelbur merged 2 commits into
eugeniughelbur:mainfrom
konsone:feat/source-quality-258
Oct 10, 2026
Merged

eugeniughelbur merged 2 commits into
eugeniughelbur:mainfrom
konsone:feat/source-quality-258

Conversation

@konsone

@konsone konsone commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does

The narrow first slice agreed on #258: source_quality: high | medium | speculation on raw sources, one shared reference listing the exact signals, and a Source quality health check. Capture labels, compile gates; this PR adds the label and the reader, not the gate.

The field is meant as the contract any later verifier (SIFT, a claim-level check, a human) writes to; consumers read only the field.

Related issues

Related to #258 (not closing: the ingest step 6 behaviour and writing the field from capture commands follow separately, as discussed there).

How I tested it

  • 17 new tests in tests/test_source_quality.py, synthetic fixtures only: all-speculation warns; one better or unlabelled source keeps it quiet; unrecognised value ignored; independent of capture_scope; source citing a source and uncited sources do not ring; daily, log and index notes do not ring; template-comment values parse; policy defaults and silent.
  • Full suite on current main: 1011 passed; 7 failures in test_groq.py / test_podcast_resolution.py are identical on an untouched main.
  • Ran against a copy of a real 848-note vault with labels written by a local pilot writer (not in this PR): 0 findings without labels, 3 with, all notes resting on a single derived Q&A or agent-report source. No false positives on daily/log/index notes.

Honest limits

  • Qualitative check only: no gold-labelled hit rate or false-positive rate.
  • Only type: source notes cited by wikilink are covered. Transitive propagation (concept to synthesis) and non-source capture types are follow-ups.
  • Nothing writes the field yet, so on an existing vault the warning stays silent until the capture commands do.
  • One divergence to confirm: the rule requires a traceable locator for medium. An author or date with no locator does not reach medium on its own.

AI-first rule compliance

  • Follows references/ai-first-rules.md; no command that writes to the vault changed
  • No banned substitution characters in instruction files

Checklist

  • Searched existing issues and PRs
  • CHANGELOG.md updated under Unreleased

🤖 Generated with Claude Code

…owledge (eugeniughelbur#258)

Capture labels, compile gates: this is the narrow first slice agreed on eugeniughelbur#258.
A source_quality: high | medium | speculation field (Rule 7 vocabulary,
orthogonal to capture_scope), one shared reference listing the exact signals,
and a Source quality check in vault_health that warns when a note cites only
speculation sources. Sources with no field are unjudged and never reported.
source_quality_policy: warn | silent follows the rewrite_policy contract.

The link-indexing block of check_source_payload moves into a shared helper so
both checks use one implementation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@eugeniughelbur

Copy link
Copy Markdown
Owner

@konsone thanks, this is the narrow slice we agreed on in #258, and it's careful about the right things.

What I checked:

  • All 17 new tests fail on current main, and CI is green on Linux and Windows.
  • _dependents_of is a line-for-line lift of the old block in check_source_payload, so the payload check behaves the same.
  • An unlabelled source keeps a note quiet. That makes the check safe on every existing vault, and there's no policy value that blocks a capture.
  • The activity-note skip list covers the daily, log and index cases that would otherwise make people mute it.

One small edge, not a blocker. _fm_field strips quotes before your # split, so source_quality: "speculation" # high | medium | speculation comes out as speculation" and is ignored. It fails quiet, so nothing gets flagged wrongly. But the template comment plus our "double-quote when in doubt" convention makes that line likely. Splitting off the comment first, then stripping quotes, fixes it. A test with that exact line would pin it.

On your open divergence: yes, medium needs a traceable locator. An author or date with no way to find the source again stays speculation.

…ity (eugeniughelbur#258)

`source_quality: "speculation"  # high | medium | speculation` came out as
`speculation"` and was ignored, because quotes were stripped before the `#`
split. It failed quiet, but the template comment plus the double-quote
convention makes that line likely. Split off the comment first, then strip
quotes; pinned with the exact line from review.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@konsone

konsone commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the careful read, and for settling the medium locator question.

Fixed the quote edge in the follow-up commit: the # comment is now split off first, then the quotes are stripped, then the value is lowercased. Pinned with your exact line, source_quality: "speculation" # high | medium | speculation, plus single-quoted and upper-case variants. The related tests pass locally (68 across test_source_quality.py, test_source_payload.py and test_vault_health_precision.py); CI will rerun on the push.

Nothing else changed in the slice. Writing the field from the capture commands and the step 6 behaviour I will leave for a separate PR, once you are happy with the field's shape here.

@eugeniughelbur
eugeniughelbur merged commit fe84aa9 into eugeniughelbur:main Oct 10, 2026
2 checks passed
@eugeniughelbur

Copy link
Copy Markdown
Owner

@konsone merged in fe84aa9. Thanks for the quick fix on the quote edge and for pinning it with that exact line.

#258 stays open for the next slices you named: writing the field from the capture commands, and the ingest step 6 behaviour.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants