Skip to content

Commit 6d8c95b

Browse files
authored
Merge pull request #10 from rodrigooler/q2-devnet
Q2 devnet
2 parents d672713 + 6c98d7d commit 6d8c95b

67 files changed

Lines changed: 8124 additions & 1403 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
.gitignore
3+
**/.DS_Store
4+
**/target
5+
**/.pytest_cache
6+
**/.mypy_cache
7+
**/.venv
8+
**/node_modules
9+
**/.next

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Keep generated deploy artifacts out of language stats noise when present.
2+
target/** linguist-generated

.github/workflows/python-tests.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
1414

1515
- name: Set up Python
16-
id: setup-python
17-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
1817
with:
1918
python-version: '3.11'
19+
cache: 'pip'
20+
cache-dependency-path: |
21+
poc/requirements-dev.txt
22+
poc/requirements.txt
2023
21-
- name: Cache pip downloads
22-
uses: actions/cache@v4
24+
- name: Restore Python venv cache
25+
id: cache-python-venv
26+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
2327
with:
24-
path: ~/.cache/pip
25-
key: ${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('poc/requirements.txt', 'poc/requirements-dev.txt') }}
26-
restore-keys: |
27-
${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-pip-
28+
path: .venv
29+
key: ${{ runner.os }}-py311-venv-${{ hashFiles('poc/requirements-dev.txt', 'poc/requirements.txt') }}
2830

2931
- name: Install dependencies
32+
if: steps.cache-python-venv.outputs.cache-hit != 'true'
3033
run: |
34+
python -m venv .venv
35+
. .venv/bin/activate
3136
python -m pip install --upgrade pip
3237
pip install --prefer-binary -r poc/requirements-dev.txt
3338
3439
- name: Run test suite
35-
run: pytest poc/tests/ -v
40+
run: .venv/bin/pytest poc/tests/ -v

.github/workflows/q2-validate.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Q2 Validate
2+
3+
on:
4+
push:
5+
branches: [main, q2-devnet]
6+
pull_request:
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
14+
15+
- name: Setup Python
16+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
17+
with:
18+
python-version: "3.11"
19+
cache: "pip"
20+
cache-dependency-path: |
21+
poc/requirements-dev.txt
22+
poc/requirements.txt
23+
24+
- name: Restore Python venv cache
25+
id: cache-python-venv
26+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
27+
with:
28+
path: .venv
29+
key: ${{ runner.os }}-py311-venv-${{ hashFiles('poc/requirements-dev.txt', 'poc/requirements.txt') }}
30+
31+
- name: Setup Rust
32+
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
33+
with:
34+
toolchain: stable
35+
36+
- name: Restore Rust cache
37+
uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db
38+
with:
39+
workspaces: |
40+
runtime/cognitive -> runtime/cognitive/target
41+
programs/raxion-poiq -> programs/raxion-poiq/target
42+
proofs -> proofs/target
43+
sdk/agent -> sdk/agent/target
44+
45+
- name: Install Python deps
46+
if: steps.cache-python-venv.outputs.cache-hit != 'true'
47+
run: |
48+
python -m venv .venv
49+
. .venv/bin/activate
50+
python -m pip install --upgrade pip
51+
pip install --prefer-binary -r poc/requirements-dev.txt
52+
53+
- name: Python tests
54+
run: |
55+
.venv/bin/pytest poc/tests/ -q
56+
57+
- name: Runtime cognitive tests
58+
run: |
59+
cargo test --manifest-path runtime/cognitive/Cargo.toml
60+
61+
- name: PoIQ program tests
62+
run: |
63+
cargo test --manifest-path programs/raxion-poiq/Cargo.toml
64+
65+
- name: RISC0 types tests
66+
run: |
67+
cargo test -p risc0-types --manifest-path proofs/Cargo.toml
68+
69+
- name: Coherence cross-validation
70+
run: |
71+
.venv/bin/python scripts/cross_validate_coherence.py
72+
73+
- name: SDK examples
74+
run: |
75+
cargo build --manifest-path sdk/agent/Cargo.toml --example math_agent --example code_agent --example text_agent
76+
77+
- name: Setup Node
78+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
79+
with:
80+
node-version: "20"
81+
cache: "npm"
82+
cache-dependency-path: apps/explorer/package-lock.json
83+
84+
- name: Explorer build
85+
run: |
86+
cd apps/explorer
87+
npm ci --prefer-offline --no-audit --fund=false
88+
npm run build

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,51 @@ __pycache__/
44
.env
55
venv/
66
.venv/
7+
.venv*/
8+
.python-version
9+
.uv-cache/
710
*.egg-info/
811
dist/
912
.pytest_cache/
1013

