chore: update plan docs, add optimize-update-sh plan
NexusGuard CI / server-core-test (push) Failing after 36s
NexusGuard CI / device-agent-test (push) Failing after 31s
NexusGuard CI / dashboard-ui-build (push) Failing after 25s

This commit is contained in:
datadunia
2026-05-27 04:36:53 +07:00
parent 0b943aead0
commit cf6ffba404
5 changed files with 368 additions and 82 deletions
@@ -59,14 +59,14 @@ Memperbaiki 5 bugs dashboard-ui + server-core + 3 critical bugs dari Metis revie
6. **models.go + peers.go + devices.go + heartbeat/redis.go**: IsActive default false
### Must Have
- [ ] IPAM tidak lagi mengalokasikan IP yang sama dengan server's interface_address
- [ ] Edit node dengan mengubah IPPoolCIDR → InterfaceAddress otomatis recalculate
- [ ] Single input IP/Prefix menolak network address (x.x.x.0/24) dan broadcast
- [ ] Peer Address di config menggunakan netmask dari pool, bukan /32
- [ ] Device baru muncul sebagai "Offline" sampai heartbeat pertama
- [ ] Advanced Overrides collapsible (default tertutup) di create + edit form
- [ ] Table default "Off" untuk server baru
- [ ] Editable wg.conf view dengan validasi keamanan
- [x] IPAM tidak lagi mengalokasikan IP yang sama dengan server's interface_address
- [x] Edit node dengan mengubah IPPoolCIDR → InterfaceAddress otomatis recalculate
- [x] Single input IP/Prefix menolak network address (x.x.x.0/24) dan broadcast
- [x] Peer Address di config menggunakan netmask dari pool, bukan /32
- [x] Device baru muncul sebagai "Offline" sampai heartbeat pertama
- [x] Advanced Overrides collapsible (default tertutup) di create + edit form
- [x] Table default "Off" untuk server baru
- [x] Editable wg.conf view dengan validasi keamanan
### Must NOT Have (Guardrails)
- **JANGAN** ubah struktur kolom DB WgServer (merge hanya UI-level, backend tetap 2 field)
@@ -121,7 +121,7 @@ Wave 3 (wg.conf Editable View):
## TODOs
- [ ] 1. Fix IPAM string comparison — strip prefix dari interface_address
- [x] 1. Fix IPAM string comparison — strip prefix dari interface_address
**What to do**:
- Di `ipam/manager.go:AllocateIPFromCIDR()` (line 87-107): saat `Pluck("interface_address", &serverIPs)`, data yang didapat format `"10.8.0.1/24"` (dengan prefix)
@@ -167,7 +167,7 @@ Wave 3 (wg.conf Editable View):
Evidence: .sisyphus/evidence/task-1-ipam-fix.json
```
- [ ] 2. Fix Update handler — recalculate InterfaceAddress saat IPPoolCIDR berubah
- [x] 2. Fix Update handler — recalculate InterfaceAddress saat IPPoolCIDR berubah
**What to do**:
- Di `api/servers.go:321-326` (Update handler):
@@ -191,7 +191,7 @@ Wave 3 (wg.conf Editable View):
- [ ] PUT /servers/{id} with `{"ip_pool_cidr": "10.9.0.0/24"}` → InterfaceAddress berubah jadi `10.9.0.1/24`
- [ ] PUT /servers/{id} with `{"ip_pool_cidr": "10.9.0.0/24", "interface_address": "10.9.0.5/24"}` → InterfaceAddress = `10.9.0.5/24` (manual override)
- [ ] 3. Change GORM defaults — IsActive=false + Table=off
- [x] 3. Change GORM defaults — IsActive=false + Table=off
**What to do**:
- `models.go:37`: `Table string \`...default:'auto'\`` → `default:'off'`
@@ -206,7 +206,7 @@ Wave 3 (wg.conf Editable View):
- `apps/server-core/internal/models/models.go:37` — Table field
- `apps/server-core/internal/models/models.go:70` — IsActive field
- [ ] 4. Fix SyncToDB — isActive default false instead of true
- [x] 4. Fix SyncToDB — isActive default false instead of true
**What to do**:
- `heartbeat/redis.go:67` — change `isActive := true` to `isActive := false`
@@ -219,7 +219,7 @@ Wave 3 (wg.conf Editable View):
**References**:
- `apps/server-core/internal/heartbeat/redis.go:57-84` — SyncToDB function
- [ ] 5. Remove IsActive:true hardcode dari CreatePeer + Devices.Create
- [x] 5. Remove IsActive:true hardcode dari CreatePeer + Devices.Create
**What to do**:
- `peers.go:99`: Hapus `IsActive: true` dari struct literal (gunakan default dari model)
@@ -236,7 +236,7 @@ Wave 3 (wg.conf Editable View):
- `apps/server-core/api/peers.go:89-103` — Device creation struct
- `apps/server-core/api/devices.go` — Devices handler
- [ ] 6. Fix peer Address — gunakan pool netmask (bukan /32)
- [x] 6. Fix peer Address — gunakan pool netmask (bukan /32)
**What to do**:
- `peers.go:133`: `Address = %s/32` → parse `wgServer.IPPoolCIDR`, ambil `ones` (netmask bits), gunakan `%s/%d`
@@ -261,7 +261,7 @@ Wave 3 (wg.conf Editable View):
- [ ] Peer dengan server pool `10.8.0.0/24` → Address = `10.8.0.2/24` (bukan /32)
- [ ] Server tanpa pool (kosong) → Address = `x.x.x.x/32` (fallback)
- [ ] 7. Merge IP Pool + Interface Address jadi 1 input + available IP count
- [x] 7. Merge IP Pool + Interface Address jadi 1 input + available IP count
**What to do**:
- **Create form** (`Servers.vue`):
@@ -311,7 +311,7 @@ Wave 3 (wg.conf Editable View):
- [ ] Tampilkan "254 available IP addresses" untuk /24, "126" untuk /25
- [ ] Edit form menunjukkan existing server sebagai `{ip}/{prefix}`
- [ ] 8. Advanced Overrides collapsible + Table default "Off"
- [x] 8. Advanced Overrides collapsible + Table default "Off"
**What to do**:
- Tambahkan `showAdvanced` ref (default `false`) seperti di DeviceDetail.vue
@@ -353,7 +353,7 @@ Wave 3 (wg.conf Editable View):
- [ ] Create server baru → Table = "off" secara default
- [ ] Edit server → Table = "off" jika belum pernah diubah
- [ ] 9. Device status UI — handle IsActive=false untuk device baru
- [x] 9. Device status UI — handle IsActive=false untuk device baru
**What to do**:
- **Devices.vue:29-33**: Status badge sudah menggunakan `device.IsActive ? 'Online' : 'Offline'`
@@ -370,7 +370,7 @@ Wave 3 (wg.conf Editable View):
- `apps/dashboard-ui/src/views/Devices.vue:29-33` — Status display
- `apps/dashboard-ui/src/views/DeviceDetail.vue:12-14` — Status badge
- [ ] 10. Editable wg.conf view + backend validation endpoint
- [x] 10. Editable wg.conf view + backend validation endpoint
**What to do**:
- **Frontend** (`PeerConfigModal.vue`):
@@ -423,16 +423,16 @@ Wave 3 (wg.conf Editable View):
## Final Verification Wave
- [ ] F1. **Plan Compliance Audit** — `oracle`
- [x] F1. **Plan Compliance Audit** — `oracle`
Verify: IPAM fix applied, all 5 bugs addressed, no scope creep
- [ ] F2. **Code Quality Review** — `unspecified-high`
- [x] F2. **Code Quality Review** — `unspecified-high`
Run `tsc --noEmit` + `bun test`, check for unused imports, console.log
- [ ] F3. **Real Manual QA** — `unspecified-high` (+ playwright)
- [x] F3. **Real Manual QA** — `unspecified-high` (+ playwright)
Execute QA scenarios for all 10 tasks. Test cross-task integration.
- [ ] F4. **Scope Fidelity Check** — `deep`
- [x] F4. **Scope Fidelity Check** — `deep`
Verify: Must Have checklist complete, Must NOT compliance
---
@@ -449,10 +449,10 @@ Wave 3 (wg.conf Editable View):
## Success Criteria
### Final Checklist
- [ ] Server yang InterfaceAddress-nya `10.8.0.1/24` — peer tidak dapat IP `10.8.0.1`
- [ ] Single input `10.172.20.1/24` → IP Pool `10.172.20.0/24`, Interface `10.172.20.1/24`
- [ ] Peer Address di config: `10.172.20.2/24` (mengikuti pool netmask)
- [ ] Advanced Overrides collapsible + Table default "Off"
- [ ] Editable wg.conf view dengan validasi
- [ ] Device baru: "Offline" sampai heartbeat pertama
- [ ] `10.172.20.0/24` — tolak sebagai network address
- [x] Server yang InterfaceAddress-nya `10.8.0.1/24` — peer tidak dapat IP `10.8.0.1`
- [x] Single input `10.172.20.1/24` → IP Pool `10.172.20.0/24`, Interface `10.172.20.1/24`
- [x] Peer Address di config: `10.172.20.2/24` (mengikuti pool netmask)
- [x] Advanced Overrides collapsible + Table default "Off"
- [x] Editable wg.conf view dengan validasi
- [x] Device baru: "Offline" sampai heartbeat pertama
- [x] `10.172.20.0/24` — tolak sebagai network address