Skip to main content

Module actor

Module actor 

Source
Expand description

Whether the actor a request names is the agent that sent it — identity M4a-2 (docs/specs/SPEC_AGENT_IDENTITY_CARRIED_NOT_DERIVED_2026_09_23.md §6.5.3, §6.5.6).

An actor site is a handler whose request says who is acting: a memory owner, a global-memory writer, a work claimer or creator, an inject or bus sender, a cron creator, a UI-automation signer (§6.5.2 item 4). When the request is Caller::Agent, the named actor is checked against that UID’s own row, and one of these is counted per site:

  • m4.actor_mismatch.<site> — the name is none of the row’s {slug, display name, instance_name}, matched as the M3 resolver matches (Store::agents_matching_name): slug exactly, the others ASCII case-insensitively. A name that would not select the caller’s row.
  • m4.actor_ambiguous.<site> — the name selects the caller’s row, but not by its slug, and also selects another row — any row, a template included: the colliding-name case, in which a slug-keyed consumer (memory) resolves to the other agent, and the template-stub case of #3573.
  • m4.actor_absent.<site> — an attributed request that names no actor.
  • m4.actor_unchecked.<site> — the caller’s row could not be read.

Never refused, never awaited, and nothing is written: the check runs detached on the blocking pool; the handler does not await it, though it contends for the store’s connection lock like any store read (§7); M4c dual-writes the UID. This only measures how often the name and the token disagree before anything relies on the token. Unattributed requests are not checked — there is no row to compare with, and most are the UI (§6.5.1).

Macros§

actor_sites 🔒

Enums§

ActorSite 🔒
Where the actor name came from — the <site> in the counters.
Outcome 🔒

Constants§

NO_TOKEN 🔒
What a route that acts for an agent says to a request with no token of this srv’s.
TOKEN_NAMES_ANOTHER 🔒
What it says when the token is another agent’s, or the name is one more than one agent answers to.

Functions§

check_actor 🔒
Count actor against the caller’s row at site. A no-op for an Unattributed caller. Never fails and is never awaited: the store reads run detached on the blocking pool (inline under test, so tests can read the counters right after the request).
check_carried_uid 🔒
A work claim also carries the claimer’s UID (agent_uid, identity M1a). A carried UID that is not the token’s is counted on its own, since it is the UID — not the name — that M3 writes to claimed_by_uid.
classify 🔒
What to count for actor against the caller’s row; None when the name is the caller’s own. rows_named lists every row the name selects, templates included (Store::rows_answering_to); it is asked only when the name selects the caller’s row other than by its slug.
count_against_row 🔒
jekt_sender_by_token 🔒
Identity M4d-4: whether a host-tier jekt is from the agent it claims by its token (audit_source_uid is the request’s Caller). Far-side receivers have no Caller and keep checking the signature, which is still sent.
names_the_caller 🔒
Whether actor is a name the agent behind uid answers to: its slug, display or instance name, or one it was renamed from (a running agent keeps sending under the name its environment held at launch). A name that also selects another row, or a row that can’t be read, is not held against it.
names_the_row 🔒
Whether actor would select row by name (see the module doc).
own_agent_only 🔒
An agent acts on its own panes only: a request that carries an agent’s token is refused when the pane (or agent) it acts on belongs to another. A request with no token (the window, a peer srv) is not compared, nor is a target that has no agent.
own_pane_by_token 🔒
Identity M4d-4: the pane of a caller whose token names it under its own slug, from its UID’s registration, with no key to check. None (today’s name path) for anyone else, or before the UID registers.
proven_slug 🔒
The slug of the agent behind uid when actor is a name only that agent answers to: its slug, a display or instance name no other agent shares, or a name it was renamed from. A name another row also answers to, or a row that can’t be read, proves nothing (unlike names_the_caller, which gives them the benefit of the doubt).
require_actor 🔒
check_actor that refuses: a request whose token names an agent may claim only that agent as its sender. Ok for an Unattributed caller (no token to compare with: the UI, muxsh, a peer srv), for a request that names no actor, and when the caller’s row can’t be read. The error is the handler’s answer.
require_own_block_transcript 🔒
require_own_transcript for a call that names a pane’s block instead of an agent: the archive or restore of that block’s transcript. An agent’s connection may act only on the block its own agent is running on (a block with no running agent is the window’s alone); any other connection must be the AgentMux window, proven by the host.
require_own_transcript 🔒
A WebSocket write to one agent’s transcript or session state. A connection that registered as an agent (with its token) may write only its own agent’s; any other connection must be the AgentMux window, proven by the host. Holding the instance auth key proves nothing, because every agent holds it. target is the agent’s definition id or its slug; what completes “FORBIDDEN: …” when a connection that isn’t the window is refused.
require_token 🔒
For a route that acts for the agent its token names (its memory, accounts, presets): the request must carry a token this srv minted. Without one the route has no one to act for, and a body’s agent_id is only a claim, so it is refused instead of being taken at its word.
require_token_actor 🔒
For a route that records who acted: the agent the request’s token names, as (slug, uid). claimed is the name the request gives for itself, and an empty one leaves the token to decide alone. Refused without a token, and when claimed is not a name only that agent answers to, so what is recorded is what the server proved and never a body field.
require_token_naming 🔒
Like require_actor, but for a route that acts for an agent and has no meaning without one: the request must carry the token of the agent it names. A request with no token (or one this srv didn’t mint) is refused instead of being taken at its word, and so is one whose token names another agent.
source_from_token 🔒
A caller its token names that sent no source (muxsh agent send in an agent’s shell) is that agent: the source becomes its slug, so tier 4 can relay it and srv can sign it (SPEC_WAN_JEKT_SIGNED_BY_SRV_2026_10_14.md §3.1 rule 2). A source the caller did send is kept, and is signed only if it is the token’s own (wan_signer).
uid_has_slug 🔒
Identity M4d-4: whether uid’s own row has name as its slug, exactly (spec §6.5.10 rule ii: never its display or instance name), so a request carrying uid’s token under name is that agent by its token.
uid_owns_name 🔒
Whether uid’s row is the one agent this instance knows by name: its slug is name ignoring case, and no other row’s slug folds to name. Every per-name key (host HMAC, LAN, WAN) is stored under the folded name, so a second row differing only in case (Victim beside victim) would hold the first one’s keys; for such a name nobody is its owner.
wan_signer 🔒
The agent srv may sign a WAN jekt as: its source_agent, when the request’s own caller (caller_uid, from its token or a cron job’s creator; never anything a hop carries) owns that name (uid_owns_name, §3.1 rules 1 and 2). The name is compared ignoring case, as the keys are stored: an agent sends as QTest, its slug is qtest.