proto.computer / section 3

rust dsl and runtime algebra

this section is the rust-land contract doc. it turns the boundary spec into an implementation-facing split: authored world and set, compiled world and set, durable runtime truth, and viewer frames. the first build target stays viewer-first, but the viewer is forced to read contract-backed world truth instead of inventing its own ontology.

authored world + set → compiled world + set → runtime truth → viewer frame protobuf first, rust embedded, stable type names explicit bind/birth, lane policy, authority, discharge

3.0 thesis

authored world + authored set → compiled world + compiled set → runtime truth → viewer frame
admit → route → spawn → place → decide → commit → measure → render

this is a clean break from the older pre-reset proto model. proto/core/primitives.proto remains legacy reference only; new work does not try to map back through interface / stream / workflow / mint as the primary ontology. the new basis is the boundary/runtime split described in section 1 and the finexa mapping in section 2.

first build target

compile a finexa authored world into scene-ready compiled data, then drive the viewer with mocked live overlays that already obey the runtime contract shapes. no visual object is allowed to imply new world truth.

naming + versioning

rust type names stay stable and unsuffixed. versioning lives in artifact metadata via schema_edition, crate semver, content hash, and optional git commit. persisted data migrates by edition and hash, not by spraying V1 through the type system.

3.1 artifact families and ownership

family protobuf package root artifacts who produces it persistence rule
authored proto.world.authored AuthoredWorld, AuthoredSet rust builder dsl durable source-of-truth input
compiled proto.world.compiled CompiledWorld, CompiledSet world compiler durable deterministic output
runtime proto.world.runtime Datum, RouteSelection, Attempt, LaneKey, Proposal, Receipt, RecordEnvelope, ObligationEnvelope, DischargeReceipt, ReplayInput machinery and readout pipeline durable where noted below; authoritative truth lives in records and obligations, not viewer state
viewer proto.world.viewer ViewerFrame viewer adapter or mocked viewer harness derived frame contract; may be transient or mocked, but must reference compiled ids and runtime truth
every root artifact carries ArtifactMeta { schema_edition, producer_semver, schema_hash, git_commit? }

ArtifactMeta is the shared root header across families. codegen may place it in a small helper proto if that makes imports cleaner, but the semantic split remains these four families.

section 3 freezes one authored split that the compiler must preserve: PortBinding owns boundary composition, FieldBinding owns proto-field maintenance, and ProtoBay owns local identity bind/birth plus lane/authority defaults.

concern declared in resolved in durable / derived / mocked
sources, ports, port bindings, faces, protos, field bindings, bays, processes, routes, effects, projections AuthoredWorld CompiledWorld authored then durable compiled
districts, anchors, tracks, docks, screens, authored layout hints AuthoredSet CompiledSet authored then durable compiled
ids, references, lane keys, authority matrix, discharge rules, default edges, default layout handles not hand-authored CompiledWorld and CompiledSet compiled deterministic output
attempts, receipts, records, obligations, discharge receipts, replay inputs runtime operators proto.world.runtime durable runtime truth
selection, hover, camera, mocked lag and pulses, live overlays viewer harness or runtime adapter ViewerFrame derived or mocked; never authoritative business truth

3.2 rust-embedded dsl

this is the authored contract surface. rust authors typed semantic and set artifacts, protobuf serializes them, and the compiler lowers them into deterministic compiled artifacts. authored ids are stable semantic slugs such as credit_request and activation.credit.create; compiled and runtime artifacts receive UUIDv7 object ids later. name is display metadata, not the authored reference.

semantic layer

rust authors world law through typed, macro-light builders. boundary composition lives on Port and PortBinding; field hydration lives on Proto and FieldBinding; identity crossing lives on ProtoBay; boundary admission lives on Face and Ruleset; process motion and obligations live on Process, Route, and Effect.

set layer

SetSpec is a sibling dsl, not a second ontology. it places districts, faces, anchors, tracks, docks, screens, and camera/lens hints using district-local 3d coordinates. compiler-only pieces such as conduits, gates, switches, chambers, relation bridges, overlay channels, and default labels stay derived.

authored semantic ids → compiled resolved ids → runtime uuidv7 envelopes → viewer frame references
boundary composition belongs to Port + PortBinding; field maintenance belongs to Proto + FieldBinding; identity crossing belongs to ProtoBay

semantic layer

WorldSpec

root authored world artifact. it gathers all semantic nouns, shared defaults, and schema metadata for one world.

  • Authored fields. id slug, optional name, schema_edition, thesis/principles, world-default authority and discharge defaults, plus collections of sources, ports, faces, rulesets, protos, proto bays, processes, routes, effects, and projections. ports carry nested PortBinding values; protos carry nested FieldBinding values.
  • Compiler derives. normalized ids, reference tables, schema hashes, compiled lookup indices, and cross-object validation graphs.
  • Invariants. every referenced slug must exist exactly once; authored slugs are stable semantic references; display names cannot be used as identifiers.
  • Contracts. serializes to AuthoredWorld; compiles into CompiledWorld.
let world = WorldSpec::new("finexa_credit_world")
    .schema_edition("2026.q1")
    .name("finexa credit ops world")
    .source(Source::http_surface("qr_campaign_surface"))
    .proto(Proto::new("credit_request"))
    .route(Route::new("origination.request.submit"));
Source

declares one outside system or material origin on the far side of the world boundary.

  • Authored fields. id, optional name, kind, emitted material kinds, delivery mode, connection/auth hints, and trust classification.
  • Compiler derives. source registry entries, capability tables, and admissible port-binding plus face compatibility validations.
  • Invariants. a source is external topology, not business ontology; it may emit material but it does not define business truth by itself.
  • Contracts. authored by world builders; referenced by port bindings, faces, field bindings, and effects.
Source::webhook("whatsapp_business_api")
    .emits(["chat_event", "flow_submission", "delivery_receipt"])
    .trust("signed_vendor_boundary");
Port

declares one deployed contact point where source material is caught or outbound obligations are delivered.

  • Authored fields. id, optional name, direction, transport family, deployment hints, nested PortBinding values, and allowed faces or effect faces.
  • Compiler derives. concrete ingress/egress binding tables, capability maps, and compatibility checks against sources, faces, and effects.
  • Invariants. port catch is not semantic admission; port direction and allowed face usage must be explicit; every real boundary crossing must name at least one PortBinding.
  • Contracts. referenced by Face, outbound effect definitions, and compiled delivery policies.
Port::https("finexa_http_ingress")
    .binding(PortBinding::new("whatsapp_flow_in")
        .source("whatsapp_business_api")
        .parser("flow_submission")
        .matcher("request_ref_and_phone")
        .trust_posture("signed_vendor_boundary"))
    .routes_to_faces(["qr_entry", "whatsapp_chat", "whatsapp_flow", "trello_pipeline"]);
