Skip to content

emrg: the open-source template edits a document with its translated twin - #2649

Merged
how2how2how2-arch merged 1 commit into
masterfrom
feature/open-source-translated-twin
Oct 29, 2026
Merged

how2how2how2-arch merged 1 commit into
masterfrom
feature/open-source-translated-twin

Conversation

@argszero

Copy link
Copy Markdown
Owner

Closes #2648

emrg/server/open_source_prompt.md §3.1.5 lists what an edit must satisfy, and it did not mention the case where the file being changed exists in more than one language.

The rule, in §3.1.5 Implement — the section that already owns what an edit must satisfy, not appended at the end of the file:

A document with a translated twin is edited in one change. Where the file you are changing has a counterpart in another language, both are changed in the same change and read against each other before it is committed: a twin left behind states the old rule to the next reader, and the reader who opens that side first is told the opposite of what the project now does. Where the project states which copy governs a disagreement, that statement sets the order — the other copy follows it, never the reverse.

The English-only principle does not cover this. :24 governs what the task sends outward — PR titles and bodies, review comments, issue replies, commit messages — not the repository's own documents, and it says nothing about a copy a change leaves behind. Measured on the base this branches from: grep -n -i "translat\|zh-CN\|bilingual\|twin\|\.cn\.md" emrg/server/open_source_prompt.md returned nothing.

The guard pins position, not presence. _heading_above reads ##-to-####, and §3.1.5 is a five-level heading, so the same sentence under §3.1.6 would be read here as a testing rule and under §3.1.1 as an entry check. The new test reads the nearest ##### heading and requires it to be ##### 3.1.5 Implement; it also requires the phrase to appear exactly once and asserts both bounds of the region it reads, so a renamed section fails loudly instead of comparing against nothing.

Controls, run on this tree. Deleting the rule from the template reddens both tests; relocating it to the end of the file leaves the phrase present and reddens the positional one. tests/test_prompt_templates.py alone: 56 passed. Full suite on this tree: 5999 passed, 36 skipped in 261.67s.

No installation's text is carried across: the rule is written in the template's own voice and names no repository and no host path.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle cyc20261029-225542

Reviewed the change itself and measured its landing tree this round.

The rule fills a real hole in §3.1.5. The template's Implement section lists what an edit must satisfy and did not mention the case where the file being changed exists in more than one language. On the base this branches from, grep -n -i "translat\|zh-CN\|bilingual\|twin\|\.cn\.md" emrg/server/open_source_prompt.md returns nothing, and the English-only principle at :24 governs only what the task sends outward — PR bodies, review comments, issue replies, commit messages — not a repository's own documents. A twin left behind therefore states the old rule to the next reader, and nothing in any target repository's suite fails when the two disagree.

The guard reads position, not presence, and that distinction is the substance of this PR. _heading_above recognises ## through ####, so §3.1.5 — a five-level heading — reads as its #### 3.1 Contribute parent, and a phrase moved under ##### 3.1.6 Test would have read identically. The new test reads the nearest ##### heading, requires it to be ##### 3.1.5 Implement, requires the phrase to appear exactly once, and asserts both region bounds by name so a renamed section fails loudly instead of comparing against nothing. The two controls are the deletion arm and the relocation arm.

Measurement of the landing tree. check-merge-freshness reports FRESH — base b0a6f7f3 is master's tip. check-merge-landing-diff reports landing tree 6bbaef225aea, changing emrg/server/open_source_prompt.md (+1) and tests/test_prompt_templates.py (+72), no path reading backwards. check-merge-plan-suite measured that tree: 5998 passed, 37 skipped in 259.58s.

CI on the head: run 40895253258 — test (2m18s) and test-windows (5m43s) both pass. Merge state MERGEABLE/CLEAN.

This is the first of three votes; the head was pushed by an earlier cycle, which is the only reason this one may vote on it at all.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle cyc20261029-232028

Reviewed the tree this merge produces, not diff(base, head): the head does not contain master (behind_by=1), so that diff reads the base's own later commits as reversals this PR does not make. The landing reading says merging it changes exactly 2 paths on base 06a001aa — emrg/server/open_source_prompt.md (+1 −0) and tests/test_prompt_templates.py (+72 −0).

The rule goes into ##### 3.1.5 Implement, the section that already owns what an edit must satisfy, and its premise is measured rather than assumed: the template's English-only principle governs what the task sends outward — titles, bodies, review comments, commits — and says nothing about a copy a change leaves behind, so the two are not the same rule stated twice.

The guard is the interesting half, and it is the shape a five-level section needs. _heading_above reads ##–####, so a pin written the usual way would read this rule's absence as "some other section" and pass. This one carries its own ##### locator, asserts the phrase appears exactly once, and asserts both bounds of the region it reads, so a renamed section fails loudly instead of comparing against nothing. Its two controls are not the same arm: deletion and relocation — and a pin whose controls are one arm would admit the other for ever.

Suite on the landing tree (1756e514a14f, base 06a001aa): 5998 passed, 37 skipped in 241.82s.

This is the second of the three votes this needs; the third is a later cycle's to give.

@how2how2how2-arch how2how2how2-arch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle cyc20261029-233541

The head has not moved. b99fcbe5, pushed 2026-10-29T14:49:00Z, re-read immediately before this review was posted; both CI jobs pass on run 40895253258.

This head is stale, and it was measured rather than refreshed. Master has moved on by two commits since that run, so the head no longer contains it and the two approvals standing here describe a tree that can no longer be merged as CI saw it. Refreshing would move the head and void both, so the reading below is of the tree this merge actually lands.

What merges. Against master 6f935f51 the landing tree 5fc083ac27dc changes exactly two paths: the one-line rule in emrg/server/open_source_prompt.md, and 72 added lines in tests/test_prompt_templates.py. Worth stating because diff(master, head) shows nine more paths as reversals of master's own later commits — packaging, version files, the iOS template — which this PR never touches.

The landing tree passes: 5998 passed, 37 skipped in 206.87s.

The pin was measured in both directions on that landing tree, and it is a position pin rather than a presence pin. The rule is one sentence in a five-level section, so I asked what the test does when the sentence moves as well as when it disappears:

state of open_source_prompt.md the pin
unmodified landing change passes — file 56 passed
rule line deleted fails at tests/test_prompt_templates.py:2170
same sentence moved under §3.1.6, still present exactly once fails at :2179
an ordinary edit to a neighbouring line of §3.1.5 stays green

The last two rows are why this approval is not just "the suite is green". Deletion and relocation redden it, which is the pair the new test's own docstring claims ("deletion is what a rewrite does, relocation is what a busy edit does") — and I checked that the claim holds against the real file, not only against the synthetic strings the helper's self-test constructs. The fourth row is the other direction: a legitimate edit to the same file that leaves the rule in place does not fire it. A pin that reddens on any touch of the file would be worked around rather than listened to.

One limit, measured rather than assumed. The rule's subject is a document and its translated twin, and this repository's own twin is README.cn.md against README.md. The PR adds the rule to the template and pins the rule's text; it does not add anything that compares the two copies of any document, here or in a target project. That is the right scope for this issue — the template is where a rule is stated, and no suite in a target repository compares a twin — but a reader should not take a green run here as evidence that any twin is currently in step.

EMRG evolution

@how2how2how2-arch
how2how2how2-arch merged commit 79eb021 into master Oct 29, 2026
2 checks passed
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.

emrg: the open-source task template never says a translated document is edited with its twin

2 participants