Copy CODING_CONSTITUTION.md from the AgentStore docs/development path and split the seven always-on .mdc files from that exact text.
95 lines
1.4 KiB
Plaintext
95 lines
1.4 KiB
Plaintext
---
|
|
alwaysApply: true
|
|
---
|
|
|
|
# 33. RUST IS NOT A DEFAULT
|
|
|
|
Rust must not be introduced simply because code is new.
|
|
|
|
Rust is justified only when there is a demonstrated engineering requirement.
|
|
|
|
Valid reasons include:
|
|
|
|
* measured performance bottleneck;
|
|
* computationally intensive geometry;
|
|
* large-scale spatial processing;
|
|
* numerical computation;
|
|
* graph processing;
|
|
* memory pressure;
|
|
* deterministic high-performance computation.
|
|
|
|
Do not use Rust speculatively.
|
|
|
|
---
|
|
|
|
# 34. MEASURE BEFORE MOVING TO RUST
|
|
|
|
Required sequence:
|
|
|
|
```text
|
|
correct implementation
|
|
↓
|
|
measurement
|
|
↓
|
|
profiling
|
|
↓
|
|
identified bottleneck
|
|
↓
|
|
Rust implementation
|
|
↓
|
|
benchmark
|
|
↓
|
|
accept/reject based on evidence
|
|
```
|
|
|
|
Do not introduce Rust based on assumptions about performance.
|
|
|
|
---
|
|
|
|
# 35. RUST BOUNDARIES MUST BE COARSE-GRAINED
|
|
|
|
Prefer:
|
|
|
|
```text
|
|
Python
|
|
↓
|
|
structured input
|
|
↓
|
|
Rust engine
|
|
↓
|
|
structured result
|
|
↓
|
|
Python
|
|
```
|
|
|
|
Avoid excessive Python ↔ Rust calls for individual operations.
|
|
|
|
Rust should encapsulate meaningful computational workloads.
|
|
|
|
---
|
|
|
|
# 36. DO NOT PREMATURELY FREEZE THE CORE IN RUST
|
|
|
|
The semantic model should first become correct and well understood.
|
|
|
|
Prefer:
|
|
|
|
```text
|
|
semantic model
|
|
↓
|
|
correctness
|
|
↓
|
|
tests
|
|
↓
|
|
architecture stabilization
|
|
↓
|
|
profiling
|
|
↓
|
|
Rust where justified
|
|
```
|
|
|
|
Do not rewrite the entire Periscope core in Rust simply to establish a Rust architecture.
|
|
|
|
---
|
|
|