# --- F. THE MAIN EVENT: a full-disc rip ------------------------------------
# ALL tracks, once, FLAC, fast-verified. This is the archival rip and the one
# whose artifacts matter most.
#
# THE TITLE CARRIES A COLON AND A '<', BOTH DELIBERATE — this is §T2.
#
#   * The COLON is the only thing that exercises the tag escape.
#     `_escape_meta_value` sends a literal ':' to cyanrip as '\:'. A safety net
#     reverses any leftover '∶' (U+2236 RATIO) in the written tags, armed ONLY
#     when the metadata actually contains a colon — so before 2026-08-20 that
#     gate was False on every scripted rig rip and the escape had never once run
#     on hardware.
#     WHAT TO LOOK FOR: this album's tag must read with a REAL colon. A '∶'
#     means the escape did not survive. The FOLDER name is expected to differ —
#     we now pass `-T unicode` and the fork's measured table says the folder
#     becomes `full acceptance∶ angle‹bracket`.
#
#   * The '<' exercises the PlainText fix. Three QMessageBox surfaces rendered
#     external text as HTML, so a '<' in an album-derived string was parsed as an
#     unknown tag and EVERYTHING AFTER IT WAS SILENTLY DROPPED. The surface that
#     names this folder is the overwrite prompt in section H.
#
# Cover art, CTDB verify, FLAC verify and the EAC-compatible log are all turned
# ON for this rip. They are the post-rip subsystem and nothing else in this file
# reaches all four at once.
#
# THE TIMEOUT COVERS A SECURE RE-READ, because this rip can do one.
#
# It said three hours, reasoning that "a full disc on this hardware is 50-70
# minutes and one real session measured 2h45m". Both figures are real and the
# conclusion was wrong: they describe a rip WITHOUT the secure re-read. F runs
# `fast_verified`, DYNAMIC mode: pass 1 has no `-Z`, and only tracks AccurateRip
# does not confirm are re-read, at `-Z 2 -r 5` (`-r 3` until section B stopped
# leaving 3 behind, 2026-09-28). Section N re-reads EVERY track that way, so F's
# worst case — a disc AccurateRip does not know — is N's workload.
#
# Measured 2026-09-03: it timed out at 10800.1s with the status reading
# "Re-ripping track 5 to secure it - 43% - about 1m 50s left in re-read 2".
# Roughly three hours and two minutes for work budgeted at three hours, and the
# four failures that followed were all this one cap: the status was not 'Done'
# because the rip was still running, the next `rip` collided with it, and the
# overwrite dialog never came.
#
# So it matches section N's budget, because its worst case is N's workload.

# **SECTION F PINS ITS GOAL, and until 2026-09-15 it inherited one.** F is the
# FAST whole-disc rip and section N is the UNIFORM SECURE RE-READ of the same
# disc; the run's value is that they are two different tests. N sets
# `rip_goal archival` explicitly. F set nothing and took whatever the config
# happened to hold — so on the 2026-09-15 12:01 run, which began with the config
# already on `archival`, **F and N ran the identical test**: both whole-disc,
# both uniform secure re-read, both 14/14 with the same 13-converged/1-not, both
# 3h10m. The run spent **six hours and twenty-one minutes proving one thing
# twice**, and the `fast_verified` whole-disc path — the DEFAULT most users have
# — got no hardware coverage at all. Every section still passed, because nothing
# asked.
#
# This is the third time the same shape has cost this file, and the first two are
# one screen apart in `docs/testing.md` §5.bi: section N inherited its
# `output_format` from a preset (fixed 2026-09-14), sections K1/K2 inherited
# their only real assertion from a witness that could not see it (fixed
# 2026-09-15). **A section's distinguishing property is asserted AT the section,
# never inherited** — a run cannot tell you two things differ if nothing pinned
# the difference.
#
# `fast_verified` is also the correct restore target for section Q, so this line
# and that one now agree about what the rig's resting state is.