PortBinding

declares one concrete boundary composition on a port. this is where source composition becomes typed law instead of folklore.

  • Authored fields. id, optional name, direction, source_ref, source_kind, credential/auth contract, protocol, parser, material contract, matcher, admit policy, bind rule, birth rule, effect policy, deployment, and trust posture.
  • Compiler derives. executable ingress/egress adapter plans, boundary validation tables, typed material contracts, and source-to-face/effect compatibility indices.
  • Invariants. PortBinding owns boundary composition only. it may normalize, authenticate, parse, match, and classify source material, but it does not maintain business fields and it does not decide local identity beyond the authored bind/birth hooks it exposes to ProtoBay.
  • Source composition semantics. the canonical authored model is source_kind + credential + protocol + parser + matcher + admit_policy + bind_rule + birth_rule + effect_policy + deployment + trust_posture.
  • Contracts. nested under Port; compiles into compiled_port_bindings and the boundary side of admission/discharge machinery.
PortBinding::new("trello_pipeline_watch")
    .direction("ingress")
    .source("trello")
    .source_kind("board_watch")
    .credential("oauth_workspace_token")
    .protocol("https_webhook")
    .parser("trello_card_event")
    .material_contract("trello.pipeline.event")
    .matcher("list_and_label_match")
    .admit_policy("mapped_operator_action_only")
    .bind_rule("credit_request_keys")
    .birth_rule("deny")
    .deployment("mx-prod-west")
    .trust_posture("operator_observation_only");
Face

declares the semantic aperture where caught material becomes candidate datum under authored rules.

  • Authored fields. id, kind, source refs, port refs, optional port-binding refs, ruleset ref, target proto bays, optional admitted datum kinds, and reject/quarantine outlets.
  • Compiler derives. face dispatch tables, admissible route families, admission tracing handles, and face-to-boundary compatibility checks.
  • Invariants. a face may admit many raw shapes, but it must have one explicit ruleset boundary and target proto bay set. if a face relies on a narrowed boundary composition, it must reference the relevant PortBinding explicitly.
  • Contracts. produces Datum through machinery admit; referenced by routes as datum_face.
Face::write("whatsapp_flow")
    .sources(["whatsapp_business_api"])
    .ports(["finexa_http_ingress"])
    .port_bindings(["whatsapp_flow_in"])
    .ruleset("whatsapp_flow_rules")
    .targets(["party", "credit_request"]);
Ruleset

declares the executable boundary and transformation graph. rulesets are declarative operator DAGs, not opaque blobs.

  • Authored fields. id, face or effect context, optional boundary contract refs, stage graph, input datum or payload contracts, output contracts, schema/version handling, and explicit operator nodes.
  • Required operators. map, filter, join, window, aggregate, project, schema_map, quarantine, reject.
  • Compiler derives. executable stage DAGs, contract validation, and compiled operator plans.
  • Invariants. every ruleset path terminates in admit, reject, or quarantine; schema version handling cannot be implicit folklore.
  • Contracts. referenced by faces for inbound admission and by field bindings/process transitions for internal maintenance logic.
Ruleset::new("whatsapp_flow_rules")
    .input("flow_submission")
    .stage("schema_map", "version_form_schema")
    .stage("map", "map_form_fields")
    .stage("filter", "require_pending_request_ref")
    .stage("quarantine", "schema_drift_or_missing_identity");
Proto

declares the semantic schema and the maintenance contract for one durable kind. proto is the field-level queryable meaning surface of the world.

  • Authored fields. id, optional name, description, keys, lookups, relations, field set, optional field groups, and maintenance defaults.
  • Compiler derives. compiled schema tables, field hydration plans, relation indices, field-group authority scopes, and validation contracts.
  • Invariants. proto owns schema and field maintenance; it does not own identity crossing. every authored field must declare datatype semantics and one canonical maintenance path.
  • Contracts. serializes into authored schema artifacts; compiles into executable field hydration and readout support.
Proto::new("credit")
    .key("credit_id")
    .lookup("fibo_credit_id")
    .lookup("croop_credit_id")
    .field(ProtoField::string("credit_id").required())
    .field(ProtoField::money("principal_balance").group("balance"))
    .field(ProtoField::enum_("status").group("lifecycle"));
ProtoField

declares one field inside a proto, including type and maintenance semantics.

  • Authored fields. field slug, datatype, cardinality, nullability, default, field group, required-for-shape flag, and derive mode.
  • Derive modes. direct source mapping, ruleset output, join, window, aggregate, projection-fed, or compiler-derived constant/default.
  • Compiler derives. field-level validation, storage shape, hydration plans, and readout dependencies.
  • Invariants. field hydration belongs here with FieldBinding, never inside BindStrategy.
  • Contracts. nested under Proto; referenced by FieldBinding and field-group authority policies.
ProtoField::money("principal_balance")
    .nullable(false)
    .group("balance")
    .derive_mode("aggregate")
    .required_for_shape(true);
FieldBinding

declares how one proto field is maintained from one or more upstream sources or ruleset outputs.

  • Authored fields. target proto field, upstream source refs, face/ruleset outputs, join keys, optional window or aggregate clauses, projection refs, freshness policy, and missing-data behavior.
  • Compiler derives. hydration query plans, execution DAG edges, and staleness guards.
  • Invariants. field maintenance may mix and match multiple upstreams, but it must produce one canonical maintained value path per field.
  • Contracts. nested under Proto; lowered into compiled field hydration/query plans.
FieldBinding::for_field("principal_balance")
    .from_face("croop_api")
    .via_ruleset("croop_api_rules")
    .join_on([("croop_credit_id", "croop_credit_id")])
    .fresh_for("4h")
    .on_missing("preserve_previous_and_raise_drift");
ProtoBay

declares identity crossing for one proto: which faces may approach, how bind precedence works, when birth is allowed, and what lane/authority defaults apply.

  • Authored fields. target proto, intake faces, bind strategy, birth strategy, lane policy, authority default, and quarantine lane or rejection policy.
  • Compiler derives. ordered executable lookup plans, bind tables, lane-key resolvers, and default crossing traces.
  • Invariants. proto bay is identity-only; it does not hydrate arbitrary business fields. every intake face must be declared. bind precedence is ordered and explicit.
  • Contracts. feeds machinery route, place, and commit; compiles into crossing policy.
ProtoBay::new("credit_request")
    .intake(["qr_entry", "whatsapp_chat", "whatsapp_flow", "trello_pipeline"])
    .bind(BindStrategy::by_precedence([
        KeyRef::field("request_id"),
        KeyRef::compound(["qr_context_id", "phone"]),
        KeyRef::field("trello_card_id"),
    ]))
    .birth(BirthStrategy::new().when("commit").requires(["phone"]).shape("minimal_shell").on_fail("quarantine"))
    .lane(LanePolicy::explicit("credit_request/request_id"));
