@semiont/make-meaning 0.5.28 → 0.5.30

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/README.md CHANGED
@@ -10,24 +10,37 @@
10
10
 
11
11
  This package implements the actor model from [ACTOR-MODEL.md](../../docs/system/ACTOR-MODEL.md). It owns the **Knowledge Base** and the seven actors that serve it.
12
12
 
13
- Five **access actors** mediate every read and write — the bus-facing interface of the Knowledge Base:
13
+ **The actors no longer run in one process.** Each container entry point in this package starts the subset it owns, and the gateway constructs **none** of them it keeps the HTTP surface, the bus door, and the job queue.
14
14
 
15
- - **Stower** (write) the single write gateway to the Knowledge Base; handles all resource and annotation mutations and job lifecycle events
16
- - **Browser** (read) handles all KB read queries: resources, annotations, events, annotation history, referenced-by lookups, entity type and tag-schema listing, the collaborator directory (the KB's declared software agents, derived from the workers/actors inference config), and directory browse (merging filesystem listings with KB metadata)
17
- - **Gatherer** (context assembly) — assembles gathered context for annotations (`gather:requested`) and resources (`gather:resource-requested`); searches vectors for semantically similar passages (adds `semanticContext` to `GatheredContext`)
18
- - **Matcher** (search/link) — context-driven candidate search with multi-source retrieval, composite structural scoring, and optional LLM semantic scoring
19
- - **CloneTokenManager** (yield) manages clone token lifecycle for resource cloning
15
+ | Service | Entry point | Actors |
16
+ | --- | --- | --- |
17
+ | **Archivist** | `@semiont/make-meaning/archivist-main` | Stower, Browser, CloneTokenManager |
18
+ | **Librarian** | `@semiont/make-meaning/librarian-main` | Gatherer, Matcher |
19
+ | **Smelter** | `@semiont/make-meaning/smelter-main` | Smelter |
20
+ | **Weaver** | `@semiont/make-meaning/weaver-main` | Weaver |
20
21
 
21
- Two **projection pipelines** follow the event log to keep the eventually-consistent read models in sync addressed by no one, replying to nothing:
22
+ `startMakeMeaning()` still assembles the **whole** set in one process that is what `LocalTransport`, scripts and tests use, and it is unchanged. `startMakeMeaningGateway()` is the split-topology root: same stores, no actors, a handler subset.
22
23
 
23
- - **Weaver** (project)subscribes to graph-relevant domain events and projects them into the graph database; carried on the KB record (`kb.weaver`) and rebuilt from the event log at startup (`rebuildAll()`)
24
- - **Smelter** (embed) — standalone embedding pipeline run via `@semiont/make-meaning/smelter-main` (not started by `startMakeMeaning`); subscribes to domain events, reads content from the KB working tree via `WorkerContentTransport`, chunks text, embeds via `@semiont/vectors`, and indexes into the vector store (Qdrant). On startup it reconciles Qdrant against the KS catalog — re-embedding what's missing or stale (every upsert is stamped with the embedded bytes' checksum, so changed content is detected) and deleting orphans — so a wiped Qdrant volume, or events missed while the worker was down, recover by restarting the smelter
24
+ ### The access actors the bus-facing interface of the Knowledge Base
25
25
 
