ADR-0067: reflexr's commands: every action a command, or listed with its reason¶
Status: Accepted Date: 2026-11-01 Deciders: Alex Nodeland Implements: lattice RFC-0014's reflexr catalog (phase 1, #916); on lattice ADR-0041
Context¶
RFC-0014 gives each package a static catalog of commands. portr, portalr's client and the parity test read it without a database. RFC-0014 gives reflexr's catalog events, rules, runs (retry, skip, cancel), schedules and dead letters. Its exit asks that every action of reflexr's be some command's gate, or listed with a reason.
reflexr already serves eighteen tools and one resource from its own MCP server (reflexr.mcp), each asking one of the eighteen actions in reflexr.workspace.ACTIONS. RFC-0014 keeps that server for library users, beside portr.
Decision¶
reflexr.commands, a layer of its own, imports pydantic, reflexr's core and lattice-core'scapabilitiesandcommands.CATALOGreads no database and opens no workspace.- 18 commands,
reflexr.<name>, version 1.0.0, each gated by the action reflexr's workspace asks for it.- Named as reflexr's own MCP tools,
reflexr.publish_event...reflexr.give_feedback, so a client that moves from that server to portr sees the same tools. Their arguments are the tools' less the workspace, which a call's scope names. - In the
automationstoolset, butreflexr.give_feedback, infeedback. None is incore, which RFC-0014 keeps to artifactr's threads and artifacts and grantr's approvals. - The reads are tier
read, withreads_private, and leave nothing to undo. - The writes that record a fact or run an action again are
irreversible:publish_event,replay_rule(which may refire),retry_run,skip_run,cancel_run, andarchive_rule, which cancels unfinished runs. Installing or updating a rule, and feedback, arecompensable. reflexr.get_runis a resource too, byreflexr://{tenant}/{workspace}/runs/{run_id}, the URI the server already serves.- A rule to install or update is described by reflexr's
Ruleschema, from its core. So a client sees the same conditions, scopes and actions thatschemas/reflexr.rules.v1.jsondescribes. - Routes go into portalr's app: a workspace's runs, its rules and schedules, or one rule. Reading or publishing events has no page, so they route nowhere.
- Named as reflexr's own MCP tools,
- Listed, with a reason, in
LISTED:reflexr:open, asked before every command in a workspace;reflexr:checkpoint_run, a run's own progress, which RFC-0014's parity row names as a runtime action;reflexr:save_cursorandreflexr:read_cursors, the log's consumers' bookkeeping. A rule's cursor shows inreflexr.rule_status.
- Not exposed: none. Every reflexr action a person takes is one an agent with the person's grants may take too, through the enforcer's approvals.
- Published as
schemas/reflexr.commands.json, with what is listed, regenerated byreflexr:schemaand checked for drift. Its sets are sorted, so the document is the same from one run to the next.
Options considered¶
Option A: Named as the MCP server's tools (chosen)¶
Pros: one name per tool wherever a client meets reflexr; RFC-0014's <package>_<name> tool names come out as they are today with a reflexr_ prefix.
Cons: the names mix verbs (get_run, rule_status) where artifactr's catalog reads read_*.
Option B: Named after the actions (reflexr.read_runs, reflexr.read_rules)¶
Cons: several commands share an action (list_runs and get_run both need reflexr:read_runs), so names after actions collide, and every client of the server would see new names.
Consequences¶
- Easier: the parity test, portalr's
CommandNameand portr's tools read one list of reflexr's commands. - Harder: a new reflexr action needs a command or a line in
LISTED, and a renamed command is a new one. - reflexr no longer imports at lattice-core-ai 0.2.0, the newest on PyPI, which lacks
capabilitiesandcommands.scripts/lowest_direct.pyexpects that until its floor rises with the next lattice-core release. - To revisit: reflexr's provider, which calls these commands through the enforcer (RFC-0011, #940), and the server's tools once portr binds the catalog.
Action items¶
-
reflexr.commands, its schema andLISTED, tested against reflexr's actions and its server's tools. - reflexr's provider for RFC-0011's registry (#940).
- The bound provider, with portr (#917).