Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ PR_DESCRIPTION.md
*.tmp
tmp/
temp/
terrain-parity-gate
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,60 @@ Repository scan → Signal detection → Risk scoring → Snapshot → Reporting
```

See [DESIGN.md](DESIGN.md) for the full architecture overview, [docs/architecture/](docs/architecture/) for detailed design documents, and the [CLI spec](docs/cli-spec.md) for the complete command reference.

## Parity gate (lifting maturity uniformly)

Terrain enforces a **parity gate** so no functional area drifts behind
the others. The gate measures every shipping area against a 17-axis
rubric (7 product / 7 engineering / 3 UI/visual). Per-pillar floors
apply:

| Pillar | Floor | Block release? |
|--------|-------|----------------|
| Gate | every cell ≥ 4 | yes |
| Understand | every cell ≥ 3 | yes |
| Align | every cell ≥ 3 | soft (warn-only) |

### How to lift a cell in your PR

1. Find the cell you're improving in `docs/release/parity/scores.yaml`.
2. Update the score (1–5) and replace the evidence line with a
one-line pointer to the change you're making (file:line, test
name, or short rationale).
3. If your change touches the audit doc's narrative,
`docs/release/0.2.x-maturity-audit.md` updates in the same PR.
4. Run `make pillar-parity` locally — your change should move at
least one cell; CI will compare the diff.

### Source-of-truth split

- **Structural** rubric (areas, axes, level definitions, floors,
uniformity gates): `docs/release/parity/rubric.yaml`. Changes
rarely; anything that moves cells around or redefines what "3"
means lives here.
- **Per-cell scores**: `docs/release/parity/scores.yaml`. Changes
every parity-lift PR. The shape is `area_id → axis_id → {score,
evidence}`.
- **Human-readable companion**: `docs/release/0.2.x-maturity-audit.md`.
Same data, prose form. Update both together.

### Local commands

```bash
make pillar-parity # full matrix + per-pillar verdict
make pillar-parity-floor # compact: just the floor map
make pillar-parity-json # JSON for tooling
```

Exit codes: `0` if every hard-gate pillar is at or above its floor
(soft warns are OK), `1` if any hard-gate pillar is below its floor,
`2` for usage errors (missing files, malformed YAML).

### Uniformity gates

In addition to per-cell floors, the rubric defines seven uniformity
gates that catch *unevenness* across detectors / frameworks /
commands / outputs (e.g. "every detector has the same eight required
fields", "every Tier-1 framework reaches the same axis floor"). These
are tracked as advisory in 0.2.0 and become hard gates in 0.2.x. See
the `uniformity_gates` block in `rubric.yaml`.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,23 @@ docs-gen:
docs-verify:
@scripts/docs-verify.sh

# ── Parity gate ────────────────────────────────────────────
# Reads docs/release/parity/{rubric,scores}.yaml and emits the
# pillar-parity matrix + verdict. Exits non-zero when any pillar
# is below its hard-gate floor (Gate ≥ 4, Understand ≥ 3 in 0.2.0).
# Soft gates (Align in 0.2.0) print a WARN banner but do not fail.
# Source-of-truth doc is `docs/release/0.2.x-maturity-audit.md`.
pillar-parity:
@go run ./cmd/terrain-parity-gate

# JSON form for CI integration / external tooling.
pillar-parity-json:
@go run ./cmd/terrain-parity-gate --json

# Compact form: per-area + per-pillar floor map only.
pillar-parity-floor:
@go run ./cmd/terrain-parity-gate --floor-map

# ── Calibration corpus ──────────────────────────────────────
# Runs the engine pipeline against every fixture under tests/calibration/
# and prints precision/recall per detector. Today a smoke gate (advisory
Expand Down
Loading
Loading