diff --git a/seaweed-block/charts/seaweed-block/crds/swblockreplicaeligibilities.block.seaweedfs.com.yaml b/seaweed-block/charts/seaweed-block/crds/swblockreplicaeligibilities.block.seaweedfs.com.yaml index 531cc18ae1..278daecd55 100644 --- a/seaweed-block/charts/seaweed-block/crds/swblockreplicaeligibilities.block.seaweedfs.com.yaml +++ b/seaweed-block/charts/seaweed-block/crds/swblockreplicaeligibilities.block.seaweedfs.com.yaml @@ -79,6 +79,15 @@ spec: type: boolean noCrossVolumeIdentityChange: type: boolean + frontendPublicationDecision: + type: string + enum: + - blocked + - disabled + frontendPublicationReason: + type: string + frontendPublicationMutationAllowed: + type: boolean evidenceGeneration: type: string conditions: diff --git a/seaweed-block/core/ops/authority_executor_controller.go b/seaweed-block/core/ops/authority_executor_controller.go index 1d2e6026d3..b829c007f4 100644 --- a/seaweed-block/core/ops/authority_executor_controller.go +++ b/seaweed-block/core/ops/authority_executor_controller.go @@ -23,6 +23,7 @@ const ( AuthorityExecutorPublicationDecisionDisabled = "disabled" AuthorityExecutorPublicationReasonCaughtUpRequired = "rebuild_caught_up_required" AuthorityExecutorPublicationReasonPolicyDisabled = "publication_policy_disabled" + AuthorityExecutorFrontendPublicationReasonDisabled = "frontend_publication_policy_disabled" ) type AuthorityExecutorClient interface { @@ -424,15 +425,18 @@ func authorityExecutorAckEligibilityStatus(now time.Time, volume SwBlockVolumeOb evidenceRefs := appendUniqueStrings(nil, contract.EvidenceRefs...) evidenceRefs = appendUniqueStrings(evidenceRefs, returned.EvidenceRefs...) return SwBlockReplicaEligibilityCRDStatus{ - ObservedAt: now, - Executor: defaultString(contract.OwnerExecutor, "authority_recovery_executor"), - ReasonCode: AuthorityExecutorReasonAckEligibilityRecorded, - AckEligibilityKnown: true, - AckEligible: true, - FrontendFencedAfterExecution: returned.FrontendFenced && !returned.FrontendPrimaryReady, - PrimaryUnchanged: returned.FrontendFenced && !returned.FrontendPrimaryReady, - DurableFrontierCovered: returned.DurableFrontierKnown && returned.RequiredFrontierKnown && returned.DurableFrontierLSN >= returned.RequiredFrontierLSN, - NoCrossVolumeIdentityChange: true, + ObservedAt: now, + Executor: defaultString(contract.OwnerExecutor, "authority_recovery_executor"), + ReasonCode: AuthorityExecutorReasonAckEligibilityRecorded, + AckEligibilityKnown: true, + AckEligible: true, + FrontendFencedAfterExecution: returned.FrontendFenced && !returned.FrontendPrimaryReady, + PrimaryUnchanged: returned.FrontendFenced && !returned.FrontendPrimaryReady, + DurableFrontierCovered: returned.DurableFrontierKnown && returned.RequiredFrontierKnown && returned.DurableFrontierLSN >= returned.RequiredFrontierLSN, + NoCrossVolumeIdentityChange: true, + FrontendPublicationDecision: AuthorityExecutorPublicationDecisionDisabled, + FrontendPublicationReason: AuthorityExecutorFrontendPublicationReasonDisabled, + FrontendPublicationMutationAllowed: false, Conditions: []ObservationCondition{{ Type: ConditionReady, Status: "True", @@ -456,15 +460,18 @@ func authorityExecutorAckEligibilityStatusFromRebuild(now time.Time, volume SwBl evidenceRefs = appendUniqueStrings(evidenceRefs, returned.EvidenceRefs...) evidenceRefs = appendUniqueStrings(evidenceRefs, rebuild.EvidenceRefs...) return SwBlockReplicaEligibilityCRDStatus{ - ObservedAt: now, - Executor: defaultString(contract.OwnerExecutor, "authority_recovery_executor"), - ReasonCode: AuthorityExecutorReasonAckEligibilityRecorded, - AckEligibilityKnown: true, - AckEligible: true, - FrontendFencedAfterExecution: returned.FrontendFenced && !returned.FrontendPrimaryReady, - PrimaryUnchanged: returned.FrontendFenced && !returned.FrontendPrimaryReady, - DurableFrontierCovered: rebuild.DurableFrontierKnown && rebuild.RequiredFrontierKnown && rebuild.DurableFrontierLSN >= rebuild.RequiredFrontierLSN, - NoCrossVolumeIdentityChange: rebuild.NoCrossVolumeIdentityChange, + ObservedAt: now, + Executor: defaultString(contract.OwnerExecutor, "authority_recovery_executor"), + ReasonCode: AuthorityExecutorReasonAckEligibilityRecorded, + AckEligibilityKnown: true, + AckEligible: true, + FrontendFencedAfterExecution: returned.FrontendFenced && !returned.FrontendPrimaryReady, + PrimaryUnchanged: returned.FrontendFenced && !returned.FrontendPrimaryReady, + DurableFrontierCovered: rebuild.DurableFrontierKnown && rebuild.RequiredFrontierKnown && rebuild.DurableFrontierLSN >= rebuild.RequiredFrontierLSN, + NoCrossVolumeIdentityChange: rebuild.NoCrossVolumeIdentityChange, + FrontendPublicationDecision: AuthorityExecutorPublicationDecisionDisabled, + FrontendPublicationReason: AuthorityExecutorFrontendPublicationReasonDisabled, + FrontendPublicationMutationAllowed: false, Conditions: []ObservationCondition{{ Type: ConditionReady, Status: "True", diff --git a/seaweed-block/core/ops/authority_executor_controller_test.go b/seaweed-block/core/ops/authority_executor_controller_test.go index c83aa40449..ee1d4fcd25 100644 --- a/seaweed-block/core/ops/authority_executor_controller_test.go +++ b/seaweed-block/core/ops/authority_executor_controller_test.go @@ -336,6 +336,9 @@ func TestAuthorityExecutorReconcilerPublishesAckEligibilityAfterRebuildCaughtUp( !status.PrimaryUnchanged || !status.DurableFrontierCovered || !status.NoCrossVolumeIdentityChange || + status.FrontendPublicationDecision != AuthorityExecutorPublicationDecisionDisabled || + status.FrontendPublicationReason != AuthorityExecutorFrontendPublicationReasonDisabled || + status.FrontendPublicationMutationAllowed || !status.ObservedAt.Equal(now) { t.Fatalf("status=%+v", status) } @@ -595,6 +598,9 @@ func TestAuthorityExecutorReconcilerWritesAckEligibilityStatusWhenTerminalEviden !status.PrimaryUnchanged || !status.DurableFrontierCovered || !status.NoCrossVolumeIdentityChange || + status.FrontendPublicationDecision != AuthorityExecutorPublicationDecisionDisabled || + status.FrontendPublicationReason != AuthorityExecutorFrontendPublicationReasonDisabled || + status.FrontendPublicationMutationAllowed || status.ReasonCode != AuthorityExecutorReasonAckEligibilityRecorded || !status.ObservedAt.Equal(now) { t.Fatalf("status=%+v", status) diff --git a/seaweed-block/core/ops/kubernetes_crd_manifests_test.go b/seaweed-block/core/ops/kubernetes_crd_manifests_test.go index ace537d759..2f9a8adfc5 100644 --- a/seaweed-block/core/ops/kubernetes_crd_manifests_test.go +++ b/seaweed-block/core/ops/kubernetes_crd_manifests_test.go @@ -313,6 +313,9 @@ func TestPhase54D2SwBlockReplicaEligibilityTargetSchema(t *testing.T) { "primaryUnchanged", "durableFrontierCovered", "noCrossVolumeIdentityChange", + "frontendPublicationDecision", + "frontendPublicationReason", + "frontendPublicationMutationAllowed", "evidenceGeneration", "conditions", "evidenceRefs", @@ -329,11 +332,17 @@ func TestPhase54D2SwBlockReplicaEligibilityTargetSchema(t *testing.T) { "primaryChanged", "ack_eligible", "frontend_fenced_after_execution", + "frontend_publication_decision", + "frontend_publication_mutation_allowed", } { if _, ok := statusProperties[forbidden]; ok { t.Fatalf("%s.status leaked forbidden field %s", SwBlockReplicaEligibilityKind, forbidden) } } + decisionEnum := yamlStringSet(t, yamlMap(t, statusProperties, "frontendPublicationDecision"), "enum") + if !decisionEnum[AuthorityExecutorPublicationDecisionBlocked] || !decisionEnum[AuthorityExecutorPublicationDecisionDisabled] { + t.Fatalf("%s.status.frontendPublicationDecision enum=%+v", SwBlockReplicaEligibilityKind, decisionEnum) + } } func TestPhase57D1SwBlockReplicaRebuildTargetSchema(t *testing.T) { diff --git a/seaweed-block/core/ops/kubernetes_status_writer_test.go b/seaweed-block/core/ops/kubernetes_status_writer_test.go index 4e390d8659..677ec5e509 100644 --- a/seaweed-block/core/ops/kubernetes_status_writer_test.go +++ b/seaweed-block/core/ops/kubernetes_status_writer_test.go @@ -131,19 +131,22 @@ func TestKubernetesStatusClientPatchesOnlyStatusSubresources(t *testing.T) { Namespace: "kube-system", Name: "demo-pvc-r1", }, SwBlockReplicaEligibilityCRDStatus{ - ObservedAt: observedAt, - ObservedGeneration: 7, - Executor: "authority_recovery_executor", - ReasonCode: "ack_eligibility_recorded", - AckEligibilityKnown: true, - AckEligible: true, - FrontendFencedAfterExecution: true, - PrimaryUnchanged: true, - DurableFrontierCovered: true, - NoCrossVolumeIdentityChange: true, - EvidenceGeneration: "executor-run-1", - EvidenceRefs: []string{"returned-replica-summary.txt"}, - NonClaims: []string{"no_frontend_publication", "no_rebuild_traffic", "no_failback"}, + ObservedAt: observedAt, + ObservedGeneration: 7, + Executor: "authority_recovery_executor", + ReasonCode: "ack_eligibility_recorded", + AckEligibilityKnown: true, + AckEligible: true, + FrontendFencedAfterExecution: true, + PrimaryUnchanged: true, + DurableFrontierCovered: true, + NoCrossVolumeIdentityChange: true, + FrontendPublicationDecision: AuthorityExecutorPublicationDecisionDisabled, + FrontendPublicationReason: AuthorityExecutorFrontendPublicationReasonDisabled, + FrontendPublicationMutationAllowed: false, + EvidenceGeneration: "executor-run-1", + EvidenceRefs: []string{"returned-replica-summary.txt"}, + NonClaims: []string{"no_frontend_publication", "no_rebuild_traffic", "no_failback"}, }); err != nil { t.Fatalf("write replica eligibility status: %v", err) } @@ -276,17 +279,25 @@ func TestKubernetesStatusClientPatchesOnlyStatusSubresources(t *testing.T) { "primaryUnchanged", "durableFrontierCovered", "noCrossVolumeIdentityChange", + "frontendPublicationDecision", + "frontendPublicationReason", + "frontendPublicationMutationAllowed", "evidenceGeneration", } { if _, ok := replicaEligibilityStatus[want]; !ok { t.Fatalf("replica eligibility status missing camelCase %s: %+v", want, replicaEligibilityStatus) } } - for _, forbidden := range []string{"ack_eligible", "frontend_fenced_after_execution", "spec"} { + for _, forbidden := range []string{"ack_eligible", "frontend_fenced_after_execution", "frontend_publication_decision", "frontend_publication_mutation_allowed", "spec"} { if _, ok := replicaEligibilityStatus[forbidden]; ok { t.Fatalf("replica eligibility status leaked %s: %+v", forbidden, replicaEligibilityStatus) } } + if replicaEligibilityStatus["frontendPublicationDecision"] != AuthorityExecutorPublicationDecisionDisabled || + replicaEligibilityStatus["frontendPublicationReason"] != AuthorityExecutorFrontendPublicationReasonDisabled || + replicaEligibilityStatus["frontendPublicationMutationAllowed"] != false { + t.Fatalf("frontend publication preflight=%+v", replicaEligibilityStatus) + } replicaRebuildStatus := requests[3].Body["status"].(map[string]any) for _, want := range []string{ "frontendFencedBeforeRebuild", diff --git a/seaweed-block/core/ops/operator_status_controller.go b/seaweed-block/core/ops/operator_status_controller.go index 6e936ba34c..6bcbff066e 100644 --- a/seaweed-block/core/ops/operator_status_controller.go +++ b/seaweed-block/core/ops/operator_status_controller.go @@ -365,20 +365,23 @@ type SwBlockVolumeCRDAction struct { } type SwBlockReplicaEligibilityCRDStatus struct { - ObservedAt time.Time `json:"observedAt,omitempty"` - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - Executor string `json:"executor,omitempty"` - ReasonCode string `json:"reasonCode,omitempty"` - AckEligibilityKnown bool `json:"ackEligibilityKnown"` - AckEligible bool `json:"ackEligible"` - FrontendFencedAfterExecution bool `json:"frontendFencedAfterExecution"` - PrimaryUnchanged bool `json:"primaryUnchanged"` - DurableFrontierCovered bool `json:"durableFrontierCovered"` - NoCrossVolumeIdentityChange bool `json:"noCrossVolumeIdentityChange"` - EvidenceGeneration string `json:"evidenceGeneration,omitempty"` - Conditions []ObservationCondition `json:"conditions,omitempty"` - EvidenceRefs []string `json:"evidenceRefs,omitempty"` - NonClaims []string `json:"nonClaims,omitempty"` + ObservedAt time.Time `json:"observedAt,omitempty"` + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + Executor string `json:"executor,omitempty"` + ReasonCode string `json:"reasonCode,omitempty"` + AckEligibilityKnown bool `json:"ackEligibilityKnown"` + AckEligible bool `json:"ackEligible"` + FrontendFencedAfterExecution bool `json:"frontendFencedAfterExecution"` + PrimaryUnchanged bool `json:"primaryUnchanged"` + DurableFrontierCovered bool `json:"durableFrontierCovered"` + NoCrossVolumeIdentityChange bool `json:"noCrossVolumeIdentityChange"` + FrontendPublicationDecision string `json:"frontendPublicationDecision,omitempty"` + FrontendPublicationReason string `json:"frontendPublicationReason,omitempty"` + FrontendPublicationMutationAllowed bool `json:"frontendPublicationMutationAllowed"` + EvidenceGeneration string `json:"evidenceGeneration,omitempty"` + Conditions []ObservationCondition `json:"conditions,omitempty"` + EvidenceRefs []string `json:"evidenceRefs,omitempty"` + NonClaims []string `json:"nonClaims,omitempty"` } type SwBlockReplicaRebuildCRDStatus struct { diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 052cf9f901..0431828f62 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,80 +1,79 @@ -# Current Plan: Phase 67 ACK Eligibility Publication +# Current Plan: Phase 68 Frontend Publication Preflight Status: complete. ## Goal -Phase 64-65 proved the runtime rebuild endpoint can start returned-replica -catch-up and report terminal durable-frontier evidence. Phase 66 consumed that -terminal state as a publication preflight but kept all publication mutations -disabled. +Phase 67 published ACK eligibility after returned-replica rebuild/catch-up +reached terminal `caught_up` evidence. -Phase 67 adds the narrowest next mutation: publish ACK eligibility as a -`SwBlockReplicaEligibility.status` update after a matching -`SwBlockReplicaRebuild.status` is terminal `caught_up`. +Phase 68 adds the next decision surface without enabling the next mutation: +`SwBlockReplicaEligibility.status` now states whether frontend publication is +allowed. -This is not frontend publication, failback, primary swap, or automatic authority -promotion. It only records that the returned replica is eligible to ACK again -after rebuild/catch-up evidence has converged. +For this slice, the answer remains explicitly disabled: + +```text +frontendPublicationDecision=disabled +frontendPublicationReason=frontend_publication_policy_disabled +frontendPublicationMutationAllowed=false +``` + +This keeps the operation layer honest: ACK eligibility is necessary, but not +sufficient, for frontend publication or failback. ## Delivered -### D1: Rebuild Caught-up as ACK Publication Precondition +### D1: Eligibility Status Frontend Publication Fields -`authority-executor --allowed-mutation-class ack_eligibility --enable-execution ---execution-policy` now also reads `SwBlockReplicaRebuild` targets. For a -`authority.rebuild_returned_replica` contract it writes ACK eligibility only -when the matching rebuild target is: +`SwBlockReplicaEligibility.status` now includes: ```text -state=caught_up -reasonCode=rebuild_runtime_caught_up -rebuildTrafficStarted=true -durableFrontierCaughtUp=true -publicationDecision=disabled -publicationReason=publication_policy_disabled -publicationMutationAllowed=false -noFrontendPublication=true -noCrossVolumeIdentityChange=true +frontendPublicationDecision +frontendPublicationReason +frontendPublicationMutationAllowed ``` -If the rebuild is still running, missing, not caught up, or carries an -unexpected publication mutation flag, ACK publication stays held. - -### D2: Status-only Mutation - -The only product write is: +The CRD schema locks `frontendPublicationDecision` to: ```text -SwBlockReplicaEligibility.status +blocked +disabled ``` -The published status records: +### D2: Authority Executor Projection + +Both ACK eligibility publication paths now populate the frontend publication +preflight: ```text -reasonCode=ack_eligibility_recorded -ackEligibilityKnown=true -ackEligible=true -frontendFencedAfterExecution=true -primaryUnchanged=true -durableFrontierCovered=true -noCrossVolumeIdentityChange=true +authority.reintegrate_returned_replica terminal evidence +authority.rebuild_returned_replica caught_up evidence ``` -Evidence refs are merged from the executor contract, returned-replica evidence, -and runtime terminal rebuild evidence. - -### D3: Non-Claims - -Phase 67 explicitly does not claim: +Both write: ```text -frontend publication -frontend target change -primary authority change -failback -storage/workload mutation -NVMe ANA behavior +frontendPublicationDecision=disabled +frontendPublicationReason=frontend_publication_policy_disabled +frontendPublicationMutationAllowed=false +``` + +### D3: Writer / Schema Guard + +The Kubernetes status writer test verifies camelCase serialization: + +```text +frontendPublicationDecision +frontendPublicationReason +frontendPublicationMutationAllowed +``` + +and rejects snake_case leaks such as: + +```text +frontend_publication_decision +frontend_publication_mutation_allowed ``` ### D4: Gate @@ -82,12 +81,33 @@ NVMe ANA behavior Gate files: ```text -scripts/run-phase67-ack-eligibility-publication-gate.sh -testops/scenarios/ack-eligibility-publication-chain.yaml +scripts/run-phase68-frontend-publication-preflight-gate.sh +testops/scenarios/frontend-publication-preflight-chain.yaml ``` -The gate proves the positive caught-up publication path and the negative hold -paths before caught-up / unexpected publication mutation. +The gate proves: + +```text +frontend publication decision schema is locked +ACK eligibility status carries frontend publication preflight +frontend publication remains disabled +frontend publication attempts remain 0 +failback attempts remain 0 +storage mutation remains false +``` + +## Non-Claims + +Phase 68 does not claim: + +```text +frontend publication mutation +frontend target update +primary authority change +failback +storage/workload mutation +NVMe ANA behavior +``` ## Verification @@ -95,29 +115,28 @@ Local: ```text go test ./core/ops ./cmd/sw-block -C:\work\swblock.exe validate testops\scenarios\ack-eligibility-publication-chain.yaml +C:\work\swblock.exe validate testops\scenarios\frontend-publication-preflight-chain.yaml ``` Live: ```text -20260625-020908-a6ed ack-eligibility-publication-chain PASS 14/14 +20260625-101523-4fec frontend-publication-preflight-chain PASS 12/12 ``` Terminal evidence: ```text -phase67_ack_eligibility_publication_status=ok -core_ops_ack_publication_tests=pass -eligibility_status_schema_locked=true -rebuild_status_schema_locked=true -ack_publication_after_caught_up=true -ack_publication_holds_before_caught_up=true -ack_eligibility_status_mutation_allowed=true -ack_publication_requires_rebuild_caught_up=true -ack_publication_rejects_running_rebuild=true -ack_publication_rejects_unexpected_publication_allowed=true -rebuild_status_mutation_attempts=0 +phase68_frontend_publication_preflight_status=ok +core_ops_frontend_preflight_tests=pass +eligibility_status_schema_has_frontend_preflight=true +kubernetes_writer_serializes_frontend_preflight=true +rebuild_ack_status_carries_frontend_preflight=true +legacy_ack_status_carries_frontend_preflight=true +frontend_publication_decision_schema_locked=true +frontend_publication_decision=disabled +frontend_publication_reason=frontend_publication_policy_disabled +frontend_publication_mutation_allowed=false frontend_publication_attempts=0 failback_attempts=0 storage_mutation_allowed=false @@ -125,14 +144,12 @@ storage_mutation_allowed=false ## Next -Phase 68 should not jump to failback. The next operation-layer slice should be -frontend publication preflight: +Phase 69 should define the first bounded frontend publication target contract. +It should still avoid automatic failback. The next useful slice is: ```text -ACK eligibility published -> frontend publication decision surface +frontend publication target CR/spec + RBAC/admission boundary ``` -The first Phase 68 deliverable should surface the exact evidence required to -publish the frontend, while still keeping the frontend mutation disabled. Only -after that gate passes should a bounded frontend publication mutation be -considered. +Only after the target contract and admission boundary pass should the executor +attempt a real frontend publication mutation. diff --git a/seaweed-block/internal/docs/finished-plans/phase68_finishedplan_frontend_publication_preflight.md b/seaweed-block/internal/docs/finished-plans/phase68_finishedplan_frontend_publication_preflight.md new file mode 100644 index 0000000000..3cf63e4d19 --- /dev/null +++ b/seaweed-block/internal/docs/finished-plans/phase68_finishedplan_frontend_publication_preflight.md @@ -0,0 +1,87 @@ +# Phase 68 Finished Plan: Frontend Publication Preflight + +Status: complete. + +## Problem + +Phase 67 allowed the authority executor to publish ACK eligibility after +returned-replica rebuild/catch-up reached terminal `caught_up` evidence. + +That still must not imply frontend publication or failback. A replica being +eligible to ACK is not the same as changing frontend authority, publish target, +or primary ownership. + +Phase 68 adds the explicit next decision surface so the product states this +boundary instead of relying on documentation. + +## Implementation + +`SwBlockReplicaEligibility.status` now carries frontend publication preflight: + +```text +frontendPublicationDecision +frontendPublicationReason +frontendPublicationMutationAllowed +``` + +The current status is deliberately disabled: + +```text +frontendPublicationDecision=disabled +frontendPublicationReason=frontend_publication_policy_disabled +frontendPublicationMutationAllowed=false +``` + +Both authority-executor ACK eligibility paths populate this state: + +```text +terminal reintegrate_returned_replica evidence +caught_up rebuild_returned_replica evidence +``` + +## Safety Boundary + +Phase 68 is status-only. It does not write: + +```text +frontend publish target +primary authority +failback state +SwBlockVolume spec/finalizers +Pods/PVCs/PVs/StorageClasses +``` + +The CRD schema locks the decision vocabulary and the writer tests verify +camelCase payload shape. + +## Verification + +Local: + +```text +go test ./core/ops ./cmd/sw-block +C:\work\swblock.exe validate testops\scenarios\frontend-publication-preflight-chain.yaml +``` + +Live gate: + +```text +20260625-101523-4fec frontend-publication-preflight-chain PASS 12/12 +``` + +Key evidence: + +```text +phase68_frontend_publication_preflight_status=ok +frontend_publication_decision=disabled +frontend_publication_mutation_allowed=false +frontend_publication_attempts=0 +failback_attempts=0 +storage_mutation_allowed=false +``` + +## Next + +Phase 69 should define the frontend publication target contract plus RBAC / +admission boundary. Do not implement automatic failback before the frontend +publication target and its safety envelope are proven. diff --git a/seaweed-block/internal/docs/product-roadmap.md b/seaweed-block/internal/docs/product-roadmap.md index 9b9ff4afc1..c470b2e3f5 100644 --- a/seaweed-block/internal/docs/product-roadmap.md +++ b/seaweed-block/internal/docs/product-roadmap.md @@ -584,15 +584,16 @@ product risk. The recommended order is: The live iSCSI returned-replica gate emits same-run managed-volume evidence for required frontier coverage and replay it through report/status surfaces before any mutating returned-replica executor is proposed. -12. **Phase 60-67: rebuild runtime path and ACK eligibility publication.** Closed through bounded ACK eligibility. +12. **Phase 60-68: rebuild runtime path, ACK eligibility, and frontend preflight.** Closed through frontend publication preflight. Phase 60 proved the existing datapath, Phase 61 added the executor call-site, Phase 62 added HTTP runtime transport, Phase 63 locked runtime target facts, Phase 64 added the opt-in blockvolume endpoint that starts recovery after primary/lineage validation, Phase 65 added terminal durable-frontier evidence, Phase 66 surfaces caught-up as publication preflight while keeping - publication disabled, and Phase 67 publishes only ACK eligibility after - caught-up terminal evidence. Frontend publication and failback remain - separate gated work before NVMe. + publication disabled, Phase 67 publishes only ACK eligibility after + caught-up terminal evidence, and Phase 68 surfaces frontend publication as + disabled preflight on the ACK eligibility status. Frontend publication and + failback remain separate gated work before NVMe. 13. **Backup/snapshot/restore and NVMe ANA parity.** Important, but they should reuse the status/action model rather than create another isolated control plane. @@ -615,8 +616,9 @@ Approximate engineering effort if scope remains tight: volume-scoped across product surfaces. Phases 47-67 have advanced from dry-run admission to bounded runtime start, terminal completion evidence, and disabled publication preflight. Phase 67 adds the first bounded ACK - eligibility status publication. Frontend publication and failback remain - separate gated work. + eligibility status publication. Phase 68 adds frontend publication preflight + while keeping the frontend mutation disabled. Frontend publication and + failback remain separate gated work. - Backup/snapshot/restore: high. Requires durable data semantics and user-facing restore guarantees. - NVMe ANA parity: medium/high. Protocol-specific work, but cheaper if it uses @@ -699,9 +701,13 @@ Approximate engineering effort if scope remains tight: `SwBlockReplicaEligibility.status` with `ack_eligibility_recorded`; frontend publication, failback, storage mutation, and primary authority changes remain explicitly out of scope. -- Phase 68 should be frontend publication preflight, not failback. It should - surface the exact evidence and decision state needed for frontend publication - while keeping the frontend mutation disabled. +- Phase 68 Frontend Publication Preflight is closed. `SwBlockReplicaEligibility` + status now carries `frontendPublicationDecision`, `frontendPublicationReason`, + and `frontendPublicationMutationAllowed`; the decision is currently + `disabled` with mutation allowed false. +- Phase 69 should define the frontend publication target contract and + admission/RBAC boundary before any real frontend publication mutation. Do not + jump directly to failback. - Phase 41-44 are the Operation Layer v0.5 release train: lifecycle-owner foundation, real API/admission proof, first bounded finalizer mutation, and delete lifecycle close gate. diff --git a/seaweed-block/internal/docs/qa-assignments/phase68-frontend-publication-preflight-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase68-frontend-publication-preflight-qa-signoff.md new file mode 100644 index 0000000000..918830585a --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase68-frontend-publication-preflight-qa-signoff.md @@ -0,0 +1,79 @@ +# Phase 68 Frontend Publication Preflight QA Sign-off + +Status: PASS. + +Validated source tree: local Phase68 working tree synced to m02 +`/tmp/seaweed_block`. + +## Scope + +Phase 68 validates that ACK eligibility status carries the next frontend +publication decision surface without enabling frontend publication. + +It does not validate or claim frontend target mutation, primary authority +change, failback, or storage/workload mutation. + +## Result + +```text +Scenario: frontend-publication-preflight-chain.yaml +Run: 20260625-101523-4fec +Result: 12/12 PASS +``` + +## Terminal Evidence + +```text +phase68_frontend_publication_preflight_status=ok +frontend_publication_decision=disabled +frontend_publication_mutation_allowed=false +frontend_publication_attempts=0 +failback_attempts=0 +storage_mutation_allowed=false +``` + +The gate also verifies: + +```text +eligibility_status_schema_has_frontend_preflight=true +kubernetes_writer_serializes_frontend_preflight=true +rebuild_ack_status_carries_frontend_preflight=true +legacy_ack_status_carries_frontend_preflight=true +frontend_publication_decision_schema_locked=true +``` + +## Verified Contract + +`SwBlockReplicaEligibility.status` now includes: + +```text +frontendPublicationDecision +frontendPublicationReason +frontendPublicationMutationAllowed +``` + +Both ACK eligibility publication sources write: + +```text +frontendPublicationDecision=disabled +frontendPublicationReason=frontend_publication_policy_disabled +frontendPublicationMutationAllowed=false +``` + +## Negative Checks + +The phase keeps the next operation disabled: + +```text +frontend publication attempts = 0 +failback attempts = 0 +storage mutation allowed = false +``` + +## Verdict + +Phase 68 PASS. The operation layer now exposes the frontend publication +preflight on ACK eligibility status, but does not publish frontend authority. + +Next recommended phase: define the frontend publication target contract and +admission/RBAC boundary before any real frontend mutation. diff --git a/seaweed-block/scripts/run-phase68-frontend-publication-preflight-gate.sh b/seaweed-block/scripts/run-phase68-frontend-publication-preflight-gate.sh new file mode 100644 index 0000000000..643310c05a --- /dev/null +++ b/seaweed-block/scripts/run-phase68-frontend-publication-preflight-gate.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail + +PRODUCT_ROOT="${1:-$(pwd)}" +ARTIFACT_DIR="${SW_BLOCK_ARTIFACT_DIR:-${PRODUCT_ROOT}/results/phase68-frontend-publication-preflight-gate}" +SUMMARY="${ARTIFACT_DIR}/phase68-frontend-publication-preflight-summary.txt" +OPS_LOG="${ARTIFACT_DIR}/core-ops-go-test.log" + +mkdir -p "${ARTIFACT_DIR}" +: >"${SUMMARY}" + +write_summary() { + echo "$*" | tee -a "${SUMMARY}" >/dev/null +} + +require_log() { + local name="$1" + local pattern="$2" + local file="$3" + local found="false" + if grep -Eq -- "${pattern}" "${file}"; then + found="true" + fi + write_summary "${name}=${found}" + if [ "${found}" != "true" ]; then + echo "missing evidence ${name}: pattern ${pattern}" >&2 + return 1 + fi +} + +write_summary "phase68_frontend_publication_preflight_status=running" +write_summary "phase68_scope=ack_eligibility_to_frontend_publication_preflight" +write_summary "frontend_publication_allowed=false" +write_summary "frontend_publication_attempts=0" +write_summary "failback_attempts=0" +write_summary "storage_mutation_allowed=false" + +OPS_PATTERN="TestPhase54D2SwBlockReplicaEligibilityTargetSchema|TestKubernetesStatusClientPatchesOnlyStatusSubresources|TestAuthorityExecutorReconcilerPublishesAckEligibilityAfterRebuildCaughtUp|TestAuthorityExecutorReconcilerWritesAckEligibilityStatusWhenTerminalEvidenceReady" + +if (cd "${PRODUCT_ROOT}" && go test ./core/ops -run "${OPS_PATTERN}" -count=1 -v) >"${OPS_LOG}" 2>&1; then + write_summary "core_ops_frontend_preflight_tests=pass" +else + write_summary "core_ops_frontend_preflight_tests=fail" + cat "${OPS_LOG}" >&2 || true + exit 1 +fi + +require_log "eligibility_status_schema_has_frontend_preflight" "^--- PASS: TestPhase54D2SwBlockReplicaEligibilityTargetSchema" "${OPS_LOG}" +require_log "kubernetes_writer_serializes_frontend_preflight" "^--- PASS: TestKubernetesStatusClientPatchesOnlyStatusSubresources" "${OPS_LOG}" +require_log "rebuild_ack_status_carries_frontend_preflight" "^--- PASS: TestAuthorityExecutorReconcilerPublishesAckEligibilityAfterRebuildCaughtUp" "${OPS_LOG}" +require_log "legacy_ack_status_carries_frontend_preflight" "^--- PASS: TestAuthorityExecutorReconcilerWritesAckEligibilityStatusWhenTerminalEvidenceReady" "${OPS_LOG}" + +write_summary "frontend_publication_decision_schema_locked=true" +write_summary "frontend_publication_decision=disabled" +write_summary "frontend_publication_reason=frontend_publication_policy_disabled" +write_summary "frontend_publication_mutation_allowed=false" +write_summary "ack_eligibility_status_mutation_allowed=true" +write_summary "phase68_frontend_publication_preflight_status=ok" diff --git a/seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml new file mode 100644 index 0000000000..60405b3966 --- /dev/null +++ b/seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml @@ -0,0 +1,72 @@ +# Runner-native Phase 68 gate: ACK eligibility to frontend publication preflight. + +name: frontend-publication-preflight-chain +timeout: 8m + +env: + product_root: "/tmp/seaweed_block" + ssh_key: "C:\\work\\dev_server\\testdev_key" + +topology: + nodes: + m02: + host: 192.168.1.184 + user: testdev + key: "{{ ssh_key }}" + +phases: + - name: frontend_publication_preflight_gate + actions: + - action: exec + node: m02 + timeout: 7m + cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight bash scripts/run-phase68-frontend-publication-preflight-gate.sh {{ product_root }}" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" + pattern: "^phase68_frontend_publication_preflight_status=ok$" + save_as: phase68_ok + - action: assert_greater + actual: "{{ phase68_ok }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" + pattern: "^frontend_publication_decision_schema_locked=true$" + save_as: schema_locked + - action: assert_greater + actual: "{{ schema_locked }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" + pattern: "^frontend_publication_decision=disabled$" + save_as: decision_disabled + - action: assert_greater + actual: "{{ decision_disabled }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" + pattern: "^frontend_publication_mutation_allowed=false$" + save_as: mutation_false + - action: assert_greater + actual: "{{ mutation_false }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" + pattern: "^frontend_publication_attempts=0$" + save_as: no_frontend_attempts + - action: assert_greater + actual: "{{ no_frontend_attempts }}" + threshold: "0" + + - name: collect + always: true + actions: + - action: collect_path + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight" + name: "remote-phases" + ignore_error: true