Skip to content

feat(retrieval): use_type_aware_compression flips to default-on (#769) [stacked on #879] - #880

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/issue-769-flip-compression-default
May 21, 2026
Merged

feat(retrieval): use_type_aware_compression flips to default-on (#769) [stacked on #879]#880
github-actions[bot] merged 4 commits into
mainfrom
feat/issue-769-flip-compression-default

Conversation

@robotrocketscience

Copy link
Copy Markdown
Owner

Closes #769.

Stacked on #879 (which closes #878 / compose-reconciliation). Set base to feat/issue-878-compress-cluster-compose until #879 lands, then this rebases to main.

Summary

Flips resolve_use_type_aware_compression() default False → True. The bench evidence cleared empirically against the post-#815 lab-side compression_a* corpora — see #769 bench-results comment:

Gate Mean Per-row positives Per-row regressions Spec threshold
A2 recall@k uplift +0.3267 15 / 25 0 / 25 strict > 0 aggregate, per-class non-regression rider
A4 fidelity delta +0.0085 2 / 15 (rows with headroom) 0 / 15 ≥ −0.005 band

Per-class non-regression rider (drop / summarise / verbatim cohorts each non-regressing) holds; all-fact cohort delta is exactly 0.0000 per the spec's stated degenerate case.

Why this is the right shape

resolve_use_type_aware_compression() docstring contract: "the bench gate flips the default after lab-side benchmark evidence clears." That precondition is now met. Compose-compatibility with the (already default-on) use_intentional_clustering flag — the structural prerequisite that almost blocked an earlier flip-attempt mid-session — ships in #879 / #878 right before this.

Mechanism

Tests

Mirrors the #436 default-flip precedent (ab4462d7):

  • test_default_is_off → test_default_is_on
  • test_pack_byte_identical_when_flag_off → test_pack_byte_identical_when_flag_on — ON-byte-identity invariant supersedes the prior OFF-byte-identity invariant; the assertion that default == explicit is preserved, only the explicit-arm flips.
  • test_retrieve_pack_byte_identical_when_flag_off → test_retrieve_pack_byte_identical_when_flag_on — same shape on the bare retrieve() path.
  • test_retrieve_env_var_enables_compression → test_retrieve_env_var_disables_compression — the env-var path now tests rollback to OFF (env="0") rather than activation (env="1"), matching the post-flip precedence semantics. The bench-harness path that originally motivated this test still works — AELFRICE_TYPE_AWARE_COMPRESSION=1 is the no-op default now.
  • test_default_call_leaves_compressed_empty → test_default_call_populates_compressed — assertion flipped to match the new default.
  • test_env_garbage_falls_through — default-arm assertion flipped.

Full suite green locally on stacked HEAD (4656 passed, 64 skipped, 75 xfailed).

Doc surfaces

Three places still asserted v2.1-era default-OFF posture — all corrected in a separate atomic commit:

Determinism (#605)

Precedence chain unchanged; only the default value flipped. Replay with same inputs reproduces same output (now compression-ON unless explicit override). The compression render itself is pure over (belief content, lock state, retention class) — no wall-clock, no random sampling.

Discretion

Diff against main is clean against the pre-push deny-list.

What this closes

Three R&D rounds (R7–R18 in 2026-05-14/15) + the @Ilya0527 statistical-power exchange (2026-05-18) + the 2026-05-20 operator verdict to flip — see #769 thread. The campaign's verdict-without-numbers state finally collides with numbers: A2 cleared, A4 cleared, no regressions, compose-reconciliation in place.

@sourcery-ai sourcery-ai Bot 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.

Sorry @robotrocketscience, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@robotrocketscience has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 6 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6082660e-0f5b-4750-aed7-5340f68f014a

📥 Commits

Reviewing files that changed from the base of the PR and between a1f2c30 and 884ca5a.

📒 Files selected for processing (7)
  • CHANGELOG/v3.md
  • docs/concepts/ROADMAP.md
  • docs/design/feature-type-aware-compression.md
  • docs/user/CONFIG.md
  • src/aelfrice/retrieval.py
  • tests/test_compression_integration.py
  • tests/test_context_rebuilder.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-769-flip-compression-default

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@robotrocketscience

Copy link
Copy Markdown
Owner Author

Stacked on #879 — do not review/label-merge this PR until #879 lands. Once #879 merges, I (or any session) will rebase this branch on main and add attn:review then.

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

PR-size soft cap

This PR is over the advisory size threshold:

  • 131 changed lines (limit: 200)
  • 7 changed files (limit: 3)

Bigger PRs collide with more open work, which under the parallel-session workflow tends to produce repeated attn:merge-conflict cycles (see #602). When practical, split into smaller PRs that each touch a focused surface.

This is advisory only — nothing is blocked. If the size is intentional (large refactor, module removal, generated code), apply the size:override label and this comment will be removed on the next push.

@robotrocketscience robotrocketscience added the author-garsecg PR coordination mutex label May 21, 2026
Substrate landed v2.1 (#434 phase 2 pack-loop rewrite) and the bench
gates (A2 recall@k uplift, A4 rebuilder continuation-fidelity in
docs/design/feature-type-aware-compression.md) have now cleared on
the lab-side compression_a* corpora:

  A2 mean recall@k uplift = +0.3267 over n=25 (15 positive, 10 zero,
  0 regressions; all-fact rows are no-op by spec)
  A4 mean fidelity delta = +0.0085 over n=15 (2 positive in the
  rows with headroom, 13 zero — 9 of those at OFF=1.0 proxy ceiling,
  0 regressions)

Per the resolve_use_type_aware_compression() docstring contract,
the default is unblocked. Compose-compatibility with the (already
default-on) use_intentional_clustering flag was the structural
prerequisite; that shipped in the preceding #878 commit via the
pack_with_clusters cost_fn seam.

Precedence (env > kwarg > TOML > default) is unchanged; only the
default value flips False -> True. Reversible via
[retrieval] use_type_aware_compression = false in .aelfrice.toml or
AELFRICE_TYPE_AWARE_COMPRESSION=0 for v2.x parity.

Tests updated, mirroring the #436 default-flip precedent:
- test_default_is_off -> test_default_is_on
- test_pack_byte_identical_when_flag_off ->
  test_pack_byte_identical_when_flag_on
- test_retrieve_pack_byte_identical_when_flag_off ->
  test_retrieve_pack_byte_identical_when_flag_on
- test_retrieve_env_var_enables_compression ->
  test_retrieve_env_var_disables_compression (the env-var path now
  tests rollback to OFF rather than activation; matches the
  post-flip precedence semantics)
- test_default_call_leaves_compressed_empty ->
  test_default_call_populates_compressed
- test_env_garbage_falls_through default-arm assertion flipped

Closes #769. Stacked on #878 (compose-reconciliation).
…#769)

Three surfaces still asserted the v2.1-era default-OFF posture. Sync
them with the #769 default-on flip:

- docs/design/feature-type-aware-compression.md: status banner now
  records the A2 + A4 bench-gate clear and the #878 compose-
  reconciliation link.
- docs/user/CONFIG.md: TOML example flips to true; flag-doc section
  reframes the default + precedence narrative; tier-table summary
  line updated.
- docs/concepts/ROADMAP.md v3.0 row: amend the A2-bench-gate bullet
  to note A4 also cleared and the default-on flip landed in #769.

Mirror of the #436 docs-correction commit (301a411 /
d001adc) that scrubbed stale Default-OFF block-comments after
the intentional-clustering flip.
Records the bench-evidence basis (A2 +0.3267 / A4 +0.0085, 0
regressions, per-class non-regression rider held), the structural
prerequisite (#878 compose-reconciliation), the unchanged precedence
chain, the rollback path (env / TOML), and the test renames mirroring
the #436 precedent. Lands in the Changed section since this is a
default flip, not a new surface.
@robotrocketscience
robotrocketscience force-pushed the feat/issue-769-flip-compression-default branch from c622ccb to 1de5543 Compare May 21, 2026 00:30
@robotrocketscience
robotrocketscience changed the base branch from feat/issue-878-compress-cluster-compose to main May 21, 2026 00:30
…flip

Missed in the initial #769 test sweep: test_context_rebuilder.py also
carries an OFF-byte-identical-when-default test
(test_rebuild_v14_compression_off_byte_identical_default) whose
assertion shape is the same as the test_compression_integration.py
ones already flipped. Post-#769 default-on, default rebuild_v14
output equals explicit-ON output, not explicit-OFF.

Renamed to test_rebuild_v14_compression_on_byte_identical_default
and flipped the explicit arm. The #139 / #288 / #798 regression
contract still holds in shape (default-call output is deterministic
and equals the explicit-arm-of-the-default value); only the value
of the default changed.

Caught by local full-suite run on the rebased branch; GitHub CI on
the pre-rebase commit didn't exercise this because the conflict only
materialised after the rebase landed on the post-#878 main tip.
@robotrocketscience robotrocketscience added the ready-to-merge Trigger merge-train: FF main to this PR's head label May 21, 2026
@github-actions github-actions Bot removed the ready-to-merge Trigger merge-train: FF main to this PR's head label May 21, 2026
@github-actions
github-actions Bot merged commit 884ca5a into main May 21, 2026
28 checks passed
@github-actions

Copy link
Copy Markdown

merge-train: merged 884ca5amain via FF push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-garsecg PR coordination mutex

Projects

None yet

1 participant