Skip to content

fix(test): resolve confirmed regressions found in polylogue-p6rz re-triage - #3340

Merged
Sinity merged 3 commits into
masterfrom
chore/verify/p6rz-retriage
Jul 27, 2026
Merged

fix(test): resolve confirmed regressions found in polylogue-p6rz re-triage#3340
Sinity merged 3 commits into
masterfrom
chore/verify/p6rz-retriage

Conversation

@Sinity

@Sinity Sinity commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Fresh devtools verify --all re-triage of polylogue-p6rz ("pre-existing test
failures unrelated to MCP cutover") against current master. Fixes several
confirmed real regressions and stale test assertions found during the pass;
files properly-scoped follow-up beads for the rest instead of leaving them as
anonymous re-discoveries.

Problem

polylogue-p6rz's original list (from 2026-07-18) was stale: a lot has merged
since. A fresh devtools verify --all run (107 failed, 14 errors on the
pre-fix baseline) needed re-triage to separate fixed / persisting / newly
introduced failures, and specifically to catch any real regression from this
session's merges (query DSL AST schema, browser-capture approval flow,
GitHub effect adapters, continuity replay wiring, etc.).

Solution

Confirmed real regressions, fixed:

  • polylogue/config.py: PR refactor(mcp): collapse role ladder into independent capability config #3202's strict bool-env coercion rejected a blank
    POLYLOGUE_FORCE_PLAIN="" value with ConfigError instead of the old
    passthrough-as-falsy behavior, breaking a long-standing CLI test convention
    (and inconsistent with this same module's own NO_COLOR "blank means not
    requested" convention). Blank bool-key env values now resolve to False.
  • polylogue/storage/sqlite/queries/mappers_support.py and
    polylogue/storage/blob_integrity.py: PR perf(core): optionalize orjson via a three-tier JSON backend facade #3155's three-tier JSON facade
    introduced polylogue.core.json.JSONDecodeError (a ValueError subclass,
    NOT a stdlib json.JSONDecodeError subclass), but two call sites still
    caught the stdlib type — silently losing DatabaseError diagnostic
    wrapping (field/record id context) and blob-corruption graceful
    degradation since 2026-07-19.

Stale test assertions / drifted mocks, fixed:

Concurrent-session note: this branch was rebased onto master mid-flight
after another session's PR #3332 landed fixing the exact same
test_timestamp_guards.py hypothesis-6.161 mypy break I'd independently
found and fixed — kept master's version (identical st.one_of split
approach) rather than duplicating it.

Already tracked, not duplicated:

  • test_execution_control.py api.query_units naming mismatch +
    >=50000 VM steps anti-vacuity mutation tests → polylogue-1ldl (fully
    root-caused 2026-07-20: PR feat(query): bound agent-facing archive reads #3018 made the mutation-under-test no longer
    expensive at this data scale).
  • test_live_batch_support.py stale failed=[...] assertion → polylogue-5202.
  • test_archive_maintenance_cli.py / test_daemon_cli.py 6-node cluster →
    polylogue-p5li.
  • tests/infra/surfaces.py stale list_sessions/search MCP tool-name
    lookups (affects test_retrieval_readiness_laws.py,
    test_cross_surface_agreement.py) → polylogue-t46.8 (MCP tool-sprawl
    replacement epic; p6rz's own original text already called this
    out-of-scope).

New follow-up beads filed (confirmed pre-existing, not this-session
regressions, but not safe/minimal to fix inline):

  • polylogue-57w4 — repair path still disagrees with converger on
    NULL-sort-key session-profile staleness (regresses PR refactor(architecture): sqlite leak sweep, staleness unify, control-center decomposition #2900's own
    invariant; root cause not fully diagnosed).
  • polylogue-lbgc — seeded-archive corpus build hits database is locked
    under xdist parallel first-build (affects test_plain_cli_snapshots.py,
    test_schema_generation.py, likely others); confirmed not simple
    cross-worker contention (the build already holds an exclusive flock across
    the whole build+integrity-check section) — more likely an unclosed
    intra-process connection.
  • polylogue-e6a0 — test_index_v37_fast_forward.py's v36 fixture predates
    the action_pairs runtime index added by PR perf(storage): index write-path hot stages, memoize pricing catalog hash #3210; attempted fix revealed
    the fixture's intended "before" shape needs the full same-version
    benign-DDL-convergence set, not just ensure_runtime_indexes_sync
    reverted the attempt rather than ship an incomplete fixture.

No regression found from this session's headline PRs (query DSL AST schema,
browser-capture approval flow, continuity replay wiring) — the two GitHub
effect-adapter tests and the materialize_incident_evidence.py boundary
violation are environment/pattern issues in supporting test/command code, not
in the new capability logic itself.

Verification

  • devtools test on every changed test file individually: all green
    (see per-file evidence above).
  • mypy --strict on every changed .py file: clean.
  • ruff format --check / ruff check: clean.
  • Fresh devtools verify --all run against this branch in progress; will
    update this PR/polylogue-p6rz with the final authoritative count once it
    completes (~14 min runtime).

Ref polylogue-p6rz

Sinity added 3 commits July 27, 2026 19:28
Problem: PR #3202's strict bool-env coercion (_coerce_env_value) rejects
any POLYLOGUE_FORCE_PLAIN/NO_COLOR/etc value that isn't a recognized
1/true/yes/on/0/false/no/off token, including an explicitly blank ""
value -- raising ConfigError instead of the old passthrough behavior
that let `bool("")` fall through as falsy. This broke the long-standing
CLI test convention `env={"POLYLOGUE_FORCE_PLAIN": ""}` used to force a
clean/cleared override in tests, and is inconsistent with this same
module's own NO_COLOR convention ("set but blank" means "not
requested").

