Papers
Topics
Authors
Recent
Search
2000 character limit reached

Declared Reflective Runtime Protocol

Updated 5 July 2026
  • Declared reflective runtime protocol is a runtime architecture that exposes adaptation elements like state, signals, and transition rules as explicit, inspectable structures.
  • It employs formal models such as finite-state machines and guarded-action calculus to ensure safe, verified reflection and runtime repair across diverse applications.
  • This protocol bridges high-level abstract semantics with low-level implementations, enabling efficient adaptive behaviors in autonomous and self-healing systems.

Searching arXiv for the specified papers and closely related work on declared reflective/runtime reflection protocols. arXiv search query: "Declared Reflective Runtime Protocol runtime reflection reflective runtime protocol VIGIL semantic tower Platum Battleship" A declared reflective runtime protocol is a runtime architecture in which the objects of adaptation are made explicit rather than latent: state variables, derived signals, safe points, guards, transition rules, and, in some systems, repair proposals or implementation mappings are represented as inspectable runtime structure instead of being buried inside an opaque control loop. In recent work, this idea appears in several adjacent forms: a declarative agent runtime with externalized confidence and revision signals (Jung et al., 8 Apr 2026), a reflective runtime for self-healing agents built as a state-gated maintenance pipeline (Cruz, 8 Dec 2025), a category-theoretic runtime reflection protocol based on first-class implementations and generalized safe points (Rideau, 1 Jun 2026), and a declared reflective methodology that compiles verified protocol specifications into flat C monitors (Amorim et al., 4 Apr 2026). Taken together, these works define a research program in which reflection is not treated as informal introspection, but as a typed, guarded, and often formally delimited runtime mechanism.

1. Historical and conceptual setting

Several of these systems begin from the same diagnosis: deployed autonomy is often structurally under-specified. "How Much LLM Does a Self-Revising Agent Actually Need?" observes that recent LLM-based agents often place world modeling, planning, and reflection inside a single LLM loop, which makes it difficult to determine which part of competence comes from the LLM and which part comes from explicit structure (Jung et al., 8 Apr 2026). "VIGIL: A Reflective Runtime for Self-Healing Agents" makes a closely related claim at the systems level: agentic LLM frameworks promise autonomous behavior via task decomposition, tool use, and iterative planning, but most deployed systems remain brittle, lack runtime introspection, cannot diagnose their own failure modes, and do not improve over time without human intervention (Cruz, 8 Dec 2025).

A different but compatible motivation comes from runtime semantics. "Climbing Up the Semantic Tower -- at Runtime" argues that software exists at multiple levels of abstraction and that first-class implementations furnish a reflection protocol to navigate this tower at runtime, including changing the underlying implementation of a computation while it is running (Rideau, 1 Jun 2026). In that formulation, reflection is not merely a debugging convenience; it is a way of relating concrete execution to abstract semantics through safe points and implementation witnesses.

Platum extends the same general orientation to runtime enforcement. "From High-Level Types to Low-Level Monitors: Synthesizing Verified Runtime Checkers for MAVLink" describes a pipeline in which high-level declarations are checked by reflection and then compiled into allocation-free runtime monitors, thereby separating specification from verification while preserving executable enforcement (Amorim et al., 4 Apr 2026). A plausible implication is that the phrase "declared reflective runtime protocol" now denotes not one single formalism, but a family of designs sharing two commitments: declaration of runtime-relevant structure at the surface level, and reflection over that structure at execution time.

2. Formal models of declaration and reflection

The most direct formalization of the term appears in the Battleship runtime. There the agent operates in discrete turns t=0,1,2,t=0,1,2,\dots, and at each turn maintains a snapshot StS_t comprising a world-model belief state WtW_t, prediction records Pt\mathcal{P}_t, two exponential-moving-average error trackers, a low-confidence streak counter t\ell_t, a cooldown counter ctc_t, policy parameters Θt\Theta_t, and revision presets and flags (Jung et al., 8 Apr 2026). From this snapshot the runtime computes declarative signals such as

etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},

and

c ⁣ft  =  1    etpred+etcal2[0,1].c\!f_t \;=\; 1 \;-\; \frac{e^{\mathrm{pred}}_t + e^{\mathrm{cal}}_t}{2}\quad\in[0,1].

These in turn define predicates such as confidentt\mathrm{confident}_t, StS_t0, StS_t1, StS_t2, StS_t3, and StS_t4, all of which are externalized in the runtime and can be queried at any point (Jung et al., 8 Apr 2026).

VIGIL expresses reflection through a different formal object: a deterministic finite-state machine

StS_t5

with

StS_t6

stage-completion events StS_t7, initial state StS_t8, and unique final state StS_t9 (Cruz, 8 Dec 2025). The transition function is partial: valid stage completions advance the runtime only if the corresponding guard predicate succeeds, while WtW_t0 sends any non-error state to WtW_t1. All other WtW_t2 pairs are undefined and raise an explicit StageOutOfOrder error rather than allowing the LLM to improvise (Cruz, 8 Dec 2025).

