+
+
+===============================================================================
+Automatic Redump DAT verification and evidence report
+===============================================================================
+
+FriiDump 0.5.3.10 adds a state-aware GDR-8050L metadata-entry flow. The
+bridge reads entry capacity first. An already-unlocked game view skips the
+redundant initial handshake and tray cycle; a locked/video view receives one
+direct full handshake with READ CAPACITY verification. A tray-cycle retry is
+retained only as an explicitly logged recovery path. The later media transition
+that restores the locked/video view for VIDEO-L0/VIDEO-L1 capture remains, as
+does the final handshake for game/XDVDFS data.
+
+FriiDump 0.5.3.9 also closes the Xbox live-summary boundary: the copied GDR-8050L path now returns title, media ID, finalized output sectors, and elapsed evidence to the final validation summary, and final STOP UNIT ownership is singular.
+
+FriiDump checks each successfully completed ISO against the canonical Redump
+DAT selected for the detected or forced disc type. Verification begins only
+after CRC32, MD5, SHA-1, and SHA-256 have been finalized.
+
+Stable DAT paths:
+
+- `redump_dat/Nintendo - GameCube.dat`
+- `redump_dat/Nintendo - Wii.dat`
+- `redump_dat/Microsoft - Xbox.dat`
+
+The verifier is active for GameCube/Wii ISO dumps and for full-disc Xbox ISO
+outputs. On Windows, the copied GDR-8050L reference-dumper bridge now returns its
+actual finalized output path, byte count, CRC32, MD5, SHA-1, and SHA-256 to the
+shared verifier. FriiDump therefore reuses the reference path's existing
+full-file hash pass rather than reading the 7.29 GiB image a second time.
+
+Xbox `-X` output remains intentionally excluded: an XISO is a game-partition
+representation, not a full Redump disc image.
+
+An exact archive verification requires all four Redump identity fields to agree
+with one DAT entry:
+
+- output byte size
+- CRC32
+- MD5
+- SHA-1
+
+SHA-256 is retained as local integrity evidence in the JSON report even though
+the supplied Logiqx DAT records do not contain SHA-256.
+
+The console now presents the evidence directly:
+
+```text
+Redump verification
+------------------------------------------------------------
+DAT redump_dat/Nintendo - GameCube.dat
+Entries scanned 2019
+Matched entry Sonic Mega Collection (USA)
+ROM Sonic Mega Collection (USA).iso
+Image size PASS
+CRC32 PASS
+MD5 PASS
+SHA-1 PASS
+Overall VERIFIED AGAINST REDUMP
+Confidence Exact archive match
+```
+
+For a non-match, FriiDump shows the closest candidate only when at least one
+hash correlates. It then prints PASS/FAIL for size, CRC32, MD5, and SHA-1. When
+no hash-correlated candidate exists, it reports aggregate per-field match counts
+instead of presenting an arbitrary same-size disc as meaningful evidence.
+
+`--redump-report <file>` writes schema-2 JSON containing the observed hashes,
+SHA-256, hash source, representation note, expected DAT fields, per-field
+PASS/FAIL evidence, match counts, overall conclusion, and confidence statement. The report is written to
+`<file>.tmp`, flushed and synchronized, closed, and then atomically replaces the
+final path. A failed write never exposes a partial final JSON document and does
+not overwrite a previous complete report.
+
+The JSON writer uses unlogged file output. Report contents therefore remain in
+the JSON artifact and are no longer mirrored into the human-readable run log as
+an incomplete object with missing string values.
+
+For the GDR-8050L/cross-flashed GDR-8163B full-ISO path, the report identifies
+`GDR-8050L reference finalized full-file hashes` as the hash source. FriiDump
+also records that XGD1 acquisition success and exact Redump hash identity are
+separate claims. The current reconstruction contains unresolved zero-filled pregame and
+postgame spans, so a clean physical read can legitimately produce
+`NO EXACT MATCH`. That result must not be promoted to archive identity.
+
+Options:
+
+- `--redump-dat-dir <dir>` explicitly selects a directory containing the
+ three stable DAT filenames above. Without it, FriiDump checks `redump_dat`
+ beside the executable and then under the current working directory.
+- `--redump-report <file>` writes the atomic machine-readable evidence report.
+- `--no-redump-verify` disables DAT lookup for a run.
+- `--nohash` also prevents DAT verification because the required hashes are not
+ calculated.
+- `--xgd1-layout-probe <file>` is a separate read-only Windows diagnostic for
+ the GDR-8050L challenge-handshake profile. It cannot be combined with image
+ output, conversion, all-methods, or HLDS 0xE7 probe options.
+
+Example:
+
+```powershell
+.\friidump.exe `
+ -d E: `
+ -T 0 `
+ -8 `
+ -s `
+ -i "sonic.iso" `
+ --redump-report "docs\debug\sonic.redump.json"
+```
+
+The DAT files are data inputs, not compiled into the executable. Replace the
+three files in the executable-relative `redump_dat` directory with newer Redump
+exports while keeping the stable filenames, or point `--redump-dat-dir` at an
+alternate set. The current-working-directory lookup is retained as a fallback
+for source-tree and legacy workflows.
+
+FriiDump 0.5.3.12 adds a second read-only XGD1 evidence mode for the user's
+modified GDR-8050L firmware:
+
+ --xgd1-raw-id-probe <report.json>
+
+The probe establishes the locked/video and unlocked/game views, performs
+controlled 16-sector READ(12) cache fills, then uses the accepted HIT 0xE7
+memdump command at cache base 0x80000000 to capture the selected 2064-byte raw
+sector. The report records the raw ID field and decodes its 24-bit physical
+sector number. This is intended to test logical-to-physical geometry; it does
+not read inaccessible filler sectors, does not modify the current XGD1 image
+layout, and requires the modified 0xE7 firmware profile.
+
+The 0.5.3.11 live logical probe found 17 successful READ(10)/READ(12) pairs,
+all byte-identical. Both active capacities rejected the sampled out-of-range
+LBAs with 05/21/00. Therefore ordinary logical reads do not supply the current
+synthetic pregame/postgame filler bytes.
+
+FriiDump 0.5.3.13 corrects the raw-ID probe after the first live v68 run
+showed that arbitrary request LBAs could leave cache base 0x80000000 pointing
+at an earlier or block-start window. The corrected probe aligns every request
+to a 16-sector block, issues the proven zero-transfer READ(12) cache flush,
+and dumps only the target slot's 12-byte header and four-byte EDC. It validates
+layer bits and raw/normalized PSNs against the current full-output geometry.
+Raw-cache user-data equality is no longer treated as evidence because Method 8
+reconstructs that field from READ(12) data before unscrambling. Geometry may be
+resolved by a complete match; inaccessible filler bytes remain unresolved.
+
+FriiDump 0.5.3.14 drive-captured XGD1 game lead-in
+----------------------------------------------------
+
+The 0.5.3.13 live cache-aligned raw-ID run matched all 13 selected locked/video
+and unlocked/game samples. It proved that unlocked source LBA 0..31 occupies
+full-output LBA 198144..198175 and immediately precedes the XDVDFS header at
+unlocked source LBA 32. FriiDump therefore no longer synthesizes the 32-sector
+game lead-in for the GDR-8050L redump-style path.
+
+The reference Xbox path now reads unlocked source LBA 0..31 strictly before
+copying source LBA 32..3431263. The native libfriidump path uses the same source
+mapping and retains per-sector zero-fill only as an explicitly counted fallback
+for a genuinely unreadable lead-in sector. Pregame and postgame physical
+locations are resolved, but their inaccessible content remains zero-filled and
+must not be described as exact without independent evidence.
+
+
+FriiDump 0.5.3.15 release cleanup
+-----------------------------------
+
+The 0.5.3.15 release candidate consolidates the XGD1 investigation into a
+repository-ready tree. Local build logs, runner transcripts, package rehearsals,
+duplicate stdout/stderr captures, and full logical-sector byte dumps are not
+retained as source authority. Compact evidence is stored under
+`docs/evidence/xgd1`.
+
+Automatic DAT discovery is now executable-relative first, with the historical
+current-working-directory lookup retained as a fallback. An explicit
+`--redump-dat-dir` remains authoritative.
+
+The reference and native full-output mappings remain those validated in
+0.5.3.14. No XGD1 output bytes changed in this cleanup.