Repository navigation
Ariadne loader: keep the rules the spec's §9 listed as defects - #1609
Merged
Merged
Conversation
The .ari schema is the structural half; docs/ARIADNE_SPEC.md is the other half, what each part means and when it acts. It covers: - conformance; - the document text; - the min_libcvc gate; - the order of loading, the schema check, what refuses a load, composition and the nesting limit; - the order of starting, reload and Restart; - the frame's deferred-intent rule; - the bind rule, scopes, confinement, holes and the two lanes; - one entry for each of the schema's 39 top-level keys; - the seven places libcvc 4.0.10 does not yet keep the spec; - what is not yet specified (scene nodes, widget types, the DSL's built-ins). ARIADNE.md now points at the spec. Its §5.2, §6.7 and §14.2 are corrected, and §7.4 notes that a missing link: mode is still writable. ariadne_schema_test's AriSpec.EveryTopLevelBlockHasItsEntry checks that the spec's §8 has one entry for each top-level key in the schema, and none for any other.
- A static load: fragment is gated by its own meta.min_libcvc, as a mounts: entry is: read_fragment checks it first for every fragment, and one too new for this build warns and is an empty group. - A repeated key warns at its place and is removed from the parsed node, so lookups, iteration (units:, state:, ...) and the schema check all read the first; before, iteration and yaml_to_json read the last. yaml_to_json keeps the first as well (ari validate). An alias shares its anchor's map, so it is walked and warned once. - A second YAML document in a file warns (the document, a library, a fragment), even when it does not parse; the first is read as before. - An import's optional: and a unit's fallback: are flags, in every spelling flag() takes; only the text "true" counted. - A document with both root: and children: warns, and reads root:. background: needed nothing: parse_background already ignores it off windows, overlays and groups, with a warning; a test pins that. nav_lab_scrub.ari gave the Camera combo the same values: twice; one is removed. AriadneSpec.* in ariadne_loader_test checks each rule; five of the six fail on the old loader.
The loader now keeps the rules spec 9 listed, so its rows go, with "None known" in their place. 2.1 says a reader reads the first of a repeated key wherever it reads the map; 3 says what a fragment too new for the reader does; 8's children: entry says a reader warns. fallback: is a document's own unit's flag, not an import's: 4.4, 8 import: and 8 units: now say so, and import:'s optional: is described as the loader reads it (a missing library is silent, one that does not parse still warns). The background: row was wrong: the loader already kept that rule. The guide's 5.2 says a load: fragment is gated, as a mounts: entry is. The status line names #1609.
#1595 landed as fd4576c. Its squash re-adds docs/ARIADNE_SPEC.md and edits docs/ARIADNE.md as a new commit, so both conflicted with this branch, which carried #1595's own commits. Resolved by taking master's versions of the two files and reapplying this branch's docs commit 8619f4e: the spec is unchanged from 8619f4e, and the guide is master's plus the 5.2 sentence. The PR's diff against master is now its own five files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The loader now keeps the rules that
docs/ARIADNE_SPEC.md§9 listed as libcvc defects. The spec's §9 has no rows left.Stacked on #1595, which adds the spec. Until #1595 merges, its commits show here too. This PR's own changes are the loader, its tests, one shipped component, and the spec and guide edits listed below.
The fixes
Each fix has a test in
ariadne_loader_test(AriadneSpec.*).load:fragment is gated by its ownmeta.min_libcvc(spec §3). Until now only amounts:entry was.read_fragmentnow checks the version first, for every fragment, before reading anything else in it. A fragment too new for this build warns and is an empty group. Amounts:entry is refused, as before.line 4:3: key 'card' repeats the one at line 3. The repeat is also removed from the parsed node, so every reader sees the first value.units:,state:and others) ended up with the last. The schema check (yaml_to_json) also read the last.yaml_to_jsonnow keeps the first as well, which also coversari validate.load:fragments, throughfirst_document, which usesYAML::LoadAll.optional:and a unit'sfallback:are flags (spec §2.2). They takeyes,on,1,Trueand the other flag spellings. Before, only the exact texttruecounted.root:andchildren:warns (spec §8,children:). It still readsroot:.background:needed no fix. The §9 row was wrong:parse_backgroundalready ignoresbackground:on anything but a window, overlay or group (which includes panels and mount sites), and warns when it does. A new test pins that down.Shipped documents
I scanned all 204 shipped
.arifiles with PyYAML for each case. None has a second document, bothroot:andchildren:, or amin_libcvcnewer than 4.0.10. One had a repeated key:src/cvc/ariadne/components/nav_lab_scrub.arigave the Camera combo the samevalues: [follow, orbit]twice. The duplicate line is removed.Spec and guide
ARIADNE_SPEC.md:children:entry says a reader warns.fallback:belongs to a document's own unit, not to an import. §4.4, §8import:and §8units:now say so, andimport:'soptional:is described as the code does it: a missing library is silent, but a library that doesn't parse still warns.ARIADNE.md§5.2: aload:fragment is gated, as is amounts:entry.Verified locally
Windows, MSVC Release, with the JSON-schema validator and FTXUI (no cvcGL, no pycvc):
ariadne_loader_test: 288 pass, including the six new tests.ariadne_host_test: 69 pass.ariadne_schema_test: 14 pass, plus 1 skip by design.EveryShippedDocumentIsValidis among them.ctest -R [Aa]ri): 1,351 pass, 0 fail; the skips are the usual environment ones (no CUDA, no browser, no E2EE store).background:one, passes, which is the point: the loader already kept that rule.git clang-formatleaves the change as it is.Not verified: Linux and macOS, cvcGL and pycvc (CI covers them).