Repository navigation
fix(graph): give the zero-results miner the same honest-failure contract - #85
Merged
Merged
Conversation
`miner_zero_results` had the same shape as the bug just fixed in
`miner_embedding`: one `except Exception` that returned `{"edges": 0}` — the
value meaning "there was nothing to surface" — and reported the reason at
`debug`, which is invisible at the level this service runs at. A failure in
`find_or_add_entity` would therefore look exactly like a quiet night, and the
record of what happened would not reach `memory.log`.
After the previous commit, `0` means something specific: this miner looked and
found no work. Leaving a second path that returns `0` on failure would make
that contract a lie again, and the two cases would be indistinguishable by the
new per-miner log line as well.
The exception now escapes to the handler in `graph_enrich` that records
`{"edges": -1}` plus a warning. The reachable `return {"edges": 0}` for "the
journal had no repeated misses" stays — that one is genuine.
This is the only other swallow in the file. The other `except Exception` left
in `graph_miners` is `_get_ner`, which probes whether spaCy is installed and
is a legitimate probe rather than a miner.
Test: a backend failure escapes `miner_zero_results`, alongside the two
existing zero-result tests that pin the real zero.
Full suite: 2086 passed.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
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.
Same shape as the bug just fixed in
miner_embedding(#84), found by grepping the file after that fix landed.The bug
{"edges": 0}is the value meaning "there was nothing to surface", and the reason is reported atdebug, which is invisible at the level this service runs at. A failure infind_or_add_entitytherefore looked exactly like a quiet night, and no trace reachedmemory.log.Why it matters now
After #84,
0means something specific: this miner looked and found no work. Leaving a second path that returns0on failure would make that contract a lie again — and the new per-miner log line (miner edges: layer=user ... zero_results=0) could not tell the two apart either.The fix
The exception escapes to the handler in
graph_enrichthat recordsedges: -1with a warning. The reachablereturn {"edges": 0}for "the journal had no repeated misses" stays — that one is genuine.Scope
This was the only other swallow in the file. The remaining
except Exceptioningraph_minersis_get_ner, which probes whether spaCy is installed: a legitimate probe, not a miner, and correctly silent.Tests
One new: a backend failure escapes
miner_zero_results. The two existing zero-result tests still pin the genuine zero (edges == 0when the journal has one miss,>= 1when it repeats), so the change is scoped to the failure path only.Full suite: 2086 passed.