trellis 2.0.5 → 2.0.6

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 (2) hide show
  1. package/README.md +196 -166
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <p align="center">
2
- <img src="logo.png" alt="TrellisVCS" width="128" />
2
+ <img src="logo.png" alt="Trellis" width="128" />
3
3
  </p>
4
4
 
5
- # TrellisVCS
5
+ # Trellis
6
6
 
7
7
  > **Graph-native, code-first version control.**
8
8
  > Every file save is an op. Every op is a node. History is a causal graph, not a linear diff.
9
9
 
10
- TrellisVCS is a from-scratch VCS built on five pillars:
10
+ Trellis is a from-scratch VCS built on five pillars:
11
11
 
12
12
  1. **Causal Stream** — an immutable, content-addressed log of ops where every change is causally chained to its predecessor.
13
13
  2. **Semantic Patching** — changes are recorded as structured AST patches (`symbolRename`, `symbolModify`, …) rather than line diffs, enabling conflict-free merges.
@@ -19,23 +19,69 @@ TrellisVCS is a from-scratch VCS built on five pillars:
19
19
 
20
20
  ## Table of Contents
21
21
 
22
+ - [Trellis Overview](#trellis-overview)
23
+ - [Project Surfaces](#project-surfaces)
22
24
  - [Quick Start](#quick-start)
23
- - [Architecture](#architecture)
24
- - [CLI Reference](#cli-reference)
25
- - [Module Guide](#module-guide)
26
- - [How It Works](#how-it-works)
27
- - [Design Doc](#design-doc)
28
- - [Development](#development)
25
+ - [CLI Overview](#cli-overview)
26
+ - [VS Code Extension](#vs-code-extension)
27
+ - [Module & Subpath Guide](#module--subpath-guide)
28
+ - [Architecture Overview](#architecture-overview)
29
+ - [Development & Releases](#development--releases)
30
+ - [Roadmap](#roadmap)
31
+
32
+ ---
33
+
34
+ ## Trellis Overview
35
+
36
+ Trellis is an umbrella project with a few distinct surfaces that all sit on the same underlying model:
37
+
38
+ - **`trellis` npm package** — the published package for engine APIs, subpath exports, and reusable modules.
39
+ - **`trellis` CLI** — the command-line interface for repo setup, history, milestones, semantic diffing, and automation.
40
+ - **VS Code extension** — the visual shell for status, issues, timeline, kanban, and wiki-link navigation.
41
+ - **Core modules** — reusable building blocks for graph storage, semantic analysis, sync, links, embeddings, and decision traces.
42
+
43
+ The core idea stays the same across all of them:
44
+
45
+ 1. **Causal Stream** — immutable, content-addressed ops linked by causal history.
46
+ 2. **Semantic Patching** — AST-aware changes instead of line-only diffs.
47
+ 3. **Narrative Milestones** — human checkpoints over a continuous stream of work.
48
+ 4. **Governance Subgraph** — signing, identities, and policy enforcement.
49
+ 5. **Idea Garden** — abandoned work detection and revival.
50
+
51
+ ## Project Surfaces
52
+
53
+ | Surface | Location | Purpose |
54
+ | :-------------------- | :------------------------------------------------------------ | :----------------------------------------------------------------- |
55
+ | **npm package** | `package.json`, `src/`, `dist/` | Published as `trellis`; exposes engine APIs and subpath exports |
56
+ | **CLI** | `src/cli/index.ts` | Repository lifecycle, branch/milestone workflows, semantic tooling |
57
+ | **VS Code extension** | `vscode-extension/` | Timeline, kanban, issue browser, wiki-link UX |
58
+ | **Core store** | `src/core/` | Inlined EAV store, kernel persistence, middleware types |
59
+ | **Platform modules** | `src/vcs/`, `src/links/`, `src/embeddings/`, `src/decisions/` | Reusable building blocks behind the product surfaces |
29
60
 
30
61
  ---
31
62
 
32
63
  ## Quick Start
33
64
 
65
+ ### Use the npm package
66
+
67
+ ```bash
68
+ bun add trellis
69
+ ```
70
+
71
+ ```typescript
72
+ import { TrellisVcsEngine } from 'trellis';
73
+
74
+ const engine = new TrellisVcsEngine({ rootPath: '/my/project' });
75
+ engine.open();
76
+ ```
77
+
78
+ ### Work on the repo locally
79
+
34
80
  ```bash
35
81
  # Install dependencies
36
82
  bun install
37
83
 
38
- # Initialize a new TrellisVCS repo in the current directory
84
+ # Initialize a new Trellis repo in the current directory
39
85
  bun run src/cli/index.ts init
40
86
 
41
87
  # Watch for file changes (continuous op stream)
@@ -50,77 +96,32 @@ bun run src/cli/index.ts import --from /path/to/git-repo
50
96
 
51
97
  ---
52
98
 
53
- ## Architecture
99
+ ## Architecture Overview
54
100
 
55
101
  ```
56
- TrellisVCS/
102
+ trellis/
57
103
  ├── src/
58
- │ ├── vcs/ # Core op types, constructors, decomposition
59
- ├── types.ts # VcsOp, VcsOpKind (16 kinds), VcsPayload
60
- ├── ops.ts # createVcsOp() SHA-256 content-addressed ops
61
- ├── decompose.ts # VcsOp EAV graph facts
62
- ├── branch.ts # Branch create/switch/list/delete
63
- ├── milestone.ts # Milestone creation with op-range tracking
64
- ├── checkpoint.ts # Auto/manual checkpoints
65
- ├── diff.ts # File-level diff (file state at op)
66
- ├── merge.ts # Three-way merge engine
67
- ├── blob-store.ts # Content-addressed blob storage (SHA-256)
68
- │ └── vcs-middleware.ts # Middleware plug for trellis-core kernel
69
-
70
- ├── git/ # Git interop bridge
71
- │ │ ├── git-reader.ts # Read commits, file changes, history
72
- │ │ ├── git-importer.ts # Git TrellisVCS (milestones + file ops)
73
- │ │ └── git-exporter.ts # TrellisVCS milestones → Git commits
74
- │ │
75
- │ ├── identity/ # Cryptographic identity + governance
76
- │ │ ├── identity.ts # Ed25519 keypair + DID generation
77
- │ │ ├── signing-middleware.ts # Op signing middleware
78
- │ │ └── governance.ts # Policy rules + enforcement
79
- │ │
80
- │ ├── garden/ # Idea Garden — abandoned work detection
81
- │ │ ├── cluster.ts # IdeaCluster types + 3 detection heuristics
82
- │ │ └── garden.ts # IdeaGarden query class (search, revive, stats)
83
- │ │
84
- │ ├── semantic/ # AST-level semantic patching
85
- │ │ ├── types.ts # ParserAdapter, ASTEntity, SemanticPatch (11 kinds)
86
- │ │ ├── ts-parser.ts # TypeScript/JS structural parser adapter
87
- │ │ └── semantic-merge.ts # Patch commutativity + merge engine
88
- │ │
89
- │ ├── sync/ # Peer sync + CRDT reconciler
90
- │ │ ├── types.ts # PeerId, SyncMessage, BranchPolicy
91
- │ │ ├── reconciler.ts # Fork detection + op stream merging
92
- │ │ ├── sync-engine.ts # Push/pull protocol, linear/CRDT modes
93
- │ │ └── memory-transport.ts # In-memory transport for testing
94
- │ │
95
- │ ├── watcher/ # Filesystem monitoring
96
- │ │ ├── fs-watcher.ts # Bun fs.watch wrapper with debounce + SHA-256
97
- │ │ └── ingestion.ts # FileChangeEvent → VcsOp pipeline
98
- │ │
99
- │ ├── cli/
100
- │ │ └── index.ts # 15+ CLI commands (Commander.js)
101
- │ │
102
- │ ├── engine.ts # Composition root — ties everything together
103
- │ └── index.ts # Public API surface
104
-
105
- ├── test/
106
- │ ├── vcs/ # Op creation, decomposition
107
- │ ├── git/ # Git reader, importer, exporter
108
- │ ├── p2/ # Branches, milestones, checkpoints
109
- │ ├── p3/ # Diff, merge
110
- │ ├── p4/ # Identity, signing, governance
111
- │ ├── p5/ # Idea Garden clusters
112
- │ ├── p6/ # Semantic parser + merge
113
- │ ├── p7/ # CRDT reconciler + sync engine
114
- │ └── engine.test.ts # Integration tests
115
-
116
- ├── trellis-core/ # Kernel dependency (source-linked)
117
- ├── DESIGN.md # Full architecture specification
118
- └── PILLARS.md # Design philosophy
104
+ │ ├── core/ # EAV store + kernel types exposed as trellis/core
105
+ │ ├── vcs/ # Ops, branches, milestones, checkpoints, diff, merge
106
+ │ ├── git/ # Git import/export bridge
107
+ │ ├── links/ # Wiki-link parsing, resolution, backlink index
108
+ │ ├── embeddings/ # Semantic indexing and vector search
109
+ │ ├── decisions/ # Decision trace capture and querying
110
+ │ ├── semantic/ # AST parsers, semantic diff, semantic merge
111
+ │ ├── sync/ # Peer sync and reconciler
112
+ │ ├── watcher/ # File watching + ingestion pipeline
113
+ │ ├── cli/ # CLI entrypoint
114
+ ├── engine.ts # Composition root
115
+ └── index.ts # Main package entrypoint
116
+ ├── vscode-extension/ # VS Code extension surface
117
+ ├── test/ # Phase and subsystem tests
118
+ ├── DESIGN.md # Detailed architecture spec
119
+ └── justfile # Local build/release recipes
119
120
  ```
120
121
 
121
122
  ### The Op Stream
122
123
 
123
- Every action in TrellisVCS is an immutable `VcsOp`:
124
+ Every action in Trellis is an immutable `VcsOp`:
124
125
 
125
126
  ```typescript
126
127
  interface VcsOp {
@@ -146,7 +147,9 @@ Ops are written to `.trellis/ops.json` and replayed into an in-memory EAV graph
146
147
 
147
148
  ---
148
149
 
149
- ## CLI Reference
150
+ ## CLI Overview
151
+
152
+ 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.
150
153
 
151
154
  ### Repository Setup
152
155
 
@@ -219,14 +222,58 @@ trellis sync reconcile --remote <path> # Reconcile with another local repo
219
222
 
220
223
  ---
221
224
 
222
- ## Module Guide
225
+ ## VS Code Extension
226
+
227
+ The VS Code extension is the visual surface for Trellis.
228
+
229
+ - **Status view** — current branch, op count, tracked files, recent activity
230
+ - **Causal stream** — browse ops as a readable event timeline
231
+ - **Issues view** — inspect and manage issue state directly in the editor
232
+ - **Kanban board** — move work across lifecycle stages visually
233
+ - **Timeline panel** — inspect history as a richer interactive visualization
234
+ - **Wiki-link UX** — click, hover, validate, and autocomplete `[[wiki-links]]`
235
+
236
+ The extension lives in [`vscode-extension/`](./vscode-extension) and publishes separately from the npm package.
237
+
238
+ ---
239
+
240
+ ## Module & Subpath Guide
241
+
242
+ The `trellis` package is intentionally split into subpaths so consumers can depend on the surface they actually need.
223
243
 
224
- ### `TrellisVcsEngine`
244
+ ### Published Package Surface
245
+
246
+ ```bash
247
+ bun add trellis
248
+ ```
249
+
250
+ ```typescript
251
+ // Main entry — engine + top-level API
252
+ import { TrellisVcsEngine } from 'trellis';
253
+
254
+ // Core store and kernel types
255
+ import { EAVStore } from 'trellis/core';
256
+ import type { Fact, Link } from 'trellis/core';
257
+
258
+ // VCS primitives
259
+ import type { VcsOp, VcsOpKind } from 'trellis/vcs';
260
+
261
+ // Semantic search
262
+ import { EmbeddingManager } from 'trellis/ai';
263
+
264
+ // Wiki-linking
265
+ import { parseFileRefs, resolveRef, RefIndex } from 'trellis/links';
266
+
267
+ // Decision traces
268
+ import { recordDecision, queryDecisions } from 'trellis/decisions';
269
+ ```
270
+
271
+ ### `trellis` — Engine Entry Point (`TrellisVcsEngine`)
225
272
 
226
273
  The main entry point. Ties together the kernel, file watcher, op log, branches, milestones, identity, garden, semantic parser, and sync.
227
274
 
228
275
  ```typescript
229
- import { TrellisVcsEngine } from 'trellisvcs';
276
+ import { TrellisVcsEngine } from 'trellis';
230
277
 
231
278
  const engine = new TrellisVcsEngine({ rootPath: '/my/project' });
232
279
 
@@ -263,6 +310,65 @@ garden.search({ keyword: 'auth' });
263
310
  garden.revive(clusterId);
264
311
  ```
265
312
 
313
+ ### `trellis/core` — Core Store
314
+
315
+ The inlined core store layer exposes the EAV primitives and kernel-adjacent types that the rest of Trellis is built on.
316
+
317
+ ```typescript
318
+ import { EAVStore } from 'trellis/core';
319
+ import type { Fact, Link, KernelOp } from 'trellis/core';
320
+
321
+ const store = new EAVStore();
322
+ ```
323
+
324
+ ### `trellis/vcs` — VCS Model
325
+
326
+ The VCS subpath exposes operation types and domain-level building blocks for branches, milestones, checkpoints, issues, diffing, merging, and blob storage.
327
+
328
+ Use this subpath when you want Trellis domain types and behavior without importing the full engine surface.
329
+
330
+ ### `trellis/links` — Wiki-Link References
331
+
332
+ Parse `[[wiki-links]]` from markdown, doc-comments, and source files. Resolve references to issues, files, symbols, milestones, and decisions. Build a bidirectional reference index.
333
+
334
+ ```typescript
335
+ import { parseFileRefs, resolveRef, RefIndex } from 'trellis/links';
336
+
337
+ const refs = parseFileRefs('src/engine.ts', source);
338
+ const resolved = resolveRef(ref, context);
339
+ const index = new RefIndex();
340
+ index.indexFile('README.md', refs, context);
341
+ index.getIncoming('issue:TRL-5');
342
+ ```
343
+
344
+ ### `trellis/ai` — Embeddings & Semantic Search
345
+
346
+ Embed issues, milestones, files, code entities, and decisions into a vector store for semantic search.
347
+
348
+ ```typescript
349
+ import { EmbeddingManager } from 'trellis/ai';
350
+
351
+ const manager = new EmbeddingManager(engine, { dbPath: 'embeddings.db' });
352
+ await manager.reindex();
353
+ const results = await manager.search('auth flow');
354
+ ```
355
+
356
+ ### `trellis/decisions` — Decision Traces
357
+
358
+ Automatically capture tool invocations as auditable decision records. Enrich them with rationale via hooks and query them later by tool, entity, or chain.
359
+
360
+ ```typescript
361
+ import { recordDecision, queryDecisions } from 'trellis/decisions';
362
+
363
+ const dec = await recordDecision(ctx, {
364
+ toolName: 'trellis_issue_create',
365
+ input: { title: 'Add parser' },
366
+ output: { id: 'TRL-5' },
367
+ });
368
+
369
+ const decs = queryDecisions(ctx, { tool: 'trellis_issue_*' });
370
+ ```
371
+
266
372
  ### `src/garden/` — Idea Garden
267
373
 
268
374
  Detects abandoned work using three heuristics, then exposes a query API.
@@ -341,6 +447,8 @@ await engine.pullFrom('peer-b');
341
447
  engine.reconcileWith(remoteOps);
342
448
  ```
343
449
 
450
+ These `src/*` sections are internal subsystem guides rather than published npm subpaths. They are useful if you are contributing to Trellis itself or navigating the codebase.
451
+
344
452
  ---
345
453
 
346
454
  ## How It Works
@@ -416,7 +524,7 @@ See [`DESIGN.md`](./DESIGN.md) for the full architecture specification, includin
416
524
 
417
525
  ---
418
526
 
419
- ## Development
527
+ ## Development & Releases
420
528
 
421
529
  ### Prerequisites
422
530
 
@@ -432,13 +540,12 @@ bun install
432
540
  ### Test
433
541
 
434
542
  ```bash
543
+ just test-core
544
+ # or run the full suite when working on those areas:
435
545
  bun test
436
- # Run a specific phase:
437
- bun test test/p6
438
- bun test test/p7
439
546
  ```
440
547
 
441
- **266 tests across 21 files, all passing.**
548
+ **The release flow currently validates against the targeted passing core suite.**
442
549
 
443
550
  ### Typecheck
444
551
 
@@ -458,94 +565,17 @@ bun run src/cli/index.ts <command>
458
565
 
459
566
  ---
460
567
 
461
- ## npm Package
462
-
463
- ### Install
568
+ ### Release Workflow
464
569
 
465
570
  ```bash
466
- bun add trellis
467
- ```
468
-
469
- > **Requires [Bun](https://bun.sh) ≥ 1.0** — TrellisVCS uses `bun:sqlite` for the vector store and Bun's native TS support.
571
+ # Validate locally without publishing
572
+ just publish-dry-run
470
573
 
471
- ### Subpath Exports
472
-
473
- ```typescript
474
- // Main entry — engine + core VCS types
475
- import { TrellisVcsEngine } from 'trellis';
476
-
477
- // Core — EAV store, kernel types
478
- import { EAVStore } from 'trellis/core';
479
- import type { Fact, Link } from 'trellis/core';
480
-
481
- // VCS — ops, branches, milestones, issues, diff, merge
482
- import type { VcsOp, VcsOpKind } from 'trellis/vcs';
483
-
484
- // AI — semantic embeddings + vector search
485
- import { EmbeddingManager, VectorStore } from 'trellis/ai';
486
-
487
- // Links — wiki-link parser, resolver, ref index
488
- import { parseFileRefs, resolveRef, RefIndex } from 'trellis/links';
489
-
490
- // Decisions — decision trace recording + queries
491
- import { recordDecision, queryDecisions } from 'trellis/decisions';
574
+ # Publish to npm locally, then tag/push/create release metadata
575
+ just publish
492
576
  ```
493
577
 
494
- ---
495
-
496
- ## New Modules
497
-
498
- ### `src/links/` — Wiki-Link References
499
-
500
- Parse `[[wiki-links]]` from markdown, doc-comments, and source files. Resolve references to issues, files, symbols, milestones, and decisions. Build a bidirectional reference index.
501
-
502
- ```typescript
503
- import { parseFileRefs, resolveRef, RefIndex } from 'trellis/links';
504
-
505
- // Parse wiki-links from a file
506
- const refs = parseFileRefs('src/engine.ts', source);
507
- // → [{ raw: '[[TRL-5]]', namespace: 'issue', target: 'TRL-5', ... }]
508
-
509
- // Resolve a reference
510
- const resolved = resolveRef(ref, context);
511
- // → { state: 'resolved', title: 'Add Python parser', uri: '...' }
512
-
513
- // Build bidirectional index
514
- const index = new RefIndex();
515
- index.indexFile('README.md', refs, context);
516
- index.getIncoming('issue:TRL-5'); // All files that reference TRL-5
517
- ```
518
-
519
- ### `src/embeddings/` — Semantic Search
520
-
521
- Embed issues, milestones, files, code entities, and decisions into a vector store for semantic search.
522
-
523
- ```typescript
524
- import { EmbeddingManager } from 'trellis/ai';
525
-
526
- const manager = new EmbeddingManager(engine, { dbPath: 'embeddings.db' });
527
- await manager.reindex(); // Index all content
528
- const results = await manager.search('auth flow'); // Semantic search
529
- // → [{ id: 'issue:TRL-5', content: '...', score: 0.87 }]
530
- ```
531
-
532
- ### `src/decisions/` — Decision Traces
533
-
534
- Automatically capture tool invocations as auditable decision records. Enrich with rationale via pre/post hooks.
535
-
536
- ```typescript
537
- import { recordDecision, queryDecisions } from 'trellis/decisions';
538
-
539
- // Record a decision
540
- const dec = await recordDecision(ctx, {
541
- toolName: 'trellis_issue_create',
542
- input: { title: 'Add parser' },
543
- output: { id: 'TRL-5' },
544
- });
545
-
546
- // Query decisions
547
- const decs = queryDecisions(ctx, { tool: 'trellis_issue_*' });
548
- ```
578
+ > **Requires [Bun](https://bun.sh) ≥ 1.0** — Trellis uses `bun:sqlite` for the vector store and Bun's native TS support.
549
579
 
550
580
  ---
551
581
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trellis",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Graph-native, code-first version control system — causal ops, semantic patching, wiki-links, embeddings, and decision traces",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",