Skip to content

fix(storage): restore literal_check deleted out from under live call sites - #3467

Closed
Sinity wants to merge 1 commit into
masterfrom
feature/fix/set-based-superset-coalescing
Closed

fix(storage): restore literal_check deleted out from under live call sites#3467
Sinity wants to merge 1 commit into
masterfrom
feature/fix/set-based-superset-coalescing

Conversation

@Sinity

@Sinity Sinity commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

Restores literal_check in polylogue/storage/sqlite/archive_tiers/common.py, deleted by #3458 as an "uncalled generator" while it actually had two live call sites in archive_tiers/index.py's delegation_facts DDL, breaking the storage import chain on master.

Problem

Investigating polylogue-oycw (verifying the set-based revision-comparison fix landed in #3401/#3405), the very first devtools status / any test import failed with:

ImportError: cannot import name 'literal_check' from 'polylogue.storage.sqlite.archive_tiers.common'

Root cause: #3458 (merged 2026-07-31 16:11, same day) deleted literal_check, claiming a zero-call-site audit. That audit was wrong — archive_tiers/index.py:1642 and :1657 call literal_check("mapping_state", *get_args(DelegationMappingState)) and literal_check("result_status", *get_args(DelegationResultStatus)) in the delegation_facts table DDL, built at module import time. Since archive_tiers/__init__.py imports index.py eagerly, this broke import polylogue.storage.sqlite.archive_tiers entirely — and with it ArchiveStore, devtools status, and any pytest collection that touches storage (i.e. nearly the whole toolchain).

Solution

Restored literal_check verbatim (plus its sql_string_literal import from polylogue.core.enums), added back to __all__, with a docstring noting the deletion's justification was incorrect and to re-verify with a real grep before deleting again.

No behavior change beyond restoring the previously-working import chain — this is a pure revert of one function's deletion.

Verification

python3 -c "import polylogue.storage.sqlite.archive_tiers.index; \
            from polylogue.storage.sqlite.archive_tiers.archive import ArchiveStore"
# previously: ImportError. now: succeeds.

devtools status
# previously: crashed with the same ImportError. now: runs.

devtools test tests/unit/storage/test_archive_tiers_common.py tests/unit/archive/test_session_revision_membership.py
# 48 passed in 5.08s

devtools verify --quick
# exit_code: 0 (format, lint, mypy, render all --check, plus this repo's lab/schema/manifest checks)

Filed while closing polylogue-oycw with full AC verification (already satisfied by #3401/#3405, see that bead's closing notes) — this fix was a blocking prerequisite for running any of that verification, not part of oycw's own scope.

Ref polylogue-oycw

…sites

Problem: PR #3458 (5798b3d, merged 2026-07-31) deleted `literal_check`
from `archive_tiers/common.py` as an "uncalled generator", but
`archive_tiers/index.py`'s `delegation_facts` DDL calls it twice
(`mapping_state` and `result_status` CHECK clauses, built at module import
time). The deletion broke `import polylogue.storage.sqlite.archive_tiers`
on master -- and therefore ArchiveStore, the CLI, devtools, and every test
that touches storage, i.e. essentially the whole toolchain. `devtools
status` and any pytest collection that imports `polylogue.storage` failed
outright before this fix.

What changed: restored `literal_check` (and its `sql_string_literal`
import) verbatim, with a docstring noting the deletion was based on a
"zero call sites" audit that was wrong -- both call sites are plain
`literal_check(...)` calls in index.py, not aliased or generated. Added
back to `__all__`.

Verification: `python3 -c "import polylogue.storage.sqlite.archive_tiers.
index"` and `from ...archive import ArchiveStore` both succeed (previously
ImportError). `devtools status` runs. `devtools test
tests/unit/storage/test_archive_tiers_common.py
tests/unit/archive/test_session_revision_membership.py` -- 48 passed.

Found and fixed as a blocking prerequisite while investigating
polylogue-oycw (the set-based revision-membership superset fix landed
same-day in #3401/#3405); could not run devtools/tests at all until this
regression was fixed.

Co-Authored-By: Claude <noreply@anthropic.com>
@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 31, 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: 47 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: 38f2725d-34c6-474f-a2f6-32def1714eb3

📥 Commits

Reviewing files that changed from the base of the PR and between 78ea7ed and ac62021.

📒 Files selected for processing (1)
  • polylogue/storage/sqlite/archive_tiers/common.py

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 commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

Superseded — a parallel lane independently found and fixed this exact regression, merged as #3464 shortly before this PR was opened. No remaining diff to land; closing without merge.

@Sinity Sinity closed this Jul 31, 2026
@Sinity
Sinity deleted the feature/fix/set-based-superset-coalescing branch July 31, 2026 14:51
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