Skip to content

feat(storage): ArchiveWriteGateway, tags M2M, insights.db, blob GC (#618, #722, #750) - #756

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/storage-v2-write-gateway
May 3, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/storage-v2-write-gateway

Conversation

@Sinity

@Sinity Sinity commented May 3, 2026

Copy link
Copy Markdown
Owner

Rebased on post-rename master. Storage v2 corrections. 10 files.

#618, #722, #750)

Problem: write side effects (FTS repair, cache invalidation) were
scattered across ingest_batch.py; schema v4 lacked tags M2M, blob GC
lease tables, and insights.db separation.

Solution:
- E1: ArchiveWriteGateway + write_effects — canonical write path with
  daemon RPC stub (slice G), process-local async lock, and consolidated
  side effects (FTS repair, cache invalidation) in write_effects.py.
  ingest_batch.py's post-write path routes through the gateway.
- E2: Tags M2M (tags + conversation_tags tables), blob lease tables
  (pending_blob_refs, gc_generations) added to schema DDL.
  InsightsDB class with separate insights.db lifecycle.
- E3: run_blob_gc() with lease, generation, and MIN_AGE safety guards.
- Schema v4->v5 upgrade plan; v3 and v2 paths composed forward.

Modules touched:
  polylogue/archive/write_effects.py       — new (canonical side effects)
  polylogue/archive/write_gateway.py       — new (gateway + lock)
  polylogue/insights/storage.py            — new (insights.db)
  polylogue/storage/blob_gc.py             — new (GC with leases)
  polylogue/pipeline/services/ingest_batch.py — redirected through gateway
  polylogue/storage/backends/schema.py     — v4->v5 upgrade action
  polylogue/storage/backends/schema_bootstrap.py — extension desc, v4->v5 plan
  polylogue/storage/backends/schema_ddl.py — version 5, new DDL composition
  polylogue/storage/backends/schema_ddl_archive.py — TAGS_M2M_DDL, BLOB_LEASE_DDL
  CHANGELOG.md                             — unreleased entries

Verification: ruff check + mypy pass on all new/modified files.
  ruff format --check: 9 files already formatted
  ruff check: All checks passed
  mypy: Success: no issues found in 4 source files
  Schema bootstrap decisions verified: v2/v3/v4/v5 all route correctly

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings May 3, 2026 11:52
@Sinity
Sinity merged commit 937997b into master May 3, 2026
2 checks passed
@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 30 minutes and 1 second before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5b08eb58-5f22-4bc2-a5a2-75599ee91a1e

📥 Commits

Reviewing files that changed from the base of the PR and between d761970 and 506b1f4.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • polylogue/archive/write_effects.py
  • polylogue/archive/write_gateway.py
  • polylogue/insights/storage.py
  • polylogue/pipeline/services/ingest_batch.py
  • polylogue/storage/blob_gc.py
  • polylogue/storage/sqlite/schema.py
  • polylogue/storage/sqlite/schema_bootstrap.py
  • polylogue/storage/sqlite/schema_ddl.py
  • polylogue/storage/sqlite/schema_ddl_archive.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/storage-v2-write-gateway

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
Review rate limit: 0/1 reviews remaining, refill in 30 minutes and 1 second.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity deleted the feature/feat/storage-v2-write-gateway branch May 3, 2026 11:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 506b1f4412

ℹ️ 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".

Comment thread polylogue/storage/blob_gc.py Resolved
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 72.F055 / P1: fixed-already at the checked revision: polylogue/storage/blob_gc.py:478 walks shard directories and :484 walks their files, reconstructing the full hash at :490. Normal two-level blob paths are therefore included in GC candidates.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 76.F066 / P1: refuted at the checked revision: Repairing the old v2-to-v5 in-place upgrade plan would reinstate an upgrade route for predecessor archive state. The fresh-format contract excludes migration or readback of earlier Polylogue state, while allowing new external source ingestion. See AGENTS.md:75.

Only the rows listed above are dispositioned. Held findings remain open.

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