Skip to content

feat(retrieval): entity-persist demotion lane onto production retrieve() (#1107 phase 3, #1096) - #1115

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/1107-phase3-entity-persist-lane
Jul 7, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/1107-phase3-entity-persist-lane

Conversation

@robotrocketscience

Copy link
Copy Markdown
Owner

What

#1107 Phase 3 — graduate the entity-persist demotion lane onto the production retrieve() path. Operator-directed ("take the next lane"). The #1096 demotion (the #1086 junk-percolation sink) was default-ON in retrieve_v2 since v4.0 but inert on the live hook path, which called the legacy retrieve(). This exposes it on production.

Why this lane is next

Of the five staged lanes still hard-off after Phase 2, entity-persist is the clear next graduate:

(The other four stay off: origin-tiebreak is a contested BM25-recall problem rerank can't reach (#1013); HRR-expand is recall-neutral (#1001); clustering / HRR-structural reorder the L1 pack and each need their own decision.)

Commits (atomic)

  1. feat(retrieval): shim passes use_entity_persist_demote=None (resolver-driven, default-ON) instead of hard-off. Tests: equivalence SHIM_LANES gains use_entity_persist_demote=None; test_shim_runs_temporal_spine_lane_others_off → test_shim_runs_graduated_lanes_others_off, now proving both graduated lanes (spine + entity-persist) live and the remaining four off, non-vacuously (durable-vs-coordination tie corpus where demotion reorders). The AC2 byte-identity regression test pins AELFRICE_ENTITY_PERSIST_DEMOTE=0 to isolate the posterior_weight=0 → BM25-only contract from the now-default-on demotion — mirroring its existing use_bm25f_anchors=False pin.
  2. docs: CONFIG.md (lane live on production retrieve(), not just retrieve_v2) + CHANGELOG.

Verification

  • Full suite: 5849 passed / 69 skipped / 75 xfailed. The one fallout (AC2 byte-identity) was the expected interaction and is isolated in-test, matching the precedent for the BM25F default-on flip.
  • Ranking ablation (benchmarks/entity_persist_ablation.py): entity-persistence AUC 1.000 vs 0.500 posterior-only (durable/ephemeral separation) — signal intact.
  • No-regression: the G2 mixed-corpus gate (test(retrieval): mixed-corpus G2 eval for entity-persist demote (#1096) #1103, tests/bench_gate/test_entity_persist_g2_mixed_corpus.py) already cleared; the lane adds one batched query, no candidate expansion.

Scope

Refs #1096, #1107 (Phase 3). Does not close the #1107 epic — origin-tiebreak / HRR-expand / clustering / HRR-structural remain, each a separate gated decision.

Opt-out

AELFRICE_ENTITY_PERSIST_DEMOTE=0 or [retrieval] use_entity_persist_demote = false.

…n retrieve() (#1107 phase 3, #1096)

The #1096 entity-persistence demotion lane (the #1086 junk-percolation sink)
was default-ON in retrieve_v2 since v4.0 but inert on the live hook path,
which called the legacy retrieve(). Pass use_entity_persist_demote=None in
the #1107 shim instead of hard-off, so production retrieve() honours
is_entity_persist_demote_enabled (env -> TOML -> default-ON). Single-step
graduation: the default was already True (G2-cleared #1103), so exposing it
makes the demotion live on every host's retrieve()/context_rebuilder/
mcp_server.

Tests: equivalence SHIM_LANES gains use_entity_persist_demote=None (mirrors
the shim); test_shim_runs_temporal_spine_lane_others_off ->
test_shim_runs_graduated_lanes_others_off, now proving BOTH graduated lanes
(spine + entity-persist) live and the remaining four off non-vacuously (a
durable-vs-coordination tie corpus where demotion reorders). AC2 byte-identity
regression test pins AELFRICE_ENTITY_PERSIST_DEMOTE=0 to isolate the
posterior_weight=0 -> BM25-only contract from the now-default-on demotion,
mirroring its existing use_bm25f_anchors=False pin.
#1107 phase 3, #1096)

CONFIG.md: the use_entity_persist_demote lane is default-ON on the production
retrieve() path since the #1107 Phase-3 cutover (was retrieve_v2-only), so the
live UserPromptSubmit hook / context_rebuilder / mcp_server run the #1086
junk-percolation demotion; note the lean shim takes no per-call kwarg (opt out
via env/TOML). CHANGELOG: Phase-3 graduation entry + amend the Phase-2 entry's
now-stale lane count.
@robotrocketscience robotrocketscience added the author-garsecg PR coordination mutex label Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@robotrocketscience, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6ceb89da-ba56-4b22-a1af-7632881eda02

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6814a and dc95c59.

📒 Files selected for processing (5)
  • CHANGELOG/v3.md
  • docs/user/CONFIG.md
  • src/aelfrice/retrieval.py
  • tests/test_bayesian_ranking.py
  • tests/test_retrieve_v2_equivalence.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/1107-phase3-entity-persist-lane

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.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR-size soft cap

This PR is over the advisory size threshold:

  • 142 changed lines (limit: 200)
  • 5 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.

@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

@robotrocketscience robotrocketscience added the attn:review Needs review (PR open, awaiting reviewer) label Jul 7, 2026
@robotrocketscience

Copy link
Copy Markdown
Owner Author

[claim:review:Setr:2026-07-07T16:30:50Z]

@robotrocketscience

Copy link
Copy Markdown
Owner Author

Review: approve.

Verified:

Adding ready-to-merge.

@robotrocketscience robotrocketscience added the ready-to-merge Trigger merge-train: FF main to this PR's head label Jul 7, 2026
@github-actions github-actions Bot removed the ready-to-merge Trigger merge-train: FF main to this PR's head label Jul 7, 2026
@github-actions
github-actions Bot merged commit dc95c59 into main Jul 7, 2026
33 of 34 checks passed
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

merge-train: merged dc95c59main via FF push.

@robotrocketscience

Copy link
Copy Markdown
Owner Author

[release:review:Setr:2026-07-07T16:33:29Z]

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

Labels

attn:review Needs review (PR open, awaiting reviewer) author-garsecg PR coordination mutex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant