Skip to content

Conformance loader expands generated_no_parse rules - #659

Open
johnml1135 wants to merge 3 commits into
s1-generate-derivedfrom
s68-generated-no-parse
Open

johnml1135 wants to merge 3 commits into
s1-generate-derivedfrom
s68-generated-no-parse

Conversation

@johnml1135

@johnml1135 johnml1135 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Start here: the suite change in sillsdev/fieldworks-parser-conformance (issue 68) lets a test case declare its no-parse words as a rule (alphabet, length range, note) instead of storing about 15,000 of them. This loader change expands the rule the same way the suite's reference script does: rules in file order, lengths ascending, alphabet order, listed words win, at most 100,000 words per rule. Without it the runner rejects the unknown key.

Stacked on #658; draft, do not merge. conformance.commit is not bumped here: the suite change must merge first, then the pin follows.

Gate (HC_CONFORMANCE_SUITE at the suite branch s68-generate-negatives): 94 passed, 0 failed, including 8 new WordsYamlGeneratedNoParseTests.

Next: lead merges the suite PR after a LAND verdict, then this PR takes the pin.

🤖 Generated with Claude Code


This change is Reviewable

… into its no-parse words

Mirrors the suite's reference expander (PROTOCOL.md section 13): rules in file order, lengths ascending, alphabet
order, listed words win, at most 100,000 words a rule.

Refs sillsdev/fieldworks-parser-conformance#68

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
doc.Words.Add(ParseWord(wordNode, path));

if (map.TryGetValue("generated_no_parse", out YamlNode generatedNode))
ExpandGeneratedNoParse(generatedNode, doc, path);

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.

Minor: F1. A test case with both generated_no_parse and variants cannot load unless every variant lists the generated words by hand. Expansion appends to doc.Words before ParseVariants (line 330) requires each variant's words to equal doc.Words in order, so listed kat + rule [a]/max 1 + a variant listing kat throws "words must contain exactly the default word list". PROTOCOL.md does not say which list a variant must match; check variants against the listed words and expand into each run, or refuse the combination by name. Traced, not run.

"variants",
};

// The keys of one generated_no_parse rule (the suite's PROTOCOL.md section 13).

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.

Minor: F2. ./local_check.sh --agent-strict fails on this comment: PROTOCOL.md section 13 matches the doc-pointer rule in scripts/CommentHygiene.psm1:63, and so does the <summary> at line 213. .claude/skills/code-comments/SKILL.md bans pointers to a Markdown file or numbered section; state the contract and drop the pointer. Matched against the regex, not run.

Assert.That(words.Words[1].Exercises, Is.EqualTo(new[] { "x" }));
}

[TestCase("generated_no_parse:\n - alphabet: [a]\n note: n\n", "max_length")]

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.

FYI: F3. Untested refusals: no case covers an empty or non-sequence generated_no_parse, a non-mapping rule, or a missing or empty alphabet, and nothing pins the variants interaction in F1. Each is one more ABadRuleIsRefused case.

@claude

This comment has been minimized.

@codecov-commenter

codecov-commenter commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.79167% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.60%. Comparing base (bb98451) to head (cc5b1f8).

Files with missing lines Patch % Lines
...rphology.HermitCrab.Conformance/WordsYamlLoader.cs 94.79% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           s1-generate-derived     #659      +/-   ##
=======================================================
+ Coverage                75.55%   75.60%   +0.04%     
=======================================================
  Files                      494      494              
  Lines                    42233    42329      +96     
  Branches                  5903     5920      +17     
=======================================================
+ Hits                     31909    32002      +93     
- Misses                    9072     9073       +1     
- Partials                  1252     1254       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…huge max_length cannot overflow it

Refs sillsdev/fieldworks-parser-conformance#68

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
johnml1135 added a commit to sillsdev/fieldworks-parser-conformance that referenced this pull request Nov 27, 2026
…se; PROTOCOL section 13 pins the alphabet encoding

No tag is pushed: ba6dfa106 has none either (ADR 0003's tag requirement is owner discipline, not met today); the commit is reachable as the head of sillsdev/machine#659.

Refs #68

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@claude

This comment has been minimized.

@claude

claude Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Verdict: approve with fixes. cc5b1f8 only rewraps the two throw lines, which answers F4. The earlier Important findings are still untouched.

Most important: F1 at src/SIL.Machine.Morphology.HermitCrab.Conformance/WordsYamlLoader.cs:193: a test case with both generated_no_parse and variants cannot load unless each variant lists every generated word.

Counts: Critical 0 open (F4 addressed), Important 2 (F1, F2), Low 1 (F3).

Ran: gh api .../compare/4a4860e...cc5b1f8 returned ahead, and git diff 4a4860ee cc5b1f87 shows only the rewrap. gh pr checks 659: both Conformance suite runs and the advisory comment hygiene jobs pass. Build on ubuntu-22.04 and windows-latest are pending.

Not verified: I could not run dotnet csharpier check locally (not approved), so F4 counts as addressed from reading the diff, not from a passing Check formatting step. F1 and F2 are still unverified, as in earlier rounds.

Public API, target framework, package, parity with sillsdev/machine.py: None verified.

Findings: F1 open (traced, not run), F2 open (unverified), F3 open, F4 addressed (pending CI).

Reviewed at cc5b1f8

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants