aien
aien-dev/aien
Brought by drakestapleton
aien / docs / GOAL_MICROJOBS.md
| 1 | # Goal to typed microjobs (Allen #13) |
| 2 | |
| 3 | Allen keeps one persistent objective as a typed, dependency-bound microjob DAG plus an append-only event journal. The seeded `.om` kernel `src/goal_microjobs/kernel.om` is the only admission logic: it replays plan + journal from stdin and either prints the derived state or refuses with a code. It runs no job, calls no model, and writes no memory or authority state. The model or planner proposes; the kernel decides what is admitted. |
| 4 | |
| 5 | Status: **IMPLEMENTED, HOST_TESTED (offline, synthetic fixtures)**. The bounded canonical Aienet-0 adapter below is also HOST_TESTED. Not run: model inference, Cortex write/restart, general multi-node canonical export, routing comparison, GPU or physical qualification. Deployment OFF. |
| 6 | |
| 7 | ## Boundary |
| 8 | |
| 9 | | Here (Allen) | Owner elsewhere | |
| 10 | |---|---| |
| 11 | | Objective plan records, journal replay, admission refusals, derived node state, objective receipt line | Execution of a node: Omega scheduler / FORGE placement; worker admission: Core #735 | |
| 12 | | Retry, budget, cancellation, correction and effect-once rules over the journal | Canonical wire ABI: aien-protocols-mv#50 (`specs/microjob/SPEC.md`, MJB1/MJR1 draft) | |
| 13 | | Local journal file in an owner-private directory (mode 700) | Durable memory: Omega Cortex (ADR 0022); the Cortex writer adapter does not exist yet | |
| 14 | |
| 15 | The journal is not Cortex and is not a second memory store: it is the local replay log of one objective until the Cortex owner publishes a typed writer. The existing transitional shell (`scripts/goal_microjobs/microjobs.sh`) handles files, the `flock` lock and the atomic rename. Current seeded Omega has file and argument APIs; the shell has not been migrated. The NL-5 shadow experiment below does not invoke this writer. |
| 16 | |
| 17 | ## Records (local replay ABI; canonical adapter below) |
| 18 | |
| 19 | Whitespace-separated decimal words, one record per line. A 32-byte SHA-256 digest is written as four big-endian 64-bit words (`microjobs.sh digest TEXT`). |
| 20 | |
| 21 | Header: `1 abi objective(4) owner runtime effect_ceiling node_count terminal max_attempts max_model_calls max_tokens budget_in budget_out budget_time_ms` |
| 22 | |
| 23 | Node (ids 1..N in order): `2 id kind op route profile effect in_tok out_tok req_in req_out verifier_kind verifier retry_class max_attempts tenant time_ms required operand(4) ndeps deps...` |
| 24 | |
| 25 | Event: `3 seq type node attempt generation issuer verdict digest(4) tokens time_ms` |
| 26 | |
| 27 | | Event type | Admitted when | Effect | |
| 28 | |---|---|---| |
| 29 | | 1 DISPATCH | node pending, all dependencies done, current generation, attempt = previous + 1, issuer is a worker (not owner, runtime or the node verifier), attempts and model-call and token reservations within budget | running; reserves `in_tok + out_tok` for a NEURAL node | |
| 30 | | 2 RESULT | running, same attempt and generation, same worker, digest not zero, tokens and time within the node contract, COMPUTE spends zero tokens | resulted (awaiting verification) | |
| 31 | | 3 VERIFY | resulted, issuer is the node verifier and not the worker, digest equals the result | verdict 1: done; verdict 0: retry or failed | |
| 32 | | 4 FAIL | running, issuer is the worker or the runtime (orphaned lease after a restart) | retry while attempts remain, else failed | |
| 33 | | 5 CANCEL | issuer is the owner; node 0 cancels the objective | node and every transitive dependent not done become cancelled | |
| 34 | | 6 CORRECT | issuer is the owner, names the current generation, new operand digest differs | node and every transitive dependent: generation + 1, reset to pending | |
| 35 | | 7 REFUSE | the running worker abstains, or the runtime refuses a pending node | refused (terminal for that generation) | |
| 36 | | 8 EFFECT | issuer is the runtime, node done with effect class 2, current generation, idempotency key not zero | effect committed once per generation | |
| 37 | |
| 38 | Output: `100 status nodes done attempts model_calls tokens_reserved last_seq time_ms cancelled tokens_used`, one `101 id state generation attempts blocked ready effect_generation` per node, `102 ready-ids...`, and when complete `103 objective(4) terminal_result(4) terminal_generation last_seq`. Objective status: 1 active, 2 complete, 3 failed, 4 cancelled, 5 blocked, 6 stalled (nothing running or fundable). Node state: 1 pending, 2 running, 3 resulted, 4 done, 5 failed, 6 cancelled, 7 refused. Complete means every required node done, the terminal node verified and every required effect committed at its current generation. |
| 39 | |
| 40 | Refusal codes (`199 seq code`, exit = code): 2 truncated, 3 malformed or too large, 4 read error, 5 wrong record tag, 10 ABI version, 11 node count, 12 node id order, 13 enum, 14 token profile, 15 needs expansion, 16 no verifier, 17 cross tenant, 18 unauthorized effect, 19 missing or duplicate dependency, 20 cycle, 21 terminal invalid or optional, 22 missing operand, 23 retry class, 24 zero cap, 25 no objective/owner/runtime, 26 over budget, 30 sequence, 31 unknown node, 32 unknown event, 33 wrong state, 34 stale generation, 35 wrong attempt, 36 attempts exhausted, 37 model-call budget, 38 token budget, 39 unauthorized issuer, 40 self-verification, 41 digest, 42 over node contract, 43 dependency not done, 44 effect not allowed, 45 duplicate effect, 46 correction without change, 47 objective cancelled, 48 tokens on COMPUTE, 49 verdict. |
| 41 | |
| 42 | ### Alignment with the MJB1 draft |
| 43 | |
| 44 | Checked against `specs/microjob/SPEC.md` draft v0.1 on aien-protocols-mv main `e705fdc9c97394f17f32f1dcbcbf038ca556250b`. Same closed values: kind (1 COMPUTE, 2 NEURAL), op ranges per kind, profile 0..4 with caps 64/16, 128/32, 256/64, 512/128, effect class 0/1/2 bounded by the header ceiling, verifier kind 1..3, retry class 1..3, max attempts 1..8. Same rules: COMPUTE spends zero tokens; required tokens above caps refuse as needs-expansion (no silent truncation); NEVER with more than one attempt and EFFECT with IDEMPOTENT refuse; sums of node input-token, output-token and time caps stay within header budgets; node tenant equals the objective tenant; dependency cycle refuses. The local replay kernel and canonical document serve different roles. Its original admission and event semantics are unchanged. |
| 45 | |
| 46 | Allen-local records intentionally retain integer authority roles, routes, required/terminal markers and journal sequence numbers. Canonical documents use explicit external references and are re-issued for each generation. `canon.om` supports only the bounded one-node COMPUTE/MATMUL Aienet-0 shape, not arbitrary local DAG export. Cryptographic MJR1 and AN0V verification remains with the protocols/Open Humanity checker, not the replay kernel. |
| 47 | |
| 48 | ## Restart, partial completion and duplicates |
| 49 | |
| 50 | Every `propose` takes the lock, copies the journal to `journal.cand`, appends one event, replays plan + candidate through the kernel, and only on exit 0 runs `sync` and renames the candidate over the journal. A writer killed before the rename leaves the journal unchanged; a restarted process replays the same bytes to the same state. A running lease left by a stopped process is closed by a runtime FAIL and retried as a new attempt; the late result of the old attempt and any repeated result or effect are refused. |
| 51 | |
| 52 | ## Reproduce |
| 53 | |
| 54 | ```sh |
| 55 | OMEGA_WORKTREE=<seeded Omega worktree at c434565c> bash tests/goal_microjobs/gate.sh |
| 56 | ``` |
| 57 | |
| 58 | `scripts/goal_microjobs/build.sh` checks the same Omega commit and compiler pins as Allen #12's harness gate. The gate writes `evidence/goal-microjobs/offline-*/` (unsigned receipt, transcript, final status and journal, mutation table). |
| 59 | |
| 60 | The historical compiler is **not tracked at that Omega revision**. A fresh |
| 61 | clone without archived `build/L574/toolchain` artifacts returns exit 3 with |
| 62 | `BLOCKED`, rather than an unexplained checksum failure. Supply that archive |
| 63 | under the pinned checkout before running the gate. Required archive identities: |
| 64 | `build/bootstrap/omc` SHA-256 |
| 65 | `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`; |
| 66 | `seed/omc/omc.om` SHA-256 |
| 67 | `8608fa11f6a2cf1c50db22d871eef16b00d5bc719bc1a222cc3e456984ac5ebf`. |
| 68 | The archive also contains `tools/verify-elf.sh`. No download or compiler |
| 69 | substitution is implicit. Without this prerequisite the replay is BLOCKED, |
| 70 | not PASS. PR #14 delivers the admission/replay kernel only; the open #13 |
| 71 | items below remain a separate workstream. |
| 72 | |
| 73 | The 12-node acceptance objective runs nodes 1 to 4 concurrently before the join at node 7; it has five COMPUTE nodes with zero tokens before the correction, three bounded NEURAL routes, one refused optional teacher route, one model failure with retry, one interrupted lease after a SIGKILL'd writer, one rejected model answer with retry, and one owner correction of node 3 that resets exactly nodes 3, 7, 8, 9, 10, 11, 12. Expected totals, recomputed with the Wolfram Language evaluator: tokens reserved (60+12) + 2(120+30) + 4(120+30) = 972; tokens used 50+40+110+120+118+116 = 554; time 12531 ms; 18 attempts; 7 model calls; static caps 800 input, 192 output, 18800 ms against budgets 1000, 256 and 20000. |
| 74 | |
| 75 | ## Open |
| 76 | |
| 77 | - General canonical multi-node export, neural jobs and non-COMPLETED canonical outcomes are outside the bounded Aienet-0 adapter. |
| 78 | - Cortex writer and restart through the Omega owner; Core #735 worker admission and dispatch; qualified-worker registry for route selection. |
| 79 | - Objective text to DAG rule baseline and shadow route policy; ordinary routing vs microjob comparison; native `.om` plan export. |
| 80 | |
| 81 | ## Canonical Aienet-0 adapter (M1) |
| 82 | |
| 83 | `src/goal_microjobs/canon.om` is IMPLEMENTED and HOST_TESTED against protocols |
| 84 | `e705fdc9c97394f17f32f1dcbcbf038ca556250b`. It emits canonical MJB1 bytes, |
| 85 | hashes them in Omega, and checks receipt/countersign bindings before formatting |
| 86 | local RESULT and VERIFY events. It does not verify P-256 signatures, execute a |
| 87 | worker, authenticate integer authority roles, append a journal, or grant authority. |
| 88 | The caller MUST successfully run `aienet0-run check` against its pinned executor |
| 89 | and independent verifier keys before ingest, and replay/atomically commit the |
| 90 | events through the kernel. Passing ingest alone is not authenticated completion. |
| 91 | **Ingest is not a standalone verifier. It must only receive the exact immutable |
| 92 | document/MJR1/AN0V bytes that passed that Rust check.** In particular, ingest |
| 93 | does not verify either signature, source/model/policy hashes, fuel/memory/work |
| 94 | accounting or the recompute verdict's cryptographic derivation. Refreshing an |
| 95 | AN0V receipt hash is not signature verification. A changed AN0V signature can |
| 96 | still pass ingest; it must fail the preceding Rust checker. |
| 97 | |
| 98 | ### Build and pins |
| 99 | |
| 100 | ```sh |
| 101 | OMEGA_OMC=/path/to/omc OMEGA_MV=/path/to/omega-checkout \ |
| 102 | sh scripts/goal_microjobs/canon-build.sh /tmp/canon |
| 103 | ``` |
| 104 | |
| 105 | The compiler is Omega `e5b32567`, SHA-256 |
| 106 | `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`. |
| 107 | The build extracts `55845e70:om/sha256/sha256-om2.om` from that checkout and |
| 108 | requires SHA-256 `dbf002dd6aa36585632b9d01d98ac3f0bd2fa0f0475082940de53638847994bb`. |
| 109 | Only the four `export fn` prefixes are removed for program mode, following the |
| 110 | protocols jobpath build convention. Missing artifacts or mismatches exit 3 with |
| 111 | BLOCKED; they never invoke a fallback compiler. The shell script is a migration |
| 112 | build adapter under [shell retirement #22](https://github.com/aien-dev/aien/issues/22), |
| 113 | not a first-party runtime implementation. |
| 114 | |
| 115 | ### Emit |
| 116 | |
| 117 | `/tmp/canon emit < records > emission` consumes exactly these four whitespace |
| 118 | decimal records (all digest groups are four big-endian u64 words): |
| 119 | |
| 120 | 1. The existing 17-word header record, including tag 1. |
| 121 | 2. One 23-word node record, including tag 2 and `ndeps=0`. |
| 122 | 3. That node's kernel status record: |
| 123 | `101 id state generation attempts blocked ready effect_generation`. |
| 124 | 4. The explicit binding record: |
| 125 | `4 objective(4) tenant(4) subject(4) approval(4) capability(4) expires_at m k n seed incarnation`. |
| 126 | |
| 127 | Every reference group and expiry must be nonzero; binding objective must equal |
| 128 | the header objective. The caller supplies the actual Aienet-0 `tenant()` and |
| 129 | `capability()` values and the submitter's `approval_ref`, never integer stand-ins. |
| 130 | Dimensions are 1 through 256; seed is u64; incarnation and generation are |
| 131 | nonzero u32; node id is nonzero u16. The 15-byte payload is kind 1, m/k/n u16 BE, |
| 132 | then seed u64 BE. Its SHA-256 must equal the node operand digest. A correction |
| 133 | uses the kernel's corrected operand and derived generation, not the original |
| 134 | plan's stale operand. Node shape is COMPUTE/MATMUL, route 0, profile ZERO, |
| 135 | effect COMPUTE, zero token caps and requirements, RECOMPUTE, NEVER/one attempt, |
| 136 | no dependencies, and a nonzero local verifier. |
| 137 | |
| 138 | Output framing is `document[640] || payload[15] || dag_digest[32]`, all binary: |
| 139 | |
| 140 | ```sh |
| 141 | dd if=emission of=document bs=1 count=640 status=none |
| 142 | dd if=emission of=payload bs=1 skip=640 count=15 status=none |
| 143 | dd if=emission of=dag_digest bs=1 skip=655 count=32 status=none |
| 144 | ``` |
| 145 | |
| 146 | The one-node document uses the supplied refs, incarnation and expiry. Node and |
| 147 | operand generations both equal the derived status generation. RECOMPUTE has |
| 148 | zero verifier_ref and pure=1; cancel DISCARD, CPU substrate, exact precision, |
| 149 | DIGEST rank-zero result; unused and reserved bytes are zero. Time cap comes |
| 150 | from the local node. Fuel/work are `m*k*n`; memory is `4*(m*k+k*n+m*n)`, following |
| 151 | the protocols profile. Header budgets equal the single node's caps. |
| 152 | |
| 153 | Job identity is the first 16 bytes of |
| 154 | `SHA-256("AIEN-ALLEN-AN0-JOB-V1\0" || objective[32] || node_id_u16_BE || generation_u32_BE)`; |
| 155 | idempotence uses `"AIEN-ALLEN-AN0-IDEM-V1\0"` with the same suffix. |
| 156 | NUL is a literal zero byte. Changing generation changes both identities and |
| 157 | the document/dag digest, not the authority references. |
| 158 | |
| 159 | ### Ingest |
| 160 | |
| 161 | `/tmp/canon ingest < ingest-input > events` consumes: |
| 162 | `document[640] || MJR1[404] || AN0V[236] || expected_ascii`, where the final |
| 163 | ASCII record is: |
| 164 | |
| 165 | `5 node generation attempt worker verifier executor_key_sha256(4) verifier_key_sha256(4) next_sequence objective_id(4) effective_operand_digest(4)` |
| 166 | |
| 167 | This is exactly 23 decimal words. The original first 15 words are unchanged; |
| 168 | objective occupies zero-based words 15..18 and effective operand 19..22. |
| 169 | The caller MUST derive those pins from its trusted objective header and replayed |
| 170 | effective operand (including the latest CORRECT), never from the supplied |
| 171 | document or receipt. A different objective or operand must not complete the |
| 172 | original task even when its bundle and signatures are otherwise valid. |
| 173 | |
| 174 | The key digests are SHA-256 of the 33-byte compressed SEC1 public keys, not keys |
| 175 | or signatures. Worker/verifier are the caller's pinned local role integers, |
| 176 | nonzero and distinct. The adapter checks document objective and CONTENT operand |
| 177 | digest against those independent pins, then derives job/idempotence identities |
| 178 | from the expected objective and node. It requires the receipt's full 32-byte |
| 179 | job/idempotence pair, generation, attempt (one), COMPLETED outcome, dag digest, |
| 180 | nonzero output, zero COMPUTE tokens and bounded time. It checks all MJR1 reserved |
| 181 | bytes are zero and recomputes input_binding as |
| 182 | `SHA-256("MJR1-BIND" || operand_kind_u8 || operand_generation_u32_BE || operand_digest)`, |
| 183 | following SPEC section 5.1 for one operand and no dependencies. |
| 184 | It checks AN0V framing, hash of the entire 404-byte receipt (including signature), |
| 185 | cross-record dag/output/verdict equality, and both public-key hashes. |
| 186 | |
| 187 | On success exactly two lines are emitted: |
| 188 | `3 seq 2 node attempt generation worker 0 output(4) 0 used_time_ms`, then |
| 189 | `3 seq+1 3 node attempt generation verifier 1 output(4) 0 0`. |
| 190 | MJR1 used_time_ms is decoded at offset 76 and output at 144. No event is |
| 191 | printed for any input mismatch. Duplicate completion and stale replay are |
| 192 | ultimately refused by the existing kernel, not by pretending ingest owns a |
| 193 | durable ledger. The caller must atomically append both lines, or after a crash |
| 194 | compare an already appended RESULT byte-for-byte and append only its matching |
| 195 | VERIFY. Never re-dispatch or replace an existing completion on recovery. |
| 196 | |
| 197 | Refusals print `CANON_<NAME>` to stderr and exit: 2 INPUT (including truncation), |
| 198 | 3 IO, 10 REF, 11 PAYLOAD, 12 SHAPE, 13 RANGE, 14 GENERATION, 15 JOB, |
| 199 | 16 OUTCOME, 17 DAG, 18 OUTPUT, 19 AN0V, 20 KEYPIN, 21 ATTEMPT, 22 RESOURCE, |
| 200 | 23 OBJECTIVE, 24 OPERAND, 25 BINDING, 26 RESERVED. |
| 201 | No refusal writes event/document bytes to stdout. |
| 202 | |
| 203 | ### Host acceptance and limits |
| 204 | |
| 205 | ```sh |
| 206 | taskset -c 10-14 nice -n 19 ionice -c3 env \ |
| 207 | OMEGA_OMC=/path/to/pinned/omc OMEGA_MV=/path/to/omega-checkout \ |
| 208 | OMEGA_WORKTREE=/path/to/archived/c434565c \ |
| 209 | CANON_RUN_ROOT=/tmp/canon-results bash tests/goal_microjobs/canon/run.sh |
| 210 | ``` |
| 211 | |
| 212 | Prerequisites: AArch64 Linux, the two pinned compilers above and the existing |
| 213 | kernel compiler archive described under Reproduce, bash, coreutils, git, sed, |
| 214 | xxd. The committed synthetic hex fixtures were generated with an external |
| 215 | throwaway Rust oracle using protocols `e705fdc9`, `p256 0.14.0` and `sha2 0.10.9`. |
| 216 | The positive receipt/countersign use deterministic synthetic test keys; these |
| 217 | are not credentials or hardware receipts. The external Rust check compared |
| 218 | the complete Omega document to independent Rust `encode`, verified `decode` |
| 219 | and `dag_digest`, `seal_bundle`/`admit_bundle`, `executor_receipt`/`check_receipt`, |
| 220 | `countersign`/`check_countersign`, exact event bytes, and generation-two admission. |
| 221 | The throwaway helper is not shipped. Fresh clones can replay the committed |
| 222 | byte-level oracles without Cargo or generated helper source. |
| 223 | |
| 224 | The gate checks exact emission and events, nineteen refusal fixtures and sixteen |
| 225 | source mutants, replay through the archived kernel to DONE, and compiler |
| 226 | pin refusal. Guard-isolating malformed fixtures deliberately refresh AN0V |
| 227 | bindings without signatures where necessary: they test individual structural |
| 228 | guards, not authenticated network acceptance. `staleoutput` leaves signatures |
| 229 | and AN0V stale and is also rejected by the external Rust receipt checker. |
| 230 | The mutant table records that each guardless binary accepts its targeted |
| 231 | malformed input while the real adapter refuses with the named code. |
| 232 | The new objective/operand swap fixtures carry valid independently admitted, |
| 233 | executed, signed and countersigned jobs; they are refused only because the |
| 234 | caller's expected task differs. The objective-pin mutant removes both the |
| 235 | explicit equality check and expected-objective identity derivation. The |
| 236 | idempotence-only fixture kills the specific mutant shortening the comparison |
| 237 | from 32 to 16 bytes. Three reserved-byte-region fixtures share one guard mutant. |
| 238 | |
| 239 | WolframLanguageEvaluator: `FromDigits[ToCharacterCode["MJB1"],256]`, |
| 240 | `FromDigits[ToCharacterCode["MJR1"],256]`, |
| 241 | `FromDigits[ToCharacterCode["AN0V"],256]` returned 1296712241, 1296716337, |
| 242 | 1095643222. Query `3*2*2` and `4*(2*3+3*2+2*2)` returned fixture caps 12 and |
| 243 | 64 bytes. Bounded-dimension maxima queries returned work 16777216 and memory |
| 244 | 786432 bytes, both representable in the encoded u64 cap fields. |
| 245 | These are computed bounds, not measured performance. |
| 246 | |
| 247 | HOST_TESTED is not hardware qualification. P1 two-machine, P2 federation, |
| 248 | GPU, deployment and merge are NOT_RUN. General DAG conversion and P-256 |
| 249 | verification in Omega are not claimed. |
| 250 | |
| 251 | ### M1 loopback execution and interruption acceptance |
| 252 | |
| 253 | `tests/goal_microjobs/aienet-m1/sequence.sh` is a shell migration adapter |
| 254 | under [aien#22](https://github.com/aien-dev/aien/issues/22), not a new |
| 255 | admission or signature implementation. It reads the current generation from |
| 256 | kernel status and routes the kernel-validated journal through `recovery.om` |
| 257 | to derive the effective operand, then calls `canon emit`, persists the unchanged |
| 258 | signed bundle before DISPATCH, resends with the worker's durable `--retry` |
| 259 | state, checks signatures and independent recomputation through Open Humanity, |
| 260 | then calls `canon ingest` and proposes RESULT and VERIFY through the kernel. |
| 261 | `recovery.om` compares every field of an already-persisted RESULT with the |
| 262 | canonical RESULT before VERIFY-only recovery (mismatch: exit 33). The current |
| 263 | kernel generation is supplied to canonical ingestion. Immediately before ingest, |
| 264 | recovery replays the current trusted plan+journal again. The sequencer routes |
| 265 | the objective from its effective header and operand from its effective node into |
| 266 | the final eight words of canon's 23-word expected record; neither pin comes from |
| 267 | the submitted document or bundle. Stale receipts with changed operands refuse |
| 268 | at the earlier operand check (exit 24). A correction round-trip returning to the |
| 269 | original operand isolates stale-generation refusal (exit 14). These decisions |
| 270 | remain in Omega, not shell admission rules. |
| 271 | `recovery-build.sh` checks the same e5b32567 compiler digest as canon-build.sh. |
| 272 | |
| 273 | Effective-operand folding streams the unchanged kernel plan+journal bytes after |
| 274 | a `1\n` mode prefix, retaining only one event. It has no event-count ceiling. |
| 275 | The prefix is excluded from the byte count. The same input-size rule as |
| 276 | `kernel.om:10,60-79` applies: its 262144-byte buffer refuses input length |
| 277 | greater than or equal to 262143 (exit 3), including trailing whitespace. |
| 278 | `recovery.om` emits the updated 40-word header/node before the sequencer adds |
| 279 | the current status and explicit binding for canonical emission. |
| 280 | |
| 281 | Build `canon` with the preceding pinned build command. Materialize the SHA |
| 282 | oracle source without modifying its checkout: |
| 283 | |
| 284 | ```sh |
| 285 | mkdir -p /tmp/aienet-m1-sha |
| 286 | git -C "$OMEGA_MV" archive 55845e70 om/sha256/sha256-om2.om | |
| 287 | tar -x -C /tmp/aienet-m1-sha |
| 288 | taskset -c 10-14 nice -n 19 ionice -c3 env \ |
| 289 | OH_TREE=/home/drakestapleton/fix/aienet-oh-seal \ |
| 290 | PROTOCOLS=/tmp/aienet/aien-protocols-mv \ |
| 291 | OMEGA_WORKTREE=/home/drakestapleton/workspace/allen-harness-evolution-omega \ |
| 292 | RECOMPUTE_OMC=/home/drakestapleton/workspace/omega-mcp/build/omc \ |
| 293 | SHA_OMEGA_TREE=/tmp/aienet-m1-sha CANON=/tmp/aienet-m1-canon \ |
| 294 | bash tests/goal_microjobs/aienet-m1/run.sh /tmp/aienet-m1-fresh-output |
| 295 | ``` |
| 296 | |
| 297 | The output directory must not exist. The harness builds both OH release |
| 298 | binaries from the explicitly supplied seal-document worktree and resolves |
| 299 | their executables from Cargo's reported artifacts, including when |
| 300 | `CARGO_TARGET_DIR` is set. It verifies the recompute pin and records the exact |
| 301 | OH revision, both OH binary digests, canonical source revision and canonical |
| 302 | binary digest in `summary.tsv`, with one expected/observed row per case. |
| 303 | `mutants.tsv` counts a mutant as killed only for its named semantic failure; |
| 304 | setup errors are not kills. Baseline failures prevent mutant qualification. |
| 305 | |
| 306 | Cases cover happy completion; SIGKILL after bundle persistence, DISPATCH, |
| 307 | receipt plus AN0V publication and RESULT; worker SIGKILL after durable admission |
| 308 | and after durable completion; generation correction; signature-covered MJR1 |
| 309 | mutation; executor-signed wrong output; duplicate receipt and an independently |
| 310 | signed second completion; signature-only AN0V mutation; and RESULT-only recovery |
| 311 | with a kernel-valid but conflicting persisted time charge. Negative self-tests |
| 312 | prove the DONE helper rejects RESULTED, missing and duplicate node-1 status |
| 313 | records. History regressions exercise multiple CORRECTs, 257 and 1000 CORRECTs, |
| 314 | and two CORRECTs after a persisted RESULT. Capacity probes check the largest |
| 315 | accepted kernel input and refused boundary/over-capacity inputs against both |
| 316 | kernel and recovery, with matching observed exits in `capacity.tsv`. |
| 317 | Authenticated substitution regressions replace a complete validly signed job, |
| 318 | receipt and countersign after publication but before ingest. Different objective |
| 319 | and operand substitutions must pass Open Humanity's pinned-key check but refuse |
| 320 | at canon with 23 and 24 respectively, emit no events, preserve the journal and |
| 321 | leave the generation running. A generation-two pre-CORRECT operand substitution |
| 322 | also refuses with 24. Restoring the original checked bytes then completes the |
| 323 | same dispatch exactly once. Observed exits are filed in `pin-refusals.tsv`. |
| 324 | Guard-removal mutants challenge persist-before-DISPATCH, check-before-ingest, |
| 325 | current-generation routing and Omega RESULT conflict checking. A fifth mutant |
| 326 | stops folding after the first CORRECT; the last-CORRECT regression must kill it. |
| 327 | Two further mutants pass the submitted document's own objective or operand as |
| 328 | the expected pin; the authenticated substitution cases must kill both. |
| 329 | Every accepted generation has one DISPATCH, RESULT and VERIFY. |
| 330 | Recovery checks that persisted bundle bytes never change. |
| 331 | |
| 332 | All identities and payload bindings here are explicit synthetic test values. |
| 333 | Disposable private scalars are generated by `openssl rand -hex 32` in an |
| 334 | owner-private `/dev/shm` directory and deleted on exit. Only loopback ephemeral |
| 335 | ports are used; workers have owned state directories and owned process IDs. |
| 336 | No GPU, model server, P1 second machine, P2 federation, Core TUR settlement, |
| 337 | production deployment or hardware qualification is exercised by this harness. |
| 338 | |
| 339 | ## NL-5: default-off private-local shadow experiment |
| 340 | |
| 341 | Issue [#19](https://github.com/aien-dev/aien/issues/19), parent |
| 342 | [architecture #349](https://github.com/aien-dev/aien-architecture-mv/issues/349). |
| 343 | This is a synthetic host experiment, not a serving route or a learned channel. |
| 344 | The source is stacked on the unchanged #13 kernel at |
| 345 | `52067ba2ec2e631db017fb9e700f31c048f1a12d` (PR #14). |
| 346 | |
| 347 | `src/goal_microjobs/shadow.om` emits an Allen-local plan and proposed journal. |
| 348 | Only the existing `kernel.om` admits that journal. It does not call the |
| 349 | transactional writer, execute effects, open files or sockets, read activations, |
| 350 | write Cortex, create an identity, or change ordinary routing. No arguments |
| 351 | means exit 64 with no output. Exact opt-in is |
| 352 | `--private-local-shadow A|B|C SCENARIO`; no arbitrary task, trace or endpoint |
| 353 | input is accepted. All data is fixed public synthetic fixture data. Runtime |
| 354 | scratch expires on process exit; private-local redirects should use `umask 077`. |
| 355 | Local opt-in grants no publication, training or Open Humanity consent. |
| 356 | |
| 357 | ### Paired arms and invariant task |
| 358 | |
| 359 | - A: deterministic text specialist. Each hop serializes `add X Y`, parses it, |
| 360 | and returns the arithmetic result. This is a constrained text stub, not |
| 361 | ordinary Allen-to-model routing or an NLP quality result. |
| 362 | - B: deterministic typed specialist. Each hop serializes three little-endian |
| 363 | u64 fields (operation 1, lhs, rhs), decodes them and computes the same result. |
| 364 | This is an internal test message, not MJB1 or SEM-WIRE. |
| 365 | - C: unsupported latent interface; explicitly reports `NOT_RUN` and falls back |
| 366 | to B. It never treats a numerical message as authority. Scenario 4 injects a |
| 367 | bad proposed value into the stub, requires its independent rejection, then |
| 368 | recomputes from the original typed operands. This tests fallback mechanics, |
| 369 | not a trained projector or the actual LTP0 decoder. |
| 370 | |
| 371 | All arms share the exact objective, owner 7, Allen runtime 9, verifier 5, |
| 372 | worker 20, pure effect ceiling 0, dependency graph and budgets. These small |
| 373 | identifiers and result words are explicitly Allen-local synthetic references, |
| 374 | not canonical identity/digest claims. The 12-node graph has four roots, a join |
| 375 | at node 5, a chain to required terminal node 11, and optional node 12. |
| 376 | Node 4 exercises the existing bounded NEURAL admission class without inference. |
| 377 | The same attempt/model/token/time caps are emitted for each normal arm. The |
| 378 | new harness also charges every specialist attempt, including fallback, against |
| 379 | the same 32-call work cap, with a fixed 128-byte message buffer and bounded |
| 380 | loops. The native conductor applies the same default child deadline to all |
| 381 | arms. Plan token/time fields are reservations and synthetic charges, not |
| 382 | observed model tokens or elapsed wall time. |
| 383 | |
| 384 | The independent oracle is Wolfram, not another invocation of the specialist. |
| 385 | Raw verification calls and task query/results are in |
| 386 | `evidence/nl5-wolfram.jsonl`; the fixed expected table is |
| 387 | `tests/goal_microjobs/shadow-oracle.om`. Every proposed result is compared |
| 388 | before verifier verdict 1. A rejected result never completes the objective. |
| 389 | Initial terminal value is 65; correcting node 3 changes it to 66. These are |
| 390 | oracle values from the filed Wolfram output, not performance statistics. |
| 391 | |
| 392 | | Scenario | Exercised behavior | |
| 393 | |---|---| |
| 394 | | 0 | Complete the equivalent pure objective; optional node 12 refused | |
| 395 | | 1 | Owner correction invalidates affected generations; verified terminal changes | |
| 396 | | 2 | Cancel node 5 and descendants; objective blocked, never complete | |
| 397 | | 3 | Stop at four completed roots; saved prefix replays and full journal restarts identically | |
| 398 | | 4 | Wrong result: A/B exit 65 with verifier rejection; C stub refuses it and recomputes typed fallback | |
| 399 | | 5 | Dispatch before dependencies: kernel exit 43 | |
| 400 | | 6 | Correction by worker, not owner: kernel exit 39 | |
| 401 | | 7 | Exhaust neural admission budget: kernel exit 37 | |
| 402 | | 8 | Attempt effect in pure shadow: kernel exit 44 | |
| 403 | | 9 | Duplicate result after completion/replay: kernel exit 33 | |
| 404 | |
| 405 | ### Reproduce and evidence |
| 406 | |
| 407 | Compiler source is Omega PR #919 at |
| 408 | `e79566c191ea8ef11888e69ce50d8fadf375d4fd`; committed `seed/out/omc` |
| 409 | SHA-256 is `d6290c7663c2b4bafb59eb3fdf812476e977f4c144def71095c6248ef9b96b84`. |
| 410 | This binary was introduced by upstream commit |
| 411 | `1fe5976d398646b17acabbf6d9dfae96b017e439` (diagnostics/Qty), not a local |
| 412 | rebuild. The older 2c824805 and 49923639 guide pins are different compiler |
| 413 | revisions and must not be substituted silently. |
| 414 | |
| 415 | From a private disposable directory, set `AIEN` to this checkout and `OMEGA` |
| 416 | to that exact Omega checkout. Shell below only invokes the compiler and native |
| 417 | conductor; no new shell runner is shipped. |
| 418 | |
| 419 | ```sh |
| 420 | umask 077 |
| 421 | ln -s "$AIEN" candidate |
| 422 | ln -s "$OMEGA/seed" seed |
| 423 | ln -s "$OMEGA/seed/out/omc" omc |
| 424 | sha256sum omc |
| 425 | ./omc < seed/qualification/om2/gate.om > gate && |
| 426 | chmod 700 gate && |
| 427 | ./gate ./omc d6290c7663c2b4bafb59eb3fdf812476e977f4c144def71095c6248ef9b96b84 \ |
| 428 | candidate/tests/goal_microjobs/shadow.cases native-final |
| 429 | ``` |
| 430 | |
| 431 | The conductor composes `shadow.om+shadow-oracle.om`; both are handwritten |
| 432 | seeded Omega. It replays all arm/scenario outputs and independently runs the |
| 433 | unchanged admission kernel against each. The `.cases` file also removes the |
| 434 | oracle guard, removes typed fallback, bypasses opt-in, and exhausts the shared |
| 435 | work budget. Recorded exact outputs are `evidence/nl5-*.planjournal`, |
| 436 | `*.status` and `*.trace`. Trace rows `201 node arm_ascii handoff_bytes` count |
| 437 | actual serialized hop bytes, including recomputation; `202 4` marks the |
| 438 | injected bad-proposal refusal. Header bytes, model token counts, codec timing, |
| 439 | queue/verification overhead, p50/p95, Turing yield and comparative economics |
| 440 | are **NOT_RUN**, not zero or an implied improvement. The ASCII arm tag is not |
| 441 | an identity. `nl5-host.json` records source/binary hashes and the independent |
| 442 | oracle/replay checks; `nl5-native.log` is the native gate transcript. |
| 443 | |
| 444 | ### External interface remains fail-closed |
| 445 | |
| 446 | NL3 owns LTP0 and NL4 owns `nlproposal`/`nlmatch`, not this repository. Their |
| 447 | proposal-only interface does not provide canonical MJB1 CONTENT digest binding, |
| 448 | durable nonce/sequence reservation, capability authorization or signed receipt |
| 449 | admission to the current Allen decimal adapter. The owning gaps are |
| 450 | [protocols #70](https://github.com/aien-dev/aien-protocols-mv/issues/70) and |
| 451 | [AEGIS #79](https://github.com/aien-dev/aegis-runtime-mv/issues/79). NL4's |
| 452 | closed inc/double/id fixture is not equivalent to this arbitrary-add graph. |
| 453 | Therefore actual LTP0/semantic-boundary integration, wrong-basis/model-swap/ |
| 454 | expired-projector negotiation and learned C transport remain **NOT_RUN**, |
| 455 | with a truthful typed fallback, not forged trust flags. The adapter boundary |
| 456 | must consume those owner APIs before C can become eligible. |
| 457 | |
| 458 | Real-model runs are **BLOCKED** by the explicit no-serving/no-activation/GPU |
| 459 | authorization boundary. The research outcome is **INCONCLUSIVE**: no latent |
| 460 | quality, generalization, speed or economic result is claimed. No live route, |
| 461 | public endpoint, promotion, Cortex writer or release gate changes are included. |
| 462 | The independent benchmark preregistration is |
| 463 | [benchmarks PR #56](https://github.com/aien-dev/benchmarks-mv/pull/56), |
| 464 | commit `8ee0a494bf73230c9d37647eb3caea792298fa8d`. |