trellis 2.1.7 → 3.0.2

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 (346) hide show
  1. package/README.md +65 -706
  2. package/dist/cli/index.d.ts +16 -0
  3. package/dist/cli/index.d.ts.map +1 -0
  4. package/dist/cli/index.js +3188 -232
  5. package/dist/client/config.d.ts +56 -0
  6. package/dist/client/config.d.ts.map +1 -0
  7. package/dist/client/index.d.ts +15 -0
  8. package/dist/client/index.d.ts.map +1 -0
  9. package/dist/client/index.js +32 -0
  10. package/dist/client/sdk.d.ts +152 -0
  11. package/dist/client/sdk.d.ts.map +1 -0
  12. package/dist/config-8hczw0rs.js +20 -0
  13. package/dist/context/heat-map-manager.d.ts +100 -0
  14. package/dist/context/heat-map-manager.d.ts.map +1 -0
  15. package/dist/context/manager.d.ts +16 -0
  16. package/dist/context/manager.d.ts.map +1 -0
  17. package/dist/context/types.d.ts +20 -0
  18. package/dist/context/types.d.ts.map +1 -0
  19. package/dist/core/agents/harness.d.ts +58 -0
  20. package/dist/core/agents/harness.d.ts.map +1 -0
  21. package/dist/core/agents/index.d.ts +8 -0
  22. package/dist/core/agents/index.d.ts.map +1 -0
  23. package/dist/core/agents/types.d.ts +79 -0
  24. package/dist/core/agents/types.d.ts.map +1 -0
  25. package/dist/core/computation/expr-evaluator.d.ts +52 -0
  26. package/dist/core/computation/expr-evaluator.d.ts.map +1 -0
  27. package/dist/core/index.d.ts +25 -0
  28. package/dist/core/index.d.ts.map +1 -0
  29. package/dist/core/index.js +105 -11
  30. package/dist/core/kernel/logic-middleware.d.ts +19 -0
  31. package/dist/core/kernel/logic-middleware.d.ts.map +1 -0
  32. package/dist/core/kernel/middleware.d.ts +28 -0
  33. package/dist/core/kernel/middleware.d.ts.map +1 -0
  34. package/dist/core/kernel/schema-middleware.d.ts +15 -0
  35. package/dist/core/kernel/schema-middleware.d.ts.map +1 -0
  36. package/dist/core/kernel/security-middleware.d.ts +24 -0
  37. package/dist/core/kernel/security-middleware.d.ts.map +1 -0
  38. package/dist/core/kernel/sync-provider.d.ts +59 -0
  39. package/dist/core/kernel/sync-provider.d.ts.map +1 -0
  40. package/dist/core/kernel/trellis-kernel.d.ts +217 -0
  41. package/dist/core/kernel/trellis-kernel.d.ts.map +1 -0
  42. package/dist/core/ontology/builtins.d.ts +16 -0
  43. package/dist/core/ontology/builtins.d.ts.map +1 -0
  44. package/dist/core/ontology/core-ontology.d.ts +20 -0
  45. package/dist/core/ontology/core-ontology.d.ts.map +1 -0
  46. package/dist/core/ontology/index.d.ts +12 -0
  47. package/dist/core/ontology/index.d.ts.map +1 -0
  48. package/dist/core/ontology/registry.d.ts +70 -0
  49. package/dist/core/ontology/registry.d.ts.map +1 -0
  50. package/dist/core/ontology/types.d.ts +201 -0
  51. package/dist/core/ontology/types.d.ts.map +1 -0
  52. package/dist/core/ontology/validator.d.ts +34 -0
  53. package/dist/core/ontology/validator.d.ts.map +1 -0
  54. package/dist/core/persist/backend.d.ts +62 -0
  55. package/dist/core/persist/backend.d.ts.map +1 -0
  56. package/dist/core/persist/better-sqlite-backend.d.ts +33 -0
  57. package/dist/core/persist/better-sqlite-backend.d.ts.map +1 -0
  58. package/dist/core/persist/sqlite-backend.d.ts +43 -0
  59. package/dist/core/persist/sqlite-backend.d.ts.map +1 -0
  60. package/dist/core/plugins/index.d.ts +8 -0
  61. package/dist/core/plugins/index.d.ts.map +1 -0
  62. package/dist/core/plugins/registry.d.ts +69 -0
  63. package/dist/core/plugins/registry.d.ts.map +1 -0
  64. package/dist/core/plugins/types.d.ts +87 -0
  65. package/dist/core/plugins/types.d.ts.map +1 -0
  66. package/dist/core/query/datalog.d.ts +52 -0
  67. package/dist/core/query/datalog.d.ts.map +1 -0
  68. package/dist/core/query/engine.d.ts +42 -0
  69. package/dist/core/query/engine.d.ts.map +1 -0
  70. package/dist/core/query/index.d.ts +12 -0
  71. package/dist/core/query/index.d.ts.map +1 -0
  72. package/dist/core/query/parser.d.ts +37 -0
  73. package/dist/core/query/parser.d.ts.map +1 -0
  74. package/dist/core/query/types.d.ts +135 -0
  75. package/dist/core/query/types.d.ts.map +1 -0
  76. package/dist/core/store/eav-store.d.ts +111 -0
  77. package/dist/core/store/eav-store.d.ts.map +1 -0
  78. package/dist/db/index.d.ts +18 -0
  79. package/dist/db/index.d.ts.map +1 -0
  80. package/dist/db/index.js +85 -0
  81. package/dist/db/inspector.js +28 -0
  82. package/dist/db/trellis.css +1 -0
  83. package/dist/decisions/auto-capture.d.ts +31 -0
  84. package/dist/decisions/auto-capture.d.ts.map +1 -0
  85. package/dist/decisions/hooks.d.ts +48 -0
  86. package/dist/decisions/hooks.d.ts.map +1 -0
  87. package/dist/decisions/index.d.ts +36 -0
  88. package/dist/decisions/index.d.ts.map +1 -0
  89. package/dist/decisions/types.d.ts +73 -0
  90. package/dist/decisions/types.d.ts.map +1 -0
  91. package/dist/deploy-999q207z.js +10 -0
  92. package/dist/embeddings/auto-embed.d.ts +52 -0
  93. package/dist/embeddings/auto-embed.d.ts.map +1 -0
  94. package/dist/embeddings/chunker.d.ts +73 -0
  95. package/dist/embeddings/chunker.d.ts.map +1 -0
  96. package/dist/embeddings/index.d.ts +18 -0
  97. package/dist/embeddings/index.d.ts.map +1 -0
  98. package/dist/embeddings/model.d.ts +30 -0
  99. package/dist/embeddings/model.d.ts.map +1 -0
  100. package/dist/embeddings/search.d.ts +87 -0
  101. package/dist/embeddings/search.d.ts.map +1 -0
  102. package/dist/embeddings/store.d.ts +66 -0
  103. package/dist/embeddings/store.d.ts.map +1 -0
  104. package/dist/embeddings/types.d.ts +54 -0
  105. package/dist/embeddings/types.d.ts.map +1 -0
  106. package/dist/engine-y0724kjq.js +8 -0
  107. package/dist/engine.d.ts +218 -0
  108. package/dist/engine.d.ts.map +1 -0
  109. package/dist/evals/types.d.ts +29 -0
  110. package/dist/evals/types.d.ts.map +1 -0
  111. package/dist/garden/cluster.d.ts +57 -0
  112. package/dist/garden/cluster.d.ts.map +1 -0
  113. package/dist/garden/garden.d.ts +104 -0
  114. package/dist/garden/garden.d.ts.map +1 -0
  115. package/dist/garden/index.d.ts +15 -0
  116. package/dist/garden/index.d.ts.map +1 -0
  117. package/dist/git/git-exporter.d.ts +37 -0
  118. package/dist/git/git-exporter.d.ts.map +1 -0
  119. package/dist/git/git-importer.d.ts +36 -0
  120. package/dist/git/git-importer.d.ts.map +1 -0
  121. package/dist/git/git-reader.d.ts +63 -0
  122. package/dist/git/git-reader.d.ts.map +1 -0
  123. package/dist/git/index.d.ts +10 -0
  124. package/dist/git/index.d.ts.map +1 -0
  125. package/dist/identity/governance.d.ts +54 -0
  126. package/dist/identity/governance.d.ts.map +1 -0
  127. package/dist/identity/identity.d.ts +63 -0
  128. package/dist/identity/identity.d.ts.map +1 -0
  129. package/dist/identity/index.d.ts +10 -0
  130. package/dist/identity/index.d.ts.map +1 -0
  131. package/dist/identity/signing-middleware.d.ts +38 -0
  132. package/dist/identity/signing-middleware.d.ts.map +1 -0
  133. package/dist/import-s2b8e0ft.js +11 -0
  134. package/dist/{index-3ejh8k6v.js → index-0q7wbasy.js} +18 -4
  135. package/dist/index-0zk3fx2s.js +1004 -0
  136. package/dist/index-2r4jxwnb.js +32 -0
  137. package/dist/index-6n5dcebj.js +847 -0
  138. package/dist/index-7e27kvvj.js +292 -0
  139. package/dist/index-bmyt7k8n.js +90 -0
  140. package/dist/index-c9h37r6h.js +1 -0
  141. package/dist/{index-k5kf7sd0.js → index-hmdbnd4n.js} +1 -1
  142. package/dist/index-k5b0xskw.js +1 -0
  143. package/dist/index-n9f2qyh5.js +495 -0
  144. package/dist/{index-22jx9qsz.js → index-q31hfjja.js} +861 -51
  145. package/dist/index-skhn0agf.js +155 -0
  146. package/dist/{index-5m0g9r0y.js → index-w7ng765c.js} +4 -497
  147. package/dist/index-wt8rz4gn.js +132 -0
  148. package/dist/index-xzym9w0m.js +43 -0
  149. package/dist/index-y3d71wzd.js +77 -0
  150. package/dist/index-y6a4kj0p.js +43 -0
  151. package/dist/index-yhwjgfvj.js +342 -0
  152. package/dist/index-yp88he8n.js +316 -0
  153. package/dist/index.d.ts +25 -0
  154. package/dist/index.d.ts.map +1 -0
  155. package/dist/index.js +21 -9
  156. package/dist/links/index.d.ts +16 -0
  157. package/dist/links/index.d.ts.map +1 -0
  158. package/dist/links/lifecycle.d.ts +112 -0
  159. package/dist/links/lifecycle.d.ts.map +1 -0
  160. package/dist/links/parser.d.ts +56 -0
  161. package/dist/links/parser.d.ts.map +1 -0
  162. package/dist/links/ref-index.d.ts +55 -0
  163. package/dist/links/ref-index.d.ts.map +1 -0
  164. package/dist/links/resolver.d.ts +90 -0
  165. package/dist/links/resolver.d.ts.map +1 -0
  166. package/dist/links/types.d.ts +70 -0
  167. package/dist/links/types.d.ts.map +1 -0
  168. package/dist/llm/provider.d.ts +11 -0
  169. package/dist/llm/provider.d.ts.map +1 -0
  170. package/dist/llm/types.d.ts +74 -0
  171. package/dist/llm/types.d.ts.map +1 -0
  172. package/dist/mcp/docs.d.ts +18 -0
  173. package/dist/mcp/docs.d.ts.map +1 -0
  174. package/dist/mcp/index.d.ts +15 -0
  175. package/dist/mcp/index.d.ts.map +1 -0
  176. package/dist/mcp/server.d.ts +26 -0
  177. package/dist/mcp/server.d.ts.map +1 -0
  178. package/dist/orchestration/types.d.ts +22 -0
  179. package/dist/orchestration/types.d.ts.map +1 -0
  180. package/dist/plugins/agent-memory/graph-context-manager.d.ts +75 -0
  181. package/dist/plugins/agent-memory/graph-context-manager.d.ts.map +1 -0
  182. package/dist/plugins/agent-memory/index.d.ts +30 -0
  183. package/dist/plugins/agent-memory/index.d.ts.map +1 -0
  184. package/dist/plugins/agent-memory/ontology.d.ts +13 -0
  185. package/dist/plugins/agent-memory/ontology.d.ts.map +1 -0
  186. package/dist/plugins/agent-memory/plugin.d.ts +17 -0
  187. package/dist/plugins/agent-memory/plugin.d.ts.map +1 -0
  188. package/dist/plugins/brand/cache.d.ts +18 -0
  189. package/dist/plugins/brand/cache.d.ts.map +1 -0
  190. package/dist/plugins/brand/catalog-generator.d.ts +89 -0
  191. package/dist/plugins/brand/catalog-generator.d.ts.map +1 -0
  192. package/dist/plugins/brand/constraints.d.ts +55 -0
  193. package/dist/plugins/brand/constraints.d.ts.map +1 -0
  194. package/dist/plugins/brand/index.d.ts +44 -0
  195. package/dist/plugins/brand/index.d.ts.map +1 -0
  196. package/dist/plugins/brand/mcp-tools.d.ts +101 -0
  197. package/dist/plugins/brand/mcp-tools.d.ts.map +1 -0
  198. package/dist/plugins/brand/ontology.d.ts +13 -0
  199. package/dist/plugins/brand/ontology.d.ts.map +1 -0
  200. package/dist/plugins/brand/plugin.d.ts +21 -0
  201. package/dist/plugins/brand/plugin.d.ts.map +1 -0
  202. package/dist/plugins/brand/voice-tone.d.ts +24 -0
  203. package/dist/plugins/brand/voice-tone.d.ts.map +1 -0
  204. package/dist/plugins/idea-garden/api.d.ts +26 -0
  205. package/dist/plugins/idea-garden/api.d.ts.map +1 -0
  206. package/dist/plugins/idea-garden/index.d.ts +12 -0
  207. package/dist/plugins/idea-garden/index.d.ts.map +1 -0
  208. package/dist/plugins/idea-garden/plugin.d.ts +16 -0
  209. package/dist/plugins/idea-garden/plugin.d.ts.map +1 -0
  210. package/dist/plugins/idea-garden/types.d.ts +22 -0
  211. package/dist/plugins/idea-garden/types.d.ts.map +1 -0
  212. package/dist/plugins/plan-approval/index.d.ts +36 -0
  213. package/dist/plugins/plan-approval/index.d.ts.map +1 -0
  214. package/dist/plugins/plan-approval/ontology.d.ts +11 -0
  215. package/dist/plugins/plan-approval/ontology.d.ts.map +1 -0
  216. package/dist/plugins/plan-approval/plan-manager.d.ts +104 -0
  217. package/dist/plugins/plan-approval/plan-manager.d.ts.map +1 -0
  218. package/dist/plugins/plan-approval/plugin.d.ts +110 -0
  219. package/dist/plugins/plan-approval/plugin.d.ts.map +1 -0
  220. package/dist/plugins/proactive-watcher/index.d.ts +28 -0
  221. package/dist/plugins/proactive-watcher/index.d.ts.map +1 -0
  222. package/dist/plugins/proactive-watcher/ontology.d.ts +8 -0
  223. package/dist/plugins/proactive-watcher/ontology.d.ts.map +1 -0
  224. package/dist/plugins/proactive-watcher/plugin.d.ts +20 -0
  225. package/dist/plugins/proactive-watcher/plugin.d.ts.map +1 -0
  226. package/dist/plugins/proactive-watcher/watcher-manager.d.ts +36 -0
  227. package/dist/plugins/proactive-watcher/watcher-manager.d.ts.map +1 -0
  228. package/dist/plugins/sprite-tools/checkpoint-middleware.d.ts +43 -0
  229. package/dist/plugins/sprite-tools/checkpoint-middleware.d.ts.map +1 -0
  230. package/dist/plugins/sprite-tools/index.d.ts +40 -0
  231. package/dist/plugins/sprite-tools/index.d.ts.map +1 -0
  232. package/dist/plugins/sprite-tools/plugin.d.ts +69 -0
  233. package/dist/plugins/sprite-tools/plugin.d.ts.map +1 -0
  234. package/dist/react/index.js +189 -0
  235. package/dist/scaffold/index.d.ts +13 -0
  236. package/dist/scaffold/index.d.ts.map +1 -0
  237. package/dist/scaffold/infer.d.ts +42 -0
  238. package/dist/scaffold/infer.d.ts.map +1 -0
  239. package/dist/scaffold/profile.d.ts +51 -0
  240. package/dist/scaffold/profile.d.ts.map +1 -0
  241. package/dist/scaffold/seed.d.ts +27 -0
  242. package/dist/scaffold/seed.d.ts.map +1 -0
  243. package/dist/scaffold/write.d.ts +53 -0
  244. package/dist/scaffold/write.d.ts.map +1 -0
  245. package/dist/sdk-snn5gad3.js +15 -0
  246. package/dist/semantic/csharp-parser.d.ts +12 -0
  247. package/dist/semantic/csharp-parser.d.ts.map +1 -0
  248. package/dist/semantic/go-parser.d.ts +12 -0
  249. package/dist/semantic/go-parser.d.ts.map +1 -0
  250. package/dist/semantic/index.d.ts +22 -0
  251. package/dist/semantic/index.d.ts.map +1 -0
  252. package/dist/semantic/java-parser.d.ts +12 -0
  253. package/dist/semantic/java-parser.d.ts.map +1 -0
  254. package/dist/semantic/python-parser.d.ts +12 -0
  255. package/dist/semantic/python-parser.d.ts.map +1 -0
  256. package/dist/semantic/ruby-parser.d.ts +12 -0
  257. package/dist/semantic/ruby-parser.d.ts.map +1 -0
  258. package/dist/semantic/rust-parser.d.ts +12 -0
  259. package/dist/semantic/rust-parser.d.ts.map +1 -0
  260. package/dist/semantic/semantic-merge.d.ts +20 -0
  261. package/dist/semantic/semantic-merge.d.ts.map +1 -0
  262. package/dist/semantic/ts-parser.d.ts +13 -0
  263. package/dist/semantic/ts-parser.d.ts.map +1 -0
  264. package/dist/semantic/types.d.ts +130 -0
  265. package/dist/semantic/types.d.ts.map +1 -0
  266. package/dist/server/auth.d.ts +72 -0
  267. package/dist/server/auth.d.ts.map +1 -0
  268. package/dist/server/deploy.d.ts +44 -0
  269. package/dist/server/deploy.d.ts.map +1 -0
  270. package/dist/server/import.d.ts +40 -0
  271. package/dist/server/import.d.ts.map +1 -0
  272. package/dist/server/index.d.ts +26 -0
  273. package/dist/server/index.d.ts.map +1 -0
  274. package/dist/server/index.js +90 -0
  275. package/dist/server/permissions.d.ts +84 -0
  276. package/dist/server/permissions.d.ts.map +1 -0
  277. package/dist/server/realtime.d.ts +78 -0
  278. package/dist/server/realtime.d.ts.map +1 -0
  279. package/dist/server/server.d.ts +43 -0
  280. package/dist/server/server.d.ts.map +1 -0
  281. package/dist/server/sprites.d.ts +26 -0
  282. package/dist/server/sprites.d.ts.map +1 -0
  283. package/dist/server/tenancy.d.ts +53 -0
  284. package/dist/server/tenancy.d.ts.map +1 -0
  285. package/dist/server/vm-config.d.ts +60 -0
  286. package/dist/server/vm-config.d.ts.map +1 -0
  287. package/dist/server-mrctdwzr.js +11 -0
  288. package/dist/sprites-vc4qbrp1.js +16 -0
  289. package/dist/streaming/types.d.ts +43 -0
  290. package/dist/streaming/types.d.ts.map +1 -0
  291. package/dist/sync/http-transport.d.ts +47 -0
  292. package/dist/sync/http-transport.d.ts.map +1 -0
  293. package/dist/sync/index.d.ts +22 -0
  294. package/dist/sync/index.d.ts.map +1 -0
  295. package/dist/sync/memory-transport.d.ts +27 -0
  296. package/dist/sync/memory-transport.d.ts.map +1 -0
  297. package/dist/sync/multi-repo.d.ts +82 -0
  298. package/dist/sync/multi-repo.d.ts.map +1 -0
  299. package/dist/sync/reconciler.d.ts +48 -0
  300. package/dist/sync/reconciler.d.ts.map +1 -0
  301. package/dist/sync/sync-engine.d.ts +65 -0
  302. package/dist/sync/sync-engine.d.ts.map +1 -0
  303. package/dist/sync/types.d.ts +71 -0
  304. package/dist/sync/types.d.ts.map +1 -0
  305. package/dist/sync/ws-transport.d.ts +41 -0
  306. package/dist/sync/ws-transport.d.ts.map +1 -0
  307. package/dist/tenancy-7d1g4ayp.js +13 -0
  308. package/dist/ui/client.html +460 -664
  309. package/dist/ui/server.d.ts +42 -0
  310. package/dist/ui/server.d.ts.map +1 -0
  311. package/dist/vcs/blob-store.d.ts +49 -0
  312. package/dist/vcs/blob-store.d.ts.map +1 -0
  313. package/dist/vcs/branch.d.ts +35 -0
  314. package/dist/vcs/branch.d.ts.map +1 -0
  315. package/dist/vcs/checkpoint.d.ts +24 -0
  316. package/dist/vcs/checkpoint.d.ts.map +1 -0
  317. package/dist/vcs/decompose.d.ts +19 -0
  318. package/dist/vcs/decompose.d.ts.map +1 -0
  319. package/dist/vcs/diff.d.ts +65 -0
  320. package/dist/vcs/diff.d.ts.map +1 -0
  321. package/dist/vcs/engine-context.d.ts +21 -0
  322. package/dist/vcs/engine-context.d.ts.map +1 -0
  323. package/dist/vcs/index.d.ts +23 -0
  324. package/dist/vcs/index.d.ts.map +1 -0
  325. package/dist/vcs/index.js +2 -2
  326. package/dist/vcs/issue.d.ts +159 -0
  327. package/dist/vcs/issue.d.ts.map +1 -0
  328. package/dist/vcs/merge.d.ts +55 -0
  329. package/dist/vcs/merge.d.ts.map +1 -0
  330. package/dist/vcs/milestone.d.ts +30 -0
  331. package/dist/vcs/milestone.d.ts.map +1 -0
  332. package/dist/vcs/ops.d.ts +27 -0
  333. package/dist/vcs/ops.d.ts.map +1 -0
  334. package/dist/vcs/types.d.ts +95 -0
  335. package/dist/vcs/types.d.ts.map +1 -0
  336. package/dist/vcs/vcs-middleware.d.ts +14 -0
  337. package/dist/vcs/vcs-middleware.d.ts.map +1 -0
  338. package/dist/vm-config-6xhsj6b3.js +22 -0
  339. package/dist/watcher/fs-watcher.d.ts +51 -0
  340. package/dist/watcher/fs-watcher.d.ts.map +1 -0
  341. package/dist/watcher/index.d.ts +9 -0
  342. package/dist/watcher/index.d.ts.map +1 -0
  343. package/dist/watcher/ingestion.d.ts +28 -0
  344. package/dist/watcher/ingestion.d.ts.map +1 -0
  345. package/package.json +57 -7
  346. package/dist/index-hybgxe40.js +0 -1174
