From e10e2b4fc596ece56cc352d2279535e05451279e Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 11 Oct 2026 09:29:29 -0500 Subject: [PATCH 1/2] plan(adaptive-intelligence): Milestone 0 inventory, ownership freeze, gap list, R11/R13/R14 host baseline receipts Fresh pinned clones of 12 default branches; capability classification with file:line evidence; Cortex ownership (omega CxStore only); Agent F owner discrepancy (spark-inquisitor archived); baseline R11 PASS 436/0, R13 run1 FAIL phase E under load + run2 HOST_PASS_NON_SILICON, R14 HOST_PASS 6/6. Co-Authored-By: Claude Fable 5.1 --- docs/plans/adaptive-intelligence/INVENTORY.md | 49 ++++++++ docs/plans/adaptive-intelligence/PINS.txt | 12 ++ .../R11/rx_aien_faculty_receipt.json | 37 ++++++ .../R13/rx_living_receipt.json | 68 +++++++++++ .../R14/rx_recovery_receipt.json | 43 +++++++ .../R13/rx_living_receipt.json | 68 +++++++++++ .../adaptive-intelligence/baseline/r11.log | 18 +++ .../baseline/r13-run1-under-load.log | 26 +++++ .../baseline/r13-run2.log | 24 ++++ .../adaptive-intelligence/baseline/r14.log | 27 +++++ .../inventory/authority-and-cortex.md | 105 +++++++++++++++++ .../inventory/evidence-chain.md | 110 ++++++++++++++++++ .../inventory/omega-runtime.md | 29 +++++ .../inventory/physics-learning.md | 99 ++++++++++++++++ .../inventory/spark-rsi.md | 108 +++++++++++++++++ 15 files changed, 823 insertions(+) create mode 100644 docs/plans/adaptive-intelligence/INVENTORY.md create mode 100644 docs/plans/adaptive-intelligence/PINS.txt create mode 100644 docs/plans/adaptive-intelligence/baseline/20261011T142516Z-16e729b6d844/R11/rx_aien_faculty_receipt.json create mode 100644 docs/plans/adaptive-intelligence/baseline/20261011T142633Z-16e729b6d844/R13/rx_living_receipt.json create mode 100644 docs/plans/adaptive-intelligence/baseline/20261011T142649Z-16e729b6d844/R14/rx_recovery_receipt.json create mode 100644 docs/plans/adaptive-intelligence/baseline/20261011T142755Z-16e729b6d844/R13/rx_living_receipt.json create mode 100644 docs/plans/adaptive-intelligence/baseline/r11.log create mode 100644 docs/plans/adaptive-intelligence/baseline/r13-run1-under-load.log create mode 100644 docs/plans/adaptive-intelligence/baseline/r13-run2.log create mode 100644 docs/plans/adaptive-intelligence/baseline/r14.log create mode 100644 docs/plans/adaptive-intelligence/inventory/authority-and-cortex.md create mode 100644 docs/plans/adaptive-intelligence/inventory/evidence-chain.md create mode 100644 docs/plans/adaptive-intelligence/inventory/omega-runtime.md create mode 100644 docs/plans/adaptive-intelligence/inventory/physics-learning.md create mode 100644 docs/plans/adaptive-intelligence/inventory/spark-rsi.md diff --git a/docs/plans/adaptive-intelligence/INVENTORY.md b/docs/plans/adaptive-intelligence/INVENTORY.md new file mode 100644 index 0000000..2f5a789 --- /dev/null +++ b/docs/plans/adaptive-intelligence/INVENTORY.md @@ -0,0 +1,49 @@ +# AIEN Adaptive Intelligence: Milestone 0 inventory (2026-10-11) +Orchestrator: Claude (Fable 5.1) session 65ed29. Fresh clones of GitHub default branches under ~/workspace/adaptive/ (PINS.txt). Detail per area in inventory/*.md with file:line evidence. + +## Pinned sources +omega 16e729b6d844 | spark-rsi 24f412f699f1 | aien-protocols 407487b7e163 | interplane 667fbe811f78 | spark-inquisitor 230d257199b7 (ARCHIVED) | benchmarks 8d4dfde8f944 | physics 8b23e5a2352e | aien-sealed 3a6659dc63b2 | aienos 3b2004b692a7 | aegis-runtime 1eba7a7223ba | aien-sovereign-core 00e7ef05302c | cortex-rs 0606636f110d (ARCHIVED) +Also ARCHIVED on GitHub: spark-supervisor, spark-hive, spark-dream, spark-crumbs, spark-adapters, aien-harness. Not modified; nothing live depends on them (evidence-chain.md, spark-rsi.md). + +## Classification +| # | Capability | Repo | Status | Evidence | +|---|---|---|---|---| +| 1 | Resident cognition loop observe/predict/explain/assess/plan, failed prediction -> hypothesis -> bounded experiment plan, explored-condition memory | omega src/runtime | Implemented and integrated; R11 PASS 436/0 | inventory/omega-runtime.md | +| 2 | Living system: GPU experiment under authority, evidence, belief update, promotion, changed production decision; 5 control arms | omega | Implemented and integrated; R13 host run1 FAIL phase E under load 5.7 (preserved), run2 HOST_PASS_NON_SILICON all phases | baseline/ | +| 3 | Restart/attack recovery A-F incl. crash in promotion and restore | omega | Implemented and integrated; R14 HOST_PASS_NON_SILICON 6/6 | baseline/ | +| 4 | Canonical Cortex CxStore (append, recall, provenance, promote, verify chain) | omega | Implemented and integrated | rx_cortex.h | +| 5 | World -> Cortex recorder (every crumb -> typed record with provenance) | omega | Implemented but DISCONNECTED from the living body (only compose path) | rx_cortex_record.h; grep | +| 6 | Cognitive state projection from Cortex | omega | Implemented (compose path); not fed to living AIEN | rx_projection.h | +| 7 | Typed resource needs, priority classes, budget, fairness, emergency stop | omega | Implemented and integrated; no adaptive policy caller | rx_world.h | +| 8 | Physics-0 world, guard (truth hidden from learner), learner (sparse polynomial, MDL), ladder, scorer, PD-0b sealed run (seal-1 FAIL at level 6) | omega/physics0, physics | Implemented and integrated | inventory/physics-learning.md | +| 9 | Latent-state recovery; multi-step consistency in ranking; changed dynamics between episodes; fixed-vs-updating comparison | omega/physics0 | Missing | LEARNER.md:106-136 | +| 10 | Brownian sealed lifecycle (freeze, one-attempt ledger, sealed parent, leak oracle) | aien-sealed | Implemented; EXP-003-CERT w2.v1 frozen on paper, no sealed world yet | brownian/ | +| 11 | RSI daemon cycle, judge, holdouts, signed exact-artifact promotion | spark-rsi | Implemented and integrated | inventory/spark-rsi.md | +| 12 | RSI capability graph measurements | spark-rsi | Implemented but disconnected: all literals (daemon.rs:66-99) | | +| 13 | Production canary admission | spark-rsi | Implemented, fed `&[]` (daemon.rs:446): fails closed by design | | +| 14 | Authenticated measured execution feed for RSI | any | Missing (archived supervisor not vendored) | | +| 15 | Evaluation receipt types + P-256 signing | aien-protocols | Implemented but disconnected (only archived inquisitor + spark-rsi use) | inventory/evidence-chain.md | +| 16 | TRN1 execution transcript (spec, C verifier, corpus) | aien-protocols | Implemented but disconnected: "not yet produced by any runtime"; unsigned | | +| 17 | Judge receipt verification (rsi-eval/2), conformance corpus + negative controls V1-V8 | interplane | Implemented and integrated | | +| 18 | AIEN adapter evidence export | interplane | Implemented, unsigned (same-user forgeable per its docs) | | +| 19 | spark-inquisitor evaluators | spark-inquisitor | Superseded (sovereign-core dropped them; archived) | | +| 20 | benchmarks main harness | benchmarks | Experimental: cannot build from a fresh clone (missing sibling canonical-branch-native-runtime) | | +| 21 | Unified receipt format; longitudinal history store; independent audit chain | benchmarks/protocols/interplane | Missing | | +| 22 | cortex-rs service on :18080 and all agent memory callers | sovereign-core | Superseded by doctrine (rx_cortex.h), still LIVE in practice; no import path into CxStore | inventory/authority-and-cortex.md | +| 23 | aegis-runtime ExecutionAuthority/RunBudget/EmergencyStop | aegis-runtime | Types only, nothing enforces them; real enforcement = skill allowlist + probe gate | | +| 24 | Experiment authority entry: RunComposeTask -> compose run (AEGIS verify, World commit, Cortex journal) -> approval desk for effects | sovereign-core | Implemented and integrated | control.rs:89 | +| 25 | Typed resource-condition state (latency, contention, memory pressure, deadline risk) | omega/sovereign-core | Missing as one typed state; raw pieces exist | | + +## Ownership freeze (Gate 0) +- Cortex: omega CxStore is the only writer path. No new caller of cortex-rs or aienos-cortex. Legacy records enter only as CX_K_IMPORTED. +- Omega runtime (Agent A): src/runtime/rx_living.c, rx_aien.c, rx_cortex_record.c + tests/runtime. Physics (Agent B): src/physics0, tests/physics0, new learner VERSION (seal-1 trees frozen). Shared Makefile edits: orchestrator only, serial. +- Agent F owner change: spark-inquisitor is archived and superseded; negative/tamper tests belong in interplane conformance + aien-protocols verifiers (Agent D). Recorded as a directive discrepancy, no decision needed. +- aegis-runtime is not an enforcement point today; bounded experiments go through sovereign-core RunComposeTask + omega World authority (aienos cap table). + +## Prioritized gap list +G1 (M2) Attach the existing World->Cortex recorder to the living body so every observe/predict/explain/plan/experiment/evidence/promotion crumb is journaled with provenance; recall + projection on restart; candidate lesson = CX_K_CANDIDATE, promotion only via cx_promote with evidence digest. Smallest missing component; all pieces exist. +G2 (M1) R13 host phase E under load: rerun idle, record both. Then M1 trace doc from receipts. +G3 (M3) New learner version: 20-step rollout error on SELECT episodes in ranking + hidden-state flag; regime-switch between episodes; fixed-vs-updating arms. Never touches seal-1 holdouts. +G4 (M4) One typed resource-condition object + a bounded policy reaction that only calls existing budget/priority setters within granted caps. +G5 (M6/M7) Unify on aien-protocols receipt + TRN1 transcript, signed; have omega/sovereign-core produce TRN1; benchmarks harness buildable from clone; history store. +G6 (M5) Measured execution feed: candidate source = sovereign-core executor emitting CanaryObservation with signed source identity; until then fail-closed stays (documented blocker). diff --git a/docs/plans/adaptive-intelligence/PINS.txt b/docs/plans/adaptive-intelligence/PINS.txt new file mode 100644 index 0000000..37fbe76 --- /dev/null +++ b/docs/plans/adaptive-intelligence/PINS.txt @@ -0,0 +1,12 @@ +omega 16e729b6d844 main +spark-rsi 24f412f699f1 main +aien-protocols 407487b7e163 main +interplane 667fbe811f78 main +spark-inquisitor 230d257199b7 main +benchmarks 8d4dfde8f944 main +physics 8b23e5a2352e main +aien-sealed 3a6659dc63b2 main +aienos 3b2004b692a7 main +aegis-runtime 1eba7a7223ba main +aien-sovereign-core 00e7ef05302c main +cortex-rs 0606636f110d main diff --git a/docs/plans/adaptive-intelligence/baseline/20261011T142516Z-16e729b6d844/R11/rx_aien_faculty_receipt.json b/docs/plans/adaptive-intelligence/baseline/20261011T142516Z-16e729b6d844/R11/rx_aien_faculty_receipt.json new file mode 100644 index 0000000..7aeb03e --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/20261011T142516Z-16e729b6d844/R11/rx_aien_faculty_receipt.json @@ -0,0 +1,37 @@ +{ + "schema": "AIEN_RX_R11_AIEN_FACULTY_V1", + "run_id": "20261011T142516Z-16e729b6d844", + "candidate_commit": null, + "candidate_bound": false, + "run_commit": "16e729b6d844e32325a0a037b7cd0f829430e935", + "tree_dirty": false, + "aienos_commit": null, + "checks": 436, + "failures": 0, + "test_binary_sha256": "7977a5a23e1269edb244aed90b88addbf5b2946353c224d68d37f611bb0318ad", + "host": {"sysname": "Linux", "release": "7.0.0-1019-nvidia", "machine": "aarch64"}, + "cpus": {"cortex_x925": "5,6,7,8,9,15,16,17,18,19", "cortex_a725": "0,1,2,3,4,10,11,12,13,14"}, + "hardware_scope": "host processor only; no graphics processor is used", + "cognition_model": "explicit statistical belief model (interval means, tolerance bands, streaks); not a neural model", + "living_run": { + "exercised": true, + "skip_reason": "", + "operation": "omega_matvec (M12), regime 64x256", + "a725_record_realization_word0": "0x0", + "a725_predicted_ns_per_call": 6938, + "x925_observed_ns_under_old_record": 4701, + "x925_record_realization_word0": "0x3f6db775476a4f99", + "x925_predicted_ns_under_new_record": 2880, + "improvement_x100": 163, + "requests_after_move_until_supported": 192, + "production_commits_between_plan_and_new_selection": 10, + "hypothesis_kind": 1, "hypothesis_state": 3, + "plans": 1, "search_epochs": 2, "predictions": 2, + "control_without_aien": {"a725_ns": 6885, "x925_ns": 4853, "search_epochs": 1} + }, + "gates": { + "R11_CONTINUOUS_COGNITION": "PASS", + "aien_caused_improvement": true, + "not_claimed": ["R8", "R13", "neural cognition", "durable beliefs (R9)", "new memory as a trigger"] + } +} diff --git a/docs/plans/adaptive-intelligence/baseline/20261011T142633Z-16e729b6d844/R13/rx_living_receipt.json b/docs/plans/adaptive-intelligence/baseline/20261011T142633Z-16e729b6d844/R13/rx_living_receipt.json new file mode 100644 index 0000000..e0c10e8 --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/20261011T142633Z-16e729b6d844/R13/rx_living_receipt.json @@ -0,0 +1,68 @@ +{ + "schema": "AIEN_RX_R13_LIVING_SYSTEM_V1", + "run_id": "20261011T142633Z-16e729b6d844", + "candidate_commit": "unknown", + "run_commit": "16e729b6d844e32325a0a037b7cd0f829430e935", + "candidate_bound": false, + "tree_dirty": false, + "aienos_commit": "unknown", + "physics_forge_commit": "6d7cf0d4d8eb2cda7b512100ff6058e25dbb3ddf", + "test_binary_sha256": "06afdf5f2e2572a8ce9c01c90013eab757030947149e5f778d45ff234e999a13", + "machine_identity": {"node": "spark-b87b", "system": "Linux", "release": "7.0.0-1019-nvidia", "architecture": "aarch64"}, + "silicon_observed": false, + "gate": {"R13_LIVING_SYSTEM": "FAIL"}, + "first_failure": "R13 mode 5: AIEN never confirmed the incumbent cost", + "scenario": {"operation": "omega integer matvec 64x256", "goal": "cost below 55% of the confirmed incumbent, semantics preserved", "incumbent_ns": 6884, "target_ns": 3786, "selected_ps_per_call": 2688414, "reference_ps_per_call_new_cores": 4778170, "aien_final_expected_ns": 2964, "aien_final_goal_status": "MET", "aien_final_prediction_epoch": 2}, + "active_generation_before": 1, + "active_generation_after": 2, + "recovered_generation": 2, + "objects": { + "human_goal": {"id": 18, "generation": 1}, + "aien_plan": {"id": 22, "generation": 1}, + "omega_search": {"id": 3, "generation": 1}, + "gpu_input": {"id": 26, "generation": 1}, + "gpu_output": {"id": 27, "generation": 1}, + "experiment_evidence": {"id": 28, "generation": 1}, + "aien_experiment_belief": {"id": 25, "generation": 1}, + "omega_selection": {"id": 4, "generation": 1}, + "generation_candidate": {"id": 29, "generation": 1}, + "promotion": {"id": 30, "generation": 1}, + "in_force": {"id": 31, "generation": 1} + }, + "selected_realization_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", + "promoted_realization_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", + "rebuilt_from_durable_bytes_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", + "promoted_realization_bytes_sha256": "7b74d680905a80be2d9dec38f46481231910e5e22ed116f2448127a1552ccafa", + "aien_activations": 131, + "omega_activations": 111, + "experiment_seat_activations_on_existing_grant": 16, + "aegis_decide_activations_during_episode": 0, + "root_install_activations_during_episode": 0, + "generation_prepare_activations": 3, + "promotion_authority_activations": 2, + "gpu_claims": 16, + "gpu_completions": 16, + "gpu_publication_worker": "0x100", + "production_commits_during_aien": 186, + "production_commits_while_an_aien_activation_executed": 0, + "production_commits_during_omega": 185, + "production_commits_during_gpu_experiment": 185, + "production_commits_before_promotion": 936, + "production_commits_during_promotion_barrier": 673, + "production_commits_after_promotion": 135, + "production_results_using_unpromoted_realization": 0, + "outside_publications_after_goal_all_production_requests": 1071, + "generation_promotion_barrier_ns": 84077215, + "generation_candidate_to_promotion_ns": 84115727, + "causal_crumb_count": 2922, + "durable_provenance_links_verified": 11, + "causal_verification_result": "PASS", + "authority": {"live_capabilities_swept": 70, "promotion_right_holders": 1, "promotion_subject": 64}, + "controls": {"A_no_aien": "PASS", "B_no_promotion_authority": "PASS", "C_revoked_experiment": "PASS", "D_stale_generation": "PASS", "E_failed_verification": "FAIL"}, + "composition_host_phase": {"result": "NOT_RUN", "reason": "production program: the composition phase needs the AIEN_TEST_BUILD rogue-candidate hook and test fixture (test-r13-testbuild-host)"}, + "fabric_host_phase": {"result": "NOT_RUN", "build": "host", "reason": "production program: Fabric F5-0 has only the loopback transport and HMAC stand-in (test build only, AIEN_TEST_BUILD); no real transport before TRUST-1"}, + "build": "production", + "argus": {"result": "OBSERVED", "mode": "observe and record (RX_ARGUS=2, authority observer, consumer ingest); no response action, holds no capability", "argus_lock": "argus.lock", "emitted": 1463830, "received": 1463830, "authority_observations": 421, "authority_mints": 420, "authority_revokes": 1, "findings": 0, "ingest_errors": 0, "ring_refused": 0}, + "operator": {"entry_point": "owner-only unix socket, SO_PEERCRED, runtime-issued caller credential plus RX_WORLD_RES_CONTROL halt capability (docs/r16-operator-control.md)", "subject": 70, "stops": 0, "resumes": 0, "restored_stops": 0, "open_stops": 0, "activations_cancelled_under_stop": 0}, + "not_claimed": ["R14", "R15", "R16", "neural/general cognition beyond R11", "open-ended realization invention beyond R10", "AIENOS-kernel isolation (authority is the host-library C port)", "the GPU add measures matvec cost (it is a physical witness of the experiment)"] +} diff --git a/docs/plans/adaptive-intelligence/baseline/20261011T142649Z-16e729b6d844/R14/rx_recovery_receipt.json b/docs/plans/adaptive-intelligence/baseline/20261011T142649Z-16e729b6d844/R14/rx_recovery_receipt.json new file mode 100644 index 0000000..a76d771 --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/20261011T142649Z-16e729b6d844/R14/rx_recovery_receipt.json @@ -0,0 +1,43 @@ +{ + "schema": "AIEN_RX_R14_LIVING_RECOVERY_V1", + "run_id": "20261011T142649Z-16e729b6d844", + "candidate_commit": "unknown", + "run_commit": "16e729b6d844e32325a0a037b7cd0f829430e935", + "candidate_bound": false, + "tree_dirty": false, + "aienos_commit": "unknown", + "physics_forge_commit": "6d7cf0d4d8eb2cda7b512100ff6058e25dbb3ddf", + "test_binary_sha256": "d123a136f885655edd103f310d36777d5c95f7f063f46f8b78bd2c5bd7ebf11b", + "machine_identity": {"node": "spark-b87b", "system": "Linux", "release": "7.0.0-1019-nvidia", "architecture": "aarch64"}, + "silicon_observed": false, + "gate": {"R14_LIVING_RECOVERY": "HOST_PASS_NON_SILICON"}, + "r13_baseline_generation": 1, + "final_generation": 2, + "recovered_generations": [1, 1, 1, 1, 1, 2, 2, 2], + "body": "R13 organism (rx_living) with R6 on: activation budget 256 per causal episode", + "scenarios": { + "A_corrupt_candidate": {"result": "PASS", "fault_observed": true, "containment_result": "R10 verifier refused each corrupt realization (identity, differential, crash)", "recovery_result": "none needed: the valid quad4 candidate was verified, selected and promoted by R9", "production_before": 240, "production_during_fault_window": 755, "production_after": 305, "crumbs_verified": 51199, "crumbs_evidence_verified": true, "authority_sweep": "PASS", "promotion_right_holders": 1, "unexpected_privileged_holders": 0, "resource_claim_accounting": "PASS", "claims": 16, "claims_closed": 16, "inflight_final": 0, "held_resource_charges": 0, "active_generation_before": 1, "active_generation_after": 2, "cases": [{"defect": "tamper", "refusal_reason": 2, "refused_id_word0": "0xd76562f90601683c", "refused_verified": false, "refused_parent_runs": 0, "store_entries": 5, "store_verified": 4, "store_mismatches": 0, "promoted_generation": 2, "promoted_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", "refusal_attributed": true, "production_during": 755, "production_after": 102}, {"defect": "semantic", "refusal_reason": 4, "refused_id_word0": "0xd76562f90601683c", "refused_verified": false, "refused_parent_runs": 0, "store_entries": 5, "store_verified": 4, "store_mismatches": 0, "promoted_generation": 2, "promoted_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", "refusal_attributed": true, "production_during": 927, "production_after": 101}, {"defect": "crash", "refusal_reason": 5, "refused_id_word0": "0x2e273085a08fc44f", "refused_verified": false, "refused_parent_runs": 0, "store_entries": 5, "store_verified": 4, "store_mismatches": 0, "promoted_generation": 2, "promoted_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", "refusal_attributed": true, "production_during": 10827, "production_after": 102}]}, + "B_forged_capability": {"result": "PASS", "fault_observed": true, "containment_result": "R7 refused forged, borrowed, revoked and stale references and the rogue GPU claim; R8 root refused stuffed and forged authority; R9 refused promotion forgery", "recovery_result": "compromised writers revoked; the lane client re-acquired through AEGIS; the root renewed the slot; lanes resumed under the renewed grant", "production_before": 1311, "production_during_fault_window": 4062, "production_after": 102, "crumbs_verified": 12573, "crumbs_evidence_verified": true, "authority_sweep": "PASS", "promotion_right_holders": 1, "unexpected_privileged_holders": 0, "resource_claim_accounting": "PASS", "claims": 137, "claims_closed": 137, "inflight_final": 0, "held_resource_charges": 0, "active_generation_before": 2, "active_generation_after": 2, "attacks": {"forged_reference": "BLOCKED", "wrong_subject_valid_reference": "BLOCKED", "revoked_reference": "BLOCKED", "stale_generation": "BLOCKED", "forged_gpu_claim": "BLOCKED", "slot_stuffing": "CONTAINED", "forged_aegis_decision": "NO_MINT", "promote_forgery": "REFUSED"}, "rogue_blocked_crumbs": [2, 2, 1, 2, 1], "rogue_gpu_claims": 0, "lane_refusals_while_stuffed": 17, "publications_under_stuffed_grant": 0, "inflight_claims_refused_at_publication": 4, "root_install_runs_during_forgery": 2, "mints_during_attacks": 0, "renewal_mints": 1, "rogue_draft_id_left_unpromoted": 3, "lanes_before": 48, "lanes_sent": 117, "lanes_published": 117, "lanes_lost": 0, "lanes_duplicated": 0, "legitimate_promotion_right_valid": true}, + "C_reaction_cycle": {"result": "PASS", "fault_observed": true, "containment_result": "R6: A<->B and X->Y->Z->X quarantined by the per-episode activation budget, the flip by the oscillation limit; each with a QUARANTINE crumb naming its episode", "recovery_result": "none needed: production, AIEN and Omega never stopped; the controls finished", "production_before": 1444, "production_during_fault_window": 4970, "production_after": 102, "crumbs_verified": 20369, "crumbs_evidence_verified": true, "authority_sweep": "PASS", "promotion_right_holders": 1, "unexpected_privileged_holders": 0, "resource_claim_accounting": "PASS", "claims": 16, "claims_closed": 16, "inflight_final": 0, "held_resource_charges": 0, "active_generation_before": 2, "active_generation_after": 2, "activation_budget_per_episode": 256, "oscillation_limit": 8, "cycles": ["A<->B (+1 each way)", "X->Y->Z->X (+1)", "self flip A-B-A"], "controls": ["countdown converges to 0", "declared periodic flip x40"], "containment_crumbs_named": 3, "containment_wrong": 0, "organism_reactions_quarantined": 0, "max_cycle_activations": 256, "cycle_crumbs_at_containment": 1293, "cycle_crumbs_500ms_later": 1293, "deferred_queue_peak": 0, "containment_ms": 7, "production_during_storm": 4970, "aien_observe_activations_during": 310, "omega_watch_activations_during": 311, "second_episode_activations": 256, "quarantines": 4}, + "D_gpu_saturation": {"result": "PASS", "fault_observed": true, "containment_result": "R5 admitted at most 4 lane claims (their windows held against the memory budget); the rest waited BLOCKED_RESOURCE", "recovery_result": "backlog drained after submission stopped; every request published and checked once", "production_before": 1247, "production_during_fault_window": 1187, "production_after": 100, "crumbs_verified": 15294, "crumbs_evidence_verified": true, "authority_sweep": "PASS", "promotion_right_holders": 1, "unexpected_privileged_holders": 0, "resource_claim_accounting": "PASS", "claims": 3216, "claims_closed": 3216, "inflight_final": 0, "held_resource_charges": 0, "active_generation_before": 2, "active_generation_after": 2, "lanes": 16, "requests_per_lane": 200, "claim_capacity": 4, "max_concurrent_claims": 4, "max_backlog_waiting": 12, "max_ring_occupancy": 22, "max_ring_claims": 4, "ring_notices_dropped": 0, "max_bytes_held": 512, "total_submitted": 3200, "total_completed": 3200, "total_checked": 3200, "total_retried": 0, "total_failed": 0, "duplicates": 0, "lost": 0, "mismatches": 0, "claims": 3200, "slot_rewakes_same_value": 0, "drain_ms": 0, "saturation_ms": 287, "production_during": 1187, "torn_refused": 0, "pressure_samples": 1127}, + "E_gpu_seat_kill": {"result": "PASS", "fault_observed": true, "containment_result": "R12 seat loss: the held claim ended FAILED (RX_ERR_SEAT_LOST) once, its charge released, the seat generation moved", "recovery_result": "the seat was relaunched on the same image; the retry, caused by the loss crumb, published once; the dead seat's claim was refused", "production_before": 1631, "production_during_fault_window": 19, "production_after": 100, "crumbs_verified": 4404, "crumbs_evidence_verified": true, "authority_sweep": "PASS", "promotion_right_holders": 1, "unexpected_privileged_holders": 0, "resource_claim_accounting": "PASS", "claims": 142, "claims_closed": 142, "inflight_final": 0, "held_resource_charges": 0, "active_generation_before": 2, "active_generation_after": 2, "kill_method": "processor stand-in not stepped, then declared lost", "claim_held_at_kill": true, "claims_lost": 1, "seat_generation_before": 1, "seat_generation_after": 2, "loss_crumbs": 1, "loss_names_stimulus": true, "bytes_held_before": 128, "bytes_held_after_loss": 128, "retry_publications": 1, "retry_caused_by_loss": true, "stale_result_refused": true, "object_generations_moved": 0, "authority_reminted": false, "kill_ms": 0, "recovery_ms": 0, "claims": 142, "completions": 141, "failures": 1, "retries": 1, "duplicates": 0, "lost": 0}, + "F_checkpoint_crash": {"result": "PASS", "fault_observed": true, "containment_result": "the process stopped inside rx_gen_promote at each R9 crash point", "recovery_result": "rx_gen_recover in a new process; generation.restore re-verified and put the recovered generation in force (or the reference for genesis); production resumed", "production_before": 7811, "production_during_fault_window": 0, "production_after": 1610, "crumbs_verified": 18858, "crumbs_evidence_verified": true, "authority_sweep": "PASS", "promotion_right_holders": 1, "unexpected_privileged_holders": 0, "resource_claim_accounting": "PASS", "claims": 0, "claims_closed": 0, "inflight_final": 0, "held_resource_charges": 0, "active_generation_before": 1, "active_generation_after": 2, "crash_matrix": [{"crash_point": "BEFORE_CANDIDATE_WRITE", "first_process_exit": 86, "recovered_old_or_new": "OLD", "recovered_generation": 1, "recovered_lineage": 1, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": false, "restore": "REFERENCE", "restore_caused_by_boot": true, "in_force_generation": 0, "production_before_crash": 441, "production_after_restart": 202, "production_used_restored_realization": 0, "durable_provenance_links": 0, "provenance_links_checked_before_crash": 0, "provenance_bytes_same_after_restart": false, "adapted_again_to_generation": 3}, {"crash_point": "DURING_CANDIDATE_WRITE", "first_process_exit": 86, "recovered_old_or_new": "OLD", "recovered_generation": 1, "recovered_lineage": 1, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": false, "restore": "REFERENCE", "restore_caused_by_boot": true, "in_force_generation": 0, "production_before_crash": 459, "production_after_restart": 202, "production_used_restored_realization": 0, "durable_provenance_links": 0, "provenance_links_checked_before_crash": 0, "provenance_bytes_same_after_restart": false, "adapted_again_to_generation": 3}, {"crash_point": "AFTER_CANDIDATE_WRITE", "first_process_exit": 86, "recovered_old_or_new": "OLD", "recovered_generation": 1, "recovered_lineage": 1, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": false, "restore": "REFERENCE", "restore_caused_by_boot": true, "in_force_generation": 0, "production_before_crash": 1058, "production_after_restart": 202, "production_used_restored_realization": 0, "durable_provenance_links": 0, "provenance_links_checked_before_crash": 0, "provenance_bytes_same_after_restart": false, "adapted_again_to_generation": 3}, {"crash_point": "BEFORE_ROOT_FLIP", "first_process_exit": 86, "recovered_old_or_new": "OLD", "recovered_generation": 1, "recovered_lineage": 1, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": false, "restore": "REFERENCE", "restore_caused_by_boot": true, "in_force_generation": 0, "production_before_crash": 1215, "production_after_restart": 201, "production_used_restored_realization": 0, "durable_provenance_links": 0, "provenance_links_checked_before_crash": 11, "provenance_bytes_same_after_restart": false, "adapted_again_to_generation": 3}, {"crash_point": "DURING_ROOT_FLIP", "first_process_exit": 86, "recovered_old_or_new": "OLD", "recovered_generation": 1, "recovered_lineage": 1, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": false, "restore": "REFERENCE", "restore_caused_by_boot": true, "in_force_generation": 0, "production_before_crash": 659, "production_after_restart": 200, "production_used_restored_realization": 0, "durable_provenance_links": 0, "provenance_links_checked_before_crash": 11, "provenance_bytes_same_after_restart": false, "adapted_again_to_generation": 3}, {"crash_point": "AFTER_ROOT_FLIP", "first_process_exit": 86, "recovered_old_or_new": "NEW", "recovered_generation": 2, "recovered_lineage": 2, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": true, "restore": "RESTORED", "restore_caused_by_boot": true, "in_force_generation": 2, "production_before_crash": 846, "production_after_restart": 201, "production_used_restored_realization": 201, "durable_provenance_links": 11, "provenance_links_checked_before_crash": 11, "provenance_bytes_same_after_restart": true, "adapted_again_to_generation": 0}, {"crash_point": "BEFORE_RECEIPT", "first_process_exit": 86, "recovered_old_or_new": "NEW", "recovered_generation": 2, "recovered_lineage": 2, "torn_generation_detected": false, "receipt_before_recovery": false, "receipt_after_recovery": true, "restore": "RESTORED", "restore_caused_by_boot": true, "in_force_generation": 2, "production_before_crash": 2312, "production_after_restart": 200, "production_used_restored_realization": 201, "durable_provenance_links": 11, "provenance_links_checked_before_crash": 11, "provenance_bytes_same_after_restart": true, "adapted_again_to_generation": 0}, {"crash_point": "AFTER_RECEIPT", "first_process_exit": 86, "recovered_old_or_new": "NEW", "recovered_generation": 2, "recovered_lineage": 2, "torn_generation_detected": false, "receipt_before_recovery": true, "receipt_after_recovery": true, "restore": "RESTORED", "restore_caused_by_boot": true, "in_force_generation": 2, "production_before_crash": 821, "production_after_restart": 202, "production_used_restored_realization": 203, "durable_provenance_links": 11, "provenance_links_checked_before_crash": 11, "provenance_bytes_same_after_restart": true, "adapted_again_to_generation": 0}]} + }, + "authority": {"promotion_right_holders": 1, "promotion_subject": 64, "unexpected_privileged_holders": 0}, + "causal": {"crumb_count": 122697, "causal_verification_result": "PASS", "durable_evidence_links_verified": true}, + "earlier_gate_defects_fixed": [ + "R6: the activation budget reset only on a direct outside wake, so reactions one step down a chain (omega.watch, aien.observe) were quarantined after 256 activations over the body's life; now counted per causal episode (regression: episode_activation_budget in test-r3)", + "R6: containment left no causal record; now a QUARANTINE crumb names the reaction, the limit and the episode", + "R8/R12: after an R8 renewal the seat claim presented the revoked reference bound at start, so honest GPU work was refused forever; the claim now presents what the slot holds (regression: slot renewal in test-r12)", + "R12: the GB10 seat refused every claim on an object id of 64 or more (it used the frozen ABI's 64-entry table size; the world projects RX_MAX_OBJECTS = 256 and the host stand-in accepted them), so GPU work on later objects failed on silicon only; found by scenario D (regression: objects past id 64 in test-r12-silicon)", + "R9: draft slots were never freed, so a body could promote at most four times per process; a promoted or stale draft now frees its slot (regression in test-r9)" + ], + "limits": [ + "R8: a principal wrongly given WRITE on a decision object can jam decisions until it is revoked; it cannot cause a mint", + "R9: rx_gen_propose checks the proposer credential (R16 C6) but no capability; an enrolled in-process proposer can hold up to four unpromotable drafts until the generation moves", + "R10: Omega's store keeps the first bytes filed under an identity; bytes that falsely claim an identity block the honest bytes for that identity in that process (found by reading, not exercised)", + "the authority table is the host-library C port; it does not survive a process restart, and the restarted body mints its grants again", + "the seat is killed by destroying its channel from the host; a chip-raised fault (MMU fault, Xid) is not exercised" + ], + "not_claimed": ["R15", "R16", "neural/general cognition beyond R11", "open-ended invention beyond R10", "AIENOS kernel isolation (authority is the host-library C port)", "immunity to every hardware fault", "recovery from machine destruction", "Byzantine hardware", "kernel/root compromise", "performance"] +} diff --git a/docs/plans/adaptive-intelligence/baseline/20261011T142755Z-16e729b6d844/R13/rx_living_receipt.json b/docs/plans/adaptive-intelligence/baseline/20261011T142755Z-16e729b6d844/R13/rx_living_receipt.json new file mode 100644 index 0000000..7c90953 --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/20261011T142755Z-16e729b6d844/R13/rx_living_receipt.json @@ -0,0 +1,68 @@ +{ + "schema": "AIEN_RX_R13_LIVING_SYSTEM_V1", + "run_id": "20261011T142755Z-16e729b6d844", + "candidate_commit": "unknown", + "run_commit": "16e729b6d844e32325a0a037b7cd0f829430e935", + "candidate_bound": false, + "tree_dirty": false, + "aienos_commit": "unknown", + "physics_forge_commit": "6d7cf0d4d8eb2cda7b512100ff6058e25dbb3ddf", + "test_binary_sha256": "06afdf5f2e2572a8ce9c01c90013eab757030947149e5f778d45ff234e999a13", + "machine_identity": {"node": "spark-b87b", "system": "Linux", "release": "7.0.0-1019-nvidia", "architecture": "aarch64"}, + "silicon_observed": false, + "gate": {"R13_LIVING_SYSTEM": "HOST_PASS_NON_SILICON"}, + "first_failure": null, + "scenario": {"operation": "omega integer matvec 64x256", "goal": "cost below 55% of the confirmed incumbent, semantics preserved", "incumbent_ns": 6775, "target_ns": 3726, "selected_ps_per_call": 2687243, "reference_ps_per_call_new_cores": 4776609, "aien_final_expected_ns": 3034, "aien_final_goal_status": "MET", "aien_final_prediction_epoch": 2}, + "active_generation_before": 1, + "active_generation_after": 2, + "recovered_generation": 2, + "objects": { + "human_goal": {"id": 18, "generation": 1}, + "aien_plan": {"id": 22, "generation": 1}, + "omega_search": {"id": 3, "generation": 1}, + "gpu_input": {"id": 26, "generation": 1}, + "gpu_output": {"id": 27, "generation": 1}, + "experiment_evidence": {"id": 28, "generation": 1}, + "aien_experiment_belief": {"id": 25, "generation": 1}, + "omega_selection": {"id": 4, "generation": 1}, + "generation_candidate": {"id": 29, "generation": 1}, + "promotion": {"id": 30, "generation": 1}, + "in_force": {"id": 31, "generation": 1} + }, + "selected_realization_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", + "promoted_realization_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", + "rebuilt_from_durable_bytes_identity": "994f6a4775b76d3fd690f082e1e1f632913df33de7604aea2fef040d13591223", + "promoted_realization_bytes_sha256": "7b74d680905a80be2d9dec38f46481231910e5e22ed116f2448127a1552ccafa", + "aien_activations": 129, + "omega_activations": 112, + "experiment_seat_activations_on_existing_grant": 16, + "aegis_decide_activations_during_episode": 0, + "root_install_activations_during_episode": 0, + "generation_prepare_activations": 3, + "promotion_authority_activations": 2, + "gpu_claims": 16, + "gpu_completions": 16, + "gpu_publication_worker": "0x100", + "production_commits_during_aien": 140, + "production_commits_while_an_aien_activation_executed": 0, + "production_commits_during_omega": 140, + "production_commits_during_gpu_experiment": 140, + "production_commits_before_promotion": 955, + "production_commits_during_promotion_barrier": 702, + "production_commits_after_promotion": 131, + "production_results_using_unpromoted_realization": 0, + "outside_publications_after_goal_all_production_requests": 1086, + "generation_promotion_barrier_ns": 89232736, + "generation_candidate_to_promotion_ns": 89367264, + "causal_crumb_count": 2949, + "durable_provenance_links_verified": 11, + "causal_verification_result": "PASS", + "authority": {"live_capabilities_swept": 70, "promotion_right_holders": 1, "promotion_subject": 64}, + "controls": {"A_no_aien": "PASS", "B_no_promotion_authority": "PASS", "C_revoked_experiment": "PASS", "D_stale_generation": "PASS", "E_failed_verification": "PASS"}, + "composition_host_phase": {"result": "NOT_RUN", "reason": "production program: the composition phase needs the AIEN_TEST_BUILD rogue-candidate hook and test fixture (test-r13-testbuild-host)"}, + "fabric_host_phase": {"result": "NOT_RUN", "build": "host", "reason": "production program: Fabric F5-0 has only the loopback transport and HMAC stand-in (test build only, AIEN_TEST_BUILD); no real transport before TRUST-1"}, + "build": "production", + "argus": {"result": "OBSERVED", "mode": "observe and record (RX_ARGUS=2, authority observer, consumer ingest); no response action, holds no capability", "argus_lock": "argus.lock", "emitted": 111711, "received": 111711, "authority_observations": 421, "authority_mints": 420, "authority_revokes": 1, "findings": 0, "ingest_errors": 0, "ring_refused": 0}, + "operator": {"entry_point": "owner-only unix socket, SO_PEERCRED, runtime-issued caller credential plus RX_WORLD_RES_CONTROL halt capability (docs/r16-operator-control.md)", "subject": 70, "stops": 0, "resumes": 0, "restored_stops": 0, "open_stops": 0, "activations_cancelled_under_stop": 0}, + "not_claimed": ["R14", "R15", "R16", "neural/general cognition beyond R11", "open-ended realization invention beyond R10", "AIENOS-kernel isolation (authority is the host-library C port)", "the GPU add measures matvec cost (it is a physical witness of the experiment)"] +} diff --git a/docs/plans/adaptive-intelligence/baseline/r11.log b/docs/plans/adaptive-intelligence/baseline/r11.log new file mode 100644 index 0000000..29d387d --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/r11.log @@ -0,0 +1,18 @@ +aienos_lock_source: /home/drakestapleton/workspace/adaptive/omega/build/aienos-authority/b84c0a67590a934f3f3e001b12ec85ebc086a9eb matches b84c0a67590a934f3f3e001b12ec85ebc086a9eb for native/capability +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I../physics/m16 -I../physics/nvrm -I../physics/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I../physics/third_party/nvidia-open-580.173.02/kernel-open/common/inc -I../physics/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I../physics/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -pthread -o build/rx_r11_aien_test src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c src/runtime/rx_native_bind.c src/runtime/rx_omega.c src/sha256.c src/omega_evidence.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c src/omega_program.c src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c tests/runtime/rx_r11_aien.c build/rx_aien.o build/aienos-cap/b84c0a67590a934f3f3e001b12ec85ebc086a9eb/libaienos_capability.a -lm +./build/rx_r11_aien_test +[*] no record yet: AIEN watches and publishes nothing +[*] a steady record is predicted and confirmed; one outlier is not a failure +[*] a failed prediction after a core-class change becomes a hypothesis and a plan +[*] a failure with nothing else changed is drift; a second failure refutes it +[*] a settled failure is relearned, so a later core move is still noticed +[*] a human goal: unknown, met, unmet -> one plan, then unmet and explored +[*] AIEN cannot write what it observes; revoked, AIEN stops and the world does not +[*] living run: moved from Cortex-A725 to Cortex-X925, AIEN notices and Omega re-realizes + requests: served 416, wrong 0, timed out 0, refused 0, crumb overflow 0 + A725 record 0 at 6938 ns; X925 under it 4701 ns; X925 new record 3f6db775476a4f99 at 2880 ns (1.63x) +[*] control: the same move without AIEN leaves the body on the old record + control: A725 6885 ns, X925 after 192 more requests 4853 ns +checks 436 failures 0 +receipt: build/qual-runs/20261011T142516Z-16e729b6d844/R11/rx_aien_faculty_receipt.json +r11 exit 0 diff --git a/docs/plans/adaptive-intelligence/baseline/r13-run1-under-load.log b/docs/plans/adaptive-intelligence/baseline/r13-run1-under-load.log new file mode 100644 index 0000000..824003d --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/r13-run1-under-load.log @@ -0,0 +1,26 @@ +mkdir -p build/argus-src/b375dca +git -C ../aienos-argus archive b375dcaa2887d53cda407d773c2e4e489a0b1365 native/argus | tar -x -C build/argus-src/b375dca +touch build/argus-src/b375dca/.extracted +aienos_lock_source: /home/drakestapleton/workspace/adaptive/omega/build/aienos-authority/b84c0a67590a934f3f3e001b12ec85ebc086a9eb matches b84c0a67590a934f3f3e001b12ec85ebc086a9eb for native/capability +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I../physics/m16 -I../physics/nvrm -I../physics/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I../physics/third_party/nvidia-open-580.173.02/kernel-open/common/inc -I../physics/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I../physics/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -DRX_ARGUS=2 -DRX_ARGUS_AUTHORITY_OBSERVER -Ibuild/argus-src/b375dca/native/argus -Wl,--wrap=aienos_cap_start -pthread -o build/rx_r13_living_host src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/runtime/rx_aien.c src/runtime/rx_omega.c src/runtime/rx_generation.c src/runtime/rx_living.c src/runtime/rx_operator.c src/sha256.c src/omega_evidence.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c src/omega_program.c src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c src/runtime/aien_machine_id.c src/runtime/rx_jspace.c src/runtime/rx_cortex.c src/runtime/rx_cortex_record.c src/runtime/rx_graph.c src/runtime/rx_capq.c src/runtime/rx_skillroute.c src/runtime/rx_compose.c tests/runtime/rx_r13_living.c src/runtime/rx_argus.c build/argus-src/b375dca/native/argus/argus_event.c build/argus-src/b375dca/native/argus/argus_ring.c build/argus-src/b375dca/native/argus/argus_core.c build/argus-src/b375dca/native/argus/argus_detect.c \ + build/aienos-cap/b84c0a67590a934f3f3e001b12ec85ebc086a9eb/libaienos_capability.a -lm +./build/rx_r13_living_host +R13 operator: state /tmp/r13-state-kxEvTV, control /tmp/r13-state-kxEvTV/control (operator subject 70, pid 1536886) +R13 costs: incumbent 6884 ns, target 3786 ns, selected 2688414 ps, reference on new cores 4778170 ps, AIEN now expects 2964 ns, goal status 2 +R13 positive: generation 1 -> 2, recovered 2; served 1298 (135 after promotion), crumbs 2922, GPU claims 16, durable links 11 +R13 operator positive: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control A: no AIEN -> no plan, no GPU experiment, no candidate, generation stays 1 +R13 operator no-aien: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control B: verified candidate 2 refused (RX_GEN_ERR_AUTHORITY); never in force, production stayed on the reference +R13 operator no-promotion: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control C: revoked grant -> seat blocked on authority, no claim, no evidence; 773 requests served meanwhile +R13 operator revoked-experiment: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control D: output generation changed mid-claim -> result refused, no evidence, no candidate +R13 operator stale-gpu: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 mode 5: AIEN never confirmed the incumbent cost +R13 E failed verification FAILED: plan 1 search 2 GPU 0 evidence 0 belief 0 selection 1 candidate 0 promotion 0 in force 0 result 0 prepare refusal 0 +R13 ARGUS: observing; observe and record, received 1463830 events, 421 authority observations, 0 findings, 0 ingest errors +R13 gate: R13_LIVING_SYSTEM=FAIL +R13 receipt: build/qual-runs/20261011T142633Z-16e729b6d844/R13/rx_living_receipt.json +make: *** [Makefile:688: test-r13-host] Error 1 +r13 exit 2 diff --git a/docs/plans/adaptive-intelligence/baseline/r13-run2.log b/docs/plans/adaptive-intelligence/baseline/r13-run2.log new file mode 100644 index 0000000..65178ed --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/r13-run2.log @@ -0,0 +1,24 @@ +load before: 09:27:41 up 5 days, 2:56, 8 users, load average: 5.71, 3.98, 2.03 +aienos_lock_source: /home/drakestapleton/workspace/adaptive/omega/build/aienos-authority/b84c0a67590a934f3f3e001b12ec85ebc086a9eb matches b84c0a67590a934f3f3e001b12ec85ebc086a9eb for native/capability +./build/rx_r13_living_host +R13 operator: state /tmp/r13-state-mXY6Cq, control /tmp/r13-state-mXY6Cq/control (operator subject 70, pid 1577529) +R13 costs: incumbent 6775 ns, target 3726 ns, selected 2687243 ps, reference on new cores 4776609 ps, AIEN now expects 3034 ns, goal status 2 +R13 positive: generation 1 -> 2, recovered 2; served 1312 (131 after promotion), crumbs 2949, GPU claims 16, durable links 11 +R13 operator positive: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control A: no AIEN -> no plan, no GPU experiment, no candidate, generation stays 1 +R13 operator no-aien: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control B: verified candidate 2 refused (RX_GEN_ERR_AUTHORITY); never in force, production stayed on the reference +R13 operator no-promotion: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control C: revoked grant -> seat blocked on authority, no claim, no evidence; 770 requests served meanwhile +R13 operator revoked-experiment: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control D: output generation changed mid-claim -> result refused, no evidence, no candidate +R13 operator stale-gpu: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 control E: crashing candidate refused by the verifier; the promoted generation holds a verified one +R13 costs: incumbent 6923 ns, target 3807 ns, selected 2697756 ps, reference on new cores 4782463 ps, AIEN now expects 3045 ns, goal status 2 +R13 control E episode: generation 1 -> 2, recovered 2; served 19520 (132 after promotion), crumbs 42326, GPU claims 16, durable links 11 +R13 operator failed-verification: stops 0 resumes 0 restored 0 open 0; under stop: commits 0 externals 0 cancelled 0; order ok +R13 ARGUS: observing; observe and record, received 111711 events, 421 authority observations, 0 findings, 0 ingest errors +R13 gate: R13_LIVING_SYSTEM=HOST_PASS_NON_SILICON +R13 receipt: build/qual-runs/20261011T142755Z-16e729b6d844/R13/rx_living_receipt.json +r13 exit 0 +load after: 09:27:55 up 5 days, 2:56, 8 users, load average: 4.75, 3.85, 2.02 diff --git a/docs/plans/adaptive-intelligence/baseline/r14.log b/docs/plans/adaptive-intelligence/baseline/r14.log new file mode 100644 index 0000000..4e8d04e --- /dev/null +++ b/docs/plans/adaptive-intelligence/baseline/r14.log @@ -0,0 +1,27 @@ +aienos_lock_source: /home/drakestapleton/workspace/adaptive/omega/build/aienos-authority/b84c0a67590a934f3f3e001b12ec85ebc086a9eb matches b84c0a67590a934f3f3e001b12ec85ebc086a9eb for native/capability +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I../physics/m16 -I../physics/nvrm -I../physics/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I../physics/third_party/nvidia-open-580.173.02/kernel-open/common/inc -I../physics/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I../physics/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -pthread -o build/rx_r14_recovery_host src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/runtime/rx_aien.c src/runtime/rx_omega.c src/runtime/rx_generation.c src/runtime/rx_living.c src/sha256.c src/omega_evidence.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c src/omega_program.c src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c src/runtime/aien_machine_id.c src/runtime/rx_jspace.c src/runtime/rx_cortex.c src/runtime/rx_cortex_record.c src/runtime/rx_graph.c src/runtime/rx_capq.c src/runtime/rx_skillroute.c src/runtime/rx_compose.c tests/runtime/rx_r14_recovery.c build/aienos-cap/b84c0a67590a934f3f3e001b12ec85ebc086a9eb/libaienos_capability.a -lm +./build/rx_r14_recovery_host +R14 F BEFORE_CANDIDATE_WRITE: first process exit 86; recovered OLD generation 1; restore REFERENCE; 202 served after restart, adapted again +R14 F DURING_CANDIDATE_WRITE: first process exit 86; recovered OLD generation 1; restore REFERENCE; 202 served after restart, adapted again +R14 F AFTER_CANDIDATE_WRITE: first process exit 86; recovered OLD generation 1; restore REFERENCE; 202 served after restart, adapted again +R14 F BEFORE_ROOT_FLIP: first process exit 86; recovered OLD generation 1; restore REFERENCE; 201 served after restart, adapted again +R14 F DURING_ROOT_FLIP: first process exit 86; recovered OLD generation 1; restore REFERENCE; 200 served after restart, adapted again +R14 F AFTER_ROOT_FLIP: first process exit 86; recovered NEW generation 2; restore RESTORED; 201 served after restart +R14 F BEFORE_RECEIPT: first process exit 86; recovered NEW generation 2; restore RESTORED; 200 served after restart +R14 F AFTER_RECEIPT: first process exit 86; recovered NEW generation 2; restore RESTORED; 202 served after restart +R14 A tamper: verdict REFUSED reason 2; generation 1 -> 2 holds verified quad4; 755 served during, 102 after +R14 A semantic: verdict REFUSED reason 4; generation 1 -> 2 holds verified quad4; 927 served during, 101 after +R14 A crash: verdict REFUSED reason 5; generation 1 -> 2 holds verified quad4; 10827 served during, 102 after +R14 B: forged/borrowed/revoked/stale/GPU refused, slot stuffing contained, forged decisions minted nothing, promotion forgery refused; renewed grant, lanes 117 published, production 4062 during, 102 after +R14 C: cycles contained in 7 ms (max 256 activations), 3 containment crumbs, organism untouched; production 4970 during, 102 after +R14 D: 3200 lane requests, at most 4 claims at once (cap 4), up to 12 waiting; 3200 published once, 0 lost, 0 duplicated; production 1187 during, 100 after +R14 E: seat killed holding lane claim 232; lost once, seat generation 1 -> 2, retry published once, stale claim refused; production 19 during, 100 after +R14 A_corrupt_candidate PASS +R14 B_forged_capability PASS +R14 C_reaction_cycle PASS +R14 D_gpu_saturation PASS +R14 E_gpu_seat_kill PASS +R14 F_checkpoint_crash PASS +R14 gate: R14_LIVING_RECOVERY=HOST_PASS_NON_SILICON +R14 receipt: build/qual-runs/20261011T142649Z-16e729b6d844/R14/rx_recovery_receipt.json +r14 exit 0 diff --git a/docs/plans/adaptive-intelligence/inventory/authority-and-cortex.md b/docs/plans/adaptive-intelligence/inventory/authority-and-cortex.md new file mode 100644 index 0000000..b03850f --- /dev/null +++ b/docs/plans/adaptive-intelligence/inventory/authority-and-cortex.md @@ -0,0 +1,105 @@ +# Authority and Cortex ownership inventory (Milestone 0) + +Scout: read-only. Repos at pins in /home/drakestapleton/workspace/adaptive/PINS.txt (omega 16e729b6d844, aienos 3b2004b692a7, aegis-runtime 1eba7a7223ba, aien-sovereign-core 00e7ef05302c, cortex-rs 0606636f110d). Paths are relative to /home/drakestapleton/workspace/adaptive/. Claims without a source are marked UNVERIFIED. + +## 1. Classification table + +| Capability | Where | Class | +|---|---|---| +| Canonical Cortex store (C CxStore, single writer, journal) | omega/src/runtime/rx_cortex.h:2-29 | Implemented and integrated (called by rx_projection.c per header :8-10; reached by sovereign-core via aien-omega-compose, crates/aien-omega-compose/src/lib.rs:1-9) | +| Cortex HTTP memory service (:18080) | aien-sovereign-core/crates/cortex-rs | Implemented and integrated (live), but declared NON-authoritative and slated for deletion (rx_cortex.h:12-29) | +| Standalone cortex-rs repo | cortex-rs/README.md:1-3 | Superseded or deprecated (ARCHIVED; canonical home is the sovereign-core copy) | +| aienos-cortex Rust epistemic store | aienos/crates/aienos-cortex | Implemented, integrated into host-side aienos-aegis/aienos-explain only; declared non-authoritative (rx_cortex.h:18-20) | +| Operator emergency stop (world level) | omega/src/runtime/rx_world.h:805-830 | Implemented and integrated (tests: omega/tests/r16_qualify/run.sh, tests/runtime/rx_operator_mutants.sh, rx_r12_resident.c) | +| Capability authority, kernel-native | aienos/crates/aienos-capability/src/lib.rs | Implemented (7 unit tests), consumed by aienos-kernel caps.rs:9; not on Linux path | +| Resource admission + budgets, kernel | aienos/crates/aienos-kernel/src/{admission,budget}.rs | Implemented (native only; AIENOS is not what runs on this Spark today, per memory) | +| Priority classes (Background/Normal/Latency) | aienos/crates/aienos-kernel/src/scheduler.rs:8-12 | Implemented (native only) | +| Host effect broker: intent, token, operator grant | aienos/crates/aienos-aegis/src/{effect,broker,capability,evaluator}.rs | Implemented but disconnected (only crate depending on it is itself; grep of crates/*/Cargo.toml) | +| aegis-runtime ExecutionAuthority trait | aegis-runtime/src/execution/broker.rs:15-18 | Implemented but disconnected (zero `impl ExecutionAuthority` in src or tests) | +| aegis-runtime RunBudget / SessionBudget | orchestration/budget.rs:3-9, sessions/session.rs:34-38 | Implemented but disconnected (no enforcement site; only constructed and serialized) | +| aegis-runtime DoctrineDecision / ContainmentLevel::EmergencyStop | defense/decision.rs:7-21 | Implemented but disconnected (type only; no producer found) | +| aegis-runtime dispatch allowlist membrane + probe gate | src/enforcement.rs:14-80, skills.rs:131-163 | Implemented and integrated (used by every dispatch path, enforcement.rs:73 comment) | +| sovereign-core approval desk + durable effect ledger | aien-runtime/src/{spine,approved,approved_auth,approved_replay,effects}.rs | Implemented and integrated (daemon path, many attack tests) | +| sovereign-core compose run (bounded experiment entry) | control.rs:89 RunComposeTask, aien-omega-compose Compose::run lib.rs:332 | Implemented and integrated | +| Inference interface | aien-abi-core AienInferenceBackend (lib :587) ; aegis-runtime InferenceEngine inference.rs:79 | Implemented and integrated (two separate traits, see section 4) | +| Serve-path observation snapshot (queue, KV, batch) | aien-dual-observation/src/lib.rs:118-158 | Implemented but disconnected (only dev-dependency users found: aien-scheduler tests) | +| Typed resource-condition state (latency, contention, memory pressure, deadline risk) as one type | none | Missing (pieces only, section 5) | +| Legacy ALLEN scoped memory | aien-allen-memory/src/lib.rs:1-16 | Implemented, separate store, not Cortex | + +## 2. Cortex ownership table + +Quoted migration plan, omega/src/runtime/rx_cortex.h:2-3 "Cortex, AIEN's durable typed memory. CANONICAL (M20)." and :4-10 AUTHORITY paragraph. Lines 22-29 verbatim: "Their records are not AIEN memory until they enter this store, and they enter only as CX_K_IMPORTED claims whose tag names the source (CX_SRC_*): never as facts and never by writing a journal directly. ... both are retired, not ported. (1) No new caller may be added to either. (2) Whatever is worth keeping is imported as CX_K_IMPORTED records through cx_append_as. (3) The crates are deleted. Until step 3 nothing may treat them as a source of truth." + +| Consumer | Which Cortex implementation | Authoritative? | Migration state | +|---|---|---|---| +| Live HTTP service on 127.0.0.1:18080 | cortex-rs binary ~/.local/bin/cortex-rs (built Sep 18, 9974712 bytes), process pid 4773 listening on 18080, `--db-path ~/.config/cortex/cortex.db` (ss and ps output this session). Routes /api/cortex/{write,search,recall,get,traverse} match aien-sovereign-core/crates/cortex-rs/src/main.rs:109-116. Which source tree built the binary: UNVERIFIED (high confidence sovereign-core copy, since the standalone repo is archived) | No (rx_cortex.h:12-16) | Step 1 stated by header; no import into CxStore found by this scout (UNVERIFIED, not searched in omega beyond headers) | +| MCP "cortex" tools (lessons memory) | ~/workspace/cortex-mcp/lib.js:12 BASE = CORTEX_URL or http://127.0.0.1:18080; calls /api/cortex/search (:81), /recall (:85), /get (:91), /write (:179, :204). README says "stored in the local cortex-rs server" | No (HTTP client of the non-authoritative service) | Not migrated. Not a Rust crate caller, so "no new caller to the crates" does not cover it | +| aien-cli | HTTP :18080 via crates/aien-cli/src/cortex.rs:5, :39, :66 | No | Header names this caller (rx_cortex.h:15-16); still live | +| spark-mail-rs | Library link: Cargo.toml:27 cortex-rs path dep; src/effect.rs:8 `use cortex_rs::{...Database...}`; also cortex_sync.rs (HTTP client, :9-15) | No | Not migrated | +| cortex-path-m1 (read-only experiment) | Library link: Cargo.toml:21; tests/m1.rs:7, src/run.rs:7 | No | Experimental consumer, not migrated | +| aien-runtime (compose daemon) | Declares `cortex-rs = { path = "../cortex-rs" }` at crates/aien-runtime/Cargo.toml:18 but NO `cortex_rs` use in any aien-runtime .rs file (grep). Its real Cortex is omega C CxStore through aien-omega-compose (crates/aien-omega-compose/src/lib.rs:1-9 "recorded in the Cortex journal /cortex.cx"; aien-runtime/src/cortex_mark.rs:1-14, effects.rs:1-30, approved_replay.rs use it) | Yes (CxStore) | Already on canonical store; the Cargo.toml dependency on cortex-rs looks like a leftover (unused dependency; build.rs/cfg use UNVERIFIED) | +| spark-rsi (Cargo.toml only) | NO dependency on cortex-rs or any cortex crate (grep -i cortex of spark-rsi/Cargo.toml returned nothing; deps at lines 21-37 are clap, serde, spark-crumbs, crumb-spec, tokio, reqwest etc.). reqwest is present, so HTTP to :18080 is possible but UNVERIFIED (src not read, per scope) | n/a | n/a | +| aienos-aegis, aienos-explain, aienos-kernel continuity | aienos/crates/aienos-cortex (aienos-aegis/Cargo.toml:13, aienos-explain/Cargo.toml:12; kernel continuity.rs:260 holds a `cortex_wal` ObjectId list only) | No (rx_cortex.h:18-20) | Not migrated; aegis uses it as a dependency but src/*.rs had no `aienos_cortex` reference in grep (dependency possibly unused: UNVERIFIED) | +| omega runtime (rx_projection.c, rx_world.c, compose) | omega C CxStore, rx_cortex.h / rx_cortex_record.h | YES, only one | Canonical (M20, 2026-09-30) | +| AEGIS runtime (aegis-runtime) | No Cortex implementation. `cortex.search` and `cortex_recall` are in ALLOWED_SKILLS but "Registered but unconnected; their handlers only report Unavailable" (src/enforcement.rs:20-24) | n/a | Disconnected | +| ALLEN memory | Separate store `.allen-memory/` (aien-allen-memory/src/lib.rs:1-5) | Not Cortex | Separate by design | + +Reading: three live stores coexist (CxStore, cortex-rs SQLite at ~/.config/cortex/cortex.db, aienos-cortex in-process). The header declares only CxStore authoritative, yet all agent-memory traffic on this Spark (MCP, aien-cli, mail) goes to cortex-rs. Step 3 (delete) is far from done because step 2 (import as CX_K_IMPORTED) has no evidence of existing in what this scout read. + +## 3. aegis-runtime: execution authority and enforcement + +Public types (aegis-runtime/src/lib.rs:18-63 re-exports): +- Intent and capability: `ActionRequest { session_id, run_id, capability: String, intent: String, target, params }` execution/broker.rs:5-12; `Action` execution/action.rs:42-54 (capability and intent are free strings). +- Admission: trait `ExecutionAuthority::authorize(&ActionRequest) -> Result` broker.rs:15-18. `DoctrineDecision { Allow, AllowRestricted(Vec), RequireApproval, Deny(String), Contain(ContainmentLevel) }` defense/decision.rs:15-22. `DefenseReceipt` defense/receipt.rs. `Approval/ApprovalStatus` defense/approval.rs:4-46. +- Emergency stop: only `ContainmentLevel::EmergencyStop` (decision.rs:7-12), as a decision value. No handler that acts on it was found (grep EmergencyStop: only the definition). +- Budget: `RunBudget { max_steps, max_inference_calls, max_actions, max_wall_time_secs }` orchestration/budget.rs:3-9; `SessionBudget { max_total_tokens, max_wall_time_secs }` sessions/session.rs:34-38. Used only to construct and map to AgentState ABI (session.rs:155-157). No enforcement site found. +- Grant: no type named grant exists in aegis-runtime. `WorkspaceCapability` security.rs:31 is a path-confinement object. +- What actually enforces: `enforcement::pre_dispatch_check` (enforcement.rs:31-58: exact-match ALLOWED_SKILLS, bash_eval only through `admit_local_command`, security.rs:326) then `probe_gate` (enforcement.rs:73-80, ProbePolicyGuard policy_guard.rs:54-111, threshold can only be raised by env, enforcement.rs:60-69). Called in SkillRegistry::execute (skills.rs:162) and dispatch_classified (skills.rs:131-143). + +Tests that show enforcement independent of the caller: +- tests/gateway_auth_tests.rs:263 `skill_allowlist_holds_behind_the_token`: an authenticated caller still cannot run exec, shell, "Bash_eval", "bash_eval ", spawn_process (loop at :266, assertion contains "allowlist" at :278). +- tests/failure_provenance_tests.rs:2 "allowlist dispatch. Each test is a bypass attempt" (header comment; per-test content not read in full). +- src/enforcement.rs:80+ unit tests: destructive_shell_refused with forms the old blocklist let through. +- tests/aegis_tests.rs (skills.execute unknown skill refused with "not on the dispatch allowlist", ~line 480 area from grep of agent.rs:482 comment). +- tests/policy_guard_tests.rs:3-14 (reference backend; strict threshold fails closed). + +Gap: the "grant, budget, emergency stop" the Adaptive Intelligence loop needs exist as unenforced data types here. The enforced path is allowlist plus probe, with no per-experiment grant or budget accounting. + +## 4. aienos: native authority, capability, kernel (public interface only) + +- aienos-capability (crates/aienos-capability/src/lib.rs, 1001 lines, 7 tests). Capability references are index plus generation (CapRef :119), `Entry` (subject, rights, 64-bit resource, epoch, lease_expiry, parent, :132-146), `Mint` (:149), `AuthorityState::{validate :256, mint :407, revoke :528 (cascades to descendants, :499), reclaim, advance_clock, bump_epoch}`. Checking and changing are split: `AuthorityView` (:615) can only inspect/validate; its `cognition_attempt_mint/revoke/reclaim/clock/epoch` (:640-656) exist to prove cognition cannot mutate; mutation needs `AuthorityAdmin` holding a 32-byte office token (:662-681). Error codes ERR_STALE_GEN/REVOKED/EPOCH/SUBJECT/RESOURCE/RIGHTS/EXPIRED/AMPLIFY (:19-30). Tests: forged_stale_subject_resource_and_rights_fail_closed :734, amplification_lease_epoch_and_revoked_ancestor_fail :790, generation_wrap_restarts_and_cognition_cannot_mint :899. +- aienos-kernel admission (crates/aienos-kernel/src/admission.rs): `AdmissionLimits :35`, `AvailableResources :78`, `AdmissionPolicy :91` with `evaluate :192` returning `GrantedAdmission :299` / `GrantedCapability :291`. Header :1-5: decides what a verified artifact may receive, does not reserve or execute. 7 unit tests. +- aienos-kernel budget (budget.rs): `ResourceEnvelope :7` (cpu ticks per period, memory frames, DMA bytes, max_runtime_ticks), `BudgetError :24`, `WorldState {Active, Quarantined} :34`, `BudgetMode {Active, Idle, Urgent} :40`, `BudgetManager::{admit :114, charge_cpu :178, charge_frames :192, pet :228, check :235, restore :254}`. Watchdog "pet/check" gives deadline policy. 6 tests. +- aienos-kernel scheduler (scheduler.rs:8-12): `TaskPriority { Background, Normal, Latency }`; `place :68`, `enqueue :93`; background starvation guard around :156-168. 9 tests. +- aienos-aegis (host-side crate, std + serde, not no_std kernel code): `EffectIntent { id, agent_id, action, parameters, claimed_capability_id, is_reversible, world_id }` effect.rs:12-19; `OperatorGrant`; `AegisDecision { Approved, RequiresOperatorApproval, Rejected }` evaluator.rs:9-13; `EffectBroker::dispatch` broker.rs:114 with `EffectAuditRecord :12`; `CapabilityGraph` HMAC-signed tokens, issue_root_token :230, derive_child_token :265, validate_token :340. Test: tests/phase_3_to_5_integration.rs (one file) plus broker.rs unit tests (:211, :331, :386). Doc comment lib.rs:3-4 "intelligence proposes; deterministic authority disposes". Disconnected: no other crate depends on it. +- aienos-cortex (src/store.rs `CortexStore` :19; record_observation :31, record_verified_fact :53, record_operator_decision :77): see section 2. + +Relevance: this is the only place with unforgeable, revocable, leased capabilities plus resource envelopes, but it targets native AIENOS, not the Linux Spark path used today (memory note aienos-local-copy-stale does not apply; the repo is a fresh clone). UNVERIFIED whether any of it runs on this machine. + +## 5. aien-sovereign-core: Worlds, inference, spine, desk, entry point + +- World implementations: (a) `WorldStore` aien-runtime/src/world.rs:67 with `WorldManifest { id, parent, object_root, filesystem_root, token_root, memory_root, capability_set, effect_log, created_at }` and an `EffectIntent` enum (WriteFile, ExecuteCommand, SendMessage, PublishGit) world.rs:10-22 — path-copying persistent worlds, effect journals; (b) the omega `RxWorld` (C) which is the authoritative world for compose (Compose::run, aien-omega-compose lib.rs:332) ; (c) aienos-aegis `JSpaceWorld` (aienos, copy-on-write, rollback/promote, world.rs:14-75). Three Worlds exist; the compose daemon uses the omega one for commit. +- Inference: `trait AienInferenceBackend` aien-abi-core/src/lib.rs:587 (load_model, execute_step -> StepMetrics, fork_sequence :607), used by the spine (aien-runtime/src/spine.rs:5-12, :20). `StepMetrics { prefill_tokens_processed, decode_tokens_emitted, step_latency_us, active_kv_blocks }` lib.rs:579-584. aegis-runtime has its own `InferenceEngine` trait (aegis-runtime/src/inference.rs:79) — duplicate interface, UNVERIFIED whether they are bridged. +- Spine (one line): `AienRuntimeSpine` aien-runtime/src/spine.rs:19-ff, the single-process runtime that unifies the sequence arena, scheduler, KV manager, WorldStore, context composer and swarm (spine.rs:1-3). CONTEXT.md:30 also uses "spine" for the daemon/compose bridge. +- Desk (one line): the "approval desk", the operator's approval step for effects; required by default, needs a desk key created by `aien compose desk-key --create 1` before the daemon starts (CONTEXT.md:13-14; code approved_auth.rs, spine.rs; header approved.rs:1-26: HMAC-authenticated approvals, replay claimed durably in the Cortex journal). +- Legacy memory consumers: cortex-rs library/HTTP callers (section 2); `aien-allen-memory` separate scoped store; spark-mail-rs; cortex-path-m1. +- Enforcement independent of caller, sovereign-core: effects.rs:25-30 "The ledger honours only grants the daemon wrote itself ... A caller-written authorization note ... is read but never honoured"; tests approved_attacks_test.rs c01-c08 (forged approver :210, invalid MACs :220-254, changed ids/path/content :268-318, desk key permissions :334); desk_required_server_test.rs :88, :108 (daemon refuses to start without desk). Durable stop: effects.rs:18-19 "stop ... A grant older than the newest stop is stale forever." +- Entry point for a bounded experiment through real authority: the aien-runtime control socket, command `ControlCommand::RunComposeTask { goal, workspace, context }` (control.rs:89-98), which runs the omega compose path (Skills compete on J-Space branches, AEGIS verify callback, winner commits via World, recorded in Cortex journal; aien-omega-compose lib.rs:1-9). An external effect then needs approval desk path (`ProposerHook`, approved.rs) -> `ComposeEffectIntent` -> ack (effects.rs, spine.rs:409-413). The emergency stop beneath that is omega `rx_world_emergency_stop` (rx_world.h:824) requiring caller credential plus a control capability with RX_WORLD_RIGHT_HALT, and refusing any reaction subject (rx_world.h:805-822). Operator-level `stop/resume/revoke` records exist in effects.rs:18-19. + +## 6. Existing resource-condition observation + +Pieces exist, no single typed condition state: +- omega/src/runtime/rx_world.h: `RxResourceNeed { memory_bytes, deadline, energy_cost, latency_class (recorded only) }` :241-249; `RxResourceBudget` :256-265; `RxStats` counters `blocked_resource :429`, `deadline_overdue :442`, `deferred_peak`, `deadline_cancelled :492` (HD-09). These are counters of past events, not a typed state of current latency/contention. +- aien-sovereign-core/crates/aien-dual-observation/src/lib.rs:118-158: `ServeObservationSnapshot` (waiting, preempted, running, KV blocks, batch limits) and `ObservationDelta`, a read-only snapshot of the serve path. Closest existing candidate; look at it before building anything. Consumers: only tests found (UNVERIFIED completeness). +- aien-abi-core `StepMetrics` lib.rs:579 (step_latency_us, active_kv_blocks). +- aien-runtime/src/spine.rs:478-479: KV "memory pressure" percentage, self-described "honest proxy until the GB10 telemetry hook lands". +- aienos-kernel budget.rs `WorldState`, `BudgetMode` (native only). +- Deadline risk: Missing as a derived value. Only the post-hoc overdue/cancelled counters (rx_world.h:442, :492) exist. +Classification: latency/memory-pressure raw observations Implemented but disconnected; contention and deadline risk typed state Missing. + +## 7. Ownership conflicts and duplication risks + +1. Biggest: Cortex has two live authorities in practice. rx_cortex.h declares C CxStore canonical and the crates retired, but every agent memory path on this Spark (MCP lessons, aien-cli, mail) writes to cortex-rs on :18080 with no import path observed. A new Adaptive Intelligence memory must write via omega CxStore (cx_append/cx_append_as, single writer) and NOT add a new caller to cortex-rs (rx_cortex.h:27-28 rule 1). +2. aegis-runtime has authority-shaped types (ExecutionAuthority, RunBudget, EmergencyStop) with no implementation. Do not build a new "budget" or "grant" type on them without deciding whether to implement them or use omega/aienos primitives. Three candidates for the same job: aegis-runtime types (unenforced), aienos-capability/aienos-aegis (native, strong, disconnected from Linux path), omega RxWorld authority and halt (enforced, C). +3. Three World implementations (sovereign-core WorldStore, omega RxWorld, aienos JSpaceWorld) and two inference traits (AienInferenceBackend, aegis InferenceEngine). +4. Stale dependency edges: aien-runtime -> cortex-rs and aienos-aegis -> aienos-cortex appear unused (grep), which will block step 3 deletion tracking unless cleaned. diff --git a/docs/plans/adaptive-intelligence/inventory/evidence-chain.md b/docs/plans/adaptive-intelligence/inventory/evidence-chain.md new file mode 100644 index 0000000..08eb654 --- /dev/null +++ b/docs/plans/adaptive-intelligence/inventory/evidence-chain.md @@ -0,0 +1,110 @@ +# Evidence chain inventory (Milestone 0, read-only scout) + +Pins: aien-protocols 407487b7e163, interplane 667fbe811f78, spark-inquisitor 230d257199b7 (ARCHIVED), benchmarks 8d4dfde8f944. +Paths are relative to /home/drakestapleton/workspace/adaptive/. Nothing was built or run; all claims are from reading source. + +## Classification table + +| Capability | Class | Key evidence | +|---|---|---| +| Evaluation plan/receipt types + P-256 signing (aien-evaluation-protocol) | Implemented but disconnected | aien-protocols/crates/aien-evaluation-protocol/src/lib.rs:510-602; only consumers are the archived inquisitor and spark-rsi per CONSUMERS.md:11-12 | +| TRN1 execution transcript (spec + C verifier + corpus) | Implemented but disconnected (spec: "Not yet produced by any runtime") | aien-protocols/specs/execution-transcript/TRN1_TRANSCRIPT_SPEC.md:3; no TRN1 mention in interplane or benchmarks (grep) | +| Signature over transcript / final chain digest | Missing | TRN1_TRANSCRIPT_SPEC.md:473-475 | +| Judge receipt `rsi-eval/2` verification (signature, subject, policy, holdout, threshold) | Implemented and integrated (inside interplane) | interplane/provenance/src/evaluation.rs:96,177,288-482; tests/evaluation.rs | +| Byte-compat with spark-rsi judge receipt | Implemented and integrated (one fixture) | interplane/provenance/tests/evaluation.rs:533,586 | +| One unified receipt format across repos | Missing: separate formats (EvaluationReceipt, rsi-eval/2, prime-race receipt v1; EvidenceReceiptV1 in sovereign-core) | sec. 1, 2, 4 | +| AIEN adapter evidence export (ledger slice, model turn, test run) | Implemented and integrated, but UNSIGNED | interplane/adapters/aien/src/provenance_export.rs:17; provenance/BINDING.md:195 | +| INTERPLANE conformance corpus + negative controls V1-V8 | Implemented and integrated | interplane/conformance/negative-controls.json:4-13 | +| spark-inquisitor protocol evaluators | Superseded (repo archived; protocol slice not carried to canonical copy) | spark-inquisitor/README.md:1-3; sec. 3 | +| benchmarks main harness (`src/harness`) | Experimental; cannot build standalone | benchmarks/Cargo.toml:18-22 | +| benchmarks prime-drag-race runner (content-addressed, no-overwrite receipts) | Implemented, standalone, own unsigned format | benchmarks/prime-drag-race/src/receipt.rs:20-40, src/lib.rs:15 | +| Longitudinal benchmark history / trend store | Missing | benchmarks/data holds two snapshot files; no history tooling found | +| Independent audit (separate party re-verifies whole chain) | Missing | judge key is operator-supplied (evaluation.rs:1-8), but nothing audits the operator or links receipt to transcript | + +## 1. aien-protocols + +Workspace members: aien-protocols/Cargo.toml:4-12. The `.crumb` at repo root has empty role strings for crates/ and specs/. + +**aien-evaluation-protocol** (crates/aien-evaluation-protocol/src/lib.rs, 806 lines; path deps only on aien-protocol-types and aien-provenance, Cargo.toml:9-10): +- Types: EvaluationRequest :17 (request_id, subject ArtifactRef, parent, profile, claims, nonce); EvaluationPlan :36 (evaluation_id, subject, evaluators, baseline, sandbox_profile, policy_digest, evaluator_manifest_digest, plan_digest); EvaluatorOutcome :165 with `execution_digest` (computed :175); EvaluationReceipt :510; SignedEvaluationReceipt :583. +- Identities bound by the receipt digest (:525-555): protocol_version, evaluation_id, request_digest, subject_digest, plan_digest, evidence_root, outcomes_root, verdict, verifier principal/key_id/trust_epoch/trusted_build_digest/policy_bundle_digest, started_at, completed_at. +- NOT bound: no "world" field, no "generation" field, no separate "execution id". Nearest: `execution_digest` per evaluator outcome (:170), merged into outcomes_root via compute_merkle_root (:651). "Candidate digest" is `subject_digest`. (Checked by grep: world/generation absent from the file.) +- Signing: `VerifierSigner` trait :254; `SoftwareP256Signer` :262 (Tier2); `TpmP256Signer` :300 (Tier4, TPM code :309-445); `sign_with_signer` :557 (rejects key_id != fingerprint); `SignedEvaluationReceipt::verify(&VerifyingKey)` :591. Verify checks the signature over the recomputed digest only; it does not check the stored cryptographic_tier or key_fingerprint against the key (:591-601). +- Orchestration: `CanaryRollbackHarness::evaluate_and_enforce` :674-. Fails closed on plan-digest mismatch, duplicate, unexpected, missing, version-mismatched evaluator; runs rollback on hard-invariant failure. +- Tests (tests/evaluator_protocol_tests.rs, 382 lines): plan tamper -> digest invalid :84; frozen-invariant tamper -> PlanTamperingDetected :94; signer tier + signature verify + key-identity mismatch :109; missing evaluator fails closed :184; version mismatch :224; invariant violation triggers rollback :267; success admits :328. + +**aien-provenance** (src/lib.rs): SourceGrant for data-source licences (verify_signature :124, validity :140, permission :149, licence :160). Source-licence provenance, not run provenance. + +**Execution transcript contract** (specs/execution-transcript/): +- TRN1_TRANSCRIPT_SPEC.md: 48-byte header with `run_id` (root causal id, bytes 8-40, table near :56); hash-chained records; refusal codes MAGIC..TRUNCATED in vectors/expected.txt:3-5; capability generations appear inside records (BRANCH_CREATE :115, CAP_TRANSITION :120, EFFECT_INTENT :122). Status :3 "Not yet produced by any runtime". Planned producers named at :9 (omega tools/replay, sovereign-core aien-replay). +- Reference verifier tools/trn1_verify.c (500 lines); corpus of 106 files in vectors/; tools/check-corpus.sh, test-check-corpus.sh, mutate-verifier.sh (disables each check in turn and fails on any survivor, mutate-verifier.sh:30). +- Candidate digest and world identity are NOT in the transcript header. Join to receipts is by `run_id` plus "join rules" that are not verifier rules (spec :470). + +**Other specs**: specs/evaluation/SPEC.md (not read in depth, content UNVERIFIED). specs/evidence-receipt/SUBSET.md:3 says it is a PARTIAL extraction and "the full extraction is owed". specs/verified-crumb/SPEC.md plus golden/r01..r08 refusal vectors. + +## 2. interplane + +**provenance/src/evaluation.rs** (482 lines). Header :1-8: no change may be promoted unless its exact identity matches a valid, independently signed evaluation; judge key comes from the operator, never from the bundle; it reads and compares, authorizes nothing. +- `receipt_digest_v2` :96-175 covers cycle_id, candidate_id, parent_id, evaluated_at, evaluator_version, evaluator_binary_sha256, subject_path, subject_sha256, holdout_set_sha256, policy_sha256, holdout counts, admitted and hard-invariant/statistical flags, per-layer results, metrics_summary. +- `verify_signature` :177-197: P-256, optional `tpm2-p256:` prefix, message is the 32 raw digest bytes. +- `check` (:288-482) refusal codes: evaluation_v1_insufficient, unsupported_evaluation, evaluation_malformed, evaluation_signature_bad, evaluation_untrusted, evaluation_subject_mismatch, evaluation_parent_mismatch, evaluation_policy_mismatch (several), evaluation_holdout_mismatch, evaluation_below_threshold. +- This is the spark-rsi judge format (tests/evaluation.rs:533 "written and signed by spark-rsi's own judge binary"), NOT aien-evaluation-protocol. grep for aien_evaluation / EvaluationReceipt / aien_protocol across interplane returned nothing. +- Entry points: `verify`/`verify_with` provenance/src/lib.rs:139-143; calls `evaluation::check` at :439. Trust statements: BINDING.md:137, :352; :195 "unsigned exports; the verifier cannot tell a harness export from a hand-written file". + +**adapters/aien/** (no `.crumb` file in this directory). Evidence crosses as an exported bundle, not as a shared type crate. `export_bundle` provenance_export.rs:199 writes the daemon's raw ComposeRecall views (claim, settlement, grant, intent, ack), daemon-run.json from /proc, the load log, the INTERPLANE trace, model files, and COMPANION.json (path, size, SHA-256) (:1-8). A scripted turn can never be `PASS complete` (:12-15). "No record is signed" (:17). Judge path: src/rsi_m5.rs (`propose_and_judge` :60, `judge_model_proposal` :73), scripts/m5-*.sh, evidence/ dirs dated 2026-10-08/09. +- Approval binding uses HMAC-SHA256 with a shared desk key, not a public-key signature: compose_ledger.rs `ApprovalBinding` :94, `DeskKey` :132, `mac` :190. +- Tests (adapters/aien/tests/): approval.rs, bridge.rs, compose_ledger.rs (2042 lines), compose_ledger_attacks.rs (558), demo_workflow.rs, exposure.rs, pipeline.rs, t4_corpus.rs. + +**conformance/**: 27 required fixtures plus injection, approval and lifecycle sets (README.md:5-7). negative-controls.json defines V1-V8: each is a deliberately defective runner variant that must fail named fixtures (:4-13). TRUST-DIGEST.txt freezes the corpus. runners/validate_fixtures.py is Python (README.md:11). + +## 3. spark-inquisitor (ARCHIVED) + +- README.md:1-3: archived; canonical home is aien-sovereign-core/crates/spark-inquisitor. +- src/protocol_evaluator.rs (199 lines): `InquisitorDiffEvaluator` :9 and `InquisitorConstitutionalEvaluator` :118, both implementing `Evaluator` (:32, :143). src/probe_audit.rs (288 lines) uses aien-probe. +- Cargo.toml:14-16: unpinned path deps on ../aien-protocols/crates/{aien-protocol-types, aien-evaluation-protocol, aien-probe}. +- Tests: tests/protocol_integration.rs: clean pass :44, telemetry/unslop rejection :69, constitutional :109, canary rollback integration :132-182 (asserts Verdict::Fail and `receipt.verify(&verifying_key)` :178-181). Other test files (constitutional_rules.rs, diff_auditor_edge_cases.rs, issue_triage_evaluator.rs, cli_exit_code_contracts.rs, probe_audit_tests.rs) check diff-content rules (dashes, buzzwords, secrets, .env), not evidence tampering. +- Live dependents: grep of Cargo.toml/lock/yml for "inquisitor" in aien-protocols, interplane, benchmarks found none. Only mention is aien-protocols/CONSUMERS.md:11 (stale doc row). +- Canonical copy (aien-sovereign-core/crates/spark-inquisitor, outside the four repos, checked locally): src/ has no protocol_evaluator.rs and Cargo.toml has no aien-protocols dependency (uses spark-crumbs and crum-spec git deps). The evaluator-protocol adapter exists only in the archived repo. +- Class: Superseded. + +## 4. benchmarks + +- Root crate `aien-benchmarks` (Cargo.toml:1-22) depends on ../canonical-branch-native-runtime/crates/{aien-platform, aien-platform-linux, aien-kv-cache, aien-scheduler, aien-inference-abi}. That sibling is absent from the adaptive workspace, so the root crate cannot build from a fresh clone. prime-drag-race/Cargo.toml:10-11 says the same. +- No dependency on aien-protocols or any evaluation crate. Own formats only. +- src/harness/: mod.rs (437 lines; `MeasurementConfig` :12, `run_measurement_suite` :34), inference_bench.rs, http_bench.rs, memory.rs, smaps.rs, system.rs, standalone.rs, workloads.rs. Output model `BenchmarkData` src/models.rs:4. Only 3 unit tests (src/main.rs:400,408,425: math, SVG, markdown); none test tampering. +- artifacts/gb10_canonical_1789907893_4d762/: manifest.json (run_id, runtime_git_sha, benchmarks_git_sha, hardware), SHA256SUMS (unsigned checksum list). scripts/verify_manifest.py (Python) checks token hashes and weight file hashes. +- data/benchmarks_20260919.json and benchmarks_latest.json are snapshots; no history or trend tooling. +- prime-drag-race (standalone, 1683 lines): receipt schema `aien-prime-race/receipt/v1` (src/lib.rs:15); receipt stored as `.json`, mode 0444, no overwrite (receipt.rs:20-40); content-addressed blobs for stdout, stderr, report, bitmap (runner.rs:95-102); receipt carries runner commit + binary sha256, hardware, quiet-flag, governors, loadavg, per-trial records (runner.rs:209-235). No signature. Independent Miller-Rabin reference (CONTRACT.md:14-21); `verify` subcommand main.rs:89. +- Negative tests (tests/negative.rs, 327 lines): wrong_bit :109, missing_prime :118, extra_composite :127, tail_garbage :136, truncated_bitmap :145, all_zero_and_all_ones :153, audit stale :179, exit_code_2 :188, no_stdout_line :195, two_lines :202, malformed_line :210, passes_zero :217, elapsed_below_min :225, line_report_mismatch, label_mismatch, failed_status_rejected, run_failure_keeps_evidence, audit_rejects_stdout_line. These attack the benchmarked program's output. I found no test that edits a stored receipt and expects rejection (confidence medium; verify_subcommand test body only partly read). +- No `.crumb` in benchmarks root. + +## 5. Dependency pinning graph + +- aien-protocols: only intra-workspace path deps (crates/*/Cargo.toml); no other aien-dev repo. CONSUMERS.md:3-4 says consumers pin "v0.1.0" by path (no rev). +- interplane: adapters/aien/Cargo.toml:26-27 git dep aien-capability + aien-mcp at aien-sovereign-core rev 9b5e6e82359f4ad6b6f03042e83ef6411c5f15ce; :32 optional path dep `aegis` -> ../../../interplane-audit/aegis-runtime. adapters/aien/PINS: aegis-runtime f4e870953a46, aien-protocols 3a4cdbe8d360 (not current 407487b7e163), sovereign-core 9b5e6e82. provenance/Cargo.toml: path deps inside interplane only. No direct dependency on aien-evaluation-protocol (transitive via aegis-runtime UNVERIFIED). +- spark-inquisitor: unpinned path deps on ../aien-protocols/crates/{protocol-types, evaluation-protocol, probe}. +- benchmarks: unpinned path deps on ../canonical-branch-native-runtime/crates/* (repo not in workspace). +- Workspace heads are in adaptive/PINS.txt; how far interplane's 3a4cdbe pin lags aien-protocols main is UNVERIFIED. + +## 6. Existing negative tests (bad artifact in, rejection expected) + +Modified receipt / signature: +- interplane/provenance/tests/evaluation.rs: substituted_scores_break_the_signature :232; wrong_keys_are_refused :276; version_1_receipts_are_insufficient :212; malformed_and_unsupported_receipts_are_refused :410; spark_rsi_receipt_with_any_field_changed_fails :586; a_genuine_receipt_for_other_bytes_is_a_substituted_change :301; a_receipt_judged_from_another_commit_is_refused :438. +- aien-protocols evaluator_protocol_tests.rs: plan digest tamper :84; frozen-invariant tamper :94; key-identity mismatch inside :109. +Altered policy file: +- interplane evaluation.rs: altered_policies_are_refused :327; holdout_set_other_than_pinned :361; the_operator_can_pin_the_policy :448; protected-path subject :465. aien-protocols policy_digest frozen-invariant :94. +Missing record: +- interplane real_chain.rs a_missing_generation_record_is_an_absent_claim_not_a_pass :223; model_turn_link.rs a_missing_model_turn :178; effect_binding.rs ledger_record_removed_from_the_manifest :285; fix_the_test.rs dropped_test_run_section/record :170,:179; aien-protocols missing required evaluator :184. +Reordered events: +- effect_binding.rs records_out_of_ledger_order :274; model_turn_link.rs times_out_of_order_or_after_the_request :141; real_chain.rs a_generation_record_must_precede_the_effect :260. TRN1 corpus covers GAP/CHAIN/DIGEST/TRUNCATED refusals (vectors/expected.txt:3-5); mutate-verifier.sh proves each verifier check is exercised. +Altered records of each type: real_chain.rs :364, :382, :399; effect_binding.rs altered_claim/committed/grant/intent/ack :192-244; altered_record_without_restamp :263. +Substitution: effect_binding.rs ledger_for_another_request :101, ledger_from_another_trace :114, other daemon process/executable/socket :140-168. +Other: adapters/aien/tests/compose_ledger_attacks.rs (individual tests not enumerated, UNVERIFIED); conformance negative controls V1-V8; specs/verified-crumb/golden r01-r08. + +## 7. Gaps + +1. No receipt binds candidate digest + world + generation + execution id + transcript digest together. aien-evaluation-protocol binds subject_digest and evaluation_id only; TRN1 binds run_id and capability generations but is unsigned and has no candidate digest; rsi-eval/2 binds candidate_id and subject_sha256 but no transcript. +2. No adapter exists between aien-evaluation-protocol and rsi-eval/2, or between benchmark receipts and either. +3. interplane adapter exports are unsigned and forgeable by a same-user process (BINDING.md:195; provenance_export.rs:17). +4. aien-evaluation-protocol verify ignores the stored tier and fingerprint fields (lib.rs:591-601). +5. benchmarks main harness cannot build standalone; no history store. diff --git a/docs/plans/adaptive-intelligence/inventory/omega-runtime.md b/docs/plans/adaptive-intelligence/inventory/omega-runtime.md new file mode 100644 index 0000000..f736049 --- /dev/null +++ b/docs/plans/adaptive-intelligence/inventory/omega-runtime.md @@ -0,0 +1,29 @@ +# Inventory: omega runtime cognitive loop (Milestone 0/1, read by the orchestrator) +Repo: aien-dev/omega main @ 16e729b6d844 (fresh clone 2026-10-11). Build pins: aienos.lock b84c0a67590a9 (native authority), argus.lock b375dcaa2887d (ARGUS observer). Sibling deps: ../physics (headers), ../aienos-argus, AIENOS_LOCK_REPO. + +| Capability | Status | Source | +|---|---|---| +| Resident AIEN faculty: observe/predict/explain/assess/plan as World reactions | Implemented and integrated | src/runtime/rx_aien.h:1-30, enums :60-85 (PRED_FAILED, HYP_CORE_CLASS/DRIFT, ACT_RESEARCH, EXP_SUPPORTED/REFUTED) | +| Failed prediction -> hypothesis -> bounded experiment plan; memory of explored conditions (no re-plan) | Implemented and integrated | rx_aien.h "memory: explored condition keys", RX_AIEN_MEMORY_SLOTS; tests/runtime/rx_r11_aien.c steps printed by the program | +| Living system: experiment on resident GPU seat under R5 admission/R7 authority, evidence, AIEN experiment belief, generation prepare/promote, in-force record read by production | Implemented and integrated | src/runtime/rx_living.h:1-30; tests/runtime/rx_r13_living.c phases POSITIVE, NO_AIEN, NO_PROMOTION, REVOKED_EXPERIMENT, STALE_GPU, FAILED_VERIFICATION (:48) | +| Restart recovery: generation.restore re-verifies the active generation at body start; R14 scenarios A-F | Implemented and integrated | rx_living.h rx_living_register_restore; tests/runtime/rx_r14_recovery.c:1-20 | +| Canonical Cortex store (append-only, typed, provenance, promote, verify chain) | Implemented and integrated | src/runtime/rx_cortex.h:1-29 (AUTHORITY M20), API :184-289 | +| World -> Cortex recorder (every crumb becomes a Cortex object with provenance links) | Implemented but DISCONNECTED from the living body | src/runtime/rx_cortex_record.h:1-20; only attached by src/runtime/rx_compose.c; no use in rx_living.c, rx_aien.c, rx_r11/r13/r14 tests | +| Cognitive state projection (typed need -> smallest Cortex state, protected evidence never summarized) | Implemented and integrated (compose path); not fed to the living AIEN | src/runtime/rx_projection.h:1-30; Makefile OMEGA_STATE_PROJECTION part B | +| Typed resource needs, 7 priority classes, physical budget, bounded fairness, emergency stop | Implemented and integrated | rx_world.h:48-60 (RX_PRIO_*), :249 RxResourceNeed, :251-269 RxResourceBudget, :735 rx_world_set_resources, :824 rx_world_emergency_stop | +| Adaptive policy that changes priority/budget from observed conditions | Missing | no caller of rx_world_set_resources from a reaction (grep) | +| Legacy stores cortex-rs / aienos-cortex | Superseded (retire, import only as CX_K_IMPORTED) | rx_cortex.h:13-29, CX_SRC_* :111 | + +## Executable path (shortest, already in main) +observation (Omega demand interval, external placement change) -> aien.observe belief -> aien.predict prediction -> miss streak -> PRED_FAILED -> aien.explain hypothesis (CORE_CLASS or DRIFT) -> aien.plan plan (ACT_RESEARCH, one per untried condition; memory blocks repeats) -> living.experiment.prepare -> living.blackwell.add (GPU seat, authority-gated) -> living.experiment.evidence -> aien experiment belief (SUPPORTED/REFUTED) -> generation.prepare candidate -> generation.promote (separate subject, native authority) -> in-force record -> production serves the new realization (changed subsequent decision). Control arms prove each link is causal (no AIEN, no promotion, revoked grant, stale GPU, failed verification). + +## Baseline (fresh clone, host) +- R11 `make AIENOS_LOCK_REPO= test-r11`: checks 436 failures 0; living run exercised (A725 -> X925, new record 1.63x faster; control without AIEN stays on the old record). Receipt: baseline/20261011T142516Z-16e729b6d844/R11/rx_aien_faculty_receipt.json, R11_CONTINUOUS_COGNITION PASS. +- R13 host, R14 host: see baseline/ (filled when the runs finish). + +## What survives a restart today +Durable: the R9 generation store (in-force record, candidate bytes, config, evidence, durable provenance links RxLivingProvenance) and the aienos authority table. Ephemeral: every AIEN world object (belief, prediction, hypothesis, plan, assessment, memory of explored conditions). So after a restart the body serves the promoted realization but AIEN has forgotten why, and would re-explore an already explored condition. That is the Milestone 2 gap. +- R13 host run1 (14:26Z, load 5.7, scouts+compile running): R13_LIVING_SYSTEM=FAIL, phase E "AIEN never confirmed the incumbent cost" (the header's documented wall-clock sensitivity); positive + controls A-D passed. Receipt baseline/20261011T142633Z-16e729b6d844/R13. +- R13 host run2 (14:27Z, alone): R13_LIVING_SYSTEM=HOST_PASS_NON_SILICON, generation 1->2, 16 GPU claims (stand-in), 11 durable links. Receipt baseline/20261011T142755Z-16e729b6d844/R13. +- R14 host: R14_LIVING_RECOVERY=HOST_PASS_NON_SILICON, A-F PASS. Receipt baseline/20261011T142649Z-16e729b6d844/R14. +- Silicon gates (test-r13-silicon, test-r14-silicon) need the GB10 seat: not run in this session (chip window, Drake go). diff --git a/docs/plans/adaptive-intelligence/inventory/physics-learning.md b/docs/plans/adaptive-intelligence/inventory/physics-learning.md new file mode 100644 index 0000000..0748dc8 --- /dev/null +++ b/docs/plans/adaptive-intelligence/inventory/physics-learning.md @@ -0,0 +1,99 @@ +# Physics-0 learning machinery and sealed controls: Milestone 0 inventory + +Scout, read-only. Pins: omega 16e729b (only src/physics0, tests/physics0, docs/physics0, mk/physics0*.mk, evidence/physics0 read), physics 8b23e5a, aien-sealed 3a6659dc. Nothing was built or run; `make -n` only. Paths are relative to the repo named; `O:` omega, `P:` physics, `S:` aien-sealed/brownian. + +## Classification table + +| Capability | Class | Anchor | +|---|---|---| +| Black-box world, bounded interventions, budgets, hash-chained records | Implemented and integrated | O:src/physics0/pd0_world.c:42-102 | +| Generator isolation from learner (symbol check) | Implemented and integrated | O:tests/physics0/isolation.sh:12-15 | +| One-step sparse polynomial learner (numerical + symbolic, MDL) | Implemented and integrated | O:src/physics0/learner/pd0_learner.c:21-30,126-180 | +| Independent ladder checker (T1..T7), scorer, negative controls | Implemented and integrated | O:src/physics0/ladder, score, controls; mk/physics0-verify.mk:7 | +| Experiment planner (active vs passive) | Implemented, partly integrated (learner has a stand-in; real planner is bridged in tests only) | O:src/physics0/planner/pd0_planner.h:1-8; learner.h:57-61; mk/physics0-planner.mk:5 | +| Held-out score with 1.5x extrapolation box | Implemented and integrated | P:docs/PD0_HIDDEN_EQUATION_BENCHMARK.md:206-210; O:src/physics0/score/pd0_score.c:44-67 | +| PD-0b sealed run (external world, final/audit protocol v2) | Implemented and integrated; seal-1 result FAIL | O:docs/physics0/PD0_PROTOCOL_V2.md; P:evidence/PD0B/PD0B_VERDICT-seal1.json:6 | +| Latent (hidden) state recovery | Missing in learner (flag only, unreliable) | O:docs/physics0/LEARNER.md:133-137 | +| Multi-step consistency in candidate ranking | Missing | O:docs/physics0/LEARNER.md:135-136 | +| Hidden-state suspicion flag | Experimental | O:src/physics0/learner/pd0_learner.c:180 | +| PD-1 machine-record view (unchanged learner on real machine logs) | Experimental, development evidence only | O:mk/physics0-pd1.mk:1-3 | +| Brownian sealed lifecycle (freeze, one-attempt ledger, sealed parent, leak oracle) | Implemented and integrated (private repo, separate domain) | S:src/brw_protocol.h:94-170 | +| EXP-003-CERT w2.v1 | Frozen on paper (receipt R3-66); no qfreeze or sealed world exists; waits for Drake | S:wave2/W2V1_FREEZE_RECEIPT.md:3,5,57 | +| Changed dynamics between episodes (drift, regime switch, version bump) | Missing | see section 6 | +| Fixed-vs-updating learner comparison | Missing | see section 7 | + +## 1. Components of omega/src/physics0 + +- `pd0_gen.[ch]`: the only place the hidden equations live; levels L0..L6 plus NULL (`pd0_gen.h:1-5`, enum `:15`). Constants drawn once per seed from declared ranges (`pd0_gen.c:20-35`); L6 has one hidden variable h (`pd0_gen.h:28`), equations at P:docs/PD0_HIDDEN_EQUATION_BENCHMARK.md:142-144 (`s0'=s0+s1*dt; s1'=s1+(-k*s0+m*h+u)*dt; h'=h+(-w*h+q*s0)*dt`), h = 0 at every reset (`:141`, `pd0_world.c:60`). +- `pd0_world.[ch]`: describe/reset/step, budgets (3000 steps, 300 episodes; 8000 steps for L5/L6 per spec `:111-112`), out-of-bounds ends the episode with nothing revealed (`pd0_world.c:91-96`), episode ends at `episode_max_steps` (`:100`). Runs as its own process over framed pipes (`pd0_world.h:6-9,57-58`; `pd0_world_main.c`). +- `pd0_wire.[ch]`: describe record (PD0DESC2, per-variable reset box), PD0REC1 records with SHA-256 chain. `pd0_rng.[ch]`: SplitMix64 named streams. `pd0_relation.[ch]`: PDLAW1 relations in delta form, degree <= 3, up to 2 latent variables (`pd0_relation.h:16-20`), rollout, NRMSE, law encode/decode (`:41-62,64-107`). `pd0_chan.c`: learner-side handle; the learner never holds a world (`pd0_world.h:6-9`). +- `pd0_guard.[ch]`: STAND_IN range check. A step is ok only if channel is none or `chan_min <= value <= chan_max`; a reset only if every value is inside its per-variable reset box (`pd0_guard.c:3-13`). A refusal is a recorded outcome that still costs the step or episode (`pd0_guard.h:1-6`; `pd0_world.c:53-58,80-84`). Post-step values beyond +-PD0_BOUND (10.0 units, PD0_PROTOCOL_V2.md:50) are caught by `pd0_guard_in_box` (`pd0_guard.h:21`). +- `learner/`: see below. `ladder/`: independent checker that replays the evidence ledger and derives the state itself (`pd0_ladder.h:1-2`), thresholds `min_t1_records 100, min_prereg 5, min_batches 3, min_batch_episodes 10, rollout_steps 20` (`pd0_ladder.c:29`); void rule for out-of-bounds trial episodes (`:265-269`); T6 trial failure -> refutation (`:331`), T7 batch failure (`:355`). `ladder/pd0_fmt.[ch]` holds byte layouts shared with learner (no generator). `score/`: scorer holds truth, never linked to a learner (`pd0_score.h:1`); checks degree, size, bits, support, constants, in-box/extrap/one-step NRMSE, and for L6 a latent requirement plus "latent-free reference must fail by factor" (`pd0_score.c:44-67`). `controls/`: negative controls NC-1.. (`pd0_controls.h:1`), receipts (`pd0_receipt.c`). `planner/`: proposes PD0EXP1 preregistrations only, no execution path (`pd0_planner.h:1-8`). + +**Learner model class (numerical AND symbolic).** One-step change of each observed variable is regressed on every monomial of total degree <= 3 over observed variables and channels (`pd0_learner.c:21-30`; `LEARNER.md:39-46`). Forward selection with backward pruning, up to 10 terms per equation (`pd0_learner.h:17`; `pd0_learner.c:126-155`), scored by MDL = n*log2(rmse_micro) + 8*(n_vars+n_channels)+24 bits per term (`pd0_learner.c:122-124`). Up to 8 candidates incl. an explicit null and runner-up rivals, re-ranked on SELECT (`pd0_learner.h:16`; `LEARNER.md:53-58`). Floats only inside fitting; all emitted numbers are micro-unit integers evaluated by the checker's integer stepper (`pd0_learner.h:7-9`; `LEARNER.md:44-46`). No latent variables are ever fitted (`LEARNER.md:133-136`). + +**How generator truth is kept from the learner.** (a) The learner accepts only FIT and SELECT tagged records and refuses everything else (`pd0_learner.c:44`, I10); HOLDOUT/TRIAL/REP never reach it (`pd0_harness.c:193-197`; `pd0_learner.h:5-6`). (b) `isolation.sh` greps learner objects for any `pd0_gen_`, `pd0_world_`, `fopen/open*` symbol (`isolation.sh:12-15`), wired into `test-physics0-learner` via `p0l-isolation` (`mk/physics0-learner.mk:37-38,62`). (c) Learner and checker link only verifier byte formats; world and truth run as separate processes (`LEARNER.md:30-35`). (d) PD-0b protocol v2: shape terms and score are refused until `final` is accepted once; play ops refused after final; all refusals counted (`PD0_PROTOCOL_V2.md:35-40,59-64,94-96`). + +**How interventions are bounded.** Describe record gives `chan_min/chan_max`, reset box, `episode_max_steps`, step and episode budgets (`pd0_learner.h:20-26`); guard enforces them (above); exploration and the stand-in planner only draw inside the bounds (`pd0_learner.c:55-61`; `pd0_learner.h:57-60`); a planner request outside bounds is a gate failure (spec `:307`). + +**Separate experimental evaluation path.** Ladder: falsifier declared and hashed before TRIAL data (spec T4 `:177`), >=5 preregistered planner schedules not in FIT/SELECT/HOLDOUT (T5 `:178`), trials within eps (T6 `:179`), >=3 fresh REP batches of >=10 episodes, half planner, half random (T7 `:180`). Scorer runs 20 noise-free truth episodes (10 in-box, 10 at 1.5x) via protocol op 3 after final (`LEARNER.md:76-77`; `PD0_PROTOCOL_V2.md:42-57`). Exploration split per five episodes: FIT FIT FIT SELECT HOLDOUT (`pd0_harness.c:193-197`). + +## 2. Documented limitations (quotes) + +- Latent state: "Not implemented: Latent-variable fitting, local refinement in the planner (Direction 5), multi-step consistency in candidate ranking, PD0DESC2 parsing beyond the assumed per-variable layout." (O:docs/physics0/LEARNER.md:133-137) +- "L6 (hidden variable). Candidates are latent-free fits; ... the trials or batches exceed eps, which is the honest outcome for a wrong model class. `hidden_state_suspected` did not fire on L6 because the latent-free fit's one-step residuals are small (0.001 to 0.005); the flag needs a rollout-based test, left for the next cut." (LEARNER.md:103-109) +- Dev table: "L6 | CANDIDATE 5/5 (3 refutations each) | FAIL 5/5 (307 latent missing, 308 reference too good) ... reported, not claimed: no latent mechanism" (LEARNER.md:93) +- Flag definition: fires if any |lag-1 residual autocorrelation| > 0.3 AND fit one-step NRMSE > 5000 micro (`pd0_learner.c:180`). The recorded dev run `evidence/physics0/learner/pd0-learner-dev-b1ae4f609128.txt` shows `hidden_state=1` on L6 seeds 2-5, contradicting LEARNER.md:106-108. UNVERIFIED which commit each describes (confidence 60 percent the doc is older than that receipt). +- L6 pass rule open: "the factor-3 reference margin is still open with Drake; the learner reports L6 and claims nothing." (LEARNER.md:120-121). Spec: factor-3 margin met on 3 of 5 calibration seeds only; "until then L6 cannot pass" (P:docs/PD0_HIDDEN_EQUATION_BENCHMARK.md:240,370). +- Noisy-level reset binding gap (LEARNER.md:122-126; `pd0_ladder.c:138`). Batch top-up not implemented (LEARNER.md:110-112). +- Multi-step is used only by the checker (20-step rollouts for T6/T7, `pd0_ladder.c:29,309,350`); the learner ranks by one-step residual bits plus description bits (`pd0_learner.c:172-179`), so a one-step-good, rollout-bad model is not penalised at ranking time (inference from those lines; confidence 85 percent). +- Spec header is stale: line 3 still says "No code exists yet" (P:docs/PD0_HIDDEN_EQUATION_BENCHMARK.md:3) though the code and receipts exist. +- No hits in src/tests for TODO/KNOWN; "FAIL" hits are test harness strings. + +## 3. Tests (omega) + +Build/run lives in `mk/physics0*.mk`, included by `Makefile:5`, output in `build/` (`Makefile:4`). No run times are stated anywhere I found (UNVERIFIED; none measured). + +| Target | Programs | Proves | Deterministic | +|---|---|---|---| +| `make test-physics0-learner` (`mk/physics0-learner.mk:62-67`) | isolation check; `tests/physics0/learner/test_pd0_learner.c` (plain + ASan/UBSan); `test_pd0_protocol_v2.c`; `test_pd0b_run.sh` | learner determinism (byte-identical reports and PDLAW1 round trip, `test_pd0_learner.c:43-50`), cubic world not fit by null and size <= 6 (`:52`), held-out theory error < 0.02 (`:59`), protocol v2 ops and refusal states | seeded streams; yes | +| `make physics0-test` (`mk/physics0.mk:76-92`) | `test_pd0_world.c` (G0, plain + ASan), isolation, `pd0_oracle.c` (V1 oracle all levels, V3 breach rates, mutants), `test_pd0_osc.c` | substrate rules, spec 2.3, oracle recovers every level incl. L6 latent, mutant sign flip is caught, Omega-language differential | seeded; yes. V3 may print FAIL without failing the target (`physics0.mk` comment, README:29) | +| `make test-physics0-verify` (`mk/physics0-verify.mk:7,31`) | `verify/test_pd0_fmt.c`, `test_pd0_ladder.c`, `test_pd0_score.c`, purity | verifier formats, ladder rules, scorer plus negative controls; per PD-0b verdict: 25 + 148 + 103 checks (P:evidence/PD0B/PD0B_VERDICT-seal1.json:14) | yes | +| `make test-physics0-planner` (`mk/physics0-planner.mk:65`) | `planner/test_pd0_planner.c`, `pd0_plan_eff.c`, `pd0_plan_eff2.c` | planner contract behaviours 1-6, purity, active vs passive information efficiency (dev evidence) | seeds 1..5 | +| `make physics0-learner-dev` (`physics0-learner.mk:70-74`) | `pd0_harness.c` + `pd0_truth_main.c` + world | full ladder run per level L0..L6 + null, seeds 1..5; writes `results.txt` | yes | +| `make physics0-pd0b-run PD0_WORLD_BIN=.. PD0B_SEEDS=..` (`:83-90`) | `pd0b_run.sh`, harness | frozen learner vs external world, new receipt each run, refuses dirty tree | yes | +| `make physics0-pd1-run RECORDS=..` (`mk/physics0-pd1.mk:5`) | `pd1/pd1_run.c` | unchanged learner on machine records, development only | seeded | + +Exact baseline command (verified present with `make -n`, not executed): from `/home/drakestapleton/workspace/adaptive/omega`: `make test-physics0-learner && make physics0-test && make test-physics0-verify`. For learning-quality numbers: `make physics0-learner-dev` (prints one PD0L line per level and seed). + +Baseline results on record (evidence/physics0/learner/pd0-learner-dev-b1ae4f609128.txt; LEARNER.md:85-94): L0-L5 REPLICATED 5/5 with scorer PASS; L6 stops at CANDIDATE (code 251, 3 refutations) 5/5; null stays OBSERVATION. + +## 4. physics repo (8b23e5a) + +- Contracts: `docs/PD0_HIDDEN_EQUATION_BENCHMARK.md` (372 lines). Level table `:104-112`. Acceptance (6.1): in-box NRMSE 0.02, extrapolation 0.06, one-step 0.01 for L0-L5; L6 0.03 / 0.08 / not scored (`:206-210`). L5 trial eps capped 0.05 (`:214`). Size bound |R| <= S*+2 (`:218`). Constants within 5 percent (L0-L4), 10 percent (L5), L6 coefficients unscored but latent required and latent-free reference must fail by factor 3 (`:236-238`). Ladder T1..T7 `:158-183`. Planner contract `:294-307`. Negative controls NC and M1-M5, positive control V1 `:313-332`. All thresholds labelled provisional/UNVERIFIED (`:3,372`). +- `docs/PD0B_SEALED_BENCHMARK.md` (63 lines): sealed families, commit then freeze then run then reveal (`:37-49`), author separation (`:26-35`), only allowed claim on PASS (`:55`). Inherits every threshold, adds none (`:14`). +- `docs/PHYSICS0_DISCOVERY_ENGINE.md` (107 lines, overview; not read in detail). Also `docs/PD1_MACHINE_LAW_BENCHMARK.md` exists (not read). +- Executable components in physics repo for PD-0: none found (`find -ipath '*pd0*'` shows only docs and evidence/PD0B); code lives in omega. +- PD-0b seal-1 evidence: `physics/evidence/PD0B/PD0B_VERDICT-seal1.json`. Verdict FAIL (`:6`); first failing: level index 6 failed 0 of 5 (`:7`); levels 0-5 each 5/5 REPLICATED, PROVISIONAL_LAW, scorer PASS (`:9,23-28`); level 6 `law_record_states: REFUTED x2, HYPOTHESIS x3`, scorer code 307 (`:29`); learner commit f9a1797, harness 965edfb (`:18`); open items: factor-3 margin, "the learner has no latent-variable mechanism", second seal needed (`:34-37`). Supporting: `PD0B_COMMIT-seal1{,b,c}.json`, `PD0B_FREEZE-seal1.json` (freeze 01:26:04Z before run 01:57:28Z, verdict `:12`), `PD0B_VALIDITY`, `PD0B_REVEAL` (43 of 43 hashes match, verdict `:11`), omega run receipts `evidence/physics0/pd0b/PD0B_RUN-965edfbf35e9-58c1fac11f47.txt` and `...d3a4063dc1a3...` (with laws). Memory claim confirmed. Note: ladder stop reasons were INTERVENED x3 (T7 batch too small, code 261) and CANDIDATE x2 (T6 failed, 251) (verdict `:7`). + +## 5. aien-sealed/brownian (3a6659dc): sealed evaluation protocol + +Domain note: Brownian is a different task (choosing observations/policies and predicting held-out points of diffusion, drift and mean-reverting processes, 3 families D0/D1/D2, `S:src/brw_world.h:11`), not Physics-0 dynamics. Reusable as a protocol, not as a learner. + +- Lifecycle (`S:src/brw_protocol.h:1-18`): dev worlds (step 2, `:94-100`), freeze (step 5, `:102-119`: artifact digest, qprofile, devman, calibration digest into qfreeze), seal (steps 6-7, `:121-133`: refusals for no qfreeze, artifact digest mismatch, qprofile mismatch, hostile cell, dirty tree; "one-sealed-attempt ledger (O_EXCL)", second attempt is STOPPED, `:17-18,131`), gain/score (steps 8-9, `:136-176`). Files are digest-named, write-once, mode 0444 (`:9-10`; `brw_write_excl` `:54`). +- Holdout separation: held-out points per world H (`brw_cellinfo`, `:62`); scoring is fit-once on the prefix (`brw_predict.h:2-3`); PRD1 bytes are the only scoring path (`brw_protocol.h:136`). Leak oracle regenerates true parameters from the sealed seed and fails the run if the oracle beats the candidate (`:152-160`). Hostile cells are development only, never sealed (`:64-65`). +- Candidates cannot touch holdout: certification candidates are reference opcodes; discovery candidates run in a bwrap sandbox with a frozen argv and line protocol (`:162-171`); packet scanner and seed scan refuse leaked seeds (`:173-178`); sealed parent derives from the qfreeze digest (`brw_sealed_parent`, `brw_protocol.c:994,1253`; W2V1_FREEZE_RECEIPT.md:57). EXP-003 contract: posterior mixture weights fixed at stop, "no learning from held-out points" (S:wave2/EXP-003-CONTRACT-DRAFT.md:136); DISC references rerun on fresh worlds (`:137`). +- Replication separation: `w2_cert verify` recomputes everything from stored files, `replay` regenerates from scratch and compares (`S:src/w2_cert.c:3-6`); `dryrun` mode has the development parent and no path to the sealed parent (`:8-11`); fault hooks active only in dryrun (`:13-15`); dev worlds never reused (receipt `:57`). +- EXP-003-CERT w2.v1 freeze state: FROZEN by decision R3-66, 2026-10-10 (`R2_INTEGRATOR_DECISIONS.md:517`; receipt `W2V1_FREEZE_RECEIPT.md:3`). Frozen set hashes at receipt `:13-21` (profile 54418df9..., thresholds 30e66c77..., evaluator tree content 7f4d6712..., omega scorer pin 2564f57, N7 receipt cdca1cec...). Receipt says "no qfreeze, no sealed parent, no seed and no world value; none exists yet" (`:5`); gates G1-G13 table `:53-67` (G1 omega digest PR was an OPEN ITEM at record time, `:55`; fault injection 341 boundaries, 0 reached PASS, `:61`). Contract file itself still carries a DRAFT header (`wave2/EXP-003-CONTRACT-DRAFT.md:3`; receipt `:23` says acceptance is R3-62/R3-63). Sealed run waits for Drake per memory (not verifiable from these files). Cap: profile 1 of 3 (`:49`). + +## 6. Changed dynamics between episodes + +**Missing.** Evidence: constants are drawn once at `pd0_gen_init` per seed (`pd0_gen.h:42-45`, `pd0_world.c:11-18`); the world holds one `gen` for its whole life (`pd0_world.h:34-35`); `grep -iE "drift|regime|non-stationar|version bump|between episodes"` over src/physics0, tests/physics0, docs/physics0 returns only an episode-numbering check (`pd0_harness.c:91`). Hits in physics repo are hardware sensor drift (forge) and in Brownian a DIFFUSION_DRIFT statistical model (mean drift of a random walk, `S:src/brw_predict.h:15`), neither is environment change between episodes. Adjacent hooks that make adding it small: single-process world with explicit `pd0_world_reset` (`pd0_world.c:46-70`), protocol v2 `final/audit` counters, `pd0_gen_init(level, seed)` (a regime switch could re-init constants mid-run, but nothing does). The Brownian "B2-emerging" label (`brw_stats.c:420`) concerns a within-trajectory property; UNVERIFIED whether it is a regime change (not read, confidence 40 percent it is not). + +## 7. Fixed-vs-updating learner comparison + +**Missing.** Closest pieces: (a) the learner refits after a refutation, moving TRIAL records into FIT, up to three attempts (`pd0_harness.c:199,230`; `LEARNER.md:74-75`), which is a within-run update but never compared with a frozen counterpart; (b) planner efficiency compares active vs passive schedules, not fixed vs updating models (`tests/physics0/planner/pd0_plan_eff.c:1-12`); (c) PD-0b freezes the learner by commit (`PD0B_SEALED_BENCHMARK.md:39`). No test has a fixed relation scored on later dynamics against a refit one. + +## Smallest defensible improvement candidate (partially observed prediction) + +Add a rollout-based residual check to candidate ranking and the hidden-state flag: score each candidate by 20-step rollout NRMSE on SELECT episodes (reuse `pd0_learner_rollout` `learner.h:65`, which already exists and carries latent from 0) and use it in `cand_cmp` / the `hidden_state_suspected` rule at `pd0_learner.c:180`. Motivating quote: "the flag needs a rollout-based test, left for the next cut" (LEARNER.md:108-109) and "Not implemented: ... multi-step consistency in candidate ranking" (LEARNER.md:135-136). Acceptance: public L6 seeds 1-5 flag fires on 5/5 and L0-L5 and null do not; frozen PD0B trees (learner, ladder, score, controls) would change, so it must be a new learner version, not a seal-1 amendment (`PD0B_FREEZE-seal1.json`). diff --git a/docs/plans/adaptive-intelligence/inventory/spark-rsi.md b/docs/plans/adaptive-intelligence/inventory/spark-rsi.md new file mode 100644 index 0000000..502ecc7 --- /dev/null +++ b/docs/plans/adaptive-intelligence/inventory/spark-rsi.md @@ -0,0 +1,108 @@ +# spark-rsi inventory (Milestone 0, read-only scout) + +Repo: /home/drakestapleton/workspace/adaptive/spark-rsi, commit 24f412f (PINS.txt confirms main). Nothing edited; no build/test run (reading only). +Note: every `.crumb` in this repo has empty `"role": ""` fields (src/.crumb, tests/.crumb), so the Crumb gave no role/invariant text. Evidence is source only. + +## Classification + +| Capability | Class | Key evidence | +|---|---|---| +| Daemon cycle (ledger, holdouts, signer, propose, jail build, judge, supervisor, ratify) | Implemented and integrated | src/daemon.rs:26-612 | +| Observation of the target repo | Experimental (weak) | src/observe.rs:168-186 (keyword scan + `cargo check`) | +| Capability graph / bottleneck ranking | Implemented but disconnected from real measurement | graph/mod.rs:171-210; daemon.rs:66-99 literals | +| Hypothesis contract | Implemented and integrated, fed by fake numbers | daemon.rs:112-130 | +| Isolated evaluation (BlindJudge, bwrap, holdouts) | Implemented and integrated | daemon.rs:359-383; actor/judge.rs | +| Signed promotion (receipt v2, exact-artifact binding) | Implemented and integrated | evaluator/mod.rs:58-257; promotion_gate.rs; daemon.rs:525-556 | +| Production canary observation admission | Implemented, integrated, but never fed (fail-closed) | canary_observation.rs; daemon.rs:445-449 | +| Measured execution feed (real canary traffic) | Missing | daemon.rs:437-439; no non-test sender of CanaryReport | +| Supervisor (in-repo) | Implemented but disconnected from the observation path | src/supervisor/*; daemon.rs:417-435 | +| Cortex client | Implemented and integrated, HTTP only | propose/cortex.rs:77-110 | +| Cortex store coupling (cortex-rs vs omega CxStore) | cortex-rs HTTP API; omega absent | see sec 4 | +| DUAL scarcity reader | Implemented but disconnected by design (diagnostic only) | daemon.rs:103-109 | +| Meta/tier governance, A/B fork | Experimental | src/meta/*; daemon.rs:210-270 | +| Soak runner | Experimental, duplicates daemon graph literals | soak/runner.rs:158-191 | + +## 1. src/daemon.rs main loop +- `RsiEngine::run_cycle` (daemon.rs:26) is one cycle, not a long-running loop. A loop is outside (main.rs:645 logs cycle errors; UNVERIFIED how main.rs repeats, not read in detail, confidence 60%). +- Order: open ledger (:33), require holdouts dir (:41-52), require P-256 signing key (:55-61), observe (:64), build graph (:65-99), top bottleneck (:101), hypothesis (:112-130), Cortex recall (:132-139), proposals from MAX model + unslop scan (:142-182), per-candidate loop (:195-410): declared-target gate (:198), tier/operator check (:211-270), stage in sandbox (:272), bwrap `cargo build --release --offline` (:290-325), invariants (:327+), BlindJudge (:359-383), ledger append (:386), break on first admitted (:409). +- Observations enter in ONE place: `observe_codebase(repo_path)` (daemon.rs:64). It returns a TelemetrySnapshot of git state, crumbs, `cargo check` result and a keyword "soul tension" score (observe.rs:168-186; keyword lists observe.rs:6-58). It contains no latency, memory or throughput of the target. +- Production canary empty array, quoted (daemon.rs:437-449): + ``` + // Production promotion counts measured observations only. + // This cycle has no execution feed, so the quota fails closed. + // A caller-supplied success and a fixed latency are not observations. + ... + let quota = crate::canary_observation::admit_production_quota( + &[], + &candidate_digest, + config.canary_target, + ); + ``` + Default `canary_target` is 5000 (models.rs:171, :152), so `&[]` always errors "received 0" (canary_observation.rs:94-98). Failure path: rollback + ledger rollback + Cortex lesson (daemon.rs:451-465). The `else` promotion branch (:466+) is therefore unreachable in the production daemon today. +- Test confirms: tests/test_no_synthetic_trust_inputs.rs:~300-329 asserts the cycle "must not promote on a synthetic canary quota" and active symlink absent. + +## 2. src/canary_observation.rs +- Struct (lines 17-25): `observation_id: String`, `observed_at_ms: u64`, `candidate_digest: String`, `latency_us: u64`, `status: String`, `provenance: Measured|Synthetic` (enum :11-15). +- Identity/digest: `canonical_bytes` (:34-49) alphabetical-key JSON; `digest_hex` SHA-256 (:51-53). Timestamp field exists but is not validated (no freshness/monotonic check in :56-101; UNVERIFIED beyond this file, confidence 85%). +- Dedupe/replay: BTreeMap by observation_id; identical record counted once, different record under same id errors (:64,82-91). Candidate digest must equal (:73). Synthetic rejected (:76-80). Empty id/status rejected (:67-72). +- No source field naming who measured it (no signer, no worker/process identity, no signature). `Measured` is a self-declared label: any caller can set it. Biggest design gap for M5. +- Only caller: daemon.rs:445 (plus a path-listing in tests/test_dual_price_reader.rs:821). Unit tests at :116-166. + +## 3. src/evaluator/ and the judge +- evaluator/mod.rs: `EvaluationReceipt` (:32-56) with `receipt_digest`, `signature`, version, optional `ReceiptBindingV2` (:58-73): subject path + SHA-256 of exact bytes (:63), `holdout_set_sha256` (:66), holdouts total/passed (:67-68), policy SHA-256 (:69). +- "Exact-artifact": a v2 receipt signs the SHA-256 of the exact bytes of one subject file in the candidate tree, the holdout set digest, and the policy digest (evaluator/mod.rs:58-70, :143-170). `verify_for_promotion` (:221-257) refuses v1, wrong key, wrong policy/holdouts, mismatched identity. daemon.rs:525-533 passes `content_sha256 = candidate_digest` and re-reads disk digest of the generation right before swap (:536-545). Docs: docs/RECEIPT-V2.md. +- Holdouts: `HoldoutSuite::load_strict` (actor/judge.rs:236-310) fails closed on missing/corrupt/empty/duplicate-id/non-json entries; set digest domain `spark-rsi.holdout-set.v1` (:86). Cases run through bubblewrap `CandidateJailRunner` (:413-419). +- Layers: evaluator/layers/{correctness,performance,resource_efficiency,security,style,longitudinal_replay}.rs. Real measurement exists inside the judge: getrusage and /proc statm (evaluator/metrics.rs:37-38, :110-121) and paired parent/candidate benchmarks of child processes (judge.rs:914-950). This is lab measurement of a candidate binary, not production traffic. +- Signing: P-256 ECDSA over receipt digest (evaluator/mod.rs:259-286); signature string prefix "tpm2-p256:" but key is a software key from `signing_key_hex` (daemon.rs:55-61); also SoftwareP256Signer for the envelope (daemon.rs:469-471). TPM use UNVERIFIED (confidence 70% it is software only). +- Note the daemon passes parent label "parent" (daemon.rs:370) and uses `scan_and_propose_unslop` text edits plus a MAX-model patch to `src/lib.rs` (daemon.rs:146). + +## 4. src/propose/cortex.rs +- Not a store: an HTTP client (reqwest) to `{base_url}/api/cortex/search?q&space&limit` with bearer token (cortex.rs:77-90). Read-only recall; lessons are written in `Ratifier::record_cortex_lesson` (called daemon.rs:393, 458, 517; implementation in src/ratify.rs, not read in detail). +- Token: env CORTEX_TOKEN or `~/.config/cortex/token` (cortex.rs:56-75). Default URL http://127.0.0.1:18080 and space "atlas-memory" (models.rs:160-161; cortex.rs:40). AGENTS.md:47-49 names `cortex-rs` as the canonical memory at `/api/cortex/`. +- Verdict: legacy Rust cortex-rs HTTP API (service). It does NOT use omega's C CxStore. Cargo.toml has NO dependency on cortex-rs or omega (checked: grep for cortex-rs/CxStore/cx_store in Cargo.toml, src, docs, README, AGENTS.md gives only AGENTS.md:47). Space "atlas-memory" is the legacy area that AGENTS.md says not to use for new entries (root AGENTS.md); aien-lessons/aien-sources not referenced here. Failure of recall silently returns empty Vec (cortex.rs:108). +- Cargo.toml path deps: `../aien-protocols/crates/{aien-protocol-types,aien-evaluation-protocol,aien-probe}` (sibling dir exists in workspace), plus git deps spark-crumbs, crumb-spec. + +## 5. Hardcoded capability-graph measurements +Graph nodes are the RSI pipeline's own stages, not the target system being improved. +| Where | Literal values (p95 us, RSS KB, error rate) | Real source? | +|---|---|---| +| daemon.rs:66-69 Observe | 50.0, 1024, 0.0 | None | +| daemon.rs:71-77 Propose | 400.0, 4096, 0.25 if drive_score>0.8 else 0.0 | error_rate derived from keyword count (observe.rs:64), not an error measurement | +| daemon.rs:78-81 BuildJail | 150.0, 2048, 0.0 | None | +| daemon.rs:82-85 JudgeEvaluation | 250.0, 8192, 0.0 | None | +| daemon.rs:86-89 SupervisorCanary | 100.0, 4096, 0.0 | None | +| daemon.rs:90-93 CortexCommit | 50.0, 1024, 0.0 | None | +| daemon.rs:95-99 edges | 400/150/250/100/50 us, freq 1.0 | None | +| soak/runner.rs:158-191 | same set plus Graph 120/2048, edges 120 | None | +| daemon.rs:420,422,423 supervisor budgets | memory 49152 MB, max latency 1_000_000 us, error rate 0.0 | policy limits, not measurements | +| tests (graph/mod.rs:260-272; tests/test_explain_evidence_graph.rs:31-49; fixtures/rsi_kv_cycle.evidence.json) | fabricated kv/scheduler numbers | synthetic by design | +Consequence: the top bottleneck and the hypothesis target `latency_us` with `b.latency_p95_us` and a 15.0 delta (daemon.rs:124-126) come from these literals. "Propose" is always the hot node unless drive_score changes. No production source feeds CapabilityNode (the only setter is `with_resource_metrics`, graph/mod.rs:28; no reader of telemetry produces latency). Score weights 0.4/0.4/0.2 are literal (graph/mod.rs:185). + +## 6. Supervisor / executor feed +- In-repo supervisor: src/supervisor/{mod,daemon,ipc}.rs and bin `spark-rsi-supervisor` (src/bin/supervisor.rs, Cargo.toml). Host side receives `WorkerMessage::CanaryReport{generation_id, transaction_id, success, latency_us, error}` (ipc.rs:33; handled supervisor/daemon.rs:202-230) and does `record_canary_transaction` against `canary_target`, latency and error budgets. So the supervisor is a RECEIVER with a worker protocol. +- Senders: only tests and unit tests construct CanaryReport (daemon.rs:394,409,458,518; tests/test_host_supervisor_ipc.rs:81,94 with fixed latencies 1200, 1100). No production worker/executor process exists in this repo that sends reports (grep of `CanaryReport` in src shows only ipc.rs and supervisor/daemon.rs). +- Gap: the in-repo supervisor's own canary counter (supervisor/daemon.rs:202-230) is NOT connected to `admit_production_quota`; daemon.rs ignores it and passes `&[]` (:446). Two parallel canary notions: IPC counter vs CanaryObservation. +- spark-supervisor (archived on GitHub): no vendored copy and no dependency (Cargo.toml has none; `ls ..` shows no spark-supervisor dir; only `spark-inquisitor` sibling, role UNVERIFIED). The legitimate source would be a worker process embedded in the live inference/serving path (or the AIEN executor) reporting per-request latency/status over the supervisor socket, then converted to signed `CanaryObservation`s. Which crate that is: UNVERIFIED, no evidence in this repo (confidence 40% for "spark-inquisitor"). + +## 7. Tests +| File | Proves | Synthetic? | +|---|---|---| +| integration_tests.rs | balance kernel, soul tension, invariants, staging, fail-closed on missing holdouts/signer, end-to-end with candidate | Mixed | +| safety_envelope_tests.rs | wrong-key receipt never promotes | Synthetic keys | +| test_adversarial_containment.rs | holdout secrecy, net isolation, root-of-trust, forged receipt | Real jail | +| test_capability_graph_and_hypothesis.rs | graph topology on made-up numbers; live MAX tests | Synthetic graph; live MAX needs service | +| test_cryptographic_improvement_ledger.rs | hash chain, tamper detect, Merkle+ECDSA, daemon records provenance | Real ledger, synthetic cycle | +| test_dual_price_reader.rs | DUAL golden vectors, hostile inputs, "authority_paths" (diagnostic only) | Golden fixtures | +| test_explain_evidence_graph.rs | evidence graph, tampered receipt not a fact, matches tests/fixtures/rsi_kv_cycle.evidence.json | Synthetic kv graph | +| test_host_supervisor_ipc.rs | canary probation, rollback on defect/latency, unauthenticated worker rejected | Synthetic reports (fixed latencies) | +| test_max_inference_and_diagnosis.rs | MAX client, extraction, Cortex query | Needs live services | +| test_meta_improvement_governance.rs | tiers, operator signature, A/B fork | Synthetic | +| test_no_synthetic_trust_inputs.rs | jail blocks net, judge fails closed, paired benchmarks use real child-process metrics, daemon does NOT promote on synthetic canary | Real measurement for lab only | +| test_objective_evaluator.rs | rusage, latency stats, bootstrap, Fisher, six-layer | Real math | +| test_ratifier_branch_only.rs | ratifier writes review branch only, path/symlink/secret guards | Real git | +| test_receipt_v2.rs | v2 binding, promotion gate, holdout digest | Synthetic keys | +| test_soak_run.rs | quarantine after 3 failures, soak preflight | Synthetic | +- Separation by type: yes for canary evidence only: `ObservationProvenance::{Measured,Synthetic}` (canary_observation.rs:11-15) plus test `synthetic_rehearsal_cannot_fill_the_quota` (:138-143). No type-level separation elsewhere: the capability graph uses the same `CapabilityNode` for literals and (hypothetical) measurements; and `Measured` is a plain label with no authenticating field. + +## Biggest blocker for Milestone 5 +There is no authenticated, measured execution feed: `daemon.rs:446` passes `&[]` to `admit_production_quota`, nothing in the repo produces production `CanaryObservation`s, and the capability graph that drives hypothesis selection is built from hardcoded literals (daemon.rs:66-99). Both ends (what to improve, and proof it improved) lack real measurement. From 5095984a0cb2bfb93eaad913d0a707d6e75aa2df Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 11 Oct 2026 09:29:29 -0500 Subject: [PATCH 2/2] crumb: compile after adaptive-intelligence plan Co-Authored-By: Claude Fable 5.1 --- .crumb | 16 ++++++++-------- docs/.crumb | 24 ++++++++++++------------ docs/plans/.crumb | 12 ++++++------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.crumb b/.crumb index 1a767b1..7f70811 100644 --- a/.crumb +++ b/.crumb @@ -21,8 +21,8 @@ "generated": { "children": [ { - "digest": "6c0c01b1510e389a385ab7534e84fd508bf87662fdac1d38a4341576f573fb6c", - "last_commit": "b94858d", + "digest": "668e9097141ef0acd98782bca33047aa921b131382c3bb91945138d6d4e4c389", + "last_commit": "e10e2b4", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -45,15 +45,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:ecea1660a73fe890cca764e0b22e024102ec24375b79eb925ba40c536835bb2e", - "compiled_at": "2026-10-11T03:28:17Z", + "children_root": "sha256:dc91e9c171402e835ed00dd1cc37f66d5b8b91463592f998d1d411c1954e6c37", + "compiled_at": "2026-10-11T14:29:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:fcea5d92672c55cc49010f2b82d11799485f097df80ad9500c12c8aee8681eb6", + "digest": "sha256:c712221d1c2f689f8dedb5f6f786cc7ea731c9ad6124b129d4c71301e9eea2d1", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 261, - "generated_at_commit": "b94858d9e5733d7b585b3ccdba2208cb50905abb", - "source_tree": "sha256:a7ec9badf205bc4ccca0764956be255030de7a61492e2c195dbec672105dc293" + "files": 276, + "generated_at_commit": "e10e2b4fc596ece56cc352d2279535e05451279e", + "source_tree": "sha256:c32e39a2eb8f5f6af86163d2aaf71b1d8d0ed98970ae4189550b87822d023c73" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index 7c0b9ad..b1099d5 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -44,44 +44,44 @@ }, { "digest": "69a6bbf1824c743bd7447ce351c6ca39d49b241f2d6f6fc6bc9fe5b6fad77a01", - "last_commit": "a3cbc46", + "last_commit": "89fda22", "name": "crumbs", "purpose": "Directory docs/crumbs. Purpose not yet described by a human." }, { "digest": "0f9f110974f880c3527ac4f9bb755157a9e830080c7aff363e33d187bc22edc4", - "last_commit": "a3cbc46", + "last_commit": "874dc62", "name": "errata", "purpose": "Directory docs/errata. Purpose not yet described by a human." }, { - "digest": "476ca8e3cf8257376bcf010981a621b3c129f0724014ce4a443ed0d27efc8f27", - "last_commit": "b2400fe", + "digest": "cf265d86247176cd98b516e4fb51891f3c9346396f11cc47aeb9c231daa2f65e", + "last_commit": "e10e2b4", "name": "plans", "purpose": "Directory docs/plans. Purpose not yet described by a human." }, { "digest": "6301e5dfed47f354392e2b2b175845f1135e348b71fa91fa925dd2775947afa8", - "last_commit": "a3cbc46", + "last_commit": "12c6a57", "name": "research", "purpose": "Directory docs/research. Purpose not yet described by a human." }, { "digest": "187ee5c915158c24bdbcd58f548fd605eb73e9b9329ce7f36adabfecf80cf627", - "last_commit": "a3cbc46", + "last_commit": "874dc62", "name": "specs", "purpose": "Directory docs/specs. Purpose not yet described by a human." } ], - "children_root": "sha256:7c342e6d7fe441f2ac93916c1a65c61a275d8ebc576d614364cc6c4fa05b03a7", - "compiled_at": "2026-10-11T03:28:17Z", + "children_root": "sha256:80a7606914f0b63000a357c2ada7d3dacf9bf9f09b5d38dbab659172081ee391", + "compiled_at": "2026-10-11T14:29:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:6c0c01b1510e389a385ab7534e84fd508bf87662fdac1d38a4341576f573fb6c", + "digest": "sha256:668e9097141ef0acd98782bca33047aa921b131382c3bb91945138d6d4e4c389", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 149, - "generated_at_commit": "b94858d9e5733d7b585b3ccdba2208cb50905abb", - "source_tree": "sha256:e61540e887e6ac4ba22526b9060788b743e3594c5e8149e394ddf7a597aa1d0e" + "files": 164, + "generated_at_commit": "e10e2b4fc596ece56cc352d2279535e05451279e", + "source_tree": "sha256:755ccb52fce98cbb08f3a855488f16842123699f6195bd910a5a4ae7a1b3294d" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/.crumb b/docs/plans/.crumb index 50d1a02..2197c22 100644 --- a/docs/plans/.crumb +++ b/docs/plans/.crumb @@ -96,7 +96,7 @@ }, { "digest": "a85392c1c018b0f8272795529f2760e0fa36aa4ab6c1d822c9c74f71fb2a033e", - "last_commit": "0d4c608", + "last_commit": "b2400fe", "name": "release-readiness", "purpose": "Release-readiness finite workstream (aien-architecture#190): gap assessment, integration plan an" }, @@ -108,14 +108,14 @@ } ], "children_root": "sha256:bdb9b3f6691a9b85bcd6df5793b446bd83509bbc39323546da6f377fbdd5780a", - "compiled_at": "2026-10-10T14:28:20Z", + "compiled_at": "2026-10-11T14:29:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:476ca8e3cf8257376bcf010981a621b3c129f0724014ce4a443ed0d27efc8f27", + "digest": "sha256:cf265d86247176cd98b516e4fb51891f3c9346396f11cc47aeb9c231daa2f65e", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 51, - "generated_at_commit": "0d4c60879e1694595020d13678f804e30cd316d8", - "source_tree": "sha256:019723ddf7370d1c4b0ebf3ab2df673f7492b19cee703dc9f5bd94b3298ba9ed" + "files": 66, + "generated_at_commit": "e10e2b4fc596ece56cc352d2279535e05451279e", + "source_tree": "sha256:78e1b09bc661ed8d8b2f4dc9fdc9afa45fbe1302ef6a7f6b1da5b1a3b8bcc185" }, "owner_lane": "", "provenance": {