threadnote 0.7.4 → 0.7.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.
@@ -8,9 +8,11 @@ Use OpenViking through Threadnote as a shared local context and memory layer. Re
8
8
  follow the nearest `AGENTS.md`, `CLAUDE.md`, or other checked-in instruction file first.
9
9
 
10
10
  When OpenViking MCP tools are available, use them directly. Prefer Threadnote-named MCP tools when present:
11
- `recall_context`, `read_context`, `list_context`, `remember_context`, and `share_publish`. Always pass JSON arguments to
12
- MCP tools, for example `recall_context({"query":"current repo latest handoff"})`. Older Threadnote MCP adapters may
13
- expose `search`, `read`, `list`, and `store` instead.
11
+ `recall_context`, `read_context`, `list_context`, `remember_context`, `compact_context`, and `share_publish`. Always
12
+ pass JSON arguments to MCP tools. When a recall query says "current repo" or "this branch", include the current
13
+ workspace path as `callerCwd`, for example
14
+ `recall_context({"query":"current repo latest handoff","callerCwd":"/absolute/workspace/path"})`. Older Threadnote MCP
15
+ adapters may expose `search`, `read`, `list`, and `store` instead.
14
16
 
15
17
  If MCP is unavailable, use the `threadnote` CLI fallback.
16
18
 
@@ -88,8 +90,19 @@ threadnote remember --kind durable --project my-repo --topic active-bug --text "
88
90
  threadnote handoff --project my-repo --topic active-bug --task "..." --tests "..."
89
91
  ```
90
92
 
91
- When recall/read surfaces several memories that describe the same durable fact, incident, branch, or handoff, compact
92
- them when it is safe:
93
+ Bare `threadnote handoff` stores the current repo/current branch handoff by default. Use `threadnote handoff
94
+ --timestamped` only when you intentionally want a historical note instead of updating the active branch handoff.
95
+
96
+ When recall/read surfaces several memories that describe the same durable fact, incident, branch, or handoff, run a
97
+ scoped hygiene dry-run before deciding what to change:
98
+
99
+ ```bash
100
+ threadnote compact --project my-repo --topic active-bug --dry-run
101
+ ```
102
+
103
+ ```text
104
+ compact_context({"project":"my-repo","topic":"active-bug","dryRun":true})
105
+ ```
93
106
 
94
107
  - Store one concise replacement memory that preserves the current status, the important facts, and the source `viking://`
95
108
  URIs you merged.
@@ -97,6 +110,8 @@ them when it is safe:
97
110
  no unique useful detail.
98
111
  - Use `threadnote archive <uri>` instead of `forget` when the old handoff still has provenance value but should no
99
112
  longer be treated as current context.
113
+ - Keep hygiene scoped to the current project/topic. Do not run global cleanup.
114
+ - For cross-repo features, link related durable memories explicitly in the body so recall can bridge the projects.
100
115
  - If the memories disagree or you are not sure what can be deleted, keep them and mention the possible cleanup instead.
101
116
 
102
117
  Never compact secrets, credentials, customer data, raw production logs, or checked-in canonical docs into memory.
@@ -142,6 +157,9 @@ Before pausing, switching agents, or ending meaningful work with local changes,
142
157
  - blockers;
143
158
  - next suggested step.
144
159
 
160
+ If you wrote or read multiple memories for the same project/topic during the task, run a scoped hygiene dry-run before
161
+ the handoff. Do not do global memory cleanup.
162
+
145
163
  Do not store long diffs, secrets, raw logs, or customer data in handoffs.
146
164
 
147
165
  ## CLI Fallback
@@ -157,6 +175,7 @@ threadnote list viking://agent/threadnote/memories --all --recursive
157
175
  threadnote remember --kind durable --project example --topic workflow --text "Durable engineering note..."
158
176
  threadnote remember --kind durable --project example --topic active-issue --text "Feature knowledge..."
159
177
  threadnote remember --replace viking://user/example/memories/durable/projects/example/workflow.md --text "Updated durable engineering note..."
178
+ threadnote compact --project example --topic active-issue --dry-run
160
179
  threadnote archive viking://user/example/memories/handoffs/active/example/old-issue.md
161
180
  threadnote forget viking://user/example/memories/events/duplicate.md
