Skip to content

Ariadne loader: keep the rules the spec's §9 listed as defects - #1609

Merged
transfix merged 6 commits into
masterfrom
ariadne/spec-defects
Nov 28, 2026
Merged

transfix merged 6 commits into
masterfrom
ariadne/spec-defects

Conversation

@transfix

Copy link
Copy Markdown
Owner

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.*).

  • A static load: fragment is gated by its own meta.min_libcvc (spec §3). Until now only a mounts: entry was. read_fragment now 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. A mounts: entry is refused, as before.
  • A repeated key warns, at its place (spec §2.1): 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.
    • Before, lookups read the first, but code that walked a map's keys (units:, state: and others) ended up with the last. The schema check (yaml_to_json) also read the last.
    • yaml_to_json now keeps the first as well, which also covers ari validate.
    • An alias shares its anchor's map, so it is walked once and warned about once.
  • A second YAML document in a file warns (spec §2.1). The loader reads the first document, as before. If a later one doesn't parse, it still warns, and the load goes on. This applies to the document itself, to imported libraries and to load: fragments, through first_document, which uses YAML::LoadAll.
  • An import's optional: and a unit's fallback: are flags (spec §2.2). They take yes, on, 1, True and the other flag spellings. Before, only the exact text true counted.
  • A document with both root: and children: warns (spec §8, children:). It still reads root:.
  • background: needed no fix. The §9 row was wrong: parse_background already ignores background: 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 .ari files with PyYAML for each case. None has a second document, both root: and children:, or a min_libcvc newer than 4.0.10. One had a repeated key: src/cvc/ariadne/components/nav_lab_scrub.ari gave the Camera combo the same values: [follow, orbit] twice. The duplicate line is removed.

Spec and guide

  • ARIADNE_SPEC.md:
    • §9's rows are gone, 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 too-new fragment does.
    • §8's children: entry says a reader warns.
    • Corrected a mistake from Ariadne: a normative spec for .ari documents (ARIADNE_SPEC.md) #1595: fallback: belongs to a document's own unit, not to an import. §4.4, §8 import: and §8 units: now say so, and import:'s optional: is described as the code does it: a missing library is silent, but a library that doesn't parse still warns.
    • The status line names this PR.
  • ARIADNE.md §5.2: a load: fragment is gated, as is a mounts: 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. EveryShippedDocumentIsValid is among them.
  • All Ariadne ctests (ctest -R [Aa]ri): 1,351 pass, 0 fail; the skips are the usual environment ones (no CUDA, no browser, no E2EE store).
  • On the old loader, five of the six new tests fail. The sixth, the background: one, passes, which is the point: the loader already kept that rule.
  • git clang-format leaves the change as it is.

Not verified: Linux and macOS, cvcGL and pycvc (CI covers them).

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.
#1599 made a map-form link: hole with no mode:
read-only, as spec 7.3 says. Its row in spec 9 and the guide's 7.4
note that a missing mode is still read-write come out. The status line
names master fc507d7, where #1599 landed.
- 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.
@transfix
transfix enabled auto-merge (squash) November 28, 2026 10:27
@transfix
transfix merged commit 431295d into master Nov 28, 2026
30 checks passed
@transfix
transfix deleted the ariadne/spec-defects branch November 28, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant