DreamLake

Localized Notes unified diffs

2026-09-25 — Cause and fix

The v2 GET /namespaces/:slug/notes/:noteId/body?contract=v2&since=...&format=diff route loads the retained source and calls generatePatch. Its unified branch explicitly emitted every old line as a deletion and every new line as an addition. Default inline-dff used the same character alignment but emitted only the actual edits. This was generation behavior, not a newline conversion, stale revision, or client display bug.

The CLI's src/cli/notes/document.ts selects the requested format and prints the returned patch verbatim (or the complete JSON response). It uses its HTTP transport directly, not the Python SDK. Python Note.read_snapshot() reads a full v2 snapshot; Note.diff(since=..., context=3) uses the separate legacy /diff endpoint and returns its patch without reformatting. Local Doc.diff() compares draft text. Neither Python path causes the v2 reproduction, and no SDK transport or revision contract change is required.

The generator now finds unchanged whole-line anchors from the bounded character alignment, trims identical edge lines from changed regions, and emits hunks with three context lines. Touching context is coalesced. It retains exact CRLF, Unicode, empty-file and missing-final-newline behavior. The parser, source hash, retained baseline, and merge/exact write paths are unchanged. Within repeated characters, per-region alignment can choose different equally valid ties from a global Myers alignment; tests require exact reconstruction and sparse edits, while explicit unchanged context remains protected.

Evidence

A read-only live reproduction returned 114 deleted and 114 added lines for one headline change. Regenerating that captured pair locally yields one hunk, @@ -8,7 +8,7 @@, with 11 patch lines and 201 UTF-8 bytes. Applying it reproduces the captured target hash exactly. No live note was patched or edited; committed regressions use synthetic fixtures only.

Server patch, isolated route, and acceptance suites pass 118 tests. Regressions cover the 114-line headline, adjacent/separate hunks, exact newline handling, seeded Unicode/repeated-text round trips, no-op results, missing bases, and independent source hashes/RTC revisions. Server TypeScript checking passes. The Python Notes/diff suites pass 119 tests; CLI fixtures pass 33 tests. CLI fixture tests verify byte-preserving text/JSON output, including CRLF, EOF markers and empty patches. The native skill packaging gate checks isolated installation/readback/update, not a public release.

The owning Notes and CLI guides recommend saved-baseline incremental reads and default inline diffs for compact agent responses. Their generated public skills are synchronized from committed source and reviewed in companion draft PRs. Those implementation checks were pre-deployment evidence. Release verification is recorded below; installed user skills are not changed automatically.

2026-09-25 — Release verification

Server PR #744 merged as ea3a8897c544b3bab83c4219b896b29738c2f866. Full server CI passed 5,090 server tests (4 skipped) and 68 migration tests, plus TypeScript. The same commit was promoted through staging to production.

Staging deployment completed on ECS revision 188. Read-only checks against a retained acceptance fixture verified both formats, exact reconstruction, hashes/revisions and empty patches. No fixture or pitch note was mutated.

Production deployment readback on ECS revision 155 confirmed the original headline reproduction now returns one 11-line, 201-byte hunk (@@ -8,7 +8,7 @@) instead of 231 lines and 5,992 bytes. Exact reconstruction matches the same content hash and RTC revision as before deployment. Inline and no-op reads also pass, and /health is healthy. Only read requests were used against live notes.

CLI #134 and #135 are merged. The live CLI guide and a freshly downloaded https://cli.dreamlake.ai/skills/dreamlake-cli.zip match the updated Notes reference. This is a server/docs release; the installed CLI already passes through the server patch and does not require a new binary.

Public skill synchronization is tracked in skills PR #35. After it merges, update a public-skills checkout with git pull. Workspace Notes docs deploy separately to the Notes guide. A source merge does not prove an installed agent's local skill changed.