fix(parity): the golden fixture dedups units, so read DUPLICATES too - #402
Conversation
The check read tests/golden/web/units/ and nothing else. The fixture
deduplicates a file whose bytes already appear in the snapshot, recording
it as a line in DUPLICATES instead — so the web config's earlyoom.service
lives under vm/units/, and reading web/units/ alone under-reported what
the module ships by two units.
Both were real divergences the check called clean:
earlyoom.service the module runs earlyoom as its OOM
backstop; the native profile ships the
binary and never configures or starts it,
so protectMemory natively is
OOMScoreAdjust alone (#394 gap 9).
agent-box-defang-cli.service the module installs the Defang CLI in the
background (#373); the native profile has
no defang at all — the same reason its
settings page offers no defang card.
Found by asking a question the check should have answered: "is earlyoom
in the NixOS backend?" It is, and the check had been reporting the unit
as present in neither.
Refs #394
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBDHCBttvBEHQJJH24MfxF
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe backend parity checker now includes deduplicated unit snapshots, validates the duplicates directory, recognizes two known unit divergences, and compares native units with a reconstructed module unit set. ChangesBackend parity validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change makes the parity check account for deduplicated units and records the newly visible known gaps; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Refs #394. A blind spot in the check merged in #396, found by a question I could not answer from the check's own output: "is earlyoom in the NixOS backend?"
The bug
The check read
tests/golden/web/units/and nothing else. But the golden fixture deduplicates: a file whose bytes already appear in the snapshot is recorded as a line inDUPLICATESrather than written twice (issue #312). So the web config'searlyoom.servicephysically lives undervm/units/, and readingweb/units/alone under-reported what the module ships.Two units were invisible, and both are real divergences the check was calling clean:
earlyoom.serviceprotectMemorynatively isOOMScoreAdjustalone, with no earlyoom, no zram, no swappiness. (#394 gap 9)agent-box-defang-cli.serviceWorth noting what the failure looked like: not a wrong answer, but a confidently empty one. The check said every divergence was declared, and the thing it could not see was a unit that has been module-only all along.
The fix
module_unit_names()reconstructs the web config's real unit set fromweb/units/plus the left-hand side of everyweb/units/... ->line inDUPLICATES.DUPLICATESjoins the preflight existence check, so a fixture layout change can't make this pass vacuously either.Both newly-visible units are declared in
UNITS_KNOWN_GAPSwith their issue — and the staleness check means closing either gap forces deleting its line.Checks run
nix build .#checks.aarch64-linux.backend-parity— passes, with earlyoom and defang-cli now listed as known gapsFAIL: 2 undeclared unit divergence(s)Note on the stack
#398 and #399 branch off the pre-fix parity script. #399 edits the same region (it deletes fail2ban from
UNITS_KNOWN_GAPSand addsUNIT_ALIASES), so whichever merges second wants a trivial rebase — I own both and will do it.