1114
# Rust
1215
target/
16+
.cargo-home/
17+
.cargo-target/
18+
runtime/agave/
19+
**/Cargo.lock
1320

1421
# Data
1522
poc/data/*.jsonl
1623
poc/data/*.parquet
1724
poc/benchmarks/results/
25+
!poc/benchmarks/results/
26+
poc/benchmarks/results/*
27+
!poc/benchmarks/results/mmlu_100_q2_baseline.json
1828

1929
# IDE
2030
.idea/
2131
.vscode/
2232
*.swp
33+
node_modules/
34+
apps/explorer/.next/
35+
apps/explorer/out/
36+
**/package-lock.json
37+
!apps/explorer/package-lock.json
2338

2439
# OS
2540
.DS_Store
2641
Thumbs.db
2742
Desktop.ini
43+
44+
# Secrets / Wallets
45+
*.pem
46+
*.key
47+
*.seed
48+
*.mnemonic
49+
**/.env.local
50+
**/.env.*.local
51+
**/id.json
52+
**/*-keypair.json
53+
**/wallet*.json
54+
**/keypair*.json

AGENTS.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ The core innovation is **Cognitive Finality**: zk-ML proofs that make a collecti
1818

1919
```
2020
raxion/
21-
├── runtime/ # Neural SVM — fork of Agave (Solana runtime)
21+
├── apps/
22+
│ ├── explorer/ # Devnet explorer (Next.js)
23+
│ └── site/ # Static website
24+
25+
├── ops/
26+
│ ├── docker/ # Pinned container images/toolchains
27+
│ └── config/
28+
│ └── deploy/ # Deployment env templates
29+
30+
├── runtime/ # Neural SVM extensions (Agave base fetched on demand)
2231
│ ├── cognitive/
2332
│ │ ├── account_types.rs # CognitiveAccount, NativeMemoryAccount structs
2433
│ │ ├── scheduler.rs # CognitiveScheduler — parallel thread dispatch
@@ -97,7 +106,7 @@ A result has Cognitive Finality when:
97106
VERIFY(π_exec × 3) = ACCEPT
98107
∧ VERIFY(π_quality) = ACCEPT
99108
∧ CoherenceScore ≥ 0.60
100-
∧ commit(output, π_poiq, slot) ∈ Solana_L1
109+
∧ commit(output, π_poiq, slot) ∈ Solana settlement layer
101110
```
102111

103112
This is the only valid definition. Do not treat any intermediate state as final.
@@ -114,12 +123,12 @@ This is the only valid definition. Do not treat any intermediate state as final.
114123

115124
| Phase | Status | In Scope |
116125
|---|---|---|
117-
| **Phase 0 — Genesis** (Q1 2026) | 🟡 Active | Whitepaper, Python PoC, RISC Zero basic integration |
118-
| **Phase 1 — Devnet** (Q2–Q3 2026) | 🔜 Next | Agave fork, PoIQ v0.1, Agent SDK v0.1 |
126+
| **Phase 0 — Genesis** (Q1 2026) | ✅ Completed | Whitepaper, Python PoC, RISC Zero basic integration |
127+
| **Phase 1 — Devnet** (Q2–Q3 2026) | 🟡 Active | Agave integration, PoIQ v0.1, Agent SDK v0.1 |
119128
| **Phase 2 — Testnet** (Q4 2026) | 🔜 Planned | GPU proofs, all PoIQ layers, RaxLang v0.1 |
120129
| **Phase 3 — Mainnet v1** (2027) | 🔜 Planned | ZK ASICs, full protocol, $RAX live |
121130