Rideau’s runtime reflection protocol lifts the formal level again. An implementation of a source language WtW_t3 by a concrete language or machine WtW_t4 is defined as a triple WtW_t5, where WtW_t6 is a full subcategory of observable or safe-point states and WtW_t7 is a functor (Rideau, 1 Jun 2026). Runtime reflection then consists in operations that move between the concrete and abstract levels, notably observe, control, and advance. In that setting, declaration takes the form of explicit implementation witnesses, while reflection consists of navigating the semantic tower through those witnesses.

3. Safe points, guarded actions, and transition discipline

Across these systems, reflection is constrained by explicit admissibility conditions. In the semantic-tower formulation, the central notion is the generalized safe point. A concrete fragment WtW_t8 may be observed only if one can continue to a state WtW_t9 by a continuation Pt\mathcal{P}_t0 such that Pt\mathcal{P}_t1 and the composed concrete behavior corresponds to an abstract step Pt\mathcal{P}_t2 under Pt\mathcal{P}_t3 (Rideau, 1 Jun 2026). The extracted API method

Pt\mathcal{P}_t4

encodes this obligation operationally. The primitives climb, descend, and advance therefore presuppose proof-bearing observability, completeness, and liveness conditions rather than unconstrained introspection (Rideau, 1 Jun 2026).

The Battleship runtime uses a declarative guarded-action calculus. Actions are defined in the form action A available when CONDITION: EFFECTS, and hypothetical transitions are supplied by

Pt\mathcal{P}_t5

which returns the predicted next snapshot if action Pt\mathcal{P}_t6 were executed without committing to it (Jung et al., 8 Apr 2026). Planning, prediction, execution, reconciliation, and reflection are therefore kept in a single runtime loop while remaining explicitly separable. The reference implementation exposes interfaces such as predict(Snapshot s, Action a) → Snapshot s', observe(Snapshot s, Action a, Outcome o) → Snapshot s_plus, and applyRevision(Snapshot s, Revision r) → Snapshot s_rev (Jung et al., 8 Apr 2026).

VIGIL is stricter still. It functions as a state-gated pipeline in which appraise, diagnose, prompt-patch generation, and code-diff generation are separate stages. Illegal stage transitions raise StageOutOfOrder; prompt-update attempts that touch CORE_IDENTITY raise GuardViolation; and schema mismatches or runtime errors inside diagnose_rbt() are caught as InternalSchemaConflict (Cruz, 8 Dec 2025). A recurring theme is that runtime reflection is permitted only at explicitly delimited points and under explicit guards.

4. Declared structure, verification, and synthesis

Platum gives the clearest example of declaration preceding reflection and code generation. Its deep-embedded DSL for global session types uses a grammar with end, internally selected choice, recursive binders, and recursive calls: Pt\mathcal{P}_t7 Each interaction carries exactly five semantic components: sender, receiver, label, payload variable, and refinement predicate (Amorim et al., 4 Apr 2026).

Reflection occurs in Meta-F*, where the AST is traversed to check four boolean invariants Pt\mathcal{P}_t8: label uniqueness, guarded recursion, global progress, and session fidelity. The well-formedness check is

Pt\mathcal{P}_t9

Once these checks succeed, the AST is reflectively extracted into an IR graph t\ell_t0 and then translated to a flat, allocation-free C switch-based FSM (Amorim et al., 4 Apr 2026). At runtime, monitor_step decodes an incoming packet, inspects msgid, evaluates the compiled C guard, updates monitor context and state on success, and flags a protocol violation on failure or no matching branch. Proof terms and logical refinements exist only at compile time; at extraction time they are erased and reified into ordinary boolean C expressions (Amorim et al., 4 Apr 2026).

VIGIL applies an analogous discipline to prompt adaptation. Its prompt template is split into immutable BEGIN_CORE_IDENTITY ... END_CORE_IDENTITY and mutable BEGIN_ADAPTIVE_SECTION ... END_ADAPTIVE_SECTION blocks. Before a patch is applied, checksums t\ell_t1 and t\ell_t2 of the core block are compared, and if they differ the runtime aborts with GuardViolation: t\ell_t3 The patch generator may rewrite only the adaptive section, preserving identity semantics by disallowing insertions, deletions, or token replacements outside those delimiters (Cruz, 8 Dec 2025). This suggests a common architectural pattern: declared regions delimit what reflection may inspect or rewrite, and guards make violations explicit.

5. Reflective diagnosis, self-repair, and revision

VIGIL is a reflective runtime for self-healing agents rather than task execution. It supervises a sibling agent, ingests behavioral logs, appraises each event into a structured emotional representation, maintains a persistent EmoBank with decay and contextual policies, and derives an RBT diagnosis that sorts recent behavior into strengths, opportunities, and failures (Cruz, 8 Dec 2025). Its deterministic appraisal function maps an event t\ell_t4 to t\ell_t5, where emotion lies in t\ell_t6, valence t\ell_t7, intensity t\ell_t8, and cause t\ell_t9. The decayed intensity read from EmoBank is

ctc_t0

with default ctc_t1 hours (Cruz, 8 Dec 2025).