26
- (The third derived read model the materialized views is not pipeline-maintained: the EventStore's `ViewManager` materializes views synchronously inside `appendEvent()` for a read-your-writes guarantee.)
26
+ - **Stower** (write, *Archivist*) the single write gateway to the Knowledge Base; handles all resource and annotation mutations and job lifecycle events. The only caller that appends events
27
+ - **Browser** (read, *Archivist*) — handles all KB read queries: resources, annotations, events, annotation history, referenced-by lookups, entity type and tag-schema listing, the collaborator directory (the KB's declared software agents, derived from the workers/actors inference config), and directory browse (merging filesystem listings with KB metadata)
28
+ - **Gatherer** (context assembly, *Librarian*) — assembles gathered context for annotations (`gather:requested`) and resources (`gather:resource-requested`); searches vectors for semantically similar passages (adds `semanticContext` to `GatheredContext`)
29
+ - **Matcher** (search/link, *Librarian*) — context-driven candidate search with multi-source retrieval, composite structural scoring, and optional LLM semantic scoring
30
+ - **CloneTokenManager** (yield, *Archivist*) — manages clone token lifecycle for resource cloning
31
+
32
+ **Stower and Browser stay together on purpose:** Stower writes the events and projections that Browser reads, so splitting them would open a cross-process read-after-write window over the same state. Git is single-writer for the same reason — the Archivist owns the working tree.
33
+
34
+ ### The projection pipelines — addressed by no one, replying to nothing
35
+
36
+ - **Weaver** (project, *Weaver service*) — subscribes to graph-relevant domain events and projects them into the graph database. It rebuilds from the event log only on an explicit `weave:rebuild`, so a projection-shape change needs that command, not just a restart
37
+ - **Smelter** (embed, *Smelter service*) — subscribes to domain events, reads content through `WorkerContentTransport`, chunks text, embeds via `@semiont/vectors`, and indexes into the vector store (Qdrant). It also owns anchored-text extraction. On startup it reconciles Qdrant against the KS catalog — re-embedding what's missing or stale (every upsert is stamped with the embedded bytes' checksum, so changed content is detected) and deleting orphans — so a wiped Qdrant volume, or events missed while it was down, recover by restarting it
38
+
39
+ (The third derived read model — the materialized views — is not pipeline-maintained: the EventStore's `ViewManager` materializes views synchronously inside `appendEvent()` for a read-your-writes guarantee. The Archivist rebuilds them at startup; unlike the graph, they need no explicit command.)
27
40
 
28
41
  All seven actors subscribe to the EventBus via RxJS pipelines and expose no public business methods — only `initialize()` and `stop()`, plus a startup recovery entry point on the pipelines (`rebuildAll()` / `reconcile()`). Callers communicate with the access actors by putting events on the bus.
29
42
 
30
- The EventBus is a **complete interface** for all knowledge-domain operations. HTTP routes in the backend are thin wrappers that delegate to EventBus actors. The `@semiont/http-transport` exposes the same operations via verb-oriented namespaces (`semiont.browse`, `semiont.mark`, `semiont.gather`, etc.).
43
+ The EventBus is a **complete interface** for all knowledge-domain operations. HTTP routes in the gateway are thin wrappers that delegate to EventBus actors. The `@semiont/http-transport` exposes the same operations via verb-oriented namespaces (`semiont.browse`, `semiont.mark`, `semiont.gather`, etc.).
31
44
 
32
45
  ## Quick Start
33
46
 
@@ -45,7 +58,9 @@ import type { Logger } from '@semiont/core';
45
58
 
46
59
  // EventBus is created outside make-meaning — it is not encapsulated by this package
47
60
  const eventBus = new EventBus();
48
- const project = new SemiontProject('/path/to/project');
61
+ const project = new SemiontProject('/path/to/project', {
62
+ anchoredTextDir: process.env.SEMIONT_ANCHORED_TEXT_DIR!,
63
+ });
49
64
 
50
65
  // Start all infrastructure
51
66
  const makeMeaning = await startMakeMeaning(project, config, eventBus, logger);
@@ -103,7 +118,7 @@ All meaningful actions flow through the EventBus. The KB actors are reactive —
103
118
 
104
119
  ```mermaid
105
120
  graph TB
106
- Routes["Backend Routes"] -->|commands| BUS["Event Bus"]
121
+ Routes["Gateway Routes"] -->|commands| BUS["Event Bus"]
107
122
  Workers["Job Workers"] -->|commands| BUS
108
123
  EBC["SemiontClient"] -->|commands| BUS
109
124
 
@@ -183,7 +198,7 @@ const kb = await createKnowledgeBase(eventStore, project, graphDb, eventBus, log
183
198
 
184
199
  ### EventBus Ownership
185
200
 
186
- The EventBus is created by the backend (or script) and passed into `startMakeMeaning()` as a dependency. Make-meaning does not own or encapsulate the EventBus — it is shared across the entire system.
201
+ The EventBus is created by the gateway (or script) and passed into `startMakeMeaning()` as a dependency. Make-meaning does not own or encapsulate the EventBus — it is shared across the entire system.
187
202
 
188
203
  ### Pure projection validators
189
204
 
@@ -204,7 +219,7 @@ This pattern (functional core, imperative shell) is shared with `@semiont/event-
204
219
  - **[API Reference](./docs/api-reference.md)** — Context modules and operations
205
220
  - **[Examples](./docs/examples.md)** — Common use cases and patterns
206
221
  - **[Job Workers](./docs/job-workers.md)** — Async annotation workers (in @semiont/jobs)
207
- - **[Scripting](./docs/SCRIPTING.md)** — Direct scripting without HTTP backend
222
+ - **[Scripting](./docs/SCRIPTING.md)** — Direct scripting without HTTP gateway
208
223
 
209
224
  ## Exports
210
225
 
@@ -0,0 +1,2 @@
1
+
2
+ export { };