@triedotdev/mcp 1.0.168 → 1.0.170

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 (149) hide show
  1. package/README.md +54 -500
  2. package/dist/chunk-2YXOBNKW.js +619 -0
  3. package/dist/chunk-2YXOBNKW.js.map +1 -0
  4. package/dist/chunk-QR64Y5TI.js +363 -0
  5. package/dist/chunk-QR64Y5TI.js.map +1 -0
  6. package/dist/cli/main.d.ts +0 -15
  7. package/dist/cli/main.js +356 -3100
  8. package/dist/cli/main.js.map +1 -1
  9. package/dist/index.js +2 -36
  10. package/dist/index.js.map +1 -1
  11. package/dist/server/mcp-server.js +2 -36
  12. package/package.json +8 -31
  13. package/dist/autonomy-config-FSERX3O3.js +0 -30
  14. package/dist/autonomy-config-FSERX3O3.js.map +0 -1
  15. package/dist/chat-store-JNGNTDSN.js +0 -15
  16. package/dist/chat-store-JNGNTDSN.js.map +0 -1
  17. package/dist/chunk-2HF65EHQ.js +0 -311
  18. package/dist/chunk-2HF65EHQ.js.map +0 -1
  19. package/dist/chunk-43X6JBEM.js +0 -36
  20. package/dist/chunk-43X6JBEM.js.map +0 -1
  21. package/dist/chunk-4MXH2ZPT.js +0 -1827
  22. package/dist/chunk-4MXH2ZPT.js.map +0 -1
  23. package/dist/chunk-575YT2SD.js +0 -737
  24. package/dist/chunk-575YT2SD.js.map +0 -1
  25. package/dist/chunk-5BRRRTN6.js +0 -354
  26. package/dist/chunk-5BRRRTN6.js.map +0 -1
  27. package/dist/chunk-6NLHFIYA.js +0 -344
  28. package/dist/chunk-6NLHFIYA.js.map +0 -1
  29. package/dist/chunk-7WITSO22.js +0 -824
  30. package/dist/chunk-7WITSO22.js.map +0 -1
  31. package/dist/chunk-DGUM43GV.js +0 -11
  32. package/dist/chunk-DGUM43GV.js.map +0 -1
  33. package/dist/chunk-EFWVF6TI.js +0 -267
  34. package/dist/chunk-EFWVF6TI.js.map +0 -1
  35. package/dist/chunk-F6WFNUAY.js +0 -216
  36. package/dist/chunk-F6WFNUAY.js.map +0 -1
  37. package/dist/chunk-FQ45QP5A.js +0 -361
  38. package/dist/chunk-FQ45QP5A.js.map +0 -1
  39. package/dist/chunk-G2TGF6TR.js +0 -573
  40. package/dist/chunk-G2TGF6TR.js.map +0 -1
  41. package/dist/chunk-GTKYBOXL.js +0 -700
  42. package/dist/chunk-GTKYBOXL.js.map +0 -1
  43. package/dist/chunk-HVCDY3AK.js +0 -850
  44. package/dist/chunk-HVCDY3AK.js.map +0 -1
  45. package/dist/chunk-JVMBCWKS.js +0 -348
  46. package/dist/chunk-JVMBCWKS.js.map +0 -1
  47. package/dist/chunk-KDHN2ZQE.js +0 -313
  48. package/dist/chunk-KDHN2ZQE.js.map +0 -1
  49. package/dist/chunk-LQIMKE3P.js +0 -12524
  50. package/dist/chunk-LQIMKE3P.js.map +0 -1
  51. package/dist/chunk-ME2OERF5.js +0 -345
  52. package/dist/chunk-ME2OERF5.js.map +0 -1
  53. package/dist/chunk-MRHKX5M5.js +0 -662
  54. package/dist/chunk-MRHKX5M5.js.map +0 -1
  55. package/dist/chunk-OBQ74FOU.js +0 -27
  56. package/dist/chunk-OBQ74FOU.js.map +0 -1
  57. package/dist/chunk-OMR4YCBS.js +0 -987
  58. package/dist/chunk-OMR4YCBS.js.map +0 -1
  59. package/dist/chunk-Q5EKA5YA.js +0 -254
  60. package/dist/chunk-Q5EKA5YA.js.map +0 -1
  61. package/dist/chunk-Q63FFI6D.js +0 -132
  62. package/dist/chunk-Q63FFI6D.js.map +0 -1
  63. package/dist/chunk-SY6KQG44.js +0 -983
  64. package/dist/chunk-SY6KQG44.js.map +0 -1
  65. package/dist/chunk-T63OHG4Q.js +0 -440
  66. package/dist/chunk-T63OHG4Q.js.map +0 -1
  67. package/dist/chunk-TN5WEKWI.js +0 -173
  68. package/dist/chunk-TN5WEKWI.js.map +0 -1
  69. package/dist/chunk-VUL52BQL.js +0 -402
  70. package/dist/chunk-VUL52BQL.js.map +0 -1
  71. package/dist/chunk-VVITXIHN.js +0 -189
  72. package/dist/chunk-VVITXIHN.js.map +0 -1
  73. package/dist/chunk-WCN7S3EI.js +0 -14
  74. package/dist/chunk-WCN7S3EI.js.map +0 -1
  75. package/dist/chunk-XE6KQRKZ.js +0 -816
  76. package/dist/chunk-XE6KQRKZ.js.map +0 -1
  77. package/dist/chunk-XPZZFPBZ.js +0 -491
  78. package/dist/chunk-XPZZFPBZ.js.map +0 -1
  79. package/dist/chunk-XTFWT2XM.js +0 -727
  80. package/dist/chunk-XTFWT2XM.js.map +0 -1
  81. package/dist/chunk-YDHUCDHM.js +0 -4011
  82. package/dist/chunk-YDHUCDHM.js.map +0 -1
  83. package/dist/chunk-YZ6Y2H3P.js +0 -1289
  84. package/dist/chunk-YZ6Y2H3P.js.map +0 -1
  85. package/dist/chunk-ZJF5FTBX.js +0 -1396
  86. package/dist/chunk-ZJF5FTBX.js.map +0 -1
  87. package/dist/chunk-ZV2K6M7T.js +0 -74
  88. package/dist/chunk-ZV2K6M7T.js.map +0 -1
  89. package/dist/cli/create-agent.d.ts +0 -1
  90. package/dist/cli/create-agent.js +0 -1050
  91. package/dist/cli/create-agent.js.map +0 -1
  92. package/dist/cli/yolo-daemon.d.ts +0 -1
  93. package/dist/cli/yolo-daemon.js +0 -423
  94. package/dist/cli/yolo-daemon.js.map +0 -1
  95. package/dist/client-NJPZE5JT.js +0 -28
  96. package/dist/client-NJPZE5JT.js.map +0 -1
  97. package/dist/codebase-index-VAPF32XX.js +0 -12
  98. package/dist/codebase-index-VAPF32XX.js.map +0 -1
  99. package/dist/fast-analyzer-XXYMOXRK.js +0 -216
  100. package/dist/fast-analyzer-XXYMOXRK.js.map +0 -1
  101. package/dist/git-EO5SRFMN.js +0 -28
  102. package/dist/git-EO5SRFMN.js.map +0 -1
  103. package/dist/github-ingester-ZOKK6GRS.js +0 -11
  104. package/dist/github-ingester-ZOKK6GRS.js.map +0 -1
  105. package/dist/goal-manager-YOB7VWK7.js +0 -25
  106. package/dist/goal-manager-YOB7VWK7.js.map +0 -1
  107. package/dist/goal-validator-ULKIBDPX.js +0 -24
  108. package/dist/goal-validator-ULKIBDPX.js.map +0 -1
  109. package/dist/graph-B3NA4S7I.js +0 -10
  110. package/dist/graph-B3NA4S7I.js.map +0 -1
  111. package/dist/hypothesis-7BFFT5JY.js +0 -23
  112. package/dist/hypothesis-7BFFT5JY.js.map +0 -1
  113. package/dist/incident-index-EFNUSGWL.js +0 -11
  114. package/dist/incident-index-EFNUSGWL.js.map +0 -1
  115. package/dist/insight-store-EC4PLSAW.js +0 -22
  116. package/dist/insight-store-EC4PLSAW.js.map +0 -1
  117. package/dist/issue-store-ZIRP23EP.js +0 -36
  118. package/dist/issue-store-ZIRP23EP.js.map +0 -1
  119. package/dist/ledger-TWZTGDFA.js +0 -58
  120. package/dist/ledger-TWZTGDFA.js.map +0 -1
  121. package/dist/linear-ingester-XXPAZZRW.js +0 -11
  122. package/dist/linear-ingester-XXPAZZRW.js.map +0 -1
  123. package/dist/output-manager-RVJ37XKA.js +0 -13
  124. package/dist/output-manager-RVJ37XKA.js.map +0 -1
  125. package/dist/parse-goal-violation-SACGFG3C.js +0 -8
  126. package/dist/parse-goal-violation-SACGFG3C.js.map +0 -1
  127. package/dist/pattern-discovery-F7LU5K6E.js +0 -8
  128. package/dist/pattern-discovery-F7LU5K6E.js.map +0 -1
  129. package/dist/progress-SRQ2V3BP.js +0 -18
  130. package/dist/progress-SRQ2V3BP.js.map +0 -1
  131. package/dist/project-state-AHPA77SM.js +0 -28
  132. package/dist/project-state-AHPA77SM.js.map +0 -1
  133. package/dist/sync-M2FSWPBC.js +0 -12
  134. package/dist/sync-M2FSWPBC.js.map +0 -1
  135. package/dist/terminal-spawn-5YXDMUCF.js +0 -157
  136. package/dist/terminal-spawn-5YXDMUCF.js.map +0 -1
  137. package/dist/tiered-storage-Z3YCR465.js +0 -12
  138. package/dist/tiered-storage-Z3YCR465.js.map +0 -1
  139. package/dist/trie-agent-3YDPEGHJ.js +0 -28
  140. package/dist/trie-agent-3YDPEGHJ.js.map +0 -1
  141. package/dist/ui/chat.html +0 -1014
  142. package/dist/ui/goals.html +0 -967
  143. package/dist/ui/hypotheses.html +0 -1011
  144. package/dist/ui/ledger.html +0 -954
  145. package/dist/ui/nudges.html +0 -995
  146. package/dist/vibe-code-signatures-F6URTBW3.js +0 -16
  147. package/dist/vibe-code-signatures-F6URTBW3.js.map +0 -1
  148. package/dist/vulnerability-signatures-T7SKHORW.js +0 -18
  149. package/dist/vulnerability-signatures-T7SKHORW.js.map +0 -1
