"""custom-html — BACKUP overlay (Phase 1e HC3): assertion-only + additive.

The orchestrator ran `ops.pre_backup` (seeded "original" into the served volume), then performed the
backup ONCE. The generic backup tier already asserted a snapshot artifact was produced; this overlay
ADDS the recipe-specific check: the seeded "original" state is intact in the volume post-backup
(pre-mutation). The backup→restore divergence happens in `ops.pre_restore`. Reads via exec_in_app
(volume-direct), immune to the post-backup serving race after backup-bot-two cycles the container."""

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "runner"))
from harness import lifecycle  # noqa: E402

MARKER_PATH = "/usr/share/nginx/html/ci-marker.txt"


def test_backup_captures_state(live_app):
    assert lifecycle.exec_in_app(live_app, ["cat", MARKER_PATH]).strip() == "original", (
        "the seeded state was not present at backup time"
    )
