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:
@@ -2,15 +2,146 @@
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Periscope Cursor Engineering Rules
|
||||
# 21. TESTING IS MANDATORY
|
||||
|
||||
Mandatory for every Cursor agent working on Periscope. This section is copied from `docs/development/CODING_CONSTITUTION.md` and must not contradict that master.
|
||||
Every meaningful implementation change requires tests.
|
||||
|
||||
## 4. Testing
|
||||
At minimum test:
|
||||
|
||||
```text
|
||||
normal case
|
||||
failure case
|
||||
boundary case
|
||||
insufficient evidence
|
||||
```
|
||||
|
||||
For semantic models, also test the boundaries between object types.
|
||||
|
||||
For PCB analysis, explicitly test:
|
||||
|
||||
```text
|
||||
Pad
|
||||
Via
|
||||
Track
|
||||
Zone
|
||||
```
|
||||
|
||||
as distinct semantic entities.
|
||||
|
||||
---
|
||||
|
||||
# 22. TESTS MUST BE STRICT AND ABSOLUTE
|
||||
|
||||
Periscope tests are not advisory.
|
||||
|
||||
A test must define the exact expected behavior.
|
||||
|
||||
Do not use vague assertions such as:
|
||||
|
||||
```text
|
||||
result is reasonable
|
||||
result is not empty
|
||||
analysis completed
|
||||
```
|
||||
|
||||
when an exact result can be established.
|
||||
|
||||
Prefer assertions such as:
|
||||
|
||||
```text
|
||||
expected object type == Via
|
||||
expected pad count == 24
|
||||
expected finding count == 0
|
||||
expected finding code == X
|
||||
expected severity == ERROR
|
||||
expected confidence == HIGH
|
||||
```
|
||||
|
||||
Where deterministic exact values are available, test them exactly.
|
||||
|
||||
Do not weaken tests merely to make an implementation pass.
|
||||
|
||||
Do not modify expected results to accommodate incorrect implementation behavior.
|
||||
|
||||
---
|
||||
|
||||
# 23. REGRESSION TEST FOR EVERY BUG
|
||||
|
||||
Every fixed bug must become a regression test.
|
||||
|
||||
Required sequence:
|
||||
|
||||
```text
|
||||
BUG
|
||||
↓
|
||||
REPRODUCE
|
||||
↓
|
||||
TEST FAILS
|
||||
↓
|
||||
FIX
|
||||
↓
|
||||
TEST PASSES
|
||||
↓
|
||||
FULL REGRESSION
|
||||
```
|
||||
|
||||
A bug fix is not complete until the original failure is permanently represented by a test.
|
||||
|
||||
---
|
||||
|
||||
# 24. TEST THE NEGATIVE CASE
|
||||
|
||||
Do not test only:
|
||||
|
||||
```text
|
||||
valid → pass
|
||||
```
|
||||
|
||||
Also test:
|
||||
|
||||
```text
|
||||
invalid → fail
|
||||
```
|
||||
|
||||
and ensure that genuine errors remain detectable.
|
||||
|
||||
For example, if fixing:
|
||||
|
||||
```text
|
||||
24 datasheet pins
|
||||
24 footprint pads
|
||||
N vias
|
||||
```
|
||||
|
||||
verify that:
|
||||
|
||||
```text
|
||||
24 datasheet pins
|
||||
23 footprint pads
|
||||
```
|
||||
|
||||
still produces a real mismatch.
|
||||
|
||||
The fix must remove false positives without suppressing true positives.
|
||||
|
||||
---
|
||||
|
||||
# 26. NO WEAKENING TESTS TO CLOSE A PHASE
|
||||
|
||||
Do not:
|
||||
|
||||
* delete failing tests;
|
||||
* weaken assertions;
|
||||
* skip tests;
|
||||
* mark tests expected-to-fail;
|
||||
* suppress failures;
|
||||
* change expected values without engineering justification;
|
||||
|
||||
simply to make a macro-phase pass.
|
||||
|
||||
If a test exposes a real implementation problem, fix the implementation.
|
||||
|
||||
If the requirement itself is wrong, change the requirement explicitly and document why.
|
||||
|
||||
---
|
||||
|
||||
- Write tests before considering a slice done. Prefer tests that lock behavior (graph topology, finding codes, via≠pad, review isolation) over tests that assert overlay stamps or file provenance comments.
|
||||
- `pytest` from the worktree with the project venv. Do not claim green from a system Python missing deps.
|
||||
- One malformed IC must not kill the whole review; keep per-IC isolation tests.
|
||||
- Do not add tests whose only job is to require `Native Periscope overlay` in a copied file.
|
||||
- UI changes: exercise the flow (not a single screenshot). If no browser tools, say what was not verified.
|
||||
- Installing docs/rules is a docs phase: existence and internal consistency of the seven `.mdc` files plus this master is the check. There is no product pytest gate for markdown-only.
|
||||
|
||||
Reference in New Issue
Block a user