Repository navigation
Conversation
The merge rules and the XML schema came from a schema the files declare, or none: a directory holding only a newer release than any file names gave `no schema compiled`, though that release would do. Where no declared schema of a namespace is in the directory, the newest schema of a declared family and of that namespace is added, and governs by the usual ranking. It is said that no file declares it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08ef1a52b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continue | ||
| } | ||
| text := os.read_file(f) or { continue } | ||
| if text.contains('targetNamespace="${ns}"') { |
There was a problem hiding this comment.
Read the candidate namespace as an XML attribute
When an otherwise suitable schema writes its namespace as targetNamespace='urn:x' or includes whitespace around =, this literal substring check rejects it even though the existing XSD reader accepts it through d.attr(root, 'targetNamespace') in flatxml/xsd/read.v. With no declared schema available, the model consequently remains ungoverned despite a usable schema in the directory. Read the root attribute through the XML parser instead of matching its serialization; this also avoids accepting namespace text that appears only in a comment.
Useful? React with 👍 / 👎.
| mut best_release := Release{} | ||
| for f in all { | ||
| r := release_of(f) or { continue } | ||
| if r.prefix !in families || (best != '' && r.compare(best_release) <= 0) { |
There was a problem hiding this comment.
Select fallback candidates within the governing family
When documents in one namespace declare multiple families and none of their declared schemas is available, this comparison chooses a single candidate across all families. For example, if most documents declare missing A_1.xsd, a minority declare missing B_1.xsd, and the directory contains A_2.xsd and B_9.xsd, only B_9.xsd is added. However, choose_governing() still selects family A by document count and places B in g.others, leaving g.use == -1 despite the usable A fallback. Determine the governing family before selecting its fallback, or retain a candidate per family so the existing governing selection can use the appropriate one.
Useful? React with 👍 / 👎.
| if best != '' { | ||
| sc.uses << &SchemaUse{ | ||
| name: os.file_name(best) | ||
| ns: ns | ||
| path: best |
There was a problem hiding this comment.
Try older fallback schemas when the newest cannot compile
When no declared schema is available and the newest matching schema fails compilation, only that candidate has been added to sc.uses, so choose_governing() cannot fall back to an older matching schema that would compile. For example, with missing declared LIB_1.xsd, usable LIB_2.xsd, and LIB_3.xsd referencing a missing include, the added LIB_3.xsd fails in compile_use() and the model remains ungoverned; merely adding that unusable newer release to a previously working schema directory therefore breaks loading. Retain older matching candidates or retry them after compilation failure so the newest successfully compiled fallback can govern.
Useful? React with 👍 / 👎.
The fallback picked one file across families before anything compiled, by matching text, so a schema written with other quoting was missed, a namespace with several families could add the wrong one, and a newest release that does not compile left the model ungoverned though an older one would do. Each family declared now tries its schemas newest first, reading targetNamespace from the parsed root, until one compiles; those that did not stay, so the governing note can say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Closed in favour of an explicit |
Files declaring only releases that are not in the schema directory stop with
no schema compiled, even when the directory holds a newer release of the same family. The fallback to "the newest at hand" only ran among declared schemas. So the workaround was to copy the schema under a declared name.compile_schemasnow adds, for a namespace with no declared schema at hand and per declared family, the newest schema in the directory of that family and namespace that compiles; newer ones that did not compile stay listed, so the note can say so.choose_governingranks it as usual, so the existing note still names the newest declared release, and the schema carries a note that no file declares it. A schema of another family or namespace is not taken, soungovernedremains for a directory with nothing suitable.Newer schemas are not strictly additive, so a file may use something the governing schema dropped. Such a file gets an XML schema finding, and
rulesalready reports the roles involved for older schemas it has at hand.Tests:
test_with_no_declared_schema_at_hand_the_newest_of_the_family_governs, on the existing synthetic schemas, covers both the fallback and a directory without the family.🤖 Generated with Claude Code