verdict: NEEDS_CHANGES

gaps:
  - severity: high
    claim: "AC-6 (docs grep) has no corresponding entry in regression_plan.checks; the gating rule requires every acceptance criterion to be linked to a regression_plan.checks row via acceptance_ids."
    evidence: "docs/plans/STORE-WATCHER-BACKUP-BOUNDED-DEFAULTS.md:144-159 (regression_plan.checks REG-1=[AC-1,AC-3], REG-2=[AC-2,AC-3], REG-3=[AC-4,AC-5] — AC-6 not present)"
    suggested_fix: "Add a REG-4 entry with command `rg 'pre-optimize|backup_retain_count|MEMPALACE_BACKUP_RETAIN_COUNT' README.md docs/BACKUP_RESTORE.md docs/AGENT_INSTALL.md`, acceptance_ids: [AC-6], proves: docs continue to surface the bounded default and explicit keep-all opt-out so future doc edits cannot silently regress the user-facing safety guidance."
  - severity: medium
    claim: "Backlog scope item `Ensure default disk floors leave enough room for a temporary backup before prune` is interpreted as fail-closed refusal only; the plan never confirms whether the existing 1 GiB `disk_min_free_bytes` floor (which `backup_disk_min_free_bytes` falls back to) actually leaves enough headroom for a temp tar.gz of a typical post-watcher palace, nor whether install/onboarding writes a per-host floor. If the implicit interpretation is `keep current floor`, the plan should state that explicitly."
    evidence: "docs/BACKLOG.yaml:65-66 lists `Ensure default disk floors leave enough room for a temporary backup before prune.`; plan addresses only the fail-closed budget check in AC-5/VER-5/REG-3 and does not adjust DEFAULT_DISK_MIN_FREE_BYTES (mempalace_code/config.py:29) or call out that the requirement is satisfied by the existing 1 GiB floor."
    suggested_fix: "Either (a) add a Design Notes line that the existing 1 GiB `disk_min_free_bytes` default is intentionally kept and that AC-5 is the regression that proves the fail-closed behavior, or (b) widen the plan to bump the floor / add an install-time write of `backup_disk_min_free_bytes`, with a verification row. Closing this ambiguity prevents a later attempt being judged against an unstated default-floor expectation."
  - severity: low
    claim: "Pre-existing assertion `test_retention_default_zero_keeps_all_archives` in `tests/test_storage.py` runs `safe_optimize(backup_first=True)` twice with no `MEMPALACE_BACKUP_RETAIN_COUNT` set and expects both pre_optimize archives to survive. Under the new implicit bound (proposed default `5` per Design Notes) two archives still pass numerically, but the test name and docstring (`default backup_retain_count=0 disables pruning`) will be semantically wrong once the implicit bound is wired up. The plan lists `tests/test_storage.py` for updates but does not call out this specific rename/rewrite."
    evidence: "tests/test_storage.py:1166-1188 — `test_retention_default_zero_keeps_all_archives` and its docstring claim the default disables pruning, which will be incorrect after the change."
    suggested_fix: "In the plan's `tests/test_storage.py` line item, explicitly note that the legacy `test_retention_default_zero_keeps_all_archives` (and any sibling whose docstring still claims `default backup_retain_count=0 disables pruning`) is renamed/rewritten to reflect the new implicit bound, or that it is replaced by the new `test_default_pre_optimize_retention_prunes_to_bound` and `test_explicit_zero_retention_keeps_all_pre_optimize_archives` test methods to avoid stale naming."
