Problem
LogseqIndentationError is defined and tested for hierarchy placement (tests/test_exceptions.py) but is never raised by StackMachineParser. Misaligned bullets are silently floored to the nearest indent level (test_misaligned_indentation_floors_to_nearest_level).
Operators and integrators cannot opt into fail-fast parsing for corrupted vault indentation.
Proposed Solution
- Add
strict_indent: bool = False to StackMachineParser (or wire LogseqIndentationError to an existing strict flag)
- When enabled, raise
LogseqIndentationError on non-monotonic indent jumps that today are coerced
- Document behavior in
ARCHITECTURE.md and logseq_ast_primer.md
- Table-driven tests in
tests/test_logos_parser.py
Context
Reserved exception surfaced during local code study (wave 9). Aligns with docs/roadmaps/ROADMAP_ROBUSTNESS_AND_SOFT_BREAKS.md tension between lenient vs strict modes.
Out of scope
- Changing default lenient behavior (breaking change)
Definition of Done
- Opt-in strict mode with tests
make all passes
CHANGELOG.md entry under [Unreleased] if behavior is user-visible
Problem
LogseqIndentationErroris defined and tested for hierarchy placement (tests/test_exceptions.py) but is never raised byStackMachineParser. Misaligned bullets are silently floored to the nearest indent level (test_misaligned_indentation_floors_to_nearest_level).Operators and integrators cannot opt into fail-fast parsing for corrupted vault indentation.
Proposed Solution
strict_indent: bool = FalsetoStackMachineParser(or wireLogseqIndentationErrorto an existing strict flag)LogseqIndentationErroron non-monotonic indent jumps that today are coercedARCHITECTURE.mdandlogseq_ast_primer.mdtests/test_logos_parser.pyContext
Reserved exception surfaced during local code study (wave 9). Aligns with
docs/roadmaps/ROADMAP_ROBUSTNESS_AND_SOFT_BREAKS.mdtension between lenient vs strict modes.Out of scope
Definition of Done
make allpassesCHANGELOG.mdentry under[Unreleased]if behavior is user-visible