Repository navigation
fix(tests): repair whale-pass daemon-cli tests broken by #3455 - #3489
Conversation
Problem: test_maybe_run_raw_materialization_whale_pass_{runs_scoped_pass_
and_emits_events,no_candidate_skips_writer} fail on master with
TypeError: <lambda>() got an unexpected keyword argument '_bootstrap',
raised from config.py:2173 (resolve_archive_root ->
load_polylogue_config(_bootstrap=bootstrap)).
Diagnosis: production is correct, the tests are stale. Both tests
monkeypatch polylogue.config.load_polylogue_config with a zero-arg
lambda, intending to satisfy _resolve_raw_materialization_whale_blob_
limit_bytes's load_polylogue_config() call. But the autouse
_clear_polylogue_env fixture removes POLYLOGUE_ARCHIVE_ROOT, so
production's real archive_root() (called first, at daemon/cli.py:1265)
falls through its env fast path into resolve_archive_root(), which
calls load_polylogue_config(_bootstrap=bootstrap) -- a call shape the
tests' lambda was never updated to accept after #3455 touched this
same call chain and test file together. Widening the lambda to accept
**kwargs would require faking a full ResolvedSettings-like object with
an .archive_root attribute, so instead this patches archive_root()/
render_root() directly on polylogue.paths -- the seam every other test
in this file already uses for the identical env-fallback problem.
Also fixes polylogue-010x: patching load_polylogue_config alone left
these tests order-dependent (only passing when some other test's
POLYLOGUE_ARCHIVE_ROOT override happened to survive into this test's
env). Patching polylogue.paths.archive_root directly makes the tests
deterministic in isolation and in file-scope runs alike.
Verification:
devtools test tests/unit/daemon/test_daemon_cli.py -k whale_pass -> 4 passed
devtools test tests/unit/daemon/test_daemon_cli.py (full file) -> 113 passed
Ref polylogue-jsxj, polylogue-010x
Co-Authored-By: Claude <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
Problem: polylogue-t93b (daemon must converge whale raw components) was dispatched for implementation, but the escalation-tier whale pass was already fully implemented and merged (#3256, #3268, #3455, #3489) prior to this session, per a same-day RECONCILE note already on the bead. What changed: independently re-verified the mechanism from source (daemon/cli.py _maybe_run_raw_materialization_whale_pass, storage/repair.py raw_materialization_whale_pass_candidate + stream-safe gating), ran the relevant tests (test_repair.py -k whale_pass, test_daemon_cli.py -k whale — 8 passed, covering the synthetic-fixture convergence AC, the non-stream-safe-fails-safely AC, and the bounded-commit-batch AC), and checked the live archive read-only for witness codex:019f49d8's current state. Appended a confirmation note: mechanism is done, witness has not converged yet purely because the ordinary trickle conveyor has not reached quiescence (whale pass only fires when quiescent), not because of a code gap. No production code changed. No PR opened — there was nothing to change. Co-Authored-By: Claude <[email protected]>
Summary
Repairs
test_maybe_run_raw_materialization_whale_pass_{runs_scoped_pass_and_emits_events,no_candidate_skips_writer}intests/unit/daemon/test_daemon_cli.py, which fail onmasterboth in isolation and file-scope with:raised from
polylogue/config.py:2173(resolve_archive_root->load_polylogue_config(_bootstrap=bootstrap)).Problem
#3455("refactor(config): delete two inert config keys and the whale off-switch") touchedpolylogue/config.pyand this exact test file in the same commit, and the failing tests are named after that PR's whale-pass feature.Which side was wrong, and why
Production is correct; the tests are the stale side. Diagnosis:
_maybe_run_raw_materialization_whale_pass(polylogue/daemon/cli.py:1265) callsarchive_root()(frompolylogue.paths) first._clear_polylogue_envfixture (tests/conftest.py:447) removesPOLYLOGUE_ARCHIVE_ROOT, soarchive_root()'s env fast path is empty and it falls through toconfig.resolve_archive_root(), which callsload_polylogue_config(_bootstrap=bootstrap).polylogue.config.load_polylogue_configwith a zero-argument lambda (originally added only to satisfy_resolve_raw_materialization_whale_blob_limit_bytes's separate zero-argload_polylogue_config().raw_authority_whale_payload_bytescall) — it was never updated to accept the_bootstrapkeyword thearchive_root()fallback path actually needs.**kwargswould still fail:resolve_archive_rootreadssettings.archive_rootoff the return value, and a bareSimpleNamespace(raw_authority_whale_payload_bytes=None)has no such attribute.Fix: patch
polylogue.paths.archive_root/polylogue.paths.render_rootdirectly — the exact seam ~20 other tests in this same file already use to sidestep this identical env-fallback path. This keepsload_polylogue_config's existing zero-arg patch scoped to the one call site it's actually meant for (_resolve_raw_materialization_whale_blob_limit_bytes).This also resolves
polylogue-010x: patchingload_polylogue_configalone made these tests pass only when some other test'sPOLYLOGUE_ARCHIVE_ROOToverride happened to leak into this test's environment (order-dependent). Patchingarchive_root()directly makes the archive root deterministic regardless of run order.Solution
tests/unit/daemon/test_daemon_cli.py: both whale-pass tests now take atmp_pathfixture andmonkeypatch.setattr("polylogue.paths.archive_root", ...)/render_rootbefore invoking_maybe_run_raw_materialization_whale_pass.archive_root()'s env-fallback behavior is correct as designed (per its own docstring, polylogue-4ma3).Anti-vacuity
The production dependency exercised is the real
archive_root()->resolve_archive_root()->load_polylogue_config(_bootstrap=...)fallback chain inpolylogue/config.pyandpolylogue/paths/_roots.py; reverting this diff (restoring the zero-arg lambda) reproduces the originalTypeErrordeterministically, both in isolation and file-scope.Verification
Ref polylogue-jsxj, polylogue-010x