Knowledge base (GKB)#
A write reaches canonical Markdown first. PostgreSQL holds a projection built from it, so the projection can be rebuilt.
Publishing#
Step |
What happens |
Code |
|---|---|---|
1 |
A client or agent publishes an artifact with evidence, lineage and an |
|
2 |
The artifact is built and checked against its schemas and pack extensions |
|
3 |
The contribution sink takes it |
|
4 |
The sink holds the writer lease and reserves the key in the filesystem journal |
|
5 |
The Markdown file is committed atomically. This is the durable commit |
|
6 |
The artifact is registered and an outbox event queued in one transaction |
|
7 |
The caller gets a receipt: artifact ID, URI, content hash and projection state |
If PostgreSQL is down, the commit still stands and registration waits.
Projecting#
The gkb-worker container claims outbox events with a lease, reads the artifact, verifies
its content hash, projects it for search and review state, and completes the event
(knowledge/gkb/worker.py, projectors.py).
Reading#
POST /v1/gkb/search, GET /v1/gkb/artifacts/{artifact_id} and MCP gkb_get_artifact
read the projection.