What changed: _coerce_env_value now treats a blank (whitespace-only)
bool-key env value as False before attempting token parsing, matching
the existing NO_COLOR blank-value convention. An unrecognized non-blank
token (e.g. "flase") still fails closed as before -- this only carves
out the "explicitly cleared" case, not typos.

Verification: devtools test tests/unit/cli/test_click_app.py::TestCliSetup::test_plain_mode_auto_detection_does_not_announce
tests/unit/core/test_config_inventory.py tests/unit/core/test_config.py
tests/unit/core/test_config_resolution_regression.py
tests/unit/core/test_privacy_config.py tests/unit/cli/test_config_command.py
(194 passed); mypy --strict polylogue/config.py clean.

Ref polylogue-p6rz
Problem: PR #3155 (three-tier JSON backend facade) made
polylogue.core.json.loads() raise its own polylogue.core.json.JSONDecodeError
(a ValueError subclass, not a subclass of stdlib json.JSONDecodeError) on
malformed input. Two call sites still caught the stdlib exception type:

- storage/sqlite/queries/mappers_support.py::_parse_json wraps decode
  failures in DatabaseError with diagnostic context (field, record id) --
  but since 2026-07-19 the custom JSONDecodeError propagates unwrapped
  instead, losing that diagnostic context entirely.
- storage/blob_integrity.py::_current_raw_payload_bytes similarly failed
  to catch a corrupt-blob decode failure, which would propagate instead
  of degrading to a "source_index:<reason>" unavailability tuple.

What changed: both call sites now import and catch
polylogue.core.json.JSONDecodeError explicitly instead of the stdlib
json.JSONDecodeError. mappers_support.py no longer needs the stdlib
`json` import at all.

Verification: devtools test tests/unit/storage/test_query_mappers.py
tests/unit/storage/test_blob_integrity.py
tests/unit/storage/test_blob_integrity_referenced_scan.py (34 passed);
mypy --strict on both changed files clean.

Ref polylogue-p6rz
… repository import

Problem: after rebasing onto current master, PR #3336's
polylogue/cli/commands/materialize_incident_evidence.py (landed
concurrently in another session) also constructs SessionRepository
directly instead of through AppEnv.repository -- the same pattern
already tracked for reconcile_work_effects.py in polylogue-a7uk.

What changed: added the second file to the boundary test's allow-list,
per its own documented remediation path, and broadened polylogue-a7uk's
scope to cover both commands rather than filing a near-duplicate bead.

Verification: devtools test tests/unit/architecture/test_surface_storage_boundary.py
(155 passed); ruff format/check and mypy --strict clean.

Ref polylogue-p6rz, polylogue-a7uk
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 22 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: ASSERTIVE

Plan: Pro Plus

Run ID: e8eafd29-13c3-4b0f-92ca-f6e8de06689e

📥 Commits

Reviewing files that changed from the base of the PR and between cd16172 and 31e5f04.

📒 Files selected for processing (12)
  • polylogue/config.py
  • polylogue/storage/blob_integrity.py
  • polylogue/storage/sqlite/queries/mappers_support.py
  • tests/unit/architecture/test_surface_storage_boundary.py
  • tests/unit/cli/__snapshots__/test_plain_cli_snapshots.ambr
  • tests/unit/cli/test_color_and_layout.py
  • tests/unit/cli/test_diagnostics.py
  • tests/unit/core/test_timestamp_guards.py
  • tests/unit/devtools/test_mandate_continuity_replay.py
  • tests/unit/operations/test_work_effect_reconciliation.py
  • tests/unit/storage/test_delegations_view.py
  • tests/unit/storage/test_durable_migrations.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/verify/p6rz-retriage

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.

@Sinity
Sinity merged commit 2c5a112 into master Jul 27, 2026
3 checks passed
@Sinity
Sinity deleted the chore/verify/p6rz-retriage branch July 27, 2026 17:40
@Sinity

Sinity commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

Final clean `devtools verify --all` run on this branch (rebased onto current master, all fixes committed):

```
85 failed, 17188 passed, 1 skipped, 1 xfailed, 14 errors in 762.35s
```

Down from the 107 failed / 14 errors pre-fix baseline. All 14 remaining errors are the already-tracked polylogue-lbgc "database is locked" seeded-archive xdist race (test_plain_cli_snapshots.py ×8, test_schema_generation.py ×6) — unchanged, not attempted in this pass (see PR body).

Confirmed via diff against the pre-fix failure list that every fix here landed cleanly (test_surface_storage_boundary, test_click_app, test_color_and_layout, test_diagnostics ×8, test_plain_cli_snapshots::test_json_status_snapshot, test_mandate_continuity_replay, test_work_effect_reconciliation, test_delegations_view ×3, test_durable_migrations ×2, test_query_mappers ×3 — all gone).

Two new observations not present in the pre-fix baseline, neither touched by this PR, both consistent with load/timing flakes rather than deterministic regressions:

  • `tests/unit/core/test_schema_observation_journal.py::test_single_jsonl_10x_replays_all_records_without_10x_python_memory` — `FileNotFoundError` reading a run's journal sqlite3 file between `glob()` and `stat()` (TOCTOU race against concurrent journal-file rotation).
  • `tests/benchmarks/test_full_session_replace.py::test_full_session_message_delete_uses_indexed_fk_cascade` appeared in the pre-fix baseline but not here — benchmark/timing flake under variable system load.

Full triage detail is in polylogue-p6rz's notes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant