feat: collapse v2 — non-bijunctive recall with Hebbian cross-source corroboration#24
Merged
Conversation
- score_all() now multiplies amplify_gain by base salience before applying Hebbian cross-source corroboration boost, so globally- important structural facts no longer crowd out query-locally- relevant facts - ICARUS_COLLAPSE_AMPLIFY_GAIN env var (default 0.15) tunes the tradeoff; raise to 0.20 if genuine corroboration feels undervalued - All tests passing (_test_collapse.py, collapse_eval.py) - Real pipeline test: 30-35% token reduction with correct ranking (Gabi Qdrant corpus now survives, was pruned in v1) Closes #23
ClaudioDrews
added a commit
that referenced
this pull request
Jun 7, 2026
) - score_all() now multiplies amplify_gain by base salience before applying Hebbian cross-source corroboration boost, so globally- important structural facts no longer crowd out query-locally- relevant facts - ICARUS_COLLAPSE_AMPLIFY_GAIN env var (default 0.15) tunes the tradeoff; raise to 0.20 if genuine corroboration feels undervalued - All tests passing (_test_collapse.py, collapse_eval.py) - Real pipeline test: 30-35% token reduction with correct ranking Closes #23 Co-authored-by: ClaudioDrews <claudio@drews.com.br>
ClaudioDrews
added a commit
that referenced
this pull request
Jun 7, 2026
) - score_all() now multiplies amplify_gain by base salience before applying Hebbian cross-source corroboration boost, so globally- important structural facts no longer crowd out query-locally- relevant facts - ICARUS_COLLAPSE_AMPLIFY_GAIN env var (default 0.15) tunes the tradeoff; raise to 0.20 if genuine corroboration feels undervalued - All tests passing (_test_collapse.py, collapse_eval.py) - Real pipeline test: 30-35% token reduction with correct ranking Closes #23 Co-authored-by: ClaudioDrews <claudio@drews.com.br>
ClaudioDrews
added a commit
that referenced
this pull request
Jun 7, 2026
) - score_all() now multiplies amplify_gain by base salience before applying Hebbian cross-source corroboration boost, so globally- important structural facts no longer crowd out query-locally- relevant facts - ICARUS_COLLAPSE_AMPLIFY_GAIN env var (default 0.15) tunes the tradeoff; raise to 0.20 if genuine corroboration feels undervalued - All tests passing (_test_collapse.py, collapse_eval.py) - Real pipeline test: 30-35% token reduction with correct ranking Closes #23 Co-authored-by: ClaudioDrews <claudio@drews.com.br>
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.
Summary
Implements non-bijunctive recall collapse with Hebbian cross-source corroboration, unified salience ranking, and physical-entropy attestation.
What it does
Replaces the stock per-source quota emission with a single cross-source salience budget:
Files
icarus/collapse.pysalience(),score_all(),collapse(),attest()icarus/hooks.py_apply_collapse()inpre_llm_call, env-configurable tunables_test_collapse.pyscripts/collapse_eval.py.github/workflows/ci.ymlTunables (env vars)
All with sensible defaults. Key ones:
ICARUS_COLLAPSE=1— master switch (set to 0 to restore legacy per-source emission)ICARUS_COLLAPSE_BUDGET=6— max survivors across all sourcesICARUS_COLLAPSE_AMPLIFY_GAIN=0.15— Hebbian boost per corroborating source (tune for Hebbian weight vs. query-local relevance tradeoff (collapse v2) #23 tradeoff)ICARUS_COLLAPSE_DEBUG=1— logs full salience-ranked pool + attestation hashReal pipeline results
pre_llm_callcontext injectionCloses #23