Repository navigation
ariadne: load-time channel lint — fail-fast enforcement (§12, PR-C) - #465
Merged
Merged
Conversation
…hannels (§12, PR-C) The load-time half of channel enforcement (the runtime policy for dynamic channel names is a follow-up). Gated on the document declaring a channels: block; strictness from the lint: block (default strict). - lint_channels() runs after the tree + scripts are built: it parses each program lane (init/on_tick/on_key/on_pointer + every widget on:) with the state_exec parser and walks the value_t AST for the string-literal first arg of (msg-send|msg-recv|msg-pending ...) — the STATIC channel references. Each is validated against the declared channels (a '/'-ref against the declared globals; a '#'-runtime channel is never linted). Undeclared -> a hard load error (strict), a warning (warn), or skipped (off) per lint.channels; warn/off emit a one-time "relaxed" notice unless lint.quiet. Dynamic (non-literal) refs are the runtime policy's job. - Guarded by CVC_STATE_EXEC (the parser is unavailable, and there are no program lanes to lint, without it) — a no-op otherwise. - 8 AriadneChannelLint tests (strict-fails, declared-passes, warn, off, global needs-declared-global, '#'-exempt, no-block-no-enforcement, init-script- linted). Full loader suite green (159), no regressions. Follow-up (final PR): the runtime policy (B) — a channel policy on each action/ resident ictx (declared set + globals + strict/quiet), checked in resolve_channel to catch DYNAMIC channel names the static lint can't see; + a roadmap §12 write-up.
transfix
force-pushed
the
design/ariadne-channel-enforcement
branch
from
September 29, 2026 03:20
6ebca47 to
be24b56
Compare
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.
PR-C of the channel-scoping work — the load-time enforcement layer, on top of the declaration (#464) and the core resolver (#463). Fail-fast, static; the runtime policy for dynamic channel names is the final follow-up.
What lands
lint_channels()runs inload_nodeonce the tree + all scripts are built. For each program lane (init/on_tick/on_key/on_pointer+ every widgeton:), it parses the script with the state_exec parser and walks thevalue_tAST for the string-literal first arg of(msg-send|msg-recv|msg-pending …)— the static channel references — then validates each:/-ref must be a declared global; a#-runtime channel (tick/key/pointer) is never lintedstrict, the default), a warning (warn), or skipped (off) perlint.channels;warn/offemit a one-time "relaxed" notice unlesslint.quietchannels:block (no block ⇒ no enforcement — existing docs keep working)Guarded by
CVC_STATE_EXEC(no parser / no program lanes without it) — a no-op otherwise. Only static (literal) refs are visible at load; dynamic(msg-recv (expr))names are the runtime policy's job.Tests
8
AriadneChannelLinttests: strict-fails, declared-passes, warn-warns-not-fails, off-skips, global-needs-declared-global (positive + negative),#-exempt, no-block-no-enforcement, init-script-linted. Full loader suite green (159), no regressions.Follow-up — final PR (runtime policy B)
A channel policy (declared set + globals + strict/quiet) on each action/resident
ictx, checked inresolve_channelto catch dynamic channel names the static lint can't see — the completeness backstop. Plus a consolidated roadmap §12 write-up of the whole channel-scoping model (#463 core → #464 declaration → this lint → runtime policy).