Write the write-path fidelity test suite
The executable spec for BoardWriter's cross-cutting guarantees, in a dedicated WriteFidelityTests.swift: minimal-touch verified down to sibling mtimes across a seven-operation session; renumber pinned as the sole exception (whole lane rewritten, board root / other lanes / tombstones untouched); delete→restore byte-precise (only the modified line differs, zero tombstone residue); unknown-key order preserved with keys interleaved among schema-owned ones; and a composite building a board purely through the writer, hand-editing a file like an agent would, then moving/copying/deleting/renumbering to a zero-warning reload. Guarantees already pinned by the per-operation suites (atomicity, move/copy identity, body round-trip) are referenced, not duplicated. Shared fixtures promoted to WriterTestSupport.swift. README gains the write-side feature bullet. 5 new tests; 250 total green. Closes milestone m2-storage-write. Claude-Session: https://claude.ai/code/session_018BjQRYBR6jQja3jCRi5S3A
This commit is contained in:
@@ -11,6 +11,7 @@ Lanework is in early development. This list tracks what has actually shipped and
|
||||
*No UI yet — the storage foundation is in place:*
|
||||
|
||||
- **Storage contract, read side** — frontmatter engine with a byte-perfect round-trip guarantee (unknown keys, comments, and formatting survive every rewrite; duplicate keys read last-wins; wrong-type scalars coerce read-side), gapped fractional ordering (Ranks), and a fail-fast board loader with UUID-gated level detection, warning-collecting skips, and tombstone-aware snapshots — pinned by a golden fixture suite of 18 on-disk boards.
|
||||
- **Storage contract, write side** — BoardWriter turns every mutation into an atomic temp-file+rename over exactly the files it touches: creates mint lowercase-UUIDv4 identities and `.kanban` packages; moves keep the UUID (with per-folder collision repair at the cross-board import boundary); copies mint fresh identities at every level; deletes are in-place tombstones with position-perfect restore and physical purge; attachment imports never overwrite and never refuse (Finder-style renames). Every app write stamps `modified`, clears `modified-by`, and preserves everything it didn't change byte-for-byte; readable-but-uneditable frontmatter shapes refuse loudly instead of corrupting.
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user