@tangle-network/agent-knowledge 22.0.8 → 22.0.11
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.
- package/CHANGELOG.md +12 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/{inspect-Ct0VmbIZ.js → inspect-CTpCsUB2.js} +253 -244
- package/dist/inspect-CTpCsUB2.js.map +1 -0
- package/docs/architecture.md +2 -0
- package/package.json +3 -3
- package/dist/inspect-Ct0VmbIZ.js.map +0 -1
package/docs/architecture.md
CHANGED
|
@@ -42,6 +42,7 @@ When that string is the canonical `<root>/.agent-knowledge` directory, both form
|
|
|
42
42
|
| `.agent-knowledge/claim-ledgers/<id>.json` | one research run's claim ledger: corroboration counts, contradiction edges, open deep questions |
|
|
43
43
|
| `.agent-knowledge/sources.json` | the immutable source registry |
|
|
44
44
|
| `.agent-knowledge/mutation.lock.durable`, `mutation.lock.owner.json`, `mutation.lock.takeover`, `mutation-epoch.json`, `file-transactions/` | the cross-process mutation lock, the record of its holder, the guard one taker holds while breaking a dead holder's lock, and the crash-recovery state |
|
|
45
|
+
| `.agent-knowledge/improvements/<run>/run.lock.durable`, `run.lock.owner.json`, `run.lock.takeover` | one knowledge-improvement run's lease, the record of its holder, and the guard one taker holds while breaking a dead holder's lease |
|
|
45
46
|
|
|
46
47
|
The root is also the directory `withKnowledgeMutation` locks, so every record above is written under one lock and one epoch.
|
|
47
48
|
Within one process, writers to a root queue in arrival order before they take the file lock, and reads share that admission: a reader waits for at most the write in progress, and a same-process write never restarts a read.
|
|
@@ -51,6 +52,7 @@ Other processes still meet the file lock and the epoch.
|
|
|
51
52
|
Every holder of the lock, including a reader healing an abandoned epoch, records its label, pid, host, OS start token, boot id, pid namespace and the identity (dev, ino, nanosecond birthtime) of the lock directory it took (`src/lock-holder.ts`).
|
|
52
53
|
A holder is provably dead only when that record was written for the current lock directory, on this host and pid namespace, and the host has rebooted since, the pid is gone, or the pid now has a different start token.
|
|
53
54
|
A provably dead holder's lock is broken at once, under the `mutation.lock.takeover` guard, and the taker emits an `AGENT_KNOWLEDGE_LOCK_TAKEOVER` warning; any other holder, including one on another host, with an old or missing record, or on a filesystem without birthtimes, keeps the whole `staleMs` lease.
|
|
55
|
+
A knowledge-improvement run's lease (`acquireRunLease`, `src/kb-improvement/state.ts`) follows the same rule through the same owner: a provably dead holder's lease is taken over at once with the same warning, and any other holder makes the next run, promotion or restore fail fast with `ELOCKED` for the lease's `leaseTtlMs`.
|
|
54
56
|
Two limits follow from that rule. Every caller of one root must use the same `staleMs`, because a shorter window treats a live holder as stale and can race a takeover. Two machines that share a store root over a network filesystem, have the same hostname and both run in the init pid namespace look like one rebooted host, so give such hosts distinct hostnames.
|
|
55
57
|
A transaction with no recovery owner, found by a caller that holds the lock and is not resuming that purpose, is rolled back with an `AGENT_KNOWLEDGE_TRANSACTION_ROLLBACK` warning: it belongs to a hold that has ended without telling its caller it succeeded.
|
|
56
58
|
A transaction with a recovery owner stays until that owner resumes it, and every other reader and writer refuses with the owner, the transaction id, its creation time and the call that resumes it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-knowledge",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.11",
|
|
4
4
|
"description": "Build, search, evaluate, and improve source-backed knowledge bases.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-knowledge#readme",
|
|
6
6
|
"repository": {
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
"zod": "4.6.5"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@tangle-network/agent-eval": ">=0.213.0 <0.
|
|
88
|
+
"@tangle-network/agent-eval": ">=0.213.0 <0.219.0",
|
|
89
89
|
"@tangle-network/agent-interface": "^5.2.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
93
93
|
"@biomejs/biome": "^2.5.14",
|
|
94
94
|
"@neo4j-labs/agent-memory": "0.5.0",
|
|
95
|
-
"@tangle-network/agent-eval": "0.
|
|
95
|
+
"@tangle-network/agent-eval": "0.218.1",
|
|
96
96
|
"@tangle-network/agent-interface": "5.7.0",
|
|
97
97
|
"@types/node": "^26.6.2",
|
|
98
98
|
"mem0ai": "3.3.0",
|