interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / docs / campaigns / next-phase-1 / mark-evidence.sh

37 lines · 1865 bytes Raw Blame History
1#!/usr/bin/env bash
2# SPDX-License-Identifier: Apache-2.0
3# Copyright 2026 Drake Stapleton (AIEN / aien-dev)
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# NEXT-PHASE-1 v6: evidence of the Cortex record mark (ACCEPTANCE-v6 Section 6.1),
18# one JSON object on stdout. Shell + coreutils + jq only; it judges nothing.
19# Usage: mark-evidence.sh MARK_FILE [MACHINE_ID_FILE]
20# Mark layout (crates/aien-runtime/src/cortex_mark.rs:10-12, 128 bytes):
21# "AIENCXM1" | u32 version | u32 0 | machine id (bytes 16..48) | u64 seq |
22# u64 records | digest (32) | sha256 of the first 96 bytes (bytes 96..128).
23set -u
24M=${1:?MARK_FILE} MID=${2:-}
25hex() { od -An -tx1 -v | tr -d ' \n'; }
26midhex=null
27if [ -n "$MID" ] && [ -f "$MID" ]; then midhex=$(hex <"$MID" | jq -R .); fi
28if [ ! -f "$M" ]; then
29 jq -nc --argjson mid "$midhex" '{present:false, compose_machine_id_file_hex:$mid}'
30 exit 0
31fi
32jq -nc --argjson size "$(stat -c %s "$M")" --arg magic "$(head -c 8 "$M" | hex)" \
33 --arg head96 "$(head -c 96 "$M" | sha256sum | cut -d' ' -f1)" --arg tail "$(tail -c +97 "$M" | hex)" \
34 --arg mark_mid "$(tail -c +17 "$M" | head -c 32 | hex)" --arg sha "$(sha256sum "$M" | cut -d' ' -f1)" \
35 --argjson mid "$midhex" \
36 '{present:true, size:$size, magic_hex:$magic, head96_sha256:$head96, tail_hex:$tail, sha256:$sha,
37 machine_id_hex:$mark_mid, compose_machine_id_file_hex:$mid}'