Repository navigation
Ariadne: a link: hole grants the subtree under its target - #905
Merged
Merged
Conversation
A load: mount's link: hole was a transparent link on one node, and every reader
(state_exec's state-* natives, bind.h) followed a link only on the last hop of a
path. findDescendant and operator() walk physical children, so with
link: {tree: s} the module's bind: tree.a, (state-get "tree.a") and
(state-children "tree.x") found the hole's own (empty) children, never s.a. A
view module could not be handed a parsed reply subtree.
cvc::state gains two opt-in path walks that follow a transparent link on every
hop: findThroughLinks (read view, creates nothing, last hop followed) and
childThroughLinks (write view, create-or-get: a writable link continues at its
target, a read-only one at the link node's own children, or refuses with
refuse_read_only; the last hop is left to value()/data()). findDescendant and
operator() are unchanged.
state-get, state-exists, state-children, state-data-get and state-json read
through findThroughLinks; state-set, state-data-set and state-from-json write
through childThroughLinks; state-cas, state-swap and state-incr refuse a path
through a read-only link, since their write would not land on the node a read
sees. bind.h's read_or_seed / read_or / read_bool_or(_seed) / write and the
Runtime's read_string use the same walks, so a widget bind under a hole works.
Default-deny holds: only the hole's target and what is under it become
reachable, a read-only hole's writes stay local, and reconcile still clears the
holes. state-delete, the expiry natives and state-watch still act on the
physical path. Docs: ARIADNE.md 7.4, STATE_API.md tree navigation.
This was referenced Oct 30, 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.
Problem
A
load:mount'slink:hole is a transparent link on one node. Every reader (state_exec'sstate-*natives,bind.h) followed a link only on the last hop of a path, andfindDescendant/operator()walk physical children. Withlink: {tree: s}, the module'sbind: tree.a,(state-get "tree.a")and(state-children "tree.x")found the hole's own (empty) children, nevers.a. So a view module could not be handed a parsed REST reply subtree (cypkg'ssearch.res.packages.{i}.*, its roadmap item L14).Fix: in cvc::state, as opt-in walks
The hole wiring cannot mirror a subtree the parent fills later, and changing
findDescendant/operator()would change every state consumer (sync, JSON, sweeps, the link index). Socvc::stategains two path walks that follow a transparent link on every hop:findThroughLinks(path): the read view. It creates nothing and follows the last hop too. A broken or cyclic link is walked as the plain node it is (resolvedValue's fallback).childThroughLinks(path, refuse_read_only = false): the write view, create-or-get. A writable link continues at its target and throwsread_only_errorwhen unresolvable, asvalue(v)does. A read-only link continues at the link node's own children, so the write stays local, or the walk refuses whenrefuse_read_onlyis set. The last hop is left tovalue()/data().Opaque links are never followed.
Users:
state-get,state-exists,state-children,state-data-getandstate-jsonread through the read view.state-set,state-data-setandstate-from-jsonwrite through the write view.state-cas,state-swapandstate-incrrefuse a path through a read-only link, because their write would not land on the node a read sees (the rule they already follow for a read-only link at the last hop).bind.h'sread_or_seed,read_or,read_bool_or(_seed)andwrite, plus the Runtime'sread_string. A widget bind under a hole works.Default-deny
clearLinks every hole, after which nothing under the old target is reachable (tested).state-delete, the expiry natives andstate-watchstill act on the physical path and do not reach through a hole.Tests
state_link_test: 11StateLinkPath.*tests covering reads, the link's own children being ignored, opaque, broken, chain, cycle, rw / ro / refuse writes, an unresolvable rw link, and the last hop of a write.state_exec_intrinsics_test: a hole chrooted atmod, with reads, rw writes (set, data-set, incr, cas) and ro writes. The ro case covers local writes, the atomics refusing, andfrom-json.ariadne_runtime_test: a mount oversearch.reswith a repeatedtree.packages.{i}.name, an expression read, ro / rw slider commits, a later parent write showing through, and a reconcile tear-down.ariadne_host_test:.ariload:modules with ro, rw and no grant, whoseinit:reads, lists, gets data and writes through the hole and cannot see the parent'ssearch.secret.All pass locally (Linux, RelWithDebInfo), as do 25 more suites touching ariadne, links and state_exec:
ariadne_loader/bind/ftxui/scene_tf/requires/stream_view,state_test,state_link_*,state_transparent_link_index,state_exec_{scheduler,integration,advanced_integration,gaps,async,deep_data,data_steps,stdlib,exceptions},world_clock,holon_sync,tf_editoranduri_http_cache.Docs: ARIADNE.md §7.4 (the subtree grant and its ro/rw rules) and STATE_API.md (tree navigation).
Not changed (follow-ups)
state-childrenlists the whole subtree by full name (state::children();fem_gallery.arirelies on that). Through a hole those are the target's absolute names: the module learns the parent's key names but cannot use them, since its paths stay chrooted. Same as before for a hole on one node.state://URI resolver (uri_state.cpp) still follows a link on the last hop only.