trajectories 0.0.0 → 0.1.1

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 (204) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +201 -0
  3. package/README.md +274 -2
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +8542 -0
  6. package/dist/convert.d.ts +31 -0
  7. package/dist/convert.js +431 -0
  8. package/dist/index.d.ts +7 -0
  9. package/dist/index.js +8402 -0
  10. package/dist/log-baseline.d.ts +26 -0
  11. package/dist/log-baseline.js +104 -0
  12. package/dist/log-content.d.ts +16 -0
  13. package/dist/log-content.js +80 -0
  14. package/dist/log-io.d.ts +10 -0
  15. package/dist/log-io.js +121 -0
  16. package/dist/log-read.d.ts +24 -0
  17. package/dist/log-read.js +117 -0
  18. package/dist/log-reconcile.d.ts +5 -0
  19. package/dist/log-reconcile.js +38 -0
  20. package/dist/log-records.d.ts +35 -0
  21. package/dist/log-records.js +85 -0
  22. package/dist/log-recovery.d.ts +18 -0
  23. package/dist/log-recovery.js +123 -0
  24. package/dist/log-stage.d.ts +14 -0
  25. package/dist/log-stage.js +138 -0
  26. package/dist/log-state.d.ts +89 -0
  27. package/dist/log-state.js +92 -0
  28. package/dist/log-switch.d.ts +3 -0
  29. package/dist/log-switch.js +98 -0
  30. package/dist/log-types.d.ts +129 -0
  31. package/dist/log-types.js +8 -0
  32. package/dist/log.d.ts +8 -0
  33. package/dist/log.js +62 -0
  34. package/dist/migrate.d.ts +29 -0
  35. package/dist/migrate.js +173 -0
  36. package/dist/normalization-runtime.d.ts +1 -0
  37. package/dist/normalization-runtime.js +3150 -0
  38. package/dist/portable.d.ts +9 -0
  39. package/dist/portable.js +26 -0
  40. package/dist/readers/canonical.d.ts +13 -0
  41. package/dist/readers/canonical.js +54 -0
  42. package/dist/readers/cline.d.ts +10 -0
  43. package/dist/readers/cline.js +107 -0
  44. package/dist/readers/cursor.d.ts +20 -0
  45. package/dist/readers/cursor.js +374 -0
  46. package/dist/readers/deepagents.d.ts +41 -0
  47. package/dist/readers/deepagents.js +163 -0
  48. package/dist/readers/fx.d.ts +11 -0
  49. package/dist/readers/fx.js +573 -0
  50. package/dist/readers/github-copilot.d.ts +8 -0
  51. package/dist/readers/github-copilot.js +216 -0
  52. package/dist/readers/grok-build.d.ts +12 -0
  53. package/dist/readers/grok-build.js +391 -0
  54. package/dist/readers/guards.d.ts +4 -0
  55. package/dist/readers/guards.js +121 -0
  56. package/dist/readers/pi-compaction.d.ts +7 -0
  57. package/dist/readers/pi-compaction.js +112 -0
  58. package/dist/readers/pi-context.d.ts +13 -0
  59. package/dist/readers/pi-context.js +64 -0
  60. package/dist/store.d.ts +25 -0
  61. package/dist/store.js +218 -0
  62. package/dist/types.d.ts +91 -0
  63. package/dist/types.js +1 -0
  64. package/dist/writers/claude-code.d.ts +5 -0
  65. package/dist/writers/claude-code.js +51 -0
  66. package/dist/writers/cline.d.ts +3 -0
  67. package/dist/writers/cline.js +77 -0
  68. package/dist/writers/codex.d.ts +3 -0
  69. package/dist/writers/codex.js +32 -0
  70. package/dist/writers/cursor.d.ts +3 -0
  71. package/dist/writers/cursor.js +197 -0
  72. package/dist/writers/deepagents.d.ts +3 -0
  73. package/dist/writers/deepagents.js +116 -0
  74. package/dist/writers/entropy.d.ts +5 -0
  75. package/dist/writers/entropy.js +33 -0
  76. package/dist/writers/fx.d.ts +3 -0
  77. package/dist/writers/fx.js +135 -0
  78. package/dist/writers/github-copilot.d.ts +3 -0
  79. package/dist/writers/github-copilot.js +71 -0
  80. package/dist/writers/grok-build.d.ts +3 -0
  81. package/dist/writers/grok-build.js +43 -0
  82. package/dist/writers/helpers.d.ts +17 -0
  83. package/dist/writers/helpers.js +75 -0
  84. package/dist/writers/omp.d.ts +3 -0
  85. package/dist/writers/omp.js +7 -0
  86. package/dist/writers/opencode.d.ts +3 -0
  87. package/dist/writers/opencode.js +65 -0
  88. package/dist/writers/pi.d.ts +3 -0
  89. package/dist/writers/pi.js +45 -0
  90. package/docs/cline-native-format.md +43 -0
  91. package/docs/copilot-native-format.md +78 -0
  92. package/docs/cursor-native-format.md +103 -0
  93. package/docs/deepagents-native-format.md +98 -0
  94. package/docs/evidence-api.md +170 -0
  95. package/docs/fx-native-format.md +87 -0
  96. package/docs/harness-parity-bootstrap.md +78 -0
  97. package/docs/harness-support-parity.md +107 -0
  98. package/docs/inspirations.md +103 -0
  99. package/docs/ledger-migration.md +141 -0
  100. package/docs/pi-compaction-context.md +75 -0
  101. package/docs/pi-provider-context.md +76 -0
  102. package/docs/research/2026-10-06-huihua-and-oar.md +176 -0
  103. package/docs/research/ledger/README.md +96 -0
  104. package/docs/research/ledger/confer/2026-09-13-round-10/README.md +61 -0
  105. package/docs/research/ledger/confer/2026-09-13-round-2/cass.md +72 -0
  106. package/docs/research/ledger/confer/2026-09-13-round-3/README.md +70 -0
  107. package/docs/research/ledger/confer/2026-09-13-round-5/README.md +61 -0
  108. package/docs/research/ledger/confer/2026-09-13-round-6/README.md +68 -0
  109. package/docs/research/ledger/confer/2026-09-13-round-7/README.md +64 -0
  110. package/docs/research/ledger/confer/2026-09-13-round-9/README.md +59 -0
  111. package/docs/research/ledger/confer/2026-09-14-wake/wake.md +146 -0
  112. package/docs/research/ledger/docs/inspirations.md +320 -0
  113. package/docs/research/ledger/docs/pr2-pr6-integration.md +53 -0
  114. package/docs/research/ledger/docs/research/2026-09-07-confer-inspirations.md +163 -0
  115. package/docs/research/ledger/docs/research/2026-09-07-letta-continuous-service.md +104 -0
  116. package/docs/research/ledger/docs/research/2026-09-08-claude-history-retrieval.md +117 -0
  117. package/docs/research/ledger/docs/research/2026-09-09-agentsview-native-discovery.md +87 -0
  118. package/docs/research/ledger/docs/research/2026-09-09-daemon-observation.md +231 -0
  119. package/docs/research/ledger/docs/research/2026-09-09-discovery-pagination.md +114 -0
  120. package/docs/research/ledger/docs/research/2026-09-09-harness-transcript-contract.md +145 -0
  121. package/docs/research/ledger/docs/research/2026-09-09-native-history-discovery.md +180 -0
  122. package/docs/research/ledger/docs/research/2026-09-09-native-history-implementation.md +137 -0
  123. package/docs/research/ledger/docs/research/2026-09-09-other-inspirations.md +279 -0
  124. package/docs/research/ledger/docs/research/2026-09-09-trajectory-and-letta-code.md +128 -0
  125. package/docs/research/ledger/docs/research/2026-09-13-diagnostics-coverage.md +116 -0
  126. package/docs/research/ledger/docs/research/2026-09-13-fts-rebuild.md +83 -0
  127. package/docs/research/ledger/docs/research/2026-09-13-read-path-split.md +74 -0
  128. package/docs/research/ledger/docs/research/2026-09-13-runtime-rollout.md +102 -0
  129. package/docs/research/ledger/docs/research/2026-09-13-scan-outcomes.md +80 -0
  130. package/docs/research/ledger/docs/research/2026-09-13-search-quality.md +105 -0
  131. package/docs/research/ledger/docs/research/2026-09-13-source-coverage.md +64 -0
  132. package/docs/research/ledger/docs/research/2026-09-13-sync-wall-budget.md +82 -0
  133. package/docs/research/ledger/docs/research/2026-09-13-typed-read-gate.md +81 -0
  134. package/docs/research/ledger/docs/research/2026-09-13-writer-lease.md +84 -0
  135. package/docs/research/ledger/docs/research/2026-09-16-c1-copy-fallback.md +227 -0
  136. package/docs/research/ledger/docs/research/2026-09-16-c10-kimi.md +414 -0
  137. package/docs/research/ledger/docs/research/2026-09-16-c2-derive-counter.md +216 -0
  138. package/docs/research/ledger/docs/research/2026-09-16-c3-echo-filter.md +305 -0
  139. package/docs/research/ledger/docs/research/2026-09-16-c4-title-index.md +349 -0
  140. package/docs/research/ledger/docs/research/2026-09-16-c5-trigram.md +268 -0
  141. package/docs/research/ledger/docs/research/2026-09-16-c6-recency-prior.md +438 -0
  142. package/docs/research/ledger/docs/research/2026-09-16-c7-tombstones.md +467 -0
  143. package/docs/research/ledger/docs/research/2026-09-16-c8-remote-truth.md +390 -0
  144. package/docs/research/ledger/docs/research/2026-09-16-c9-grok.md +380 -0
  145. package/docs/research/ledger/docs/research/2026-09-16-wake-port-program.md +38 -0
  146. package/docs/research/ledger/docs/research/2026-09-17-cursor-blobstore.md +157 -0
  147. package/docs/research/ledger/manifest.json +540 -0
  148. package/legacy/NOTICE.md +50 -0
  149. package/legacy/bin/ledger-core.ts +7 -0
  150. package/legacy/bin/ledger.ts +7 -0
  151. package/legacy/bin/traj-bridge.ts +7 -0
  152. package/legacy/scripts/import-claude-history.ts +130 -0
  153. package/legacy/scripts/native-history-smoke.ts +52 -0
  154. package/legacy/scripts/observe-daemon.ts +570 -0
  155. package/legacy/scripts/retitle-sessions.md +19 -0
  156. package/legacy/scripts/verify-runtime-rollout.ts +151 -0
  157. package/legacy/src/canonical.ts +108 -0
  158. package/legacy/src/cli.ts +1293 -0
  159. package/legacy/src/db.ts +2254 -0
  160. package/legacy/src/diagnostics.ts +87 -0
  161. package/legacy/src/discovery.ts +56 -0
  162. package/legacy/src/embeddings.ts +382 -0
  163. package/legacy/src/filter.ts +602 -0
  164. package/legacy/src/gemini_embeddings.ts +103 -0
  165. package/legacy/src/identity.ts +9 -0
  166. package/legacy/src/index.ts +10 -0
  167. package/legacy/src/ingest.ts +791 -0
  168. package/legacy/src/managed.ts +178 -0
  169. package/legacy/src/native/common.ts +68 -0
  170. package/legacy/src/native/cursor.ts +647 -0
  171. package/legacy/src/native/grok.ts +540 -0
  172. package/legacy/src/native/kimi.ts +706 -0
  173. package/legacy/src/native/opencode.ts +470 -0
  174. package/legacy/src/native/sqlite-ro.ts +281 -0
  175. package/legacy/src/native.ts +97 -0
  176. package/legacy/src/normalizer.ts +457 -0
  177. package/legacy/src/parentage.ts +562 -0
  178. package/legacy/src/pressure.ts +162 -0
  179. package/legacy/src/private-storage.ts +74 -0
  180. package/legacy/src/reader.ts +1255 -0
  181. package/legacy/src/scanner.ts +591 -0
  182. package/legacy/src/schema-gate.ts +263 -0
  183. package/legacy/src/schema.ts +829 -0
  184. package/legacy/src/semantic-top-k.ts +71 -0
  185. package/legacy/src/session-hash.ts +49 -0
  186. package/legacy/src/store-status.ts +218 -0
  187. package/legacy/src/sync-preparation.ts +45 -0
  188. package/legacy/src/sync-truth.ts +843 -0
  189. package/legacy/src/sync.ts +1219 -0
  190. package/legacy/src/types.ts +436 -0
  191. package/legacy/src/vocab.txt +30522 -0
  192. package/legacy/src/watch.ts +673 -0
  193. package/legacy/src/writer-lease.ts +310 -0
  194. package/ops/README.md +120 -0
  195. package/ops/install-cli.sh +63 -0
  196. package/ops/install-release.sh +49 -0
  197. package/ops/linux/install-systemd-user.sh +103 -0
  198. package/ops/macos/install-launchd.sh +72 -0
  199. package/ops/sync-settings.sh +37 -0
  200. package/package.json +19 -5
  201. package/skills/trajectories/SKILL.md +138 -0
  202. package/skills/trajectories/scripts/trajectories_recent.sh +26 -0
  203. package/skills/trajectories/scripts/trajectories_search.sh +26 -0
  204. package/index.js +0 -1