Process

declares one FSM of lawful motion over a durable kind or cross-kind operating track.

  • Authored fields. id, tracked proto or family, statuses, transitions, and optional route attachments.
  • Compiler derives. transition graph validation, status ordering helpers, and viewer track metadata.
  • Invariants. process semantics include statuses, legal transitions, and side effects; process state is not inferred from tool UI drift.
  • Contracts. referenced by routes, compiled track layouts, and runtime readout.
Process::new("risk_review")
    .status(ProcessStatus::new("pending_bureau"))
    .status(ProcessStatus::new("analyst_review"))
    .status(ProcessStatus::terminal("approved"))
    .transition(ProcessTransition::new("analyst_review", "approved"));
ProcessStatus

declares one named process state.

  • Authored fields. status slug, terminal/intermediate kind, optional presentation label, and optional status-local effects or notes.
  • Compiler derives. normalized ordering and track-stop metadata.
  • Invariants. statuses are legal FSM states, not projections of vendor list names.
  • Contracts. nested under Process; referenced by transitions and viewer track rendering.
ProcessStatus::terminal("approved").label("approved")
ProcessTransition

declares one legal edge in a process FSM, including any required side effects or guards.

  • Authored fields. from status, to status, optional guard refs, optional route refs, and side-effect refs.
  • Compiler derives. transition legality tables and route-to-process transition validations.
  • Invariants. transitions are explicit; no route may silently move process state without a declared legal edge.
  • Contracts. nested under Process; consumed by Route and compiled track logic.
ProcessTransition::new("analyst_review", "approved")
    .via_route("risk.review.decide")
    .effects(["notify_mattermost"]);
Route

declares one legal interpretation path for one admitted datum family.

  • Authored fields. id, datum face, eligible datum kind, touched proto bays, process transition, lane policy, commit fact kinds, birth permissions, effects/obligations, authority override, discharge override, and failure/quarantine policy.
  • Compiler derives. dispatch entries, commit-domain plans, effect obligation templates, and validation against process and proto bay law.
  • Invariants. route-level fact kinds are authored explicitly; birth must align with proto bay policy; one admitted route yields one local commit boundary.
  • Contracts. authored route becomes RouteSelection at runtime and drives decide plus commit.
Route::new("activation.credit.create")
    .datum_face("trello_pipeline")
    .datum_kind("normalized_activation_command")
    .touches(["credit", "credit_request"])
    .process_transition("activation:approved->active")
    .lane(LanePolicy::explicit("credit_request/request_id"))
    .commit_facts(["credit.created", "credit_request.linked"])
    .births(["credit"])
    .effects(["create_or_move_trello_card", "sync_to_fibo"])
    .on_fail("quarantine");
Effect

declares one outbound obligation family owed to the outside world.

  • Authored fields. id, effect face, destination source, payload contract, discharge policy, retry/escalation hints, and emitted receipt kinds.
  • Compiler derives. obligation templates, delivery plans, and discharge matchers.
  • Invariants. effects are not hidden side channels; if the world owes it, the effect must be declared and the discharge condition must be named.
  • Contracts. emitted by routes as ObligationEnvelope values; closed by DischargeReceipt.
Effect::new("sync_to_fibo")
    .through_face("fibo_outbound")
    .payload("credit_sync_payload")
    .discharge(DischargePolicy::new().receipt("fibo.accepted").timeout("30m"));
Projection

declares one read surface or derived operational view over durable record.

  • Authored fields. id, source protos or processes, readout intent, refresh mode, and screen affinity.
  • Compiler derives. projection dependencies, readout plans, and viewer screen handles.
  • Invariants. projections are derived readout, not canonical ontology or hidden process law.
  • Contracts. referenced by screens and readout compilation.
Projection::new("active_credits_lens")
    .from_protos(["credit"])
    .from_process("servicing")
    .kind("readout_lens");
LanePolicy

declares how one admitted route resolves to its local serial commit domain.

  • Authored fields. typed lane-key ref (or DSL alias recipe), referenced fields or relation keys, optional fallback lane, and collision behavior.
  • Compiler derives. executable lane-key resolvers and lane conflict detectors.
  • Invariants. lane policy is explicit, not inferred from runtime convenience. equal bind results must yield equal lane keys.
  • Contracts. lowered into compiled lane-key plans; consumed by machinery place.
LanePolicy::explicit("credit_request/request_id")
BindStrategy

declares identity-only matching precedence for entering a proto bay.

  • Authored fields. ordered precedence list, compound key groups, optional confidence gates, and match outcome rules.
  • Compiler derives. executable lookup chains and ambiguous-match detection plans.
  • Invariants. bind strategy never owns field hydration; it only answers whether this datum matches an existing epi and in what order references are attempted.
  • Contracts. nested under ProtoBay; compiled into crossing policy.
BindStrategy::by_precedence([
    KeyRef::field("request_id"),
    KeyRef::compound(["qr_context_id", "phone"]),
    KeyRef::field("trello_card_id"),
])
BirthStrategy

declares composable birth law. mental model: when + requires + shape + on_fail.

  • Authored fields. trigger point, required identities or relations, allowed resulting shape, and failure outcome.
  • Compiler derives. birth guards, partial-shape validators, and crossing failure plans.
  • Invariants. birth is never implicit from bind miss alone. the strategy must say when birth is legal, what minimum shape is sufficient, and what happens if the minimum is not met.
  • Contracts. nested under ProtoBay; consulted during commit.
BirthStrategy::new()
    .when("commit")
    .requires(["phone"])
    .shape("minimal_shell")
    .on_fail("quarantine")
AuthorityPolicy

declares who is canonical for maintained truth. granularity is world default, proto field-group policy, and route override.

  • Authored fields. canonical owner, field-group scopes, allowed observation faces, allowed writeback effects, and optional route-local override mode.
  • Compiler derives. authority matrix and illegal truth-promotion guards.
  • Invariants. not every field is authored independently, but field groups such as balance, lifecycle, and external_refs must be nameable and governable.
  • Contracts. compiled into authority_matrix; checked during commit and sync discharge.
AuthorityPolicy::world_canonical()
    .field_group("balance", "compiled_world")
    .observe_from_faces(["croop_api"])
    .writeback_effects(["sync_to_fibo"]);
DischargePolicy

declares what closes an obligation. mental model: satisfying receipt kinds plus timeout, escalation, and terminal failure behavior.

  • Authored fields. accepted receipt-kind refs, timeout, escalation target or effect, and terminal failure rule.
  • Compiler derives. receipt matchers, expiry watchers, and obligation state transitions.
  • Invariants. no obligation may be considered discharged by vendor side effects alone; a declared receipt is required unless the policy explicitly says otherwise.
  • Contracts. nested under Effect or route override; compiled into discharge rules and emitted DischargeReceipt matching logic.
