Skip to content

Ariadne: a load: names its application per instance (name:), and a repeated mount is made once - #1485

Merged
transfix merged 1 commit into
masterfrom
feat/ariadne-repeated-app-names
Nov 23, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/ariadne-repeated-app-names

Conversation

@transfix

@transfix transfix commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

A load: can name the application it mounts, one name per instance under repeat:. A repeated mount is built once instead of being copied every frame. nicotina needs both to open one copy of its client per TX.WTF site, each with a menu named by that site (cy-pca/nicotina#35).

What changes

name: on a load: (§5.25).

  • The value is a state key, or an expression on the read lane. It is worked out each frame in the loader's scope, with {i} as the instance's index.
  • When the value is not empty, it names the application: its menu in the outer bar, its Restart and Quit items, its entry in Windows > Applications, and its notifications.
  • When it is empty, the old name stays: meta.name, or " N" for a repeated mount.
  • If two applications end up with the same name, the second gets a number ("tx.wtf", "tx.wtf 2"), because two menus with one title would be one menu to a terminal's bar.
  • Code:
    • Widget::app_name_bind is set by the loader.
    • plan_windows_menu records it, along with the scope the mount sits in.
    • plan_frame_apps works it out for each instance.
    • mount_names takes it as each mount is drawn.

A repeated mount is made once.

  • Before, each_instance ran substitute_index on the whole mounted document for every instance on every frame. That is a deep copy of a whole document, such as nicotina's few thousand widgets, each frame for each site.
  • Now an outermost repeated mount's instances are kept in mount_instances_, keyed by template and index. The template lives in root, so its address holds until the next reconcile, and the reconcile clears the cache.
  • Repeats inside a mount, and repeats that are not mounts, are unchanged.

No nested-repeat warning for a repeated mount.

  • The module's own repeat:s use their {i} at the instance's sub-prefix. They never needed the outer index, so the loader no longer warns about them.
  • Every nicotina load warned about this before.

Tests

  • ariadne_runtime_test, AMountsNameNamesEachInstancesApplication checks:
    • each instance is named from its key;
    • a name given twice is told apart;
    • an instance with no name keeps its number;
    • a name change shows on the next frame;
    • Quit goes by the name;
    • a non-repeated mount takes an expression.
  • ariadne_loader_test, ALoadsNameIsKeptAndARepeatedMountIsNotANestedRepeat checks that the key is kept and that the warning is gone.

Docs: ARIADNE.md §5.25.

Overlaps

Checked here

On Windows, MSVC, a shared build: all 256 tests in ariadne_loader_test and all 349 in ariadne_runtime_test pass. To link the runtime test I added GTEST_LINKED_AS_SHARED_LIBRARY=1 locally (not in this PR). On master, its death test (#1088) doesn't link against a shared googletest built from source.

This branch's ari with nicotina's fleet branch, against two stub sites: the bar reads nicotina 127.0.0.1:61834 127.0.0.1:61833 Windows, and the nested-repeat warning is gone.

…peated mount is made once

name: on a load: is a state key or a read-lane expression, worked out each
frame in the loader's scope with {i} the instance under repeat:. When it
isn't empty it names the application: its menu in the outer bar, Restart and
Quit, Windows > Applications, and its notifications. A name two applications
come to is told apart by a number ("tx.wtf", "tx.wtf 2"), since two menus of
one title are one menu to a terminal's bar.

An outermost repeated mount's instances are kept (mount_instances_, cleared
when the root is swapped) instead of each being substitute_index-copied every
frame: an instance is a whole loaded document.

A repeated mount is not a nested repeat: the module's repeats use their {i}
at the instance's sub-prefix, so the loader no longer warns about them.

nicotina opens a copy of its client per TX.WTF site this way, each site's
menu named by its host.
transfix added a commit to cy-pca/nicotina that referenced this pull request Nov 23, 2026
… at once, each in its own window (#35)

* The TX.WTF fleet: a Site combo on the sign-in form, and several sites at once, each in its own window

The sign-in form's Site combo lists --instance's site, --sites', then the
fleet's 15 deployed sites (txwtf-fleet's fleet.yaml), each where the host may
reach it: bin/nicotina passes fleet.policy, which allows them all; a page the
ones its config allows.

Each site you sign in to is a copy of the client: main.ari loads nicotina.ari
as a repeated mount, a slot a site, with its own session, windows, tray mail
icon and menu (Home through Refresh, and Sign out, this site only). The
nicotina menu signs in to another site (a form at the next free site) or out
of every site, leaving the first's form. A site's window closes when it signs
out while another is open; one session a site.

Each site's token is kept under its own credential, txwtf.<host> (site.ari),
bound to its origin; a session kept under the old single name, txwtf, still
resumes. With --credential-store every kept site opens signed in.

The menus are named by host where the host takes name: on a load (libcvc
4.0.7, transfix/libcvc#1485), else nicotina 1, nicotina 2. The cyberpcangel.com
page allows dev.tx.wtf beside tx.wtf (both send CORS for it); the fleet's
other sites need CORS for the page's origin first.

tests/run.sh: a second stub site; two kept sessions (old and new credential
names) open two signed-in copies; the launcher's --net-policy; fleet.policy
and main.ari agree; a tmux walk through Sign in to another site, a site's own
Sign out, Sign out of every site and the Site combo.

* tests: the two-site walk's Sign out is three up from the site's first item, past the host's Quit and Restart
@transfix
transfix enabled auto-merge (squash) November 23, 2026 06:47
transfix added a commit that referenced this pull request Nov 23, 2026
The closed schema lands after the PRs that add loader keys, so it carries
their keys now:

- notifications: always, as well as a flag (#1450);
- a tray_icon's icon: and auth: (#1450);
- a color picker's fmt: rgb | hex (#1452);
- a load:'s name:, a key or an expression that names the application
  (#1485);
- scene: clock: max_lag:, more than 0 and at most 10 s, in the scene and
  in a scene of its own (#1475).

Master's own new keys need none: #1472's look: wheel:, wheelbase: and
track: sit in world:, which the world rules check, and #1399's region: is
a custom node's own key.

AcceptsWhatTheLoaderTakes takes each new form; FindsEachMistakeWhereItIs
finds fmt: cmyk and notifications: sometimes.
@transfix
transfix merged commit b36f3a2 into master Nov 23, 2026
32 checks passed
@transfix
transfix deleted the feat/ariadne-repeated-app-names branch November 23, 2026 12:29
transfix added a commit that referenced this pull request Nov 23, 2026
…p9/volume-grid-segment

VolumeGridNode keeps both the segmentation and the VolumeRenderNode: both
includes, both forward declarations, both ticks; the surfaces group's comment
(header and ARIADNE.md) names the volume, the contours' and the segments.
transfix added a commit that referenced this pull request Nov 23, 2026
INDEX.ari keeps master's http_cache entry and adds processes after it. The
runtime tests keep master's AMountsNameNamesEachInstancesApplication beside
SH0's two tests, which git had interleaved. The mirror test checks that a
loader's name: (#1485) names an ariadne.apps entry, and ARIADNE.md says so.
transfix added a commit that referenced this pull request Nov 24, 2026
)

* Ariadne: a closed .ari schema every load checks, and ari validate

The .ari document's structure gets a formal definition, roadmap section 15,
now docs/ARIADNE.md section 14:

- src/cvc/ariadne/schema/ari.v1.schema.json: one JSON Schema for every
  top-level block, all 35 built-in widget types, the scene, include: and
  load: sites, with descriptions. Every map is closed: an unknown key is an
  error, except x- keys, a custom widget's or node's own keys, and a block an
  app registered or the document declares in customs:. A widget's type is its
  first type key in the loader's order. It keeps to json-schema-validator's
  draft-7 subset.
- CMake embeds it (CvcEmbedText.cmake) for ari_schema_json() and installs it
  under share/libcvc/ariadne/schema/.
- With the validator built in, every load checks the document, its import:ed
  libraries, its load: fragments and each include: expansion (placed in the
  unit's own file), as warnings and LoadResult::schema_issues with line and
  column. The compiled validators live in a cvc::app slot.
- validate_string / validate_file check without loading, the document's own
  units instantiated with their declared args.
- ari validate [--structural-only] [--strict] [--json] and ari schema.
- ci.yml: package-linux's configure assertion also requires the validator.

All 176 shipped documents are valid; reopen_refit.ari gains its missing
meta.min_libcvc. Five loader tests that feed bad values count the loader's own
warnings and check the schema flags the same pointer. New ariadne_schema_test
and ctests for ari validate and ari schema.

* Ariadne schema: scene: clock: hz, the world's rate

OW8 (#1441) gave the scene's clock an hz key: a whole number of ticks a
second from 10 to 240, as sim_rate_valid takes it. The schema takes it the
same way in both clock entries, and ClockBlockTakesAWorldsRate checks that the
schema accepts hz: 60 and flags each rate the loader warns about.

* Ariadne schema: the hosts' blocks in their short forms

wasm: takes a guest's path alone and relay: a relay's URL alone, as
their readers do; a bare server: or world: sets nothing, as theirs do.
The schema took a map only, so WasmWasiTest's `wasm: all.wat`, under
min_libcvc 3.7.13, failed its load on Linux.

* Ariadne schema: the keys the open PRs add to the loader

The closed schema lands after the PRs that add loader keys, so it carries
their keys now:

- notifications: always, as well as a flag (#1450);
- a tray_icon's icon: and auth: (#1450);
- a color picker's fmt: rgb | hex (#1452);
- a load:'s name:, a key or an expression that names the application
  (#1485);
- scene: clock: max_lag:, more than 0 and at most 10 s, in the scene and
  in a scene of its own (#1475).

Master's own new keys need none: #1472's look: wheel:, wheelbase: and
track: sit in world:, which the world rules check, and #1399's region: is
a custom node's own key.

AcceptsWhatTheLoaderTakes takes each new form; FindsEachMistakeWhereItIs
finds fmt: cmyk and notifications: sometimes.
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