Conversation
The copy in schemas/ dated from Bridgeconn#207 (July 2023) and predates USX 3.1.2, so it rejected constructs the current spec allows. Most visibly it has no efe in Footnote.style.enum, which blocks Bridgeconn#423. Taken from the tcdocs 3.1.2 branch at b76e9f0, and adds schemas/readme.md recording the source, branch, commit and date so the copy stays traceable and diffable against upstream. Against the schema-validation tests: 20 more pass, 4 fewer. The 4 are paratextTests/NoErrorsShort and special-cases/empty-book, both marked validated=fail and both consisting of only an \id and \usfm line, which the newer schema correctly rejects. Refs Bridgeconn#420
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR updates the USX 3.1.2 Relax NG schema with expanded lexical rules, root models, peripheral-book support, richer content models, validation patterns, and style definitions. It also documents schema provenance, verification, and the ChangesUSX schema validation
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: ⚪ Minimal · up to The schema refresh broadens USX 3.1.2 validation and adds provenance documentation, with no actionable merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| <value usfm:propattribs="src size ref alt? loc? copy?">fig</value> | ||
| </attribute> | ||
| <optional> | ||
| <ref name="char.closed"/> | ||
| </optional> | ||
| <optional> | ||
| <group> | ||
| <usfm:match match="PIPE" matchout="'|'" dump="true"/> | ||
| <oneOrMore> | ||
| <attribute usfm:fallback-from="style"> | ||
| <usfm:matchpair first="/[^\\\n="]+/" between="'="'" second="/[^\\\n"]*/" after="/"${WSS}/" fallback="/[^\\\n=]+(?=\\)/"/> | ||
| <anyName> | ||
| <except> | ||
| <choice> | ||
| <name ns="">style</name> | ||
| <name ns="">closed</name> | ||
| </choice> | ||
| </except> | ||
| </anyName> | ||
| <data type="string"/> | ||
| </attribute> | ||
| </oneOrMore> | ||
| </group> | ||
| <ref name="char.closed" usfm:ignore="true"/> | ||
| </optional> | ||
| <group usfm:order="-1"> | ||
| <optional> | ||
| <text> | ||
| <usfm:match match="TEXTATTRIB"/> | ||
| <usfm:match match="TEXTNOTATTRIB"/> | ||
| </text> | ||
| </optional> | ||
| </group> | ||
| <optional> | ||
| <ref name="Attributes"/> | ||
| </optional> |
There was a problem hiding this comment.
Suggestion: The active FigureThree rule makes all figure attributes optional, so <figure style="fig"/> validates despite missing required image source, size, and reference data. [incomplete implementation]
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** schemas/usx.rng
**Line:** 1526:1540
**Comment:**
*Incomplete Implementation: The active `FigureThree` rule makes all figure attributes optional, so `<figure style="fig"/>` validates despite missing required image source, size, and reference data.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
CodeAnt Nitpicks1 code suggestion1.
|
User description
Refs #420
Picking up your note on that issue: "Update our current usx.rnc with latest one from tcdocs, test and conform."
The existing copy in
schemas/is from #207 (July 2023) and predates USX 3.1.2, so it rejects things the current spec allows (likeefeinFootnote.style.enum, which is what blocks #423).This takes
grammar/usx.rngfrom the tcdocs 3.1.2 branch (as opposed tomain), at commitb76e9f0.mainhas merged 3.2 and dropped the initial chapter requirement, so it acceptstests/introductions/bad/test1("a body paragraph is not allowed before the first chapter element",validated=fail), which the 3.1.2 schema correctly rejects. (Obviously we could just jump to 3.2, but that'd need to be handled.)Test and conform. Against the two schema-validation tests that CI currently excludes (
generated_usx_with_rnc_grammar,testsuite_usx_with_rnc_grammar), 59 failures become 43.20 newly pass:
bugfixes/tcc,bugfixes/new-marker-ipc,bugfixes/new-marker-ta,bugfixes/new-marker-wladvanced/figureInNote,biblica/CategoriesOnNotes,biblica/CrossRefWithPipespecExamples/footnote,usfmjsTests/ts,usfmjsTests/ts_2,usfmjsTests/chunk_footnote4 newly fail, and they're two fixtures counted twice:
paratextTests/NoErrorsShortandspecial-cases/empty-book. Both arevalidated=failin their metadata but overridden to"pass"intests/__init__.py, one of them under your "Need to be fixed" heading. Each is only an\idand a\usfmline, so the newer schema is siding with the metadata against the override. I've left both alone rather than guess.Everything else is green:
tree-sitter test76/76, and the CI python selection 3777 passed.I also added
schemas/readme.mdrecording the source URL, branch, commit and date, in the same spirit astests/readme.md, with a one-linecurl | diffso anyone can verify the copy against upstream. Happy to drop that file if you'd rather not carry it.Scoped to the schema and that readme only. No fixture edits, no changes to the exclusion lists in
tests/__init__.py, and no attempt to re-enable the excluded tests. Those felt like your calls once you can see the numbers.CodeAnt-AI Description
Update USX validation to match the USX 3.1.2 specification
What Changed
efeImpact
✅ Fewer valid USX files rejected✅ Support for USX 3.1.2 footnotes and markup✅ More consistent USX validation💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
New Features
Documentation