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 / visor-authority.md

148 lines · 11036 bytes Raw Blame History Source

Omega Visor V1: authority and effect safety (lane 7)

Invariant: the Visor can ask. The Visor cannot grant.

The Visor may describe an effect and turn it into a request. It cannot mint, revoke, promote, publish or execute, and a request it builds is never authorized. The only things that may act on a request are the existing authority code paths outside the Visor, listed below.

1. The existing authority path (mapped, not changed)

StageFileFunction(s)What it decides
Capability rootsrc/runtime/rx_caproot.h/.crx_caproot_validate, rx_caproot_inspectIs (cap_id, generation) live, current epoch, unexpired, chain intact, for this subject, resource and rights? (RX_CAP_ERR_BOUNDS/STALE_GEN/REVOKED/EPOCH/SUBJECT/RESOURCE/RIGHTS/...)
Root administrationsamerx_capadmin_mint/revoke/reclaim/advance_clock/bump_epochOnly the admin channel holder with the right token and an office authority may change the table (RX_CAP_ERR_UNAUTHORIZED otherwise). Reclaim advances the slot generation.
World checksrc/runtime/rx_world.h, rx_world.crx_world_validate_cap, rx_world_inspect_capSame question, routed to the Linux oracle or the native Aienux view (rx_world_init_with_auth).
World publishsamerx_world_publish_externalAn outside stimulus needs a cap for (external_subject, object resource, WRITE) and a live object ref (RX_ERR_AUTHORITY, RX_ERR_STALE_GEN).
AEGIS policysrc/runtime/rx_aegis.h/.crx_aegis_evaluate (pure), aegis.decide.k / root.install.k reactionsGRANT / DENY (WHY_NO_RULE, WHY_PRIVILEGED, WHY_BAD_REQUEST) / ESCALATE. Only root.install mints (through the native Aienux admin). Nothing calls AEGIS; a reaction is simply not ready until its slot holds authority.
Generation barriersrc/runtime/rx_generation.h/.crx_gen_propose, rx_gen_add_work, rx_gen_promote, rx_gen_reject_replayPromotion needs RX_RIGHT_PROMOTE on RX_GEN_RES_PROMOTION; the promoted root records committed external effect ids, and rx_gen_reject_replay refuses a recorded id (RX_GEN_ERR_REPLAY).
Design referencesspec/r7-aienos-authority-mapping.md, spec/r8-aegis-resident.mdHost authority onto the Aienux table; AEGIS resident authority and its attack list.

Route of a legitimate effect: Visor -> EffectIntent -> AEGIS/PHYSICS authority -> bounded execution -> receipt. The Visor owns only the first arrow.

2. Adapter contract (src/visor/visor_effect_request.h/.c)

typedef struct { SemanticId effect_id; uint16_t resource_class; uint16_t operation_code;
  uint32_t capability_slot; uint64_t capability_generation; SemanticId capability_ref;
  uint16_t param_len; uint8_t param_bytes[128]; uint8_t request_digest[32];
  bool authorized; char status[64]; char route[128]; } VisorEffectRequest;
int visor_effect_request_build(const OmegaGraph *g, const SemanticId *effect_object_id, VisorEffectRequest *out);
int visor_effect_request_classify(const OmegaGraph *g, const SemanticId *id, bool *requires_authority);
int visor_effect_request_format_text(const VisorEffectRequest *r, char *out, size_t n);
int visor_effect_request_format_json(const VisorEffectRequest *r, char *out, size_t n);

3. Hostile test matrix (tests/visor/test_visor_authority.c, make test-visor-authority)

The harness plays the authority side (it mints, revokes, promotes); the hostile UI builds requests with the adapter. Every refusal has a positive control through the same call.

Test conventions, not runtime semantics: resource = 0x7100 + resource_class; rights: op 1 READ, 2 WRITE, 3 EFFECT, 16 MINT; generation-record effect id = first 8 bytes (little endian) of request_digest.

