Replace paraphrased constitution with the 1224-line master.

Copy CODING_CONSTITUTION.md from the AgentStore docs/development path and split
the seven always-on .mdc files from that exact text.
This commit is contained in:
2026-09-20 18:24:29 +02:00
parent 0533d4ebd2
commit 2f2e35e802
8 changed files with 2390 additions and 142 deletions
+87 -7
View File
@@ -2,13 +2,93 @@
alwaysApply: true
---
# Periscope Cursor Engineering Rules
# 33. RUST IS NOT A DEFAULT
Mandatory for every Cursor agent working on Periscope. This section is copied from `docs/development/CODING_CONSTITUTION.md` and must not contradict that master.
Rust must not be introduced simply because code is new.
## 3. Rust
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.
---
- Periscopes product code is Python/TypeScript today. If a Rust crate is added, it is original Periscope code, not a paste of an AGPL PinScope module.
- Rust slices follow the same verify-then-switch rule: tests first, then wire into the Python/TS surface.
- Use `rustfmt` + `clippy` on that crate. No `unsafe` without a comment that names the invariant.
- Do not introduce Rust to dodge AGPL or to empty-delete Python in `dependency/`.