Skip to content

Copy a code entry before asking whether a person signed it - #56

Merged
tamnd merged 1 commit into
mainfrom
copy-code-before-the-guard
Aug 18, 2026
Merged

Copy a code entry before asking whether a person signed it#56
tamnd merged 1 commit into
mainfrom
copy-code-before-the-guard

Conversation

@tamnd

@tamnd tamnd commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Follow-on from #55, which is what surfaced this.

apply_entry asked the human guard first and the code copy second. #55 taught the block rule to read three more shapes of code, 4 segments left the memory as a result, and the 5 entries in the corpus holding them stayed exactly where they were: translated, not fuzzy, and accounted for by nothing.

S04 reported all five, and S04 was right. An unmarked non-fuzzy string reads to a reviewer and to Sphinx as somebody's considered work. There was nothing behind these, and no way to clear the finding short of a corpus-wide --refuzzy that would have to be run again after the next classifier change.

Why the guard was not the right thing to ask first

The guard exists to stop a machine translation landing on a person's work. Copying the msgid is not a machine translation, it is the source text, and P07 requires the entry to hold it byte for byte. The guard is not engaged for a code entry, and putting it first only meant that a writer could leave its own checker with findings it had no way to clear.

The precedence was the other way round in #53, on the reasoning that a reviewer's mark outranks everything. That was the conservative first cut and one classifier change was enough to show the cost. The test that asserted it is now asserting the opposite, with the reason written next to it.

Measured before the swap

corpus entries that are human-marked and classified as code 5
of those, msgstr already byte-identical to msgid 5
of those, msgstr differing from msgid 0

So the reordering changes no translated text at all. It adds five provenance comments saying where the text came from. The guard is untouched for everything that is not code, which is 81,964 of the 87,008 entries, and there is a test holding it there.

Checks

make check green, 1,399 tests, 97.47 per cent coverage. H03 clean.

apply asked the human guard first and the code copy second. The block rule
learning to read `def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):` was
enough to show what that costs. Four segments left the memory, because a
person's copy of a line of code is not a translation of it. The five entries
in the corpus stayed exactly as they were, translated and not fuzzy and now
accounted for by nothing, and S04 reported all five.

S04 was right. An unmarked non-fuzzy string reads to a reviewer and to Sphinx
as somebody's considered work, and there was nothing behind these. The guard
was holding in place a mark that had lost its meaning, and there was no way
to clear the finding short of a corpus-wide --refuzzy, which would have to be
run again after the next classifier change.

The guard exists to stop a machine translation landing on a person's work.
Copying the msgid is not a machine translation, it is the source text, and
P07 requires the entry to hold it byte for byte. The guard is not engaged
here, and putting it first only meant a writer could leave its own checker
with findings it had no way to clear.

Measured before the swap: 5 entries in the corpus are human-marked and
classified as code, and all 5 already hold the msgid byte for byte. The
reordering changes no translated text and adds five provenance comments
saying where the text came from. The guard is where it always was for
everything that is not code, which is 81 964 of the 87 008 entries.
@tamnd
tamnd merged commit 17e1689 into main Aug 18, 2026
@tamnd
tamnd deleted the copy-code-before-the-guard branch August 18, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant