# Implementation Plan: Verification of translated output before review

## Approach

Extend `qc-structure.mjs` rather than add a parallel verifier. Four of the six requirements are
already met there: fragment links resolve (check 9) covers FR-005, and the section, table,
Markdoc, code-fence, identifier and EOF checks cover FR-006. Adding a second script would
duplicate the pair-walking and leave two places to keep in step.

What is missing is the general case of FR-003. Two narrow forms exist — check 5b flags a Markdoc
`name=` attribute identical to the English when it reads as prose, and check 10 flags a link
label that stayed English after its target became translated. Both are surface-specific and both
decide by heuristic, because there is nothing authoritative to decide against.

So the first deliverable is the missing artifact: a **keep-in-source list** of segments that are
legitimately identical in both languages. It is derived, not authored. Every aligned pair in the
approved corpus is already evidence: a segment that survived review byte-identical is evidence
that identity is correct for that segment. `polling` appears 47 times that way; `Ripple Bank Code` 14. With that list in hand, FR-003 stops being a heuristic and becomes a set difference,
and the existing narrow checks keep working unchanged.

FR-004 then falls out of FR-003: a surface is partially translated when it holds at least one
segment reported under FR-003 and at least one that differs from its source.

FR-001 and FR-002 are orchestration. The gate already exits non-zero on findings; what changes
is that generated output is checked before a human is asked to look at it, rather than after.

## Rollback

Each check is independent and additive. Reverting the commit restores the previous gate, and no
translated content changes, because the verifier only reads. The derived keep-in-source list is
a build artifact and can be regenerated from the corpus at any commit.

## Appendix

### Alternatives considered

**Language detection instead of byte-identity.** Rejected. It disagrees with reality in both
directions on this corpus: `Ripple Bank Code` is correct and would be flagged as English, while
a half-translated sentence would pass. Byte-identity plus an evidenced exemption list is
decidable and reproducible; language identification is neither.

**Authoring the keep-in-source list by hand.** Rejected. It would start stale and drift, and the
corpus already contains the evidence. Deriving it means it grows as the corpus does.

**A separate verifier script.** Rejected. The pair-walking, section alignment and manifest
reading already exist in `qc-structure.mjs`; a second script duplicates all of it.