feat(rebuilder): default trigger_mode threshold (#746) - #750
Conversation
Flip DEFAULT_TRIGGER_MODE from TRIGGER_MODE_MANUAL to TRIGGER_MODE_THRESHOLD. PreCompact rebuilder is now default-on for fresh installs. The v1.4.0 ship-default of 'manual' was conservative pending production telemetry. Both bench gates have cleared: - #592 (eval-harness commit-3): hot-start 100% at trigger_threshold <= 0.6, cold-start 75% across t in {0.5..0.8}, closed 2026-05-13. - #687 (Cohen's-kappa multi-run validation): closed 2026-05-13. Opt-out via [rebuilder] trigger_mode = "manual" in .aelfrice.toml. The config-load and hook-dispatch paths already honor that override; no plumbing changes required by this commit.
Update tests for the threshold-default flip in #746: - test_tm1_default_trigger_mode_is_manual -> renamed test_tm1_default_trigger_mode_is_threshold; asserts threshold both at the constant and at RebuilderConfig() default. - test_tm1_no_config_file_defaults_to_threshold: new test exercising the user-visible promise of #746 (fresh install with no .aelfrice.toml auto-fires). Belt + suspenders alongside the constant check. - test_hook_pre_compact.py: clarify obsolete v1.4-vintage comments that said 'default is manual; opt in to threshold'. The opt-in TOML writes remain in the fixtures so the tests stay self-documenting and robust to any future default flip. All 24 tests in test_rebuilder_triggers.py and test_hook_pre_compact.py pass.
Surgical updates to docs/context_rebuilder.md for the #746 flip: - Roadmap row: 'default manual' -> 'default threshold since #746'. - TOML example: switch the example value from manual to threshold, rewrite the comment to lead with the new default and frame manual as the opt-out. - Bullet annotations: '(default at v1.4.0)' on manual -> '(opt-out since #746)' with the augment-mode token-spend trade-off; threshold bullet gets '(default since #746; bench gates #592 + #687 cleared 2026-05-13)' annotation while the rest of the line stays put. README scan showed no remaining 'opt-in via .aelfrice.toml' wording in the current revision, so no README change required.
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Sorry @robotrocketscience, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
PR-size soft capThis PR is over the advisory size threshold:
Bigger PRs collide with more open work, which under the parallel-session workflow tends to produce repeated This is advisory only — nothing is blocked. If the size is intentional (large refactor, module removal, generated code), apply the |
|
[claim:review:curie:2026-05-13T21:26:12Z] |
|
[release:review:curie:2026-05-13T21:27:29Z] |
Closes #746.
What this PR does
Flips
DEFAULT_TRIGGER_MODEinsrc/aelfrice/context_rebuilder.pyfromTRIGGER_MODE_MANUALtoTRIGGER_MODE_THRESHOLD. Fresh installs now experience the PreCompact augment-mode rebuild without configuration; opt-out remains available via[rebuilder] trigger_mode = "manual"in.aelfrice.toml.Why now
Both bench gates referenced by the v1.4.0 ship-default conservatism note have closed:
trigger_threshold <= 0.6, cold-start 75% across t ∈ {0.5..0.8}.The original
manualdefault was explicitly framed as "until production telemetry confirms the calibrated threshold" — the telemetry is in, the threshold cleared, the gate exists to be flipped.Commits (atomic)
feat(rebuilder): default trigger_mode threshold (#746)— one-line constant flip + docstring rewrite citing feat(eval-harness): wire context-rebuilder eval harness for #587 hot-start scoring #592/eval-harness: Cohen's-κ judge calibration before #592 close #687 closure.test(rebuilder): default trigger_mode threshold (#746)— renamestest_tm1_default_trigger_mode_is_manual→_is_threshold, asserts threshold at both the constant andRebuilderConfig()default; adds newtest_tm1_no_config_file_defaults_to_thresholdexercising the user-visible promise (no TOML present → threshold); updates obsolete v1.4-vintage comments intest_hook_pre_compact.pythat described threshold as opt-in.docs(rebuilder): default trigger_mode is threshold (#746)—docs/context_rebuilder.mdroadmap row + TOML example + mode descriptions reordered so threshold leads with gate-clearance history.docs(changelog): note rebuilder default trigger_mode flip (#746)—[Unreleased] > Changedentry.Acceptance coverage (#746 checklist)
DEFAULT_TRIGGER_MODEflipped toTRIGGER_MODE_THRESHOLD(context_rebuilder.py:197)context_rebuilder.py:198-209updated to reflect gate clearance[rebuilder] trigger_mode = "manual"verified working — existingtest_tm1_manual_mode_pre_compact_hook_no_opscovers this path; the config-load + hook-dispatch paths already honor the override.AELFRICE_NO_REBUILDERenv override — checked: no such env var exists in the codebase (grep -rn 'AELFRICE_NO_REBUILDER\|NO_REBUILDER'returns nothing). TOML-based opt-out is the only opt-out and was already the documented surface. The acceptance bullet appears to be aspirational; not adding one in this PR since the issue body itself frames it as "decide whether to add one" and TOML opt-out is sufficient.docs/context_rebuilder.mdupdated. README scan showed no remaining "opt-in via .aelfrice.toml" wording in the v3 revision, so no README change required.[Unreleased] > Changed.Out of scope (per the issue body)
Risk
threshold_fraction = 0.6is fixture-bound. Users opting into custom calibration already have the override path ([rebuilder] threshold_fraction = X); this flip doesn't change that.Test plan
uv run pytest tests/test_rebuilder_triggers.py tests/test_hook_pre_compact.py→ 24 passed.uv run pytest -q -x(full suite) → 3821 passed, 59 skipped, 75 xfailed.