feat(synthesis): representative claim digest + map/reduce version split#193
Merged
Conversation
The claim-join fix attached ~2,335 claims across ~109 articles, but DIGEST_CLAIM_CAP=150 filled the reduce's claim index first-come by article order — so ~13 dense articles ate all 150 slots and the rest of the corpus never reached the reduce. Result: deep proposals but a narrowed brief (holders collapsed to 1-3 each; furin/DEFUSE cruxes dropped). - selectDigestClaims: keep every is_key claim, then round-robin one-per-article so the 150 span the whole corpus, not its densest few. claimIndex now carries is_key. - Split the version: corpusExtractKey (map-extract cache) keys on MAP_PROMPT_VERSION (held at 'corpus-v2'); CORPUS_PROMPT_VERSION bumped to 'corpus-v3' for staleness/provenance. Reduce-side changes now stale briefs WITHOUT orphaning the cached map extracts — the caching and reduce-prompt tuning were otherwise at war. - Reduce prompt: list EVERY holder and enumerate ALL major cruxes (incl. scientific disputes not in the claims index), not a sample. Reduce-side only: the map prompt is untouched, so existing cached extracts survive. No wire kind. Tests: representative selection (breadth + is_key priority), the map/overall version decoupling, prompt breadth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Real-use problem
After #191 attached ~2,335 claims across ~109 articles, an Opus brief came back deeper but narrower than the earlier 2-claim brief: position
holderscollapsed to 1–3 each, and central cruxes (furin cleavage site, DEFUSE proposal) vanished. The brief said why itself — "13 with extracted claims in the digest."Cause:
DIGEST_CLAIM_CAP = 150filled the reduce's claim index first-come by article order, so ~13 claim-dense articles consumed all 150 slots and the rest of the corpus never reached the reduce — starving cross-article proposals and claim-anchored cruxes of the whole tail.Three moves (all reduce-side — the map cache is untouched)
selectDigestClaims): keep everyis_keyclaim, then round-robin one-per-article so the 150 span the whole corpus instead of clustering in its densest few.claimIndexnow carriesis_key.corpusExtractKey(the map-extract cache key) now keys onMAP_PROMPT_VERSION(held atcorpus-v2), not the overallCORPUS_PROMPT_VERSION(bumped tocorpus-v3). So this reduce change and all future reduce-prompt tuning stale briefs viacorpusInputHashwithout orphaning the expensive cached extracts. The two start equal and diverge exactly when a reduce-only change lands. (Without this, every reduce tweak would blow away the map cache from feat(synthesis): cache per-article map extracts to skip redundant LLM calls #192 — caching and tuning were at war.)Why this is safe
Reduce-side only — the map prompt is unchanged, so your 100 cached extracts survive (verified:
corpusExtractKeykeys onMAP_PROMPT_VERSION, pinned atcorpus-v2). Briefs go stale and re-run cheaply. No wire kind, no schema change, no fused score.Verification
is_keypriority + dense-article can't monopolize); the map/overall version decoupling (a reduce bump doesn't move the cache key); the prompt breadth lines.npm test→ 1976 pass ·npm run buildclean ·npm run lint0 errors.After merge + reload: stay on Opus, re-run — the 100 extracts reuse for free, and the reduce should produce a brief with full holder lists and the furin/DEFUSE cruxes restored. Compare against the current brief; if a crux still reads thin, the remaining lever is a modest
DIGEST_CLAIM_CAPraise.🤖 Generated with Claude Code