Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

FormaSL — Reactive Activation Contract (RAC)

Status: STABLE Authority: NORMATIVE ARCHITECTURAL DECISION CONTRACT — reactive execution boundary Ratification: owner dispatch 2026-09-30 — “RAC-01 autorizado conceitualmente com as emendas A1/A2” (see §12) Parent: ../FORMASL.md Depends on: ../foundations/FORMASL-INTENT.md, ../foundations/FORMAL-WORLD-MODEL.md, ../foundations/SEMANTIC-INVARIANTS.md, ../foundations/SEMANTIC-CONTINUITY.md, EFFECT-OBSERVATION-CLAIM.md, EXECUTABLE-SEMANTIC-INTERFACE-CONTRACT.md (§13), P5AR-C-REPRESENTATION-IMPLEMENTATION-CONTRACTS.md (§CHG), COMPUTATIONAL-REGIME-BOUNDARIES.md, SEMANTIC-LIFECYCLE-TRANSITIONS.md, SITUATED-RESULT-CONTRACT.md Role: freeze the reactive activation boundary — reactivity over complete, basis-sealed evaluations only — without opening incremental/streaming semantic consumption (FO-L5-12 / FO-P3-14), without new concrete syntax, and without a second event engine.


1. Core decision

The normative core of this contract:

FormaSL reactive execution schedules new, basis-sealed evaluations in
response to recoverably detected changes in material dependencies.
Reactive activation does not itself introduce semantic standing,
establish semantic causation, consume incomplete semantic results, or
authorize category-changing effects. Each activated evaluation executes
under the existing semantic contracts and produces only the
result/lifecycle standings those contracts already authorize.

The admitted shape:

change
  → affected
  → activation gate
  → NEW sealed EvaluationInstance
  → ordinary FormaSL evaluation
  → complete/material result
  → downstream change notification
  → (loop)

The rejected shape:

event → magic callback → arbitrary side effect

Reactivity is therefore a runtime/architectural capability, not a language extension at this stage. The semantic content of any activated evaluation is exactly what the existing contracts already authorize; the reactive layer adds scheduling, not standing.

2. What reactive activation is

Conceptually, an ActivationEngine:

  1. receives ChangeNotifications from heterogeneous ChangeSources;
  2. computes the AffectedSet by intersecting changed coordinates with registered dependencies (pure operational invalidation);
  3. applies an ActivationGate (activation policy, admission, current basis, availability, completion conditions);
  4. seals a NEW EvaluationInstance for each activation (never mutates a running evaluation — P3-O-20);
  5. the sealed evaluation runs as an ordinary evaluation and completes under the existing completion contracts;
  6. its completed material result may itself become a downstream ChangeNotification (propagation).

ChangeSources include, without being limited to:

watch streams / state commits
observation acquisition (post-bridge)
external adapters (post-verification)
source publication
runtime results (completed evaluations)
timers (as declared reevaluation policy, never as premise)
manual invocation

The model is two-phase:

Phase 1 — invalidation (operational, no execution):
    Change → Dependency Index → AffectedSet

Phase 2 — activation (gated):
    AffectedSet + activation policy + basis + admission
    + availability + completion conditions → Activation

Activation candidates arise from invalidation and from declared reevaluation policies (e.g. periodic/timer-driven reevaluation). In every case the gate applies; a timer tick with no changed coordinates produces no AffectedSet entry — it can only become a candidate through a declared policy.

3. What reactive activation is not

ReactiveReevaluation    -/-> IncrementalSemanticConsumption   (FO-L5-12 stays closed)
ReactiveReevaluation    -/-> StreamingSemanticConsumption     (EXECUTABLE-SEMANTIC-INTERFACE-CONTRACT §13)
Activation              -/-> SemanticCausation
ChangeNotification      -/-> Standing
ReactiveFeedback        -/-> RecursiveComposition
ActivationEngine        -/-> UniversalEventEngine / WorkflowEngine
Result                  -/-> Effect (automatic conversion prohibited)

A consumer never begins producing from a producer’s unfinished prefix. Every activated evaluation consumes only established, completed material. Long-lived runtimes are sequences of finite evaluations, not an infinite evaluation.

4. Definitions

ChangeSource            any origin that may emit a ChangeNotification
ChangeNotification      mechanism data about detected change; carries
                        recovery coordinates; has no standing
ChangedCoordinates(Δ)   the coordinates material to the change
DependencyIndex         registry of Dependencies(E) per application/evaluation
AffectedSet(Δ)          evaluations/applications whose dependencies intersect Δ
ActivationGate          policy gate between AffectedSet and Activation
Activation              decision to seal a new EvaluationInstance
MaterialDependency      a dependency that is semantically material to an
                        evaluation's result (static or dynamic, §6)