162
181
  threadnote handoff --project example --topic active-issue --task "short task summary" --tests "checks run" --next-step "what to do next"
package/docs/migration.md CHANGED
@@ -187,8 +187,9 @@ Preferred agent behavior is automatic after `threadnote install` has updated the
187
187
  `remember --replace <uri>` instead of burying that knowledge only in a handoff.
188
188
  - When current status changes, update the active handoff with the same project/topic or `handoff --replace <uri>` instead
189
189
  of creating another near-duplicate progress memory.
190
- - When recall surfaces clearly duplicate or stale memories, store one concise replacement memory and forget only the
191
- redundant originals.
190
+ - When recall surfaces clearly duplicate or stale memories, run `threadnote compact --project <name> --topic <topic>
191
+ --dry-run` or `compact_context({"project":"<name>","topic":"<topic>","dryRun":true})`. Keep cleanup scoped to the
192
+ current project/topic; archive stale handoffs by default and forget only exact redundant duplicates.
192
193
  - Before pausing, switching agents, or finishing meaningful code changes, store a concise handoff with status, tests,
193
194
  blockers, and next steps.
194
195
 
@@ -199,6 +200,7 @@ threadnote recall --query "last handoff for this branch"
199
200
  threadnote recall --query "durable feature knowledge for this branch"
200
201
  threadnote remember --kind durable --project example --topic active-feature --text "Feature knowledge..."
201
202
  threadnote remember --replace viking://user/example/memories/events/current.md --text "Updated durable engineering note..."
203
+ threadnote compact --project example --topic active-feature --dry-run
202
204
  threadnote handoff --project example --topic active-feature --task "short task summary" --tests "checks run" --next-step "what the next agent should do"
203
205
  ```
204
206
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadnote",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "type": "commonjs",
5
5
  "main": "dist/threadnote.cjs",
6
6
  "description": "Shared local context and handoffs for development agents",
@@ -43,18 +43,21 @@
43
43
  "clean": "rm -rf dist",
44
44
  "dev": "tsx src/threadnote.ts",
45
45
  "dev:mcp-server": "tsx src/mcp_server.ts",
46
- "lint": "eslint \"src/**/*.ts\"",
47
- "lint:fix": "eslint \"src/**/*.ts\" --fix",
46
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
47
+ "lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --fix",
48
48
  "prepare": "husky",
49
- "precommit": "npm run lint && npm run prettier:check",
49
+ "precommit": "npm run lint && npm run prettier:check && npm run test",
50
50
  "prepack": "npm run build",
51
51
  "prettier:check": "prettier --check \"**/*.{ts,js,cjs,json,md,yaml,yml}\"",
52
52
  "prettier:write": "prettier --write \"**/*.{ts,js,cjs,json,md,yaml,yml}\"",
53
+ "test": "vitest run",
54
+ "test:watch": "vitest",
55
+ "test:coverage": "vitest run --coverage",
53
56
  "threadnote": "npm run build --silent && node ./bin/threadnote.cjs",
54
57
  "doctor": "npm run build --silent && node ./bin/threadnote.cjs doctor",
55
58
  "mcp-server": "npm run build --silent && node ./bin/threadnote-mcp-server.cjs",
56
59
  "pack:dry-run": "npm pack --dry-run",
57
- "typecheck": "tsc --noEmit"
60
+ "typecheck": "tsc --noEmit && tsc -p test/tsconfig.json --noEmit"
58
61
  },
59
62
  "engines": {
60
63
  "node": ">=20"
@@ -64,6 +67,7 @@
64
67
  "@modelcontextprotocol/sdk": "^1.29.0",
65
68
  "@types/js-yaml": "^4.0.9",
66
69
  "@types/node": "^25.6.0",
70
+ "@vitest/coverage-v8": "^4.1.7",
67
71
  "commander": "^14.0.3",
68
72
  "esbuild": "^0.27.7",
69
73
  "eslint": "^10.3.0",
@@ -74,6 +78,7 @@
74
78
  "tsx": "^4.21.0",
75
79
  "typescript": "^6.0.3",
76
80
  "typescript-eslint": "^8.59.2",
81
+ "vitest": "^4.1.7",
77
82
  "zod": "^4.4.3"
78
83
  }
79
84
  }