122-
**Current phase is Phase 0.** Do not implement Mainnet features during Phase 0. The PoC does not need ZK proofs — it needs to validate convergence.
131+
**Current phase is Phase 1 (Devnet).** Do not implement Testnet/Mainnet-only features in this stage.
123132

124133
---
125134

Anchor.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[toolchain]
2+
3+
[features]
4+
resolution = true
5+
skip-lint = false
6+
7+
[programs.devnet]
8+
raxion_poiq = "5JVFMV1DvhQD6Tm2BtPBs8zkvGArzRGUYF6GSNw2XUeT"
9+
10+
[registry]
11+
url = "https://api.apr.dev"
12+
13+
[provider]
14+
cluster = "Devnet"
15+
wallet = "~/.config/solana/id.json"
16+
17+
[scripts]
18+
test = "anchor test"

CLAUDE.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Project Identity
88

9-
**RAXION** is a sovereign Layer-1 blockchain (Sovereign SVM Rollup on Solana) that proves AI inference quality mathematically — replacing human subjective consensus with cryptographic proofs.
9+
**RAXION** is a Sovereign SVM Rollup settled on Solana that proves AI inference quality mathematically — replacing human subjective consensus with cryptographic proofs.
1010

1111
**Core thesis**: Bittensor's failure is not an implementation problem. It is an axiom problem. Any system with a human in the inference evaluation loop inherits the Oracle Problem. RAXION removes the human entirely.
1212

@@ -16,15 +16,15 @@
1616

1717
## Current Phase
1818

19-
**Phase 0Genesis (Q1 2026)**
19+
**Phase 1Devnet (Q2 2026)**
2020

2121
Active work:
22-
- Whitepaper v1.0 complete ✅
23-
- Python PoC: validate convergence between 2 architectures on 100+ queries
24-
- RISC Zero: basic proof-of-execution for simple model
25-
- Repository setup with contributor-ready issues
22+
- PoIQ v0.1 on-chain path and deterministic challenge flow
23+
- Runtime cognitive extensions and SDK stabilization
24+
- RISC Zero embedding commitment path validation
25+
- Devnet explorer hardening and deployment flow
2626

27-
**Do not** ask Claude to implement Agave fork, on-chain programs, or token mechanics yet. Those are Phase 1 (Q2 2026).
27+
**Do not** ask Claude to implement Testnet/Mainnet-only scope (GPU proving, full 6 challenge categories, TGE tokenomics) yet.
2828

2929
---
3030

@@ -43,6 +43,11 @@ Read this before asking "why didn't you just...":
4343
| No optimistic assumptions | Cognitive consequences are irreversible; 7-day challenge windows allow harmful propagation | Optimistic rollup-style contestation |
4444
| Jolt for quality proofs | 10–100x faster than RISC Zero for matrix operations / embedding similarity | RISC Zero for everything |
4545
| α=0.4, β=0.6 weighting | Causal coherence is more robust than surface embedding similarity | Equal weighting |
46+
| Agent stake PDA derivation is fixed | Prevents arbitrary stake injection in slashing paths; Anchor enforces seeds/owner constraints | Free-form external stake account input |
47+
| Stake source-of-truth is protocol stake PDA | Financial math must use synchronized protocol-owned state; scheduler cache is non-canonical | CognitiveAccount cache or SPL token account as slash source |
48+
| `chronic_multiplier_milli` derived on-chain | Removes client-controlled slashing amplification vector; bounded deterministic behavior | Client-provided chronic multiplier |
49+
| `is_final` depends on challenge lifecycle | Enforces that challenged inferences are not final until verified pass | Marking final immediately when score ≥0.60 |
50+
| Q2 completion requires anti-manipulation invariants | Events alone are insufficient; deterministic challenge + stake constraints + on-chain derivation are mandatory | Declaring completion by happy-path event output |
4651

4752
---
4853

