feat(safety): add atomic WireGuard mutation and rollback engine
This commit is contained in:
@@ -263,7 +263,7 @@ Allowed status values: `NOT STARTED`, `IN PROGRESS`, `BLOCKED`, `DONE`.
|
||||
| M0 | DONE | Test harness and safe project skeleton |
|
||||
| M1 | DONE | Runtime foundation, CLI shell, and config loading |
|
||||
| M2 | DONE | WireGuard parser, client model, `status`, and `list` |
|
||||
| M3 | NOT STARTED | Locking, backups, atomic apply, and rollback engine |
|
||||
| M3 | DONE | Locking, backups, atomic apply, and rollback engine |
|
||||
| M4 | NOT STARTED | Safe client creation |
|
||||
| M5 | NOT STARTED | Client detail, config export, and QR display |
|
||||
| M6 | NOT STARTED | Safe client removal and archival |
|
||||
@@ -1593,6 +1593,20 @@ Use this template:
|
||||
- Suggested commit message: `feat(clients): add WireGuard state parsing and client listing`
|
||||
- Next milestone: M3
|
||||
|
||||
## 2026-10-12 — M3 — DONE
|
||||
|
||||
- Implemented: reusable internal mutation transaction with nonblocking `flock` serialization, post-lock state revalidation, same-filesystem restrictive staging, `wg-quick strip` validation, timestamped manifest backups with bounded safe retention, atomic config replacement, `wg syncconf` apply verification, and disk/runtime rollback with a distinct critical recovery status.
|
||||
- Coordinator: `gpt-5.6-sol` (`high`)
|
||||
- Subagents: `milestone_worker` / `milestone_repairer`, `gpt-5.6-luna` (`medium`)
|
||||
- Repair cycles: 11
|
||||
- Sol review: fixed incomplete rollback verification, unsafe temporary-file allocation and trap handling, false-positive lock/mode tests, missing failure and interruption coverage, permissive mock contracts, backup-manifest and retention gaps, runtime-dump verification gaps, unconditional pruning after failed mutations, unchecked backup writes, and backup-counter exhaustion that could reuse `-999`; all defects received regression coverage.
|
||||
- Verification: `bash -n wg-manager.sh`, `bash -n tests/run.sh`, `bash -n tests/helpers.sh`, `bash -n tests/mocks/bin/*`, `bash tests/run.sh transaction`, `bash tests/run.sh rollback`, `bash tests/run.sh locking`, `bash tests/run.sh backups`, `bash tests/run.sh`, `bash tests/run.sh mutation-preserves-source`, `bash tests/run.sh secret-modes`, `git diff --check`, per-file `git diff --no-index --check /dev/null <new-file>`, permission and secret-pattern review.
|
||||
- Result: all required checks passed; transaction/rollback/locking/backups/full/mutation-preserves-source/secret-modes passed 51/65/19/34/297/47/27 assertions. Concurrent mutation, INT/TERM cleanup, exact command order, source preservation, restrictive active temp and backup modes, apply rollback, critical rollback failures, hostile runtime dumps, safe pruning, and counter exhaustion were verified exclusively with fixtures and mocks. Optional `shellcheck wg-manager.sh tests/*.sh tests/mocks/bin/*` was `SKIP` because ShellCheck is unavailable.
|
||||
- Decisions: none
|
||||
- Known limitations: real WireGuard, networking, systemd, firewall, route, sysctl, journal, and deployment-server behavior was not accessed or tested; M3 verification is fixture- and mock-based as required. No add/remove/restore CLI command is exposed until later milestones.
|
||||
- Suggested commit message: `feat(safety): add atomic WireGuard mutation and rollback engine`
|
||||
- Next milestone: M4
|
||||
|
||||
# 8. Final completion rule
|
||||
|
||||
The MVP is complete only when:
|
||||
|
||||
Reference in New Issue
Block a user