RecoveryRegime          the declared regime by which an activation source
                        supports restart: LevelSensitive or OccurrenceSensitive
                        (or a declared hybrid)
InternalDerivedConsequence  an intermediate derivation inside an evaluation's
                            fixpoint; never an operational coordinate
CompletedMaterialResult a completed, exported result under its declared
                        result/data-dependence interface

5. Laws

LeiRegra
RAC-L01ReactiveReevaluation != IncrementalSemanticConsumption
RAC-L02Activation != SemanticCausation
RAC-L03ChangeNotification != Event != Claim != Observation != Effect; a notification gains no standing
RAC-L04Affected != Activated
RAC-L05DataDependence -> ActivationCandidate — never execution order, never mandatory execution
RAC-L06Trigger != Premise — a wakeup may provoke evaluation without contributing a fact to the semantic world
RAC-L07mechanical time does not create temporal standing; material time enters only through the temporal interface
RAC-L08coalescing only when the consumption profile admits reevaluation against current state; occurrence identity is not erased when material
RAC-L09ReactiveFeedback != RecursiveComposition; LongLivedRuntime != InfiniteSemanticEvaluation
RAC-L10activation/index state is reconstructible; recovery uses occurrence replay when occurrence-sensitive, state resync when level-sensitive, per declared contract
RAC-L11InternalDerivedConsequence -/-> IndependentChangeAuthority; a CompletedMaterialResult may be a downstream dependency/change coordinate only through its declared result/data-dependence interface
RAC-L01 — Reactive reevaluation is not incremental semantic consumption
  Each activation re-executes a complete evaluation over a fresh sealed basis.
  No consumer ever consumes a partial/incomplete semantic result. FO-L5-12
  (CHG-1) remains UNSUPPORTED / ABSENT-FROM-VOCABULARY, enforced by
  conformance (chg_absence); EXECUTABLE-SEMANTIC-INTERFACE-CONTRACT §13
  (StreamingTransport -/-> IncrementalSemanticConsumption) is untouched.

RAC-L02 — Activation is not semantic causation
  That a change made an evaluation a candidate, or that an evaluation ran
  after another, establishes no causal or authority relation. Causal standing
  continues to require CausalBasisRef under the existing dependence contracts;
  temporal precedence is not semantic dependence (INV-TIME-02).

RAC-L03 — ChangeNotification has no standing
  ChangeNotification/ChangeSet are mechanism data. They are not Events,
  Claims, Observations, Effects or Results, and never enter a world as facts.
  Semantic standing continues to be introduced only by the existing routes:
  claim lifecycle transitions, ObservationBridge (OBG-5), and the carrier
  disciplines of EFFECT-OBSERVATION-CLAIM.

RAC-L04 — Affected is not Activated
  Invalidation only names candidates. An affected application may be
  inactive, out of scope, disabled, waiting on another dependency, or already
  covered by an admissible equivalent evaluation. Only the ActivationGate
  activates. Duplicate affected-set entries may coalesce at the gate (RAC-L08).

RAC-L05 — DataDependence yields candidacy, not order
  The existing distinction DataDependence != SemanticOrder != SourceTextOrder
  != RuntimeSchedule (compose) is preserved and extended operationally:
  a data dependence from producer P to consumer C makes C an activation
  candidate when P's completed result changes. It never implies that C must
  run, must run now, or runs after P in any authority sense.

RAC-L06 — Trigger is not premise
  A wakeup, watch ping or wake event may provoke reevaluation while its
  content contributes nothing to the semantic world (the K5 law generalized:
  ExternalEffect never updates CurrentObserved; only ExplicitObservation
  sustains the observed). Level-triggered consumers re-read current state.

RAC-L07 — Mechanical time creates no temporal standing
  A timer tick is a trigger under a declared reevaluation policy, never a
  premise and never a coordinate of change. Material time continues to enter
  only through the temporal interface (formasl-time: ClockReading, guards,
  TemporalStanding {Holds, Fails, Incommensurable}; carrier timestamps such
  as observed_at/recorded_at). A reading is never standing.

RAC-L08 — Coalescing respects consumption profile
  Repeated notifications for the same coordinates may coalesce into one
  reevaluation against the latest basis only when the application's
  consumption profile is declarative re-derivation (level-sensitive).
  When occurrences are material (occurrence-sensitive), coalescing must not
  erase occurrence identity; each occurrence remains separately addressable.
  This behavior is derived from the consumption profile where possible; it is
  not a public surface enumeration at this stage.

RAC-L09 — Feedback across time is not recursion; longevity is not infinity
  Evaluation A1 → world change → Evaluation B1 → world change → Evaluation A2
  are distinct evaluations at distinct times; no composition invocation cycle
  A → B → C → A is introduced, and OrdinaryCompositionCycle continues to
  require ExplicitIterationOrRecursionContract. A runtime may serve for
  months, but each observable unit remains Activation → EvaluationInstance →
  completion — finite.

