feat(ml): encode native review round 2 — glossary v0.4.0, rules 18 → 24, first deterministic ml lints - #297
Merged
Merged
Conversation
…y English Maintainer ruling of 2026-09-01 on the round-2 scope question from lecture-python-programming.ml#7 — extends D-2026-08-17 from Hint/Solution sections to exercise statements, hybrid sentences included. Encoding tracked in #296. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…24, first deterministic ml lints Encodes the second inline native-review round (118 suggestion blocks on lecture-python-programming.ml#7, functions; dispositions in QuantEcon/project-translation reports/2026-09-01-ml-functions-review-disposition.md). The round-1 rules held, so this carries the new classes the round surfaced: - rules: terminal punctuation; sentence-initial capitalisation of retained English; the hortative teacher's voice (നമുക്ക് … -ആം, never നമ്മൾ … -ും); consistent accusative -നെ and no additive -ഉം on list items; fixed renderings (a given → തന്നിരിക്കുന്ന, consider → നോക്കാം, കുറച്ചുകൂടി); the sandwich-sentence rule; three more English-retained connectives; pointer-sentence examples for the three rule-6 misses; and the exercise-statement scope extension ruled 2026-09-01 (D-2026-09-01-ml-exercise-statements-stay-english). - glossary v0.4.0 (+16): useful, provide, exist, automatically, create, improve, full, stage, answer, successive, line, lines (kept English); straightforward, contrived, limited, facilitate (everyday Malayalam). - ml_metrics.py: round-2 lints as a LINT bucket (never FAIL) — terminal punctuation, lowercase-Latin-initial sentences, banned renderings, a future-hortative watch. Calibrated on the editor's reviewed text: seed 23/17/15/6 → reviewed 1/0/2/1, the residuals being his own kept forms. Held for the editor's answers on lecture-python-programming.ml#12: "For example" as a discourse rule; glossary pins for already, name, example(s), work. Tracked in #296. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…x5 negative example added to the scope rule Archives the regeneration check for #296 (functions from lecture-python-programming@81d9734, claude-sonnet-5, --localize none) with the seed / reviewed / arm signature table and the misses: terminal punctuation and bullet capitalisation under-deliver from prompt alone (the case for a deterministic post-processing step), one scope over-application (ex5 statement kept English), and one-instance regressions on `set` (transliterated — pinned-term FAIL) and `refer`. The ex5 case is fixed in the rule text: a pure-programming exercise statement is named as the negative example and must translate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Encodes the second Malayalam native-review round into the engine’s ml rules/glossary, and adds deterministic (non-blocking) lint signals to the Malayalam benchmark tooling so future sync PRs can surface these classes consistently.
Changes:
- Extend
ml.additionalRules(18 → 24) to cover the new review-round classes (punctuation, casing, hortative voice, fixed renderings, sandwich-sentence, exercise-scope extension). - Bump Malayalam glossary to v0.4.0 (61 → 77 terms), including new keep-English pins and a few additional everyday-word translations.
- Add “round-2” lint reporting (LINT-only) to
ml_metrics.py, plus tests/docs/changelog updates and a new decision record.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/language-config.ts | Adds round-2 Malayalam rule text to ml.additionalRules. |
| src/tests/language-config.test.ts | Extends tests to assert v0.4.0 glossary additions and presence/absence of key round-2 rule snippets. |
| glossary/ml.json | Bumps Malayalam glossary to v0.4.0 with new keep-English pins and added everyday translations. |
| experiments/ml-benchmark/scripts/ml_metrics.py | Introduces “round-2 lints” (terminal punctuation, lowercase-initial, banned renderings, hortative watch) as LINT output. |
| experiments/ml-benchmark/arms/2026-09-01-round2-rules-sonnet5/README.md | Archives the round-2 regeneration arm summary and signature table. |
| experiments/ml-benchmark/arms/2026-09-01-round2-rules-sonnet5/functions.md | Stores the regenerated Malayalam functions output used for the arm’s scoring/comparison. |
| docs/user/language-config.md | Updates Malayalam documentation to describe the second inline review round and the new rule classes. |
| docs/user/glossary.md | Updates built-in glossary table to reflect Malayalam v0.4.0 and new term count. |
| dist-action/index.js | Rebuilds the committed Action bundle to match updated source rules. |
| CHANGELOG.md | Adds an Unreleased entry describing the Malayalam round-2 encoding and lints. |
| .dev/decisions/D-2026-09-01-ml-exercise-statements-stay-english.md | Records the maintainer ruling extending the English-retention scope to math/probability exercise statements. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… text; docs counts
- ml_metrics.py: DIRECTIVE_LINE_RE no longer skips a prose line that opens
with a MyST role ({ref}`…`, {doc}`…`) — directive bodies are inside fences
already — and the lowercase-initial lint strips the role prefix and tests
the link text, which is what the capitalisation rule names. Recalibrated:
seed 24/19/16/6, reviewed 1/1/2/1 (the new hit is the editor's own
{doc}`previous lecture` at 290 against {ref}`Previous lecture` at 229),
arm 18/5/1/3. Arm README and CHANGELOG carry the corrected counts.
- docs/user/language-config.md: "(61 terms)" → "(77 terms)"; the rule set
has been extended three times, not twice.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Encodes the second inline native-review round — 118 suggestion blocks on QuantEcon/lecture-python-programming.ml#7 (
functions), all applied and merged there asc1200fa, every one dispositioned in QuantEcon/project-translationreports/2026-09-01-ml-functions-review-disposition.md. Tracker: #296. The round-1 rules held (no recurrence of below-deixis, ordinal, light-verb,-യുടെor suffixed-English flags), so this PR carries the new classes the round surfaced.Rules (
src/language-config.ts, ml 18 → 24): terminal punctuation on every Malayalam paragraph (a colon before the cell, list or equation it introduces); sentence-initial capitalisation of a retained-English word (Functions-നെ,Built-in,Return statement); the hortative teacher's voice (നമുക്ക് … -ആം, never the plain futureനമ്മൾ … -ും); consistent accusative-നെon light-verb objects, no additive-ഉംon list items,`a`, `b` എന്നിവ; the fixed renderings he corrected on every occurrence ("a given" →തന്നിരിക്കുന്ന, "consider" →നോക്കാം, spellingകുറച്ചുകൂടി, "useful" stays English); the sandwich-sentence rule (a claim interrupted by code cells is stated once, before the first cell); three more English-retained connectives ("In particular", "Obviously", "Basically"); worked examples for the pointer sentences the model missed three times; and the maintainer's 2026-09-01 ruling that exercise statements with probabilistic or mathematical content stay English, hybrid sentences included — decision record.dev/decisions/D-2026-09-01-ml-exercise-statements-stay-english.md, with the pure-programming negative example named so the rule does not over-apply.Glossary (
glossary/ml.jsonv0.4.0, 61 → 77): the ordinary words the editor kept moving back to English (useful×4 — never ഉപയോഗപ്രദമായ —provide,exist,automatically,create,improve,full,stage,answer,successive), theline/linespin the #273 regeneration flagged (14× variance regression), and four everyday words he moved the other way (straightforward→ എളുപ്പം,contrived→ കൃത്രിമം,limited→ പരിമിതി,facilitate→ സഹായിക്കുക).Lints (
experiments/ml-benchmark/scripts/ml_metrics.py): the round's four deterministic classes as a LINT bucket (never FAIL until #189 Phase 3 decides what graduates) — terminal punctuation, lowercase-Latin-initial sentences, a banned-renderings list drawn from the rules, a future-hortative watch. String checks, so unaffected by #240 and #229. Calibrated on real text: the pre-review seed scores 23/17/15/6, the editor's reviewed text 1/0/2/1, and every residual is a form he himself kept.Regeneration check (same recipe as #273; archived under
experiments/ml-benchmark/arms/2026-09-01-round2-rules-sonnet5/): a freshclaude-sonnet-5pass offunctionsfrom source81d9734lands 17 of 26 signatures at or past the reviewed form — every fixed pair, the list-item and sandwich forms, the connectives, all four exercise-scope retentions and both pointer sentences. The two purely mechanical classes under-deliver from prompt alone (bare endings 23 → 16, bullet capitalisation 17 → 5): the strongest case yet for a deterministic post-processing step (bare Malayalam ending before a{code-cell}→:; lowercase Latin word at the head of a prose line or list item → capitalised), W2-shaped (#260) and left out of this PR deliberately; the lints detect both on every PR meanwhile. Logged one instance each:settransliterated (a real pinned-term FAIL the gate caught),refercalqued.Held for the editor's answers on QuantEcon/lecture-python-programming.ml#12 (deliberately not encoded): "For example," as a discourse rule; glossary pins for
already,name,example(s),work.ml-scoped only — no other language's rules move; the Stage 4 shadow-window freeze (cross-language rubric, floors) is untouched. Full suite 1538 green; lint and format clean;
dist-actionrebuilt. Docs (docs/user/glossary.md,docs/user/language-config.md) and CHANGELOG updated. Release after merge so the rules reach production before round 3 (matplotlib) is generated.🤖 Generated with Claude Code