DischargePolicy::new()
    .receipt("fibo.accepted")
    .timeout("30m")
    .escalate("notify_mattermost")
    .on_terminal_failure("raise_fault");

set layer

SetSpec

root authored set artifact. it places semantic landmarks in district-local 3d space without redefining world law.

  • Authored fields. set id, world ref, district placements, face placements, anchor placements, track placements, dock placements, screen placements, camera hints, and lens hints.
  • Compiler derives. resolved global positions, derived scene edges, default labels, camera fallbacks, and overlay channels.
  • Invariants. coordinates are local to a district frame, not global world absolutes. set authoring may place landmarks and hints only; conduits, gates, switches, chambers, relation bridges, overlay channels, and default labels remain compiler-only.
  • Contracts. serializes to AuthoredSet; compiles into CompiledSet.
let set = SetSpec::new("finexa_credit_world")
    .world("finexa_credit_world")
    .district(DistrictPlacement::new("center").origin([0.0, 0.0, 0.0]))
    .anchor(AnchorPlacement::new("credit_request").district("center").at([0.0, 0.0, 0.0]));
DistrictPlacement

declares one local spatial frame for a semantic district such as west, center, north, east, or south.

  • Authored fields. district id, local origin, extents, optional orientation, and membership defaults.
  • Compiler derives. global transforms and default placement bounds.
  • Invariants. all contained landmark coordinates are local to this district frame.
  • Contracts. nested under SetSpec; used when resolving placements.
DistrictPlacement::new("center")
    .origin([0.0, 0.0, 0.0])
    .extent([14.0, 8.0, 6.0]);
FacePlacement

places one semantic face landmark in district-local space.

  • Authored fields. face id ref, district, local position, optional rotation, and optional size/style hint.
  • Compiler derives. shell alignment, default conduit anchors, and viewer handles.
  • Invariants. face placement references an existing semantic face and does not create one.
  • Contracts. nested under SetSpec; compiled into a face landmark in CompiledSet.
FacePlacement::new("whatsapp_flow")
    .district("west")
    .at([1.5, 3.0, 0.5]);
AnchorPlacement

places one proto anchor orb in district-local space.

  • Authored fields. proto id ref, district, local position, optional scale, and optional bay emphasis hints.
  • Compiler derives. bridge sockets, bay visual handles, and occupancy overlay channels.
  • Invariants. anchors correspond to compiled protos only; anchor position does not change identity law.
  • Contracts. nested under SetSpec; compiled into anchor nodes.
AnchorPlacement::new("credit")
    .district("center")
    .at([4.0, 0.5, 0.0]);
TrackPlacement

places one process track using semantic connection points plus optional control points.

  • Authored fields. process id ref, district, semantic endpoints or stop refs, optional local control points, and optional stop spacing hints.
  • Compiler derives. final curves, stop interpolation, and route overlay attachment points.
  • Invariants. track placement is authored as semantic connection points, not arbitrary freehand mesh geometry.
  • Contracts. nested under SetSpec; compiled into track geometry and stop metadata.
TrackPlacement::new("activation")
    .district("north")
    .connect("credit_request", "credit")
    .control_points([[1.5, 1.0, 0.0], [2.5, 1.2, 0.0]]);
DockPlacement

places one outbound effect dock in district-local space.

  • Authored fields. effect id ref, district, local position, and optional orientation or capacity hint.
  • Compiler derives. default obligation lanes and effect-edge routing sockets.
  • Invariants. docks correspond to declared effects only.
  • Contracts. nested under SetSpec; compiled into dock landmarks.
DockPlacement::new("sync_to_fibo")
    .district("south")
    .at([3.0, -2.0, 0.0]);
ScreenPlacement

places one projection screen or readout slab in district-local space.

  • Authored fields. projection id ref, district, local position, optional orientation, optional size, and optional default lens ref.
  • Compiler derives. screen framing, projection handles, and default label anchors.
  • Invariants. screens reference projections; they do not define readout logic themselves.
  • Contracts. nested under SetSpec; compiled into screen landmarks.
ScreenPlacement::new("active_credits_lens")
    .district("east")
    .at([2.0, 1.0, 0.0]);
CameraHint

authors basic camera intent for default world framing, focus zones, or entry views.

  • Authored fields. hint id, target district or landmark refs, offset, framing mode, and optional zoom/angle preference.
  • Compiler derives. camera fallback stack and transition-friendly framing metadata.
  • Invariants. camera hints guide staging, but they are not interaction scripts or imperative camera choreography.
  • Contracts. nested under SetSpec; exposed to viewer defaults.
CameraHint::new("default_finexa_view")
    .target_districts(["west", "center", "north"])
    .offset([0.0, 0.0, 18.0]);
LensHint

authors basic readout and overlay emphasis intent for a screen or viewport lens.

  • Authored fields. hint id, target projection or landmark refs, overlay channel preferences, selection scope, and filter defaults.
  • Compiler derives. viewer-ready lens presets and overlay binding handles.
  • Invariants. lens hints guide readout emphasis only; they are not imperative interaction scripting.
  • Contracts. nested under SetSpec; consumed by viewer/frame defaults.
LensHint::new("risk_queue_focus")
    .projection("risk_queue")
    .show_channels(["attempts", "obligations", "faults"]);

finexa authored world snippet

let world = WorldSpec::new("finexa_credit_world")
    .schema_edition("2026.q1")
    .source(Source::webhook("whatsapp_business_api"))
    .port(Port::https("finexa_http_ingress"))
    .face(
        Face::write("whatsapp_flow")
            .sources(["whatsapp_business_api"])
            .ports(["finexa_http_ingress"])
            .ruleset("whatsapp_flow_rules")
            .targets(["party", "credit_request"]),
    )
    .proto(
        Proto::new("credit_request")
            .key("request_id")
            .lookup("qr_context_id")
            .lookup("trello_card_id")
            .lookup("phone")
            .field(ProtoField::string("request_id").required())
            .field(ProtoField::string("phone").group("identity"))
            .field(ProtoField::enum_("status").group("lifecycle"))
            .binding(
                FieldBinding::for_field("status")
                    .from_face("trello_pipeline")
                    .via_ruleset("trello_pipeline_rules")
                    .fresh_for("1h")
                    .on_missing("preserve_previous"),
            ),
    )
    .proto_bay(
        ProtoBay::new("credit_request")
            .intake(["qr_entry", "whatsapp_chat", "whatsapp_flow", "trello_pipeline"])
            .bind(BindStrategy::by_precedence([
                KeyRef::field("request_id"),
                KeyRef::compound(["qr_context_id", "phone"]),
                KeyRef::field("trello_card_id"),
            ]))
            .birth(BirthStrategy::new().when("commit").requires(["phone"]).shape("minimal_shell").on_fail("quarantine"))
            .lane(LanePolicy::explicit("credit_request/request_id")));