RAC-L10 — Restart safety requires recoverable activation basis
  The dependency index and activation metadata are caches, reconstructible;
  they are not authority over world state. Recovery is regime-declared:
    LevelSensitive      → resync: re-read current basis/state, reconcile
                          (missed notifications need not be enumerated)
    OccurrenceSensitive → durable occurrence identity + replayable position
                          + ack/progress; lost occurrences are recoverable
                          by replay, never reconstructed from current state
    Hybrid (declared)   → cursor replay + periodic authoritative resync;
                          a cursor alone is not authority over world state
  There is no universal cursor field. Durable change lives in the existing
  substrate feeds (storage watch streams with distinct
  occurrence/delivery/acknowledgement; FormaFS change feed ordinals; the
  append-only lifecycle history); the reactive layer consumes them, never
  replaces them.

RAC-L11 — Internal derived consequences are not change authorities
  InternalDerivedConsequence -/-> IndependentChangeAuthority. An intermediate
  derivation inside a fixpoint never becomes an operational event or
  independent invalidation coordinate. A CompletedMaterialResult may
  establish a downstream invalidation coordinate only through its declared
  result/data-dependence interface (compose DataDependence; result
  contracts). This closes propagation Δ → A → completed result → B without
  turning A's interior into a semantic stream.

6. Dependency coordinate model

Coordinates are material change addresses. The index operates over three logical classes (the implementation may compress them, the semantics may not):

C1  Input / basis coordinates
      admitted observations, source state revisions, application state,
      policy/model revisions, established occurrences, claim lifecycle
      transitions

C2  Result coordinates
      completed application/result identities, exported relation/result
      channels — reachable only via the result/data-dependence interface
      (RAC-L11)

C3  Dynamic concrete dependencies
      state key + version + basis (StateReadSet), exact revision refs,
      concrete subjects/resources when material

Dependency extraction is two-level:

Static semantic dependency   from program/plan: predicates, types, channels
                             (DataDependence {producer_step, consumer_step};
                             declared result channels)
Dynamic concrete dependency  from each evaluation: StateReadSet
                             {key, version, basis, presence}

The affected relation:

Dependencies(E) = StaticSemanticDeps(E) ∪ DynamicConcreteDeps(E)

Affected(E, Δ)  iff  Dependencies(E) ∩ ChangedCoordinates(Δ) ≠ ∅

Category rules:

  • Changed coordinates live in C1/C2/C3; internal fixpoint intermediates are not coordinates (RAC-L11).
  • Storage keys are not semantic coordinates: a storage-key change must be projected to semantic coordinates by the source’s declared interface before it can affect statically registered semantic dependencies (and vice versa, concrete key-level invalidation uses C3).
  • A single admitted input change may legitimately propagate through completed results (C2) and cascade: Δ → A → completed result → B. Each hop is a complete evaluation; the cascade is scheduling, not one running computation.

7. Recovery coordinates on notifications

Abstract obligation (no universal cursor field is frozen):

ChangeNotification must preserve/refer to enough recovery coordinates
for its activation source's declared recovery regime.

Always present:
    source identity
    basis/revision
    changed coordinates

When the source's declared regime requires:
    occurrence identity
    source position/cursor
    sequence/watermark

Level-sensitive sources may satisfy this with state coordinates alone; occurrence-sensitive sources must carry occurrence identity and position. The substrate feeds already distinguish occurrence from delivery from acknowledgement, and FormaFS already provides monotonic ordinals and cursors; RAC consumes these disciplines rather than inventing a new one.

8. Effects remain outside the automatism

The reactive layer never converts a result into an effect. The chain remains:

RiskDetected
  → Decision (e.g. DecideBlock)
  → AuthorizationDecision
  → ExecutionRequest
  → effectuation (GovernedExecutor / carrier discipline)

The ActivationEngine may activate the application that requests execution; it cannot authorize, execute, or mint effect standing. External effect feedback re-enters only through the epistemic boundary: transport receipt → verification/acquisition → bridge → ObservationRecord → optional claim (OBG-1..5; DecodeEvidenceBridge; OneTimeEffectPermit keyed by EffectKey{case_key, external_occurrence}; ExternalStateReadback where state standing is required). “Signature valid” still does not establish business truth.

9. Non-openings

RAC-01 explicitly does not reopen:

FO-L5-12  incremental / streaming semantic consumption        (CHG-1, stays UNSUPPORTED)
FO-P3-14  runtime/JIT semantic-fragment generation            (CHG-2, stays CH)
concrete FormaSL syntax
reasoning semantics
universal event sourcing
universal event store
universal durable queue
universal cursor protocol
universal workflow engine

