Skip to content

Add diary replies - #11

Merged
rivertam merged 1 commit into
mainfrom
add-diary-replies
Aug 9, 2026
Merged

Add diary replies#11
rivertam merged 1 commit into
mainfrom
add-diary-replies

Conversation

@rivertam

@rivertam rivertam commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Diary replies on canonical entries

Adds an optional Reply Target to canonical EntryContent, using the extension seams introduced by the foundation PR instead of creating reply-specific transport, queue, or compatibility models.

Behavior

  • Only synced Device Entries expose the reply action. Pending and failed rows have predicted ids, but those ids cannot be selected as Reply Targets.
  • The synced-only rule is enforced in shared Rust markup, JavaScript state transitions, and a defensive click guard.
  • Replies work through both the local-first wasm queue and the plain form POST fallback.
  • A Reply Target is a validated permalink-shaped soft reference. The target row need not exist, so missing or deleted history does not invalidate the reply.
  • Presentation stays intentionally shallow: the reply action, compose banner, parent line, and permalink-detail parent link.

Narrow change surface

  • EntryContent owns reply_to, normalization, validation, equality, and fingerprint identity.
  • The shared projection adds the field once; typed content writes carry it through persistence, collision placement, dedupe, reconciliation, rekeys, HTTP, direct sync, and wasm without reply-specific mapping.
  • One epoch-2 server migration and one epoch-2 device migration add the optional field while preserving existing body-only rows and local CAS tokens.
  • Shared views, the strict server form parser, and page JavaScript implement the behavior users see.

There is no reply-specific production logic in the outbox, store queries, sync sequencer, worker exports, service worker, collision placement, flush report, or acknowledgement path. Changes in those modules are fixtures, comments, and regression tests only.

Migration and rollout safety

  • There are no v1/v2 wire DTOs, historical adapters, per-row versions, or version-filtered business queries.
  • CURRENT_SCHEMA_EPOCH advances to 2; HTTP and direct sync require that exact current shape.
  • Explicit epoch-1 and future direct sessions are denied after migration.
  • The bounded claimless bridge can see and create top-level entries only, never reply content.
  • Existing body-only server and device rows migrate in place with no Reply Target.
  • Cached epoch-1 wasm refuses the epoch-2 device ledger while holding the same store lock used by all local operations.

Verified

  • just check — 325 application tests and 83 diary-core tests, plus the server library and command suites
  • just wasm
  • just build
  • JavaScript syntax checks for the page and service worker
  • Real SurrealDB migration and restricted-session permission tests for current, stale, future, and claimless sessions
  • Independent contract and migration audits with no blocking findings

Base automatically changed from diary-rust-worker to main August 8, 2026 22:20
Co-authored-by: Cursor <cursoragent@cursor.com>
@rivertam
rivertam force-pushed the add-diary-replies branch from 2cfdac9 to 215096f Compare August 8, 2026 23:12
@rivertam
rivertam merged commit 72052ac into main Aug 9, 2026
1 check passed
@rivertam
rivertam deleted the add-diary-replies branch August 9, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant