reports.deletion_report

reports.deletion_report(spec, name)

Fowler’s deletion test for one unit, as Markdown.

The report lists the blast radius (declared consumers plus every file that references the unit, operational and human dependents included), the intent items with their evaluation and provenance coverage, and a verdict. It is the markdown of deletion_test.

Parameters

Name Type Description Default
spec RegenSpec The loaded spec. required
name str Dotted module name, or its unique suffix ("forecasting.level"). required

Returns

Name Type Description
str str The Markdown report.

Raises

Name Type Description
KeyError If name matches no unit or more than one.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from spotregen import deletion_report, load_spec, make_sample_repo

with TemporaryDirectory() as tmp:
    spec = load_spec(make_sample_repo(Path(tmp) / "demo"))
    print(deletion_report(spec, "core.calc"))
# Deletion test: samplepkg.core.calc

File `src/samplepkg/core/calc.py`, pace fast, risk low.

## Blast radius

| consumer | kind | declared | note |
|---|---|---|---|
| `docs/guide.qmd` | doc | yes | teaches add |
| `src/samplepkg/app/main.py` | code | yes | sums values with add |
| `tests/test_regen_eval_calc.py` | test | yes | evaluation |

## Knowledge outside the implementation

| intent | evaluations | decisions |
|---|---|---|
| C-1 | 1 | why-add |

Verdict: regenerable. 1 intent items, all evaluated; 3 dependents, all declared.