Mixed Migration Strategy#
Use this pattern to migrate legacy digestion in controlled slices.
Context#
Many real libraries start with scattered validation code. A full rewrite is risky. Mixed mode allows gradual migration with minimal disruption.
Strategy#
Add
_argdigest.pywithDIGESTION_STYLE = "auto".Keep existing registry digesters active.
Introduce new package-style digesters for newly migrated arguments.
Use decorator registration for plugin/extension modules.
_argdigest.py example#
DIGESTION_SOURCE = [
"mylib._private.digestion.registry",
"mylib._private.digestion.argument",
]
DIGESTION_STYLE = "auto"
STRICTNESS = "warn"
Migration checkpoints#
Stage A: warnings are visible and triaged.
Stage B: no new legacy inline digestion is introduced.
Stage C: strictness moves from
warntoerror.
When to finish mixed mode#
Exit mixed mode when:
digestion coverage is complete,
chosen target style is stable,
migration warnings are resolved in CI.