Repository navigation
Ariadne shell SH7: asks and grants, input and signals to granted applications, argv: - #1598
Merged
Merged
Conversation
…ications, argv:
docs/roadmap/ARIADNE_SHELL.md 4.5, 4.6 and the SH7 row; ARIADNE.md 5.6, 5.7, 6.3, 6.8, 13.
- Grant tokens (inc/cvc/ariadne/grants.h): delegate.keys, .pointer, .signals, extend.menubar,
.tray, .context_menu, .settings, access.settings(.read), request.main_view, request.open and
net.origin, with a meaning for authors and words for the sheet. A mounted document asks in its
requires: (net.origin with origins:), the loading document grants with grants: on its load: or
mounts: slot ({delegate.signals: [...]} and {net.origin: [...]} limit what they cover), deny:
takes tokens away, and with neither the mount gets extend.tray and extend.settings. A token
holds when asked and granted (the defaults without asking); a mount grants its own mounts only
what it holds. A mounts: entry's own grants pick from its slot's.
- A required token not granted fails a load: (the document's load) or refuses a mounts: entry,
named; an optional one leaves (has? ...) false. (has? NAME) answers per mount in programs (the
held set taken on the host thread with the context, kept by spawned children), init: and the
read lane; the document's own scope answers as it would alone. The entry gets holds and
net_origins back. extend.tray gates a loaded application's tray icons.
- Input: post_input queues what a mount may take; the drain routes a key to the focused
application holding delegate.keys (its on_key: and its keys: bindings at <sub>.keys.<id>), after
the document's own bindings, and to none while a text field outside it has the keyboard; the
pointer over an application's window to its on_pointer: with delegate.pointer. The focus follows
the focused window (Backend::window_focused, window_hovered, item_has_keyboard, reports_focus;
ImGui answers them) or (app-focus AS), mirrored at ariadne.focus. InputEvent::ui marks what the
host's UI took: arigl posts it marked instead of dropping it.
- Signals: without an on_signal: of its own, the shell passes an interrupt to the focused
application (taken over) and a request to end to every application holding delegate.signals
(the host's default still applies); with one, (app-signal AS NAME) passes one on.
- argv: a load:'s argv: or a mounts: entry's argv is parsed by the mounted document's args:,
published under its sub-prefix before its init:; a bad one refuses the mount with its usage (in
the feed for a mounts: entry).
- net.origin: the origins a mount holds are kept on its slot (MountState::net_origins), in the
form SH11's ScopePrincipal::net_origins takes, ready to hand over once #1576 is
on master.
- ari test --mounted runs a document as a shell's application, granted what it holds alone, with
its tests in its scope (MountResult/MountState::tests, Runtime::run_program_in_mount).
- The .ari schema learns grants:, deny:, argv: on load: and mounts:, and requires: origins:.
Tests: ariadne_grants_test (the arithmetic; the loader's grants, warnings, origins and argv; a
refused mount, keys to the focused granted application only and none while the shell's field
has the keyboard, the parent's binding keeping its key, focus following the focused window,
SIGTERM to every granted application and SIGINT to the focused one, a signal list, app-signal,
argv and a bad one's usage in the feed, has? per mount, origins, a static load: taking keys, the
tray gate, one document's tests alone and mounted, two apps side by side); ari_grants_alone and
ari_grants_mounted (src/ari/tests/grants_component.ari, Linux CI with FTXUI).
…l's own left out From SH11's review of the hand-off (#1576): - policy_origin is cvc::net::parse_origin_spec(spec)->str(), the parse SH11's net host reads net_origins with. An origin it refuses (a path after it, not http(s)) is refused at grant time with its reason, in the requires: warning, the grants: warning and the mount's refusal: the net host would otherwise fail every request of the mount without a word. - The origins a mount holds are worked out with its principal before the wrapper moves, so SH11's set_scope_principal block can take them before any program is built, and a remote: principal's own origin is left out (it reaches it anyway; listing it only costs a cache key). Tests: AriadneGrants.PolicyOriginsAndSignalNames (a path refused, with its reason), AriadneGrantsRuntime.AMountHoldsTheOriginsItsSlotGrants (a mount asking for an origin with a path is refused, naming why).
…ariadne-shell-sh7 # Conflicts: # src/cvc/ariadne/ariadne.cpp
SH11's ScopePrincipal::net_origins now gets what SH7 grants: open_mount records a mount's held origins with its principal, and a hot reload that changes them records the new list. Conflicts kept both sides (the source list takes principal.cpp and grants.cpp; the shell entry list takes grants/argv and net_policy/credential_store/e2ee_store; finish_context passes the scope to install_host_verbs and the held grants to has?).
…Gui does Joe's policy is that the shell works in ari on FTXUI and tvision, not only in arigl, so grants and input routing must behave the same there. FtxuiBackend now answers Backend::reports_focus, window_focused, window_hovered and item_has_keyboard: the focus is in the window holding the focused widget, else the one last clicked or raised; the pointer is over the window at its cell; a focused text field has the keyboard. Hosted, tvision says which (FtxuiBackend::set_window_focus): the desktop's current window and the frontmost under the pointer. What the UI used now goes to the Runtime marked InputEvent::ui (FtxuiBackend::post_taken), as arigl posts what ImGui takes, so a focused application gets the keys its own field takes and the shell's handlers still never see them. Tests: AriadneFtxuiShell, a shell with two applications on FTXUI (click to focus, keys and clicks to the one whose window has them, its own field's keys too, none while the shell's field has the focus) and hosted (the host sets the focus and the pointer).
Owner
Author
|
package-linux / libcvc-debug at 07b26a9 (run 46111424334): merged master in as 215ee61.
SH7 doesn't slow mount ticking. What it adds to a frame is one
So the CI miss was a stall of over 5 s on a loaded Debug runner, not a steady slowdown. If it recurs, the test's first |
Conflicts kept both sides: the mounts: slot's grants:/deny: next to its in_background: (widget.h, the schema), a load:'s command line and keys' defaults next to its datasets (emit_container, open_mount, hot reload), a load:'s grants next to its scene plan (plan_windows_menu), grants.cpp next to table_emit.cpp, and the docs' shell.apps entry list. load_mount_checked keeps SH7's prefix-aware message for gl.scene and drops the "not drawn in a mount yet" warning, as SH3 did. As agreed for whichever of #1597/#1598 merged second, a fragment's keys: are SH7's alone (MountGrants::keys, held with delegate.keys): MountScene::keys, its parse in parse_mount_scene, its term in the null check and its two asserts in AriadneLoader.AFragmentsSceneIsParsed are gone, and the docs and comments that listed keys with a mount's scene and datasets say so.
This was referenced Nov 29, 2026
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.
Phase SH7 of the Ariadne shell (
docs/roadmap/ARIADNE_SHELL.md4.5, 4.6 and the SH7 row): asks and grants, input and signals to granted applications, andargv:. Docs: ARIADNE.md §5.6, §5.7, §6.3, §6.8 and §13, plus an "As built in SH7" note in ARIADNE_SHELL.md.What it does
Grant tokens (
inc/cvc/ariadne/grants.h, pure functions):delegate.keys/.pointer/.signals,extend.menubar/.tray/.context_menu/.settings,access.settings(.read),request.main_view,request.openandnet.origin.requires:.net.origintakesorigins:.grants:on aload:or amounts:slot.{delegate.signals: [...]}and{net.origin: [...]}limit what those two cover, anddeny:takes tokens away.grants:, a mount getsextend.trayandextend.settings.mounts:entry's owngrantspicks from its slot's.Refusal:
load:(the document's load), or refuses amounts:entry. Either way the token is named.(has? ...)false.holdsandnet_originsback.extend.traynow gates a loaded application's tray icons.(has? NAME)answers per mount, in programs, ininit:and in the read lane. The document's own scope answers as it would alone.Keys and pointer:
delegate.keys: itson_key:, and itskeys:bindings at<sub>.keys.<id>.on_pointer:when it holdsdelegate.pointer.window_focused,window_hovered,item_has_keyboardandreports_focus, which ImGui answers.(app-focus AS)also sets the focus. It is mirrored atariadne.focus.InputEvent::ui, instead of dropping it.Signals. If the shell has no
on_signal:of its own:delegate.signals, and the host's default still applies.A shell that has its own
on_signal:passes a signal on itself with(app-signal AS NAME).argv:
load:'sargv:or amounts:entry'sargvis parsed by the document's ownargs:.init:runs.mounts:entry, the usage goes to the feed.net.origin. The origins a mount holds are kept on its slot (MountState::net_origins), in the form SH11'sScopePrincipal::net_originstakes.ari test --mountedruns a document as a shell's application, granted what it would hold alone, with its tests run in its scope.Schema. The
.arischema learnsgrants:,deny:andargv:, andorigins:on arequires:entry.Where it differs from the design (in the As-built note)
extend.trayis enforced among theextend.*tokens. The rest, andaccess.*andrequest.*, are only answered and checked at mount until SH9, SH6 and SH14.grants: { ask: }warns (that's SH9).keys:bindings have no modifiers yet.(app-focus)is the only way to move it.Coordination
ScopePrincipal::net_origins. This PR does not build on Ariadne shell SH11: the network, credentials, keys and sign-ins per principal #1576. Whichever of the two merges second adds one line inopen_mount,who.net_origins = slot.net_origins;, inside SH11'sset_scope_principalblock. The format (policy origins,scheme://host[:port]) is the one SH11's note asks for.open_mount, the mount loader). It had pushed no branch when this was opened.Tests
ariadne_grants_test(20, new). It covers:app-signal;has?per mount, origins, a staticload:taking keys, and the tray gate;ari_grants_aloneandari_grants_mounted:src/ari/tests/grants_component.arirun withari testand withari test --mounted.ariadne_grants_test20/20,ariadne_loader_test282,ariadne_runtime_test378,ariadne_requires_test20,ariadne_schema_test14 (1 skipped by design),ariadne_deep_nesting_test19. The ctestsari_grants_alone,ari_grants_mounted,ari_processes_componentandari_chat_componentpass.ImGuiBackendhooks and the arigl input change (cvcGL is off in this build);