instar 1.3.369 → 1.3.370

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +9 -0
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +3 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/CoherenceJournal.d.ts +12 -1
  8. package/dist/core/CoherenceJournal.d.ts.map +1 -1
  9. package/dist/core/CoherenceJournal.js +38 -2
  10. package/dist/core/CoherenceJournal.js.map +1 -1
  11. package/dist/core/JournalSyncApplier.d.ts.map +1 -1
  12. package/dist/core/JournalSyncApplier.js +16 -0
  13. package/dist/core/JournalSyncApplier.js.map +1 -1
  14. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  15. package/dist/core/PostUpdateMigrator.js +16 -0
  16. package/dist/core/PostUpdateMigrator.js.map +1 -1
  17. package/dist/scaffold/templates.d.ts.map +1 -1
  18. package/dist/scaffold/templates.js +4 -0
  19. package/dist/scaffold/templates.js.map +1 -1
  20. package/dist/server/routes.d.ts.map +1 -1
  21. package/dist/server/routes.js +27 -0
  22. package/dist/server/routes.js.map +1 -1
  23. package/dist/threadline/ConversationMeshView.d.ts +50 -0
  24. package/dist/threadline/ConversationMeshView.d.ts.map +1 -0
  25. package/dist/threadline/ConversationMeshView.js +78 -0
  26. package/dist/threadline/ConversationMeshView.js.map +1 -0
  27. package/dist/threadline/ConversationStore.d.ts +17 -0
  28. package/dist/threadline/ConversationStore.d.ts.map +1 -1
  29. package/dist/threadline/ConversationStore.js +52 -0
  30. package/dist/threadline/ConversationStore.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/data/builtin-manifest.json +63 -63
  33. package/src/scaffold/templates.ts +4 -0
  34. package/upgrades/1.3.370.md +38 -0
  35. package/upgrades/side-effects/threadline-conversation-kind-p3.md +83 -0
@@ -0,0 +1,83 @@
1
+ # Side-Effects Review — Threadline Conversation Coherence build (P3.1 + P3.2 surfaces)
2
+
3
+ **Version / slug:** `threadline-conversation-kind-p3`
4
+ **Date:** `2026-06-06`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required (implements the 2-round-converged P3 spec; a 4th journal kind riding P1's proven transport; content-free by typed schema; read-only view)`
7
+
8
+ ## Summary of the change
9
+
10
+ THREADLINE-CONVERSATION-COHERENCE-SPEC (converged 2026-06-06, merged in
11
+ #924) — every machine can answer "which machine holds each A2A
12
+ conversation, and is it bound to a topic?" from local disk:
13
+
14
+ 1. The 4th journal kind `threadline-conversation` — the spec's honest
15
+ "compiler-guided multi-site edit" performed in full: JournalKind union,
16
+ JOURNAL_KINDS, 6 Record literals (nextSeq/highWaterSeq/opKeys/retention
17
+ merge/rateBuckets/persistMeta), the typed validate() branch
18
+ (action/conversationId/peerFingerprint/topicId? — free text
19
+ structurally excluded, 256-char id bounds), the opKeyOf branch
20
+ ((conversationId, action, topicId?) — conversationId lives in data,
21
+ the round-1 finding), the emitThreadlineConversation emitter, AND the
22
+ JournalSyncApplier.validateData mirror branch (without which the
23
+ receive side suspect-flags the sender). DEFAULT_RETENTION +
24
+ ConfigDefaults literal (8MiB × keep 8; applyDefaults backfills).
25
+ 2. ConversationStore: the lifecycle emission as a prev/next TRANSITION
26
+ DIFF inside commit() — the store's single write funnel — on `state` +
27
+ `boundTopicId` ONLY (message appends/lastActivity bumps emit NOTHING);
28
+ terminal set = resolved/failed/archived (the real enum);
29
+ setCoherenceJournalSeam + one wiring line at the store's construction
30
+ (journal in scope; emit drops harmlessly when absent/locked-out).
31
+ 3. NEW route GET /threadline/conversations (?scope=mesh) + the
32
+ ConversationMeshView fold: OWN rows from the LIVE store (the
33
+ authority — own-stream journal entries ignored), replica rows folded
34
+ per-stream last-writer on the composite (holderMachineId,
35
+ conversationId) key under the P1 reader's bounds, with staleness +
36
+ streamStatus + partial-result honesty. 200 with own rows when
37
+ replication is dark; 503 only when the store itself is absent.
38
+ 4. Agent Awareness on ALL THREE surfaces (template + migrateClaudeMd +
39
+ shadow markers + featureSections tracking): the holder-view trigger
40
+ including the relay's REAL offline bound (in-memory ~24h queue) in the
41
+ honest-answer wording.
42
+
43
+ ## Decision-point inventory
44
+
45
+ - Transition derivation: first-commit → started (+bound when born
46
+ bound); boundTopicId change → unbound(old)+bound(new); non-terminal →
47
+ terminal → closed. No fingerprint → no emission (nothing coherent to
48
+ record).
49
+ - The fold's `unbound` clears the binding; `closed` keeps the row with
50
+ status closed (existence stays answerable).
51
+ - Emission failure NEVER reaches the conversation write (observability
52
+ invariant; try/catch at the seam).
53
+
54
+ ## 1-2. Over/Under-block
55
+
56
+ Over: conversations without peer fingerprints never journal (deliberate).
57
+ Under: the P1.2 reader reports streamStatus 'current' always — the
58
+ gapped qualifier gains teeth with the P1.3 reader states (the spec's
59
+ named dependency); until then partial-result is the honesty signal.
60
+
61
+ ## 3. Fit / 4. Blast radius
62
+
63
+ The kind rides P1's transport/trust wholesale (proven by the integration
64
+ test reusing the journal-sync applier verbatim); the store seam is one
65
+ injected callback; the view is read-only. Emission is always-on with the
66
+ journal (like every kind); REPLICATION of it rides the existing explicit
67
+ gate. A bug can only mis-report holder visibility — nothing actuates off
68
+ this view (Signal vs Authority).
69
+
70
+ ## Evidence
71
+
72
+ - tests/unit/ThreadlineConversationKind.test.ts — 7 passing: schema
73
+ bounds + op-key dedupe; the commit() diff matrix (started/bound,
74
+ rebind unbound+bound naming the OLD topic, closed, non-lifecycle
75
+ emits NOTHING, no-fingerprint emits nothing); the fold (own-live +
76
+ replica last-writer + unbound clears + closed status + local scope).
77
+ - tests/integration/threadline-conversation-replication.test.ts — 1
78
+ passing: store lifecycle on A → journal → buildServeBatch → apply on
79
+ B under A's authenticated identity → B's mesh view names A as holder
80
+ with the binding → close converges on the next delta.
81
+ - CoherenceJournal (39 incl. the advert test updated for 4 kinds),
82
+ CoherenceJournalReader, JournalSyncApplier suites green;
83
+ feature-delivery-completeness (81) green. Typecheck clean.