PR26.2: panel-survival framework + FakePanelAdapter#529
Merged
Conversation
PR26.2 — generic hosting-panel adapter framework. Adds the
PANEL-SURVIVAL-001 invariant: a detected panel whose adapter
integration fails must not reach StateCommitted unless the operator
opts out via --no-panel.
internal/installer/panelfw/ (new package):
- PanelAdapter interface (read-only contract)
- PanelDetection / PanelPolicy / PanelResult types
- Register / RegisteredAdapters (registry; empty in PR26.2)
- DefaultPolicy (RequirePanelSuccess=true, AllowPanelAbsent=true)
- Evaluate / EvaluateAdapters (test-callable variant)
- FakePanelAdapter (test-only via _test.go) + 14 spec tests
internal/installer/validate:
- new assertion `panel_survival_ok` consuming opts.PanelPolicy
- new RunAssertionsWithOpts(...) entry point + AssertionOpts.WithPanelPolicy
- existing RunAssertions delegates to RunAssertionsWithOpts with default opts;
callers stay source-compatible
- integration tests prove the assertion blocks StateCommitted via AllPassed
cmd/nftban-installer:
- new --no-panel flag
- phaseData.noPanel propagates from cfg
- phaseValidate (VALIDATE_1 and VALIDATE_2) calls RunAssertionsWithOpts
with the operator-derived policy
Hard exclusions:
- no DirectAdmin / cPanel / Plesk adapter (those land in PR26.3+)
- no firewall mutation
- no runtime nft surgery
- no host destructive testing
- no restore changes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generic hosting-panel adapter framework. Adds PANEL-SURVIVAL-001 as a new post-install assertion so a detected panel with a failing integration cannot reach StateCommitted (unless the operator passes
--no-panel).PR26.2 ships the framework + a test-only
FakePanelAdapter. No real adapter is registered — DirectAdmin lands in PR26.3 only after this merges.Scope
Hard exclusions preserved per the operator authorization:
Invariant — PANEL-SURVIVAL-001
Implemented as: assertion
panel_survival_okappended toRunAssertions. Failure →AllPassedreturns false → existing gate atcmd/nftban-installer/phases.gofalls through toStateDegraded. Nophases.gomutation logic added — only an opts-bearing call to the newRunAssertionsWithOpts.Architecture
The framework calls only the contract methods on adapters (
Detect,RequiredPorts,ValidateReachability). All three are read-only by interface contract. PR26.2'sFakePanelAdapterhas zero mutation surface — verified structurally by theTestFramework_NoExecutorMutationtable test.Test matrix (FakePanelAdapter spec)
AllowPanelAbsent=false+ no panel detectedOperatorDisabled=trueOperatorDisabled=trueRequirePanelSuccess=falseDefaultPolicy()valuesPlus 3
validate-level integration tests:TestRunAssertions_PanelSurvival_BlocksStateCommitted— adapter failure →AllPassed=falseTestRunAssertions_PanelSurvival_OperatorDisabled_DoesNotBlock—--no-panel→AllPassed=trueTestRunAssertions_DefaultPath_PanelSurvivalPasses— defaultRunAssertions(empty registry) → passLab proof (lab4, RHEL/cPanel, go1.25.8)
Branch base:
cdf8f770(origin/main, post-PR26.1 merge).TMPDIR=/root/build-tmp(lab4: both /tmp and /var/tmp are noexec under cPanel).Test plan
go test ./internal/installer/panelfw/...green on lab4go test ./internal/installer/validate/...green on lab4 (no regression vs PR26.1 baseline)go vet ./internal/installer/panelfw/... ./internal/installer/validate/... ./cmd/nftban-installer/...clean on lab4go test ./...green on lab4 (65 packages, 0 fail)🤖 Generated with Claude Code