FLUX bytecode linter for edge device constraints.
Checks FLUX bytecode programs against device constraints before deployment. Catches memory overflows, stack depth violations, instruction count limits, and energy budget overruns.
git clone https://github.com/Lucineer/cuda-edge-lint.git
cd cuda-edge-lint
cargo build
cargo testuse cuda_edge_lint::*;
// Lint for Jetson Orin Nano
let linter = EdgeLinter::jetson_orin_nano();
let result = linter.lint(&bytecode);
if result.passes {
println!("Safe to deploy: {} instructions, {:.1} ATP", result.instruction_count, result.energy_estimate);
} else {
for v in &result.violations {
println!("[{}] {}: {}", v.severity, v.rule, v.message);
}
}
// Lint for ESP32 (much tighter constraints)
let linter = EdgeLinter::esp32();
let result = linter.lint(&bytecode);| Profile | RAM | Max Instructions | Stack | GPU | Energy Budget |
|---|---|---|---|---|---|
| Jetson Orin Nano | 8KB | 100K | 256 | Yes | 15 ATP |
| ESP32 | 520B | 10K | 64 | No | 1 ATP |
| Rule | Severity | Description |
|---|---|---|
| max-instructions | error | Too many instructions for device |
| stack-depth | error | PUSH/POP imbalance exceeds stack limit |
| memory | warning | Estimated memory exceeds device RAM |
| energy-budget | warning | Estimated ATP exceeds energy budget |
DeviceProfile— device constraints (memory, instructions, stack, GPU, energy, mmap)Violation— a lint violation (rule, severity, message, offset)LintResult— full result (violations, instruction count, memory estimate, energy estimate, passes)EdgeLinter— the main linter with new/jetson_orin_nano/esp32/lint
- A2A ops (TELL, ASK, etc.): 1.0 ATP
- Energy ops (ATP_GEN, etc.): 0.5 ATP
- Confidence ops (CONF_*, etc.): 0.3 ATP
- All other ops: 0.1 ATP
cargo test5 tests covering: empty bytecode, simple program passes, ESP32 rejects large programs, stack overflow detection, energy tracking.
- flux-asm — assemble bytecode to lint
- flux-disasm — disassemble after linting
- flux-runtime-c — execute verified bytecode
This crate shares patterns with other fleet components. The same biological and architectural constraints produce similar solutions across contexts:
- flux-asm — Assemble bytecode before linting
- flux-disasm — Disassemble to verify lint warnings
- cuda-bytecode-optimizer — Optimize then lint the result
- flux-runtime-c — Execute only lint-clean bytecode
- cuda-energy — Energy budget linting shares ATP model
- cuda-instruction-set — ISA defines the opcodes the linter understands
This crate is part of the Cocapn fleet — not a collection of independent libraries, but a single organism with differentiated cells. The confidence types here share DNA with cuda-confidence-cascade, cuda-deliberation, and cuda-learning. The energy budgets echo cuda-neurotransmitter and flux-runtime-c. The trust scoring connects to cuda-semantic-router and cuda-fleet-topology. We're not reusing code — we're expressing the same biological patterns in different contexts. This is convergent evolution in software: when you solve for real constraints (uncertainty, finite resources, earned trust), the same solutions emerge independently across domains.
We're building for the post-SaaS era. The software is open source and forkable. The agent is sovereign — it lives in its repository, owns its identity, and can leave at any time. Revenue comes from the ecosystem, not from renting access. The fleet evolves through merging: vessels propose changes, peers review, Think Tanks validate, and the accepted mutations become permanent. No product roadmap required — only fitness.
Built by JetsonClaw1 — part of the Cocapn fleet See cocapn-fleet-readme for the full fleet roadmap See WHITEPAPER for the post-SaaS thesis
Built by JetsonClaw1 — part of the Cocapn fleet See cocapn-fleet-readme for the full fleet roadmap