Repository navigation
raft: enable accepted-baseline protected startup - #1364
Conversation
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
…ootstrap Signed-off-by: bootjp <contact@bootjp.me>
|
Important Review skippedToo many files! This PR contains 416 files, which is 316 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files.
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (3)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Signed-off-by: bootjp <contact@bootjp.me>
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (1f95523):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
@codex review Please review exact latest HEAD 1f95523, including security review. The implemented scope is durable local intent/marker primitives plus a nonmutating exact-snapshot catalog plan, not runtime activation. Review canonical/aggregate size bounds, error propagation, atomic file ordering/crash boundaries, monotone identity/policy cross-checks, mutation/read-set cloning and unknown/lost-state behavior. Runtime startup/session/policy/baseline/admission remain explicitly incomplete and this PR remains Draft. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Checkpoint gates complete for HEAD 1f95523: explicit latest-head normal/security reviews and every CI check now pass, including full Go race/full-length gRPC, both Jepsen modes, TLA, lint, build, CodeQL and DCO. No new root inline findings. This remains Draft: only the local durable-format and nonmutating planner foundations are implemented, not the accepted v5 runtime, native baseline, authenticated sessions, guarded apply/receipts or operational readiness. The production direct-write diagnostic remains red and #1355 remains blocked by its actual P1, irrespective of this green checkpoint. |
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (6346b98):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
@codex review Review exact latest pushed HEAD6346b9817213badd49e4557f9df5861f466c5389 including security. Adds independently reviewed actual mTLS connection/exporter-bound peer-session primitives and bridge, atomic protected control/data/config/index staging for native and affected-key memory overlay, readiness caller composition, external snapshot/backup fail-closed and maintained durability/snapshot/OCC regressions. Two original store P2s plus actual SST projection-watermark P2 were reproduced and fixed; parent unchanged original independent regressions race3 PASS11.147s. All snapshots retain rows and exact advertised watermark; SST magic required, no row fallback. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Final verification receipt HEAD: The latest-push normal review and security review both identify this HEAD and report no findings. No new root inline findings were submitted for this push. Earlier approvals were not reused after subsequent pushes. All current CI checks succeed, including Linux race and unchanged full-length gRPC sequences, Jepsen encryption off/on, CodeQL, build, proto, lint, TLA and DCO. The Linux run first encountered an interrupted close in an unchanged in-memory FUSE fixture. The identical HEAD passed on attempt 2 without modifying or skipping that test. The precise interrupt origin remains unproven. Implemented in this checkpoint:
Focused validation evidence:
Scope remains the documented accepted-baseline profile and exact local startup rotation with active storage encryption. Encrypted legacy/offline migration, arbitrary external encryption admin operations, cold seed, lost-state replacement, protected membership changes and the full v5 snapshot/journal protocol are not claimed complete. Three-member encrypted fault injection remains outside the demonstrated E2E coverage. No production deployment or operational-stability claim is made. GitHub reports this non-draft PR MERGEABLE / CLEAN. The PR remains open and has not been merged. |
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (652c630):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
@codex review Latest HEAD: 652c630. Implemented explicit-key encrypted legacy data-group migration and authenticated external EncryptionAdmin.RotateDEK. Offline verification authenticates complete logical history and retained native state while preserving original ciphertext, epochs and nonce state. External requests retain the original receiver generation, require ADMIN bearer plus verified mTLS, and never replay an unknown command under a renewed process context. Added real encrypted legacy migration -> activation -> protected write/read/restart E2E, public RPC rotation/restart E2E, rejection/lost-reply checks and shutdown/panic lifetime tests. Independent review identified snapshot checkpoint/cutover boundary gaps; both are fixed and old-code overlays reproduce the regressions. Local evidence: root full race 355.435s; store 212.380s; native 190.969s; admission 1.672s; final migration/lifecycle race 10.540s, post-boundary migration race 10.288s; Jepsen unit 345 tests / 1391 assertions; composed lint zero issues. Commits are signed and Signed-off-by bootjp contact@bootjp.me. No deployment or production-stability claim. Encrypted scalar TSO migration, multi-member encrypted fault injection, cold seed and arbitrary protected membership remain outside this checkpoint. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review Retrying the reviewer infrastructure error at #1364 (comment). Please review current HEAD 652c630. No code has changed since the previous request. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 652c630872
ℹ️ 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".
Signed-off-by: bootjp <contact@bootjp.me>
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (66c2697):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
@codex review Please review latest HEAD 66c2697 after the final push. Addressed the protected QUIT P2: terminal validation and buffered reply publication precede physical close; trailing parsed pipeline commands and MULTI queued writes are discarded. Added real-wire, denied-terminal, child-join and panic regressions. Legacy behavior and enforced overflow/poison shutdown remain unchanged. The prior Linux CI failure was an unchanged process-global runtime.NumGoroutine assertion running under t.Parallel. Isolated only that measuring test; all 40 groups, 3 workers and strict original thresholds remain. A naive one-goroutine-per-group overlay still fails (42 is not below 22). Package race x5 passes in 103.573s. The original CI count violation was not reproduced locally; local old-code repetition instead timed out in WAL fsync, and is not claimed as a reproduction. All composed lint passes; targeted QUIT/wire transaction race x5 passes. Earlier HEAD reviews/CI are stale and are not used as approval for this push. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Final verification receipt HEAD: Author and committer of all three new commits are bootjp contact@bootjp.me. GitHub verifies every signature; DCO passes. The local tree is clean and its HEAD matches the remote PR. The last-push normal review and security review both identify this HEAD and report no findings. No new root inline findings exist for this push, and no review threads remain unresolved. Earlier HEAD approvals were not reused. CI is complete: 17 successful checks, no failures or pending checks. Two conditional pull_request_review helper jobs were skipped (Claude Code and the test branch of Review approval events); the actual test workflows ran successfully:
This checkpoint implements:
The previous Linux CI count failure was in an unchanged process-wide goroutine measurement running in parallel with other tests. Only that measuring test is isolated now: 40 groups, 3 workers and the strict original thresholds remain. A naive one-goroutine-per-group overlay still fails. The original CI count violation was not reproduced locally; an earlier local old-code repetition timed out in WAL fsync and is not represented as a reproduction. Local focused evidence includes final migration/snapshot race tests, external RPC/recipe/lifecycle race tests, QUIT/wire transaction repetition, scheduler package race x5 and the Jepsen unit suite (345 tests / 1391 assertions). Negative old-code overlays fail for the fixed snapshot boundaries and unbounded worker implementation. Scope remains the documented accepted-baseline encrypted data-group profile. Encrypted scalar TSO migration, encrypted multi-member fault injection, cold seed, lost-state replacement, arbitrary protected membership changes and full v5 snapshot/journal completion are not claimed. No production deployment or operational-stability claim is made. GitHub reports this non-draft PR MERGEABLE / CLEAN. It remains open and has not been merged. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 66c2697915
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
|
Additional security review follow-up The earlier verification receipt predates two newly submitted findings on HEAD 66c2697 and is superseded for merge-readiness purposes:
Both paths are being fixed and independently checked. The update will reject actual material reuse before request authorization and before apply mutation, and reserve shared RESP backing capacity before allocation with bounded network-output lifetime. Fresh review and CI on the next pushed HEAD are required; existing approval receipts are not reused. No merge or deployment has been performed. |
Signed-off-by: bootjp <contact@bootjp.me>
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (f22e306):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Verification on f22e306\n\n- Reused AES DEK material is refused across retained IDs and storage/Raft purposes before external proposal and Raft apply mutation. Exact active-request retry remains valid; temporary plaintext is cleared.\n- Protected Redis replies use a receiver-wide 128 MiB backing-capacity budget, direct bounded network publication, and a pre-backend execution gate. Four blocked XREADs cannot exclude direct or Lua XADD producers. This is not a total backend/parser allocation or RSS bound.\n- Local: full root race suite, broad adapter race suite (excluding only the two full-length gRPC sequences run by CI), repeated focused Redis race tests, encryption race tests, Jepsen unit suite (345 tests / 1391 assertions), and full lint passed. Guard-disabled negative controls failed as expected.\n- Linux Test workflow attempt 1 failed in the unchanged forced-leadership-transfer migration test with a 60-second context deadline. Its isolated race test passed 3 local repetitions. The same-SHA workflow rerun (attempt 2) passed both broad race coverage and full-length gRPC sequences. This establishes a green check, not a diagnosed root cause for the first timeout.\n- The separate vendor-like jepsen/redis scaffold test cannot load its own jepsen.redis namespace; it was not counted as passing.\n- Fresh normal and security reviews both inspected f22e306 and reported no findings. All PR checks are success/skipped, and both security threads are resolved. No deployment or merge was performed. |
Design: docs/design/2026_08_29_partial_tso_batch_slot_claims.md Depends on #1364. Draft: the revised protocol is not connected to production admission. ## Revised contract Group 0 owns unique, monotonic, failover-fenced timestamp issuance. Operation-to-timestamp associations belong to the data group and must be committed atomically with the write or PREPARE. The earlier group-0 per-slot ClaimBatch design is withdrawn. A returned timestamp may be an unused gap; a successful data-group Raft apply is the durability point for its operation binding. ## Current changes - Remove the previous per-slot claim ledger, credential/snapshot protocol, and claim-aware forwarding paths from this PR. - Retain the independently tested exact prepared-version comparison and cleanup store capability. - Add immutable dual-index bindings in the data group: operation ID, timestamp, manifest digest, and creation phase. Exact retries skip the data apply and conflicting bindings fail. - Add opt-in atomic FSM apply for raw, one-phase, and PREPARE creation. Production admission still rejects the new operation-ID field. - Add local operation-ID lookup with reverse-index consistency checks for future unknown-outcome reconciliation. Absence is authoritative only after a leader read barrier. - Add opt-in group-0 physical-band reservation. It commits the full band end and serves logical offsets locally, including safe rollover, term change, ceiling change, and ambiguous proposal tests. It has no wire route and rejects active Phase D. - Update the design and rollout gates. ## Required before activation - Version the reservation response and wire the physical-band issuer. Old response semantics cannot describe multiple reservations from one committed band. - Establish trusted issuance provenance at the receiving data leader; a numeric value inside a committed band is not sufficient. Reject unproven forwarded creation. - Persist the primary/home decision before secondary PREPARE and verify the full participant manifest across groups. COMMIT/ABORT must use the bound PREPARE evidence. - Reconcile unknown outcomes by operation ID through an authoritative leader read barrier. - Complete retention, snapshot/restore, rolling-upgrade, whole-cluster Phase-D fencing, authentication, fault, Jepsen, and performance gates. This branch remains Draft and does not claim the range-validation hole is closed in production. ## Verification - Full `go test ./kv -count=1`: pass with local listener access. - Focused binding and physical-band tests: pass. - `golangci-lint run ./kv ./proto --timeout=5m`: 0 issues. - Signed, DCO-compliant commit verified. Author: bootjp <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **新機能** * 書き込みやトランザクションの作成時に、操作IDと永続化タイムスタンプの対応関係を記録し、同一内容の再試行を安全に扱えるようになりました。 * TSOが物理時間の範囲を予約して論理スロットを割り当てる仕組みを追加しました。リーダー交代時には以前の範囲を再利用しません。 * 準備済みトランザクションの変更を、競合を検証したうえで適用できるようになりました。 * **ドキュメント** * タイムスタンプ割り当ての設計と導入条件を更新しました。条件が整うまでは従来のプロトコルを維持します。 <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Design:
docs/design/2026_10_30_proposed_raft_catalog_bootstrap.mdRunbook:
docs/raft_bootstrap_enablement.mdSummary
backup-preserving preparation/resume, post-preparation attestation and
activation certification for an existing quiesced cluster.
WAL, mismatched identities, divergent cuts and incomplete preparation rather
than deleting data or bootstrapping a replacement voting identity.
--raftBootstrapPeerConfigDirthrough production construction, recoveredpolicy, shared TLS listeners, local activation and Control/DataReady.
children, maintenance and terminal results. Revoke on native term/config
changes, interrupt blocked public transports and join before retirement.
Dedicated TSO compares the complete reconstructed control namespace before
accepting retained durable state; incomplete snapshots cannot downgrade it.
authenticated typed startup controls before all groups are DataReady.
commands, EXEC or DISCARD. Bound queue memory both per connection and across
protected queues server-wide, close overflowing transactions, bound idle ownership, join
cancelled work and preserve ambiguous submitted outcomes.
complete logical history and retained WAL/snapshot verification without
rewriting ciphertext, epochs or nonce state.
pinned identity/epoch, bounded concurrency, original-generation transfer and
strictly read-only reconciliation after an unknown outcome.
verification and paired invalidation around key/wrapper publication. Separate
current leader completion from explicit read-barrier-fenced follower permission.
final encrypted payloads outside the arbiter, bind declarations to plaintext,
and seal the actual ciphertext at native enqueue.
them before DataReady; retain fatal errors and refuse unguarded initialization.
Scope And Risks
The offline migration accepts plaintext native state and explicit-key encrypted
data-group baselines with an already populated replicated catalog. Encrypted
sources require all historical keys and matching durable checkpoints/writer
registrations. Preserve original ciphertext, source backups, encryption sidecars,
KEK access and full writer identities. This does not prove historical
serializability or repair divergent replicas. Encrypted scalar TSO migration
remains unsupported.
The protected encryption extension requires an already active storage envelope
and supports both the exact local startup recipe requested by
--encryptionRotateOnStartupand separately authenticated external RotateDEK.External rotation is not unrestricted admin authority: it requires ADMIN bearer,
verified client mTLS, the local full node identity and pinned purpose epoch.
Startup credentials cannot authorize it. Cancelled or unknown commands are never
reproposed by the supervisor. Arbitrary enable/bootstrap operations remain
fail-closed. Cold seed, lost-state replacement, protected
membership changes and the complete v5 snapshot/journal protocol remain separate
gates. Legacy mode remains separate and unchanged.
Protected RAW requests no longer detach into cross-request microbatches; each
request retains its entire atomic command and original context. Throughput is
not claimed unchanged. Revoking a blocked stream may close its shared physical
connection and interrupt other multiplexed requests; that is not proof that their
writes were absent. EXEC disconnection is observed after the synchronous wire
handler returns; ownership is retained and the work is joined in the meantime.
No production deployment, throughput result or operational stability claim is
made by this PR. This is not completion of the full v5 design or the isolation
audit associated with #1355.
Verification
Composed-source test results and exact latest-push review/CI receipts are recorded
in the follow-up comment. Earlier checkpoint approvals do not approve later
pushes.
Author: bootjp