finexa authored set snippet

let set = SetSpec::new("finexa_credit_world")
    .world("finexa_credit_world")
    .district(DistrictPlacement::new("west").origin([0.0, 0.0, 0.0]))
    .district(DistrictPlacement::new("center").origin([16.0, 0.0, 0.0]))
    .district(DistrictPlacement::new("north").origin([16.0, 10.0, 0.0]))
    .face(FacePlacement::new("whatsapp_flow").district("west").at([1.5, 2.0, 0.5]))
    .anchor(AnchorPlacement::new("credit_request").district("center").at([0.0, 0.0, 0.0]))
    .anchor(AnchorPlacement::new("credit").district("center").at([4.0, 0.5, 0.0]))
    .track(
        TrackPlacement::new("activation")
            .district("north")
            .connect("credit_request", "credit")
            .control_points([[1.5, 0.8, 0.0], [2.8, 1.2, 0.0]]),
    )
    .dock(DockPlacement::new("sync_to_fibo").district("south").at([3.0, -2.0, 0.0]))
    .screen(ScreenPlacement::new("active_credits_lens").district("east").at([2.0, 1.0, 0.0]));

this is rust-embedded authoring, not a textual mini-language pasted into strings. the dsl remains regular rust data construction so normal tests, refactors, traits, and code review still apply.

3.3 compiled world and compiled set

the compiler exists to make authored law executable, not to invent missing law.

compiled artifacts are the first implementation-facing IR. they freeze authored slugs into resolved handles, lower boundary and field plans into executable policy, and carry every topology element the static viewer needs. ViewerFrame stays thin because compiled artifacts already own topology, positions, labels, and handles.

this section stays high-level on purpose. the full typed compiler reference now lives in compiler ir spec, including the rust-only normalization layers, the typed lowered ruleset dag, the strict expression ast, the precedence products, and the full symbol/strata mini-map on every surface.

CompiledWorld

deterministic world IR for law, machinery, replay, and viewer adapters.

  • Compiled fields. meta, authored_world_ref, resolved_ids, compiled_sources, compiled_ports, compiled_port_bindings, compiled_faces, compiled_rulesets, compiled_protos, compiled_proto_bays, compiled_processes, compiled_routes, compiled_projections, bind_plans, birth_plans, lane_key_plans, authority_matrix, discharge_rules, viewer_handles, and compile_diagnostics.
  • Resolved ownership. compiled sources and ports keep boundary capabilities; compiled port bindings own parser/matcher/admit composition; compiled protos own field hydration plans; compiled proto bays own bind/birth/lane defaults; compiled routes own commit-domain, fact-kind, and effect emission plans.
  • Precedence resolution. lane resolves as route.lane_policy_override > proto_bay.lane_policy; authority resolves as route.authority_override > proto.field_group_policy > world.default_authority; discharge resolves as route.discharge_override > effect.discharge_policy; bind/birth strategy resolves only from ProtoBay.
  • Compiler derives. stable dotted resolved handles, executable lookup chains, birth guards, authority guards, discharge matchers, route dispatch tables, relation indices, and viewer-safe handles for districts, landmarks, tracks, and projections.
  • Ambiguity errors. same-tier conflicting declarations, missing required resolution, impossible source-to-face contracts, or route-local attempts to redefine proto-bay bind/birth law are compile errors, not runtime fallbacks.
  • Contracts. durable deterministic protobuf artifact consumed by Law, Machinery, Readout, and static/dynamic viewer loaders.
high-level summary only here.
full typed catalog:
compiler_ir_spec.html#compiled-world
compiler_ir_spec.html#resolved-ids-public
compiler_ir_spec.html#compiled-route
CompiledPortBinding

the lowered boundary object for one deployed source composition path.

  • Compiled fields. resolved binding id, port ref, source ref, direction, deployment handle, credential contract, protocol adapter, parser plan, material contract id, matcher plan, admit policy, bind hook, birth hook, effect policy, trust posture, and boundary diagnostics.
  • Compiler derives. executable adapter chain, parsed payload contract, matcher bytecode/graph, and compatibility mapping to allowed faces or effect faces.
  • Invariants. a compiled port binding may shape and classify source material, but it may not maintain proto truth directly. its output must cross a face/ruleset boundary before it can become a Datum.
  • Contracts. nested inside CompiledWorld; consumed by admit and outbound delivery/discharge machinery.
CompiledPortBinding {
  binding_id: "pb_whatsapp_flow_in_01...",
  port_id: "prt_finexa_http_ingress_01...",
  source_id: "src_whatsapp_business_api_01...",
  protocol_adapter: "https_webhook",
  parser_plan: "flow_submission.v3",
  matcher_plan: "request_ref_and_phone",
  trust_posture: "signed_vendor_boundary",
}
CompiledSet

deterministic scene IR resolved against compiled world ids.

  • Compiled fields. meta, authored_set_ref, compiled_world_ref, districts, face_placements, anchors, tracks, docks, screens, semantic_connection_points, optional control_points, resolved_global_positions, derived_conduits, derived_gates, derived_switches, derived_chambers, relation_bridges, overlay_channels, default_labels, default_camera_state, default_lens_state, and compile_diagnostics.
  • Compiler derives. global coordinates from district-local positions, semantic edge routing, default district/layout hints, bridge geometry, overlay lanes, label fallbacks, and camera/lens defaults.
  • Invariants. compilation may derive scene machinery only from authored landmarks and compiled world topology. it may not create new routes, proto bays, authority policy, or process law.
  • Viewer boundary. every node, edge, position, label, and handle needed for a static render lives here or in CompiledWorld; ViewerFrame never duplicates them.
  • Contracts. durable deterministic protobuf artifact loaded directly by the first static viewer.
high-level summary only here.
full typed catalog:
compiler_ir_spec.html#compiled-set
compiler_ir_spec.html#resolved-district
compiler_ir_spec.html#resolved-track
policy surface declaration sites compile-time resolution ambiguity rule
lane Route, ProtoBay route.lane_policy_override > proto_bay.lane_policy missing resolution is a compile error; same-tier conflicts are compile errors
authority Route, Proto.field_group_policy, WorldSpec.default_authority route.authority_override > proto.field_group_policy > world.default_authority same-tier conflicts are compile errors; illegal truth promotion is rejected in compilation
discharge Route, Effect route.discharge_override > effect.discharge_policy same-tier conflicts are compile errors; unresolved discharge means the effect is illegal
bind/birth ProtoBay, route birth permission ProtoBay defines bind/birth strategy; route may allow or deny authored birth targets but may not redefine strategy route-side strategy redefinition is a compile error

3.4 runtime algebra

the operator split from section 1 becomes the rust execution boundary here:

