Repository navigation
feat: tail ahead-of-archive source sessions - #392
Conversation
Problem\n\nPolylogue could only query the stable archive state. For Claude Code\nsessions still advancing on disk, that meant users had to choose between\nwaiting for ingest or inventing a separate live-mode model with different\nquery semantics.\n\nWhat changed\n\nAdd a temporary tail overlay that snapshots the stable archive into a\nthrowaway SQLite database, reparses supported source files that are ahead\nof archive state, and runs the normal query path against that overlay.\nExpose tail provenance on conversation and summary payloads, preserve\nsummary-query lightweight provider metadata by projecting only the\ntail_overlay fragment, and add the root --tail flag plus read-only route\nguards.\n\nCompatibility\n\nThe stable archive remains authoritative and unchanged. --tail is opt-in,\ncurrently scoped to configured Claude Code sources, and unsupported for\nmutation and open routes.\n\nRef #308\nCo-Authored-By: Claude <[email protected]>
Problem\n\nThe new tail overlay path spans real Claude Code source discovery,\noverlay materialization, query execution, summary projection, and CLI\nhelp surfaces. Without direct coverage, it would be easy to regress the\nsemantics while the stable archive path still passes.\n\nWhat changed\n\nAdd runtime tests for ahead-of-archive replacement, unseen sessions,\nparse-failure fallback, and archive catch-up. Add CLI coverage for JSON\nlist output and unsupported-source errors, extend query execution tests\nfor rejected mutation/open routes, and refresh terminal help snapshots.\n\nRef #308\nCo-Authored-By: Claude <[email protected]>
Problem\n\nThe root CLI help gained a new tail query flag and example. The rendered\nreference needs to match the live surface so operators can discover the\nfeature without reading implementation details.\n\nWhat changed\n\nRegenerate the CLI reference after adding the --tail option and example.\n\nRef #308\nCo-Authored-By: Claude <[email protected]>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 52 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (15)
✨ Finishing Touches🧪 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: 63cd6c3f16
ℹ️ 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".
## Summary Add an opt-in `--tail` query mode that runs the normal query path against a throwaway overlay archive built from source files that are ahead of stable archive state. Query semantics stay the same as non-tail mode; the only addition is machine-readable provenance showing when a result came from source state the archive has not caught up to yet. ## Problem `#308` originally used a looser “live session” framing, but the actual need is narrower and more concrete: users want to tail sources that have advanced on disk without inventing a separate transcript ontology or a second query model. Before this change, Polylogue could only query the stable archive. Claude Code sessions that were newer on disk were invisible until the next ingest, and any attempt to expose that state risked drifting into bespoke live-only semantics. ## Solution - add `polylogue.pipeline.tail_overlay` and `polylogue.lib.tail_overlay` to snapshot the stable archive into a temporary SQLite overlay and materialize ahead-of-archive Claude Code source state there - keep the normal query planner and execution path intact by routing `--tail` queries through the overlay runtime services instead of inventing a second query surface - expose tail provenance on conversation and summary runtime models plus JSON surface payloads - preserve summary-query lightweight metadata behavior by projecting only the `tail_overlay` fragment out of `provider_meta` - add read-only guardrails for mutation/delete/open routes while rendered artifacts still reflect stable archive state - cover replacement, unseen-session, parse-failure fallback, catch-up, and CLI help/output behavior with direct runtime tests ## Verification - `mypy --strict polylogue/cli/query.py polylogue/lib/tail_overlay.py polylogue/pipeline/tail_overlay.py polylogue/surface_payloads.py polylogue/lib/conversation_runtime.py polylogue/lib/conversation_summary_runtime.py polylogue/storage/backends/queries/conversations_reads.py` - `pytest -q tests/unit/pipeline/test_tail_overlay_runtime.py tests/unit/cli/test_tail_query_runtime.py tests/unit/cli/test_click_app.py tests/unit/cli/test_query_exec.py` - `pytest -q tests/unit/storage/test_store_ops.py::test_list_summaries_by_query_omits_large_provider_meta_payloads tests/unit/cli/test_tail_query_runtime.py tests/unit/cli/test_terminal_snapshots.py --snapshot-update` - `devtools render-all` - `devtools verify` - `git push -u origin feature/feat/tail-ahead-of-archive-sessions` (pre-push `devtools verify --quick`) Closes #308
|
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. |
Summary
Add an opt-in
--tailquery mode that runs the normal query path against athrowaway overlay archive built from source files that are ahead of stable
archive state. Query semantics stay the same as non-tail mode; the only
addition is machine-readable provenance showing when a result came from
source state the archive has not caught up to yet.
Problem
#308originally used a looser “live session” framing, but the actual need isnarrower and more concrete: users want to tail sources that have advanced on
disk without inventing a separate transcript ontology or a second query model.
Before this change, Polylogue could only query the stable archive. Claude Code
sessions that were newer on disk were invisible until the next ingest, and any
attempt to expose that state risked drifting into bespoke live-only semantics.
Solution
polylogue.pipeline.tail_overlayandpolylogue.lib.tail_overlaytosnapshot the stable archive into a temporary SQLite overlay and materialize
ahead-of-archive Claude Code source state there
--tailqueries through the overlay runtime services instead of inventing a second
query surface
surface payloads
tail_overlayfragment out ofprovider_metaartifacts still reflect stable archive state
help/output behavior with direct runtime tests
Verification
mypy --strict polylogue/cli/query.py polylogue/lib/tail_overlay.py polylogue/pipeline/tail_overlay.py polylogue/surface_payloads.py polylogue/lib/conversation_runtime.py polylogue/lib/conversation_summary_runtime.py polylogue/storage/backends/queries/conversations_reads.pypytest -q tests/unit/pipeline/test_tail_overlay_runtime.py tests/unit/cli/test_tail_query_runtime.py tests/unit/cli/test_click_app.py tests/unit/cli/test_query_exec.pypytest -q tests/unit/storage/test_store_ops.py::test_list_summaries_by_query_omits_large_provider_meta_payloads tests/unit/cli/test_tail_query_runtime.py tests/unit/cli/test_terminal_snapshots.py --snapshot-updatedevtools render-alldevtools verifygit push -u origin feature/feat/tail-ahead-of-archive-sessions(pre-pushdevtools verify --quick)Closes #308