Skip to content

feat(ml): encode native review round 2 — glossary v0.4.0, rules 18 → 24, first deterministic ml lints - #297

Merged
mmcky merged 5 commits into
mainfrom
ml-round2-v04
Sep 1, 2026
Merged

mmcky merged 5 commits into
mainfrom
ml-round2-v04

Conversation

@mmcky

@mmcky mmcky commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Encodes the second inline native-review round — 118 suggestion blocks on QuantEcon/lecture-python-programming.ml#7 (functions), all applied and merged there as c1200fa, every one dispositioned in QuantEcon/project-translation reports/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.json v0.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), the line/lines pin 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 fresh claude-sonnet-5 pass of functions from source 81d9734 lands 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: set transliterated (a real pinned-term FAIL the gate caught), refer calqued.

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-action rebuilt. 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

mmcky and others added 3 commits September 1, 2026 15:23
…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>
Copilot AI lite review requested due to automatic review settings September 1, 2026 05:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread experiments/ml-benchmark/scripts/ml_metrics.py Outdated
Comment thread experiments/ml-benchmark/scripts/ml_metrics.py
Comment thread docs/user/language-config.md Outdated
… 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>
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.

2 participants