Technical specification: Generalized lossless YAML engine for v0.2

Historical document from source revision 61e75e9. This plan records the work proposed at that revision; it is not current implementation guidance. Original source.

1. Goal

Extend the private mutation engine with structural mapping and sequence primitives without weakening the fail-closed and byte-preservation contract.

Dependencies: task09.md, task10.md.

2. Gap

The current engine focuses on relations, id, anchor, and string scalars. OKF v0.2 uses nested mappings and sequences, bool/int/date/datetime values, and flow forms. Touched flow nodes are currently rejected outright.

Do not patch flow style internally: atomic replacement of an entire collection value is allowed when its boundaries and ownership have been proven.

3. Private primitives

Add:

Selector routes:

A generic raw YAML path must not become a public API.

4. Fail-closed contract

Add stable error codes and source locations within bounds.

5. Files

6. Tests

All tests follow AAA.

7. Acceptance criteria

8. Out of scope

Public v0.2 operations, semantic migration, executor runtime, and generic caller-controlled SetYAML.