From c95947ab1a3f8e45339970fbc0bb83f305f31bde Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 14 Jun 2026 11:02:14 -0700 Subject: [PATCH] phase41: QA sign-off PASS; close phase 41; open phase 42 G1-G7 pass (contract review, schema-aware API boundary, delete-safety decision semantics, cleanup_observed_at freshness, dry-run lifecycle-owner action, multi-volume isolation, live operator-status status/events-only boundary). Records the required carry-forward: a full live-apiserver/envtest lifecycle-owner RBAC/admission gate is still needed before any finalizer mutation can ship. - add QA sign-off - add Phase 41 finished plan - rewrite current-plan as Phase 42 (lifecycle-owner API/admission gate) - roadmap: mark Phase 41 closed, Phase 42 active Co-Authored-By: Claude Opus 4.8 (1M context) --- seaweed-block/docs/roadmap.md | 22 +- seaweed-block/internal/docs/current-plan.md | 358 ++++++------------ ...finishedplan_lifecycle_owner_foundation.md | 96 +++++ ...1-lifecycle-owner-foundation-qa-signoff.md | 167 ++++++++ 4 files changed, 406 insertions(+), 237 deletions(-) create mode 100644 seaweed-block/internal/docs/finished-plans/phase41_finishedplan_lifecycle_owner_foundation.md create mode 100644 seaweed-block/internal/docs/qa-assignments/phase41-lifecycle-owner-foundation-qa-signoff.md diff --git a/seaweed-block/docs/roadmap.md b/seaweed-block/docs/roadmap.md index bcf5f1025f..06ac6f4eb0 100644 --- a/seaweed-block/docs/roadmap.md +++ b/seaweed-block/docs/roadmap.md @@ -105,11 +105,18 @@ Recommended order from here: status/events-only visibility, not lifecycle mutation. 2. Complete the Operation Layer v0.5 release train before adding more storage features: - - Phase 41: lifecycle-owner foundation. Define observer, lifecycle-owner, - and executor roles. Keep operator-status status/events-only. - - Phase 42: real API/admission proof. Show that a lifecycle owner can be - granted main-object patch only for finalizer-shaped writes, with spec and - unrelated metadata rejected by a real Kubernetes API/admission gate. + - Phase 41: lifecycle-owner foundation. **Closed 2026-06-14, QA PASS** + (`internal/docs/finished-plans/phase41_finishedplan_lifecycle_owner_foundation.md`). + Observer/lifecycle-owner/executor roles defined; delete-safety preconditions + and a dry-run finalizer-release action shipped; operator-status stays + status/events-only; finalizer mutation deferred. Recorded carry-forward: a + real live-apiserver/envtest RBAC/admission gate is still required before any + finalizer mutation can ship. + - Phase 42 (**active**): real API/admission proof. Show that a lifecycle owner + can be granted main-object patch only for finalizer-shaped writes, with spec + and unrelated metadata rejected by a real Kubernetes API/admission gate. This + is the recorded Phase 41 carry-forward and the gate before any actual + finalizer add/remove. - Phase 43: first bounded lifecycle mutation. The likely candidate is `SwBlockVolume` finalizer add/remove, with delete-safety preconditions and user-visible Events/status. @@ -126,6 +133,11 @@ Recommended order from here: owner, evidence, and status model rather than creating another isolated control plane. +The internal release-train contract is +`internal/docs/ref/operation-layer-v0.5-release-train.md`; the Phase 42 entry +gate is drafted in +`internal/docs/ref/phase42-lifecycle-owner-api-admission-gate.md`. + The practical rule is: ```text diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 52363f92ea..3754c13744 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,329 +1,223 @@ -# Current Plan: Phase 41 - Lifecycle Owner Foundation +# Current Plan: Phase 42 - Lifecycle Owner API / Admission Gate -Status: dev-complete, 90% complete, awaiting QA/review. Started on -2026-06-14. +Status: open, 0% complete. Started on 2026-06-14. Branch: `phase41-lifecycle-owner-foundation` -Previous phase: Phase 40 is closed in -`internal/docs/finished-plans/phase40_finishedplan_operator_production_hardening.md`. +Previous phase: Phase 41 is closed in +`internal/docs/finished-plans/phase41_finishedplan_lifecycle_owner_foundation.md`. ## Product Goal -Turn the v0.4 status/events-only operator foundation into a safe lifecycle -owner foundation without breaking the read-only operator-status boundary. +Prove the real Kubernetes API/admission boundary required before Seaweed Block +ships any `SwBlockVolume` finalizer mutation. -Phase 40 made the control plane useful as an observation surface: CRD status, -Events, node evidence, cleanup visibility, delete-safety status, action -decisions, install drift, and API conformance. Phase 39 proved why the next -step cannot be a local patch: CRD finalizer mutation requires main-object -`patch swblockvolumes`, so it must belong to a clearly scoped lifecycle owner, -not the status-only observer. +Phase 39 proved that CRD finalizers require main-object +`patch swblockvolumes`. Phase 41 defined the lifecycle-owner role and shipped +only dry-run/status decisions. Phase 42 must prove that a future lifecycle owner +can hold that main-object patch permission without becoming a broad mutating +operator. -The hard exit statement: +Hard exit statement: ```text -Seaweed Block has an explicit lifecycle-owner contract and a gated first -mutation path. Status-only observation remains status/events-only. Any lifecycle -mutation is owned by a separate component, guarded by real Kubernetes API/RBAC -tests, and explained through CRD status, Events, reports, and QA evidence. +The lifecycle-owner identity can patch exactly the approved finalizer shape on +SwBlockVolume main objects, and cannot patch spec, unrelated metadata, status +through the main object, or any storage/workload resource. ``` -## Why This Comes Before NVMe / Rebuild / Backup +## Why This Is Still Operation Layer Work -NVMe ANA parity, returned-replica rebuild/failback, and backup/restore all add -state transitions. If the product cannot clearly answer who owns a lifecycle -mutation, what facts authorize it, how it is audited, and how it is blocked, -those features will add more status debt. +This phase is not another generic ops cleanup loop. It is the concrete gate that +lets the product move from status/dry-run guidance to the first safe Kubernetes +lifecycle mutation in Phase 43. -Phase 41 is not another unbounded ops-fix loop. It has one purpose: define and -prove the mutation boundary that later features can reuse. +Until this proof exists, returned-replica rebuild/reintegration, NVMe ANA parity, +backup/restore, and any cleanup executor would add more state transitions before +the product has a trusted mutation owner. ## Scope Contract | In | Out | |---|---| -| lifecycle-owner responsibility contract | NVMe ANA parity | -| real CRD/RBAC/envtest gate before mutation | rebuild/failback implementation | -| finalizer strategy and ownership decision | backup/snapshot/restore | -| first bounded lifecycle mutation behind an explicit gate | automatic cleanup of host/storage residue | -| delete-safety preconditions and user-visible block reasons | promotion/fencing executor | -| multi-volume isolation for lifecycle status/mutation | broad production lifecycle claims | +| real apiserver/envtest/admission harness | product finalizer controller | +| lifecycle-owner RBAC proof | cleanup execution | +| finalizer-only admission rule or equivalent enforcement | rebuild/failback | +| accepted/rejected patch audit evidence | backup/restore | +| delete-safety precondition carry-forward | NVMe ANA parity | +| multi-volume object isolation | broad production lifecycle claims | Allowed implementation rule: ```text -Phase 41 may introduce a separate lifecycle-owner component or mode only after -the contract and API/RBAC gates prove the boundary. +Phase 42 may introduce test-only lifecycle-owner identities, RBAC, and +admission/enforcement code needed to prove the boundary. -Phase 41 must not broaden operator-status into a mutating controller. -Phase 41 must not execute cleanup, rebuild, failback, backup, restore, or -promotion. If finalizer mutation lands, it is the only allowed lifecycle -mutation and must be release-gated. +Phase 42 must not enable product finalizer add/remove in the released +operator-status path. +Phase 42 must not broaden operator-status beyond status/events-only. ``` -## D1: Lifecycle Owner Contract +## D1: Harness Choice And Baseline -Goal: make ownership explicit before code changes. - -Status: dev-complete, awaiting review. +Goal: choose and wire the real API proof. Acceptance: ```text -[x] document the three roles: observer/status writer, lifecycle owner, executor -[x] define which component may patch CR metadata/finalizers -[x] define which component may patch CR status -[x] define which component may create Events -[x] define which component may execute storage/workload/host mutation -[x] define evidence, preconditions, and audit fields for each allowed action -[x] explain why operator-status remains status/events-only +[ ] choose one primary harness: envtest, live throwaway cluster, or equivalent +[ ] load real SwBlockVolume CRD schema +[ ] install lifecycle-owner RBAC separate from operator-status +[ ] install admission policy/webhook or equivalent finalizer-only enforcement +[ ] prove operator-status RBAC remains status/events-only ``` Verification: ```text -docs review: current-plan, roadmap, lifecycle-owner control contract -no code changes that broaden RBAC before this contract is accepted +documented harness command +negative test proving mock-only is not the source of truth ``` -## D2: Real Kubernetes API / RBAC Harness +## D2: Allowed Finalizer Patch -Goal: stop live-only schema/RBAC bugs before QA. +Goal: prove the one intended mutation works. -Status: dev-complete for the non-mutating Phase 41 path. The schema-aware -boundary gate is in place; a real live-apiserver/envtest path remains a required -carry-forward before any finalizer mutation ships. +Allowed patch shape: + +```json +{"metadata":{"finalizers":["block.seaweedfs.com/swblockvolume-protection"]}} +``` Acceptance: ```text -[x] harness loads real SwBlockCluster/SwBlockVolume CRD status schemas -[x] harness uses equivalent ServiceAccount/RBAC tokens for observer and - lifecycle owner -[x] status-only observer can patch status and create Events only -[x] lifecycle owner can perform only the explicitly approved finalizer-shaped - main-object patch -[x] wrong status casing, enum drift, endpoint drift, RBAC broadening, spec - patch, unrelated metadata patch, and fake `/finalizers` endpoint fail -[x] record that a live-apiserver/envtest version is still required before any - finalizer mutation ships +[ ] lifecycle-owner can add the Seaweed Block finalizer +[ ] lifecycle-owner can remove the Seaweed Block finalizer +[ ] repeated add/remove is idempotent +[ ] spec, labels, annotations, ownerReferences, and status are preserved +[ ] audit evidence records request, decision, reason, and object diff ``` -Verification: +## D3: Forbidden Main-Object Patches + +Goal: prove broad main-object patch permission is effectively confined. + +Forbidden patches: ```text -go test ./core/ops ./cmd/sw-block -scripts/run-phase41-lifecycle-owner-api-boundary.ps1 -scripts/run-phase41-lifecycle-owner-api-boundary.sh -testops/scenarios/lifecycle-owner-api-boundary-chain.yaml -future envtest/live-apiserver target with real CRD schemas and RBAC -negative tests for forbidden spec/storage/workload mutation +spec changes +status through the main object +labels or annotations changes +ownerReferences changes +deletionTimestamp manipulation +foreign finalizer add/remove +mixed finalizer + spec patch +mixed finalizer + unrelated metadata patch ``` -## D3: Delete-Safety To Lifecycle Preconditions - -Goal: convert Phase 39 delete-safety status into executable preconditions -without executing cleanup. - -Status: dev-complete, awaiting QA/review. - Acceptance: ```text -[x] blocked delete evidence rejects lifecycle release with stable reason -[x] clean delete evidence permits release intent -[x] missing evidence produces decision=unknown and release_allowed=false -[x] stale evidence produces decision=unknown from an explicit freshness fact -[x] cleanup-required evidence suggests scripted verification only -[x] CRD/report/dashboard/operator-snapshot agree on decision and evidence -[x] multi-volume evidence stays isolated per volume +[ ] every forbidden patch is rejected by real API/admission +[ ] rejection reason is stable enough for QA evidence +[ ] object is unchanged after every rejected patch ``` -Verification: +## D4: Forbidden Resource Mutations + +Goal: prove lifecycle-owner does not become a storage/workload mutator. + +Forbidden resources: ```text -from-bundle scenarios: clean, blocked, stale, missing, multi-volume -operator-status remains status/events-only +pods +deployments +persistentvolumeclaims +persistentvolumes +storageclasses +secrets +nodes +csidrivers +csinodes ``` -## D4: Finalizer Strategy Gate - -Goal: decide whether Phase 41 lands a finalizer mutation or stops at a -documented design block. - -Status: dev-complete, awaiting review. Phase 41 defers finalizer mutation and -continues with a dry-run/status lifecycle-owner path. - Acceptance: ```text -[x] explicitly choose one strategy: - - lifecycle-owner owns finalizer mutation with main-object patch RBAC, or - - finalizer mutation is deferred to a future CSI/lifecycle controller -[x] if lifecycle-owner owns it, add admission/code/RBAC proof that spec and - storage mutation stay forbidden -[x] if deferred, document the exact future owner and release non-claim -[x] user-facing impact is documented for PVC/CR deletion +[ ] create/update/patch/delete are denied for each forbidden resource +[ ] no product action attempts these mutations +[ ] operator-status permissions are unchanged ``` -Verification: +## D5: Delete-Safety Preconditions Stay External -```text -design review -RBAC can-i matrix -envtest/live-apiserver proof for the chosen strategy -``` - -## D5: First Bounded Mutation Prototype - -Goal: if D4 approves mutation, implement only finalizer add/remove. If D4 -defers mutation, implement the dry-run lifecycle-owner status path instead. - -Status: dev-complete, awaiting QA/review. D4 deferred mutation, so D5 shipped -the dry-run lifecycle-owner status path. +Goal: prove Phase 42 does not bypass the Phase 41 decision model. Acceptance: ```text -[x] disabled by default or explicitly beta-gated -[x] no storage/workload/host cleanup is executed -[x] clean volume: finalizer release is allowed and audited -[x] blocked volume: finalizer release is rejected and audited -[x] repeated reconciles are idempotent -[x] Events are bounded and stable -[x] operator-status RBAC remains unchanged +[ ] clean delete-safety evidence permits finalizer-release intent +[ ] blocked residue rejects finalizer-release intent +[ ] missing or stale cleanup evidence returns unknown +[ ] decisions are visible through CRD status/actions +[ ] Phase 42 does not execute cleanup to make the decision pass ``` -Verification: +## D6: Multi-Volume Isolation + +Goal: prove API/admission and action decisions are per object. + +Scenario: ```text -live lab or envtest finalizer lifecycle gate -can-i matrix -no pods/PVC/PV/StorageClass/host mutation -cleanup verifier remains zero-residue after test +A: finalizer patch allowed +B: spec patch rejected +C: blocked delete-safety rejected +D: stale evidence unknown ``` -## D6: Multi-Volume And Failure Isolation Gate - -Goal: prove the lifecycle-owner path does not mix volume identities or poison -other volumes. - -Status: dev-complete for the status/dry-run path. A live finalizer mutation gate -is not applicable because D4 deferred mutation. - Acceptance: ```text -[x] one blocked volume does not block status or lifecycle decisions for others -[x] one releasable volume does not release another volume -[x] stale evidence on one volume stays Unknown only for that volume -[x] Events, allowedActions, deleteSafety, and finalizer state are per-volume -[x] cleanup verification remains clean -``` - -Verification: - -```text -multi-volume from-bundle gate -live lab gate if finalizer mutation is enabled -CRD/report/dashboard/operator-snapshot agreement +[ ] A's allowed patch does not affect B/C/D +[ ] B's rejected patch leaves B unchanged +[ ] C/D status decisions do not block A's API proof +[ ] all Events/audit evidence use the correct volume identity ``` ## D7: Close Gate -Goal: close Phase 41 only if the lifecycle-owner boundary is real enough to -build future features on. - -Acceptance: +Phase 42 can close only if: ```text -[x] D1-D6 pass or a documented D4 design block is accepted -[x] operator-status remains status/events-only -[x] lifecycle-owner permissions are minimal and tested for the non-mutating - status/dry-run path -[x] first mutation path is either gated and QA-proven or explicitly deferred -[x] user-facing docs state what deletion/finalizer behavior is and is not -[x] roadmap is updated for Phase 42 -[ ] QA sign-off is received -``` - -Verification: - -```text -finished plan -QA sign-off -roadmap update -git diff --check +[ ] real API/admission proof is used +[ ] finalizer-shaped add/remove works +[ ] forbidden main-object patches fail +[ ] forbidden resource mutations fail +[ ] operator-status remains status/events-only +[ ] delete-safety remains status/action evidence, not cleanup execution +[ ] QA sign-off records that Phase 43 is eligible to implement the first real + finalizer mutation ``` ## Current Progress -- 0%: Phase 41 opened from the v0.4 beta operator-status release baseline. The - phase is intentionally larger than a single finalizer fix: it must establish - a lifecycle-owner boundary, a real Kubernetes API/RBAC test harness, and the - first bounded mutation decision before adding storage lifecycle features. -- 14%: D1 dev-complete. Added - `internal/docs/ref/lifecycle-owner-control-contract.md`, defining the - observer/status writer, lifecycle owner, and executor roles; preserving the - released operator-status status/events-only boundary; and making finalizer - mutation an explicit lifecycle-owner strategy decision rather than an RBAC - patch to the observer. -- 24%: D2 schema-aware boundary gate dev-complete. Added - `TestPhase41D2LifecycleOwnerFinalizerBoundary`, Phase 41 D2 wrapper scripts, - and a TestOps scenario. The gate proves the observer cannot patch the main - `SwBlockVolume`, the future lifecycle-owner identity can only make a - finalizer-shaped main-object patch, and spec/unrelated metadata/fake - `/finalizers` endpoint mutation is rejected. A true live-apiserver/envtest - execution path remains open before D2 can be called fully closed. -- 42%: D3 dev-complete. Delete-safety now uses - `decision=unknown` for missing cleanup evidence instead of treating missing - evidence as confirmed blocked residue. From-bundle tests prove blocked - residue rejects release, clean evidence allows release, missing evidence keeps - data-plane readiness separate from lifecycle release, and the surfaces carry - the same delete-safety decision. Cleanup summaries now carry - `cleanup_observed_at`, and stale cleanup evidence produces - `decision=unknown reason=cleanup_evidence_stale` instead of allowing - finalizer release. -- 56%: D4 strategy dev-complete. Added - `internal/docs/ref/lifecycle-owner-finalizer-strategy.md`. Phase 41 will not - ship finalizer add/remove because the future lifecycle owner still lacks a - real API/admission proof for main-object patch confinement. The release - non-claim remains: delete-safety is status-only guidance, not Kubernetes - deletion protection. -- 70%: D5 dev-complete. Delete-safety decisions now project a dry-run - `safe_k8s.release_swblockvolume_finalizer` lifecycle-owner action across - report, operator-snapshot, and CRD allowedActions. Clean evidence produces - `decision=allowed`, residue produces `decision=rejected`, and missing/stale - evidence produces `decision=unknown`; all carry `mutationAllowed=false`. -- 84%: D6 dev-complete for the non-mutating Phase 41 path. The multi-volume - operator-status regression now covers blocked, ready, releasable, and stale - delete-safety decisions in one reconcile. Each volume keeps its own - `deleteSafety` and dry-run lifecycle-owner action decision, with no finalizer - mutation Events and no cross-volume contamination. -- 90%: D7 local close criteria are satisfied for the non-mutating slice. Phase - 41 intentionally closes as lifecycle-owner boundary + dry-run/status decision - work, not as finalizer execution. The live-apiserver/envtest admission/RBAC - proof remains a required carry-forward before any future lifecycle-owner - component can receive main-object `patch swblockvolumes`. +- 0%: Phase 42 opened from the Phase 41 lifecycle-owner foundation. The + planning contract is drafted in + `internal/docs/ref/phase42-lifecycle-owner-api-admission-gate.md`. ## Prerequisites / Risks - `tp01` was reported `NotReady`/unreachable during recent QA. Restore before any multi-node live gate. -- Do not broaden operator-status RBAC. It is the released status/events-only - observer and must stay that way. -- A finalizer controller for CRDs needs main-object patch permission. Treat this - as a lifecycle-owner design decision, not a small RBAC tweak. -- Mock-only tests are insufficient for shipping future CRD/RBAC writers. Phase - 41 uses schema-aware equivalent RBAC for the non-mutating boundary; a real - live-apiserver/envtest proof is required before finalizer mutation. -- If D4 cannot prove a safe mutation boundary, Phase 41 should close with a - documented defer decision rather than shipping a weak mutating controller. +- Do not broaden operator-status RBAC. +- Do not treat mock-only tests as proof. The gate must exercise a real + Kubernetes API/admission path or an equivalent envtest harness. +- If finalizer confinement cannot be proven, Phase 42 must fail closed and Phase + 43 must not start. ## Next Step -Send Phase 41 to QA using -`internal/docs/qa-assignments/phase41-lifecycle-owner-foundation-qa.md`. If QA -passes, write the finished plan. If QA finds a live boundary gap, fix that -before closing. +Implement D1: choose the harness shape, wire the real CRD/RBAC/admission test +surface, and prove the existing status-only observer remains unchanged. diff --git a/seaweed-block/internal/docs/finished-plans/phase41_finishedplan_lifecycle_owner_foundation.md b/seaweed-block/internal/docs/finished-plans/phase41_finishedplan_lifecycle_owner_foundation.md new file mode 100644 index 0000000000..5d2fd067d9 --- /dev/null +++ b/seaweed-block/internal/docs/finished-plans/phase41_finishedplan_lifecycle_owner_foundation.md @@ -0,0 +1,96 @@ +# Phase 41 Finished Plan: Lifecycle Owner Foundation + +Status: closed on 2026-06-14. + +Branch: `phase41-lifecycle-owner-foundation` + +## Outcome + +Phase 41 establishes the control-plane boundary that future storage-lifecycle +features must reuse, without breaking the released status/events-only +`operator-status` boundary and without shipping any Kubernetes lifecycle +mutation. The product now has: + +```text +an explicit lifecycle-owner contract (observer / lifecycle-owner / executor), +delete-safety converted into executable allowed/rejected/unknown preconditions, +a dry-run lifecycle-owner finalizer-release action surface (never executed), +and a schema-aware API/RBAC boundary gate for the future mutating component. +``` + +The Phase 39 finding drove the phase: changing `metadata.finalizers` on a CRD +requires main-object `patch swblockvolumes`, which is too broad for the +status-only observer. Rather than weaken that boundary with an RBAC tweak, Phase +41 defines a separate lifecycle-owner role and **defers** finalizer mutation until +a real Kubernetes API/admission proof exists. + +## Delivered + +- Lifecycle-owner control contract + (`internal/docs/ref/lifecycle-owner-control-contract.md`): three roles with + separate, non-implicit RBAC; allowed/forbidden permissions per role; the action + contract fields; delete-safety precondition table; required gates before any + mutation ships. +- Finalizer strategy decision + (`internal/docs/ref/lifecycle-owner-finalizer-strategy.md`): **Path B (defer)**. + Phase 41 does not ship finalizer add/remove; the release non-claim + ("delete-safety is status-only guidance, not Kubernetes deletion protection") + is kept. +- Delete-safety preconditions: clean → `releasable/allowed`, residue → + `blocked/rejected`, missing → `requested/unknown`, stale → + `requested/unknown reason=cleanup_evidence_stale`; data-plane `Ready` stays + independent of lifecycle release. +- Dry-run lifecycle-owner action surface across report, operator-snapshot, and + CRD `allowedActions`: `safe_k8s.release_swblockvolume_finalizer`, `mode=dry_run`, + `ownerExecutor=lifecycle_owner`, `mutationAllowed=false`, decision mirrors + delete-safety; no finalizer mutation Events. +- Schema-aware API boundary gate + (`scripts/run-phase41-lifecycle-owner-api-boundary.{ps1,sh}`, + `testops/scenarios/lifecycle-owner-api-boundary-chain.yaml`, + `TestPhase41D2LifecycleOwnerFinalizerBoundary`): observer cannot patch the main + object; lifecycle-owner identity may issue only a finalizer-shaped patch; + spec/unrelated-metadata/fake-`/finalizers` patches are rejected. +- Cleanup freshness: `verify-helm-cleanup.sh` now emits + `cleanup_observed_at=`; `cleanup_status` + residue counters + exit + behavior unchanged. +- Multi-volume isolation regression (four volumes: blocked / ready / releasable / + stale) proving per-volume `deleteSafety`, per-volume dry-run action, and no + cross-volume contamination. + +## QA Result + +All gates pass — see +`internal/docs/qa-assignments/phase41-lifecycle-owner-foundation-qa-signoff.md`: + +```text +G1 contract review PASS +G2 API boundary gate PASS (schema-aware/equivalent-RBAC) +G3 delete-safety decision semantics PASS +G4 cleanup freshness source PASS (cleanup_observed_at RFC3339 UTC) +G5 dry-run lifecycle-owner action PASS +G6 multi-volume isolation PASS +G7 live operator-status boundary PASS (status/events-only; RBAC unchanged) +``` + +## Required Carry-Forward (Phase 42 entry point) + +```text +A full live-apiserver/envtest lifecycle-owner RBAC/admission gate is still +required before any finalizer mutation (main-object patch swblockvolumes) can +ship. Phase 41's boundary gate is schema-aware/equivalent-RBAC, not a live +apiserver/admission proof. +``` + +## Non-Claims (unchanged) + +Phase 41 does not implement a mutating operator, finalizer add/remove, automatic +cleanup, repair/rebuild/failback/backup/restore/promotion/fencing, NVMe ANA +parity, or production SLOs. It defines the boundary those features must use. + +## Next + +Phase 42: real lifecycle-owner API/admission gate — an envtest/live-apiserver +proof that a lifecycle-owner identity can perform only a constrained +`metadata.finalizers` patch (spec/unrelated-metadata/storage/workload mutation +fails against a real API server) before any actual finalizer add/remove is +enabled. NVMe / rebuild / backup remain deferred until that proof exists. diff --git a/seaweed-block/internal/docs/qa-assignments/phase41-lifecycle-owner-foundation-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase41-lifecycle-owner-foundation-qa-signoff.md new file mode 100644 index 0000000000..1fcdc0cdc1 --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase41-lifecycle-owner-foundation-qa-signoff.md @@ -0,0 +1,167 @@ +# QA Sign-off — Phase 41 Lifecycle Owner Foundation + +Verdict: **PASS (non-mutating slice).** Phase 41 establishes the lifecycle-owner +control boundary, converts delete-safety into executable preconditions, and ships +a dry-run lifecycle-owner action surface — **without** turning `operator-status` +into a mutating controller and **without** any finalizer add/remove. G1–G7 pass. + +**Required carry-forward (recorded per the assignment):** + +```text +A full live-apiserver/envtest lifecycle-owner RBAC/admission gate is still +required before any finalizer mutation (main-object patch swblockvolumes) can +ship. Phase 41's API boundary gate (G2) is schema-aware/equivalent-RBAC, not a +live apiserver/admission proof. +``` + +Date: 2026-06-14 +Source: branch `phase41-lifecycle-owner-foundation` @ `43c7a87 phase41: prepare +qa close handoff` (commits `d0ba1fb`..`b414a9f` + close handoff) +Runner/env: local `go test` + PowerShell boundary gate on the branch tree; live +`kubectl auth can-i` + `verify-helm-cleanup.sh` on the m02 k3s lab (clean). + +## Lab Node Health + +m01 `Ready`, m02 `Ready`, **tp01 `NotReady`/unreachable** (unchanged). Phase 41 +is non-mutating status/dry-run work; no multi-node RF=3 gate is required. Restore +tp01 before any future live finalizer-mutation gate. + +## G1 — Contract Review — PASS + +Reviewed `lifecycle-owner-control-contract.md`, +`lifecycle-owner-finalizer-strategy.md`, `current-plan.md`, `docs/roadmap.md`. + +- Three roles are explicit and separately permissioned: **observer/status + writer** (`operator-status`; CRD `/status` + Events only), **lifecycle owner** + (separate; owns lifecycle metadata, may patch finalizers *only if a future + phase proves the boundary*), **executor** (separate; not introduced here). +- Finalizer mutation is explicitly **deferred** (strategy doc "Decision": "Phase + 41 does **not** ship `SwBlockVolume` finalizer add/remove"). +- Delete-safety is framed as **status guidance, not deletion protection** + ("Delete-safety is status-only guidance, not Kubernetes deletion protection"). +- Non-claims list excludes mutating operator, finalizer add/remove, automatic + cleanup, rebuild, backup, NVMe — consistent across roadmap and current-plan. + +No doc implies operator-status owns finalizers or that cleanup/deletion-protection/ +rebuild/backup/NVMe is delivered. Pass criteria met; no fail conditions present. + +## G2 — API Boundary Gate — PASS (schema-aware; carry-forward applies) + +`scripts/run-phase41-lifecycle-owner-api-boundary.ps1` +(`results/phase41-api-boundary-qa/...-summary.txt`): + +```text +phase41_lifecycle_owner_api_boundary_status=ok +go_test_core_ops=ok +operator_status_main_patch_allowed=false +lifecycle_owner_finalizer_patch_allowed=true +lifecycle_owner_spec_patch_allowed=false +lifecycle_owner_unrelated_metadata_patch_allowed=false +finalizers_endpoint_allowed=false +``` + +As the assignment notes, this is schema-aware/equivalent-RBAC (CRD schema + token +RBAC equivalence), **not** a live-apiserver/admission envtest. Called out as the +open carry-forward, not a product failure. + +## G3 — Delete-Safety Decision Semantics — PASS + +`go test ./core/ops -run +'TestEvaluateSwBlockVolumeDeleteSafety|TestObservationBundle_DeleteSafety'` → `ok`. +All decision behaviors green (both the evaluator and the observation-bundle +projection): + +```text +clean evidence -> state=releasable decision=allowed release_allowed=true +residue -> state=blocked decision=rejected release_allowed=false +missing evidence -> state=requested decision=unknown release_allowed=false +stale evidence -> state=requested decision=unknown reason=cleanup_evidence_stale +not requested -> no premature decision +``` + +Missing/stale never becomes `allowed`; missing is not reported as confirmed +residue; data-plane `Ready` is not used to imply finalizer release is safe. + +## G4 — Cleanup Freshness Source — PASS + +`scripts/verify-helm-cleanup.sh` on the clean m02 lab: + +```text +cleanup_status=ok +k8s_residue_count=0 iscsi_residue_count=0 process_residue_count=0 +multipath_residue_count=0 hostpath_residue_count=0 +cleanup_observed_at=2026-06-14T17:56:28Z +``` + +`cleanup_observed_at` is present and RFC3339 UTC (`date -u +%Y-%m-%dT%H:%M:%SZ`, +script line 237); `cleanup_status` and all residue counters are preserved; exit +behavior unchanged (`exit 1` on failure, line 242). The verifier does not hide +residue. + +## G5 — Dry-Run Lifecycle-Owner Action Surface — PASS + +`go test ./core/ops -run +'TestOperatorStatusReconcilerProjectsDeleteSafetyWithoutFinalizerMutation|TestOperatorStatusReconcilerDeleteSafetyDoesNotContaminateOtherVolumes'` +→ `ok`. The reconciler projects, for each delete-safety volume, an `allowedActions` +entry `safe_k8s.release_swblockvolume_finalizer` with `Mode=dry_run`, +`OwnerExecutor=lifecycle_owner`, `MutationAllowed=false`, and `Decision` equal to +the volume's `deleteSafety` decision. `FinalizerPatchCount==0` and no +`finalizer_added`/`finalizer_released` Events are emitted. + +## G6 — Multi-Volume Isolation — PASS + +The isolation test drives four volumes in one reconcile and asserts per-volume +isolation: + +```text +A delete-a (blocked, iscsi_node_records_present) -> deleteSafety blocked / decision rejected +B healthy-b (ready, first_volume_verified) -> NO deleteSafety (uncontaminated) +C clean-c (clean evidence) -> deleteSafety releasable / decision allowed +D stale-d (stale evidence) -> deleteSafety requested / decision unknown / cleanup_evidence_stale +``` + +A does not contaminate B/C/D; C does not release A/B/D; D stays unknown only for +D; each volume carries its own `deleteSafety` + dry-run lifecycle-owner action; +`FinalizerPatchCount==0` (no finalizer mutation attempted). + +## G7 — Live Boundary / Non-Mutation — PASS + +Phase 41 makes **no change** to `operator-status` RBAC (git-confirmed: no Phase 41 +commit touches `templates/operator-status-rbac.yaml`; the only chart change is +2 +lines of SwBlockVolume CRD status schema). Fresh live `kubectl auth can-i` against +the applied Phase 41 operator-status RBAC on the m02 apiserver: + +```text +patch swblockvolumes.block.seaweedfs.com => no +patch swblockvolumes.block.seaweedfs.com --subresource=status => yes +create events => yes +patch pods => no +patch persistentvolumeclaims => no +update storageclasses.storage.k8s.io => no +``` + +`operator-status` remains status/events-only on the live apiserver. (RBAC was +applied for the check and removed; lab left clean.) + +## Blocking Findings + +None. Phase 41 is a non-mutating boundary + dry-run/status slice; it neither +broadens `operator-status` nor executes any lifecycle mutation. + +## Non-Blocking Findings / Carry-Forwards + +1. **Live-apiserver/envtest lifecycle-owner RBAC/admission gate is still required + before any finalizer mutation ships** (the explicit carry-forward above). G2 is + schema-aware/equivalent-RBAC; it does not exercise a real apiserver admission + path. This is the natural Phase 42 entry point. +2. **tp01 `NotReady`** — lab infra; restore before any live finalizer-mutation or + RF=3 gate. + +## Recommendation + +**Phase 41 can close** as the lifecycle-owner boundary + delete-safety +preconditions + dry-run lifecycle-owner action surface, with `operator-status` +provably still status/events-only. The next phase must build the real +live-apiserver/admission proof for a constrained main-object finalizer patch +before any actual finalizer add/remove is enabled. NVMe / rebuild / backup should +remain deferred until that control-plane proof exists.