The same system defines policy rules for storage and diagnosis. A new appraisal is stored iff ctc_t2 or the sign of its valence differs from the previous one; near-duplicate entries within ctc_t3 minutes are coalesced with ctc_t4; and if a positive-valence event follows a negative-valence one within ctc_t5 minutes, a synthetic determination entry with ctc_t6 and ctc_t7 is appended (Cruz, 8 Dec 2025). The RBT partition then classifies high-intensity positive emotions as Roses, curiosity or positive cues as Buds, and frustration or anxiety above threshold as Thorns (Cruz, 8 Dec 2025). From this diagnosis, VIGIL generates guarded prompt updates and read-only code proposals through a strategy engine that scans repository hotspots and emits unified diffs without mutating the working tree (Cruz, 8 Dec 2025).

The Battleship runtime instantiates reflection differently: as symbolic in-episode revision and sparse LLM-based revision. The four layers are belief tracking only, explicit world-model planning (WMA), symbolic in-episode reflection (MRA), and sparse LLM-based revision (MRA-LLM) (Jung et al., 8 Apr 2026). Because all state and signals are declared, these layers can be toggled independently. In the reported evaluation over 54 games, explicit world-model planning improves substantially over a greedy posterior-following baseline by ctc_t8 percentage points in win rate and ctc_t9 in Θt\Theta_t0; symbolic reflection operates as a real runtime mechanism with prediction tracking, confidence gating, and guarded revision actions, even though its current revision presets are not yet net-positive in aggregate; and adding conditional LLM revision at about Θt\Theta_t1 of turns yields a small and non-monotonic change, with average Θt\Theta_t2 rising slightly by Θt\Theta_t3 while win rate drops from Θt\Theta_t4 to Θt\Theta_t5 wins out of Θt\Theta_t6 (Jung et al., 8 Apr 2026). The runtime therefore makes it possible to study revision as an explicit mechanism rather than as an inseparable property of one language-model loop.

6. Implementations, applications, and points of distinction

The principal implementations differ in domain but share the same reflective discipline.

Work Declared object Runtime consequence
VIGIL (Cruz, 8 Dec 2025) stage-gated maintenance pipeline prompt patches and read-only code proposals
Semantic tower protocol (Rideau, 1 Jun 2026) first-class implementation Θt\Theta_t7 climb, descend, advance, simulate, perform
Platum (Amorim et al., 4 Apr 2026) global session type DSL flat, allocation-free C FSM monitor
Battleship runtime (Jung et al., 8 Apr 2026) snapshot, signals, guarded actions inspectable planning and revision loop

The application scenarios are correspondingly heterogeneous. VIGIL reports a reminder latency case study in which elevated lag was identified, prompt and code repairs were proposed, and an internal diagnostic-tool failure caused by a schema conflict was itself surfaced, followed by a fallback diagnosis and repair plan (Cruz, 8 Dec 2025). Rideau’s semantic-tower protocol uses thread migration between two Scheme virtual machines as a motivating example: one climbs from a live thread state in Θt\Theta_t8 to an abstract step in Θt\Theta_t9, then descends into etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},0, with observability and completeness ensuring preservation of high-level behavior (Rideau, 1 Jun 2026). Platum targets centralized proxy monitors at the GCS/UAV communication boundary for MAVLink, and evaluates monitor latency and memory overhead in ArduPilot SITL, reporting etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},1 total latency and etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},2 logic delta for Platum, versus etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},3 total latency and etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},4 logic delta for DATUM, with Platum’s RSS delta at etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},5 MB and DATUM’s at etpred=α  o^tot+(1α)  et1pred,e^{\mathrm{pred}}_{t} = \alpha\;\bigl|\hat o_{t} - o_{t}\bigr| +(1-\alpha)\;e^{\mathrm{pred}}_{t-1},6 MB (Amorim et al., 4 Apr 2026).

Several common misconceptions are directly addressed by this literature. First, a declared reflective runtime protocol is not synonymous with unrestricted self-modification: VIGIL permits only guarded prompt patches inside an adaptive section and emits code diffs under read-only rules, while Rideau’s protocol allows reflection only through safe points and implementation witnesses (Cruz, 8 Dec 2025, Rideau, 1 Jun 2026). Second, it is not equivalent to embedding reflection in an LLM prompt. The Battleship system explicitly externalizes confidence signals, hypothetical transitions, and revision conditions, and shows that symbolic reflection can run without any LLM calls, while sparse LLM revision is invoked only when its guards fire (Jung et al., 8 Apr 2026). Third, it is not limited to agent planning. The same architectural idea appears in verified network monitors and in runtime movement across abstraction levels in a semantic tower (Amorim et al., 4 Apr 2026, Rideau, 1 Jun 2026).

A plausible implication is that declared reflective runtime protocols are best understood as a unifying systems idiom rather than a single algorithm: declaration fixes the surface structure over which the runtime may reason, and reflection supplies the mechanisms—observation, verification, guarded adaptation, or repair—by which that structure is used during execution.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Declared Reflective Runtime Protocol.