@tangle-network/agent-knowledge 22.0.7 → 22.0.8
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 +4 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{inspect-DOQ_h1p6.js → inspect-Ct0VmbIZ.js} +299 -92
- package/dist/inspect-Ct0VmbIZ.js.map +1 -0
- package/docs/architecture.md +7 -2
- package/package.json +1 -1
- package/dist/inspect-DOQ_h1p6.js.map +0 -1
package/docs/architecture.md
CHANGED
|
@@ -41,14 +41,19 @@ When that string is the canonical `<root>/.agent-knowledge` directory, both form
|
|
|
41
41
|
| `.agent-knowledge/events.json` | legacy event array; migrated transactionally on the first event write |
|
|
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
|
-
| `.agent-knowledge/mutation.lock.durable`, `mutation-epoch.json`, `file-transactions/` | the cross-process mutation lock
|
|
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
45
|
|
|
46
46
|
The root is also the directory `withKnowledgeMutation` locks, so every record above is written under one lock and one epoch.
|
|
47
47
|
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.
|
|
48
48
|
A waiting writer stops new readers from entering, and a finishing writer admits every waiting reader, so neither side starves.
|
|
49
49
|
A mutation cannot start inside a read of the same root; it fails instead of waiting on itself.
|
|
50
50
|
Other processes still meet the file lock and the epoch.
|
|
51
|
-
|
|
51
|
+
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
|
+
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
|
+
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.
|
|
54
|
+
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
|
+
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
|
+
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.
|
|
52
57
|
Retrieval visibility snapshots under `.agent-knowledge/retrieval-visibility/` are content-addressed evidence, written without the lock and without moving the epoch.
|
|
53
58
|
There is exactly one writer per file: a second index writer alongside this one is a defect, not a variation.
|
|
54
59
|
|
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.8",
|
|
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": {
|