pub trait Compiler {
    fn compile_world(&self, world: &AuthoredWorld) -> CompiledWorld;
    fn compile_set(&self, set: &AuthoredSet, world: &CompiledWorld) -> CompiledSet;
}

pub trait Law {
    fn decide(
        &self,
        world: &CompiledWorld,
        snapshot: &WorldSnapshot,
        route: &RouteSelection,
        datum: &Datum,
    ) -> Vec<Proposal>;
}

pub trait Machinery {
    fn admit(
        &self,
        world: &CompiledWorld,
        intake: SourceMaterial,
        face_id: FaceId,
    ) -> AdmitOutcome;

    fn route(
        &self,
        world: &CompiledWorld,
        datum: &Datum,
    ) -> Vec<RouteSelection>;

    fn spawn(
        &self,
        world: &CompiledWorld,
        datum: &Datum,
        route: &RouteSelection,
    ) -> Attempt;

    fn place(
        &self,
        world: &CompiledWorld,
        attempt: &Attempt,
    ) -> LaneKey;

    fn commit(
        &self,
        world: &CompiledWorld,
        snapshot: &WorldSnapshot,
        attempt: &Attempt,
        lane: &LaneKey,
        route: &RouteSelection,
        datum: &Datum,
        proposals: &[Proposal],
    ) -> CommitResult;
}

pub trait Readout {
    fn measure(
        &self,
        world: &CompiledWorld,
        records: &[RecordEnvelope],
    ) -> ReadoutState;
}

pub trait Staging {
    fn render(
        &self,
        set: &CompiledSet,
        readout: &ReadoutState,
        live: &ViewerFrame,
    ) -> Picture;
}

protobuf contracts stop at durable or boundary-relevant artifacts. Datum, RouteSelection, Attempt, LaneKey, Receipt, RecordEnvelope, ObligationEnvelope, DischargeReceipt, ReplayInput, and ViewerFrame are contract types. SourceMaterial, AdmitOutcome, WorldSnapshot, CommitResult, ReadoutState, and Picture are Rust-only internal shapes with explicit mappings documented below.

runtime type status durability rule
Datum admitted boundary input durable ingress truth for replay and traceability
RouteSelection chosen path for one admitted datum durable as part of attempt and replay input
Attempt one concrete runtime responsibility durable coordination record
LaneKey resolved local commit domain durable wherever attempt or record needs commit ordering
Proposal law output, not truth transient by default; may be persisted for diagnostics, but replay must not depend on proposal storage
Receipt commit summary durable runtime outcome
RecordEnvelope durable committed fact authoritative immutable fact atom; the only durable runtime truth besides obligations and discharge receipts
ObligationEnvelope durable promise to the outside authoritative until discharged or failed terminally
DischargeReceipt proof of obligation discharge durable runtime truth
ReplayInput reconstruction bundle durable replay contract
ViewerFrame viewer/live envelope derived or mocked; never the authoritative record

CommitResult is the runtime join point: it contains a Receipt, emitted RecordEnvelope values, and emitted ObligationEnvelope values. only records change world truth. obligations change what the world owes. receipts summarize what happened.

RecordEnvelope

durable committed truth. each record carries one immutable fact atom and never stores a diff as canonical truth.

  • Durable fields. record_id, route_id, attempt_id, lane_key, affected epi refs, timestamps, provenance refs, and fact_atom.
  • fact_atom union. exactly one of event, assertion, relation_fact, or observation.
  • Truth rule. diff is never durable truth. diffs, snapshots, and projections are derived from committed fact atoms.
  • Observation rule. an observation may maintain proto fields only when a FieldBinding explicitly consumes observations and the resolved authority matrix allows that source for the relevant field group.
  • Replay consequence. replay and proto maintenance operate over immutable fact atoms, not over vendor-side state dumps or viewer diffs.
RecordEnvelope {
  record_id: "rec_01...",
  route_id: "activation.credit.create",
  attempt_id: "att_01...",
  lane_key: "credit_request:req_942",
  affected_epi_ids: ["credit:cr_443", "credit_request:req_942"],
  fact_atom: {
    event: {
      kind: "credit.created",
      credit_id: "cr_443",
      request_id: "req_942"
    }
  }
}
ObligationEnvelope

durable runtime promise owed by the world to an external boundary.

  • Durable fields. obligation_id, effect_id, through-face ref, payload ref or payload hash, discharge rule ref, retry state, timeout state, and terminal status.
  • Compiler dependency. every obligation must point at a compiled discharge rule resolved from effect policy and any route override.
  • Truth rule. an obligation remains owed until a matching DischargeReceipt closes it or it reaches terminal failure according to authored policy.
ObligationEnvelope {
  obligation_id: "obl_01...",
  effect_id: "sync_to_fibo",
  through_face: "fibo_outbound",
  discharge_rule_id: "dr_sync_to_fibo_receipt",
  status: "owed"
}
ViewerFrame

thin viewer/live envelope. it references compiled artifacts and runtime truth but does not duplicate topology.

  • Frame fields. root meta, compiled_world_ref, compiled_set_ref, camera state, visible districts/layers, selection, hover/highlight state, pinned entities, live attempt refs, live obligation refs, and optional mocked overlay slots such as lag, faults, and pulses.
  • Static-mode rule. for the first viewer, topology, positions, labels, node kinds, edge kinds, and handles all come from CompiledWorld plus CompiledSet. static ViewerFrame only seeds presentation state.
  • Contracts. protobuf contract emitted by a runtime adapter or a mocked viewer harness; safe to snapshot-test and fixture-load without a running runtime.
ViewerFrame {
  meta: ArtifactMeta { schema_edition: "2026.q1", producer_semver: "0.1.0", schema_hash: "sha256:..." },
  compiled_world_ref: "fixtures/finexa/compiled_world.pbjson",
  compiled_set_ref: "fixtures/finexa/compiled_set.pbjson",
  camera_state: { preset: "default_overview" },
  visible_districts: ["west", "center", "north", "east", "south"],
  selection: "credit_request",
  live_attempts: ["att_01..."],
  live_obligations: ["obl_01..."],
  mocked_overlays: {
    lag: [],
    faults: [],
    pulses: ["activation.credit.create"]
  }
}
rust-only internal adapters

these nouns stay in rust land. they are allowed as internal execution surfaces only because their protobuf boundary mappings are explicit.

internal type role protobuf mapping
SourceMaterial raw boundary input after transport/auth/parsing but before semantic admission maps into admitted Datum plus intake diagnostics
AdmitOutcome internal result of running admit maps into Datum, route candidates, reject/quarantine diagnostics
WorldSnapshot assembled execution read model over compiled world plus committed truth materialized from CompiledWorld, RecordEnvelope[], and ObligationEnvelope[]
CommitResult internal join point at commit maps into one Receipt, zero or more RecordEnvelope, zero or more ObligationEnvelope, and optional DischargeReceipt
ReadoutState internal staged read model before viewer framing maps into ViewerFrame inputs and derived presentation state
Picture final render product for one staging backend no protobuf contract; terminal backend output only

