# Objective Guard rules, states, and validations

## Decision rules

### REG-01 — `error` is not `pass`

- [Inference] A timeout, parser failure, or internal error produces unknown scope.
- [Inference] The loop can continue, but the error remains logged.

### REG-02 — Only reproducible evidence blocks deterministically

- [Inference] The finding must include rule, version, location, and reproduction.
- [Inference] Severity is applied by explicit policy.

### REG-03 — An anomaly is not an incorrectness

- [Inference] A percentile or conformal p-value expresses extremity with respect to a sample.
- [Inference] Output cannot express it as direct probability of incorrect code.

### REG-04 — Delta-only

- [Inference] An active fingerprint is not re-emitted.
- [Inference] A resolved finding can be summarized in a single line.
- [Inference] Losing state can cause repetition, never permanent silence.

### REG-05 — Output budget

- [Inference] Level 0 emits maximum five lines, descending severity, and explicit overflow.

### REG-06 — Evidence obligation by task

| Type | Minimum obligation |
| --- | --- |
| bugfix | Reproduction or regression test. |
| feature | New behavior and relevant compatibility. |
| refactor | Observable preservation. |
| improvement | Baseline and metric. |
| migration | Integrity, compatibility, and recovery. |
| investigation | Evidence and conclusion without implicit productive mutation. |

### REG-07 — Exceptions do not erase facts

- [Inference] An approval changes the current decision, not the history.
- [Ambiguity] Identity model still not defined.

### REG-08 — Statistics initially passive

- [Inference] A statistical feature without calibration is only recorded.
- [Inference] Activation requires out-of-sample generalization and placebo trial.

## States

### Session state

```text
discovery → active → verifying → completed
                 ↘ blocked
```

- `discovery`: ambiguous objective; inspection allowed, sensitive mutation warned.
- `active`: sufficient contract to work.
- `verifying`: closure in progress; criteria and final checks.
- `completed`: required criteria satisfied or validly excepted.
- `blocked`: violation exists or missing authority.

[Ambiguity] The exact transition for reopening sessions is still not defined.

### Criterion state

- `proven`: reproducible evidence satisfies the criterion.
- `violated`: evidence exists against.
- `unknown`: insufficient information or check not executed.
- `not_applicable`: explicit justified acceptance.

### Finding state

```text
new → active → resolved
          ↘ excepted → expired → active
```

- [Inference] `new` is emitted once.
- [Inference] `active` remains in complete state without automatic re-emission.
- [Inference] `resolved` appears as delta summary.
- [Inference] `excepted` preserves the finding and adds decision.

### Statistical signal state

```text
experimental → calibrated → intervention-tested → active
       ↘ rejected       ↘ suspended
```

- `experimental`: passive observation.
- `calibrated`: generalizes out of sample.
- `intervention-tested`: demonstrates net utility.
- `active`: can intervene per policy.
- `rejected`: does not exceed baselines or fails calibration.
- `suspended`: data drift or operational degradation.

## Validations

### Session contract

- Original objective present.
- Known type or `discovery`.
- Each criterion possesses stable ID.
- Scope and invariants indicate provenance.
- Policy conflicts are visible.
- Contract hash changes on any modification.

### Result

- Status belongs to allowed enum.
- Scope declared.
- New findings separated from known.
- Checks executed and omitted listed.
- Duration and version available.
- Reproduction present for deterministic blocks.

### Scientific event

- `run_id` and `step` stable.
- Timestamp and action.
- Diff hash.
- Contract hash when it exists.
- Surface without merging facts and inferences.
- Checks result.
- Append-only events.

### Documentary guard

- [Fact] `scripts/validate-docs.mjs` checks required files.
- [Fact] Checks capability contractual fields.
- [Fact] Checks matrix table and relative links.
- [Ambiguity] Does not yet verify Markdown anchors or external scientific accuracy.