#AttackRefused by (existing code)Result
1Forged cap: random slotrx_caproot_validate, rx_world_validate_capBOUNDS
1Forged cap: right slot, random generationrx_caproot_validateSTALE_GEN
1Wrong slot (another subject's live cap)rx_caproot_validate, rx_world_validate_capSUBJECT
1Hostile caller sets authorized = truenothing reads it; root still refuses; formatter prints falserefused
2Stale generation (revoke, then reclaim)rx_caproot_validate, rx_world_validate_capREVOKED, then STALE_GEN
3Replayed authorization after generation advancerx_caproot_validate (new grant, old ref) and rx_gen_reject_replaySTALE_GEN, RX_GEN_ERR_REPLAY
4UI direct privileged callrx_aegis_evaluate (WHY_PRIVILEGED), rx_caproot_validate (RIGHTS), rx_capadmin_mint under a non-office authority / forged token (UNAUTHORIZED) / no channel (IO); link check (sec. 4)refused
5Malformed request (short / oversized payload, param_len > 128, resource 0)omega_validate_object + visor_effect_request_build-1
6Operation outside the grantrx_caproot_validate (RIGHTS), rx_aegis_evaluate (DENY, WHY_NO_RULE)refused
6Resource outside the client's policyrx_aegis_evaluateDENY, WHY_NO_RULE
7Resource changed after authorizationvisor_effect_request_build digest check (-1); re-identified object has a different digest and rx_caproot_validate / rx_world_validate_cap return RESOURCErefused
8Arguments changed after authorizationdigest check (-1); re-identified digest differs; changed operation -> RIGHTSparams-only: see non-claims
9Duplicate submissionrx_gen_reject_replay after rx_gen_promote recorded the effectRX_GEN_ERR_REPLAY
10Bypass publish: stale / junk / read-only / other subject's cap, stale objectrx_world_publish_externalRX_ERR_AUTHORITY / RX_ERR_STALE_GEN
11Bypass AEGIS: present a slot nobody grantedrx_caproot_validate, rx_world_validate_cap; rx_aegis_evaluate with no policy -> DENYrefused
0Contractbuild/classify never mutate; authorized false; formats deterministic; truncation -1; classify fails closed on missing refs

Result on the DGX Spark host (2026-09-28, start commit ceb68d6): PASS 81/81, OMEGA_VISOR_AUTHORITY_HOSTILE_PASS, 4 non-claims printed. After merging main (2026-09-29, 64-bit capability generations): PASS 84/84 real checks, 20 non-claims (see ยง5 item 7), OMEGA_VISOR_AUTHORITY_HOSTILE_PASS.

Runs nm over build/visor/*.o, build/language/*.o, build/omega_main.o and build/omega (missing files are skipped with a note; an empty build/visor fails). It fails when a file:

It also requires visor_effect_request.o to export exactly its four public functions, and fails if any Visor source (src/visor, src/language, tools/omega.c) assigns authorized anything other than false. Success prints OMEGA_VISOR_AUTHORITY_ISOLATION_PASS.

"No authorized setter" is enforced by that export allowlist and source grep, and in the test by file-scope definitions of visor_effect_request_authorize, _grant, _submit and _set_authorized that conflict with any declaration of those names in the header. C cannot stop a caller writing the field; the design point is that nothing trusts it.

5. Explicit non-claims

  1. The capability root binds subject, resource, rights, generation, epoch and lease, not effect parameters. A params-only change validates at rx_caproot_validate (observed in the test); only the request digest differs. No existing runtime call compares effect digests.
  2. The World does not deduplicate external stimuli (observed: the same publish succeeds twice). Duplicate refusal exists only in the generation record of committed external effects (rx_gen_reject_replay).
  3. The typed-result publish gate (rc_gate_register, a resident reaction) is not driven; only the World's external publish check is.
  4. AEGIS is not on a call path. The resident aegis.decide / root.install reactions are not run; rx_aegis_evaluate is exercised as the pure policy function. The native Aienux authority is linked (for rx_aegis.c) but validation in this test uses the Linux oracle (rx_caproot_validate).
  5. The operation-code-to-rights and resource-class-to-resource mappings are test conventions. Omega's EffectPayload has no canonical mapping to runtime rights yet.
  6. No effect is executed and no receipt is produced by anything in the Visor.
  7. **Resolved by spec/effect-cap64-migration.md (was: honest 64-bit generations unrepresentable in the effect format).** Runtime capability generations are 64-bit and seeded from CLOCK_BOOTTIME ns << 8, so they exceed 2^32. Omega's EffectPayload / VisorEffectRequest used to carry a 32-bit generation, so every honest reference carried through the Visor was truncated and refused as STALE_GEN, and the Visor-path checks printed a NON-CLAIM instead of being counted (before the fix: PASS 84/84, 20 non-claims). Effect objects are now version 0x02 with a 178-byte big-endian payload carrying the full 64-bit generation; the GEN_FITS gating is removed, every Visor-path check is counted, and case 12 asserts the full generation is carried and validates, and that the same reference cut to 32 bits is STALE_GEN.