Skip to content

fix(storage): harden source train continuity refresh - #3924

Merged
Sinity merged 2 commits into
masterfrom
feature/fix/source-continuity-completion
Aug 10, 2026
Merged

fix(storage): harden source train continuity refresh#3924
Sinity merged 2 commits into
masterfrom
feature/fix/source-continuity-completion

Conversation

@Sinity

@Sinity Sinity commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Harden receipt-backed source-train continuity refresh for authorized source-tier mutations.

Problem

PR #3868 supplied the continuity refresh route, but its regression had drifted to a hard-coded source version and the guard lacked a direct typed rejection for wrong-tier pre-mutation evidence.

Solution

  • Keep the real backup/receipt/archive/schema/operation/post-evidence continuity route fail-closed.
  • Make the liveness regression follow the current source train.
  • Reject non-source pre-mutation evidence explicitly.
  • Keep production source mutation under the phase-2 live receipt; this PR does not mutate production.

Verification

  • Focused durable/liveness/CLI suite: 97 passed.
  • devtools verify --quick: 24 checks passed.
  • Red reproduction failed before the explicit wrong-tier guard.
  • Fresh adversarial review found no legitimate AC gaps.

Sinity added 2 commits August 10, 2026 17:10
The unreleased source-train fixture named source train 029 even though the live source tier is now version 031, so the production continuity guard skipped the fixture. Bootstrap also creates the train-state directory before the test does.

Load the current packaged source train sidecar and tolerate the bootstrap-created directory so the test reaches reconcile_blob_ref_liveness and rejects the unreleased train before a receipt is written.

Verification: focused durable/liveness/CLI suite (97 passed); devtools verify --quick (24 checks passed).

Ref polylogue-6k0na
Source continuity refresh now rejects pre-mutation evidence unless it is explicitly source-tier evidence before reading mutation receipts or backup manifests.

A real file-backed SQLite regression exercises the released-train refresh route with USER-labeled evidence and proves the direct fail-closed rejection.

Ref polylogue-6k0na
@coderabbitai

coderabbitai Bot commented Aug 10, 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: 35 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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 Plus

Run ID: 5388b51d-3361-4d28-839b-2b7ce680e6b7

📥 Commits

Reviewing files that changed from the base of the PR and between d8ba0e3 and a81073c.

📒 Files selected for processing (3)
  • polylogue/storage/sqlite/durable_change_train.py
  • tests/unit/storage/test_blob_ref_liveness.py
  • tests/unit/storage/test_durable_change_train.py

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 e33fbca into master Aug 10, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/fix/source-continuity-completion branch August 10, 2026 15:47
Sinity added a commit that referenced this pull request Aug 10, 2026
## Summary

Restore the guarded acceptance-contract snapshot for the 216 safely
reconciled Beads records and record the closure of the three
implementation lanes whose reviewed PRs are already merged.

## Problem

The merged repository contained the acceptance-contract tooling and
historical contract wave, but the current `.beads/issues.jsonl` snapshot
had lost nearly all structured contracts after a stale export. Three
implementation Beads also remained in progress after their exact-head
PRs merged.

## Solution

- Reconciled the historical contract snapshot against the current issue
population with the guarded repository reconciler.
- Imported 216 exact/timestamp-safe contract rows and adjudicated the
two drifted manifest rows (`4n8k` and `fbkr`) separately; the latter now
carries a fresh contract bound to its current closed record.
- Closed `fbkr`, `q4qpl`, and `6k0na` only for their implementation/test
scope, retaining live-operation successors and residual production work.
- Preserved the two operator-action rows without invented implementation
contracts.

## Verification

- Guarded reconciliation: 216 rows applied; two drifted rows separately
adjudicated.
- Structured contract population: 218 records present after import.
- `devtools lab policy bead-graph`: no cycles, no invalid contracts, and
no missing required contracts; two deferred operator-action rows remain
intentionally without AC (`av2g`, `n2f4`).
- Merged implementation evidence is recorded in the three closed Beads
and the exact PR carriers below.

<!-- polylogue-pr-scope:v1
{
  "assigned_beads": [
    "polylogue-fbkr",
    "polylogue-q4qpl",
    "polylogue-6k0na"
  ],
"beads_digest":
"1dba3dcb4de072e61123ac05863732ba9c05715f586651ec3ea69039db26beaf",
  "dispositions": [
    {
      "bead_id": "polylogue-fbkr",
      "disposition": "partial",
      "evidence": [
        {"kind": "commit", "ref": "d8ba0e3a9da6 merged PR #3922"},
{"kind": "test", "ref": "raw-authority frontier focused tests and quick
gate passed"},
{"kind": "review", "ref": "late mutation-preservation assertion repaired
and independently checked"}
      ],
      "successors": ["polylogue-c0z2a"]
    },
    {
      "bead_id": "polylogue-q4qpl",
      "disposition": "satisfied",
      "evidence": [
        {"kind": "commit", "ref": "b941e330b152 merged PR #3923"},
{"kind": "test", "ref": "focused maintenance/CLI provenance suite and
quick gate passed"},
{"kind": "review", "ref": "offline post-promotion reconciliation
regression covered both checkpoint-write failures"}
      ],
      "successors": []
    },
    {
      "bead_id": "polylogue-6k0na",
      "disposition": "satisfied",
      "evidence": [
        {"kind": "commit", "ref": "e33fbcac2 merged PR #3924"},
{"kind": "test", "ref": "focused durable/liveness/CLI suite: 97
passed"},
{"kind": "command", "ref": "devtools verify --quick: 24 checks passed"}
      ],
      "successors": []
    }
  ],
  "head_sha": "d4c2e4ef3fb46d84af7120d414967c7d7f87f49d",
"scope_digest":
"edc3f90b7a687388dbe8a8385ae352673718b510edc8a2a0db70069088012508",
  "version": 1
}
-->
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