Skip to content

ml round-2 residuals: lint regex misses hyphen-suffixed sentence starts; rule 11 ends with a dangling colon #301

Description

@mmcky

Two residuals from the #297 review that shipped in v0.27.0 unfixed — both small, both in ml-only surfaces, filed so they are not lost.

1. The lowercase-Latin-initial lint misses the rule's headline case

experiments/ml-benchmark/scripts/ml_metrics.py (line 227 at 58b9c69): re.match(r"[a-z][a-z-]*(\s|$)", head) requires whitespace or end-of-string after the Latin run, so a hyphen-suffixed retained-English word at sentence start is never flagged. Verified: functions-നെ systematic ആയി … → no flag, while rule 13's first example is exactly Functions-നെ. Suffixed English is the dominant ml pattern, so this is a systematic false negative and the PR's claim that "the lints detect both mechanical classes on every PR" does not hold for the common case. Fix is a lookahead that accepts a hyphen as a terminator: [a-z][a-z-]*(?=[\s-]|$), or test [a-z]+(?![A-Za-z0-9_.(]). Add functions-നെ … as a fixture line; the reviewed-text calibration (1/1/2/1) should be re-run since the seed count for this class will rise.

Related nits from the same review, take or leave in the same PR: the terminal-punctuation lint flags every table row (| … |) and hard-wrapped continuation line — skip lines starting with | before matplotlib (round 3) arrives with tables; DIRECTIVE_LINE_RE skips any line starting with (, so parenthetical prose is never linted — anchor the label skip to ^\s*\([^)]*\)=\s*$.

2. Rule 11 (hortative) ends with a dangling colon

src/language-config.ts, ml additionalRules[11]: the string ends … "Recall that …" fronts ഓർക്കുക:. In the numbered system prompt that colon runs into the next rule's number, and it disagrees with rule 12, which specifies a comma after a fronted ശ്രദ്ധിക്കുക. Either the colon is the intended rendering for ഓർക്കുക (then say so in words and reconcile with rule 12) or it is a typo — two characters either way, but it is in the cached stable prefix of every ml prompt, so it goes out on every call until fixed. Needs the editor's confirmation of which punctuation he uses; the round-2 disposition report may already answer it.

Both are ml-scoped; no other language's rules or the shadow-window freeze are touched. Parent: #296 / #189 Phase 2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions