feat(reads): align live queries to Raft horizons (EN-1946) - #1890
Conversation
✅ Approve — automated reviewNo actionable correctness defects remain in the current diff. Previously raised documentation and projection-selectivity concerns have been addressed at HEAD. No findings. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/en-1946-projection-certificates #1890 +/- ##
========================================================================
- Coverage 83.43% 83.20% -0.24%
========================================================================
Files 459 459
Lines 42645 42757 +112
========================================================================
- Hits 35581 35574 -7
- Misses 7059 7178 +119
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6f144ba to
b515155
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1890 (comment)
b515155 to
7bf2b05
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot review complete: no remaining inline findings.
Resolved 1 stale NumaryBot review thread (1 fixed, 0 outdated).
Summary: #1890 (comment)
7bf2b05 to
b1324aa
Compare
b1324aa to
f6c823d
Compare
f6c823d to
c6abd2e
Compare
|
This PR (EN-1946) reworks cross-projection read alignment so that filtered reads wait for each projection's Raft certificate at a fixed main-store applied-index horizon Standards[P2][blocking] Canonical docs remove a still-supported prepared-query field
[P2][blocking] Stale checkpoint comment contradicts the implemented behavior
[P3][non-blocking] Intentional error discards lack the required justification commentsNew bare [P3][non-blocking] Duplicated "read H, assert ≥ R" horizon logic
[P3][non-blocking]
|
Final review — PR #1890 ("feat(reads): align live queries to raft horizons")This PR replaces sequence-cursor alignment of asynchronous projections with fixed Raft-horizon certificates ( Standards[P2] Canonical API docs drop a field the live API still honors. [P2] "It waits only for projections the query actually uses" is not what the code does. [P2] Stale checkpoint-limitation comment contradicts the new contract. [P3] New [P3] Duplicated main-horizon/ReadIndex check. [P3] Unused exported reservation API. SpecNo spec available — no confirmed material finding. There is no issue reference in the commit message, no reachable linked tracker entry (EN-1946 lives in an external Linear instance), and the PR body is a one-line stack note, so no requirement-level specification could be verified against the diff. Candidate spec findings that referenced unverifiable external requirements were not retained; the verifiable code/doc contradictions they surfaced are reported under Standards above. Reviewed independently by GLM (glm-5.3-flash) and Codex (gpt-5.6-sol) via Shipfox; verified and synthesized by GLM. |
|
This PR replaces fold-cursor-based cross-store alignment with a fixed-Raft-horizon scheme: a main-store snapshot's durable applied index Recommendation: request changes (single small documentation fix; everything else is non-blocking). Standards[P2][blocking] [P3][non-blocking] New bare [P3][non-blocking] Duplicated wrapper/alignment shapes invite drift [P3][non-blocking] [P3][non-blocking] New "waits only for projections the query actually uses" claim is broader than the code SpecNo spec is available for this PR: the commit message ( Reviewed independently by GLM (glm-5.3-flash) and Codex (gpt-5.6-sol) via Shipfox; verified and synthesized by GLM. |
c6abd2e to
c5e68ed
Compare
|
This PR rewires cross-store alignment from a native-sequence fold wait to fixed Raft-horizon certificates, and updates the read-path documentation accordingly. The core mechanism (fixed main-store horizon Standards[P2] [P2] [P2] Filtered reads against pre-certificate query checkpoints now hard-fail, with no migration. Before this diff, [P2] Obsolete checkpoint-limitation comment contradicts the changed behavior. [P3] Intentional error discards lack the required justification comment. The new code in Judgement calls (not blocking):
SpecReviewing against the PR-body specification ("align each live read only with the projections it uses, at the fixed main-store snapshot horizon"), one confirmed failure: [P2] Main-store-only transaction filters still wait for the read projection. No other missing/incorrect requirement or material scope creep was confirmed. Reviewed independently by GLM (glm-5.3-flash) and Codex (gpt-5.6-sol) via Shipfox; verified and synthesized by GLM. |
Review summaryThis PR (EN-1946, base Recommendation: request changes — the code needs no structural rework, but the blocking documentation contradictions below must be resolved (and the spec deviation either fixed or explicitly acknowledged) before merge. Standards[P2][blocking]
|
c5e68ed to
841ac7c
Compare
|
This PR reworks live-read alignment onto fixed Raft horizons: each read pins the main store's durable applied index Standards[P2][blocking] The canonical API-surface table now misstates the still-honored [P2][blocking] "Waits only for projections the query actually uses" is not what the code does [P2][blocking] Stale checkpoint-limitation comment contradicts the implemented wait-and-fail contract [P2][blocking] Checkpoints created before the certificate keys existed now hard-fail their reads (upgrade compatibility) [P3][non-blocking] Intentional error discards lack justification comments [P3][non-blocking][judgement call] Duplicated main-horizon check [P3][non-blocking][judgement call] Speculative generality: Considered and rejected: the e2e rewrites in SpecSpec source: the PR's own stated requirement — "Consumes the projection certificates from the preceding PR to align each live read only with the projections it uses, at the fixed main-store snapshot horizon." [P2] Main-store-only filters still wait for a projection they do not use Reviewed independently by GLM (glm-5.3-flash) and Codex (gpt-5.6-sol) via Shipfox; verified and synthesized by GLM. |
|
This PR reworks live-read alignment: each read now pins a fixed main-store applied index Standards[blocking] Authoritative API doc drops a field the API still honors
[blocking] Stale checkpoint-limitation comment contradicts the changed behavior
[non-blocking] "Waits only for projections the query actually uses" is false as written
[non-blocking] Bare
|
841ac7c to
699b21e
Compare
a8a00ec to
1797d3d
Compare
|
This PR rewires live reads so each query aligns only with the projections it actually uses, at a fixed main-store Raft horizon ( Recommendation: approve with comments. Standards
SpecNo confirmed material finding. No usable spec exists for this change: the PR body is a single line ("Stack 2/7 for EN-1946") referencing an internal tracker not available for review, so the Spec axis is empty by construction. Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
1797d3d to
0731c81
Compare
|
This PR replaces the best-effort audit/read-index contract with a fixed-horizon, certificate-gated alignment: filtered audit reads wait for the audit projection's Raft certificate at the main snapshot's durable applied index Standards
SpecNo spec is available for this change, so the Spec axis has no confirmed material finding. Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
0731c81 to
4553f98
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1890 (comment)
|
Final review of formancehq/ledger PR #1890 — "feat(reads): align live queries to Raft horizons (EN-1946)" (fixed point 0004a07 → 4553f98). This PR replaces the fold-sequence alignment model with fixed-Raft-horizon alignment: routed linearizable reads now carry their Standards
Rejected candidate findings: the "intentional error discards lack justification comments" item (40+ identical pre-existing bare SpecNo spec is available for this PR, so the Spec axis has no confirmed material finding. Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
4553f98 to
e2f0ef0
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot review complete: no remaining inline findings.
Resolved 1 stale NumaryBot review thread (1 fixed, 0 outdated).
Summary: #1890 (comment)
|
This PR reworks cross-store read alignment: linearizable reads now fix a main-store Raft horizon Standards
SpecNo spec was available for this change: the commit message ( Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
e2f0ef0 to
ee4972e
Compare
|
This PR moves projection-backed reads from fold-sequence alignment to Raft-certificate alignment at a fixed main-store applied index Standards
SpecNo spec is available for this PR: EN-1946 lives in an external tracker not reachable through the read-only GitHub integrations, the PR body is a one-line stack note, and no spec file exists in the repository or checkout. The Spec axis therefore has no confirmed material finding. Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
ee4972e to
42c85e9
Compare
42c85e9 to
81726d5
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1890 (comment)
Final review — PR #1890 (feat/read-alignment)Fixed point I verified both candidate reports against Recommendation: approve with comments. All confirmed findings are maintainability/drift risks, none affects current behavior. Standards
SpecNo spec is available for this PR; the spec axis was not reviewed. Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
|
Final ownership pass on 81726d5: fixed authoritative consistency docs/comments and projection selectivity; all inline threads are answered and resolved. The latest reclaim-hold claim was rejected with code evidence: callers retain ownership and release on every error or defer path. Canonical full+E2E+Schemathesis validation PASS; exact final review APPROVE (MEDIUM). |
81726d5 to
de64081
Compare
|
This PR (EN-1946) replaces the fold-sequence alignment of read/audit projections with a fixed main-store Raft horizon: reads now capture a durable Standards
Checked and clean: new tests use SpecNo confirmed material finding. All five PR-body requirements are implemented faithfully and were verified in code:
One behavior tightening was examined and judged in-scope rather than scope creep: a frozen checkpoint whose projection certificate lags its applied index now fails explicitly ("frozen read projection … behind main checkpoint horizon" / Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
|
This PR fixes the main read/audit horizon at the already-open main snapshot ( Standards
SpecAll five PR-body bullets are implemented as specified: fixed horizon
Reviewed independently by GLM (glm-5.3-flash) and DeepSeek (deepseek-v4-pro-0813) via Shipfox; verified and synthesized by GLM. |
Summary
Stack
EN-1946 stack 3/8. Depends on #1889 (feat/en-1946-projection-certificates).
Merge/review order: #1897 → #1889 → #1890 → #1894 → #1891 → #1893 → #1892 → #1881.
Validation
Final base: 01f5df3.
Final head: de64081.
Canonical PR validation: PASS, including full race validation, business/cluster E2E, and Schemathesis 62/62.
Independent exact diff review: APPROVE (residual risk MEDIUM).
Jira: EN-1946. Do not merge automatically.