Repository navigation
fix: final gaps — stale docs, FK surfacing test (#820/#852) - #911
Conversation
- #852: update internals.md (bare polylogue is fast status, not search) - #820: add test proving FK violations are surfaced by ON CONFLICT DO NOTHING Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates documentation for CLI extension guidance and adds a test verifying SQLite foreign key constraint enforcement. The doc change clarifies that bare invocation shows daemon status with archive summary fallback; the test confirms FK violations are raised, not swallowed, when inserting invalid attachment references. ChangesCLI Documentation and Storage Verification
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1839807ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR addresses two “final gap” items tied to storage integrity and internal documentation accuracy: it adds a regression test meant to ensure attachment-ref FK violations are not silently swallowed, and it updates internals documentation to reflect the daemon-first CLI default behavior.
Changes:
- Add a unit test intended to assert FK violations are surfaced when inserting
attachment_refs(#820). - Update
docs/internals.mdCLI extension-point guidance to reflect bare-invocation status behavior (#852).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/unit/storage/test_backend.py |
Adds a new regression test around FK violation surfacing for attachment_refs. |
docs/internals.md |
Updates internal docs for CLI behavior on bare invocation (daemon status vs archive summary fallback). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from polylogue.storage.sqlite.schema_ddl_archive import ARCHIVE_STORAGE_DDL | ||
|
|
||
| db = tmp_path / "fk_surface.db" | ||
| conn = sqlite3.connect(str(db)) |
| # Try to insert an attachment_ref with a non-existent attachment_id | ||
| # ON CONFLICT DO NOTHING only handles ref_id conflicts — FK violations still raise | ||
| try: | ||
| conn.execute( | ||
| "INSERT INTO attachment_refs(ref_id, attachment_id, conversation_id) VALUES(?,?,?)", | ||
| ("ref-1", "nonexistent-attachment", "c1"), | ||
| ) | ||
| conn.commit() | ||
| # If we get here, the FK violation was NOT surfaced — this is a bug | ||
| raise AssertionError("FK violation should have raised IntegrityError") |
Direct, no-PR. Local repair in `tests/unit/storage/test_backend.py`: the wave that landed PRs #882/#903/#911 left two FK-test cases referencing helper names that had been renamed in the same wave, so `devtools verify` failed at the test stage even though every individual PR's CI was green. Realigns the helper names; pure test-file repair, no production code change.
Direct, no-PR. `tests/unit/storage/test_backend.py` accumulated regression cases from the FK / quarantine / FTS / blob waves (PRs #879/#881/#882/#903/#911) and exceeded its previous LOC budget. Bumps `docs/plans/file-size-budgets.yaml` to 1750 so `devtools verify-file-budgets` passes; the tests stay grouped in one place rather than splitting along an arbitrary cut.
Two acceptance-criteria leftovers from the closing wave. - #820 (storage integrity): adds an FK-violation surfacing test in `tests/unit/storage/test_backend.py` that proves the attachment-ref `ON CONFLICT(ref_id) DO NOTHING` path from PR #881 still surfaces real FK constraint violations rather than silently swallowing them. - #852 (execution graph): refreshes `docs/internals.md` to match the daemon-first architecture, removing stale references to the removed public `polylogue run` ingestion surface. #852 is the mass-execution control issue, not the work itself; the durable change here is the storage test and the docs refresh. Refs #820, #852
Direct, no-PR. Local repair in `tests/unit/storage/test_backend.py`: the wave that landed PRs #882/#903/#911 left two FK-test cases referencing helper names that had been renamed in the same wave, so `devtools verify` failed at the test stage even though every individual PR's CI was green. Realigns the helper names; pure test-file repair, no production code change.
Direct, no-PR. `tests/unit/storage/test_backend.py` accumulated regression cases from the FK / quarantine / FTS / blob waves (PRs #879/#881/#882/#903/#911) and exceeded its previous LOC budget. Bumps `docs/plans/file-size-budgets.yaml` to 1750 so `devtools verify-file-budgets` passes; the tests stay grouped in one place rather than splitting along an arbitrary cut.
Two acceptance-criteria leftovers from the closing wave. - #820 (storage integrity): adds an FK-violation surfacing test in `tests/unit/storage/test_backend.py` that proves the attachment-ref `ON CONFLICT(ref_id) DO NOTHING` path from PR #881 still surfaces real FK constraint violations rather than silently swallowing them. - #852 (execution graph): refreshes `docs/internals.md` to match the daemon-first architecture, removing stale references to the removed public `polylogue run` ingestion surface. #852 is the mass-execution control issue, not the work itself; the durable change here is the storage test and the docs refresh. Refs #820, #852
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
#852: fix internals.md. #820: add FK violation surfacing test.
Summary by CodeRabbit