@@ -0,0 +1,103 @@
1
+ # Inspirations and provenance
2
+
3
+ Trajectories inherits Ledger's implemented search and indexing engine and keeps
4
+ the prior-art research that shaped it. This page is the current map: it separates
5
+ adopted dependencies, independently implemented patterns, and ideas that remained
6
+ research or plans. Resemblance to a reference is not evidence that its code or
7
+ file format was adopted.
8
+
9
+ The historical packet is preserved under the [Ledger research archive](research/ledger/README.md),
10
+ frozen from `archeism/ledger` commit
11
+ `43081aef54c23b4bd017b6c0e11fc42a9a1cb381`. Its [manifest](research/ledger/manifest.json)
12
+ records every original and ported path, SHA-256 digest and link-only transformation.
13
+ Those documents describe Ledger at the frozen commit; their commands, plans,
14
+ measurements and open items are historical evidence rather than current package
15
+ instructions.
16
+
17
+ Read each claim at its recorded scope. Static source inspection, synthetic tests,
18
+ live observations and proposed designs are different evidence classes in the
19
+ archive. A later port preserves the finding and its limits; it does not turn an
20
+ unrun upstream test or rejected experiment into current verification.
21
+
22
+ ## Current classification
23
+
24
+ | Reference | Classification | What reached Trajectories |
25
+ | --- | --- | --- |
26
+ | [Letta Trajectory](https://github.com/letta-ai/trajectory) | Adopted dependency | Canonical normalization, validation, stable source identities and canonical records. Trajectories currently pins `@letta-ai/trajectory` `0.4.3`; its portable store, native discovery, relationships and access layers remain Trajectories responsibilities. |
27
+ | [Obelisk](https://github.com/tommy0103/obelisk) | Behavioral research; independent implementation | Ledger studied writer ownership, commit ordering and explicit execution relationships. The port retains Ledger's writer lease and source-proved parentage. No Obelisk code, SQL, package or unpublished workspace dependency was copied. |
28
+ | [Cass](https://github.com/dicklesworthstone/coding_agent_session_search) | Behavioral and format research; independent implementation | Ledger adapted machine-readable search, source-bound recovery and operational patterns, and used pinned native-reader findings when implementing Cursor and OpenCode discovery. Trajectories does not embed Cass or claim its engine or output format. |
29
+ | [AgentsView](https://github.com/kenn-io/agentsview) | Behavioral and format research; independent implementation | Ledger learned from writable ownership, watch plus reconciliation, capture publication, and native Cursor/OpenCode readers. Its own reconciliation and native SQLite handling were implemented and tested in Ledger, then ported. |
30
+ | [Vercel AI SDK Harnesses](https://github.com/vercel/ai/tree/main/packages/harness) | Historical live-capture research | Ledger treated the event stream as a possible live input seam, not a persistence layer. Its proposed live adapter and push path did not ship in Ledger. Current Trajectories codecs and transfer work need their own evidence; this archive does not establish that lineage by resemblance. |
31
+ | [Letta Code](https://github.com/letta-ai/letta-code) | Historical service and reflection research | Ledger studied process ownership, scheduled-run outcomes and reflection completion. The planned Dream/curation worker did not ship. Reading `letta-code` transcript files is source-format support, not adoption of Letta Code's service lifecycle. |
32
+ | [Wake](https://github.com/iAmCorey/Wake) | Implemented patterns with attribution; no dependency or code copy | Ledger independently implemented several pinned Wake mechanisms: locked-SQLite copy fallback, derive-rule counters, echo filtering, title and recency behavior, deletion tombstones, and remote truthfulness primitives. The trigram proposal was measured and rejected; no remote transport was shipped. These Ledger files were then ported to Trajectories. |
33
+
34
+ ## What was actually ported
35
+
36
+ Trajectories' `legacy` engine came from Ledger at the frozen commit. The
37
+ [retirement source audit](../evidence/ledger-retirement-source-audit.md) and
38
+ [port inventory](../evidence/ledger-port-2026-10-06/source-inventory.json) distinguish
39
+ byte-identical files from intentional package changes. The package-level
40
+ [`legacy/NOTICE.md`](../legacy/NOTICE.md) records that direct source provenance.
41
+
42
+ The inherited surface includes:
43
+
44
+ - native history discovery and normalization through the adopted Trajectory
45
+ dependency;
46
+ - lexical, semantic and hybrid retrieval with machine-readable output;
47
+ - source identity, diagnostics, parentage and coverage;
48
+ - bounded ingestion, reconciliation, durable progress and writer arbitration;
49
+ - Wake-derived mechanisms whose source comments retain the upstream pin and
50
+ scope; and
51
+ - operator utilities, installers and regression tests recorded by the migration
52
+ audit.
53
+
54
+ Trajectories adds portable managed history, immutable snapshots, native
55
+ reader/writer codecs and conversion/continuation boundaries. Those additions
56
+ have their own tests and evidence; the Ledger archive does not retroactively
57
+ attribute them to an older inspiration.
58
+
59
+ ## Research that did not become Ledger runtime behavior
60
+
61
+ The frozen research also contains proposals and targets. The following were not
62
+ missing code in the port:
63
+
64
+ - Dream analysis, reflection, findings publication and memory or skill
65
+ promotion;
66
+ - an AI SDK Harness live-event adapter and durable push buffer;
67
+ - a cross-machine fleet service or remote mirror transport;
68
+ - integrity-addressed retention of every native artifact generation ever
69
+ indexed; and
70
+ - Wake's desktop UI, whole-session replacement, stats-only deduplication and
71
+ in-process-only scan locking.
72
+
73
+ Trajectories' managed snapshots preserve histories explicitly imported into its
74
+ store. That does not prove archival coverage for every transcript previously
75
+ found by Ledger's native scanner.
76
+
77
+ ## Retained evidence
78
+
79
+ Start with the archived [Ledger inspiration index](research/ledger/docs/inspirations.md).
80
+ The most useful primary maps are:
81
+
82
+ - [September 7 pinned comparison](research/ledger/docs/research/2026-09-07-confer-inspirations.md)
83
+ and [Letta Code service review](research/ledger/docs/research/2026-09-07-letta-continuous-service.md);
84
+ - [September 9 refreshed comparison](research/ledger/docs/research/2026-09-09-other-inspirations.md),
85
+ [Trajectory and Letta Code review](research/ledger/docs/research/2026-09-09-trajectory-and-letta-code.md),
86
+ and [harness transcript contract](research/ledger/docs/research/2026-09-09-harness-transcript-contract.md);
87
+ - [native history discovery](research/ledger/docs/research/2026-09-09-native-history-discovery.md),
88
+ [AgentsView native audit](research/ledger/docs/research/2026-09-09-agentsview-native-discovery.md),
89
+ and [native implementation verification](research/ledger/docs/research/2026-09-09-native-history-implementation.md);
90
+ - [PR2/PR6 integration record](research/ledger/docs/pr2-pr6-integration.md)
91
+ and [daemon observation](research/ledger/docs/research/2026-09-09-daemon-observation.md); and
92
+ - [Wake deep dive](research/ledger/confer/2026-09-14-wake/wake.md),
93
+ [port program](research/ledger/docs/research/2026-09-16-wake-port-program.md),
94
+ and its C1–C10 cycle notes. The [C5 note](research/ledger/docs/research/2026-09-16-c5-trigram.md)
95
+ preserves the rejected trigram result; the [C8 note](research/ledger/docs/research/2026-09-16-c8-remote-truth.md)
96
+ preserves the narrower primitives-only remote scope.
97
+
98
+ For the current comparison against Huihua and OAR (Open Agent Runtime), see
99
+ [Huihua and OAR assessment](research/2026-10-06-huihua-and-oar.md). That review is
100
+ separate from this provenance record and must not imply dependency, ingestion,
101
+ schema or format compatibility without direct evidence.
102
+ The owner reaffirmed Trajectories' own format: borrow Voyage's observation
103
+ patterns to improve it. Voyage ingestion is not part of the proposed ports.
@@ -0,0 +1,141 @@
1
+ # Ledger retirement and Trajectories package boundary
2
+
3
+ Trajectories now contains Ledger's implemented CLI engine and operational
4
+ utilities. The conversion SDK and CLI ship in one `trajectories` package with
5
+ separate entrypoints. `trajector` is not a runtime dependency or an additional
6
+ required package.
7
+
8
+ | Entry point | Purpose | Runtime and dependencies |
9
+ | --- | --- | --- |
10
+ | `import … from 'trajectories'` | Native codecs, per-session canonical logs, central identity and explicit continuation preparation | Node 22.13+; no Bun SQLite, AI SDK, WDK or harness executor |
11
+ | `trajectories` | Discover/index/search/analyze native and managed history; conversion and operator utilities | Bun; retained Ledger SQLite/search engine; local semantic model is optional |
12
+
13
+ Perpetual execution, provider credentials, worker recovery and execution leases
14
+ belong to the caller. The CLI's writer lease protects the search DB; it does not
15
+ claim ownership of an agent. Managed `index` is a derived lexical projection,
16
+ not another execution journal. SDK consumers can omit it entirely.
17
+
18
+ The [canonical-log replacement](../../../docs/adr/0011-trajectories-log-authority.md)
19
+ changes the shared managed-session core used by the API and managed CLI commands.
20
+ It also replaces full portable captures in caller receipts and Workflow results
21
+ with retained delta references. Ordinary native scan/sync keeps Ledger's ingestion
22
+ and search engine. Native harness files remain native. The version 2 managed
23
+ API requires explicit migration of version 1 stores; it does not write both
24
+ managed formats as competing authorities.
25
+
26
+ For managed version 1 stores, freeze native and Workflow writers and run
27
+ `trajectories migrate SOURCE --out NEW_DESTINATION --writers-stopped --robot`.
28
+ The destination must be fresh. The migration locks each old session's publication,
29
+ preserves its ID, imports accepted captures and retains each old prepared native
30
+ baseline once. It never rewrites source session/snapshot bytes or reads mutable
31
+ native paths. `NEW_DESTINATION/migration.json` is published only after successful
32
+ reconstruction. Keep failed partial destinations and the original source.
33
+
34
+ The manifest's `heads` map selects the migrated head after each old source head's
35
+ prepared bindings. `captures` separately maps each old accepted snapshot to its
36
+ exact capture head/reference; `bindings` maps old exported baselines to exact new
37
+ head/binding IDs. Apply these mappings to caller and Workflow state before resuming
38
+ writers against the destination; unmapped state still requires migration.
39
+
40
+ ## Port inventory
41
+
42
+ Source oracle: `archeism/ledger` at
43
+ `43081aef54c23b4bd017b6c0e11fc42a9a1cb381` (latest Ledger main verified 2026-10-06).
44
+ The [source audit](../evidence/ledger-retirement-source-audit.md) records the
45
+ distinction between implemented behavior and aspirations in the old README.
46
+
47
+ | Ledger capability | Trajectories location or command |
48
+ | --- | --- |
49
+ | 18 native history readers, source discovery and scan outcomes | `legacy/src/scanner.ts`, `native/`; `scan`, `sync` |
50
+ | Lexical/semantic/hybrid search, metadata, filters, aliases and robot v1/v2 | `search/query`, `recent/last`, `status`, `models pull` |
51
+ | Queue, resumable append ingestion, checkpoints, diagnostics and budgets | Retained `legacy/src` engine; `sync`, `build`, foreground `watch` |
52
+ | SQLite schema/migrations, read-only gates, writer arbitration and tombstones | Retained schema/reader/writer; `delete` and serving/admission guards |
53
+ | Proven native parent/subagent/workflow relationships | Retained normalization and parentage fields; search/recent metadata |
54
+ | Worktree wrapper and SHA-pinned source installation | `ops/install-cli.sh`, `ops/install-release.sh` |
55
+ | Bounded Linux/macOS periodic lexical ingestion | `ops/linux/install-systemd-user.sh`, `ops/macos/install-launchd.sh` |
56
+ | Agent-facing CLI utilities | `skills/trajectories`, search/recent shell wrappers |
57
+ | Claude prompt-only history recovery with original-byte provenance | `import-claude-history`; `legacy/scripts/import-claude-history.ts` |
58
+ | Bounded native SQLite diagnostic and old title recovery recipe | `legacy/scripts/native-history-smoke.ts`, `retitle-sessions.md` |
59
+ | Read-only resource/ingestion observer and frozen rollout validation | `legacy/scripts/observe-daemon.ts`, `verify-runtime-rollout.ts` |
60
+ | Pinned source inspirations, native-format research and Wake cycle decisions | [Inspiration index](./inspirations.md), [historical research packet](./research/ledger/README.md) |
61
+
62
+ Added on top of the port: 11 native reader/writer codecs, managed canonical
63
+ log history, stable central identity across prepared harness changes,
64
+ `show` for full conversation inspection, and `index --store` to make completed
65
+ central histories searchable under `managed:<id>`. This source coverage is
66
+ different from proving all runtime/model routes live; keep the
67
+ [compatibility limits](../README.md#fidelity-and-supported-boundaries).
68
+
69
+ Ledger never shipped the planned Dream/memory-curation system, a fleet server,
70
+ or raw archival retention for every historically indexed native transcript.
71
+ They are not missing ports. Managed log references retain captured native evidence
72
+ for histories explicitly imported through its SDK/CLI; ordinary native sync
73
+ retains the old provenance/path contract. Preserve native stores and evidence archives.
74
+
75
+ The historical research packet now travels with Trajectories. Its manifest pins
76
+ the Ledger source and hashes both original and ported documents; relative links
77
+ to excluded evidence point at the original immutable commit. Historical commands
78
+ are not current operator instructions. Large raw transcripts, databases and
79
+ experiment archives remain in their original evidence locations. The separate
80
+ [Huihua/OAR assessment](./research/2026-10-06-huihua-and-oar.md) records new port
81
+ candidates without changing the SDK's active-context or execution contracts.
82
+
83
+ ## Deliberate cutover
84
+
85
+ 1. Build and verify this package. Run the packed-consumer test to prove the SDK,
86
+ CLI, skills and operator files work outside both source repositories.
87
+ 2. Select the existing Ledger DB explicitly. Compare `status`, `recent` and known
88
+ search queries with the old CLI before replacing a machine's entrypoint.
89
+ 3. Back up that DB with SQLite's backup mechanism and stop its old writer. Keep
90
+ the original DB path and native harness histories. Installation does not move
91
+ them. Existing WAL files require a consistent SQLite backup, not an arbitrary
92
+ copy of the primary file while a writer is active.
93
+ 4. Install the new CLI and inspect a manual bounded `sync`. Enable the replacement
94
+ periodic unit on the target host; the installer does not stop Ledger's unit.
95
+ The [ops guide](../ops/README.md) contains commands, limits and OS behavior.
96
+ 5. Freeze Ledger's source/history after that cutover is verified. Keep the old
97
+ commit and its research/evidence as historical records. Trajectories requires
98
+ no Ledger checkout at runtime.
99
+
100
+ DB precedence remains `--db` > `TRAJECTORIES_DB` > `LEDGER_DB` > the old XDG
101
+ `ledger/ledger.sqlite` default. Central storage separately uses `--store` >
102
+ `TRAJECTORIES_HOME` > XDG `trajectories`. Scheduled `sync` indexes native stores;
103
+ `index --store` explicitly projects a selected managed store. Repeat after a
104
+ new accepted head. Only accepted history enters this projection; staged captures
105
+ do not become search results. Index deletion suppresses the derived search row
106
+ without deleting the session's canonical log or retained evidence.
107
+
108
+ Managed index rows use the dedicated `managed` source (`--source managed` in
109
+ search/recent), while their records keep original native `source_type`,
110
+ `native_session_id` and `binding_id` where known. This isolates
111
+ native admission tombstones from central IDs. Indexed `show` explicitly returns
112
+ the full `ledger-db` record projection; `managed_log_path` points to the session
113
+ log. Use `show CENTRAL_ID --store STORE` for accepted records with central ids,
114
+ payloads and per-record origin, pinned to the displayed head. The SQLite
115
+ projection is not another conversation authority. Its optional provenance
116
+ columns remain null for old records whose origin was not captured; read-only
117
+ commands continue serving older compatible databases without migrating them.
118
+
119
+ The source release installer retains the full reviewed monorepo archive and
120
+ frozen dependency patch, filters the dependency install to Trajectories, skips
121
+ root lifecycle scripts and builds only this package. The packed npm consumer
122
+ does not need the monorepo; install it with `bun add --global trajectories@0.1.0`. The subsequent
123
+ [Mac cutover](../evidence/mac-cutover-2026-10-07/README.md) verified the clean
124
+ command and scheduler replacement against the retained database; its receipt
125
+ records the rollback and remaining ingestion limits.
126
+
127
+ ## Acceptance evidence
128
+
129
+ Verify with `bun run verify` in `packages/trajectories`. The retained Ledger
130
+ suite exercises the original index/search contracts; added tests cover managed
131
+ identity across Claude Code → Codex history preparation, unchanged re-indexing,
132
+ full-length tools, accepted-history preservation, suppression, corrupt/missing store
133
+ refusal, writer contention, standalone packaging and wrappers/installers.
134
+ Operational tests use temporary homes and fake service supervisors. Linux units
135
+ also pass the real systemd definition parser when available. These local tests
136
+ are separate from the later Mac cutover and the live transfer cohorts.
137
+
138
+ The [acceptance record](../evidence/ledger-port-2026-10-06/README.md) preserves the
139
+ 812-pass local gate, 12 explicit skips, raw logs, resources, source hashes and
140
+ independent review. House operating skills remain unchanged; the product skill
141
+ was migrated without claiming measured skill improvement.
@@ -0,0 +1,75 @@
1
+ # Pi compacted provider context
2
+
3
+ Verified locally on 2026-10-05 with `@ai-sdk/harness-pi@1.0.104`, native
4
+ `@earendil-works/pi-coding-agent@0.84.4`, and OMP 17.3.4. This is native Pi's
5
+ compacted history transported to another harness, not a shared native runtime or
6
+ a new summarization policy. The SDK still has no harness runtime dependency.
7
+
8
+ ## Archive and live context
9
+
10
+ `snapshot.raw` retains the exact complete native transcript. For supported Pi
11
+ compaction, `snapshot.canonical` becomes the native active view: the latest
12
+ summary as a user message, its retained range, then subsequent entries. Older
13
+ summary entries selected by that range become additional wrapped user messages,
14
+ matching native ordering. Surviving canonical identities and hashes are kept;
15
+ derived summaries use their native compaction entry ID and disclose the
16
+ `trajectories/pi-compaction-context-v1` diagnostic. The existing failed-draft
17
+ filter follows this projection.
18
+
19
+ Pi's summary wrapper is copied exactly. Export rederives the active view from
20
+ raw bytes, so clearing an archive's `portabilityIssues` or rehashing stale
21
+ canonical history cannot bypass that contract. Old snapshots need recapture.
22
+ Original snapshots stay immutable.
23
+
24
+ Same-native Pi compaction can change the live prefix. Central append therefore
25
+ requires the same identified native session and exact append-only source bytes,
26
+ then checks the full archive conversation with failed drafts excluded. A summary
27
+ alone does not count as new conversation progress. Other harnesses and imported
28
+ native sessions retain the normal prepared-prefix check.
29
+
30
+ This follows Raven's useful distinction between lossless archive and lossy live
31
+ compaction, documented in its [pinned vocabulary](https://github.com/EverMind-AI/Raven/blob/3632e6040c7038a60ec418ce39ccae185c72c19f/CONTEXT.md).
32
+ No Raven code or execution loop was introduced.
33
+
34
+ ## Bounded acceptance
35
+
36
+ Accept identified Pi v3 files with one complete linear entry chain, unique IDs,
37
+ ancestral retention anchors, ordinary user/assistant/tool-result content, and
38
+ recognized bookkeeping. Every selected non-failed message must have canonical
39
+ coverage. Tool results require native call ID and name; pending/orphan tool
40
+ guards still apply after projection.
41
+
42
+ Branches, disconnected or duplicate metadata, resets, custom messages, extension
43
+ summaries, images, unsupported roles/content and malformed summaries stay blocked.
44
+ Unsupported histories remain archivable with `portabilityIssues`; conversion
45
+ rejects them. OMP-origin compaction stays unsupported because its remote history,
46
+ reset, retry and snapcompact rules differ. This does not change that reader.
47
+ Native extensions that transform provider messages are outside this proof.
48
+
49
+ ## Source contract and verification
50
+
51
+ | Installed source | SHA-256 |
52
+ | --- | --- |
53
+ | Pi 0.84.4 `dist/core/session-manager.js` | `f0912a8b585263cc9793b38d97f01d19b0617c67b56d7f790bbb81a27d916a3c` |
54
+ | Pi 0.84.4 `dist/core/messages.js` | `a4e4865e343bf87f8078f75ff179a2a77cd7c2700cf8473476bd4dc5ed36adb6` |
55
+ | OMP 17.3.4 `src/session/session-context.ts` | `752c20f846be937422fadcbb632710376c7b829fd7ba520d02e92d21ce3012ea` |
56
+
57
+ Pi's `buildContextEntries` selects the latest compaction, retained entries starting
58
+ at `firstKeptEntryId`, and subsequent entries. `convertToLlm` adds the summary's
59
+ exact user wrapper. Installed runtime source supplies the oracle; core code uses
60
+ pure data. Recheck this contract when upgrading the native runtime or normalizer.
61
+
62
+ `test/pi-compaction.test.ts` protects identities/raw preservation, repeated
63
+ summaries, central continuity/progress, malformed topology, export revalidation,
64
+ and unfinished or silently dropped tool results. An independent GPT-6-astra
65
+ review reproduced a missing-call-ID result that normalization silently removed;
66
+ its failing regression preceded the guard correction.
67
+
68
+ The [native trial](../../trajectories-workflow/experiments/pi-compaction/README.md)
69
+ uses ordinary public HarnessAgent sessions. Baseline Pi continued after compaction
70
+ while both exports rejected it. After projection, central append, direct Pi
71
+ resume, Pi export and OMP handoff passed with exact logical provider role/text
72
+ order and the complete original transcript preserved. Localhost responses do not
73
+ prove semantic summary quality, native state transfer, or perpetual availability.
74
+ The retained [transfer receipt](../evidence/pi-compaction-transfer.json) includes
75
+ the provider conversations, native hashes, diagnostics and resource measurements.
@@ -0,0 +1,76 @@
1
+ # Pi interrupted assistant drafts
2
+
3
+ Verified 2026-10-03 against installed Pi dependencies and a real Workflow Harness
4
+ discovery transcript. This is a source-specific projection, not a general rule
5
+ for other harnesses or a complete implementation of native context reconstruction.
6
+
7
+ ## Native behavior
8
+
9
+ Pi's `transformMessages` removes an entire assistant message when its
10
+ `stopReason` is `aborted` or `error`, including text, reasoning, and incomplete
11
+ tool calls. Provider translators call this transformer before making a model
12
+ request. Native session JSONL still contains those messages.
13
+
14
+ Verified upstream files:
15
+
16
+ | Package | Installed source | Relevant lines | SHA-256 |
17
+ | --- | --- | --- | --- |
18
+ | `@earendil-works/pi-ai@0.84.4` | `dist/api/transform-messages.js` | 153–160 omit drafts; 170–173 preserve tool results | `e51975857b2fefa7e9cc108850ddab5a2fd1753a399f3cde00d76cd700ce6d10` |
19
+ | `@earendil-works/pi-ai@0.74.2` | `dist/providers/transform-messages.js` | 150–157 omit drafts; 167–170 preserve tool results | `2601ac1c657643dc4f2f1cb55785a3ef435077345457d973fb0a018dfcefa469` |
20
+
21
+ The source repositories are [Pi](https://github.com/earendil-works/pi/tree/main/packages/ai)
22
+ and its earlier [pi-mono location](https://github.com/earendil-works/pi-mono/tree/main/packages/ai).
23
+ The installed package version and file digest above are the verified inputs;
24
+ moving default-branch documentation is not a version pin.
25
+
26
+ Pi does **not** remove a real tool result paired with an omitted assistant draft.
27
+ It also synthesizes a result for some dangling non-failed calls. Trajectories
28
+ preserves actual tool results and does not copy the synthetic-result behavior:
29
+ orphan results and unfinished non-failed tool batches continue to fail closed.
30
+ OMP has a different native transformation; the Pi projection is never applied to
31
+ OMP input. Installed OMP 17.3.4 drops aborted/error drafts and paired results,
32
+ except some interrupted-thinking continuity pairs, and has additional reset,
33
+ retry and remote-compaction behavior. Our unchanged OMP archive path is not a
34
+ claim that all its archived records are visible to its provider.
35
+
36
+ The separate [Pi compaction projection](pi-compaction-context.md) adds a verified
37
+ summary-and-tail view for a bounded native subset, before this draft filter.
38
+
39
+ ## Portable projection and provenance
40
+
41
+ `readSnapshot` first normalizes the original bytes through the pinned Letta
42
+ normalizer. It rejects invalid native JSON before projection. For Pi only,
43
+ `projectPiProviderContext` removes canonical components attributable to an
44
+ aborted/error assistant entry. Every surviving record keeps its original ID,
45
+ hash, order, and content. All original diagnostics are retained. Each omitted
46
+ entry adds a `noise_record_dropped` diagnostic with its original line and the
47
+ explicit `trajectories/pi-provider-context-v1` marker.
48
+
49
+ Original bytes, including every omitted draft, remain unchanged in `snapshot.raw`.
50
+ The snapshot identity hashes those bytes and the resulting canonical view. The
51
+ projection does not rewrite an existing saved snapshot. Re-reading its original
52
+ bytes produces a new snapshot when this projection changes its canonical view.
53
+
54
+ Native wrapper IDs identify canonical components. Legacy rows without IDs use
55
+ Letta's pinned byte-anchor identity, including UTF-8 bytes and CRLF characters:
56
+ `sha256(sourceGroupId + '|byte|' + byteOffset)`. This identity mapping was verified
57
+ against `@letta-ai/trajectory@0.4.3`, `dist/canonical.js`, SHA-256
58
+ `b1441714396dfb85a01feaae2c0624b27739a517807c8f86815d15fae0364244`.
59
+ Tests protect that dependency contract; recheck it when upgrading the normalizer.
60
+
61
+ ## Evidence
62
+
63
+ The real discovery snapshot originally contained an aborted partial
64
+ `checkpoint_probe` call with ID `call_d184b675b83c46e0885c8270`. Pi's installed
65
+ transformer reduced 14 native messages to 13 provider messages; there was no
66
+ associated tool result. Without projection, all six native writers rejected the
67
+ unfinished batch. Re-reading the identical bytes with projection made all six
68
+ format conversions succeed and disclose the omitted draft. This check used zero
69
+ model calls and establishes format compatibility, not resumed model behavior.
70
+
71
+ The before/after snapshot IDs, source digest, conversion results, and diagnostic
72
+ are recorded in `evidence/pi-provider-context-discovery.json` in the repository.
73
+ `test/pi-context.test.ts` covers string/array error drafts, every destination,
74
+ legacy Unicode/CRLF identities, original diagnostics, preserved tool results,
75
+ pending successful calls, unchanged OMP handling, stable continuation prefixes,
76
+ and malformed source rejection.
@@ -0,0 +1,176 @@
1
+ # Huihua and OAR: evidence formats for Trajectories
2
+
3
+ Source inspection, 2026-10-06. This assessment adds research and port candidates;
4
+ it does not add a codec, execution adapter, dependency, or live compatibility claim.
5
+ The preserved [Ledger inspiration packet](../inspirations.md) distinguishes
6
+ implemented patterns from proposals and rejected experiments.
7
+
8
+ ## Frozen sources
9
+
10
+ | Project | Inspected revision | Purpose |
11
+ | --- | --- | --- |
12
+ | [Huihua](https://github.com/wibus-wee/huihua/tree/a596eb1dbcec1e2928dfd7865dedf5188e08a62a) | `a596eb1dbcec1e2928dfd7865dedf5188e08a62a`, v0.3.0 | Read and normalize native stores and recorded streams |
13
+ | [OAR](https://github.com/botiverse/oar/tree/a3b43f94059ff40a38536a76b541011a48ed8686) | `a3b43f94059ff40a38536a76b541011a48ed8686` | Runtime observations, controls, projections and Voyage recording |
14
+ | [Ledger](https://github.com/archeism/ledger/tree/43081aef54c23b4bd017b6c0e11fc42a9a1cb381) | `43081aef54c23b4bd017b6c0e11fc42a9a1cb381` | Original research, implemented CLI patterns and experiment evidence |
15
+ | [Trajectories baseline](https://github.com/archeism/oh-my-ai/tree/b2555516b77ce0508f0c02b94c0ac4346125b490/packages/trajectories) | `b2555516b77ce0508f0c02b94c0ac4346125b490` | Existing SDK, managed sessions and Ledger CLI port |
16
+
17
+ These are separate source pins. Huihua's provider research can reference older
18
+ OAR or runtime revisions; inspecting current OAR does not refresh those fixtures.
19
+ The observations below are source/test inspection, not a new performance trial.
20
+
21
+ ## What Voyage unifies
22
+
23
+ Yes: OAR unifies heterogeneous runtime observations into one ordered record
24
+ stream. Voyage is the JSONL serialization of that stream. Normalization happens
25
+ in OAR's adapters; the [Voyage writer](https://github.com/botiverse/oar/blob/a3b43f94059ff40a38536a76b541011a48ed8686/packages/oar/src/voyage.ts)
26
+ wraps each existing record without translating it again.
27
+
28
+ The [record contract](https://github.com/botiverse/oar/blob/a3b43f94059ff40a38536a76b541011a48ed8686/docs/spec/record-stream.md)
29
+ uses three kinds sharing a sequence and attribution envelope:
30
+
31
+ | Kind | Evidence retained | Meaning |
32
+ | --- | --- | --- |
33
+ | `frame` | Native payload plus zero or more normalized facts | What the runtime actually reported |
34
+ | `request` | Direction, request identity and control/native request body | What the host or runtime asked for |
35
+ | `response` | Observed control acceptance, rejection, answer or exit | What outcome OAR observed for that control |
36
+
37
+ `seq` orders records within the stream; `sessionId` and `agentPath` identify the
38
+ session and agent. Optional `spanId` is native, rather than a fabricated turn id.
39
+ `receivedAt` is the adapter's observation time, not proof of vendor execution
40
+ time. Multiple facts from one native frame share its sequence; the payload stays
41
+ in one record. An uninterpreted frame remains present with an empty fact list.
42
+
43
+ A control being accepted does not prove that execution completed. Native
44
+ completion is a separate frame. Unobserved outcomes remain absent, and late
45
+ runtime frames are retained after an abort/dispose request or a settled span.
46
+ An unsolicited process exit can have an empty `requestId`; an importer must not
47
+ invent a matching control. Child-session completion and usage must not settle
48
+ the root session. Requested model/effort in a header differs from values the
49
+ runtime actually reports.
50
+
51
+ Voyage v3 starts with `format: "oar-voyage/3"` and a header, then record wrappers,
52
+ then an `end` line. A missing end marks a truncated capture. An end line does not
53
+ prove successful task execution. Synchronous writes retain already-written data
54
+ across a process crash, but the inspected writer does not call `fsync`; this is
55
+ not evidence of power-loss durability or recovery of unobserved events.
56
+
57
+ ### What to borrow
58
+
59
+ 1. Keep host intent, control acknowledgement and runtime fact separately
60
+ attributable. This directly helps investigate the previously observed gap
61
+ between a slice checkpoint and later native effects.
62
+ 2. OAR traces facts back to a shared native frame, preserving unknown records
63
+ without copying a large payload once per interpreted fact. The owner has
64
+ skipped adding an evidence-reference API to Trajectories; retain this as
65
+ comparative research, not an implementation task.
66
+ 3. Make usage, status and conversation views recomputable from records, with a
67
+ scoped cursor. Preserve late events and child attribution in the evidence.
68
+
69
+ This is a useful acquisition/analysis contract. It does not establish portable
70
+ active context, native caches, permissions, exactly-once effects, or durable
71
+ workflow recovery. The lessons concern source retention, ordering and attribution
72
+ inside our own managed-session format. Voyage is a
73
+ comparison source, not a proposed ingestion format. The earlier OAR lab imported
74
+ the underlying Pi native transcript.
75
+
76
+ ## Huihua port assessment
77
+
78
+ Huihua's [architecture and coverage](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/docs/architecture.md)
79
+ describe 20 provider labels, including ACP and OAR recordings. That is a count
80
+ of readable input families, not 20 executable harnesses or writable resume
81
+ formats. Trajectories currently has 18 CLI history sources and 11 SDK codecs.
82
+
83
+ | Candidate | Existing overlap | Smallest useful port and acceptance gate |
84
+ | --- | --- | --- |
85
+ | **Native evidence references — skipped by owner** | Canonical Letta records, raw transcript, hashes and diagnostics already survive snapshots | Use the retained native transcript for conversion debugging. No separate observation projection or evidence inspection API is an active task. |
86
+ | **Incremental SDK acquisition — unmeasured** | CLI ingestion is already bounded and resumable; SDK `readSnapshot` generally collects the transcript | Measure import time and peak memory before changing internals. Preserve canonical records, diagnostics, snapshot identities and publication integrity; a failed or cancelled import must not advance a managed head. Keep the public API until a measured benefit justifies a change. |
87
+
88
+ The [skipped evidence API design](../evidence-api.md) is retained as history.
89
+ Type-checking and contract review proved properties of the proposal, not that a
90
+ new interface was needed. Streaming first needs a measured baseline; there is
91
+ no new exported streaming or evidence API in this checkpoint.
92
+
93
+ The [event contract](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/src/contracts/event.ts)
94
+ links normalized events by sequence and record index. Its
95
+ [source contract](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/src/contracts/source.ts)
96
+ keeps native record evidence independently. Tool, file-change and subagent
97
+ selectors return views of existing events; they do not establish implicit
98
+ tool pairing or native resume semantics. This can supplement our canonical
99
+ conversation without promoting every observed event into model context.
100
+
101
+ Huihua accepts acquired byte streams separately from discovery. Its
102
+ [streaming tests](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/tests/parse.test.ts)
103
+ check producer consumption and early cancellation. JSONL parsing is incremental;
104
+ some SQLite paths buffer selected rows, and a collected snapshot still retains
105
+ history. Early termination does not validate an unread suffix. Streaming is
106
+ therefore not a fixed-memory or complete-snapshot guarantee.
107
+
108
+ Malformed JSON can remain unknown evidence with a diagnostic in Huihua; that
109
+ differs from a fatal stream, checksum or size failure. Managed snapshot
110
+ publication still needs our own explicit completeness and integrity policy.
111
+
112
+ Two lower-priority ideas need comparison against the retained Ledger engine:
113
+
114
+ - Provider scans can yield a failed store separately from prior discoveries.
115
+ Borrow that SDK seam only where our existing scan outcomes do not already
116
+ provide isolation; retain cancellation and explicit provider selection.
117
+ - A pure TypeScript read-only SQLite/WAL decoder could help inspect frozen
118
+ archives without adding a native SQLite dependency to the SDK. Huihua rejects
119
+ unsupported/changed stores; its bounded schema coverage and custom-parser
120
+ maintenance cost require separate evaluation. It is not a replacement for
121
+ the CLI's live-store snapshot/retry reader.
122
+
123
+ ## Preserve the protections we already proved
124
+
125
+ Huihua's [Pi research](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/src/providers/pi/RESEARCH.md)
126
+ retains branches in physical order and does not select native active context.
127
+ Our [Pi compaction](../pi-compaction-context.md),
128
+ [provider-context projection](../pi-provider-context.md), and incomplete-tool
129
+ guards must remain. An archive reader accepting a file does not authorize
130
+ replaying every message into another harness.
131
+
132
+ Neither representation automatically preserves an entire original store image.
133
+ Huihua's [JSONL reader](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/src/shared/jsonl.ts)
134
+ skips blank lines; selected SQLite rows are not a database backup, and compressed
135
+ source bytes need separate retention. Trajectories' normal UTF-8 text reads also
136
+ do not prove fidelity for arbitrary invalid UTF-8. Keep source evidence and
137
+ diagnostics specific to the actual capture method.
138
+
139
+ Huihua's [compatibility manifest](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/fixtures/compatibility/sources.json)
140
+ provides useful fixture provenance. Evidence strength varies: several provider
141
+ research pages pin producer sources, while some link moving branches;
142
+ [Antigravity research](https://github.com/wibus-wee/huihua/blob/a596eb1dbcec1e2928dfd7865dedf5188e08a62a/src/providers/antigravity/RESEARCH.md)
143
+ explicitly relies on a partial observed schema and synthetic fixtures.
144
+ Do not turn provider registration into an unbounded compatibility claim.
145
+
146
+ ## What remains worth measuring
147
+
148
+ The current SDK [reader](../../src/convert.ts) collects and normalizes complete
149
+ native history. Large imports may therefore incur temporary-memory and parsing
150
+ costs. Internal incremental parsing is a candidate only after profiling; chunked
151
+ reading followed by the same full-buffer parser does not prove a saving, and the
152
+ final snapshot still retains complete history.
153
+
154
+ The managed [store](../../src/store.ts) writes each new snapshot id as a complete
155
+ JSON bundle, retaining raw text, canonical records and sidecars. Identical ids
156
+ reuse an immutable file, but changed generations retain complete bundles again.
157
+ The owner has explicitly rejected this per-capture full-bundle architecture.
158
+ [ADR 0011](../../../../docs/adr/0011-trajectories-log-authority.md) specifies one
159
+ canonical append-only log, shared native evidence/artifacts, and restrained
160
+ derived checkpoints. The store and Workflow migration is pending. Measure
161
+ allocated bytes across the full replacement and its evidence/cache overhead;
162
+ do not use a smaller copy of the same snapshot system as the new source of truth.
163
+
164
+ The import-memory candidate is a source-based hypothesis; no measured performance
165
+ improvement is claimed. The retained Ledger CLI already has bounded/resumable
166
+ ingestion and must not be rewritten merely to copy Huihua's interface. Provider
167
+ scan isolation and a custom SQLite decoder have no demonstrated additional need.
168
+
169
+ The current decision is to preserve this research, skip the evidence API, and
170
+ move managed persistence to one canonical log while keeping SDK ingestion costs
171
+ unmeasured. The owner asked
172
+ what we can learn from Voyage, not to add its format as an input. The earlier
173
+ Voyage/ACP recording-reader proposal was removed after that correction.
174
+ Keep Letta-backed conversation conversion and our central session identity.
175
+ Keep native execution in HarnessAgent and durability in the optional Workflow
176
+ integration. No new reader, schema or runtime behavior ships with this checkpoint.