3.5 normative policies frozen here

topic rule implementation consequence
compiler posture explicit authoring is required for ontology, routes, bind/birth, key precedence, lane policy, authority, discharge, and effects compiler inference stays narrow: ids, obvious scene edges, default districts, default layout hints, viewer handles
bind/birth every ProtoBay declares ordered bind precedence and explicit birth strategy missing or ambiguous resolution goes to quarantine unless the authored birth strategy explicitly allows birth
lane policy every route or proto bay declares an explicit LanePolicy compiler resolves one lane key plan per admitted route; fanout means multiple admitted routes, not one multi-domain commit blob
precedence route overrides enclosing policy; proto policy overrides world defaults; same-tier conflicts are illegal ambiguity is a compile error for lane, authority, and discharge; runtime never guesses between authored policies
authority compiled/runtime world is canonical for balances and servicing truth croop, fibo, sheets, trello, and similar systems can observe, mirror, or receive syncs, but they do not silently become ontology
trello only explicitly mapped trello/operator actions may become admitted datums for legal routes raw card/list/archive state is never canonical business truth by itself
credit birth activation.credit.create births credit at commit external sync receipts may confirm delivery and discharge obligations, but may not define birth
payment truth payments become canonical at reconciliation commit sheet visibility or vendor visibility may confirm or drift-check, but does not define the payment fact
record algebra RecordEnvelope.fact_atom is exactly one of event, assertion, relation_fact, or observation diffs and snapshots stay derived; replay and proto maintenance run over immutable fact atoms only
discharge only declared receipts may discharge declared obligations delivery success must be captured as DischargeReceipt; external state change without matching receipt does not close the obligation
viewer bootstrap compiled artifacts own topology, positions, labels, and handles the first static viewer loads CompiledWorld, CompiledSet, and a thin ViewerFrame without inventing new graph structure

finexa key precedence

party
  party_id
  > government_id
  > phone
  > employee_code

credit_request
  request_id
  > (qr_context_id + phone)
  > trello_card_id

credit
  credit_id
  > fibo_credit_id
  > croop_credit_id

payment
  payment_id
  > (external_payment_ref + credit_id)

discharge stance

send / sync obligation
  commit creates obligation
  effect face attempts delivery
  declared receipt matches policy
  DischargeReceipt closes obligation

no receipt
  = still owed

external side effect without record
  ≠ world truth

3.6 finexa example in the new contract split

the first static viewer target is the canonical Finexa specimen set: authored world + authored set + compiled world + compiled set + thin static frame. the normative fixture paths are fixtures/finexa/authored_world.pbjson, fixtures/finexa/authored_set.pbjson, fixtures/finexa/compiled_world.pbjson, fixtures/finexa/compiled_set.pbjson, and fixtures/finexa/static_viewer_frame.pbjson.

authored world snippet

let world = WorldSpec::new("finexa_credit_world")
    .schema_edition("2026.q1")
    .source(Source::webhook("whatsapp_business_api"))
    .port(
        Port::https("finexa_http_ingress")
            .binding(
                PortBinding::new("whatsapp_flow_in")
                    .direction("ingress")
                    .source("whatsapp_business_api")
                    .source_kind("flow_submission")
                    .credential("signed_vendor_secret")
                    .protocol("https_webhook")
                    .parser("flow_submission_v3")
                    .material_contract("whatsapp.flow.submission")
                    .matcher("request_ref_and_phone")
                    .admit_policy("require_request_ref")
                    .bind_rule("credit_request_keys")
                    .birth_rule("deny")
                    .deployment("mx-prod-west")
                    .trust_posture("signed_vendor_boundary"),
            ),
    )
    .face(
        Face::write("whatsapp_flow")
            .sources(["whatsapp_business_api"])
            .ports(["finexa_http_ingress"])
            .port_bindings(["whatsapp_flow_in"])
            .ruleset("whatsapp_flow_rules")
            .targets(["party", "credit_request"]),
    )
    .proto(
        Proto::new("credit")
            .field(ProtoField::money("principal_balance").group("balance"))
            .field_binding(
                FieldBinding::for_field("principal_balance")
                    .from_face("croop_api")
                    .via_ruleset("croop_api_rules")
                    .join_on([("croop_credit_id", "croop_credit_id")])
                    .on_missing("preserve_previous_and_raise_drift"),
            ),
    )
    .proto_bay(
        ProtoBay::new("credit_request")
            .intake(["qr_entry", "whatsapp_chat", "whatsapp_flow", "trello_pipeline", "google_form_interview", "docs_upload"])
            .bind(BindStrategy::by_precedence([
                KeyRef::field("request_id"),
                KeyRef::compound(["qr_context_id", "phone"]),
                KeyRef::field("trello_card_id"),
            ]))
            .birth(BirthStrategy::minimal_shell())
            .lane(LanePolicy::explicit("credit_request/request_id")),
    )
    .route(
        Route::new("activation.credit.create")
            .datum_face("trello_pipeline")
            .touches(["credit", "credit_request"])
            .births("credit")
            .lane(LanePolicy::explicit("credit_request/request_id"))
            .authority(AuthorityPolicy::world_canonical())
            .discharge(DischargePolicy::by_receipt("fibo.accepted"))
            .effects(["create_or_move_trello_card", "sync_to_fibo"]),
    );

authored set snippet

let set = SetSpec::new("finexa_credit_world")
    .district("west").origin([0.0, 0.0, 0.0]).extent([12.0, 8.0, 6.0]).members(["qr_entry", "whatsapp_chat", "whatsapp_flow", "google_form_interview", "docs_upload", "croop_api"])
    .district("center").origin([18.0, 0.0, 0.0]).extent([14.0, 8.0, 6.0]).members(["party", "credit_request", "credit", "payment"])
    .district("north").origin([18.0, 12.0, 0.0]).extent([14.0, 6.0, 4.0]).members(["origination", "risk_review", "activation", "servicing"])
    .district("east").origin([36.0, 0.0, 0.0]).extent([10.0, 8.0, 6.0]).members(["pipeline_board", "active_credits_lens", "trello_pipeline", "trello_outbound", "fibo_outbound"])
    .district("south").origin([18.0, -12.0, 0.0]).extent([14.0, 6.0, 4.0]).members(["create_or_move_trello_card", "sync_to_fibo"])
    .anchor(AnchorPlacement::new("credit_request").district("center").at([0.0, 0.0, 0.0]))
    .anchor(AnchorPlacement::new("credit").district("center").at([4.0, 0.0, 0.0]))
    .track(
        TrackPlacement::new("risk_review")
            .district("north")
            .connect("credit_request", "credit_request")
            .from_point([-0.2, 1.4, 0.0])
            .to_point([0.2, 1.4, 0.0])
            .control_points([[1.4, 2.2, 0.0], [-1.4, 2.2, 0.0]]),
    )
    .track(
        TrackPlacement::new("activation")
            .district("north")
            .connect("credit_request", "credit")
            .from_point([0.5, 0.0, 0.0])
            .to_point([3.5, 0.0, 0.0])
            .control_points([[1.5, 0.8, 0.0], [2.5, 0.8, 0.0]]),
    )
    .dock(DockPlacement::new("sync_to_fibo").district("south").at([3.0, -2.0, 0.0]));

