refactor: comments state current behavior, not project history

Comments across the tree justified the code by pointing at a Rust
implementation that is no longer in the repository, citing files and line
numbers (config.rs:132, schema.rs:26-54, reader.rs:42) that cannot be
opened, plus crates and datasets that are equally gone. A reader could not
check any of it.

Every invariant those comments carried is kept and restated so it stands on
its own: the bytewise sort that decides which row survives a duplicate exam
number, the literal U+0300..U+036F range that must match the site's toAscii,
the trailing space in "SINH ", the BIFF and shared-string corrections, the
VACUUM-after-COMMIT rule, the deploy-from-main guard.

The reader's contract is now anchored to the frozen oracle in
parser/testdata, which still exists and is still checked, rather than to the
tool that originally produced it.

TestDDLMatchesRust becomes TestDDLIsFrozen: it compares against a copy of
the DDL inside the test and never read schema.rs, so both the name and the
failure message were misleading.

ToAscii no longer claims the d-replacement must precede lowercasing. Both
cases map to 'd' and ToLower runs last, so the order has no effect.
This commit is contained in:
tiennm99 committed 2026-08-14 09:40:41 +07:00
1 parent c988bfafcf
commit 933adf70c9
43 files changed
+392 -515

No files matched your search

+9 -10
View File
@@ -1,13 +1,12 @@
# Canonical cell-dump SHA-256 per input file, produced by the Rust/calamine
# ground truth (parser/examples/dump_cells.rs). The Go reader must reproduce
# each hash exactly. Hashes only - the dumps themselves are real student PII
# and are never committed, per parser/tests/fixtures/README.md.
# FROZEN. These hashes were produced by the Rust/calamine parser, which has
# since been removed, so they cannot be regenerated. They remain a real
# regression guard: any change to the Go reader that alters a single cell of any
# input file listed below fails the suite. If the inputs themselves ever change,
# the affected rows must be re-derived deliberately and reviewed, not refreshed
# in bulk.
# Canonical cell-dump SHA-256 per input file. The reader must reproduce each
# hash exactly. Hashes only - the dumps themselves are real student PII and are
# never committed. parser/cmd/dumpcells prints the stream a hash is taken over,
# which is how a failure is narrowed from a file to a cell.
# FROZEN. These cannot be regenerated, so a mismatch is a reader bug until
# proven otherwise, never a cue to refresh this file. Any change to the reader
# that alters a single cell of any input listed below fails the suite. If the
# inputs themselves ever change, re-derive only the affected rows, deliberately
# and reviewed, not in bulk.
data/2016/023718c7d3cf7ace3a7116fabb12bd9cdhyduoccantho-1468920829104.xlsx fc3afd8da9ed28b0fc177192fab7b19a06535cb45d86841835d8e8828fc61c1c
data/2016/08cdeb3636dcb2adaef829d62968274atravinh-1468902443859.xlsx 71f0e61918c63b95f08a16d502f5e9f2054e3c830bd83c725f1285bb1aabead1
data/2016/0b583c9875443e65ffa449d5ca76fae8ninhbinh-1468899778557.xlsx b0c2cfb9ab419442f151be5a014439f7f477fa7b31a9ae3f37b83073276bdb59
1 # Canonical cell-dump SHA-256 per input file, produced by the Rust/calamine # Canonical cell-dump SHA-256 per input file. The reader must reproduce each
2 # ground truth (parser/examples/dump_cells.rs). The Go reader must reproduce # hash exactly. Hashes only - the dumps themselves are real student PII and are
3 # each hash exactly. Hashes only - the dumps themselves are real student PII # never committed. parser/cmd/dumpcells prints the stream a hash is taken over,
4 # and are never committed, per parser/tests/fixtures/README.md. # which is how a failure is narrowed from a file to a cell.
5 # FROZEN. These hashes were produced by the Rust/calamine parser, which has # FROZEN. These cannot be regenerated, so a mismatch is a reader bug until
6 # since been removed, so they cannot be regenerated. They remain a real # proven otherwise, never a cue to refresh this file. Any change to the reader
7 # regression guard: any change to the Go reader that alters a single cell of any # that alters a single cell of any input listed below fails the suite. If the
8 # input file listed below fails the suite. If the inputs themselves ever change, # inputs themselves ever change, re-derive only the affected rows, deliberately
9 # the affected rows must be re-derived deliberately and reviewed, not refreshed # and reviewed, not in bulk.
# in bulk.
10 data/2016/023718c7d3cf7ace3a7116fabb12bd9cdhyduoccantho-1468920829104.xlsx data/2016/023718c7d3cf7ace3a7116fabb12bd9cdhyduoccantho-1468920829104.xlsx
11 data/2016/08cdeb3636dcb2adaef829d62968274atravinh-1468902443859.xlsx data/2016/08cdeb3636dcb2adaef829d62968274atravinh-1468902443859.xlsx
12 data/2016/0b583c9875443e65ffa449d5ca76fae8ninhbinh-1468899778557.xlsx data/2016/0b583c9875443e65ffa449d5ca76fae8ninhbinh-1468899778557.xlsx