Parent
#176
What to build
Add the user-facing string sentinel declaration surface to ProfileConfig and thread it through to StructuralProfileResult so Phase 2 can read declared sentinels from the profile without holding a config reference.
ProfileConfig (profiling/_config.py):
- Add
string_sentinels: dict[str, list[str]] field with default empty dict
- Update
to_dict() to serialize the field
- Update
from_dict() to restore it (missing key → empty dict, for backwards compatibility)
- Update the class docstring to document the new parameter
StructuralProfileResult (profiling/_config.py):
- Add
string_sentinels: dict[str, list[str]] field with default empty dict
StructuralProfiler.profile() copies profile_config.string_sentinels into the result when building it
Acceptance criteria
Blocked by
None — can start immediately
Parent
#176
What to build
Add the user-facing string sentinel declaration surface to
ProfileConfigand thread it through toStructuralProfileResultso Phase 2 can read declared sentinels from the profile without holding a config reference.ProfileConfig(profiling/_config.py):string_sentinels: dict[str, list[str]]field with default empty dictto_dict()to serialize the fieldfrom_dict()to restore it (missing key → empty dict, for backwards compatibility)StructuralProfileResult(profiling/_config.py):string_sentinels: dict[str, list[str]]field with default empty dictStructuralProfiler.profile()copiesprofile_config.string_sentinelsinto the result when building itAcceptance criteria
ProfileConfig.string_sentinelsfield exists, defaults to{}ProfileConfig.to_dict()includes thestring_sentinelskeyProfileConfig.from_dict()restoresstring_sentinels; a dict without the key defaults to{}StructuralProfileResult.string_sentinelsfield exists, defaults to{}StructuralProfiler.profile()copiesprofile_config.string_sentinelsonto the returnedStructuralProfileResultProfileConfigwith no sentinels declared serializes and deserializes identically to the current behaviourBlocked by
None — can start immediately