Problem
Setting settings.validation: error on a schema does not enforce anything: a note missing a required field still validates with passed: true, warning_count: 1, error_count: 0. Observed during the development MCP acceptance run mcp-acceptance-20260810T031527Z (schemas phase FAIL) against cloud revision 28213b84 / core 940acff6, and reproducible from the code alone.
Root cause
The validation mode is a stringly-typed open value with no boundary validation, and unknown modes silently behave as warn:
src/basic_memory/picoschema/parser.py:309 (and resolver.py:89): validation_mode = settings.get("validation", "warn") — accepts any string verbatim into a field documented only by comment as "warn" | "strict" | "off" (parser.py:55).
src/basic_memory/picoschema/validator.py:105/113/130: escalation to errors happens only on the literal validation_mode == "strict"; every other value — including error — falls into the warnings branch.
So validation: error (a natural spelling a user or runbook reaches for) is silently accepted and silently unenforced. For a validation setting, silent lenience on an unrecognized mode is the worst failure direction.
Fix direction (Constructive Domain Modeling)
Model the mode as a closed vocabulary constructed at the boundary:
validation_mode becomes a closed type (Literal["warn", "strict", "off"] / parsed enum), not str.
- The parser rejects unknown values explicitly — a schema declaring
validation: banana (or error, if not adopted) surfaces a parse/validation error on the schema itself instead of silently degrading.
- Product decision inside the fix: either accept
error as a documented alias of strict (it is the spelling the acceptance runbook and at least one user-facing flow used), or reject it with a message naming the accepted values. Pick one canonical vocabulary and align docs/runbook.
Acceptance criteria
Problem
Setting
settings.validation: erroron a schema does not enforce anything: a note missing a required field still validates withpassed: true,warning_count: 1,error_count: 0. Observed during the development MCP acceptance runmcp-acceptance-20260810T031527Z(schemas phase FAIL) against cloud revision28213b84/ core940acff6, and reproducible from the code alone.Root cause
The validation mode is a stringly-typed open value with no boundary validation, and unknown modes silently behave as
warn:src/basic_memory/picoschema/parser.py:309(andresolver.py:89):validation_mode = settings.get("validation", "warn")— accepts any string verbatim into a field documented only by comment as"warn" | "strict" | "off"(parser.py:55).src/basic_memory/picoschema/validator.py:105/113/130: escalation toerrorshappens only on the literalvalidation_mode == "strict"; every other value — includingerror— falls into thewarningsbranch.So
validation: error(a natural spelling a user or runbook reaches for) is silently accepted and silently unenforced. For a validation setting, silent lenience on an unrecognized mode is the worst failure direction.Fix direction (Constructive Domain Modeling)
Model the mode as a closed vocabulary constructed at the boundary:
validation_modebecomes a closed type (Literal["warn", "strict", "off"]/ parsed enum), notstr.validation: banana(orerror, if not adopted) surfaces a parse/validation error on the schema itself instead of silently degrading.erroras a documented alias ofstrict(it is the spelling the acceptance runbook and at least one user-facing flow used), or reject it with a message naming the accepted values. Pick one canonical vocabulary and align docs/runbook.Acceptance criteria
passed: falsewitherror_count >= 1.settings.validationvalue is rejected at schema parse/definition time with the accepted vocabulary named — never silently treated aswarn.warnandoffbehaviors are unchanged and pinned by tests.