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 / machine-identity.mk

26 lines · 1482 bytes Raw Blame History
1# M20 canonical machine identity (src/runtime/aien_machine_id.h). Host-only, no
2# Physics or Aienux sources needed. Run from the repo root.
3AIEN_MID_TEST = $(OUT_DIR)/aien_machine_id_test
4
5$(AIEN_MID_TEST): tests/runtime/aien_machine_id_test.om src/runtime/aien_machine_id.om \
6 seed/ng/sha256.om
7 mkdir -p $(dir $@)
8 ( echo om2; cat seed/ng/sha256.om src/runtime/aien_machine_id.om tests/runtime/aien_machine_id_test.om ) | $(SEED_OMC) > $@
9 chmod +x $@
10
11.PHONY: test-machine-identity
12test-machine-identity: $(AIEN_MID_TEST)
13 $(abspath $(AIEN_MID_TEST))
14
15# ARGUS adapter: with RX_ARGUS_MACHINE_ID set, ARGUS stamps the canonical id into
16# its events (checked in the summary); a malformed one keeps ARGUS from starting.
17# Needs the ARGUS/aienos sources (see ARGUS_REPO, AIENOS_LOCK_REPO); not in CI.
18.PHONY: test-machine-identity-argus
19test-machine-identity-argus: $(AIEN_MID_TEST)
20 @$(MAKE) --no-print-directory $(ARGUS_R7)
21 @set -e; d=$$(mktemp -d); t=$$($(abspath $(AIEN_MID_TEST)) --kat-text); \
22 RX_ARGUS_MACHINE_ID=$$t RX_ARGUS_CONSUMER=ingest RX_ARGUS_SUMMARY=$$d/ok.json ./$(ARGUS_R7) > $$d/ok.log 2>&1; \
23 grep -q '"machine_id": "b3d2c32ee1a3ef5803e1cc604943dc8189fda2f5ea90bb5158eecc0acf5ff366"' $$d/ok.json; \
24 RX_ARGUS_MACHINE_ID=$${t}0 RX_ARGUS_CONSUMER=ingest RX_ARGUS_SUMMARY=$$d/bad.json ./$(ARGUS_R7) > $$d/bad.log 2>&1 || true; \
25 grep -q 'not a canonical machine identity' $$d/bad.log; test ! -e $$d/bad.json; \
26 rm -rf $$d; echo M20_MACHINE_IDENTITY_ARGUS_PASS