Repository navigation
fix: close scope gaps — bare CLI, ingest contract, FK test - #902
Conversation
|
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 (3)
📝 WalkthroughWalkthroughThe PR adds typed daemon response parsing via ChangesDaemon Response Handling and Status Display Integration
🎯 2 (Simple) | ⏱️ ~12 minutes
✨ 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.
Pull request overview
This PR tightens a few “contract gaps” across CLI and storage: it makes bare polylogue show a fast status-oriented view when possible, aligns CLI ingest output with the shared ImportOperation envelope, and adds a regression test around the messages.parent_message_id FK behavior during conversation deletion.
Changes:
- Bare
polyloguenow prefersshow_fast_status()(daemon-first, SQLite fallback) when not in verbose mode. polylogue ingestnow parses the daemon response viaImportOperation.from_dict()and prints from the typed envelope.- Adds a unit test exercising deletion of a conversation containing a parent/child/grandchild message chain.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
polylogue/cli/click_app.py |
Routes the no-args CLI path through show_fast_status() when not verbose, else falls back to the existing archive summary. |
polylogue/cli/commands/ingest.py |
Switches CLI ingest to interpret daemon responses via ImportOperation instead of ad-hoc dict access. |
tests/unit/storage/test_backend.py |
Adds a regression test for deleting a conversation containing self-referential message chains. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with urlopen(req, timeout=5) as resp: | ||
| result = json.loads(resp.read()) | ||
| raw = json.loads(resp.read()) | ||
| except OSError as exc: |
| operation = ImportOperation.from_dict(raw) | ||
| if operation.status not in ("failed", "error"): | ||
| env.ui.console.print( | ||
| f"[bold green]Scheduled:[/bold green] {result['path']}\n" | ||
| f" Operation: {result['operation_id']}\n" | ||
| f" {result['message']}" | ||
| f"[bold green]Scheduled:[/bold green] {operation.path}\n" |
| try: | ||
| from polylogue.cli.commands.status import show_fast_status | ||
|
|
||
| show_fast_status(env) | ||
| return | ||
| except Exception: | ||
| pass |
| async def test_parent_message_id_self_referential_fk( | ||
| tmp_path: Path, | ||
| ) -> None: | ||
| """messages.parent_message_id FK uses NO ACTION — conversation-scoped deletion works.""" | ||
| from polylogue.storage.sqlite.async_sqlite import SQLiteBackend |
Three small slices for the user-facing CLI, the import- contract migration, and storage FK invariants. - #825 (bare CLI status): `polylogue/cli/click_app.py` wires bare `polylogue` (no subcommand) to `show_fast_status()` so the no-arg invocation matches the `polylogue status` command, satisfying #825's fast-feel acceptance criterion. - #861 (import contract): `polylogue/cli/commands/ingest.py` parses incoming JSON through `ImportOperation.from_dict()` instead of bespoke kwargs, sharing the typed contract from PR #883 with daemon HTTP and the live watcher. - #881 (FK regression): `tests/unit/storage/test_backend.py` adds a `parent_message_id` FK regression test pinning the `NO ACTION` policy from PR #881. Refs #825, #861, #881
Three small slices for the user-facing CLI, the import- contract migration, and storage FK invariants. - #825 (bare CLI status): `polylogue/cli/click_app.py` wires bare `polylogue` (no subcommand) to `show_fast_status()` so the no-arg invocation matches the `polylogue status` command, satisfying #825's fast-feel acceptance criterion. - #861 (import contract): `polylogue/cli/commands/ingest.py` parses incoming JSON through `ImportOperation.from_dict()` instead of bespoke kwargs, sharing the typed contract from PR #883 with daemon HTTP and the live watcher. - #881 (FK regression): `tests/unit/storage/test_backend.py` adds a `parent_message_id` FK regression test pinning the `NO ACTION` policy from PR #881. Refs #825, #861, #881
#825: wire bare polylogue to show_fast_status(). #861: CLI ingest uses ImportOperation.from_dict(). #881: add parent_message_id FK regression test.
Summary by CodeRabbit
New Features
Bug Fixes
Tests