interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / spec / workflow-fusion.md

225 lines · 12387 bytes Raw Blame History Source

Omega verified workflow fusion (OMEGA_WORKFLOW_FUSION)

Code: src/runtime/rx_fusion.{c,h}, plus the AG_META node kind in src/runtime/rx_graph.{c,h}. Test: tests/runtime/rx_workflow_fusion.c, make test-workflow-fusion. Receipt: evidence/WORKFLOW_FUSION/.

Purpose

Omega runs the same verified action-graph fragments again and again. When a fragment A -> B -> C -> D keeps coming back with the same semantic dependencies, the same authority pattern and the same result contract, a low failure rate and stable evidence, Omega may propose it as a MetaSkill: one node that does what the steps did, with fewer reactions, crumbs and scheduling rounds per run.

A MetaSkill never replaces behaviour silently. It starts as a candidate and only becomes usable after verification, measurement, a canary, promotion through the generation barrier and publication into the Skill Net table. rx_fusion_compile applies only published MetaSkills and reports each fusion it made; everything else in its library is refused and counted.

Pipeline

StageWhat happensState after
observerx_fusion_observe takes a run only when the lowered result equals the sequential reference on every node (status, value, evidence, step evidence), the outcome is decided, and every evidence node of a successful run has its word. Fragments are enumerated and grouped by signature.pattern
judgetoo small; evidence unstable (a repeated input gave a different result or step evidence); failure rate over the policy; too few occurrences; seen in too few graphscandidate or not
buildrx_fusion_build: ancestry, contracts derived from the fragment, realization, reference graph, observed samplesCANDIDATE
verifyrx_fusion_verify against the reference fragmentVERIFIED / REJECTED
measureoriginal and fused side by side; rx_fusion_accept_measureMEASURED / SLOWER
canaryfused graph in shadow beside production; rx_fusion_canaryCANARY_PASSED / QUARANTINED
promoterx_fusion_promote: an R9 generation carrying the realization bytes, identities, contracts and figures; the promotion right is checked on the native authority; the proposer cannot promote its own candidatePROMOTED
publishrx_fusion_publish: the promoted generation must be active and its bytes must equal the MetaSkill as it is nowPUBLISHED

REJECTED, SLOWER and QUARANTINED are final.

What a fragment may hold

So that one node means exactly what the steps meant:

Enumeration grows each fragment backwards from its exit, adding a producer only when every consumer of that producer is already inside, so every set is convex and single-exit.

The MetaSkill

AgMetaSkill {
    id, state, identity
    ancestry[]              graph digest, run, exit origin of the runs it came from
    input_contract          type and edge mode per port
    output_contract         type, may fail
    authority_contract      READ per object slot, nothing else
    resource_contract       merged need of the steps
    effect_contract         performs 0, publishes 0, proposals n
    realization             COMPILED | LEARNED | HYBRID | HARDWARE
    reference               the fragment as observed (a step program)
    samples[]               observed inputs and what the reference produced
    verdict, measure, canary counts, generation
}

Contracts are derived from the fragment, never chosen. The identity is SHA-256 over the id, contracts, realization identity, reference signature and ancestry.

Realizations

A realization is not assumed to be text or code.

The AG_META node

AG_META is an action-graph node kind. op is the skill id; imm/imm2 hold the first 128 bits of the realization identity the node was built for, and the node runs only a published realization with that identity. It carries its input contract (in_type) and its object slots (mobj). Lowering gives it one reaction reading its ports, its objects, the run token and its cell; authority is derived from its objects (READ each). Its cell field 5 holds the step evidence: the chain `H(acc, local step identity, status, value, inputs)` over the steps that ran, which is exactly what the original steps would have recorded. Identity, validation, dependency budgets, CSE, the effect-ordering rule and the sequential reference all know the kind.

Verification

rx_fusion_verify first checks, in order, and rejects on the first failure:

  1. identity: resealed reference and realization, realization identity and MetaSkill identity equal what it carries;
  2. contracts: input/output contracts equal those derived from the reference; the realization's program signature equals the reference's;
  3. authority equivalence: READ per slot, equal to the reference's;
  4. effect equivalence: no boundary in reference or realization; effect contract equal;
  5. resource contract equal.

Then it runs vectors. Both sides run in the sequential reference: the original fragment step by step as ordinary graph nodes, the candidate as one AG_META node, behind the same port drivers (each port ends OK with a value, FAILED, or SKIPPED):

Per vector: exit status, value and attempts (semantic equivalence; failure behaviour when a port was not OK or the exit was not OK), and step evidence (evidence equivalence). Any mismatch rejects.

What each check catches (all exercised by the test): narrowed or widened authority → authority; a claimed effect → effect; a change without a new identity → identity; a changed program step → contract; a learned wrong value → semantic; a learned right value with wrong evidence → evidence; a learned failure turned into success → failure behaviour; the reference and the realization rewritten together → semantic (it no longer reproduces the observations), and it matches no real workflow anyway.

Tampering with contracts cannot widen authority at run time either: a fused node's authority is derived from its objects, and rx_fusion_apply checks that it equals exactly the union of the replaced steps' authority.

Measurement

Original and fused graphs run side by side in two worlds with the same inputs, 41 interleaved runs each at 4 workers, pinned to one core class:

Accepted when fewer reactions compute per run, the median is within the original leg's own spread ((p75 − p25) / median, never less than 5 %) of the original, and success and failure counts are equal. The receipt records the spread and the tolerance used. A fragment of two independent heavy steps is refused (SLOWER): fused, they no longer run side by side.

Canary

The fused graph runs in shadow beside the original on production traffic, including inputs never observed. Per run: exit status, value and attempts, outcome, the out and effect objects, and the fused node's step evidence against the evidence recomputed from the original run. One divergence quarantines the MetaSkill for good. The test's poisoned hybrid (one learned entry for an input verification never generates) verifies and is then quarantined by the canary.

Promotion and publication

rx_fusion_promote proposes an R9 generation carrying the realization's canonical bytes (rx_graph_realization_encode), the realization and MetaSkill identities, the authority contract, the verification, measurement and canary figures, and the ancestry, then promotes it with the caller's request. The barrier checks the promotion right on the native authority and refuses a proposer promoting its own candidate. rx_fusion_publish then requires the generation to be active and re-reads the bytes: a MetaSkill changed after promotion is not published.

rx_fusion.o references no Aienux admin operation (checked by the build).

Gate evidence (what the test proves)

ClaimHow
observation of verified runs onlya run that differs from its reference is refused
repeated fragments found across graphsthe workflow found in three procedures, with its failure count
unstable / flaky / too-big / single-graph fragments not proposedjudge reasons, budget counter
semantic, authority, effect, evidence, failure-behaviour equivalenceverification of compiled and hybrid; nine tampering cases caught
learned alone and hardware not promotedboth rejected not_runnable
never silentan unpublished MetaSkill (verified, measured, canary-passed, promoted) is not applied and the graph is unchanged; after publication, three unpublished library entries are still refused
benchmark is a real gatethe parallel fragment is SLOWER
canary is a real gatethe poisoned hybrid is QUARANTINED
promotion needs authorityrefused without the right and for the proposer
fused graphs equal the originalsevery run: lowered == reference (incl. step evidence), original vs fused (exit, outcome, out and effect objects, step evidence), causal ancestry, evidence present, no bypass; determinism at 1, 2, 4, 8 workers
authority removed (golden path N3)both sides block with BLOCKED_AUTHORITY and perform nothing; the fused node needs READ on A and nothing else; missing authority is reported on it

Limits