package/README.md CHANGED
@@ -1,764 +1,123 @@
1
1
  # Trellis
2
2
 
3
- > **A comprehensive graph-native platform for code, knowledge, and collaboration.**
3
+ https://trellis.computer
4
4
 
5
- | Capability | Description |
6
- | :--------------------- | :------------------------------------------------------------ |
7
- | **Graph-Native VCS** | Immutable causal ops, semantic patching, narrative milestones |
8
- | **Knowledge Graph** | EAV store, wiki-links, embeddings, ontology validation |
9
- | **Intelligent Agents** | Tool registry, decision traces, agent orchestration |
10
- | **Collaboration** | Peer sync, multi-repo federation, HTTP/WebSocket transports |
5
+ > **The Agentic Framework** — A structured runtime for building agents that understand code, remember everything, and explain themselves.
6
+
7
+ | Use Case | How |
8
+ | :----------------------------- | :-------------------------------------------------------------------------------------------------------- |
9
+ | **Agentic State Engine** | Tool registry + decision traces + branching — agents operate on state they can fork, audit, and roll back |
10
+ | **Building Agents End-to-End** | Unified LLM abstraction + context management + RAG + orchestration |
11
+ | **Autonomous Code Editing** | Semantic patching + AST-aware tools + causal history |
12
+ | **Auditable Reasoning** | Immutable op log + decision traces + precedent search |
11
13
 
