You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second PR in the v1.99 Update Engine Canonization track. Deepens G3-U4
with package-install target detection + two new preflight checks + a
planning-only RecoveryPlan surface. No mutation, no apply logic.
Architecture constraint (INV-U-001) remains intact:
Update is still a BOUNDED TRIGGER into the rebuild/lifecycle pipeline.
Apply work stays deferred to PR-18.
New file internal/installer/update/target.go:
- DetectInstallOrigin: probe rpm -q / dpkg -s / NFTBAN_SOURCE_DIR env
to classify origin when operator didn't pass --rpm/--deb/--source
- DetectPackageTarget: query rpm -q --queryformat '%{VERSION}' OR
dpkg -s | grep ^Version:
- Both functions READ-ONLY — no package manager transactions
Extensions:
- DetectVersions signature: +origin param; source tree wins over
package query so explicit --source-dir is always honoured
- Preflight: +origin param; new checks P-6 rebuild_recovery_available
(terminal prior state + ip nftban + nft binary) and P-7
install_origin_coherent (declared vs detected match)
- BuildRecoveryPlan: produces RecoveryPlan metadata (mechanism=rebuild,
Available bool, Notes). Planning-only — no recovery execution
- Plan.AttachRecovery + Plan.Recovery field: new planning surface
apply (PR-18) will consume per INV-U-002
- Plan.Render: shows Recovery block with availability + mechanism
Installer binary cmd/nftban-installer/update_dryrun.go:
- auto-detects origin via update.DetectInstallOrigin when no flag
passed (so package-install hosts without --rpm/--deb still get a
correct plan)
- attaches BuildRecoveryPlan output to the rendered plan
Tests (new target_test.go + extended update_test.go):
- 11 new unit tests covering DetectInstallOrigin (rpm/deb/source/unknown),
DetectPackageTarget (rpm/deb/not-owned/unknown-origin), DetectVersions
package-deb fallback + source-tree override, P-6/P-7 preflight paths,
BuildRecoveryPlan happy/no-state/in-progress cases
CI gate extensions:
- G3-U4 now asserts all 7 preflight checks reported
- New G3-U4-deepen step: Recovery block + Mechanism line must render
Out of scope (explicit — per spec + user guidance):
- No payload mutation
- No apply logic
- No rebuild switch changes
- No shell update path deletion
- No .conf.local write path changes
- No config delivery changes
- No rollback logic beyond planning/metadata
Depends on: v1.98.2 tag (already shipped), PR-16 merged (ca48884).
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments