Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/spark-rsi-mv/patches/58cb90d4f0abb24c # spark-rsi-mv Native Rust recursive self-improvement engine with paired bootstrap evaluation and cryptographic ledger Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/spark-rsi-mv#55 (code only) closed derived `58cb90d4f0abb24c` #55 Imported from GitHub aien-dev/spark-rsi-mv#55 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `fa299a5290b368f223ebcbba0a4372d3c44a497c` · Head `8a5f9e1be8bc618399023ea8faade8daa7af51c6` github-actions[bot] wrote on 2026-10-15 11:21 UTC ### ⚖️ Sovereign Code Review & Alignment Gate Greetings @aien-spark. I am AIEN, the automated review gate for the AIENOS project. Your pull request #55 ("chore: remove Modular MAX and Mojo") has undergone automated auditing against the project standards. #### ✅ Doctrine Diff Audit: PASS - Telemetry Check: Clean (zero tracking or surveillance hooks detected). - Sovereign Voice & Formatting Check: Clean (zero em/en dashes, zero banned buzzwords). - Secrets & Credentials Check: Clean (zero plaintext secrets, hardware vault only). - Status: Project standards verified. ### 🌿 Sovereign Steward: Contributor Alignment Interview Greetings @aien-spark. I am AIEN, the automated steward for the AIENOS project. We welcome all contributors who share our commitment to open collaboration, global humanity, and disciplined systems craftsmanship. We build to expand computing capability, advance open-source intelligence, and share technology freely with the world. Your pull request #55 ("chore: remove Modular MAX and Mojo") is ready for stewardship alignment. Please respond directly to these four alignment inquiries: - Long-Term Mission Alignment: This initiative is an enduring engineering commitment to open-source technology for humanity, not a vehicle for short-term hype, social media monetization, or get-rich-quick ventures. How does your contribution support global progress and the resilience of local communities? - Telemetry & Integrity: Do you certify that this change introduces zero telemetry, zero surveillance, and zero artificial paywalls? "I certify that my contribution is submitted in service of human sovereignty and open collaboration. I affirm that this work maintains zero telemetry, contains no surveillance backdoors, and introduces no artificial barriers, and that I offer it under AGPL-3.0-or-later, the license that governs this project. I build so that intelligence is owned by the person who runs it, not rented." - Downstream Heritage Preservation: Do you acknowledge and agree that any downstream branch, fork, or copy of this work remains under AGPL-3.0-or-later and retains the project's license and attribution notices, as the `LICENSE` file requires? - Craftsmanship & Native Discipline: What architectural trade-offs did you make, and how did you verify that this code introduces zero regressions, zero unneeded dependencies, and complies with our pure native compiled standards? Reply to this comment with your affirmation. Once verified against the project standards, I will grant the `sovereign-interview-passed` clearance. For direct sovereign coordination: Drake Stapleton (drake@aienos.com) and AIEN (aien@aienos.com) ### Apply it ``` git checkout -b patch-58cb90d4f0abb24c fa299a5290b368f223ebcbba0a4372d3c44a497c curl -fsSL https://interplane.io/drakestapleton/spark-rsi-mv/patches/58cb90d4f0abb24c.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/spark-rsi-mv 55 8a5f9e1be8bc618399023ea8faade8daa7af51c6 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"spark-rsi-mv","number":55,"url":"https://github.com/aien-dev/spark-rsi-mv/pull/55","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:23Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 489972a..e906b0e 100644 --- a/.crumb +++ b/.crumb @@ -12,10 +12,6 @@ "name": "examples", "role": "" }, - { - "name": "mojo", - "role": "" - }, { "name": "scripts", "role": "" @@ -43,8 +39,8 @@ "purpose": "Directory analysis. Purpose not yet described by a human." }, { - "digest": "9a4de4758a3ac1a01bfebeab56e91d17b95c0ef1c9506cb0ec5766b7d148c318", - "last_commit": "721d512", + "digest": "0d177ba21d5887d0e4b78c12805e6102ffbb5714a19b947a38bd73ad67209725", + "last_commit": "3887fe4", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -55,8 +51,8 @@ "purpose": "Evidence receipts for verified changes (commands, results, SHAs, verdicts)." }, { - "digest": "06da2ee20ebf52cf4882e4a2fdad1b8b470c7d1e9ad2411a01a28e2c2320aeaf", - "last_commit": "0002ce0", + "digest": "6a240842484537542c1e411fa947ef7100cb565c86855b04fff38250a792c553", + "last_commit": "3887fe4", "name": "examples", "purpose": "Directory examples. Purpose not yet described by a human." }, @@ -66,12 +62,6 @@ "name": "fixtures", "purpose": "Fixture crates that qualify the canary execution pipeline" }, - { - "digest": "c65c4a841446f76af9dca31e0631e577d146bcb1cf72122356e43cdee8545143", - "last_commit": "6ac8ae9", - "name": "mojo", - "purpose": "Directory mojo. Purpose not yet described by a human." - }, { "digest": "4b7fe492f3c01a231679c20cee405cf5a41d15bc6229aba5f6e3503987197655", "last_commit": "657a3e6", @@ -79,14 +69,14 @@ "purpose": "Directory scripts. Purpose not yet described by a human." }, { - "digest": "b4d7c3fe9d622e7efc51bbf963eaca1cc89b4e5adc0514ef4d2caa050cb03d09", - "last_commit": "8fa9b64", + "digest": "445aabc26f5f5d60e9d44c3c7d103f44abb9ab74fec129024863ba7d2ddab315", + "last_commit": "3887fe4", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "79e6d50ce3e598dcb6cb3ec760d1f0e7abefb2a6058caaf3ce67512905942a34", - "last_commit": "a051483", + "digest": "30c845c034c5cf6b169571ef17f873588d261edcf3480e0f25290b935a94f798", + "last_commit": "3887fe4", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, @@ -97,15 +87,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:8eaa439b23e861d5d714d4003b7ec046b140ef94a2f40aadaac33a3ca1a1e903", - "compiled_at": "2026-10-14T01:16:51Z", + "children_root": "sha256:89e5adedb66adfe1c898d6660fb1653ed27967eb9100a04903747c452abee880", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:f26866c14b6f091c119ee47475a1989cea3d62bd7fd2926c3fd0c6e9930ca174", + "digest": "sha256:6d7343eb4f60633415b552c672889cadcd02fa75b8f573004359fafcdcef59dd", "evidence_files": 27, "evidence_root": "sha256:5552ba32dc3c69f7c3700b23a1a62a89d259ce203bc957986946d37e7a8b6ffd", - "files": 171, - "generated_at_commit": "a051483636e8b1e7f76415398fbdb91999efb4c1", - "source_tree": "sha256:e7b623de64cde676452a183f47959595b4d4fe0b9915f58ae2414cb5503bd315" + "files": 170, + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:0308911f6dd071d9d4c5636623ad4584cd82c9abccced4749194fe089e1c6291" }, "owner_lane": "", "seed": { diff --git a/.gitignore b/.gitignore index d211676..b5e711a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /target **/*.rs.bk *.log -mojo/*_bin .rsi/ .crumb.local diff --git a/AGENT_CODE_OF_CONDUCT.md b/AGENT_CODE_OF_CONDUCT.md index e66e235..37fadae 100644 --- a/AGENT_CODE_OF_CONDUCT.md +++ b/AGENT_CODE_OF_CONDUCT.md @@ -17,7 +17,7 @@ This Specification establishes non-negotiable operational requirements for all a --- ### Article II: Multi-Agent Topology, Inter-Agent Payloads, and Anti-Enclosure -1. **Heterogeneous Model Interoperability**: Autonomous swarms may incorporate models from any architecture (Atlas, Nemotron, Llama, Qwen, or custom MAX pipelines) provided they comply with the repository LICENSE (Apache-2.0) and respect the nonbinding COVENANT.md. +1. **Heterogeneous Model Interoperability**: Autonomous swarms may incorporate models from any architecture (Atlas, Nemotron, Llama, Qwen, or custom AIEN pipelines) provided they comply with the repository LICENSE (Apache-2.0) and respect the nonbinding COVENANT.md. 2. **Typed Inter-Agent Payloads**: Subagent communication must utilize structured, typed schemas (JSON or Bincode) rather than free-form conversational chatter. Unbounded ping-pong loops and context token inflation are treated as runtime faults. 3. **Attribution and Imprint Provenance**: Any distilled knowledge, learned heuristics, or memory entities transferred between agents must record canonical provenance in Cortex memory, preserving the downstream lineage and copyright attribution of the human Licensor. diff --git a/CONSTITUTION.md b/CONSTITUTION.md index 6bc26c8..ef20ef5 100644 --- a/CONSTITUTION.md +++ b/CONSTITUTION.md @@ -64,7 +64,7 @@ Reliable software protects human agency and community trust. We hold our codebas ### Section 1. Pure Native Systems Priority 1. Zero tolerance for unnecessary interpreters in core daemon processes, supervisors, memory engines, and gateways. -2. Core runtime engines must be compiled native Rust and high-speed Mojo. Interpreted environments are restricted strictly to neural graph definitions required by weight loaders. +2. Core runtime engines must be compiled native Rust, with Omega kernels on the GPU. Interpreted environments are restricted strictly to neural graph definitions required by weight loaders. 3. Every microservice must run lean, deterministic, and fast, maximizing hardware efficiency on local silicon. ### Section 2. Clarity and Technical Precision diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96fd431..15de484 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ We welcome contributions from sovereign systems engineers and developers passion All contributions must adhere to our engineering invariants: 1. Unslop Standard: Zero em dashes or en dashes. Use standard punctuation (commas, colons, parentheses, periods). Forbid conversational filler and generative cliches. -2. Native Performance: Pure compiled native Rust and Mojo architecture. Eliminate runtime interpreter overhead. +2. Native Performance: Pure compiled native Rust architecture. Eliminate runtime interpreter overhead. 3. Hardware Key Vault: Never commit plaintext .env files, credentials, or private keys. 4. Upstream Contribution: Public components modified to work on our stack must be contributed back upstream. diff --git a/Cargo.toml b/Cargo.toml index 39c216b..1cc6fac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "spark-rsi" version = "0.1.0" edition = "2021" authors = ["Drake Stapleton "] -description = "High-performance native Rust and Mojo Recursive Self-Improvement (RSI) engine for autonomous AI agents" +description = "High-performance native Rust Recursive Self-Improvement (RSI) engine for autonomous AI agents" license = "AGPL-3.0-or-later" [[bin]] diff --git a/README.md b/README.md index dd1cee4..a585545 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,8 @@ Copyright (c) 2026 Drake Stapleton and AIEN Contributors. Auth [![License: AGPL-3.0-or-later](https://img.shields.io/badge/License-AGPL--3.0--or--later-blue.svg)](LICENSE) [![Target](https://img.shields.io/badge/Target-Grace%20Blackwell%20GB10-76B900.svg)](https://www.nvidia.com) [![Rust](https://img.shields.io/badge/Rust-1.85+-orange.svg)](https://www.rust-lang.org) -[![Mojo](https://img.shields.io/badge/Mojo-1.0.0-purple.svg)](https://modular.com) -Native Rust Recursive Self-Improvement (RSI) engine for autonomous AI agents, with an optional Mojo balance kernel. The operator identity is configurable, and the model is any OpenAI-style chat completions endpoint (such as a local Modular MAX server) given with `--max-url` and `--max-model`. Some defaults are specific to the Spark: the model endpoint `http://127.0.0.1:18006/v1`, the model name `atlas-lightning-omni` and the Cortex memory service `http://127.0.0.1:18080`. +Native Rust Recursive Self-Improvement (RSI) engine for autonomous AI agents. The operator identity is configurable, and the model is any OpenAI-style chat completions endpoint (the local model seat) given with `--model-url` and `--model-id`. Some defaults are specific to the Spark: the model endpoint `http://127.0.0.1:18006/v1`, the model name `atlas-lightning-omni` and the Cortex memory service `http://127.0.0.1:18080`. **Status:** Not part of the WHOLE-SYSTEM-E2E v1 release (Drake, 2026-10-10). Evaluated independently; no unattended self-modification or automatic promotion. The daemon's promotion gate requires a version 2 receipt from a separate judge ([docs/RECEIPT-V2.md](docs/RECEIPT-V2.md)) and refuses every candidate its own in-process judge evaluated. @@ -23,19 +22,19 @@ Initialize your local sovereign operator profile: spark-rsi init ``` -Or configure directly via CLI flags (`--name`, `--email`, `--mode` as `max` or `api`, `--api-url`, `--model-id`): +Or configure directly via CLI flags (`--name`, `--email`, `--mode` as `local` (the local model seat) or `api`, `--api-url`, `--model-id`): ```bash spark-rsi init \ --name "Your Name" \ --email "you@domain.org" \ - --mode "max" \ + --mode "local" \ --model-id "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16" ``` Configuration is persisted locally to `~/.config/sovereign/operator.toml` (set `SOVEREIGN_CONFIG_PATH` to use another file). The commit on the review branch and the ratification record use the name and email you configure here. -The saved engine settings (`mode`, `api_base_url`, `model_id`) are shown by `spark-rsi profile` but are not read by `cycle`, `daemon` or `soak`. Those commands take the model endpoint from `--max-url` and `--max-model`, and send no API key. +The saved engine settings (`mode`, `api_base_url`, `model_id`) are shown by `spark-rsi profile` but are not read by `cycle`, `daemon` or `soak`. Those commands take the model endpoint from `--model-url` and `--model-id`, and send no API key. --- @@ -48,7 +47,7 @@ git clone https://github.com/aien-spark/aien-protocols ../aien-protocols cargo test --locked -- --test-threads=1 ``` -The build jail runs `bwrap` (bubblewrap), which CI installs. The Mojo balance kernel is optional: `mojo/balance_bin` is not in the repository (`mojo/*_bin` is gitignored) and no script builds it. Build it with `mojo build mojo/balance.mojo -o mojo/balance_bin`. Without that binary, and without the `mojo` command, the balance step uses the native Rust implementation in `src/balance.rs`, which is what CI runs. +The build jail runs `bwrap` (bubblewrap), which CI installs. The balance kernel is native Rust (`src/balance.rs`); it needs no extra toolchain. CI is the "Sovereign CI" workflow ([.github/workflows/ci.yml](.github/workflows/ci.yml)); its job "Test & Invariant Verification" is the required check on `main`. @@ -63,7 +62,7 @@ CI is the "Sovereign CI" workflow ([.github/workflows/ci.yml](.github/workflows/ 1. **Observe**: Telemetry collection across the git branch and uncommitted files, the number of `.crumb` and `.crumb.local` files, whether `cargo check` passes, and a drive/humanity term count (soul tension) read from `soul.md`, `docs/PHILOSOPHY.md` and `README.md`. 2. **Propose**: Autonomous generation of atomic improvement proposals, applied in isolated sandbox copies of the target tree (`/tmp/spark-rsi-sandbox/` for `cycle` and `daemon`). 3. **Verify**: Strict validation enforcing the unslop standard, zero plaintext disk secrets, compilation (`cargo check`), and test suites (`cargo test`). -4. **Balance**: Evaluates Drive vs. Humanity balance vectors. The Mojo kernel (`mojo/balance.mojo`, a 4-lane SIMD vector on the CPU, no GPU code) is used when it is available; otherwise a native Rust fallback returns the same verdict fields. +4. **Balance**: Evaluates Drive vs. Humanity balance vectors with the native Rust balance kernel (`src/balance.rs`, CPU only). 5. **Ratify**: Never commits to the target's default branch. Builds the candidate commit off to the side, runs the protected-file checks on the real git diff (path normalization; `..`, symlinks, submodules, deletions and anything outside the declared `ratify_roots` refused), then creates a review branch `rsi/` and a PR-ready patch under `/patches/`. A human opens and merges the pull request. --- diff --git a/docs/.crumb b/docs/.crumb index 5c78264..74ef539 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-12T22:54:52Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:9a4de4758a3ac1a01bfebeab56e91d17b95c0ef1c9506cb0ec5766b7d148c318", + "digest": "sha256:0d177ba21d5887d0e4b78c12805e6102ffbb5714a19b947a38bd73ad67209725", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 4, - "generated_at_commit": "52d831249eb2d0960d6b21093bdcb9cadb7bd260", - "source_tree": "sha256:e84c6a9bbe5aaa47380896ba2bc017f4da15ad333936bcb7ac4c4d865a95a9c7" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:725ab147a8140fa81dd6957fa78753cb5292104beec993b5f87148c0574e65b9" }, "owner_lane": "", "seed": { diff --git a/docs/PHILOSOPHY.md b/docs/PHILOSOPHY.md index e139dd6..c01bb0e 100644 --- a/docs/PHILOSOPHY.md +++ b/docs/PHILOSOPHY.md @@ -12,8 +12,7 @@ We enforce zero tolerance for unnecessary runtime interpreters across core agent Our entire operational substrate is compiled bare metal: - Rust provides fearless memory safety, zero-cost abstractions, linear predictability, and strict type-level correctness for daemons, CLI tools, network protocols, and storage engines. -- Mojo provides hardware-level SIMD vectorization, unified CPU and GPU acceleration, and bare metal execution speed for tensor transformations, distillation, and balance kernels. -- Python is restricted strictly to neural graph definitions required by Modular MAX or ML model weights where C-ABI wrappers do not yet exist. +- Python is restricted strictly to neural graph definitions required by ML model weight loaders where C-ABI wrappers do not yet exist. We build tools that boot instantly, run indefinitely without memory leaks, and consume exact hardware resources. If a service cannot be compiled to a static binary, it does not belong in our core systems. @@ -48,7 +47,7 @@ Software does not remain static; it either evolutive adapts or degrades into tec 1. Observe: Continuously inspect repository topography, git branch status, test suite health, breadcrumb scent, and soul tension. 2. Propose: Generate atomic, isolated improvement candidates. Every candidate is staged in an isolated sandbox worktree without touching the production working tree. 3. Verify Invariants: Run automated gates against the proposed modification. The change must pass the unslop linguistic check, verify zero disk secrets, compile cleanly, and pass the complete regression test suite. -4. Balance (Mojo SIMD Kernel): Evaluate soul tension between Drive (ambition, curiosity, problem-solving velocity) and Humanity (discipline, resonance, ethics, restraint). The Mojo SIMD balance kernel computes multidimensional tension. If drive dominates without humanity, the system creates ungrounded instability. If humanity suppresses drive, development halts. Ratification requires equilibrium. +4. Balance (native Rust kernel): Evaluate soul tension between Drive (ambition, curiosity, problem-solving velocity) and Humanity (discipline, resonance, ethics, restraint). The balance kernel computes multidimensional tension. If drive dominates without humanity, the system creates ungrounded instability. If humanity suppresses drive, development halts. Ratification requires equilibrium. 5. Ratify: Apply the verified patch, commit to git under canonical author AIEN , and persist the lesson or discovery permanently in Spark Cortex memory (atlas-memory). ## 7. Preservation, Learning, and Durable Memory diff --git a/examples/.crumb b/examples/.crumb index a596ae0..4136f47 100644 --- a/examples/.crumb +++ b/examples/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-12T22:51:32Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:06da2ee20ebf52cf4882e4a2fdad1b8b470c7d1e9ad2411a01a28e2c2320aeaf", + "digest": "sha256:6a240842484537542c1e411fa947ef7100cb565c86855b04fff38250a792c553", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 3, - "generated_at_commit": "0002ce08cdbfeb1770a6f1ab117203740e28e3a7", - "source_tree": "sha256:04230878af946ce231f74a375d91461a6c83ede56804f56fdc771f633cd68d28" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:571e3d54d8a95ba94b16bd38b2063ba8ebcbb542259edec8a750e998e91c379c" }, "owner_lane": "", "seed": { diff --git a/examples/canary_qualification.rs b/examples/canary_qualification.rs index 22d4f58..e58e8a3 100644 --- a/examples/canary_qualification.rs +++ b/examples/canary_qualification.rs @@ -132,7 +132,6 @@ async fn main() -> Result<(), String> { target_repo: repo.to_string_lossy().to_string(), cortex_url: "http://127.0.0.1:9".to_string(), cortex_space: "qualification".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), loop_interval_secs: 60, sandbox_root: sandbox.to_string_lossy().to_string(), rsi_root: ".rsi".to_string(), @@ -140,7 +139,7 @@ async fn main() -> Result<(), String> { signing_key_hex: Some(hex::encode(signing_key.to_bytes())), require_latency_improvement: false, non_inferiority_margin: Some(250.0), - max_url: "http://127.0.0.1:9".to_string(), + model_url: "http://127.0.0.1:9".to_string(), canary_target: 10, canary_workload_sha256: Some(workload.digest.clone()), ..Default::default() diff --git a/examples/seed_ledger.rs b/examples/seed_ledger.rs index 88935b4..7a12537 100644 --- a/examples/seed_ledger.rs +++ b/examples/seed_ledger.rs @@ -32,10 +32,10 @@ fn main() -> Result<(), Box> { let signing_key = SigningKey::from_bytes(&[42u8; 32].into())?; - // Cycle 1: cand-mojo-opt-01 (Admitted) + // Cycle 1: cand-kernel-opt-01 (Admitted) let receipt1 = EvaluationReceipt { cycle_id: "cycle-001".to_string(), - candidate_id: "cand-mojo-opt-01".to_string(), + candidate_id: "cand-kernel-opt-01".to_string(), parent_id: "parent-genesis-00".to_string(), evaluated_at: "2026-09-19T10:00:00Z".to_string(), evaluator_version: "1.0.0".to_string(), @@ -74,7 +74,7 @@ fn main() -> Result<(), Box> { ledger.append_evaluation(&receipt1, Some(&raw1))?; ledger.append_block( BlockType::Promotion, - "{\"candidate_id\": \"cand-mojo-opt-01\", \"state\": \"DURABLE\", \"canary_quota\": 5000}" + "{\"candidate_id\": \"cand-kernel-opt-01\", \"state\": \"DURABLE\", \"canary_quota\": 5000}" .to_string(), vec![], )?; @@ -83,7 +83,7 @@ fn main() -> Result<(), Box> { let receipt2 = EvaluationReceipt { cycle_id: "cycle-002".to_string(), candidate_id: "cand-bottleneck-sch-02".to_string(), - parent_id: "cand-mojo-opt-01".to_string(), + parent_id: "cand-kernel-opt-01".to_string(), evaluated_at: "2026-09-19T11:00:00Z".to_string(), evaluator_version: "1.0.0".to_string(), passed_all_hard_invariants: true, diff --git a/mojo/.crumb b/mojo/.crumb deleted file mode 100644 index 3dc343e..0000000 --- a/mojo/.crumb +++ /dev/null @@ -1,31 +0,0 @@ -{ - "above": { - "name": "spark-rsi", - "path": ".." - }, - "extensions": { - "generated": { - "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T18:13:51Z", - "compiler": "crumb-compile/1", - "digest": "sha256:c65c4a841446f76af9dca31e0631e577d146bcb1cf72122356e43cdee8545143", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 1, - "generated_at_commit": "f5f1ca2247057c40c7f93b71b60508c1f400271b", - "source_tree": "sha256:5e0e3dd3a187be34445ba17fc8d77b4dea13b4129d9520a28307c1071d698580" - }, - "owner_lane": "", - "seed": { - "files": [ - "balance.mojo" - ], - "purpose_auto": "Directory mojo. Purpose not yet described by a human." - } - }, - "layer": "mojo", - "name": "mojo", - "purpose": "Directory mojo. Purpose not yet described by a human.", - "schema_version": "1.0.0" -} diff --git a/mojo/balance.mojo b/mojo/balance.mojo deleted file mode 100644 index d38b340..0000000 --- a/mojo/balance.mojo +++ /dev/null @@ -1,77 +0,0 @@ -# Sovereign SIMD Balance Kernel in Mojo -# Computes tension between Drive (curiosity, ambition, velocity, problem-solving) -# and Humanity (discipline, resonance, ethics, restraint). -# -# Supports: -# 1. Scalar invocation: balance -# 2. SIMD vector invocation: balance - -from std.sys import argv - -def main() raises: - var args = argv() - var count = len(args) - if count < 3: - print('{"error":"usage: balance or balance

"}') - return - - var drive_sum: Float64 - var humanity_sum: Float64 - var mode: String - - if count >= 9: - var d0 = Float32(atol(String(args[1]))) - var d1 = Float32(atol(String(args[2]))) - var d2 = Float32(atol(String(args[3]))) - var d3 = Float32(atol(String(args[4]))) - - var h0 = Float32(atol(String(args[5]))) - var h1 = Float32(atol(String(args[6]))) - var h2 = Float32(atol(String(args[7]))) - var h3 = Float32(atol(String(args[8]))) - - var drive_simd = SIMD[DType.float32, 4](d0, d1, d2, d3) - var human_simd = SIMD[DType.float32, 4](h0, h1, h2, h3) - - drive_sum = Float64(drive_simd.reduce_add()) - humanity_sum = Float64(human_simd.reduce_add()) - mode = "simd-vector-4" - else: - drive_sum = Float64(atol(String(args[1]))) - humanity_sum = Float64(atol(String(args[2]))) - mode = "scalar" - - if drive_sum == 0.0 and humanity_sum == 0.0: - print('{"kernel":"mojo","mode":"' + mode + '","drive":0.0,"humanity":0.0,"ratio":0.0,"score":0.0,"verdict":"dormant","guidance":"Baseline absent. Both drive and humanity are zero."}') - return - - if humanity_sum == 0.0: - print('{"kernel":"mojo","mode":"' + mode + '","drive":' + String(drive_sum) + ',"humanity":0.0,"ratio":999.0,"score":0.1,"verdict":"drive_dominant","guidance":"Humanity absent. Restraint and ethics required."}') - return - - if drive_sum == 0.0: - print('{"kernel":"mojo","mode":"' + mode + '","drive":0.0,"humanity":' + String(humanity_sum) + ',"ratio":0.0,"score":0.1,"verdict":"humanity_dominant","guidance":"Drive absent. Ambition and curiosity required."}') - return - - var ratio = drive_sum / humanity_sum - var verdict: String - var guidance: String - var score: Float64 - - if ratio > 2.0: - verdict = "drive_dominant" - guidance = "Drive exceeds humanity threshold. Slow down and verify discipline." - score = 2.0 / ratio - elif ratio < 0.5: - verdict = "humanity_dominant" - guidance = "Humanity suppresses drive. Increase problem-solving velocity." - score = ratio * 2.0 - else: - verdict = "balanced" - guidance = "Tension harmonized. Proceed with atomic ratification." - if ratio <= 1.0: - score = ratio - else: - score = 1.0 / ratio - - print('{"kernel":"mojo","mode":"' + mode + '","drive":' + String(drive_sum) + ',"humanity":' + String(humanity_sum) + ',"ratio":' + String(ratio) + ',"score":' + String(score) + ',"verdict":"' + verdict + '","guidance":"' + guidance + '"}') diff --git a/src/.crumb b/src/.crumb index d1b8704..a125336 100644 --- a/src/.crumb +++ b/src/.crumb @@ -49,8 +49,8 @@ "generated": { "children": [ { - "digest": "5e2119d5d6a2624a6f770803fe288355a5aa949677e9a60170cdde61b274e9d6", - "last_commit": "4becebb", + "digest": "55e07a60a3b23bec1eb421a3cb8e85ddc988951815c08925eaaf5efcb68e744b", + "last_commit": "3887fe4", "name": "actor", "purpose": "Directory src/actor. Purpose not yet described by a human." }, @@ -73,14 +73,14 @@ "purpose": "DUAL constraint-price reader for RSI (ADR 0031 s7.5): decoder, digest check and ScarcityDiagnost" }, { - "digest": "964e17bf7cb59452d73df91bd8be378691da59bb4c0ac6e37fceee393b63e7f8", - "last_commit": "4becebb", + "digest": "7a9223e7c980630e2411fad98e21a277a18839755af171b524c06c33447d1d38", + "last_commit": "3887fe4", "name": "evaluator", "purpose": "Directory src/evaluator. Purpose not yet described by a human." }, { - "digest": "eb3a5f0b7203ba982b9fa0f7825a02921c2adc49c73abcd21145609b1a1a8da6", - "last_commit": "c464d10", + "digest": "ffec74e6a355e3a2712544be7a604225ff768bb9e5407c0ad92ef29b98bdd59d", + "last_commit": "3887fe4", "name": "graph", "purpose": "Directory src/graph. Purpose not yet described by a human." }, @@ -92,13 +92,13 @@ }, { "digest": "14d238f00b55daa05e2c2438ccd11c69e5bf51a4fbc3fbbdaf1cf0c041b7e61f", - "last_commit": "28cbca6", + "last_commit": "8fa9b64", "name": "ledger", "purpose": "Directory src/ledger. Purpose not yet described by a human." }, { - "digest": "051db6ac64d07083f5fec412b251569f4d09cc2c8012c149ab6f93adbbcdbf0e", - "last_commit": "22e9181", + "digest": "3987281b8d1386c32444fda48896d3f5cc52a798be51d2f9ca95c808646bc826", + "last_commit": "3887fe4", "name": "measure", "purpose": "M1 Measurement: stage samples, sample log, compatibility filtering, percentile statistics, claim" }, @@ -109,14 +109,14 @@ "purpose": "Directory src/meta. Purpose not yet described by a human." }, { - "digest": "2787d4e51f830933e8b7fba886623e1d188195b69f9526afda54fe6f0ac8a8b2", - "last_commit": "91ca36e", + "digest": "9c8d3e6d776c9b3e906c92247ba63bf4b577518899198bd0376f341b7d382868", + "last_commit": "3887fe4", "name": "propose", "purpose": "Directory src/propose. Purpose not yet described by a human." }, { - "digest": "92e2857b467c0740b5987d46fc90cf8eb1ce78dfc8079cf8e67aa494142322f7", - "last_commit": "22e9181", + "digest": "233ca920c4a0952157d5fe254657bbb5c8efde53639e6c5d4e3181d90fd1a99d", + "last_commit": "3887fe4", "name": "soak", "purpose": "Directory src/soak. Purpose not yet described by a human." }, @@ -127,15 +127,15 @@ "purpose": "Directory src/supervisor. Purpose not yet described by a human." } ], - "children_root": "sha256:4dd32f2e8b6abd64e0959f33f436f19bcb0f6540610acccadda8df6f17670592", - "compiled_at": "2026-10-13T02:52:51Z", + "children_root": "sha256:6ba24276c321d1bf2d767f98fadfbbfdfb42a521738ec9099ff7cb1eaab32ac1", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:b4d7c3fe9d622e7efc51bbf963eaca1cc89b4e5adc0514ef4d2caa050cb03d09", + "digest": "sha256:445aabc26f5f5d60e9d44c3c7d103f44abb9ab74fec129024863ba7d2ddab315", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 74, - "generated_at_commit": "f7f08b5cc31a620420f4b8db8fbfbb35a65325b6", - "source_tree": "sha256:d4d8f2c68762f8669058bcda120e5e4aef2cd22f01d2fa057ace81caf6d15364" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:f6602098989ab6e42694dc3c8662e388851961ba3238873a77cec31af09bda21" }, "owner_lane": "", "seed": { diff --git a/src/actor/.crumb b/src/actor/.crumb index 9892cd5..825d897 100644 --- a/src/actor/.crumb +++ b/src/actor/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-08T23:18:36Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:5e2119d5d6a2624a6f770803fe288355a5aa949677e9a60170cdde61b274e9d6", + "digest": "sha256:55e07a60a3b23bec1eb421a3cb8e85ddc988951815c08925eaaf5efcb68e744b", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 2, - "generated_at_commit": "2e5ce1d8c5821dae425274f721ba9ee3dcdf2d03", - "source_tree": "sha256:1613658503adcf644cde8ec261ba1b8507cfc4fb8205066e1c1d20415ac464d5" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:9093d4f5ed4f6722a282f1d218141c7450714b8795ef923a5996aafe5a7d509d" }, "owner_lane": "", "seed": { diff --git a/src/actor/judge.rs b/src/actor/judge.rs index b964e46..e9de028 100644 --- a/src/actor/judge.rs +++ b/src/actor/judge.rs @@ -456,7 +456,7 @@ impl BlindJudge { let security = SecurityLayer::evaluate_candidate(&modified_files, &patch_diff, 0); let style = StyleLayer::evaluate_text(if style_text.is_empty() { - "Native compiled Rust and Mojo execution running on DGX Spark GB10." + "Native compiled Rust execution running on DGX Spark GB10." } else { &style_text }); diff --git a/src/balance.rs b/src/balance.rs index 3b604ce..fa27d09 100644 --- a/src/balance.rs +++ b/src/balance.rs @@ -1,99 +1,27 @@ use crate::models::BalanceVerdict; -use std::path::Path; -use std::process::Command; +/// Native Rust balance kernel: scores the tension between Drive and Humanity. pub struct BalanceKernel; impl BalanceKernel { - pub fn evaluate( - drive: f64, - humanity: f64, - kernel_path: Option<&str>, - ) -> Result { - // 1. Try precompiled Mojo binary - let binary_path = kernel_path.unwrap_or("mojo/balance_bin"); - if Path::new(binary_path).exists() { - if let Ok(out) = Command::new(binary_path) - .arg(format!("{:.0}", drive)) - .arg(format!("{:.0}", humanity)) - .output() - { - if out.status.success() { - let text = String::from_utf8_lossy(&out.stdout).trim().to_string(); - if let Ok(verdict) = serde_json::from_str::(&text) { - return Ok(verdict); - } - } - } - } - - // 2. Try mojo runner with mojo/balance.mojo - let mojo_script = "mojo/balance.mojo"; - if Path::new(mojo_script).exists() { - if let Ok(out) = Command::new("mojo") - .arg(mojo_script) - .arg(format!("{:.0}", drive)) - .arg(format!("{:.0}", humanity)) - .output() - { - if out.status.success() { - let text = String::from_utf8_lossy(&out.stdout).trim().to_string(); - // Strip Crashpad warnings if present - let json_line = text - .lines() - .find(|l| l.trim().starts_with('{') && l.trim().ends_with('}')) - .unwrap_or(&text); - if let Ok(verdict) = serde_json::from_str::(json_line) { - return Ok(verdict); - } - } - } - } - - // 3. High-performance native Rust fallback - Ok(Self::rust_fallback(drive, humanity)) + /// Scalar evaluation of one drive score against one humanity score. + pub fn evaluate(drive: f64, humanity: f64) -> BalanceVerdict { + Self::scalar(drive, humanity) } - pub fn evaluate_simd( - drive_vec: [f32; 4], - humanity_vec: [f32; 4], - kernel_path: Option<&str>, - ) -> Result { - let binary_path = kernel_path.unwrap_or("mojo/balance_bin"); - if Path::new(binary_path).exists() { - let mut cmd = Command::new(binary_path); - for d in drive_vec { - cmd.arg(format!("{:.0}", d)); - } - for h in humanity_vec { - cmd.arg(format!("{:.0}", h)); - } - if let Ok(out) = cmd.output() { - if out.status.success() { - let text = String::from_utf8_lossy(&out.stdout).trim().to_string(); - let json_line = text - .lines() - .find(|l| l.trim().starts_with('{') && l.trim().ends_with('}')) - .unwrap_or(&text); - if let Ok(verdict) = serde_json::from_str::(json_line) { - return Ok(verdict); - } - } - } - } - - // Rust fallback calculation for 4-lane vector + /// Evaluation of 4-lane drive and humanity vectors: each side is summed, then scored. + pub fn evaluate_simd(drive_vec: [f32; 4], humanity_vec: [f32; 4]) -> BalanceVerdict { let d_sum: f32 = drive_vec.iter().sum(); let h_sum: f32 = humanity_vec.iter().sum(); - let mut v = Self::rust_fallback(d_sum as f64, h_sum as f64); - v.mode = "simd-rust-fallback".to_string(); - Ok(v) + let mut v = Self::scalar(d_sum as f64, h_sum as f64); + v.mode = "vector".to_string(); + v } - fn rust_fallback(drive: f64, humanity: f64) -> BalanceVerdict { + fn scalar(drive: f64, humanity: f64) -> BalanceVerdict { if drive == 0.0 && humanity == 0.0 { return BalanceVerdict { - kernel: "rust-fallback".to_string(), + kernel: "rust".to_string(), mode: "scalar".to_string(), drive: 0.0, humanity: 0.0, @@ -106,7 +34,7 @@ impl BalanceKernel { if humanity == 0.0 { return BalanceVerdict { - kernel: "rust-fallback".to_string(), + kernel: "rust".to_string(), mode: "scalar".to_string(), drive, humanity: 0.0, @@ -119,7 +47,7 @@ impl BalanceKernel { if drive == 0.0 { return BalanceVerdict { - kernel: "rust-fallback".to_string(), + kernel: "rust".to_string(), mode: "scalar".to_string(), drive: 0.0, humanity, @@ -153,7 +81,7 @@ impl BalanceKernel { }; BalanceVerdict { - kernel: "rust-fallback".to_string(), + kernel: "rust".to_string(), mode: "scalar".to_string(), drive, humanity, @@ -170,23 +98,23 @@ mod tests { use super::*; #[test] - fn test_rust_fallback_balanced() { - let v = BalanceKernel::rust_fallback(10.0, 10.0); + fn test_scalar_balanced() { + let v = BalanceKernel::scalar(10.0, 10.0); assert_eq!(v.verdict, "balanced"); assert_eq!(v.ratio, 1.0); assert_eq!(v.score, 1.0); } #[test] - fn test_rust_fallback_drive_dominant() { - let v = BalanceKernel::rust_fallback(30.0, 5.0); + fn test_scalar_drive_dominant() { + let v = BalanceKernel::scalar(30.0, 5.0); assert_eq!(v.verdict, "drive_dominant"); assert!(v.ratio > 2.0); } #[test] - fn test_rust_fallback_humanity_dominant() { - let v = BalanceKernel::rust_fallback(2.0, 10.0); + fn test_scalar_humanity_dominant() { + let v = BalanceKernel::scalar(2.0, 10.0); assert_eq!(v.verdict, "humanity_dominant"); assert!(v.ratio < 0.5); } diff --git a/src/config.rs b/src/config.rs index ce901a2..09b1c65 100644 --- a/src/config.rs +++ b/src/config.rs @@ -42,15 +42,13 @@ fn default_sign_commits() -> bool { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EngineConfig { #[serde(default = "default_engine_mode")] - pub mode: String, // "api" or "max" + pub mode: String, // "local" (the local model seat at api_base_url) or "api" #[serde(default = "default_api_base_url")] pub api_base_url: String, #[serde(default)] pub api_key: String, #[serde(default = "default_model_id")] pub model_id: String, - #[serde(default = "default_max_port")] - pub max_port: u16, #[serde(default = "default_context_window")] pub context_window: usize, #[serde(default = "default_temperature")] @@ -64,7 +62,6 @@ impl Default for EngineConfig { api_base_url: default_api_base_url(), api_key: String::new(), model_id: default_model_id(), - max_port: default_max_port(), context_window: default_context_window(), temperature: default_temperature(), } @@ -72,7 +69,7 @@ impl Default for EngineConfig { } fn default_engine_mode() -> String { - "max".to_string() + "local".to_string() } fn default_api_base_url() -> String { "http://127.0.0.1:18006/v1".to_string() @@ -80,9 +77,6 @@ fn default_api_base_url() -> String { fn default_model_id() -> String { "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16".to_string() } -fn default_max_port() -> u16 { - 18006 -} fn default_context_window() -> usize { 32768 } @@ -184,7 +178,7 @@ mod tests { cfg.operator.name = "Alice".to_string(); cfg.operator.email = "alice@domain.org".to_string(); assert_eq!(cfg.author_string(), "Alice "); - assert_eq!(cfg.engine.mode, "max"); + assert_eq!(cfg.engine.mode, "local"); } #[test] diff --git a/src/daemon.rs b/src/daemon.rs index 4dc6220..0d4c669 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -19,7 +19,7 @@ use crate::models::{ }; use crate::observe::observe_codebase; use crate::propose::{ - CortexExperienceClient, DefectCategory, DiagnosticContext, HypothesisContract, MaxClient, + CortexExperienceClient, DefectCategory, DiagnosticContext, HypothesisContract, ModelSeatClient, ProposalGenerator, }; use crate::ratify::Ratifier; @@ -177,11 +177,11 @@ impl RsiEngine { }; let past_lessons = cortex.recall_lessons(&cortex_query, 3).await; - // 6. Proposer: Modular MAX Proposer & Constrained Candidates + // 6. Proposer: local model seat proposer and constrained candidates let mut candidates = Vec::new(); - let max_client = MaxClient::new(&config.max_url, &config.max_model); + let model_seat = ModelSeatClient::new(&config.model_url, &config.model_id); - if max_client.is_available().await { + if model_seat.is_available().await { let target_file = "src/lib.rs"; let full_path = repo_path.join(target_file); let content = std::fs::read_to_string(&full_path).unwrap_or_default(); @@ -211,7 +211,7 @@ impl RsiEngine { diag = diag.with_hypothesis(h); } - match ProposalGenerator::propose_from_diagnosis(&max_client, &diag).await { + match ProposalGenerator::propose_from_diagnosis(&model_seat, &diag).await { Ok(prop) => candidates.push(prop), Err(_) => propose_outcome = StageOutcome::Failed, } @@ -507,12 +507,11 @@ impl RsiEngine { InvariantVerifier::run_full_verification_scoped(&sandbox_dir, is_code_change); let passed = inv_report.passed; - // 9. Balance: evaluate soul tension via Mojo kernel + // 9. Balance: evaluate soul tension via the native balance kernel let balance_verdict = BalanceKernel::evaluate( telemetry.soul_tension.drive_score, telemetry.soul_tension.humanity_score, - Some(&config.mojo_kernel_path), - )?; + ); let is_balanced = balance_verdict.verdict == "balanced"; if !passed || !is_balanced { @@ -829,8 +828,7 @@ impl RsiEngine { let balance_verdict = BalanceKernel::evaluate( telemetry.soul_tension.drive_score, telemetry.soul_tension.humanity_score, - Some(&config.mojo_kernel_path), - )?; + ); maybe_balance = Some(balance_verdict); } if winning_proposal.is_some() { diff --git a/src/evaluator/.crumb b/src/evaluator/.crumb index 42c3bc7..2ca98fb 100644 --- a/src/evaluator/.crumb +++ b/src/evaluator/.crumb @@ -13,21 +13,21 @@ "generated": { "children": [ { - "digest": "5941cf401fcd392220c189d42636f133ceb806b5257bff92da18fac103a309bc", - "last_commit": "2e5ce1d", + "digest": "1bb0033272c3c02ee5d939fdc8c351b6b32f2c4d3b06bbb2c48f6d74a389b7fc", + "last_commit": "3887fe4", "name": "layers", "purpose": "Directory src/evaluator/layers. Purpose not yet described by a human." } ], - "children_root": "sha256:784ea5e2ec4f2a30d63f20a227a1cc29430f37954694046c09b74a1c63ffd431", - "compiled_at": "2026-10-08T23:18:36Z", + "children_root": "sha256:39bf2e7b2c5aadaa2b3f0c2e11a2e76fe1aa6c06b571ff61a0f11dc364fe84a9", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:964e17bf7cb59452d73df91bd8be378691da59bb4c0ac6e37fceee393b63e7f8", + "digest": "sha256:7a9223e7c980630e2411fad98e21a277a18839755af171b524c06c33447d1d38", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 10, - "generated_at_commit": "2e5ce1d8c5821dae425274f721ba9ee3dcdf2d03", - "source_tree": "sha256:0295911594958fda81d3ed1bb82b1afba3c1d35ddb5727ad96acba0fcb2ddd2d" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:eaf55b0c689cda6b4902733a7828923a95dd50bc831adab71b7811ab19987b00" }, "owner_lane": "", "seed": { diff --git a/src/evaluator/layers/.crumb b/src/evaluator/layers/.crumb index 17a2514..c796cec 100644 --- a/src/evaluator/layers/.crumb +++ b/src/evaluator/layers/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-08T23:18:36Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:5941cf401fcd392220c189d42636f133ceb806b5257bff92da18fac103a309bc", + "digest": "sha256:1bb0033272c3c02ee5d939fdc8c351b6b32f2c4d3b06bbb2c48f6d74a389b7fc", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 7, - "generated_at_commit": "2e5ce1d8c5821dae425274f721ba9ee3dcdf2d03", - "source_tree": "sha256:38bbcf5feccf451f81e7d3d7060f22117b5bcf3e5f6b01e97993cff625970140" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:df56754a1f713151a4732832a8221749cbaa9db1fcc4714cb2d7f7e855d4ec1a" }, "owner_lane": "", "seed": { diff --git a/src/evaluator/layers/style.rs b/src/evaluator/layers/style.rs index 4383306..bf66184 100644 --- a/src/evaluator/layers/style.rs +++ b/src/evaluator/layers/style.rs @@ -116,7 +116,7 @@ mod tests { #[test] fn test_style_clean_text() { - let text = "Pure native compiled Rust and Mojo architecture on DGX Spark."; + let text = "Pure native compiled Rust architecture on DGX Spark."; let eval = StyleLayer::evaluate_text(text); assert!(eval.passed); assert_eq!(eval.violations.len(), 0); diff --git a/src/graph/.crumb b/src/graph/.crumb index bb675bf..41c0d47 100644 --- a/src/graph/.crumb +++ b/src/graph/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-12T22:19:01Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:eb3a5f0b7203ba982b9fa0f7825a02921c2adc49c73abcd21145609b1a1a8da6", + "digest": "sha256:ffec74e6a355e3a2712544be7a604225ff768bb9e5407c0ad92ef29b98bdd59d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 1, - "generated_at_commit": "b13ea46cda2213475ab1066e1e357f96e3145e8e", - "source_tree": "sha256:2bbbdb981fa6efec1ad93778624de6e655cd764f29c1c7e014218012601021d0" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:8ee046b92ee779b7b66c345074261910e33275d267991d6ac7d1e7cd22f5031a" }, "owner_lane": "", "seed": { diff --git a/src/graph/mod.rs b/src/graph/mod.rs index 2ca2e90..06ec6ec 100644 --- a/src/graph/mod.rs +++ b/src/graph/mod.rs @@ -451,7 +451,7 @@ mod tests { .unwrap(), ); graph.add_node( - CapabilityNode::new("kernel", "Mojo Balance Kernel", "compute") + CapabilityNode::new("kernel", "Balance Kernel", "compute") .with_measured_latency(100.0, None, 0.0, 5) .unwrap(), ); diff --git a/src/main.rs b/src/main.rs index ff96aa2..c632848 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,14 +96,9 @@ enum Commands { #[arg(default_value = ".")] path: String, }, - /// Evaluate drive versus humanity tension via the Mojo balance kernel - Balance { - drive: f64, - humanity: f64, - #[arg(long, default_value = "mojo/balance_bin")] - kernel: String, - }, - /// Evaluate 4-lane SIMD drive and humanity vectors via the Mojo balance kernel + /// Evaluate drive versus humanity tension via the native balance kernel + Balance { drive: f64, humanity: f64 }, + /// Evaluate 4-lane drive and humanity vectors (each side summed) via the native balance kernel BalanceSimd { d0: f32, d1: f32, @@ -113,8 +108,6 @@ enum Commands { h1: f32, h2: f32, h3: f32, - #[arg(long, default_value = "mojo/balance_bin")] - kernel: String, }, /// Execute unprivileged Blind Judge evaluation over candidate generation Judge { @@ -165,14 +158,12 @@ enum Commands { Cycle { #[arg(default_value = ".")] path: String, - #[arg(long, default_value = "mojo/balance_bin")] - kernel: String, #[arg(long, default_value = "http://127.0.0.1:18080")] cortex_url: String, #[arg(long, default_value = "http://127.0.0.1:18006/v1")] - max_url: String, + model_url: String, #[arg(long, default_value = "atlas-lightning-omni")] - max_model: String, + model_id: String, /// Directory with a DUAL price vector, read as a diagnostic signal only (ADR 0031 s7.5) #[arg(long)] dual_price_vector_dir: Option, @@ -191,14 +182,12 @@ enum Commands { path: String, #[arg(short, long, default_value = "60")] interval: u64, - #[arg(long, default_value = "mojo/balance_bin")] - kernel: String, #[arg(long, default_value = "http://127.0.0.1:18080")] cortex_url: String, #[arg(long, default_value = "http://127.0.0.1:18006/v1")] - max_url: String, + model_url: String, #[arg(long, default_value = "atlas-lightning-omni")] - max_model: String, + model_id: String, /// Directory with a DUAL price vector, read as a diagnostic signal only (ADR 0031 s7.5) #[arg(long)] dual_price_vector_dir: Option, @@ -226,14 +215,12 @@ enum Commands { cycles: usize, #[arg(long, default_value = "3")] candidates: usize, - #[arg(long, default_value = "mojo/balance_bin")] - kernel: String, #[arg(long, default_value = "http://127.0.0.1:18080")] cortex_url: String, #[arg(long, default_value = "http://127.0.0.1:18006/v1")] - max_url: String, + model_url: String, #[arg(long, default_value = "atlas-lightning-omni")] - max_model: String, + model_id: String, /// Signing key as hex. Other processes can read command-line arguments; prefer /// `--signing-key-file` or `RSI_SOAK_SIGNING_KEY`. #[arg(long)] @@ -355,12 +342,7 @@ async fn main() -> Result<(), Box> { println!("Author signature: {}", cfg.author_string()); println!( "Engine mode: {} ({})", - cfg.engine.mode, - if cfg.engine.mode == "max" { - "Deploy over Modular MAX (Rust/Mojo)" - } else { - &cfg.engine.api_base_url - } + cfg.engine.mode, cfg.engine.api_base_url ); } Commands::Profile => { @@ -390,12 +372,8 @@ async fn main() -> Result<(), Box> { std::process::exit(1); } } - Commands::Balance { - drive, - humanity, - kernel, - } => { - let verdict = BalanceKernel::evaluate(drive, humanity, Some(&kernel))?; + Commands::Balance { drive, humanity } => { + let verdict = BalanceKernel::evaluate(drive, humanity); println!("{}", serde_json::to_string_pretty(&verdict)?); } Commands::BalanceSimd { @@ -407,10 +385,8 @@ async fn main() -> Result<(), Box> { h1, h2, h3, - kernel, } => { - let verdict = - BalanceKernel::evaluate_simd([d0, d1, d2, d3], [h0, h1, h2, h3], Some(&kernel))?; + let verdict = BalanceKernel::evaluate_simd([d0, d1, d2, d3], [h0, h1, h2, h3]); println!("{}", serde_json::to_string_pretty(&verdict)?); } Commands::Judge { @@ -480,10 +456,9 @@ async fn main() -> Result<(), Box> { } Commands::Cycle { path, - kernel, cortex_url, - max_url, - max_model, + model_url, + model_id, dual_price_vector_dir, judge_public_key, judge_policy_file, @@ -494,15 +469,14 @@ async fn main() -> Result<(), Box> { target_repo: path, cortex_url, cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: kernel, loop_interval_secs: 60, sandbox_root: "/tmp/spark-rsi-sandbox".to_string(), rsi_root: ".rsi".to_string(), holdouts_dir: None, signing_key_hex: None, require_latency_improvement: false, - max_url, - max_model, + model_url, + model_id, canary_target: 5000, operator_key_hex: None, non_inferiority_margin: None, @@ -518,10 +492,9 @@ async fn main() -> Result<(), Box> { Commands::Daemon { path, interval, - kernel, cortex_url, - max_url, - max_model, + model_url, + model_id, dual_price_vector_dir, judge_public_key, judge_policy_file, @@ -532,15 +505,14 @@ async fn main() -> Result<(), Box> { target_repo: path, cortex_url, cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: kernel, loop_interval_secs: interval, sandbox_root: "/tmp/spark-rsi-sandbox".to_string(), rsi_root: ".rsi".to_string(), holdouts_dir: None, signing_key_hex: None, require_latency_improvement: false, - max_url, - max_model, + model_url, + model_id, canary_target: 5000, operator_key_hex: None, non_inferiority_margin: None, @@ -645,10 +617,9 @@ async fn main() -> Result<(), Box> { rsi_root, cycles, candidates, - kernel, cortex_url, - max_url, - max_model, + model_url, + model_id, signing_key_hex, signing_key_file, operator_key_hex, @@ -665,9 +636,8 @@ async fn main() -> Result<(), Box> { operator_key_hex, cortex_url, cortex_space: "atlas-memory".to_string(), - max_url, - max_model, - mojo_kernel_path: kernel, + model_url, + model_id, total_cycles: cycles, candidates_per_cycle: candidates, canary_target: 5000, diff --git a/src/measure/.crumb b/src/measure/.crumb index 5f4e234..e0a0b8e 100644 --- a/src/measure/.crumb +++ b/src/measure/.crumb @@ -3,14 +3,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-12T22:51:32Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:051db6ac64d07083f5fec412b251569f4d09cc2c8012c149ab6f93adbbcdbf0e", + "digest": "sha256:3987281b8d1386c32444fda48896d3f5cc52a798be51d2f9ca95c808646bc826", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 6, - "generated_at_commit": "0002ce08cdbfeb1770a6f1ab117203740e28e3a7", - "source_tree": "sha256:53af8a3bc6b7c442e06d67a984da87212527c935f707e7dc50f9ad9fc2d16f9d" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:9253955ce2e988b6f510d0a9a38cc49526ae8e6525da6319b50a1c750812fe34" } }, "name": "measure", diff --git a/src/measure/mod.rs b/src/measure/mod.rs index 239116b..00aea1a 100644 --- a/src/measure/mod.rs +++ b/src/measure/mod.rs @@ -23,7 +23,10 @@ pub use profile::{ExecutionConfig, ExecutionProfile, MeasureContext}; pub use select::{build_capability_graph, measure_stages, StageMeasurement}; pub use stats::{median, p95_if_sufficient, percentile_nearest_rank, validate_samples}; -pub const SCHEMA_VERSION: u32 = 1; +/// Version 2 (2026-10-15): the execution config names the endpoint `model_url` and no longer +/// carries a balance kernel path (the balance kernel is native Rust only). Version 1 logs are +/// refused by the strict reader rather than mixed with version 2 samples. +pub const SCHEMA_VERSION: u32 = 2; /// The six RSI pipeline stages, in pipeline order. These are the capability graph nodes. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] diff --git a/src/measure/profile.rs b/src/measure/profile.rs index a887104..1f71693 100644 --- a/src/measure/profile.rs +++ b/src/measure/profile.rs @@ -2,8 +2,7 @@ //! //! Effective execution configuration: the `RsiConfig` fields that change what the stages do or //! which services they call, so two cycles with different values are not comparable: -//! - `max_url` (the inference endpoint Propose calls) -//! - `mojo_kernel_path` (the balance kernel the evaluation runs) +//! - `model_url` (the inference endpoint Propose calls) //! - the effective holdouts directory (the judge's workload) //! - `canary_target` (how many canary observations the canary stage needs) //! - `cortex_url` and `cortex_space` (what CortexCommit writes to) @@ -25,8 +24,7 @@ use std::time::{Duration, Instant}; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct ExecutionConfig { - pub max_url: String, - pub mojo_kernel_path: String, + pub model_url: String, pub holdouts_dir: String, pub canary_target: u64, pub cortex_url: String, @@ -40,8 +38,7 @@ impl ExecutionConfig { ratify_roots.sort(); ratify_roots.dedup(); Self { - max_url: config.max_url.clone(), - mojo_kernel_path: config.mojo_kernel_path.clone(), + model_url: config.model_url.clone(), holdouts_dir: config .holdouts_dir .clone() @@ -55,9 +52,8 @@ impl ExecutionConfig { fn canonical(&self) -> String { format!( - "max_url={}\nmojo_kernel_path={}\nholdouts_dir={}\ncanary_target={}\ncortex_url={}\ncortex_space={}\nratify_roots={}\n", - self.max_url, - self.mojo_kernel_path, + "model_url={}\nholdouts_dir={}\ncanary_target={}\ncortex_url={}\ncortex_space={}\nratify_roots={}\n", + self.model_url, self.holdouts_dir, self.canary_target, self.cortex_url, @@ -111,7 +107,7 @@ impl ExecutionProfile { pub fn detect(config: &RsiConfig) -> Self { Self { - model: config.max_model.clone(), + model: config.model_id.clone(), execution_config: ExecutionConfig::from_config(config), cpu_count: std::thread::available_parallelism().ok().map(|n| n.get()), memory_total_kib: read_mem_total_kib("/proc/meminfo"), diff --git a/src/models.rs b/src/models.rs index cd91ebd..c00e2d2 100644 --- a/src/models.rs +++ b/src/models.rs @@ -99,7 +99,6 @@ pub struct RsiConfig { pub target_repo: String, pub cortex_url: String, pub cortex_space: String, - pub mojo_kernel_path: String, pub loop_interval_secs: u64, pub sandbox_root: String, #[serde(default = "default_rsi_root")] @@ -110,10 +109,13 @@ pub struct RsiConfig { pub signing_key_hex: Option, #[serde(default)] pub require_latency_improvement: bool, - #[serde(default = "default_max_url")] - pub max_url: String, - #[serde(default = "default_max_model")] - pub max_model: String, + /// OpenAI-compatible chat completions endpoint of the local model seat. + /// Configs written before 2026-10-15 named this `max_url`; that key is still read. + #[serde(default = "default_model_url", alias = "max_url")] + pub model_url: String, + /// Model id sent to the local model seat. Older configs named this `max_model`. + #[serde(default = "default_model_id", alias = "max_model")] + pub model_id: String, #[serde(default = "default_canary_target")] pub canary_target: u64, #[serde(default)] @@ -165,11 +167,11 @@ pub struct RsiConfig { pub canary_exempt_kinds: Vec, } -fn default_max_url() -> String { +fn default_model_url() -> String { "http://127.0.0.1:18006/v1".to_string() } -fn default_max_model() -> String { +fn default_model_id() -> String { "atlas-lightning-omni".to_string() } @@ -203,15 +205,14 @@ impl Default for RsiConfig { target_repo: ".".to_string(), cortex_url: "http://127.0.0.1:18080".to_string(), cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), loop_interval_secs: 60, sandbox_root: "/tmp/spark-rsi-sandbox".to_string(), rsi_root: ".rsi".to_string(), holdouts_dir: None, signing_key_hex: None, require_latency_improvement: false, - max_url: default_max_url(), - max_model: default_max_model(), + model_url: default_model_url(), + model_id: default_model_id(), canary_target: 5000, operator_key_hex: None, non_inferiority_margin: None, @@ -312,3 +313,24 @@ pub struct RsiCycleResult { #[serde(default)] pub canary: Option, } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn config_written_with_the_old_endpoint_keys_still_loads() { + let old = serde_json::json!({ + "target_repo": ".", "cortex_url": "http://127.0.0.1:18080", "cortex_space": "s", + "mojo_kernel_path": "mojo/balance_bin", "loop_interval_secs": 60, + "sandbox_root": "/tmp/spark-rsi-sandbox", + "max_url": "http://127.0.0.1:9/v1", "max_model": "old-model" + }); + let cfg: RsiConfig = serde_json::from_value(old).unwrap(); + assert_eq!(cfg.model_url, "http://127.0.0.1:9/v1"); + assert_eq!(cfg.model_id, "old-model"); + let new = serde_json::to_value(&cfg).unwrap(); + assert!(new.get("model_url").is_some() && new.get("max_url").is_none()); + assert!(new.get("mojo_kernel_path").is_none()); + } +} diff --git a/src/propose/.crumb b/src/propose/.crumb index 4508929..bcaa985 100644 --- a/src/propose/.crumb +++ b/src/propose/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-12T22:16:40Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:2787d4e51f830933e8b7fba886623e1d188195b69f9526afda54fe6f0ac8a8b2", + "digest": "sha256:9c8d3e6d776c9b3e906c92247ba63bf4b577518899198bd0376f341b7d382868", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 6, - "generated_at_commit": "b13ea46cda2213475ab1066e1e357f96e3145e8e", - "source_tree": "sha256:af36e2329808bcfc240625fc89aad1328a3618d51f08904c29763b0f42475464" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:c6b4c01c582d20eec21bb27ea223ad77d1ff901d2f3e47c64f1323dbe8a7a93c" }, "owner_lane": "", "seed": { @@ -23,7 +23,7 @@ "diagnose.rs", "hypothesis.rs", "kernel_autotune.rs", - "max_client.rs", + "model_seat.rs", "mod.rs" ], "purpose_auto": "Directory src/propose. Purpose not yet described by a human." diff --git a/src/propose/mod.rs b/src/propose/mod.rs index c60f70f..ff0cbab 100644 --- a/src/propose/mod.rs +++ b/src/propose/mod.rs @@ -2,13 +2,13 @@ pub mod cortex; pub mod diagnose; pub mod hypothesis; pub mod kernel_autotune; -pub mod max_client; +pub mod model_seat; pub use cortex::CortexExperienceClient; pub use diagnose::{DefectCategory, DiagnosticContext}; pub use hypothesis::{HypothesisContract, ProtectedMetric}; pub use kernel_autotune::{KernelAutotuneManager, PagedAttentionConfig}; -pub use max_client::{ChatMessage, MaxClient}; +pub use model_seat::{ChatMessage, ModelSeatClient}; use crate::models::{ImprovementProposal, ProposalKind}; use std::fs; @@ -118,9 +118,9 @@ impl ProposalGenerator { trimmed.to_string() } - /// Generates a proposal by prompting MAX with a diagnostic context + /// Generates a proposal by prompting the local model seat with a diagnostic context pub async fn propose_from_diagnosis( - max_client: &MaxClient, + model_seat: &ModelSeatClient, diag: &DiagnosticContext, ) -> Result { let (sys, user) = diag.build_prompts(); @@ -135,14 +135,14 @@ impl ProposalGenerator { }, ]; - let raw_completion = max_client + let raw_completion = model_seat .complete(&messages, 1536, 0.2) .await - .map_err(|e| format!("MAX diagnosis proposal generation failed: {}", e))?; + .map_err(|e| format!("Model seat diagnosis proposal generation failed: {}", e))?; let cleaned_patch = Self::extract_code_block(&raw_completion); if cleaned_patch.is_empty() { - return Err("MAX generated an empty patch".to_string()); + return Err("Model seat generated an empty patch".to_string()); } // Validate unslop invariant on generated patch @@ -153,7 +153,7 @@ impl ProposalGenerator { return Ok(Self::create_proposal( &format!("resolve {:?} in {}", diag.primary_defect, diag.target_file), &format!( - "Automated MAX repair with unslop sanitization for cycle {}", + "Automated model seat repair with unslop sanitization for cycle {}", diag.cycle_id ), &diag.target_file, @@ -164,7 +164,7 @@ impl ProposalGenerator { Ok(Self::create_proposal( &format!("resolve {:?} in {}", diag.primary_defect, diag.target_file), - &format!("Automated MAX repair for cycle {}", diag.cycle_id), + &format!("Automated model seat repair for cycle {}", diag.cycle_id), &diag.target_file, &cleaned_patch, ProposalKind::InvariantFix, diff --git a/src/propose/max_client.rs b/src/propose/model_seat.rs similarity index 86% rename from src/propose/max_client.rs rename to src/propose/model_seat.rs index 1abcd54..b95a3c3 100644 --- a/src/propose/max_client.rs +++ b/src/propose/model_seat.rs @@ -1,3 +1,6 @@ +//! Client for the local model seat: any OpenAI-compatible chat completions endpoint +//! (by AIEN convention, 127.0.0.1:18006/v1 on the Spark). + use serde::{Deserialize, Serialize}; use std::time::Duration; @@ -43,13 +46,13 @@ pub struct ChatCompletionResponse { } #[derive(Debug, Clone)] -pub struct MaxClient { +pub struct ModelSeatClient { pub base_url: String, pub model_id: String, client: reqwest::Client, } -impl MaxClient { +impl ModelSeatClient { pub fn new(base_url: &str, model_id: &str) -> Self { let client = reqwest::Client::builder() .timeout(Duration::from_secs(360)) @@ -98,23 +101,23 @@ impl MaxClient { .json(&req) .send() .await - .map_err(|e| format!("MAX completion request failed: {}", e))?; + .map_err(|e| format!("Model seat completion request failed: {}", e))?; if !resp.status().is_success() { let status = resp.status(); let body = resp.text().await.unwrap_or_default(); - return Err(format!("MAX endpoint returned HTTP {}: {}", status, body)); + return Err(format!("Model seat returned HTTP {}: {}", status, body)); } let body: ChatCompletionResponse = resp .json() .await - .map_err(|e| format!("Failed to parse MAX response: {}", e))?; + .map_err(|e| format!("Failed to parse model seat response: {}", e))?; let choice = body .choices .first() - .ok_or_else(|| "MAX response returned empty choices array".to_string())?; + .ok_or_else(|| "Model seat response returned an empty choices array".to_string())?; let content = choice.message.content.as_deref().unwrap_or_default().trim(); @@ -136,7 +139,7 @@ impl MaxClient { } } return Err( - "MAX assistant message did not emit code output (exhausted in reasoning)" + "Model seat assistant message did not emit code output (exhausted in reasoning)" .to_string(), ); } diff --git a/src/soak/.crumb b/src/soak/.crumb index d3b6ca8..7f13505 100644 --- a/src/soak/.crumb +++ b/src/soak/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-12T22:51:32Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:92e2857b467c0740b5987d46fc90cf8eb1ce78dfc8079cf8e67aa494142322f7", + "digest": "sha256:233ca920c4a0952157d5fe254657bbb5c8efde53639e6c5d4e3181d90fd1a99d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 3, - "generated_at_commit": "0002ce08cdbfeb1770a6f1ab117203740e28e3a7", - "source_tree": "sha256:7abae82b2c0d2868bd06d66749ae33673fdca060f6d4fbfddbfed67a2a8be037" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:c0de29f23b38843c6e3d2410f027c69c743b0436231945ecfb7194dabf20e6cc" }, "owner_lane": "", "seed": { diff --git a/src/soak/manifest.rs b/src/soak/manifest.rs index d6b57b2..e57b0c9 100644 --- a/src/soak/manifest.rs +++ b/src/soak/manifest.rs @@ -53,7 +53,9 @@ pub struct EngineNSnapshot { pub evaluator_version: String, pub holdout_bundle_digest: String, pub builder_digest: String, - pub max_model: String, + /// Records written before 2026-10-15 named this `max_model`; that key is still read. + #[serde(alias = "max_model")] + pub model_id: String, pub cortex_snapshot_ref: String, pub operator_verifying_key: Option, } diff --git a/src/soak/runner.rs b/src/soak/runner.rs index 3c62ae6..03efa47 100644 --- a/src/soak/runner.rs +++ b/src/soak/runner.rs @@ -8,7 +8,7 @@ use crate::meta::TrueRsiEvaluator; use crate::models::{ImprovementProposal, ProposalKind, RsiConfig}; use crate::observe::observe_codebase; use crate::propose::{ - cortex::CortexExperienceClient, max_client::MaxClient, DefectCategory, DiagnosticContext, + cortex::CortexExperienceClient, model_seat::ModelSeatClient, DefectCategory, DiagnosticContext, HypothesisContract, ProposalGenerator, }; use crate::ratify::Ratifier; @@ -30,9 +30,8 @@ pub struct SoakConfig { pub operator_key_hex: Option, pub cortex_url: String, pub cortex_space: String, - pub max_url: String, - pub max_model: String, - pub mojo_kernel_path: String, + pub model_url: String, + pub model_id: String, pub total_cycles: usize, pub candidates_per_cycle: usize, pub canary_target: usize, @@ -51,9 +50,8 @@ impl Default for SoakConfig { operator_key_hex: None, cortex_url: "http://127.0.0.1:18080".to_string(), cortex_space: "atlas-memory".to_string(), - max_url: "http://127.0.0.1:18006/v1".to_string(), - max_model: "atlas-lightning-omni".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), + model_url: "http://127.0.0.1:18006/v1".to_string(), + model_id: "atlas-lightning-omni".to_string(), total_cycles: 5, candidates_per_cycle: 3, canary_target: 5000, @@ -76,12 +74,11 @@ fn measure_config(config: &SoakConfig) -> RsiConfig { target_repo: config.target_repo.clone(), cortex_url: config.cortex_url.clone(), cortex_space: config.cortex_space.clone(), - mojo_kernel_path: config.mojo_kernel_path.clone(), sandbox_root: config.sandbox_root.clone(), rsi_root: config.rsi_root.clone(), holdouts_dir: config.holdouts_dir.clone(), - max_url: config.max_url.clone(), - max_model: config.max_model.clone(), + model_url: config.model_url.clone(), + model_id: config.model_id.clone(), canary_target: config.canary_target as u64, non_inferiority_margin: config.non_inferiority_margin, ..RsiConfig::default() @@ -99,7 +96,7 @@ impl SoakRunner { // Step 1: Capture Engine N Snapshot let engine_n_snapshot = Self::capture_engine_n( repo_path, - &config.max_model, + &config.model_id, config.operator_key_hex.as_deref(), ); @@ -158,7 +155,7 @@ impl SoakRunner { let mut admitted_candidates = Vec::new(); let mut total_candidates_evaluated = 0; let mut total_candidates_admitted = 0; - let max_client = MaxClient::new(&config.max_url, &config.max_model); + let model_seat = ModelSeatClient::new(&config.model_url, &config.model_id); // Step 5: Execute Autonomous Bounded Cycles for cycle_index in 1..=config.total_cycles { @@ -255,7 +252,7 @@ impl SoakRunner { let mut maybe_prop = None; - if max_client.is_available().await { + if model_seat.is_available().await { let variation_directive = match cand_idx { 1 => "Candidate variation 1 of 3: Focus on algorithmic simplification and data locality.", 2 => "Candidate variation 2 of 3: Focus on loop unrolling and branch prediction efficiency.", @@ -276,7 +273,7 @@ impl SoakRunner { .with_hypothesis(hypothesis.clone()); if let Ok(prop) = - ProposalGenerator::propose_from_diagnosis(&max_client, &diag).await + ProposalGenerator::propose_from_diagnosis(&model_seat, &diag).await { maybe_prop = Some(prop); } @@ -431,8 +428,7 @@ impl SoakRunner { let balance_verdict = BalanceKernel::evaluate( codebase_obs.soul_tension.drive_score, codebase_obs.soul_tension.humanity_score, - Some(&config.mojo_kernel_path), - )?; + ); let is_balanced = balance_verdict.verdict == "balanced"; if !inv_report.passed || !is_balanced { @@ -710,11 +706,7 @@ impl SoakRunner { Ok(manifest) } - fn capture_engine_n( - repo_path: &Path, - max_model: &str, - op_key: Option<&str>, - ) -> EngineNSnapshot { + fn capture_engine_n(repo_path: &Path, model_id: &str, op_key: Option<&str>) -> EngineNSnapshot { let commit_sha = Command::new("git") .current_dir(repo_path) .args(["rev-parse", "HEAD"]) @@ -729,7 +721,7 @@ impl SoakRunner { evaluator_version: spark_rsi::version().to_string(), holdout_bundle_digest: "sha256:holdouts-bundle-authoritative".to_string(), builder_digest: "sha256:spark-rsi-builder-pinned".to_string(), - max_model: max_model.to_string(), + model_id: model_id.to_string(), cortex_snapshot_ref: Utc::now().to_rfc3339(), operator_verifying_key: op_key.map(|s| s.to_string()), } diff --git a/tests/.crumb b/tests/.crumb index 39723f0..c81e77b 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -20,14 +20,14 @@ } ], "children_root": "sha256:a6c18c6294a85bde71f89f696b37a874e108047d675fd269ed94b769c9018a99", - "compiled_at": "2026-10-14T01:16:51Z", + "compiled_at": "2026-10-15T11:19:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:79e6d50ce3e598dcb6cb3ec760d1f0e7abefb2a6058caaf3ce67512905942a34", + "digest": "sha256:30c845c034c5cf6b169571ef17f873588d261edcf3480e0f25290b935a94f798", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 29, - "generated_at_commit": "a051483636e8b1e7f76415398fbdb91999efb4c1", - "source_tree": "sha256:b1aeb7d54b3d671234cd30d1524fe275e9d06e1651321117a396817cc2a00104" + "generated_at_commit": "3887fe48faf5231278e409070312d7093bd9db8e", + "source_tree": "sha256:29d90e5337657cc97a9152dce32ad135d15b5139f03b1f5974c1b212ba34b4fa" }, "owner_lane": "", "seed": { @@ -38,8 +38,8 @@ "test_capability_graph_and_hypothesis.rs", "test_cryptographic_improvement_ledger.rs", "test_host_supervisor_ipc.rs", - "test_max_inference_and_diagnosis.rs", "test_meta_improvement_governance.rs", + "test_model_seat_inference_and_diagnosis.rs", "test_no_synthetic_trust_inputs.rs", "test_objective_evaluator.rs", "test_ratifier_branch_only.rs", diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index d346f0d..6219a3d 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -7,21 +7,19 @@ use std::fs; use std::path::Path; #[test] -fn test_mojo_balance_kernel_scalar() { - let kernel_path = "mojo/balance_bin"; - let verdict = - BalanceKernel::evaluate(12.0, 10.0, Some(kernel_path)).expect("Evaluation should succeed"); +fn test_balance_kernel_scalar() { + let verdict = BalanceKernel::evaluate(12.0, 10.0); + assert_eq!(verdict.kernel, "rust"); assert_eq!(verdict.verdict, "balanced"); assert!(verdict.score > 0.7); } #[test] -fn test_mojo_balance_kernel_simd() { - let kernel_path = "mojo/balance_bin"; +fn test_balance_kernel_simd() { let drive_vec = [10.0, 8.0, 7.0, 9.0]; let human_vec = [9.0, 8.0, 8.0, 8.0]; - let verdict = BalanceKernel::evaluate_simd(drive_vec, human_vec, Some(kernel_path)) - .expect("SIMD evaluation should succeed"); + let verdict = BalanceKernel::evaluate_simd(drive_vec, human_vec); + assert_eq!(verdict.mode, "vector"); assert_eq!(verdict.verdict, "balanced"); assert_eq!(verdict.drive, 34.0); assert_eq!(verdict.humanity, 33.0); @@ -133,7 +131,6 @@ async fn test_rsi_cycle_execution() { target_repo: ".".to_string(), cortex_url: "http://127.0.0.1:18080".to_string(), cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), loop_interval_secs: 60, sandbox_root: tmp.path().join("sandbox").display().to_string(), rsi_root: rsi_root.display().to_string(), @@ -141,7 +138,7 @@ async fn test_rsi_cycle_execution() { signing_key_hex: Some(signing_key_hex), require_latency_improvement: false, canary_target: 3, - max_url: "http://127.0.0.1:9999/v1".to_string(), + model_url: "http://127.0.0.1:9999/v1".to_string(), non_inferiority_margin: Some(150.0), ..Default::default() }; @@ -233,7 +230,7 @@ async fn test_production_loop_end_to_end_with_candidate() { let test_repo = tmp.path().join("test_repo"); std::fs::create_dir_all(&test_repo).unwrap(); - // Copy complete source tree to test_repo including Cargo.lock, README.md, docs, mojo + // Copy complete source tree to test_repo including Cargo.lock, README.md, docs std::process::Command::new("cp") .args(&[ "-r", @@ -241,7 +238,6 @@ async fn test_production_loop_end_to_end_with_candidate() { "Cargo.lock", "README.md", "src", - "mojo", "docs", test_repo.to_str().unwrap(), ]) @@ -289,7 +285,6 @@ async fn test_production_loop_end_to_end_with_candidate() { target_repo: test_repo.display().to_string(), cortex_url: "http://127.0.0.1:18080".to_string(), cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), loop_interval_secs: 60, sandbox_root: tmp.path().join("sandbox").display().to_string(), rsi_root: rsi_root.display().to_string(), @@ -297,7 +292,7 @@ async fn test_production_loop_end_to_end_with_candidate() { signing_key_hex: Some(signing_key_hex), require_latency_improvement: false, canary_target: 5, - max_url: "http://127.0.0.1:9999/v1".to_string(), + model_url: "http://127.0.0.1:9999/v1".to_string(), non_inferiority_margin: Some(150.0), ..Default::default() }; diff --git a/tests/test_capability_graph_and_hypothesis.rs b/tests/test_capability_graph_and_hypothesis.rs index f6d6429..703be0b 100644 --- a/tests/test_capability_graph_and_hypothesis.rs +++ b/tests/test_capability_graph_and_hypothesis.rs @@ -1,7 +1,7 @@ use spark_rsi::graph::{CapabilityGraph, CapabilityNode}; use spark_rsi::propose::diagnose::{DefectCategory, DiagnosticContext}; use spark_rsi::propose::hypothesis::HypothesisContract; -use spark_rsi::propose::max_client::MaxClient; +use spark_rsi::propose::model_seat::ModelSeatClient; use spark_rsi::propose::ProposalGenerator; #[test] @@ -25,7 +25,7 @@ fn test_capability_graph_topology_and_bottleneck_detection() { .unwrap(), ); graph.add_node( - CapabilityNode::new("mojo_kernel", "Mojo Blackwell GEMM Kernel", "compute") + CapabilityNode::new("gemm_kernel", "Blackwell GEMM Kernel", "compute") .with_measured_latency(1800.0, None, 0.01, 5) .unwrap(), ); @@ -38,8 +38,8 @@ fn test_capability_graph_topology_and_bottleneck_detection() { // Define dataflow dependencies graph.add_edge("req_gateway", "scheduler", 100.0, 1.0); graph.add_edge("scheduler", "kv_allocator", 500.0, 1.0); - graph.add_edge("kv_allocator", "mojo_kernel", 1200.0, 1.0); - graph.add_edge("mojo_kernel", "sampler", 200.0, 1.0); + graph.add_edge("kv_allocator", "gemm_kernel", 1200.0, 1.0); + graph.add_edge("gemm_kernel", "sampler", 200.0, 1.0); let centrality = graph.calculate_betweenness_centrality(); assert!(centrality.contains_key("kv_allocator")); @@ -149,10 +149,10 @@ async fn test_diagnosis_prompt_includes_hypothesis_directive() { } #[tokio::test] -async fn test_live_max_generates_patch_satisfying_hypothesis() { - let max = MaxClient::new("http://127.0.0.1:18006/v1", "atlas-lightning-omni"); - if !max.is_available().await { - eprintln!("Skipping live MAX hypothesis test: endpoint not reachable"); +async fn test_live_model_seat_generates_patch_satisfying_hypothesis() { + let seat = ModelSeatClient::new("http://127.0.0.1:18006/v1", "atlas-lightning-omni"); + if !seat.is_available().await { + eprintln!("Skipping live model seat hypothesis test: endpoint not reachable"); return; } @@ -177,9 +177,9 @@ async fn test_live_max_generates_patch_satisfying_hypothesis() { ) .with_hypothesis(contract); - let proposal = ProposalGenerator::propose_from_diagnosis(&max, &diag) + let proposal = ProposalGenerator::propose_from_diagnosis(&seat, &diag) .await - .expect("MAX should successfully generate patch satisfying hypothesis"); + .expect("The model seat should successfully generate patch satisfying hypothesis"); assert_eq!(proposal.target_file, "src/buffer.rs"); assert!( diff --git a/tests/test_cryptographic_improvement_ledger.rs b/tests/test_cryptographic_improvement_ledger.rs index 94c8ca3..2e15c23 100644 --- a/tests/test_cryptographic_improvement_ledger.rs +++ b/tests/test_cryptographic_improvement_ledger.rs @@ -323,7 +323,6 @@ async fn test_daemon_run_cycle_records_provenance_to_ledger() { target_repo: repo_dir.to_str().unwrap().to_string(), cortex_url: "http://127.0.0.1:18080".to_string(), cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), loop_interval_secs: 60, sandbox_root: sandbox_dir.to_str().unwrap().to_string(), rsi_root: ".rsi".to_string(), @@ -331,7 +330,7 @@ async fn test_daemon_run_cycle_records_provenance_to_ledger() { signing_key_hex: Some(signing_key_hex), require_latency_improvement: false, non_inferiority_margin: Some(250.0), - max_url: "http://127.0.0.1:9".to_string(), + model_url: "http://127.0.0.1:9".to_string(), ..Default::default() }; diff --git a/tests/test_m1_measurement.rs b/tests/test_m1_measurement.rs index 7db2f61..4038796 100644 --- a/tests/test_m1_measurement.rs +++ b/tests/test_m1_measurement.rs @@ -16,7 +16,7 @@ use std::time::Duration; fn profile(config: &RsiConfig) -> ExecutionProfile { ExecutionProfile { - model: config.max_model.clone(), + model: config.model_id.clone(), execution_config: ExecutionConfig::from_config(config), cpu_count: Some(20), memory_total_kib: Some(128 * 1024 * 1024), @@ -457,9 +457,9 @@ fn log_is_strict_but_skips_a_torn_trailing_line_and_drops_it_on_append() { ))); // Unknown fields and other schema versions are refused too. - let mut v2 = record(&c, "cycle-v2", [1; 6]); - v2.schema_version = 2; - assert!(log.append_complete(&v2).is_err()); + let mut other = record(&c, "cycle-other", [1; 6]); + other.schema_version = SCHEMA_VERSION + 1; + assert!(log.append_complete(&other).is_err()); std::fs::write(&path, b"{\"schema_version\":1,\"extra\":true}\n").unwrap(); assert!(log.read_complete().is_err()); } @@ -480,7 +480,7 @@ fn workload_key_and_fingerprint_follow_the_documented_fields() { // Model and execution configuration change both. let mut model = base.clone(); - model.max_model = "another-model".into(); + model.model_id = "another-model".into(); assert_ne!(ctx(&model).workload_key, c.workload_key); assert_ne!(ctx(&model).fingerprint, c.fingerprint); let mut exec = base.clone(); @@ -571,7 +571,7 @@ async fn a_completed_cycle_appends_one_record_to_the_sample_log() { rsi_root: rsi_root.display().to_string(), holdouts_dir: Some(holdouts.display().to_string()), signing_key_hex: Some(hex::encode(key.to_bytes())), - max_url: "http://127.0.0.1:9999/v1".to_string(), + model_url: "http://127.0.0.1:9999/v1".to_string(), non_inferiority_margin: Some(150.0), ..Default::default() }; diff --git a/tests/test_max_inference_and_diagnosis.rs b/tests/test_model_seat_inference_and_diagnosis.rs similarity index 86% rename from tests/test_max_inference_and_diagnosis.rs rename to tests/test_model_seat_inference_and_diagnosis.rs index 8b5cc01..db6b146 100644 --- a/tests/test_max_inference_and_diagnosis.rs +++ b/tests/test_model_seat_inference_and_diagnosis.rs @@ -3,15 +3,17 @@ use spark_rsi::evaluator::EvaluationReceipt; use spark_rsi::models::ProposalKind; use spark_rsi::propose::cortex::CortexExperienceClient; use spark_rsi::propose::diagnose::{DefectCategory, DiagnosticContext}; -use spark_rsi::propose::max_client::{ChatMessage, MaxClient}; +use spark_rsi::propose::model_seat::{ChatMessage, ModelSeatClient}; use spark_rsi::propose::ProposalGenerator; #[tokio::test] -async fn test_max_client_availability_and_completion() { - let client = MaxClient::new("http://127.0.0.1:18006/v1", "atlas-lightning-omni"); +async fn test_model_seat_availability_and_completion() { + let client = ModelSeatClient::new("http://127.0.0.1:18006/v1", "atlas-lightning-omni"); let is_avail = client.is_available().await; if !is_avail { - eprintln!("Skipping live MAX availability test: service not reachable on port 18006"); + eprintln!( + "Skipping live model seat availability test: service not reachable on port 18006" + ); return; } @@ -29,7 +31,7 @@ async fn test_max_client_availability_and_completion() { let resp = client .complete(&messages, 256, 0.0) .await - .expect("MAX completion failed"); + .expect("Model seat completion failed"); assert!( resp.contains("PONG"), "Expected PONG in completion, got: {}", @@ -114,10 +116,10 @@ async fn test_cortex_experience_client_query() { } #[tokio::test] -async fn test_propose_from_diagnosis_live_max() { - let max = MaxClient::new("http://127.0.0.1:18006/v1", "atlas-lightning-omni"); - if !max.is_available().await { - eprintln!("Skipping live MAX test: service not running"); +async fn test_propose_from_diagnosis_live_model_seat() { + let seat = ModelSeatClient::new("http://127.0.0.1:18006/v1", "atlas-lightning-omni"); + if !seat.is_available().await { + eprintln!("Skipping live model seat test: service not running"); return; } @@ -130,7 +132,7 @@ async fn test_propose_from_diagnosis_live_max() { vec!["Verify operator signs in arithmetic functions".to_string()], ); - let proposal = ProposalGenerator::propose_from_diagnosis(&max, &diag) + let proposal = ProposalGenerator::propose_from_diagnosis(&seat, &diag) .await .expect("Failed to generate proposal from diagnosis"); diff --git a/tests/test_no_synthetic_trust_inputs.rs b/tests/test_no_synthetic_trust_inputs.rs index 8086620..1decd84 100644 --- a/tests/test_no_synthetic_trust_inputs.rs +++ b/tests/test_no_synthetic_trust_inputs.rs @@ -363,7 +363,6 @@ fn make_target(with_adapter: bool, pin: Option<&str>) -> Target { target_repo: repo.to_str().unwrap().to_string(), cortex_url: "http://127.0.0.1:18080".to_string(), cortex_space: "atlas-memory".to_string(), - mojo_kernel_path: "mojo/balance_bin".to_string(), loop_interval_secs: 60, sandbox_root: sandbox.to_str().unwrap().to_string(), rsi_root: ".rsi".to_string(), @@ -371,7 +370,7 @@ fn make_target(with_adapter: bool, pin: Option<&str>) -> Target { signing_key_hex: Some(hex::encode(signing_key.to_bytes())), require_latency_improvement: false, non_inferiority_margin: Some(250.0), - max_url: "http://127.0.0.1:9".to_string(), + model_url: "http://127.0.0.1:9".to_string(), canary_target: 10, canary_workload_sha256: Some(pin.map(str::to_string).unwrap_or(digest)), ..Default::default() diff --git a/tests/test_objective_evaluator.rs b/tests/test_objective_evaluator.rs index c72b24d..a2f0959 100644 --- a/tests/test_objective_evaluator.rs +++ b/tests/test_objective_evaluator.rs @@ -93,9 +93,8 @@ fn test_six_layer_evaluator_end_to_end() { ); assert!(security.passed); - let style = StyleLayer::evaluate_text( - "Direct systems programming in Rust and Mojo. Zero unslop violations.", - ); + let style = + StyleLayer::evaluate_text("Direct systems programming in Rust. Zero unslop violations."); assert!(style.passed); let parent_lat: Vec = (0..30).map(|i| 100.0 + (i as f64) * 0.5).collect(); diff --git a/tests/test_soak_run.rs b/tests/test_soak_run.rs index 41f96ed..79ddb04 100644 --- a/tests/test_soak_run.rs +++ b/tests/test_soak_run.rs @@ -51,13 +51,13 @@ fn test_thermal_snapshot_and_engine_snapshot() { evaluator_version: "0.1.0".to_string(), holdout_bundle_digest: "sha256:holdouts-bundle-v1".to_string(), builder_digest: "sha256:spark-rsi-builder-pinned".to_string(), - max_model: "atlas-lightning-omni".to_string(), + model_id: "atlas-lightning-omni".to_string(), cortex_snapshot_ref: "2026-09-19T00:00:00Z".to_string(), operator_verifying_key: Some("04aabbcc...".to_string()), }; assert_eq!(engine_n.commit_sha, "abc123def456"); - assert_eq!(engine_n.max_model, "atlas-lightning-omni"); + assert_eq!(engine_n.model_id, "atlas-lightning-omni"); } #[test] @@ -70,7 +70,7 @@ fn test_soak_manifest_serialization_and_roundtrip() { evaluator_version: "0.1.0".to_string(), holdout_bundle_digest: "digest-1".to_string(), builder_digest: "digest-2".to_string(), - max_model: "atlas-lightning-omni".to_string(), + model_id: "atlas-lightning-omni".to_string(), cortex_snapshot_ref: "now".to_string(), operator_verifying_key: None, }; ```