Skip to content

fix: scout against every record root, not just kb/communities - #736

Merged
realmarcin merged 1 commit into
mainfrom
fix-scout-dedup-all-record-roots
Sep 3, 2026
Merged

fix: scout against every record root, not just kb/communities#736
realmarcin merged 1 commit into
mainfrom
fix-scout-dedup-all-record-roots

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

Checked the scout-communities skill before running it. The documented CLI matches the script exactly — presets, flags, defaults — but the dedup index did not match the corpus.

The gap

scout_communities.py reports a paper as NEW when no curated record cites it, and it built that index from kb/communities/ alone. data/isolates/ holds records with the same root class, and 5 references are cited only from there:

PMID:34111782
PMID:38150661
doi:10.1007/s10163-014-0276-4
doi:10.1016/j.mineng.2013.03.022
doi:10.1016/j.scitotenv.2021.148151

Each would have been reported as a new community to go and research — when it is already curated.

The consequence is wasted work, not a wrong record, which is exactly why it sat unnoticed. Nothing fails. A curator simply spends a deep-research pass on a community that already exists.

Same shape this repo keeps hitting: data/isolates outside every validation glob (#350), kb/taxa outside every CI trigger (#471), a hardcoded root list that cannot notice a new member (#689). Same fix — read default_record_roots() instead of naming a directory. The index goes from 325 records to 329.

The guard corrected the test I wrote for it

My first test globbed kb/communities to compute which references were unique to the other roots, and #689's guard flagged it — correctly, and with the right advice: "Prefer fixing it to recording it." Adding the module to _COMMUNITY_ONLY would have recorded a falsehood; it is not community-only.

Asking the question per root names no directory and is stronger: for each root, every reference unique to it must be in the index. That holds for a root added later with this file untouched, and it refuses to run vacuously if no root has a unique reference.

mutation result
revert the scout to kb/communities only RED — both the count and the per-root check

Skill doc

Updated to match, version: 1.1.0, plus two limitations that were not written down:

  • a false NEW costs research, not correctness — the reason this was invisible;
  • --since is a floor, not a window. Left at its 2024 default, a pass in 2026 re-surfaces everything earlier passes under research/scouting/ already saw.
just lint       clean
pytest tests/   2927 passed, 25 skipped

Known unrelated failure: test_no_snippet_stops_mid_word, from an untracked local cache on a record this PR does not touch.

Checked the `scout-communities` skill against the tree before running it. The
documented CLI matches the script exactly -- presets, flags, defaults -- but the
dedup index did not match the corpus.

`scout_communities.py` reports a paper as NEW when no curated record cites it,
and it built that index from `kb/communities/` alone. `data/isolates/` holds
records with the same root class, and **5 references are cited only from there**:

    PMID:34111782, PMID:38150661,
    doi:10.1007/s10163-014-0276-4, doi:10.1016/j.mineng.2013.03.022,
    doi:10.1016/j.scitotenv.2021.148151

Each would have been reported as a new community to go and research, when it is
already curated. The consequence is wasted work rather than a wrong record,
which is why it sat unnoticed: nothing fails, a curator just researches
something that exists.

Same shape this repository keeps hitting -- `data/isolates` outside every
validation glob (#350), `kb/taxa` outside every CI trigger (#471), a hardcoded
root list that cannot notice a new member (#689). Same fix: read
`default_record_roots()` rather than naming a directory, so a root added later
is covered without anyone remembering this file. The index goes from 325 records
to 329.

`scripts/` is run by path rather than imported, so `src/` is put on `sys.path`
for the shared helper.

## The guard corrected the test I wrote for it

The first version globbed `kb/communities` to compute which references were
unique to the other roots, and #689's guard flagged it -- correctly, and with
the right advice: prefer fixing it to recording it. Adding the module to
`_COMMUNITY_ONLY` would have been recording a falsehood, since it is not
community-only.

Asking the question PER ROOT instead names no directory and is stronger: for
each root, every reference unique to it must be in the index. That holds for a
root added later with this file untouched, and it refuses to run vacuously if no
root has a unique reference.

Mutation-checked by reverting the scout to the single root, which reds both the
count and the per-root check.

Skill doc updated to match, and two limitations recorded that were not written
down: a false NEW costs research rather than correctness, and `--since` is a
floor rather than a window -- left at its 2024 default a pass in 2026
re-surfaces everything earlier passes already saw.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 23:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@realmarcin
realmarcin merged commit bccc153 into main Sep 3, 2026
4 checks passed
@realmarcin
realmarcin deleted the fix-scout-dedup-all-record-roots branch September 3, 2026 00:18
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