Skip to content

fix(devtools): link archive tiers in fast-forward generations (#2805) - #2805

Merged
Sinity merged 1 commit into
masterfrom
feature/fix/v35-generation-sibling-links
Jul 12, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/fix/v35-generation-sibling-links

Conversation

@Sinity

@Sinity Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Make v35 fast-forward generations expose the same durable sibling tiers as ordinary index generations.

Problem

Live v35 activation proved that a generation containing only index.db breaks cross-tier reads: SQLite reports the resolved generation directory, so Drive catch-up could not attach source.db and failed with no such table: raw_sessions. The live generation was repaired with the canonical sibling links and Drive catch-up then completed with zero errors.

Solution

  • Link source.db, user.db, embeddings.db, ops.db, and blob into each fast-forward generation before validation.
  • Resolve links to the canonical archive-root targets, matching IndexGenerationStore.create.
  • Extend the real generation activation/rollback fixture to prove every sibling link is present and resolves correctly.

Ref polylogue-5ucz

Verification

  • devtools test tests/unit/devtools/test_index_fast_forward.py
    • 6 passed in 31.37s
  • devtools verify --quick
    • 15/15 steps passed, run 20260712T231116Z-quick-1982816-95cfc11e
  • pre-push devtools verify --quick
    • 15/15 steps passed, run 20260712T231256Z-quick-1990318-c68cbdc5
  • Live postflight after restoring the same links:
    • daemon health ok, index v35, user v6
    • Drive catch-up sources=1 raw=0 sessions=0 changed=0 errors=0
    • ports 8765 and 8766 owned by the deployed daemon

Fast-forward generations resolved index.db inside their generation directory but omitted the sibling-tier links created by the normal generation store. Cross-tier reads therefore could not find source.db after activation, breaking Drive catch-up.\n\nCreate canonical source, user, embeddings, ops, and blob links alongside the cloned index before validation. Extend the activation fixture to prove every link resolves to the live archive tier.\n\nRef polylogue-5ucz\n\nCo-Authored-By: Claude <[email protected]>
@Sinity Sinity changed the title fix(devtools): link archive tiers in fast-forward generations fix(devtools): link archive tiers in fast-forward generations (#2805) Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 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: 59 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

Run ID: 63a7e486-4cf4-48b4-a3f6-f732f837d130

📥 Commits

Reviewing files that changed from the base of the PR and between bfbecc1 and bace601.

📒 Files selected for processing (2)
  • devtools/index_fast_forward.py
  • tests/unit/devtools/test_index_fast_forward.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/v35-generation-sibling-links

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 merged commit ae65a84 into master Jul 12, 2026
3 of 13 checks passed
@Sinity
Sinity deleted the feature/fix/v35-generation-sibling-links branch July 12, 2026 23:14
Sinity added a commit that referenced this pull request Jul 13, 2026
## Summary

Reconciles the declared fast-forward plan layer onto the live-proven
v32→v35 executor deployed by #2804/#2805. The deployed executor remains
the only implementation of clone, activation, rollback, and recovery
behavior.

## Problem

PR #2788 was based before the executor landed and independently
implemented the same operational surface. The merge conductor correctly
held it: replacing a live-archive-proven executor would be unsafe and
would create two competing recovery mechanisms.

## Solution

- Keep the declarative layer in `polylogue/storage/sqlite/lifecycle.py`:
versioned delta classes, clone-safe operation metadata, policy coverage,
and explicit semantic-reparse routing.
- Drive the deployed executor’s canonical objects, receipt delta
classes, and exact stage order from the declared v32→v35 plan. Its
live-proven SQL, pressure checks, reflink handling, receipts, symlink
activation, rollback, and service checks are retained unchanged.
- Declare v36 as `semantic-reparse`: it is a source-origin vocabulary
change and is rebuild/reprocess-only, not clone SQL.
- Keep ma2’s v34 `idx_web_constructs_message` as the first `index-only`
plan operation and assert that the deployed executor receipt records
that declaration.
- Delete the branch’s competing executor/activation/rollback
implementation and its conflicting executor tests; no parallel entry
point remains.
- Retain the schema-version policy gate and generated docs/topology
projection.

## Acceptance criteria

| Bead | Status | Evidence |
| --- | --- | --- |
| `polylogue-9rw0` | partially satisfied; replay equivalence deferred to
`polylogue-p5r4` | Every current index bump is classified (v33–v35
clone-safe; v36 semantic reparse); policy rejects gaps; the deployed
v32→v35 executor consumes the plan and records stages/classes; semantic
deltas route away from executor SQL. Independent replay of sampled raw
bytes and hash comparison remains explicitly deferred. |
| `polylogue-ma2` | satisfied | v34 declares the FK-supporting index as
`index-only`; the deployed executor’s v32 fixture runs the canonical
index DDL and asserts `EXPLAIN QUERY PLAN` uses
`idx_web_constructs_message` without a table scan. No in-place migration
helper was added. |

## Verification

- `POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest
POLYLOGUE_PYTEST_WORKERS=0 nix develop --command devtools test
tests/unit/storage/test_index_fast_forward_lifecycle.py
tests/unit/devtools/test_index_fast_forward.py` → **13 passed**.
- `nix develop --command devtools lab policy schema-versioning` →
**Schema evolution policy intact**.
- `nix develop --command devtools verify --quick` → passed; the
subsequent pre-push hook reported `HEAD already verified (7527883)`.
- Executor census: `rg -l "def create_and_fast_forward_generation|def
fast_forward_clone" devtools polylogue tests -g '*.py'` → only
`devtools/index_fast_forward.py`.

Anti-vacuity: the executor integration test calls the deployed clone
path and checks receipt stages/classes against the production lifecycle
plan; removing that plan consumption or ma2’s operation fails it. The
policy test invokes the real schema-version lab command. The
pre-existing deployed executor tests still cover clone failure,
activation identity proof, rollback, tamper rejection, sibling links,
and restart rollback.

Ref polylogue-9rw0.
Ref polylogue-ma2.
Ref polylogue-p5r4.

---------

Co-authored-by: Codex <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
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