@@ -102,8 +107,8 @@ consensus in decentralized AI with Proof of Inference Quality (PoIQ).
102107
103108
Context files: AGENTS.md (repo structure + invariants), CLAUDE.md (this), MEMORY.md (decisions).
104109
105-
Current phase: Phase 0 (Q1 2026) — Python PoC + basic RISC Zero integration.
106-
Next milestone: Devnet Q2 2026.
110+
Current phase: Phase 1 (Q2 2026) — Devnet implementation and validation.
111+
Next milestone: Testnet preparation (Q3/Q4 2026).
107112
108113
Key files:
109114
- Whitepaper: docs/whitepaper/RAXION_Whitepaper_v1.0_EN.md
@@ -201,7 +206,7 @@ Use this test fixture for CoherenceScore validation:
201206

202207
| Term | Definition |
203208
|---|---|
204-
| **Cognitive Finality** | State where a zk-ML proof is valid and committed to Solana L1 — immutable |
209+
| **Cognitive Finality** | State where a zk-ML proof is valid and committed to Solana settlement layer — immutable |
205210
| **CoherenceScore** | 0.4×CS_semantic + 0.6×CC — epistemic coherence among 3 architectures |
206211
| **Cognition Thread** | Atomic unit of parallel inference — one architecture, one query, one partial proof |
207212
| **Cognitive Scheduler** | Decomposes queries into DAGs of parallel threads |
@@ -212,7 +217,7 @@ Use this test fixture for CoherenceScore validation:
212217
| **π_quality** | Quality proof — Jolt proof of CoherenceScore computation |
213218
| **π_poiq** | Aggregated final proof = AGGREGATE(π_exec×3, π_quality) |
214219
| **Dissent Queue** | Holding area for high-confidence divergent outputs awaiting challenge |
215-
| **Sovereign SVM Rollup** | Neural SVM executes independently; commits state roots to Solana L1 |
220+
| **Sovereign SVM Rollup** | Neural SVM executes independently; commits state roots to Solana settlement layer |
216221

217222
---
218223

CONTRIBUTING.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ By participating in this project, you agree to abide by our [Code of Conduct](./
3737

3838
### Prerequisites
3939

40+
- Python 3.11+ with `uv`
4041
- Rust 1.75+ (for core protocol)
41-
- Node.js 20+ (for tooling)
42-
- Solana CLI tools
43-
- Anchor CLI (for Solana programs)
4442

4543
### Building
4644

@@ -49,14 +47,17 @@ By participating in this project, you agree to abide by our [Code of Conduct](./
4947
git clone https://github.com/rodrigooler/raxion.git
5048
cd raxion
5149

50+
# Python environment (PoC)
51+
uv venv --python 3.11 .venv
52+
source .venv/bin/activate
53+
uv pip sync poc/requirements-dev.txt
54+
5255
# Build core (Rust)
5356
cargo build
5457

5558
# Run tests
5659
cargo test
57-
58-
# Build Solana programs
59-
anchor build
60+
uv run pytest poc/tests/ -v
6061
```
6162

6263
---
@@ -106,6 +107,20 @@ Open an issue with the `enhancement` label describing:
106107
- [ ] Documentation is updated
107108
- [ ] Commit messages follow guidelines
108109
- [ ] PR title follows conventional commits
110+
- [ ] No third-party source tree was vendored into this repository
111+
112+
### Repository Hygiene (Required)
113+
114+
- Do not commit upstream third-party source code (for example `runtime/agave` as a subtree copy).
115+
- Use on-demand bootstrap scripts instead:
116+
- `./scripts/fetch_agave.sh` for pinned Agave checkout
117+
- `./scripts/apply_rust_toolchain_patches.sh` for local cargo compatibility patches
118+
- Keep generated artifacts out of git:
119+
- benchmark outputs in `poc/benchmarks/results/`
120+
- build outputs in `target/`
121+
- Keep contribution focused on RAXION first-party code (`runtime/cognitive`, `programs/`, `sdk/`, `poc/`, `proofs/`).
122+
- Frontend contributions live in `apps/explorer` and `apps/site`.
123+
- Operational/deploy changes live in `ops/` and `scripts/`.
109124

110125
---
111126

0 commit comments

Comments
 (0)