log --- F. the main event: full-disc rip, all tracks, every post-rip check on ---
run-size standard
set rip_goal fast_verified
expect rip_goal fast_verified
expect secure_rerip_dynamic on
set cover_art embed
expect cover_art embed
set save_additional_art on
set ctdb_verify_after_rip on
set verify_flac_after_rip on
set write_eac_log_after_rip on
expect write_eac_log_after_rip on
# The format this rip writes in, asserted where the rip happens. Section B pins
# it 150 lines up and nothing between changes it, so this is the low-risk twin
# of the same assertion in N — where the chain was genuinely broken. Cheap, and
# it means a whole-disc rip never takes its format on trust.
expect output_format flac
select-tracks all
album full acceptance: angle<bracket (run) (ripper)
album-artist Platterpus Acceptance
rip
wait-for-rip 21600
snapshot afterfullrip
log A4 (TASKS "Three screenshot steps found no window on screen"): the next screenshot records info, not fail, if the display has stopped showing the app
screenshot afterfullrip
# ASSERT THE RIPPER'S RECORD, NOT THE LABEL ON SCREEN.
#
# This was `expect-status Done` for most of this file's life, under a comment
# claiming that "matching one disc-agnostic word keeps this working on any CD".
# Every word of that was wrong in the way that is hardest to see: the WORD is
# disc-agnostic, and the LINE is not. "Done - all N tracks ripped cleanly" is
# what the status reads after a CLEAN rip. On a disc holding one track whose
# re-reads disagree, `ui/rip_progress.py` deliberately overwrites that line with
# the read-stability warning -- because a 2026-07-28 audit found the unattended
# user, the notification's whole audience, being told "all tracks ripped
# cleanly" while the window said a track never read reproducibly.
#
# So the app is right and the assertion was wrong, and it cost section N -- an
# ARCHIVAL section -- on 2026-09-03, on a rip that wrote all 14 tracks with
# `Ripping errors: 0` and an intact completion footer.
#
# The replacement is NOT a looser match. `expect-rip-complete` asserts a
# different and stronger proposition against a different witness: the parsed
# rip log's own completion footer, track tally and truncation flags. Tri-state,
# so a missing footer reports NOT DETERMINED and fails. Read instability is
# counted and reported by that verb and deliberately not graded -- it is a fact
# about the disc, which `rig-check` and the EAC-compatible log both carry.
expect-rip-complete
# F switches ctdb_verify_after_rip and verify_flac_after_rip ON above and then
# asserts that those SETTINGS round-tripped, which is a setting checked against
# itself -- the vacuity K4 was demoted to UX for. On 2026-09-22 both checks were
# dropped unfinished: section G below is one 0.7s rig-check and a snapshot, then
# H starts a rip, so CTDB over 14 tracks had about one second. F's own record
# said so (gates.ctdb superseded, ctdb null, and the issue text 'an absent
# result is not a passed one') and the run still reported 247 of 247, because
# nothing read it. This step waits for the checks and grades what they left, so
# the section can fail over its own title.
expect-verification
# THE DISC'S OWN ISRC (TASKS R20, round 35). `prefer_disc_isrc` is on from the
# baseline, so a build whose contract lists `--prefer-disc-isrc` gets it on this
# rip; J2 turns it off. Whether the disc carries ISRCs is a fact about the disc:
# the report records the disc's value and MusicBrainz's either way.
expect-rip-argv with --prefer-disc-isrc
# GRADE WHAT THE RIP LEFT, not only that it finished and its checks left A
# result (2026-09-30). Until these steps no line of this file opened a report's
# verdicts, its self-audit, the cue, the EAC-style log or a FLAC: a run could go
# green over a rip whose tags had lost this album title's colon, or whose CTDB
# lookup had failed. Each verb waits for the record to settle and grades the
# artifact, delegating to the product's own predicate for the question:
#   expect-album-audit  the report's self-checks (all of them), re-run against the
#                       files on disk: cyanrip's own -Y on its log, the cue
#                       (titles, ISRCs, pre-gaps), the EAC log's checksum AND its
#                       CRCs against the ripper's, the argv, the audio files.
#   expect-accuraterip  every track has an AccurateRip ANSWER. Any disc passes:
#                       one frame, a mismatch or "not in the database" are all
#                       answers. What fails is no lookup, or the report and the
#                       log on disk disagreeing about which tracks verified.
#   expect-ctdb whole   looked up and compared; `partial` after a subset rip
#                       asserts the lookup was DECLINED, which is correct there.
#                       A match CTDB's own database outvotes FAILS (2026-11-03).
#   expect-read-offset  the offset the rip applied is the drive list's, or
#                       AccurateRip confirmed it on this disc, and the -s we sent
#                       is the one the log applied. Not determined never passes.
#   expect-tags         the FLACs say exactly what the track table says, the
#                       `:` and `<` in this album title included (that was a
#                       "WHAT TO LOOK FOR" for a person until now).
#   expect-cover-art    the cover the cover_art setting asks for, in the files.
expect-album-audit
expect-accuraterip
expect-ctdb whole
# Round 39's G3 (2026-11-11): every track's record says how it was verified,
# and none says Accurately ripped over a repair or OK over disagreeing reads.
expect-track-records
expect-read-offset
expect-tags
expect-cover-art

# --- G. POST-RIP VERIFICATION ----------------------------------------------
# `rig-check` is the seam check the cyanrip fork asked for, reachable both as a
# script verb and as `--rig-check` so both projects append to one manifest. With
# no argument it DISCOVERS the album folder, which is why it can run here without
# this file knowing a path.
#
# It composes a real rip's argv, runs it against a device that cannot open, reads
# `invocation` back out of cyanrip's own `-j` record, parses the rip's log, reads
# the handshake note, and reports the paranoia counters and any `Interrupted at:`
# line. SKIP means "did not run" and is not a pass — that distinction is the
# whole point of its status vocabulary.
#
# It also exercises a non-zero exit with a column-0 diagnostic and a complete
# `-j` record, which the fork's lap 3 §C4 pointed out is a real path this
# already covers.

log --- G. post-rip: the seam check, and the rip's own log ---
run-size standard
rig-check
snapshot afterrigcheck