12
14
  ---
13
15
 
14
- ## Table of Contents
16
+ ## Why Trellis?
15
17
 
16
- - [Quick Start](#quick-start)
17
- - [Platform Overview](#platform-overview)
18
- - [Core Capabilities](#core-capabilities)
19
- - [Project Surfaces](#project-surfaces)
20
- - [Package Architecture](#package-architecture)
21
- - [CLI Overview](#cli-overview)
22
- - [VS Code Extension](#vs-code-extension)
23
- - [Module & Subpath Guide](#module--subpath-guide)
24
- - [Development & Releases](#development--releases)
25
- - [Roadmap](#roadmap)
18
+ Most agent frameworks focus on the _reasoning engine_ (the LLM) but treat _state_ as an afterthought. Trellis reverses this. It is the **System of Record for Decisions**, providing agents with a persistent, queryable, and auditable memory that compounds over time.
26
19
 
27
- ---
20
+ **[Read the story →](./THE-STORY.md)**
28
21
 
29
- ## Quick Start
22
+ - **Durable Memory**: Every thought, tool call, and file change is an immutable operation in a causal graph
23
+ - **Explainability by Default**: Decision traces don't just store _what_ happened, but _why_
24
+ - **Safe Exploration**: Agents can "fork" state to explore multiple paths
30
25
 
31
- ### Install
26
+ ---
32
27
 
33
- Global install:
28
+ ## Quick Start
34
29
 
35
30
  ```bash
31
+ # 1. Install
36
32
  npm install -g trellis
37
- trellis -h
38
- ```
39
33
 
40
- Or use npx:
34
+ # 2. Initialize a repository
35
+ mkdir my-project && cd my-project
36
+ trellis init
41
37
 
42
- ```bash
43
- npx trellis -h
44
- ```
38
+ # 3. Create content (tracked automatically)
39
+ echo "# My Project" > README.md
45
40
 
46
- ### Initialize a repository
41
+ # 4. Add structured entities
42
+ trellis issue create --title "Bootstrap Visualization"
43
+ trellis milestone "Initial Release"
47
44
 
48
- ```bash
49
- # With the CLI
50
- npx trellis init
51
- npx trellis watch
52
-
53
- # Or programmatically
54
- import { TrellisVcsEngine } from 'trellis';
55
- const engine = new TrellisVcsEngine({ rootPath: '/my/project' });
56
- await engine.initRepo();
45
+ # 5. Visualize the system (auto-opens browser)
46
+ trellis code
57
47
  ```
58
48
 
59
- ### Import from Git
60
-
61
- ```bash
62
- npx trellis import --from /path/to/git-repo
63
- ```
49
+ See the [CLI guide](https://trellis.computer/docs/cli) for complete documentation.
64
50
 
65
51
  ---
66
52
 
67
- ## Platform Overview
68
-
69
- Trellis is a comprehensive platform that unifies version control, knowledge management, semantic analysis, and intelligent automation. Built on a graph-native foundation, it treats every action—code changes, decisions, links, and embeddings—as first-class entities in a causal graph.
53
+ ## What is Trellis?
70
54
 
71
- The platform consists of multiple integrated surfaces:
72
-
73
- - **`trellis` npm package** — the published package exposing all platform APIs through modular subpaths
74
- - **`trellis` CLI** — command-line interface for repository management, semantic tooling, knowledge operations, and automation
75
- - **VS Code extension** — visual interface for timeline exploration, issue management, knowledge navigation, and collaborative features
76
- - **Core platform modules** — reusable building blocks for graph storage, semantic analysis, sync, knowledge graphs, embeddings, and decision traces
77
-
78
- ### Core Capabilities
79
-
80
- #### 1. **Graph-Native Foundation**
81
-
82
- - **EAV Store** — Entity-Attribute-Value graph database with SQLite backend
83
- - **TrellisKernel** — Generic graph CRUD operations independent of VCS
84
- - **Query Engine** — EQL-S query language and Datalog evaluator
85
- - **Ontology System** — Schema validation and built-in ontologies
86
-
87
- #### 2. **Advanced Version Control**
88
-
89
- - **Causal Stream** — Immutable, content-addressed operations with causal chaining
90
- - **Semantic Patching** — AST-aware changes enabling conflict-free merges
91
- - **Narrative Milestones** — Human-readable checkpoints over continuous work streams
92
- - **Governance** — Op signing, identity management, and policy enforcement
93
-
94
- #### 3. **Knowledge & Intelligence**
95
-
96
- - **Wiki-Links** — Bidirectional reference system for cross-linking entities
97
- - **Embeddings** — Semantic indexing and vector search for intelligent discovery
98
- - **Decision Traces** — Automated capture and querying of agent decisions
99
- - **Idea Garden** — Detection and revival of abandoned work clusters
100
-
101
- #### 4. **Collaboration & Sync**
102
-
103
- - **Peer Sync** — CRDT-based reconciliation with HTTP/WebSocket transports
104
- - **Multi-Repo Federation** — Cross-repository entity references and linking
105
- - **Agent System** — Tool registry and decision trace capture
106
- - **Plugin Architecture** — Extensible system with event bus and workspace config
107
-
108
- ## Project Surfaces
109
-
110
- | Surface | Location | Purpose |
111
- | :-------------------- | :------------------------------------------------------------ | :----------------------------------------------------------------------- |
112
- | **npm package** | `package.json`, `src/`, `dist/` | Published as `trellis`; exposes all platform APIs via subpaths |
113
- | **CLI** | `src/cli/index.ts` | Repository lifecycle, semantic tooling, knowledge operations, automation |
114
- | **VS Code extension** | `vscode-extension/` | Timeline, knowledge navigation, issue management, collaborative UX |
115
- | **Core platform** | `src/core/` | EAV store, kernel, ontology, query, agents, plugins |
116
- | **Platform modules** | `src/vcs/`, `src/links/`, `src/embeddings/`, `src/decisions/` | Specialized subsystems for version control, knowledge, and intelligence |
117
-
118
- ---
119
-
120
- ## Package Architecture
121
-
122
- ```
123
- trellis/
124
- ├── src/
125
- │ ├── core/ # EAV store, kernel, ontology, query, agents, plugins
126
- │ │ ├── kernel/ # TrellisKernel with entity CRUD and middleware
127
- │ │ ├── ontology/ # Schema registry, validation, built-in ontologies
128
- │ │ ├── query/ # EQL-S query engine and Datalog evaluator
129
- │ │ ├── agents/ # Agent harness, tool registry, decision traces
130
- │ │ └── plugins/ # Plugin registry, event bus, workspace config
131
- │ ├── vcs/ # Version control: ops, branches, milestones, diff, merge
132
- │ ├── links/ # Wiki-link parsing, resolution, backlink index
133
- │ ├── embeddings/ # Semantic indexing, vector search, auto-embed, RAG
134
- │ ├── decisions/ # Decision trace capture and querying
135
- │ ├── semantic/ # AST parsers, semantic diff, semantic merge
136
- │ ├── sync/ # Peer sync, CRDT reconciler, HTTP/WebSocket transports, multi-repo
137
- │ ├── garden/ # Idea Garden: abandoned work detection and revival
138
- │ ├── git/ # Git import/export bridge
139
- │ ├── identity/ # Ed25519 identity management and governance
140
- │ ├── watcher/ # File watching + ingestion pipeline
141
- │ ├── mcp/ # Model Context Protocol server integration
142
- │ ├── cli/ # CLI entrypoint
143
- │ ├── engine.ts # Composition root
144
- │ └── index.ts # Main package entrypoint
145
- ├── vscode-extension/ # VS Code extension surface
146
- ├── test/ # Comprehensive test suites
147
- ├── DESIGN.md # Detailed architecture specification
148
- └── justfile # Local build and development recipes
149
- ```
150
-
151
- ### The Op Stream
152
-
153
- Every action in Trellis is an immutable `VcsOp`:
55
+ Trellis is an **event-sourced causal graph engine** that unifies version control, knowledge management, and semantic analysis. Every action is an immutable operation in a causal stream:
154
56
 
155
57
  ```typescript
156
58
  interface VcsOp {
157
- hash: string; // trellis:op:<sha256> — content-addressed
59
+ hash: string; // content-addressed
158
60
  kind: VcsOpKind; // e.g. 'vcs:fileModify'
159
61
  timestamp: string; // ISO 8601
160
- agentId: string; // Author identity (DID)
62
+ agentId: string; // Author identity
161
63
  previousHash?: string; // Causal chain link
162
- vcs: VcsPayload; // Op-specific data (filePath, contentHash, …)
163
- signature?: string; // Ed25519 signature (P4+)
64
+ vcs: VcsPayload; // Op-specific data
65
+ signature?: string; // Ed25519 signature
164
66
  }
165
67
  ```
166
68
 
167
- Ops are written to `.trellis/ops.json` and replayed into an in-memory EAV graph on startup. They are **never rewritten or deleted**.
69
+ Ops are written to `.trellis/ops.json` and **never rewritten or deleted**.
168
70
 
169
- ### Op Tiers
71
+ ### Platform Surfaces
170
72
 
171
- | Tier | Kinds | Description |
172
- | :---- | :---------------------------------------------------------- | :-------------------------------- |
173
- | **0** | `fileAdd`, `fileModify`, `fileDelete`, `fileRename` | File-level mutations from watcher |
174
- | **1** | `dirAdd`, `dirDelete`, `branchCreate`, `milestoneCreate`, … | Structural VCS control ops |
175
- | **2** | `symbolRename`, `symbolMove`, `symbolExtract` | AST-level semantic patches |
73
+ | Surface | Purpose |
74
+ | :-------------------- | :--------------------------------------- |
75
+ | `trellis` npm package | Core platform APIs via subpaths |
76
+ | `trellis` CLI | Repository management and automation |
77
+ | VS Code extension | Visual timeline and knowledge navigation |
176
78
 
177
79
  ---
178
80
 
179
- ## CLI Overview
180
-
181
- The CLI is the operational surface for Trellis repositories. It is the fastest way to initialize repos, inspect history, create milestones, diff/merge work, and script automation around the op stream.
182
-
183
- ### Repository Setup
184
-
185
- ```bash
186
- trellis init [--path <dir>] # Initialize a new repo
187
- trellis import --from <git-repo> # Import Git history as milestones
188
- trellis export --to <dir> # Export milestones to Git commits
189
- ```
190
-
191
- ### Working
192
-
193
- ```bash
194
- trellis status # Current branch, op count, pending changes
195
- trellis log [--limit N] [--branch b] # Op stream history
196
- trellis files [--deleted] # All tracked files
197
- trellis watch # Start continuous file watching
198
- ```
199
-
200
- ### Branches
201
-
202
- ```bash
203
- trellis branch # List branches
204
- trellis branch <name> # Create a branch
205
- trellis branch -d <name> # Delete a branch
206
- ```
207
-
208
- ### Milestones & Checkpoints
209
-
210
- ```bash
211
- trellis milestone create -m "message" # Create milestone
212
- trellis milestone create -m "msg" --from <hash> --to <hash> # Over a specific range
213
- trellis milestone list # List milestones
214
- trellis checkpoint create # Manual checkpoint
215
- trellis checkpoint list # List checkpoints
216
- ```
217
-
218
- ### Diff & Merge
219
-
220
- ```bash
221
- trellis diff [--from <hash>] [--to <hash>] # File-level diff
222
- trellis merge --branch <name> [--dry-run] # Three-way merge
223
- trellis parse <file> # Semantic parse (declarations, imports)
224
- trellis sdiff <fileA> <fileB> # Semantic diff between two versions
225
- ```
81
+ ## Documentation
226
82
 
227
- ### Identity & Governance
228
-
229
- ```bash
230
- trellis identity [show|create|list] # Manage identities
231
- trellis governance [list|add|remove] # Manage policy rules
232
- ```
233
-
234
- ### Idea Garden
235
-
236
- ```bash
237
- trellis garden # List abandoned clusters
238
- trellis garden list [--status <s>] [--file <f>] # Filter clusters
239
- trellis garden show <cluster-id> # Inspect a cluster
240
- trellis garden search --keyword <term> # Search by keyword
241
- trellis garden revive <cluster-id> # Revive cluster as branch
242
- trellis garden stats # Garden statistics
243
- ```
244
-
245
- ### Sync
246
-
247
- ```bash
248
- trellis sync status # Local sync state
249
- trellis sync reconcile --remote <path> # Reconcile with another local repo
250
- trellis sync push --peer <id> # Push ops to a peer (HTTP/WebSocket)
251
- trellis sync pull --peer <id> # Pull ops from a peer
252
- trellis link-repo <alias> <location> # Link a remote repo for cross-repo refs
253
- ```
254
-
255
- ### Query & Search
256
-
257
- ```bash
258
- trellis query "find Project where status = 'active'" # EQL-S structured query
259
- trellis query-repl # Interactive query REPL
260
- trellis ask "authentication code" # Natural language semantic search
261
- trellis ask "show me auth code" --rag # Output as RAG context for LLMs
262
- ```
263
-
264
- ### Ontology
265
-
266
- ```bash
267
- trellis ontology list # List registered ontologies
268
- trellis ontology show <id> # Show ontology details
269
- trellis ontology validate # Validate store against ontologies
270
- ```
271
-
272
- ### Agents
273
-
274
- ```bash
275
- trellis agent list # List registered agents
276
- trellis agent create <name> # Create a new agent definition
277
- trellis agent run <id> --input "task" # Execute an agent run
278
- trellis agent inspect <run-id> # View run details and decision traces
279
- ```
280
-
281
- ### Plugins
282
-
283
- ```bash
284
- trellis plugin list # List loaded plugins
285
- trellis plugin add <id> # Register and load a plugin
286
- trellis plugin remove <id> # Unload and unregister a plugin
287
- ```
83
+ - **[Full documentation](https://trellis.computer)** — Complete guides and API reference
84
+ - **[CLI reference](./README-ARCHIVED.md#cli-overview)** — Command details (archived)
85
+ - **[API modules](./README-ARCHIVED.md#module--subpath-guide)** — Subpath imports (archived)
86
+ - **[DESIGN.md](./DESIGN.md)** Architecture specification
288
87
 
289
88
  ---
290
89
 
291
- ## VS Code Extension
292
-
293
- The VS Code extension provides a rich visual interface for the entire Trellis platform, making knowledge navigation, collaboration, and project management intuitive and efficient.
294
-
295
- ### Core Features
296
-
297
- - **Status Dashboard** — Real-time view of repository health, activity metrics, and system state
298
- - **Causal Timeline** — Interactive exploration of the complete operation history with filtering and search
299
- - **Knowledge Navigator** — Browse and traverse the wiki-link graph with visual connections
300
- - **Issue Management** — Full lifecycle issue management with drag-and-drop workflow automation
301
- - **Semantic Explorer** — Navigate code structure and relationships through AST-aware visualizations
302
- - **Decision Inspector** — Review decision traces and understand the reasoning behind changes
303
- - **Collaboration Hub** — Multi-repo federation view and cross-project relationship mapping
304
- - **Intelligence Panel** — Semantic search, RAG context, and AI-powered insights
305
-
306
- The extension lives in [`vscode-extension/`](./vscode-extension) and publishes separately from the npm package.
307
-
308
- ---
309
-
310
- ## Module & Subpath Guide
311
-
312
- The `trellis` package is intentionally split into subpaths so consumers can depend on the specific capabilities they need, from core graph operations to advanced AI features.
313
-
314
- ### Published Package Surface
90
+ ## Development
315
91
 
316
92
  ```bash
317
- npm install trellis
318
- ```
319
-
320
- ```typescript
321
- // Main entry — full platform engine
322
- import { TrellisVcsEngine } from 'trellis';
323
-
324
- // Core graph foundation (independent of VCS)
325
- import { EAVStore, TrellisKernel } from 'trellis/core';
326
- import type { Fact, Link, EntityRecord } from 'trellis/core';
327
-
328
- // Version control primitives
329
- import type { VcsOp, VcsOpKind } from 'trellis/vcs';
330
-
331
- // Knowledge and intelligence
332
- import { EmbeddingManager } from 'trellis/ai';
333
- import { parseFileRefs, resolveRef, RefIndex } from 'trellis/links';
334
- import { recordDecision, queryDecisions } from 'trellis/decisions';
335
- ```
336
-
337
- ### `trellis` — Platform Engine (`TrellisVcsEngine`)
338
-
339
- The main entry point that orchestrates the entire platform: kernel, file watcher, version control, knowledge graphs, semantic analysis, and collaboration features.
340
-
341
- ```typescript
342
- import { TrellisVcsEngine } from 'trellis';
343
-
344
- const engine = new TrellisVcsEngine({ rootPath: '/my/project' });
345
-
346
- // Repository management
347
- await engine.initRepo();
348
- engine.open();
349
-
350
- // Core operations
351
- engine.getOps(); // All operations
352
- engine.status(); // Branch, op count, files
353
- engine.log(); // Formatted history
354
- engine.getFiles(); // Currently tracked files
355
-
356
- // Version control
357
- await engine.createBranch('feature/x');
358
- await engine.createMilestone('Implement auth', { fromOpHash, toOpHash });
359
-
360
- // Semantic analysis
361
- engine.parseFile(content, 'src/auth.ts');
362
- engine.semanticDiff(oldContent, newContent, 'src/auth.ts');
363
-
364
- // Knowledge operations
365
- const garden = engine.garden();
366
- garden.listClusters();
367
- garden.search({ keyword: 'auth' });
368
-
369
- // Intelligence features
370
- const embeddings = engine.embeddings();
371
- await embeddings.search('authentication flow');
372
- ```
373
-
374
- ### `trellis/core` — Graph Foundation
375
-
376
- The core graph layer exposes EAV primitives, ontology schemas, query engine, agent harness, and plugin system. This module is independent of version control and can be used for any graph-based application.
377
-
378
- ```typescript
379
- import { EAVStore, TrellisKernel } from 'trellis/core';
380
- import { OntologyRegistry, builtinOntologies } from 'trellis/core';
381
- import { QueryEngine, parseQuery } from 'trellis/core';
382
- import { AgentHarness } from 'trellis/core';
383
- import { PluginRegistry, EventBus } from 'trellis/core';
384
- import type { Fact, Link, KernelOp, AgentDef, PluginDef } from 'trellis/core';
385
-
386
- // Graph operations
387
- const kernel = new TrellisKernel({ backend, agentId: 'me' });
388
- await kernel.createEntity('proj:1', 'Project', {
389
- name: 'Trellis',
390
- status: 'active',
391
- });
392
-
393
- // Ontology validation
394
- const registry = new OntologyRegistry();
395
- for (const o of builtinOntologies) registry.register(o);
396
-
397
- // Graph queries
398
- const query = parseQuery('find Project where status = "active"');
399
- const results = new QueryEngine(store).eval(query);
400
-
401
- // Agent orchestration
402
- const harness = new AgentHarness(kernel);
403
- await harness.createAgent({ name: 'Reviewer', status: 'active' });
404
-
405
- // Plugin system
406
- const plugins = new PluginRegistry();
407
- plugins.register({ id: 'my:plugin', name: 'My Plugin', version: '1.0.0' });
408
- ```
409
-
410
- ### `trellis/vcs` — Version Control Model
411
-
412
- The VCS subpath exposes operation types and domain-level building blocks for version control: branches, milestones, checkpoints, issues, diffing, merging, and blob storage.
413
-
414
- Use this subpath when you want Trellis version control capabilities without the full platform surface.
415
-
416
- ### `trellis/links` — Knowledge Graph & Wiki-Links
417
-
418
- Parse `[[wiki-links]]` from markdown, doc-comments, and source files. Resolve references to issues, files, symbols, milestones, and decisions. Build a bidirectional knowledge graph that connects all entities in your workspace.
419
-
420
- ```typescript
421
- import { parseFileRefs, resolveRef, RefIndex } from 'trellis/links';
422
-
423
- const refs = parseFileRefs('src/engine.ts', source);
424
- const resolved = resolveRef(ref, context);
425
- const index = new RefIndex();
426
- index.indexFile('README.md', refs, context);
427
- index.getIncoming('issue:TRL-5');
428
-
429
- // Cross-repository references
430
- index.addCrossRepoLink('frontend', 'proj:app', 'backend', 'api:users');
431
- ```
432
-
433
- ### `trellis/ai` — Semantic Intelligence
434
-
435
- Advanced semantic capabilities: embed issues, milestones, files, code entities, and decisions into a vector store for intelligent search, discovery, and RAG (Retrieval-Augmented Generation).
436
-
437
- ```typescript
438
- import { EmbeddingManager } from 'trellis/ai';
439
-
440
- const manager = new EmbeddingManager(engine, { dbPath: 'embeddings.db' });
441
- await manager.reindex();
442
- const results = await manager.search('auth flow');
443
-
444
- // RAG context for LLMs
445
- const context = await manager.getRAGContext('authentication implementation');
446
- ```
447
-
448
- ### `trellis/decisions` — Decision Intelligence
449
-
450
- Automatically capture tool invocations and agent decisions as auditable traces. Enrich them with rationale via hooks and query them later by tool, entity, or decision chain. Perfect for understanding how and why decisions were made.
451
-
452
- ```typescript
453
- import { recordDecision, queryDecisions } from 'trellis/decisions';
454
-
455
- const dec = await recordDecision(ctx, {
456
- toolName: 'trellis_issue_create',
457
- input: { title: 'Add parser' },
458
- output: { id: 'TRL-5' },
459
- rationale: 'Needed for TypeScript support',
460
- });
461
-
462
- // Query decision patterns
463
- const decs = queryDecisions(ctx, { tool: 'trellis_issue_*' });
464
- const chain = queryDecisions(ctx, { entity: 'TRL-5' }); // Full decision chain
465
- ```
93
+ # Prerequisites
94
+ # Requires Bun ≥ 1.0
466
95
 
467
- ### `src/garden/` — Idea Garden
468
-
469
- Detects abandoned work using three heuristics, then exposes a query API.
470
-
471
- ```typescript
472
- import { detectClusters, IdeaGarden } from './src/garden/index.js';
473
-
474
- const clusters = detectClusters(ops, milestonedHashes);
475
- const garden = new IdeaGarden(ops, milestones);
476
-
477
- garden.search({ file: 'auth.ts', status: 'abandoned', limit: 10 });
478
- garden.stats(); // { total, abandoned, draft, revived, totalOps, totalFiles }
479
- garden.revive('cluster:abc');
480
- ```
481
-
482
- ### Platform Subsystem Guides
483
-
484
- The following sections provide detailed guides for Trellis' internal subsystems. These are useful if you're contributing to the platform or extending its capabilities.
485
-
486
- #### Knowledge Graph & Wiki-Links (`src/links/`)
487
-
488
- Builds a bidirectional knowledge graph from wiki-link references across all workspace entities.
489
-
490
- **Detection heuristics:**
491
-
492
- | Heuristic | Trigger | Signal |
493
- | :---------------------- | :------------------ | :---------------------------------------------------------------- |
494
- | `contextSwitchDetector` | File-set pivot | Group of ops in unrelated dirs followed by a context switch away |
495
- | `revertDetector` | Complementary ops | Ops undone by a subsequent inverse op (add→delete, modify→revert) |
496
- | `staleBranchDetector` | Time + no milestone | Ops on non-`main` branches untouched >7 days without a milestone |
497
-
498
- #### Semantic Intelligence (`src/semantic/`)
499
-
500
- Advanced TypeScript/JavaScript analysis with structural entity extraction and semantic diffing for intelligent code understanding.
501
-
502
- ```typescript
503
- import { typescriptParser, semanticMerge } from './src/semantic/index.js';
504
-
505
- // Parse code into structural entities
506
- const result = typescriptParser.parse(source, 'file.ts');
507
- result.declarations; // ASTEntity[] — functions, classes, interfaces, enums, …
508
- result.imports; // ImportRelation[]
509
- result.exports; // ExportRelation[]
510
-
511
- // Compute semantic differences
512
- const patches = typescriptParser.diff(oldResult, newResult);
513
- // SemanticPatch[] — symbolAdd | symbolRemove | symbolModify |
514
- // symbolRename | importAdd | importRemove | …
515
-
516
- // Intelligent merging with conflict resolution
517
- const merged = semanticMerge(ourPatches, theirPatches, 'file.ts');
518
- merged.clean; // true if no conflicts
519
- merged.patches; // Merged patch list
520
- merged.conflicts; // SemanticMergeConflict[] — entity-level, with suggestions
521
- ```
522
-
523
- ### `src/sync/` — Peer Sync
524
-
525
- Implements the have→want→ops→ack protocol with linear and CRDT branch modes.
526
-
527
- ```typescript
528
- import { SyncEngine, MemoryTransport, reconcile } from './src/sync/index.js';
529
-
530
- // Standalone CRDT reconciler
531
- const result = reconcile(localOps, remoteOps);
532
- result.merged; // Interleaved by timestamp
533
- result.forkPoint; // Last common op hash
534
- result.conflicts; // File-level conflicts
535
-
536
- // Full sync engine
537
- const transport = new MemoryTransport('peer-a', 'Alice');
538
- const engine = new SyncEngine({
539
- localPeerId: 'peer-a',
540
- transport,
541
- getLocalOps: () => ops,
542
- onOpsReceived: (newOps) => {
543
- /* integrate */
544
- },
545
- branchPolicy: { linear: false }, // CRDT mode
546
- });
547
-
548
- await engine.pushTo('peer-b');
549
- await engine.pullFrom('peer-b');
550
- engine.reconcileWith(remoteOps);
551
- ```
552
-
553
- #### Collaboration & Sync (`src/sync/`)
554
-
555
- Enterprise-grade synchronization with CRDT reconciliation, multiple transport protocols, and multi-repo federation for distributed teams.
556
-
557
- ```typescript
558
- import {
559
- SyncEngine,
560
- MemoryTransport,
561
- reconcile,
562
- HttpSyncTransport,
563
- WebSocketSyncTransport,
564
- MultiRepoManager,
565
- formatCrossRepoRef,
566
- } from './src/sync/index.js';
567
-
568
- // CRDT reconciler for conflict-free merging
569
- const result = reconcile(localOps, remoteOps);
570
- result.merged; // Interleaved by timestamp
571
- result.forkPoint; // Last common op hash
572
- result.conflicts; // File-level conflicts
573
-
574
- // HTTP transport for network sync
575
- const httpTransport = new HttpSyncTransport('peer-a');
576
- httpTransport.addPeer('peer-b', 'http://192.168.1.10:4200');
577
-
578
- // WebSocket transport for real-time collaboration
579
- const wsTransport = new WebSocketSyncTransport('peer-a');
580
- await wsTransport.connect('peer-b', 'ws://192.168.1.10:4201');
581
-
582
- // Multi-repo federation — connect knowledge across repositories
583
- const repoManager = new MultiRepoManager(kernel);
584
- await repoManager.linkRepo(
585
- 'backend',
586
- '/path/to/backend-api',
587
- 'Backend service',
588
- );
589
- await repoManager.addCrossRepoLink(
590
- 'proj:frontend',
591
- 'dependsOn',
592
- 'backend',
593
- 'lib:api-client',
594
- );
595
- // Creates: proj:frontend --dependsOn--> @backend:lib:api-client
596
-
597
- // Discover cross-repository relationships
598
- const refs = repoManager.findReferencesTo('backend', 'lib:api-client');
599
- ```
600
-
601
- These subsystem guides provide insight into Trellis' internal architecture. They're particularly useful for platform contributors, extenders, or those building custom integrations.
602
-
603
- ---
604
-
605
- ## How It Works
606
-
607
- ### Init Flow
608
-
609
- ```
610
- trellis init
611
- → mkdirSync .trellis/
612
- → write config.json (agentId, defaultBranch, ignorePatterns)
613
- → create vcs:branchCreate op for "main"
614
- → scan filesystem → create vcs:fileAdd op per file
615
- → flush ops to .trellis/ops.json
616
- ```
617
-
618
- ### Watch Flow
619
-
620
- ```
621
- trellis watch
622
- → FileWatcher.scan() populates known-files map
623
- → FileWatcher.start() sets up Bun fs.watch
624
- → on change → debounce → SHA-256 hash → emit FileChangeEvent
625
- → Ingestion.process(event) → createVcsOp(kind, payload)
626
- → engine.applyOp(op) → EAV store + op log
627
- → auto-checkpoint if threshold crossed
628
- ```
629
-
630
- ### Milestone Flow
631
-
632
- ```
633
- trellis milestone create -m "Add auth"
634
- → auto-detect fromOpHash (last milestone's toOpHash + 1)
635
- → collect affected files from ops in range
636
- → createVcsOp('vcs:milestoneCreate', { message, fromOpHash, toOpHash, affectedFiles })
637
- → optional: trellis export → Git commit
638
- ```
639
-
640
- ### Semantic Diff Flow
641
-
642
- ```
643
- trellis sdiff old.ts new.ts
644
- → typescriptParser.parse(old) → ParseResult { declarations, imports, exports }
645
- → typescriptParser.parse(new) → ParseResult
646
- → typescriptParser.diff(old, new) → SemanticPatch[]
647
- - symbolAdd / symbolRemove / symbolModify
648
- - symbolRename (detected via signature similarity)
649
- - importAdd / importRemove / importModify
650
- ```
651
-
652
- ### Sync / Reconcile Flow
653
-
654
- ```
655
- Engine A sends 'have' { heads: { main: 'h42' }, opCount: 42 }
656
- → Engine B compares to its own heads
657
- → B sends 'want' { afterHash: 'h38' }
658
- → A sends 'ops' [ op39, op40, op41, op42 ]
659
- → B integrates new ops (linear: filter dupes; CRDT: reconcile())
660
- → B sends 'ack' { integrated: ['h39', …] }
661
- ```
662
-
663
- ---
664
-
665
- ## Design Doc
666
-
667
- See [`DESIGN.md`](./DESIGN.md) for the complete platform architecture specification, including:
668
-
669
- - §3 — Causal stream and branch concurrency model
670
- - §4 — Semantic patching: parser adapter interface, patch types, commutativity
671
- - §5 — Milestone narrative model
672
- - §6 — Identity, signing, and governance
673
- - §7 — Idea Garden cluster detection heuristics
674
- - §8 — Knowledge graph and wiki-link system
675
- - §9 — Embeddings and semantic search architecture
676
- - §10 — Decision trace capture and querying
677
- - §11 — Sync protocols and multi-repo federation
678
- - §12 — Core graph kernel and ontology system
679
- - §13 — Agent harness and plugin architecture
680
- - §14 — Open questions and architectural trade-offs
681
-
682
- ---
683
-
684
- ## Development & Releases
685
-
686
- ### Prerequisites
687
-
688
- - [Bun](https://bun.sh) ≥ 1.0
689
- - No other native dependencies
690
-
691
- ### Install
692
-
693
- ```bash
96
+ # Install dependencies
694
97
  bun install
695
- ```
696
-
697
- ### Test
698
98
 
699
- ```bash
700
- just test-core
701
- # or run the full suite when working on those areas:
99
+ # Run tests
702
100
  bun test
703
- ```
704
-
705
- **The release flow currently validates against the targeted passing core suite.**
706
-
707
- ### Typecheck
708
-
709
- ```bash
710
- bun run typecheck
711
- ```
712
-
713
- ### Build
714
101
 
715
- ```bash
716
- # Build for npm (bun build → dist/)
102
+ # Build for npm
717
103
  bun run build
718
-
719
- # Run CLI directly during development
720
- bun run src/cli/index.ts <command>
721
104
  ```
722
105
 
723
106
  ---
724
107
 
725
- ### Release Workflow
726
-
727
- ```bash
728
- # Validate locally without publishing
729
- just publish-dry-run
730
-
731
- # Publish to npm locally, then tag/push/create release metadata
732
- just publish
733
- ```
108
+ ## Status
734
109
 
735
- > **Requires [Bun](https://bun.sh) 1.0** — Trellis uses `bun:sqlite` for the vector store and Bun's native TypeScript support for optimal performance.
110
+ | Phase | Deliverable | Status |
111
+ | :---- | :------------------------- | :----- |
112
+ | P0 | Causal stream + CLI | ✅ |
113
+ | P0.5 | VS Code extension | ✅ |
114
+ | P1 | Git import bridge | ✅ |
115
+ | P2 | Branches, milestones | ✅ |
116
+ | P2.5 | Blob store, modularization | ✅ |
117
+ | P3 | File-level diff + merge | ✅ |
118
+ | P4 | Identity + governance | ✅ |
119
+ | P5 | Idea Garden | ✅ |
736
120
 
737
121
  ---
738
122
 
739
- ## Roadmap
740
-
741
- | Phase | Deliverable | Status | Commit |
742
- | :---- | :------------------------------------------------- | :----- | :---------- |
743
- | P0 | Causal stream + CLI | ✅ | `51475d3` |
744
- | P0.5 | VS Code extension / visual timeline | ✅ | `947d5a1` |
745
- | P1 | Git import bridge | ✅ | `f4cc4a6` |
746
- | P2 | Branches, milestones, checkpoints | ✅ | `3f91e9a` |
747
- | P2.5 | Blob store, engine modularization, git exporter | ✅ | `5c43a31` |
748
- | P3 | File-level diff + text-based merge | ✅ | `c953654` |
749
- | P4 | Identity + op signing + governance | ✅ | `3acddda` |
750
- | P5 | Idea Garden — cluster detection + query | ✅ | `105a207` |
751
- | P6 | Semantic patching — parser adapter + diff/merge | ✅ | `22192ae` |
752
- | P7 | Peer sync + CRDT reconciler | ✅ | `d02f3f7` |
753
- | P8 | Wiki-links, embeddings, decision traces | ✅ | `b9cd5b7` |
754
- | P9 | npm package + VSCode extension publish | ✅ | `57bad37` |
755
- | P10 | Graph kernel + SQLite backend + entity CRUD | ✅ | |
756
- | P11 | EQL-S query engine + Datalog evaluator | ✅ | |
757
- | P12 | Ontology system + validation middleware | ✅ | |
758
- | P13 | Transformers.js upgrade + auto-embed + RAG | ✅ | |
759
- | P14 | Agent harness + tool registry + decision traces | ✅ | |
760
- | P15 | Plugin system + event bus + workspace config | ✅ | |
761
- | P16 | Sync federation + multi-repo linking | ✅ | |
762
- | P17 | Advanced knowledge graph + cross-repo intelligence | 🚧 | In Progress |
763
- | P18 | Enterprise collaboration features + RBAC | 📋 | Planned |
764
- | P19 | Advanced AI capabilities + intelligent automation | 📋 | Planned |
123
+ _For comprehensive documentation including detailed CLI commands, API examples, and subsystem guides, see [README-ARCHIVED.md](./README-ARCHIVED.md)._