package/README.md CHANGED
@@ -1,557 +1,111 @@
1
- # Trie: Governance ledger for agent-human teams
1
+ # Trie Agent
2
2
 
3
- **Context that travels from Agents CLI CI/CD, keeping agents and humans aligned.**
3
+ **Cloud context bridge for Cursor and Claude Code.** Connects AI assistants to your Trie cloud workspace—signals, documents, ledger, and graph—so agents have the right context before editing.
4
4
 
5
5
  [![Download Workspace](https://img.shields.io/badge/Download-Trie%20Workspace-blue)](https://www.trie.dev) [![Follow on X](https://img.shields.io/badge/Follow-@louiskishfy-1DA1F2?logo=x)](https://x.com/louiskishfy)
6
6
 
7
- ## The Problem
8
-
9
- When agents and humans ship code together across Cursor, Claude Code, VS Code, and CI/CD, context fragments. An agent makes a decision in one tool, a human forgets it in another, and nothing prevents repeating the same mistake.
10
-
11
- **Traditional tools don't solve this:**
12
- - Linear tracks tasks, not decisions or reasoning
13
- - GitHub shows changes, not why they were made
14
- - Slack/Discord: context vanishes in chat history
15
- - No tool tells you if today's change conflicts with yesterday's decision
16
-
17
- ## The Solution
18
-
19
- Trie keeps a **governance ledger**—a tamper-evident record of decisions, incidents, and fixes that travels with your code. Every tool reads from the same ledger, so decisions persist and everyone stays aligned.
20
-
21
- - **`trie watch`** - Monitors your codebase 24/7, learns patterns autonomously
22
- - **`trie gotcha`** - Predicts problems before you ship based on past incidents
23
- - **Governance ledger** - Decision memory with Git-backed audit trail and digital signatures
24
- - **Cross-tool context** - Same ledger in Cursor, CLI, CI/CD—no coordination needed
25
-
26
- Think of it as **double-entry bookkeeping for code decisions**—tamper-evident accountability that works with Git and your existing workflow.
27
-
28
7
  ## Quick Start
29
8
 
30
9
  ### Install
31
10
 
32
11
  ```bash
33
- npm install -g trie
34
- cd your-project
35
- trie init
36
- ```
37
-
38
- ### Basic Workflow
39
-
40
- ```bash
41
- # 1. Report incidents as they happen
42
- trie tell "Users can't log in after password reset"
43
-
44
- # 2. Start autonomous monitoring
45
- trie watch
46
-
47
- # 3. Before pushing, check for risks
48
- trie gotcha
49
-
50
- # 4. Learn from your git history
51
- trie learn
52
-
53
- # 5. Give feedback
54
- trie ok # Prediction was helpful
55
- trie bad # Prediction was wrong
56
- ```
57
-
58
- ## Core Features
59
-
60
- ### 1. Autonomous Monitoring (`trie watch`)
61
-
62
- Real-time agent that monitors your codebase and enforces custom rules:
63
-
64
- ```bash
65
- # Set any quality rule you want enforced
66
- trie goal add "No console.log statements in production"
67
- trie goal add "All API endpoints must have rate limiting"
68
- trie goal add "We never truncate text in UI components"
69
-
70
- # Start watching
71
- trie watch
12
+ npm install -g @triedotdev/mcp
72
13
  ```
73
14
 
74
- **Features:**
75
- - Interactive dashboard with goals, memory, and analysis activity
76
- - AI-powered goal checking using semantic understanding (not just keywords)
77
- - Token-aware to manage AI costs
78
- - Smart caching to avoid duplicate scans
79
- - Real-time nudges when violations are detected
15
+ ### Login
80
16
 
81
- Run in background with screen or tmux:
82
17
  ```bash
83
- screen -S trie-watch
84
- trie watch
85
- # Detach: Ctrl+A then D
86
- # Reattach: screen -r trie-watch
87
- ```
88
-
89
- ### 2. Predictive Analysis (`trie gotcha`)
90
-
91
- Predicts problems before you ship based on your actual incident history:
92
-
93
- ```bash
94
- # Check current changes for risks
95
- trie gotcha
96
-
97
- # Connect to Linear for JIT defect prediction
98
- trie linear auth <your-api-key>
99
- trie linear sync
100
- ```
101
-
102
- Trie warns you if your current changes correlate with:
103
- - Historical regressions in the same files
104
- - High-risk patterns from past incidents
105
- - Active tickets that might conflict
106
-
107
- ### 3. Governance Ledger
108
-
109
- Tamper-evident record of all decisions, incidents, and fixes:
110
-
111
- **Architecture:**
112
- - **Governance ledger** (`.trie/memory/ledger.json`) - Append-only chain with Ed25519 signatures
113
- - **Issue memory** (`.trie/memory/issues.json`) - Fast searchable cache
114
-
115
- **Key properties:**
116
- - Never deleted, only corrected (full audit trail)
117
- - Digital signatures prove who (human or agent) created each entry
118
- - Auto-commits to Git for distributed backup
119
- - Works across Cursor, CLI, CI/CD—same ledger everywhere
120
-
121
- **Setup signing:**
122
- ```bash
123
- trie keys generate # Generate Ed25519 signing key
124
- trie keys status # Check if signing is configured
125
- ```
126
-
127
- **Ledger commands:**
128
- ```bash
129
- trie ledger verify # Validate chain integrity
130
- trie ledger history # Show blocks with author attribution
131
- trie ledger stats # Block counts, entries, severity breakdown
132
- ```
133
-
134
- **Corrections (not deletions):**
135
- ```bash
136
- # Mark false positive
137
- trie ledger correct <entry-id> -r "Expected behavior" -t false-positive
138
-
139
- # Mark as fixed
140
- trie ledger correct <entry-id> -r "Fixed in commit abc123"
141
-
142
- # View correction stats
143
- trie ledger corrections
18
+ trie login
144
19
  ```
145
20
 
146
- ## Integrations
21
+ This opens a browser to authorize the CLI with your Trie account. After login, the MCP server can access your team's cloud context.
147
22
 
148
- | Integration | Setup | Purpose |
149
- |-------------|-------|---------|
150
- | **Linear** | `trie linear auth <key>` | JIT defect prediction from active tickets |
151
- | **GitHub** | Set `GITHUB_TOKEN` env var | Sync PRs and issues into context graph |
152
- | **Slack** | `trie setup slack <webhook>` | Team notifications for critical issues |
153
- | **Cursor Cloud** | Set `CURSOR_API_KEY` | Verified automated fixes via cloud agent |
23
+ ### MCP Setup (Cursor / Claude Code)
154
24
 
155
- ### Linear Integration
156
-
157
- ```bash
158
- trie linear auth <your-api-key>
159
- trie linear sync
160
- ```
161
-
162
- Or via MCP: `trie_linear_sync` — syncs tickets into the context graph for gotcha predictions.
163
-
164
- ### GitHub Integration
165
-
166
- Sync open PRs and issues into the context graph:
167
-
168
- ```bash
169
- # Via MCP (Cursor/Claude)
170
- trie_github_sync
171
- trie_github_branches # See which branch has latest updates
172
- ```
173
-
174
- Requires `GITHUB_TOKEN` (repo scope for private repos, public_repo for public).
175
-
176
- ### Slack Integration
177
-
178
- ```bash
179
- # Show setup guide
180
- trie setup slack
181
-
182
- # Configure webhook
183
- trie setup slack <webhook-url> [#channel]
184
-
185
- # Test connection
186
- trie setup test-slack
187
- ```
25
+ Add to your MCP settings:
188
26
 
189
- Or manually add to `.trie/config.json`:
190
27
  ```json
191
28
  {
192
- "integrations": {
193
- "slack": {
194
- "enabled": true,
195
- "webhook": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
196
- "channel": "#security"
29
+ "mcpServers": {
30
+ "trie": {
31
+ "command": "trie",
32
+ "args": ["mcp"],
33
+ "env": {}
197
34
  }
198
35
  }
199
36
  }
200
37
  ```
201
38
 
202
- ### Cursor Cloud Agent
203
-
204
- Dispatch high-risk issues to Cursor's cloud for verified, test-passing fixes:
205
-
206
- ```bash
207
- # Via MCP
208
- trie_cloud_fix action:configure apiKey:"key-..."
209
- trie_cloud_fix action:dispatch issueIds:["issue-1"]
210
-
211
- # Force cloud dispatch (bypass triage)
212
- trie_cloud_fix action:dispatch forceCloud:true
213
-
214
- # Ad-hoc dispatch
215
- trie_cloud_fix action:dispatch file:"src/auth.ts" issue:"SQL injection" fix:"Use parameterized queries"
216
- ```
217
-
218
- The cloud agent runs in an isolated VM, applies the fix, runs tests, captures screenshots, and opens a PR.
219
-
220
- ### Pipeline View
221
-
222
- See work across Linear, GitHub, and Trie in one place:
223
-
224
- ```bash
225
- # Via MCP
226
- trie_pipeline # Full status: tickets, PRs, issues
227
- trie_pipeline action:coverage # Only Trie issues with no ticket/PR
228
- trie_pipeline action:create_tickets issueIds:["id1","id2"] # Open tickets
229
- ```
230
-
231
- ## AI Tool Integration (MCP)
232
-
233
- Trie provides Model Context Protocol tools for Claude, Cursor, and AI assistants.
234
-
235
- ### Setup for Cursor/Claude
236
-
237
- Add to your MCP settings:
39
+ If you use `npx` instead of a global install:
238
40
 
239
41
  ```json
240
42
  {
241
43
  "mcpServers": {
242
44
  "trie": {
243
- "command": "trie",
244
- "args": ["mcp"],
245
- "env": {
246
- "ANTHROPIC_API_KEY": "your-api-key",
247
- "LINEAR_API_KEY": "your-key",
248
- "GITHUB_TOKEN": "your-token",
249
- "CURSOR_API_KEY": "your-cursor-key"
250
- }
45
+ "command": "npx",
46
+ "args": ["-y", "@triedotdev/mcp", "mcp"],
47
+ "env": {}
251
48
  }
252
49
  }
253
50
  }
254
51
  ```
255
52
 
256
- ### Available Tools
257
-
258
- **Core:**
259
- - `trie_tell` - Report incidents and extract structured signals
260
- - `trie_check` - Quick risk assessment
261
- - `trie_watch` - Start/stop autonomous monitoring
262
- - `trie_memory` - Search incident history
263
- - `trie_fix` - Apply fixes (use `action:route` to see triage plan)
264
- - `trie_cloud_fix` - Dispatch to Cursor cloud agent
265
-
266
- **Integrations:**
267
- - `trie_linear_sync` - Sync active Linear tickets
268
- - `trie_github_sync` - Sync open PRs and issues
269
- - `trie_github_branches` - Fetch branches with latest commits
270
- - `trie_pipeline` - Consolidated view of tickets, PRs, issues
271
-
272
- **Query Tools (Targeted Context):**
273
- - `trie_get_governance` - Query decisions with filters
274
- - `trie_get_blockers` - Get active blockers only
275
- - `trie_get_nudges` - Get unresolved goal violations
276
- - `trie_get_related_governance` - Find related context
277
- - `trie_query_context` - Natural language queries across all signals
278
-
279
- **Why query tools matter**: Instead of dumping everything into context, agents ask for exactly what they need. This prevents context pollution and keeps agents focused.
280
-
281
- ## Advanced Features
282
-
283
- <details>
284
- <summary><b>Goals & Custom Rules</b></summary>
285
-
286
- Set improvement goals that are actively enforced in real-time:
287
-
288
- ```bash
289
- # Add goals
290
- trie goal add "No hardcoded API keys"
291
- trie goal add "All async functions must handle errors"
292
- trie goal add "Every TODO must have a ticket reference"
293
-
294
- # View progress
295
- trie goal list
296
-
297
- # Get unresolved violations
298
- trie_get_nudges # Via MCP
299
- ```
300
-
301
- Goals use AI-powered semantic understanding to catch violations, not just keyword matching.
302
-
303
- </details>
304
-
305
- <details>
306
- <summary><b>Fix Triage System</b></summary>
307
-
308
- Trie routes each issue to one of three fix strategies:
309
-
310
- | Strategy | When | Action |
311
- |----------|------|--------|
312
- | **inline-auto** | Trivial fixes (score < 0) | Apply automatically |
313
- | **local-ai** | Moderate risk (score 0–3) | `trie_fix` — local AI applies fix |
314
- | **cloud-agent** | High risk (score ≥ 4) | `trie_cloud_fix` — Cursor cloud agent |
315
-
316
- See routing plan before applying:
317
- ```bash
318
- trie_fix action:route
319
- ```
320
-
321
- </details>
322
-
323
- <details>
324
- <summary><b>Team Sync (Shared Ledger)</b></summary>
325
-
326
- Sync ledger blocks across your team:
327
-
328
- ```bash
329
- trie sync init # Initialize shared storage
330
- trie sync pull # Pull shared updates
331
- trie sync push # Push local changes
332
- trie sync status # Show sync state
333
- trie sync hooks --install # Install auto-sync git hooks
334
- ```
335
-
336
- The shared ledger lives in `.trie-shared/` with hot/cold storage tiers and automatic compression.
337
-
338
- </details>
339
-
340
- <details>
341
- <summary><b>Memory Management</b></summary>
342
-
343
- ```bash
344
- # Search incident history
345
- trie memory search "authentication"
346
- trie memory stats
347
- trie memory recent
348
-
349
- # Clean up old issues (doesn't affect immutable ledger)
350
- trie memory purge smart # Remove resolved & old low-priority
351
- trie memory purge resolved # All resolved issues
352
- trie memory purge old # Older than 90 days
353
- ```
354
-
355
- </details>
356
-
357
- <details>
358
- <summary><b>Git Hooks</b></summary>
359
-
360
- Installed automatically with `trie init`:
361
-
362
- - **pre-commit** - Scan staged files, block on critical issues
363
- - **post-commit** - Update context graph
364
- - **pre-push** - Block push on critical issues
365
-
366
- **Bypass methods:**
367
- ```bash
368
- git push --no-verify # Skip all hooks
369
- TRIE_BYPASS=1 git push # Skip Trie but log bypass
370
- ```
371
-
372
- </details>
373
-
374
- ## How It Works
375
-
376
- ### Memory Architecture
377
-
378
- Trie maintains two complementary memory systems:
379
-
380
- **1. Governance Ledger** (`.trie/memory/ledger.json`)
381
- - Append-only chain with Ed25519 signatures
382
- - Tamper-evident, never deleted (only corrected)
383
- - Used for: audit trail, compliance, gotcha predictions
384
- - Auto-commits to Git for distributed backup
385
-
386
- **2. Issue Memory** (`.trie/memory/issues.json`)
387
- - Fast searchable cache of detected issues
388
- - Can be compacted and purged
389
- - Used for: pattern recognition, quick queries
390
- - Links back to ledger via `ledgerBlockHash`
391
-
392
- Both systems sync across your team and travel with your codebase via Git.
393
-
394
- ### File Structure
395
-
396
- ```
397
- your-project/
398
- ├── .trie/
399
- │ ├── memory/
400
- │ │ ├── ledger.json # Governance ledger (cryptographic chain)
401
- │ │ └── issues.json # Issue cache
402
- │ ├── warm/
403
- │ │ └── decisions.db # SQLite database for structured queries
404
- │ ├── context.json # Project knowledge graph
405
- │ ├── config.json # Settings
406
- │ └── keys/ # Ed25519 signing keys (never committed)
407
- ├── .trie-shared/ # Shared ledger for team sync (optional)
408
- │ ├── active/
409
- │ ├── archived/
410
- │ └── ledger-manifest.json
411
- └── .git/
412
- ```
413
-
414
- ### Signal Extraction
415
-
416
- Instead of dumping raw logs into context, Trie extracts structured signals:
417
-
418
- **Input:** Incident report, commit, conversation
419
- **Extraction:** AI pulls out structured data:
420
- - **Decisions**: "Chose bcrypt over sha256 for password hashing"
421
- - **Facts**: "Stripe requires TLS 1.2+ for EU transactions"
422
- - **Blockers**: "Missing VAT validation blocks EU checkout"
423
- - **Questions**: "Should we cache session tokens?"
424
-
425
- **Storage:** Goes to queryable database with embeddings
426
- **Query:** Agents ask for targeted context, not everything at once
427
-
428
- This prevents context pollution and keeps agents focused on relevant signals.
429
-
430
- ## CLI Reference
431
-
432
- ### Basic Commands
433
-
434
- ```bash
435
- trie init # Set up Trie in your project
436
- trie status # View project health and memory stats
437
- trie tell # Report incidents (extracts decisions, facts, blockers)
438
- trie gotcha # Predict problems with current changes
439
- trie learn # Train from git history or feedback
440
- trie watch # Start interactive monitoring dashboard
441
- ```
442
-
443
- ### Goals
53
+ ### Proactive Warnings
444
54
 
445
55
  ```bash
446
- trie goal add "<goal>" # Set improvement goal
447
- trie goal list # View progress
56
+ trie init
448
57
  ```
449
58
 
450
- ### Memory
59
+ This adds Cursor rules and CLAUDE.md guidance so agents call `trie_check_file` before editing files and read `trie://context` at conversation start.
451
60
 
452
- ```bash
453
- trie memory search "query" # Search incident history
454
- trie memory stats # View statistics
455
- trie memory recent # Recent issues
456
- trie memory purge smart # Clean up old/resolved
457
- ```
61
+ ## CLI Commands
458
62
 
459
- ### Ledger
63
+ | Command | Description |
64
+ |---------|-------------|
65
+ | `trie init` | Add Cursor/Claude rules for proactive file checks |
66
+ | `trie login` | Sign in via browser (OAuth) |
67
+ | `trie logout` | Revoke session |
68
+ | `trie teams [list\|switch <teamId>]` | List or switch teams |
69
+ | `trie pull [context\|graph\|signals\|documents\|ledger\|all]` | Fetch cloud data (JSON) |
70
+ | `trie status` | Show auth and cache status |
460
71
 
461
- ```bash
462
- trie ledger verify # Validate chain integrity
463
- trie ledger history # Show blocks with authors
464
- trie ledger stats # Block counts, entries, severity
465
- trie ledger correct <id> # Mark entry as corrected
466
- trie ledger corrections # View correction stats
467
- ```
72
+ ## MCP Tools
468
73
 
469
- ### Sync
74
+ | Tool | Description |
75
+ |------|-------------|
76
+ | `trie_context` | Consolidated context: hot zones, graph summary, recent signals/documents |
77
+ | `trie_check_file` | Risk assessment for a file (incidents, alerts, decisions) |
78
+ | `trie_graph` | Read ANT graph from cloud |
79
+ | `trie_signals` | Read signals feed |
80
+ | `trie_documents` | Read cloud documents |
81
+ | `trie_ledger` | Read cloud ledger entries |
82
+ | `trie_search` | Natural language search over cloud context |
470
83
 
471
- ```bash
472
- trie sync init # Initialize shared ledger
473
- trie sync pull # Pull from shared storage
474
- trie sync push # Push to shared storage
475
- trie sync status # Show sync state
476
- trie sync hooks --install # Install auto-sync git hooks
477
- ```
84
+ ## MCP Resources
478
85
 
479
- ### Keys
86
+ | URI | Description |
87
+ |-----|-------------|
88
+ | `trie://context` | Consolidated context with hot zones and active signals |
89
+ | `trie://graph` | Raw ANT graph from cloud |
480
90
 
481
- ```bash
482
- trie keys generate # Generate Ed25519 signing key
483
- trie keys status # Check if signing is configured
484
- trie keys public # Get your public key
485
- ```
91
+ **Usage:** Agents should read `trie://context` at conversation start and call `trie_check_file` before editing high-risk files.
486
92
 
487
- ### Feedback
93
+ ## Configuration
488
94
 
489
- ```bash
490
- trie ok # Pattern is good
491
- trie bad # Pattern is bad
492
- trie pause # Disable warnings for 1 hour
493
- ```
95
+ Auth and config are stored locally (keychain-backed where available). The API base URL defaults to `https://trie-api.vercel.app` and can be overridden with `TRIE_API_BASE_URL`.
494
96
 
495
- ### Setup
97
+ ## Development
496
98
 
497
99
  ```bash
498
- trie setup # Show setup guide
499
- trie setup slack <webhook> # Configure Slack
500
- trie setup test-slack # Test Slack connection
501
- trie linear auth <key> # Configure Linear
502
- trie linear sync # Sync Linear tickets
503
- ```
504
-
505
- ## Configuration
506
-
507
- Create `.trie/config.json`:
508
-
509
- ```json
510
- {
511
- "scanOptions": {
512
- "maxConcurrency": 4,
513
- "timeoutMs": 30000
514
- },
515
- "integrations": {
516
- "slack": {
517
- "enabled": true,
518
- "webhook": "https://hooks.slack.com/...",
519
- "channel": "#security"
520
- }
521
- },
522
- "autoEscalation": {
523
- "enabled": true,
524
- "quietHours": { "start": "21:00", "end": "08:00" }
525
- }
526
- }
100
+ npm install
101
+ npm run build
102
+ npm test
527
103
  ```
528
104
 
529
- ## Troubleshooting
530
-
531
- **Trie not finding issues**: You haven't taught Trie about your patterns yet. Use `trie tell` to report incidents.
532
-
533
- **Memory queries returning empty**: Report incidents with `trie tell` or run `trie learn` to extract from git history.
534
-
535
- **Query tools not working**: Make sure you've initialized with `trie init` and have `ANTHROPIC_API_KEY` set.
536
-
537
- **Hooks not working**: Reinstall with `trie init`. Check write permissions to `.git/hooks/`.
538
-
539
- **Goals showing but not detecting violations**: Goals may not be active in project state. Run `trie goal add "<goal>"` to activate.
540
-
541
- **Quick start:**
542
- 1. Fork and clone the repository
543
- 2. `npm install`
544
- 3. Copy `.env.example` to `.env.local` and add API keys
545
- 4. `npm run build`
546
- 5. `npm test`
547
-
548
105
  **Before submitting:**
549
- - All tests pass (`npm test`)
550
- - Type checking passes (`npm run typecheck`)
551
- - Follow code style (`npm run lint`)
552
- - Update docs for new features
553
- - Never commit secrets or API keys
554
-
106
+ - Tests pass (`npm test`)
107
+ - Typecheck passes (`npm run typecheck`)
108
+ - Lint passes (`npm run lint`)
555
109
 
556
110
  ## License
557
111