# `mgf-test-supervisor` — scope policy

> This is `mgf-test-supervisor`'s **scope policy** (federation rule family **SP**).
> It governs what belongs in the federation's pytest supervisor. A proposed
> addition is in scope only if it passes the §3 gate.

## §1 In scope (SP-01)

A **stdlib-only, crash-survivable, budget-aware pytest driver** that any sibling
can run in its own environment:

- tier selection + budget knapsack (`--tier`, `--budget`)
- out-of-process pytest execution with crash/hang/timeout classification
- structured JSONL run records (the `TestRecord` schema)
- flaky-test quarantine (atomic state under `.gates/`)
- per-failure bundles + self-check
- opt-in per-test perf attribution (`--perf`)

The boundary: **anything that keeps the runner stdlib-only and able to drive
pytest as a subprocess.** mgf-common is a *dev-only* dependency (alignment-pin
verification); it is never imported at runtime (TS-23).

## §2 Out of scope (SP-02) — with reasons

| Not here | Why | Where instead |
|---|---|---|
| A test *framework* (assertions, fixtures, collection) | pytest already does this; we drive it, not replace it | `pytest` |
| Runtime dependency on mgf-common (settings/observability) | would drag a dep tree into every consumer's test env, breaking TS-23 | keep it stdlib-only |
| CI orchestration / pipeline definition | that's the consumer's `.woodpecker.yml` | Woodpecker |
| Coverage measurement engine | delegated | `coverage.py` / `pytest-cov` |
| A GUI / web dashboard for results | the runner emits JSONL; visualization is a separate concern | consumer tooling |
| Language-agnostic test running | this is a Python pytest supervisor | out of federation scope |

## §3 Scope-creep gate (SP-03)

A PR adding a module/flag/surface MUST answer in its description:
1. Does it keep the runner **stdlib-only at runtime**? (If it needs a third-party or mgf-common runtime import → rejected, violates TS-23.)
2. Is it *supervising* pytest, not re-implementing a test framework?
3. Is there a consumer demand signal (a `FEEDBACK.md` paper / a sibling's need), or is it speculative?

Any "no/unclear" blocks the addition until resolved.

## §4 Adjacent scope (SP-04)

Adjacent (plausible, not yet in): a JUnit-XML→JSONL converter for non-pytest
suites, a TUI results viewer, distributed/sharded run coordination. These move
adjacent → in only on a **documented consumer-demand signal** (a real sibling
need or `FEEDBACK.md` paper), never speculatively.

## §5 Alternatives for out-of-scope needs (SP-05)

Need something §2 excludes? Test framework → `pytest`; coverage → `coverage.py`;
runtime config/observability → that belongs in the *consumer's* app via
`mgf-common`, not in the supervisor; dashboards → build on the JSONL records.

## §6 Revisiting scope (SP-06)

Revisited at every **MAJOR** boundary (the 0.x → 1.0 line, and each later major).
Pre-1.0, scope may tighten/loosen per the §3 gate; a major bump is the checkpoint
to re-justify the whole surface against §1/§2 — and to re-affirm the stdlib-only
invariant, which is the load-bearing constraint of this library.


## Boundary — verified ownership (generated)

> Generated from the fleet-wide import matrix — the **verified** ownership boundary (who is the SOLE importer of each third-party dep across the whole federation). Regenerate with `fleet_ownership_audit.py --inject`; CI-gated against code drift by `--check`. **Do not hand-edit the block below.**

<!-- BEGIN BOUNDARY (generated by mgf-standard/scripts/fleet_ownership_audit.py --inject; do not hand-edit) -->
- **Owns (sole third-party importer, fleet-verified):** — (no exclusive third-party dep; domain/seam owner)
- **Federation deps (imports):** `mgf.common`, `mgf.test_supervisor`
<!-- END BOUNDARY -->
