Skip to content

ariadne: .ari channels: declaration + lint: policy + mount grant (§12, PR-B) - #464

Merged
transfix merged 1 commit into
masterfrom
design/ariadne-channels-declaration
Sep 29, 2026
Merged

transfix merged 1 commit into
masterfrom
design/ariadne-channels-declaration

Conversation

@transfix

Copy link
Copy Markdown
Owner

PR-B of the channel-scoping work — the .ari authoring surface on top of the core resolver merged in #463. Loader-side only; the enforcement engine (PR-C) consumes what this parses.

What lands

  • Top-level channels: — a document declares its own channels: a sequence of bare names (- nav.done) or {channel, shared, global} maps. global: true puts a channel at app-root and adds it to the default-deny globals allowlist (a /-prefixed reference is permitted only for a declared global — a chrooted sub-doc can't blanket-escape). → LoadResult.channels + has_channels_block (the enforcement gate: a doc with no channels: block is never channel-linted, so existing docs keep working).
  • Doc-level lint: block (part of a broader lint/correctness effort, not buried in channels:) — channels: strict|warn|off (default strict) + quiet → LoadResult.lint. Parsed now; PR-C's enforcement consumes it.
  • Mount channels: grant — the messaging analogue of link:. Each entry (local: parent rw, or local: {to: parent, mode: ro|rw}) lowers into the existing Widget::links/LinkHole under the reserved channels. subtree, so wire_holes plants it and state_exec: chroot-scope message channels (§12 core) #463's resolve_channel follows it — a granted channel resolves to the parent's key, end to end, with no new runtime plumbing. Fail-closed rw/ro; rejects a leading /.
  • is_builtin_block += channels/lint; parse_channels/parse_lint mirror parse_customs.

Tests

6 AriadneChannels loader tests (declaration incl. shared/global; the no-block gate; duplicate-drop; lint: parse + default-strict; mount grant → the right LinkHole with fail-closed mode). Full loader suite green (151), no regressions.

Follow-up — PR-C (enforcement)

Both layers, driven by lint.channels: (A) load-time lint (fail-fast — parse each script, scan static (msg-* "literal") refs, validate vs declared/granted/globals → error/warn/off) and (B) runtime policy (the backstop for dynamic (msg-recv (expr)) names — a channel policy on the action ictx, checked in resolve_channel). The lint: block is inert until PR-C wires it.

…, PR-B)

The authoring surface for chroot-scoped channels (PR-A #463 is the core
resolver this builds on). Loader-side only; enforcement (PR-C) consumes it.

- Top-level `channels:` — declares a document's own channels (a sequence of
  bare names or {channel, shared, global} maps). `global: true` adds a channel
  to the default-deny globals allowlist ('/'-refs permitted only for declared
  globals). LoadResult.channels + has_channels_block (the enforcement gate:
  a doc with no channels: block is never channel-linted).
- Doc-level `lint:` block (part of a broader lint effort) — `channels:
  strict|warn|off` (default strict) + `quiet` -> LoadResult.lint. Parsed now;
  the enforcement layer (PR-C) consumes it.
- Mount `channels:` grant — the messaging analogue of link:. Each entry
  (`local: parent` rw, or `local: {to: parent, mode: ro|rw}`) LOWERS into the
  existing Widget::links/LinkHole under the reserved channels. subtree, so
  wire_holes plants it and PR-A's resolve_channel follows it (a granted channel
  resolves to the parent's key). Fail-closed rw/ro; rejects a leading '/'.
- is_builtin_block += channels/lint; parse_channels + parse_lint mirror
  parse_customs.
- 6 AriadneChannels loader tests (declaration incl. shared/global, no-block
  gate, dup drop, lint parse + default, mount grant -> LinkHole). Full loader
  suite green (151), no regressions.

Follow-up PR-C: enforcement — the load-time lint (A, scan static msg-* refs)
and the runtime policy (B, dynamic), both driven by lint.channels.
@transfix
transfix merged commit 154aa52 into master Sep 29, 2026
12 of 13 checks passed
@transfix
transfix deleted the design/ariadne-channels-declaration branch October 29, 2026 20:51
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