Files
stack/tests/bib/test_store.py
kert c3628d8f09 fix(bib): merge every source before capping code-tags; batch tag commits per item (refs #688)
Ruling A7: stack bib code-tags called apply_code_tags once per
collection with an independent mapping, so the max-codes-per-item cap
was evaluated per source instead of per item — 54 items straddling
rules/corpus could dodge it in both calls. Now every selected source
(rules anchors + chunks, comments chunks, corpus chunks) merges into
one item_key -> (codes, families) mapping before a single
apply_code_tags call.

Store.add_tags batches an item's new labels into one commit instead
of one commit per add_tag call; apply_code_tags uses it. Fixes the
34-minute backfill's commit-per-tag overhead.

Also: noqa on the codetags._con() access, a CLI test for
--anchors-only on a non-rules collection, and add_tags coverage in
test_store.py.
2026-09-09 22:41:19 -04:00

32 KiB