compiled world excerpt

CompiledWorld {
  meta: ArtifactMeta {
    schema_edition: "2026.q1",
    producer_semver: "0.1.0",
    schema_hash: "sha256:...",
    git_commit: Some("...")
  },
  resolved_ids: {
    world: "cw.finexa_credit_world",
    faces: { "trello_pipeline": "cw.finexa_credit_world.face.trello_pipeline" }
  },
  compiled_port_bindings: {
    "whatsapp_flow_in": {
      source_ref: "cw.finexa_credit_world.source.whatsapp_business_api",
      matcher_plan: "request_ref_and_phone",
      trust_posture: "signed_vendor_boundary"
    }
  },
  compiled_processes: {
    "activation": {
      statuses: ["approved", "active"],
      transitions: [{ from: "approved", to: "active", effects: ["create_or_move_trello_card", "sync_to_fibo"] }]
    }
  },
  compiled_routes: {
    "activation.credit.create": {
      lane_key_plan: "credit_request.request_id",
      birth_targets: ["credit"],
      authority: "AUTHORITY_OWNER_COMPILED_WORLD",
      discharge_rules: ["sync_to_fibo"],
      process_transition: { process: "activation", from: "approved", to: "active" }
    }
  },
  authority_matrix: {
    "credit.balance.*": "AUTHORITY_OWNER_COMPILED_WORLD",
    "trello.card_state": "AUTHORITY_OWNER_PROJECTION_ONLY",
    "croop.balance_snapshot": "AUTHORITY_OWNER_BOUNDARY_OBSERVATION_ONLY"
  },
  compile_diagnostics: []
}

compiled set excerpt

CompiledSet {
  compiled_world_ref: "fixtures/finexa/compiled_world.pbjson",
  districts: {
    "center": { origin: [18.0, 0.0, 0.0], extent: [14.0, 8.0, 6.0], members: ["party", "credit_request", "credit", "payment"] }
  },
  anchors: {
    "credit_request": { global_position: [18.0, 0.0, 0.0] },
    "credit": { global_position: [22.0, 0.0, 0.0] }
  },
  tracks: {
    "activation": {
      from: "credit_request",
      to: "credit",
      semantic_connection_points: { from_point: [18.5, 12.0, 0.0], to_point: [21.5, 12.0, 0.0] },
      control_points: [[19.5, 12.8, 0.0], [20.5, 12.8, 0.0]]
    }
  },
  derived_conduits: ["west.whatsapp_flow->center.credit_request"],
  relation_bridges: ["credit_request->credit"],
  default_camera_state: { preset: "default_overview" }
}

runtime truth excerpt

Attempt {
  attempt_id: "att_01...",
  datum_id: "dat_01...",
  route_id: "activation.credit.create",
  lane_key: "credit_request:req_942",
}

RecordEnvelope {
  record_id: "rec_01...",
  route_id: "activation.credit.create",
  attempt_id: "att_01...",
  lane_key: "credit_request:req_942",
  affected_epi_ids: ["credit:cr_443", "credit_request:req_942"],
  fact_atom: {
    event: { kind: "credit.created", credit_id: "cr_443", request_id: "req_942" }
  }
}

ObligationEnvelope {
  obligation_id: "obl_01...",
  effect_id: "sync_to_fibo",
  through_face: "fibo_outbound",
  discharge_rule_id: "dr_sync_to_fibo_receipt"
}

viewer frame excerpt

ViewerFrame {
  meta: ArtifactMeta {
    schema_edition: "2026.q1",
    producer_semver: "0.1.0",
    schema_hash: "sha256:..."
  },
  compiled_world_ref: "fixtures/finexa/compiled_world.pbjson",
  compiled_set_ref: "fixtures/finexa/compiled_set.pbjson",
  camera_state: { preset: "default_overview" },
  visible_districts: ["west", "center", "north", "east", "south"],
  selection: "credit_request",
  highlight_state: { highlighted_routes: ["activation.credit.create"] },
  live_attempts: ["att_01..."],
  live_obligations: ["obl_01..."],
  mocked_overlays: {
    lag: [],
    faults: [],
    pulses: ["activation.credit.create"]
  }
}

the first viewer slice may mock overlays, but the shape is already the real contract shape. later runtime wiring swaps the producer, not the ontology.

fixture set

fixtures/finexa/
  authored_world.pbjson
  authored_set.pbjson
  compiled_world.pbjson
  compiled_set.pbjson
  static_viewer_frame.pbjson

these are the canonical bootstrap artifacts for the first static viewer and for fixture-driven contract tests.

3.7 validation gates for implementation

contract shape

  • rust dsl serializes losslessly. WorldSpec and SetSpec round-trip into authored protobuf artifacts without hidden fields.
  • compile is deterministic. equal authored input plus equal edition yields byte-stable compiled artifacts.
  • boundary composition stays explicit. every deployed ingress/egress path compiles through PortBinding, not ad hoc handler glue.
  • type names stay stable. compatibility is governed by artifact metadata, not type renames.

semantic law

  • bind/birth is deterministic. precedence and birth policy decide resolution without ambient handler tricks.
  • lane resolution is deterministic. equal route and equal bind result yield equal lane keys.
  • authority rejects drift. external read/write surfaces cannot promote themselves into canonical truth.
  • observation is gated. observation facts only maintain proto fields through explicit FieldBinding and resolved authority.

viewer + replay

  • viewer can load canonical finexa fixtures. authored, compiled, and static frame specimens are sufficient to bootstrap the first scene.
  • mocked live overlays stay contract-backed. no viewer-only ids or ad hoc event shapes.
  • replay is stable. identical records and viewer rules yield identical viewer frames for deterministic overlays.
required property tests when code lands
  compile(authored) is deterministic
  lane_key(route, bind_result) is deterministic
  bind_or_birth obeys precedence and explicit birth policy
  port_binding(face, source_material) is contract-compatible or compile fails
  activation.credit.create is the only credit birth route
  discharge only occurs on declared receipts
  observation updates require explicit field binding + authority
  replay(records) -> viewer_frame is deterministic for deterministic overlays