and does not introduce any surface form:

on Event { ... }
trigger ...
subscribe ...
Stream<Result>
IncrementalResult

The composition cycle contract is untouched (OrdinaryCompositionCycle requires ExplicitIterationOrRecursionContract). Reactive feedback across time consists of distinct evaluations, not composition recursion (RAC-L09).

10. Relationship to existing artifacts

Verified precursors this contract builds on (all inspected, not assumed):

crates/runtime/src/runtime.rs            EvaluationInstance sealed over plan +
                                         EvaluationSemanticClosure + dynamic
                                         basis; rebind materializes a NEW
                                         instance; no rebind-in-place (P3-O-20)
crates/application-state/src/read_set.rs StateDependency {key, version, basis},
                                         StateReadResult {present} (contract §26;
                                         versions prevent ABA)
crates/application-state/src/projector.rs
                                         StateTransitionOccurrence
                                         {reference, affected_keys},
                                         StateTransitionOrdinal(u64)
crates/compose/src/compose.rs            DataDependence != SemanticOrder !=
                                         SourceTextOrder != RuntimeSchedule;
                                         DataDependence {producer_step,
                                         consumer_step}
crates/storage (watch_stream)            occurrence / delivery / acknowledgement
                                         distinct identities; duplicate delivery
                                         never duplicates occurrence
crates/formafs-core (change.rs)          FormaFsChange feed, monotonic ordinal,
                                         FormaFsCursor
crates/lifecycle (history.rs)            append-only history chain; replay does
                                         not create occurrences
crates/time (formasl-time)               ClockReading + domain, guard predicates,
                                         TemporalStanding; a reading is never
                                         standing
crates/mrs-terminal                      DecodeEvidenceBridge,
                                         OneTimeEffectPermit (EffectKey),
                                         ExternalStateReadback {observed_at}
crates/action (action.rs)                ActionJournal carriers; EffectRecord
                                         requires CausalBasisRef;
                                         ObservationRecord only via
                                         ObservationBridge (OBG-5)
docs/applications/forma-kubernetes/...   K5 law: ExternalEffect never updates
reconciliation-k5.md                     CurrentObserved; only
                                         ExplicitObservation sustains the
                                         observed

Consistency obligations inherited: INV-TIME-01 (temporal roles remain distinct), INV-TIME-02 (temporal precedence is not semantic dependence), INV-TIME-03 (revision does not erase prior occurrence); the Record-vs-Standing discipline of EFFECT-OBSERVATION-CLAIM.md; the anti-commitments of FORMASL-INTENT.md (no required event store, no OCCUR operator, no event-sourced runtime) — RAC adds an operational capability on top of existing carriers; it does not promote notifications, cursors or indices to semantic authority.

11. What this contract does not specify

Deferred, in order:

RAC-02  Dependency, Invalidation & Recovery Contract
        StaticDependencyCoordinate / DynamicDependencyCoordinate /
        ResultDependencyCoordinate binding; ChangedCoordinates vocabulary;
        Affected(E, Δ) operational definition; dependency registration and
        invalidation mechanics; staleness; coalescing eligibility rules;
        level-sensitive recovery protocol; occurrence-sensitive recovery
        protocol; restart / lost notification / duplicate notification /
        out-of-order notification / resync obligations.
        Dependency and recovery are specified together (owner amendment).

then    RAC-03 dependency extraction wiring
        RAC-04 invalidation engine
        RAC-05 activation gate + propagation
        RAC-06 external ingress (adapters / observation / watches)
        RAC-07 external effect feedback (requests / effectuation /
               observation loop)
        RAC-08 reliability (coalescing, occurrence identity, lost wakeup,
               resync, retry, backpressure)
then    scheduler / continuous host design

RAC-01 itself introduces no code obligations; the CHG-1/CHG-2 absence checks continue to hold unchanged.

12. Amendment record

A1 (owner, 2026-09-30)  Origin vs reactive result. The earlier draft rule
                        "derived atoms are not change coordinates" was
                        replaced: derived results that are completed and
                        exported may legitimately propagate (a completed
                        InferFraud result is exactly DecideBlock's
                        dependency). Frozen as RAC-L11 with the three-class
                        coordinate model (§6).

A2 (owner, 2026-09-30)  Recovery is not universally cursor-based. Level-
                        sensitive consumers recover by resync (read current
                        state, reconcile — missed notifications need not be
                        enumerated); occurrence-sensitive consumers require
                        durable occurrence identity and replayable position;
                        hybrids are declared, not universal. Cursor became a
                        conditional recovery coordinate (§7), not a
                        mandatory ChangeSet field. Frozen as RAC-L10.