The hardcoded-sentence gate failed on its own corpus read, not on a violation

`reference_strings` demanded a sentence from each of the four string sources,
because the two `Localize()` files wrap their assignments in a function and that
shape has to be proven to parse. This realm's `GlueXML\GlueLocalization.lua` has
its whole `Localize()` body commented out and tweaks frames instead, so the
assertion fired on a chain where nothing is wrong — and took the policy half of
the test, the part that actually reads every Rust source for a sentence the
reference ships, down with it.

Asserted over the pair now: a base table can never be empty, and at least one
`Localize()` file must yield, which `FrameXML\Localization.lua`'s enGB overrides
do. The policy half runs again and passes, so nothing is hardcoded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
This commit is contained in:
2026-10-29 15:35:15 -06:00
co-authored by Claude Opus 5
parent 76e022ba78
commit 40cbec55cd
+19 -3
View File
@@ -144,6 +144,13 @@ fn no_user_facing_sentence_is_written_in_rust_when_the_reference_ships_one() {
let mut shipped: HashMap<String, Vec<String>> = HashMap::new();
// The base tables and the locale patches: where `Localize()` redefines a key, its wording is
// the one the player reads.
// Whether either `Localize()` file yielded anything, which is what proves the wrapper shape
// still parses. Asserted over the pair rather than per file: this realm's
// `GlueXML\GlueLocalization.lua` has its whole `Localize()` body commented out and tweaks
// frames instead, so demanding a sentence of *that* file failed the gate on a chain where
// nothing is wrong. `FrameXML\Localization.lua` carries the enGB overrides and still proves
// the shape.
let mut wrapped_yielded = false;
for file in [
"Interface\\FrameXML\\GlobalStrings.lua",
"Interface\\FrameXML\\Localization.lua",
@@ -165,10 +172,19 @@ fn no_user_facing_sentence_is_written_in_rust_when_the_reference_ships_one() {
taken += 1;
}
}
// Every source must contribute: the `Localize()` files wrap their assignments in a
// function, a shape the base tables never have.
assert!(taken > 0, "{file} contributed no sentences");
// A base table can never be empty; a `Localize()` patch can be, and this chain's Glue one
// is.
if file.ends_with("Localization.lua") {
wrapped_yielded |= taken > 0;
} else {
assert!(taken > 0, "{file} contributed no sentences");
}
}
assert!(
wrapped_yielded,
"neither Localize() file contributed a sentence — the wrapper shape stopped parsing, and \
a locale override is the wording the player actually reads"
);
let mut sources = Vec::new();
walk(Path::new("src"), &mut sources);