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
| 1 | # Fabric interface F5-0 (src/fabric/fabric.h): membership, capability |
| 2 | # advertisement, leases and loss detection keyed by AienMachineId, over the |
| 3 | # in-process loopback transport. Files under src/fabric/ and tests/fabric/. |
| 4 | # Picked up by `-include mk/*.mk`. Not part of `all` or `test` (that runs only |
| 5 | # the omegatool gates); CI runs test-fabric and test-fabric-living (rx-host.yml). |
| 6 | # Lane 32: every Fabric build here is a TEST build (-DAIEN_TEST_BUILD=1): the |
| 7 | # loopback transport, HMAC stand-in and dispatcher refuse to compile without |
| 8 | # it, and only the R13 test-build variant links them (RX_FABRIC_TEST_SRCS); the |
| 9 | # production program carries no Fabric until a real transport exists (TRUST-1). |
| 10 | # It uses the Capability Graph only |
| 11 | # through src/runtime/rx_capq.h and links the same objects test-capability-graph |
| 12 | # links (rx_capq.o, rx_graph.o, the pinned Aienux capability library). |
| 13 | # |
| 14 | # test-fabric purity check, then the exit-gate test plain and with ASan/UBSan |
| 15 | # fabric-purity fabric objects reference no authority, World, socket or process call |
| 16 | # fabric-receipt digest-named receipt under evidence/F5-0 (clean tree only) |
| 17 | # test-fabric-living Lane 13: a second machine's Skill found and used by the |
| 18 | # COMPOSITION-2 causal path (rx_compose) through the Fabric |
| 19 | # dispatcher (fab_dispatch.c); lease loss, forgery and wrong |
| 20 | # machine refused; plain and ASan/UBSan, two runs each. The |
| 21 | # same scenario runs inside the R13 test-build variant. |
| 22 | ifndef FABRIC_MK |
| 23 | FABRIC_MK := 1 |
| 24 | .PHONY: test-fabric test-fabric-living fabric-purity fabric-receipt |
| 25 | FAB_DIR = $(OUT_DIR)/fabric |
| 26 | FAB_CFLAGS = -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 -Isrc -Isrc/runtime -Isrc/fabric \ |
| 27 | -DAIEN_TEST_BUILD=1 |
| 28 | FAB_ASAN = -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all |
| 29 | FAB_SRCS = src/fabric/fabric.c src/fabric/fab_hmac.c src/fabric/fab_loopback.c |
| 30 | FAB_LIVING_SRCS = $(FAB_SRCS) src/fabric/fab_dispatch.c |
| 31 | FAB_HDRS = src/fabric/fabric.h src/fabric/fab_hmac.h src/fabric/fab_loopback.h src/fabric/fab_dispatch.h \ |
| 32 | src/runtime/rx_skillroute.h \ |
| 33 | src/runtime/rx_capq.h src/runtime/aien_machine_id.h src/runtime/rx_jspace.h |
| 34 | # Routing discovers and carries records; it never grants authority, never |
| 35 | # touches the World, and F5-0 opens no socket and starts no process. |
| 36 | FAB_FORBIDDEN = ' U (aienos_|rx_caproot_|rx_world_|rx_aegis|argus_|ag_cap|socket$$|connect$$|bind$$|listen$$|accept$$|sendto$$|recvfrom$$|fork$$|exec|system$$|dlopen$$|mmap$$)' |
| 37 | # Decoupled from legacy C runtime & libaienos_capability.a: Fabric links only |
| 38 | # rx_capq.o (backed by om/runtime/rx_capq_core.om), aien_machine_id.c, and OM-2 units. |
| 39 | FAB_LINK_SRCS = src/omega_om_units.c src/runtime/aien_machine_id.c |
| 40 | |
| 41 | $(FAB_DIR)/%.o: src/fabric/%.c $(FAB_HDRS) |
| 42 | @mkdir -p $(FAB_DIR) |
| 43 | $(CC) $(FAB_CFLAGS) -c -o $@ $< |
| 44 | |
| 45 | fabric-purity: $(FAB_DIR)/fabric.o $(FAB_DIR)/fab_hmac.o $(FAB_DIR)/fab_loopback.o $(FAB_DIR)/fab_dispatch.o |
| 46 | @if nm -u $^ | grep -E $(FAB_FORBIDDEN) ; then \ |
| 47 | echo "fabric object references an operation the Fabric must not have"; exit 1; fi |
| 48 | @echo "fabric-purity: fabric.o, fab_hmac.o, fab_loopback.o and fab_dispatch.o reference no forbidden symbol" |
| 49 | |
| 50 | FAB_OMC ?= seed/out/omc |
| 51 | FAB_OM_SRCS = seed/ng/sha256.om src/runtime/aien_machine_id.om \ |
| 52 | src/fabric/fab_hmac.om src/fabric/fab_loopback.om src/fabric/fabric.om |
| 53 | |
| 54 | $(FAB_DIR)/fabric_test: tests/fabric/fabric_test.om $(FAB_OM_SRCS) $(FAB_OMC) |
| 55 | @mkdir -p $(FAB_DIR) |
| 56 | (printf 'om2\n'; sed '/^om2$$/d' $(FAB_OM_SRCS) tests/fabric/fabric_test.om) | $(FAB_OMC) > $@ && chmod +x $@ |
| 57 | |
| 58 | test-fabric: $(FAB_DIR)/fabric_test |
| 59 | $(abspath $(FAB_DIR)/fabric_test) |
| 60 | |
| 61 | test-fabric-living: fabric-purity |
| 62 | @$(MAKE) --no-print-directory $(RX_CAPQ_OBJ) $(RX_GRAPH_OBJ) $(RX_SKILLROUTE_OBJ) $(OUT_DIR)/rx_cortex.o $(AIENOS_CAP_LIB) |
| 63 | $(CC) $(CFLAGS) $(FAB_CFLAGS) -Itests/runtime -Itests/fabric -pthread -o $(FAB_DIR)/fabric_living_test \ |
| 64 | tests/fabric/fabric_living_test.c $(FAB_LIVING_SRCS) $(RX_COMPOSE_SRCS) $(RX_COMPOSE_LINK) |
| 65 | $(CC) $(CFLAGS) $(FAB_CFLAGS) $(FAB_ASAN) -Itests/runtime -Itests/fabric -pthread \ |
| 66 | -o $(FAB_DIR)/fabric_living_test_asan tests/fabric/fabric_living_test.c $(FAB_LIVING_SRCS) \ |
| 67 | $(RX_COMPOSE_SRCS) $(RX_COMPOSE_LINK) |
| 68 | $(abspath $(FAB_DIR)/fabric_living_test) |
| 69 | $(abspath $(FAB_DIR)/fabric_living_test_asan) > $(FAB_DIR)/living_asan.out |
| 70 | @grep -q '^FABRIC_LIVING_PASS$$' $(FAB_DIR)/living_asan.out && echo "test-fabric-living: ASan/UBSan run PASS" |
| 71 | |
| 72 | fabric-receipt: |
| 73 | tests/fabric/fabric_receipt.sh |
| 74 | endif |