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

49 lines · 3478 bytes Raw Blame History
1# Omega Visor V1, lane 7 (authority / effect safety). "The Visor can ask. The Visor cannot grant."
2#
3# test-visor-authority hostile test: Visor effect requests vs the EXISTING authority code
4# (capability root, World publish check, AEGIS policy, generation record).
5# Links the runtime, so it is a test-only binary; build/omega never links it.
6# Uses the Makefile's $(CFLAGS) (same as RX_TEST); run with
7# PHYSICS_DIR=<physics checkout>. rx_aegis.c needs the native Aienux
8# capability library; point VISOR_AUTH_CAP_LIB (default $(AIENOS_CAP_LIB))
9# at a built libaienos_capability.a.
10# visor-authority-check isolation check: no Visor object references/defines an authority-mutating
11# symbol, and no OM-2 source of omega names one (with bite controls).
12# mk/*.mk is included before the Makefile defines AIENOS_R7_DIR/AIENOS_CAP_LIB, and a
13# prerequisite list is expanded when the rule is read, so the defaults are repeated here
14# (same values as the Makefile's R7 block, the pinned aienos.lock extraction; its later
15# definitions are then identical). The library is a prerequisite of the link, so a changed
16# libaienos_capability.a relinks the test. The old default ../aienos-r9 overrode the
17# Makefile's pinned default for every authority target (R7 to R16).
18AIENOS_LOCK_REPO ?= ../aienos-argus-cap
19# AIENOS_LOCK: the validated commit parsed at the top of the Makefile (before this include).
20AIENOS_R7_DEFAULT = $(OUT_DIR)/aienos-authority/$(AIENOS_LOCK)
21AIENOS_R7_DIR ?= $(AIENOS_R7_DEFAULT)
22AIENOS_CAP_LIB ?= $(OUT_DIR)/aienos-cap/libaienos_capability_om2.a
23VISOR_AUTH_CAP_LIB ?= $(AIENOS_CAP_LIB)
24VISOR_AUTH_RX_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \
25 src/runtime/rx_generation.c src/runtime/rx_aegis.c
26VISOR_AUTH_TEST = $(OUT_DIR)/tests-visor-authority/test_visor_authority
27
28$(OUT_DIR)/tests-visor-authority:
29 mkdir -p $@
30
31$(VISOR_AUTH_TEST): tests/visor/test_visor_authority.c $(VISOR_AUTH_RX_SRCS) \
32 $(OUT_DIR)/visor/visor_effect_request.o $(VISOR_CORE_OBJS) src/visor/visor_effect_request.h \
33 src/runtime/rx_aegis.h src/runtime/rx_caproot.h src/runtime/rx_world.h \
34 src/runtime/rx_generation.h $(VISOR_AUTH_CAP_LIB) | $(OUT_DIR)/tests-visor-authority
35 @test -f "$(VISOR_AUTH_CAP_LIB)" || { echo "error: VISOR_AUTH_CAP_LIB=$(VISOR_AUTH_CAP_LIB) not found (needed by rx_aegis.c); pass VISOR_AUTH_CAP_LIB=<path to libaienos_capability.a>" >&2; exit 1; }
36 $(CC) $(CFLAGS) -Isrc/visor -pthread -o $@ tests/visor/test_visor_authority.c $(VISOR_AUTH_RX_SRCS) \
37 $(OUT_DIR)/visor/visor_effect_request.o $(VISOR_CORE_OBJS) $(VISOR_AUTH_CAP_LIB) -lm
38
39.PHONY: test-visor-authority visor-authority-check
40test-visor-authority: $(VISOR_AUTH_TEST)
41 ./$(VISOR_AUTH_TEST)
42
43# The omega binary is pure OM-2 and has no symbol table, so nm cannot see into it. The check
44# scans the OM-2 sources it is built from ($(OMEGA_OM_SRCS), plus every tools/omega*.om,
45# om/visor, src/visor and src/language unit) for forbidden authority names, runtime prefixes
46# and authorization state, with planted-name bite controls that must be caught. The binary
47# stays a prerequisite so a source that does not compile fails the check.
48visor-authority-check: $(OUT_DIR)/visor/visor_effect_request.o $(OMEGA_BIN)
49 OMEGA_OM_SRCS='$(OMEGA_OM_SRCS)' sh tests/visor/check_authority_link.sh $(OUT_DIR)