ADR-058: Models by section¶
Status¶
Accepted.
Decision¶
obelize.models is a package of six modules, each importing only the ones before it in this
table, and its __init__ re-exports every name they define. No import path and no committed JSON
Schema changed when models.py became this package.
| Module | Holds |
|---|---|
vocabulary.py |
Every closed vocabulary: the Literals, the sets derived from them and the tables beside them |
fields.py |
The string types and validators the models share, and the frozen base they inherit |
scan.py |
Finding, Binding, Edit, EditProposal, the pack's ScanSpec, ImpactPlan, ManifestPlan and the findings document |
config.py |
Config and the verification and model settings under it |
verify.py |
A verification phase and the commands it ran |
run.py |
The plan, run, model, proposal and undo documents |
Consequences¶
models.pyheld 2,425 lines, which no reader could take in. A new vocabulary goes invocabulary.py, a new document inscan.pyorrun.py, and a new module here needs its own ADR like any other.- A private name lives with its only user (
_loopbackinconfig.py) or, shared, infields.py. - The vocabularies are still held equal to SCAN_VOCABULARY.md,
RUN_FOLDER.md and CLI.md by
tests/unit/test_models.pyand the tests beside it, which import every name fromobelize.models. python src/obelize/schemas/generate.pywrites the same bytes as before the split.