A self-hosted knowledge graph whose relation writer skips every triple a correction rejected

GCTRL (Ground Control)

A self-hosted AGPL knowledge-graph platform that agents read and write over MCP: relations in Neo4j, chunks in Qdrant and PostgreSQL, heat-decayed dossiers, value-keyed corrections.

LicenceAGPL-3.0 in LICENSE and every package manifest except the MIT n8n connector; LICENSING.md offers a paid commercial licence as the alternative
Size53,962 lines of Rust in 63 files under services/api-rs/src, 13,613 lines of Python in 46 files under services/kex/src and 9,534 in 23 under services/fuse/src, 99 SQL migrations (2,793 lines), and a 1,430-line MCP server
Activity665 commits dated 23 April to 3 December 2026, 650 attributed to one account; the GitHub repository was created on 23 April 2026; the head commit's message names release v0.9.36
Tests623 Rust #[test] functions under services/api-rs/src, 392 pytest functions in 33 KEX test files and 136 in 12 FUSE test files; CI runs cargo check, not cargo test, for the API and no pytest step; none run here

Carries 3 of 7 rubric mechanisms. Most systems here carry none or one (41%), and a dash means the mechanism was not found at this commit — not that the system needed it. Each mark is one LLM reviewer's reading of the code at this commit rather than a run of it — known limits.

  • Tombstone
  • Trust state
  • Bi-temporal
  • Scope enforced
  • Mutation audit
  • Human review
  • Negative evals

1. Executive Summary

GCTRL, branded Ground Control, is a self-hosted platform that turns documents, connector data, code and agent notes into a knowledge graph that agents read and write over MCP. A Rust API fronts three stores: PostgreSQL for chunks, dossiers and corrections, Qdrant for chunk vectors, and Neo4j for entities and relations. A Python worker, KEX, extracts entities with GLiNER and relations with a local model; a second, FUSE, merges graphs and compiles per-entity dossiers. This report covers the memory those services keep for agents.

Notable: a correction is stored as the value it rejects. Deleting a wrong relation inserts owner, head, relation type and tail into knowledge_corrections, and the relation writer loads those triples before every extraction and skips a match. Chunk retrieval applies the owner, the granted jobs and a clearance rank as hard filters in both channels and again on the final list. Use drives a Hebbian heat with per-item half-lives.

Weak: trust is a float that ranks and labels. A dossier voted down to trust 0 is injected labelled authoritative, and the injection reheats it. Eviction archives a chunk for the lexical channel only. Node deletions are recorded and never read. Merge review happens after the merge. Neither the API's Rust tests nor the Python suites run in CI.

Three marks are present and four withheld (section 9).

Licence. The AGPL grant covers the tree, but the shipped stack holds every extraction until the vendor's licence is activated. The installer starts a licence agent whose /check refuses with "License not activated", and KEX holds each job on that answer; an unreachable agent fails open (deploy/compose-template.yml:97-101, services/agent-rs/src/server.rs:198-208, services/kex/src/middleware/license_check.py:46-50, :59-61). The tuned entity-resolution recipe "is NOT in this public repo" and arrives over the licence channel, leaving generic defaults in the tree (services/fuse/src/tuning.py:1-17). Contributors grant the maintainer a "perpetual, worldwide, royalty-free, irrevocable right" to relicense their work commercially (CONTRIBUTING.md:44-49). LICENSE is the unmodified AGPL text with no project copyright line, and nothing restricts analysis. SECURITY.md asks for private email reports, not public issues.

2. Mental Model

Everything enters as a job. An agent store, a file upload, a connector sync and a code index each insert a jobs row and push a payload onto a Redis queue (services/api-rs/src/routes/agent.rs:1624-1719). The KEX worker turns the job's text into entities, typed relations, chunks and a distilled fact log, and every product carries the job id: _source_jobs on nodes and edges, job_id on chunks and on their Qdrant points (docs/knowledge-removal.md:7-8). Scope and removal both follow that lineage.

Three tiers hold what was extracted. Chunks are the cold tier, searchable by vector and full text. Relations in Neo4j are structured facts, and the edge between two named entities is merged by head, type and tail, so re-extraction strengthens one edge rather than multiplying it (services/kex/src/kg_builder.py:543-544). Dossiers are the hot tier: a model-written summary per entity, its key facts and origin files, injected above everything else when a query names the entity (services/api-rs/migrations/049_entity_dossiers.sql:1-17).

A fact stops being believed in one of two ways. A person or agent deletes it, and the deletion leaves a correction row the writer reads on the next extraction. Or it cools: each use adds heat and lengthens a half-life, and a cycle decays idle items and archives the cold ones (services/api-rs/src/services/hebb.rs:1-17). The diagram follows a triple through both.

Diagram — How a stored text becomes chunks and edges, and where a correction stops a triple from coming back
Diagram source
%% caption: How a stored text becomes chunks and edges, and where a correction stops a triple from coming back
flowchart TD
    A["store, upload,<br/>connector, code index"] --> J["jobs row +<br/>Redis queue"]
    J --> W["KEX worker:<br/>GLiNER, relation model,<br/>chunking, fact log"]
    W --> C["text_chunks + Qdrant<br/>owner, job_id, min_rank"]
    W --> K{"triple in owner's<br/>corrections?"}
    K -->|yes| S["relation skipped"]
    K -->|no| G["Neo4j edge MERGE<br/>_owner, _source_jobs"]
    X["correct_relationship,<br/>downvote with a triple,<br/>conflict resolution"] --> D["edge deleted<br/>in Neo4j"]
    X --> KC["knowledge_corrections<br/>owner, head, rel, tail"]
    KC -.->|"read before<br/>every write"| K
    C --> R["search: owner + jobs<br/>+ clearance filters"]
    R --> H["Hebbian prior,<br/>agent notes last"]
    H --> P["prompt: dossiers,<br/>graph facts, chunks"]
    P -.->|"heat + half-life"| C
    M["cycle every 600 s:<br/>decay, dedup,<br/>promote, evict"] -.-> C

3. Architecture

docker-compose.yml builds the API from services/api-rs, KEX from services/kex, FUSE from services/fuse and a LIMES resolver from a path outside the repository (docker-compose.yml:186-188), beside PostgreSQL 16 and Redis. The installer's template adds Neo4j, Qdrant, Ollama, optional llama.cpp and vLLM servers, and the gctrl-agent licence container (deploy/compose-template.yml:12-20). services/api is an older TypeScript API that no compose file builds.

The API is one axum binary. Routes under /api/kg, /api/kex, /api/agent and /api/memory require authentication; /api/rag takes optional authentication (services/api-rs/src/main.rs:159-193). Background tasks in services/api-rs/src/background/mod.rs run the memory cycle, retention cleanup, conflict sweeps and the licence heartbeat. KEX is a FastAPI service with a worker pool draining the queue and a /search endpoint that only the API calls, guarded by a shared secret when one is set (services/kex/src/main.py:1948-1957).

Deployment and ergonomics

An operator stands up six services and four stores, plus a model server, and the GLiNER model is about 1.5 GB on a fresh install (services/kex/src/main.py:1187-1189). Extraction waits on licence activation as described in section 1. Every model call is local by default, and a per-knowledge-base local_only mode refuses a cloud provider before any call (services/api-rs/src/routes/rag.rs:597-610).

4. Essential Implementation Paths

  • Agent write. store in services/api-rs/src/routes/agent.rs:1624-1719 authorises the target knowledge base, reuses a job for identical text, inserts the job with source: "agent_store", and enqueues it. The stdio server's gctrl_store posts to /kex/extract instead (services/mcp/src/index.ts:999-1052, services/api-rs/src/routes/kex.rs:253-313).
  • Extraction. _run_pipeline_impl in services/kex/src/main.py:180-500 runs redaction, NER, relation extraction, the graph write, chunking, embedding, storage and the fact log.
  • Graph write and the correction check. build_graph and _write_relations in services/kex/src/kg_builder.py:170-310, :518-700.
  • Correction. delete_relationship_core and delete_node_core in services/api-rs/src/routes/kg.rs:3829-3885, :3982-4026; supersede_chunk_core in services/api-rs/src/routes/kex.rs:2105-2131; apply_fact_resolution in services/api-rs/src/routes/kg.rs:4745-4800.
  • Retrieval. query in services/api-rs/src/routes/rag.rs:466-1590; search_endpoint, _dense_search and _lexical_search in services/kex/src/main.py:1583-2050.
  • Hot tier. collect_hot_blocks and render_dossier_block in services/api-rs/src/routes/kg.rs:3739-3772, :3646-3690.
  • Dynamics. services/api-rs/src/services/hebb.rs, run_memory_cycle in services/api-rs/src/background/mod.rs:1789-1840, services/kex/src/dedup.py, services/kex/src/hebb.py.

5. Memory Data Model

Chunks are text_chunks rows with owner, job, compilation, clearance min_rank, entity_mentions, and the dynamics columns heat, access_count, last_accessed, archived, half_life_secs and archived_reason (services/api-rs/migrations/050_memory_dynamics.sql:18-23, services/api-rs/migrations/083_hebbian_memory.sql:16-18, services/api-rs/migrations/081_memory_eviction_windows.sql:17). A lesson is a chunk with kind = 'lesson' and its fields in meta (services/api-rs/migrations/099_lessons.sql:5-10). The fact log stores model sentences as further chunks under the same job, from sequence 5000 up (services/kex/src/fact_log.py:1-14, :30-31).

Graph elements are Entity nodes whose uri folds the name to a lower-case slug and prefixes twelve characters of the owner's id, so each owner has its own node per name (services/kex/src/kg_builder.py:20-33). Nodes and edges carry _owner, _source_jobs, a classification label list and _min_rank; edges add confidence, asserted_at, _source_doc and that document's modified time (services/kex/src/kg_builder.py:625-640).

Dossiers are entity_dossiers rows, unique per owner and entity uri, with summary, key_facts, origin_files, timeline, trust (a real defaulting to 0.8), pinned, heat columns, archived and stale (services/api-rs/migrations/049_entity_dossiers.sql:20-35, services/api-rs/migrations/096_entity_dossiers_stale.sql:9-10).

Corrections are knowledge_corrections rows: owner, optional compilation, element_kind, head, rel_type, tail, action and a reason (services/api-rs/migrations/044_knowledge_corrections.sql:15-26). The schema comment names edge and node kinds and the delete, rename and flag actions; the code also writes chunk rows and a job_removed action (services/api-rs/src/routes/kex.rs:1597). No statement in the tree updates or deletes a correction; an account deletion cascades.

Conflicts and reviews. fact_conflicts holds the competing values of a functional relation, an authority winner and a status, unique per owner, relation and key entity (services/api-rs/migrations/062_fact_conflicts.sql:34-52); migration 086 adds auto_resolved to open, resolved and dismissed (services/api-rs/migrations/086_conflict_resolutions.sql:41-51). Doubtful entity merges are review_queue rows (services/api-rs/migrations/092_merge_reviews.sql:1-27), and every human decision on a conflict is a conflict_resolutions row (services/api-rs/migrations/086_conflict_resolutions.sql:26-35).

6. Retrieval Mechanics

POST /api/rag/query serves the agent's query tool, the stdio gctrl_query and the chat (services/api-rs/src/routes/agent.rs:1587-1606). It resolves a clearance rank and, through chunk_job_scope, the jobs the caller may read: a named compilation's jobs for every caller, the granted jobs for a KB-scoped token, and no restriction otherwise (services/api-rs/src/routes/kg.rs:362-387). It sends query, owner, rank and jobs to KEX /search (services/api-rs/src/routes/rag.rs:653-676).

KEX embeds the query and runs both channels. The dense channel filters the Qdrant payload on owner, clearance and jobs, with the compilation as a soft preference and an owner-wide fallback (services/kex/src/main.py:1589-1640). The lexical channel runs websearch_to_tsquery with an ILIKE substring rescue, under the same filters plus archived = false (services/kex/src/main.py:1698-1714, :1729-1735). Reciprocal-rank fusion, a cross-encoder rerank, the Hebbian prior, a final job filter, a PostgreSQL clearance check and the trust order follow (services/kex/src/main.py:2001-2042).

The Hebbian prior gives a bounded bonus to chunks that keep being used and pulls in a strongly co-activated neighbour of the hits (services/kex/src/hebb.py, services/kex/tests/test_search_scope.py:93-99). The trust order moves every chunk of an agent_store job behind every chunk of any other job and tags it origin: "agent_note" (services/kex/src/trust.py:35-50).

Back in the API, a term-overlap rerank keeps ten chunks, and the ones returned are reheated and recorded as co-activated pairs (services/api-rs/src/routes/rag.rs:740-786, services/api-rs/src/services/hebb.rs:145-152). Up to three dossiers named in the query or the chunks are injected first, pinned first and then by trust (services/api-rs/src/routes/rag.rs:1178, services/api-rs/src/routes/kg.rs:3759-3762). Relations of the mentioned entities follow as a second tier; where a fact has several values, each is tagged current or superseded from the conflict scan's _authority (services/api-rs/src/routes/rag.rs:1226-1248, :2066-2091). The source sessions of the top chunks, at most six of about 4,000 characters, can be added last (services/api-rs/src/routes/rag.rs:951-962).

7. Write Mechanics

An agent's store returns at once with status: "pending"; the memory exists once the KEX worker finishes the job (services/api-rs/src/routes/agent.rs:1712-1718). The stdio server waits up to 90 seconds, polling every three, before linking the job to a compilation (services/mcp/src/index.ts:1018-1037). Text stored twice with the same settings links the existing job rather than extracting again (services/api-rs/src/routes/agent.rs:1656-1671).

The worker asks the licence agent for credits, then runs the pipeline (services/kex/src/main.py:730). The relation writer loads the owner's corrections first and skips matching triples (services/kex/src/kg_builder.py:229-232, :591-597). It merges nodes by uri and edges by head uri, type and tail uri, keeping the highest confidence and overwriting asserted_at (services/kex/src/kg_builder.py:654-667). After the write, conflict detection compares sibling edges of every relation registered as functional and stamps current on a winner ranked by source-document date, assertion time, dossier trust and confidence (services/kex/src/conflicts.py:229-272).

Operational cost

A ten-minute cycle runs for every account on the deployment (services/api-rs/src/background/mod.rs:210-225). It decays the heat of idle chunks and dossiers with an UPDATE across each table and merges near-duplicate chunks above cosine 0.92 once a night. It builds up to three dossiers per tick through FUSE with a model, promotes lessons proven in several projects to a team knowledge base, and archives dossiers idle seven days and chunks idle thirty (services/api-rs/src/background/mod.rs:1754-1766, :1789-1840, :1959-1973, services/api-rs/src/routes/lessons.rs:322, :378). The owner-level run_maintenance tool runs the same deployment-wide cycle on demand, dedup included (services/api-rs/src/routes/agent.rs:2327-2338).

8. Agent Integration

The stdio server registers 34 gctrl_* tools, each with a deprecated borghive_* alias. It calls the REST API with a scoped token or, as a fallback, a password login defaulting to admin@gctrl.tech (services/mcp/src/index.ts:76-86). With GCTRL_GATEWAY_URL set it proxies the HTTP gateway's tool list instead. The gateway at /api/agent/mcp exposes the agent's 56 tools and is on unless GCTRL_AGENT_GATEWAY_ENABLED is false, though its module comment says off by default (services/api-rs/src/config.rs:66-70, services/api-rs/src/routes/agent_gateway.rs:12-13).

The agent holds its own correction verbs: correct_relationship, delete_node, delete_chunk, supersede_chunk and memory_feedback (services/api-rs/src/routes/agent.rs:394, :412-415). The owner-level memory tools refuse a KB-scoped token, and a read-only token may call only the listed read tools (services/api-rs/src/routes/agent.rs:2276-2278, :446-455, :822). The store description tells the model to store only what the user asks for or confirms, because "unverified agent notes are read back later as facts" (services/api-rs/src/routes/agent.rs:379).

9. Reliability, Safety, and Trust

A correction is a value the writer checks

delete_relationship_core deletes the matching edge inside the compilation's jobs and inserts the triple whether or not an edge was found (services/api-rs/src/routes/kg.rs:3851-3878). Four paths reach it: the graph editor's DELETE /api/kg/relationship, the agent's correct_relationship, a downvote naming a triple from the chat or the agent, and a fact-conflict resolution, which blocks each losing value (services/api-rs/src/routes/kg.rs:4785-4800). The writer's check runs before every relation write.

The match is narrower than the node identity. The writer compares head and tail as stripped strings, case-sensitively, while the node uri folds case, so "ACME" re-asserts a relation rejected for "Acme" (services/kex/src/kg_builder.py:28, :591-592). The loader returns an empty set when PostgreSQL is unreachable (services/kex/src/kg_builder.py:405-408). Node deletions are written as element_kind node and the loader reads edges only, so a deleted entity is recreated by the next extraction that mentions it (services/api-rs/src/routes/kg.rs:4015-4020, services/kex/src/kg_builder.py:396-399). A superseded chunk is flagged by its id, and the same passage ingested again is a new chunk (services/api-rs/src/routes/kex.rs:2122-2127).

Trust is a number, and the hot block shows it

A downvote sets the dossier's trust to 0 and its heat to 0 (services/api-rs/src/routes/rag.rs:145-163, services/api-rs/src/services/hebb.rs:233-236). The handler's comment says the block then renders flagged low-trust (services/api-rs/src/routes/rag.rs:66-68). Nothing filters on trust. The hot block keeps the three best dossiers by pin and trust, renders each under "TRUST TIER 1 · DOSSIER (authoritative) · trust=0.00", and reheats each one it injects (services/api-rs/src/routes/kg.rs:3646-3651, :3759-3769, services/api-rs/src/services/hebb.rs:191-200). A distrusted dossier that a query names is printed as authoritative and kept warm by being injected.

The agent-note demotion keys on jobs.input->>'source' = 'agent_store' (services/kex/src/trust.py:53-66). Only the gateway's store writes that tag; the stdio server's gctrl_store goes through /kex/extract, whose job input has none, so its notes rank with documents (services/api-rs/src/routes/kex.rs:303-313).

Eviction hides a chunk from one channel

Eviction, dedup and supersession all set archived. The lexical channel filters it; the dense channel's Qdrant filter has no such condition (services/kex/src/main.py:1589-1604, :1700-1702). Dedup and supersession delete the vector, so their chunks are gone from both (services/kex/src/dedup.py:247-256, services/api-rs/src/routes/kex.rs:2120). An evicted chunk keeps its vector, can be returned by the dense channel, and is unarchived by the heat bump that follows (services/api-rs/src/background/mod.rs:2091-2101, services/api-rs/src/services/hebb.rs:176-177). Eviction is a lexical demotion.

Review comes after the merge

FUSE merges both its acceptance and review bands and then queues the few doubtful merges that hold a cluster together (services/fuse/src/merger.py:767-790, :820-825). The resolve route's comment says the merge has happened when the question is asked, and not_same queues a re-merge that splits the node (services/api-rs/src/routes/kg.rs:4297-4300). Fact conflicts are delivered with both values tagged while the row is open. After five human decisions with one signature and an 80% majority, the decision memory applies the next one itself (services/api-rs/migrations/086_conflict_resolutions.sql:3-13).

The audit trail is an access log

log_access records action, resource, clearance and outcome for reads and writes alike (services/api-rs/src/services/audit.rs:18-51). A relation deletion logs the compilation as its resource, and the triple lives only in the correction row (services/api-rs/src/routes/kg.rs:3884-3886). Trust, pins, heat and archival overwrite in place. The cycle's run log is pruned to 200 rows (services/api-rs/src/background/mod.rs:1863-1866). The retention job's audit insert names entity_type and entity_id, columns audit_log does not have, and discards the error before deleting the compilation (services/api-rs/src/background/mod.rs:1378-1389, services/api-rs/migrations/005_audit_log.sql:1-10).

Marks

  • tombstone — present. A rejected triple keyed on its value, consulted by the extraction writer; case-sensitive, edges only, and untested.
  • scope_enforced — present. Owner, granted jobs and clearance filter both chunk channels and the final list; dossiers filter on owner and clearance.
  • negative_eval — present. Populated cases in Rust and Python assert a foreign job's chunk is dropped; they are unit cases and CI runs neither.
  • trust_state — withheld. Dossier trust is a float that ranks and is printed; current and superseded are labels on delivered facts; the archived flag that does withhold is a lifecycle column shared by disuse, dedup and supersession, and the dense channel ignores it.
  • bitemporal — withheld. fact_conflicts.valid_from and valid_to are declared reserved and have no writer (services/api-rs/migrations/062_fact_conflicts.sql:31); edges hold a source-document date used for ranking and an asserted_at overwritten on every re-extraction.
  • audit_log — withheld. The access log does not say what changed, and the correction table records removals only.
  • human_review — withheld. Merges are applied before review, conflicting values are delivered while open, and the agent holds the correction verbs.

10. Tests, Evals, and Benchmarks

The API carries 623 Rust #[test] functions inline, KEX 392 pytest functions in 33 files and FUSE 136 in 12. CI runs cargo test for the licence agent, npm test for the TypeScript agent and the code indexer, and cargo check for the API; no workflow runs pytest (.github/workflows/build-push.yml:204, :285, .github/workflows/ci.yml:74, :87). I ran none of them.

The negative cases are real and narrow. foreign_job_chunks_are_dropped feeds three chunks from two jobs and asserts the two in scope (services/api-rs/src/routes/kg.rs:5514-5523). Its Python twin drops foreign, jobless and missing-job chunks, and a second case removes a co-activated neighbour from another job (services/kex/tests/test_search_scope.py:86-99). Source guards over main.py assert that each channel passes the scope (services/kex/tests/test_search_scope.py:164-187). Nothing tests the correction skip: every builder test patches the loader to return nothing.

Cases to want first: a re-extraction of a corrected triple with different casing; a downvoted dossier named in a query; an evicted chunk that the dense channel returns.

No paper describes GCTRL; the only arXiv link in the tree is in a blog post. The README's entity-resolution F1 figures have no committed result file. A code-navigation benchmark ships its questions and results under packages/code-indexer/bench/, and measures the code tools, not memory.

11. For Your Own Build

Steal

  • Store the correction as the value. A row of head, relation and tail that the writer reads before writing survives every re-ingest of the source.
  • Carry the job on everything. One lineage key on chunks, points, nodes and edges gives scope, removal and provenance the same answer.
  • Scope twice. Filter in the store, then filter the final list again after any step that can add rows, as the Hebbian pull-in can.
  • Lengthen the half-life on use. Used knowledge decays over months and a one-off passage over weeks, with no tuning per item.

Avoid

  • Do not let a downvote stop at a number. If trust only ranks, label it honestly, and do not let injection reheat what a person distrusted.
  • Do not archive in one index. A flag the vector store cannot see makes eviction channel-dependent.
  • Fold the comparison the way identity folds. A correction that compares raw strings while nodes fold case rejects one spelling.
  • Do not record what no reader consults. A node correction nothing reads tells the user "remembered" and does nothing.

Fit

Fits a team that wants a governed, self-hosted graph over its documents with local models, clearance levels per element and colleague tokens scoped to knowledge bases, and that will run six services and accept the vendor's licence activation.

Walk away if a distrusted fact must stop reaching the agent, if forgetting must hold on every retrieval channel, or if you need the memory without the document-ingestion platform around it.

12. Open Questions

  • Whether a downvoted dossier is meant to keep the authoritative label, given that the feedback handler's comment says it renders flagged low-trust.
  • Whether eviction is meant to apply to the dense channel.
  • Whether node corrections are meant to block re-extraction, as the delete_node description's "remembered" implies (services/api-rs/src/routes/agent.rs:413).
  • Whether the stdio gctrl_store path is meant to bypass agent-note demotion.

Appendix: File Index

  • API: services/api-rs/src/routes/agent.rs, services/api-rs/src/routes/kg.rs, services/api-rs/src/routes/rag.rs, services/api-rs/src/routes/kex.rs, services/api-rs/src/routes/lessons.rs, services/api-rs/src/routes/memory.rs, services/api-rs/src/routes/agent_gateway.rs
  • Dynamics: services/api-rs/src/services/hebb.rs, services/api-rs/src/background/mod.rs, services/kex/src/hebb.py, services/kex/src/dedup.py
  • Extraction and graph: services/kex/src/main.py, services/kex/src/kg_builder.py, services/kex/src/conflicts.py, services/kex/src/fact_log.py, services/kex/src/trust.py, services/kex/src/search_scope.py
  • Fusion and dossiers: services/fuse/src/merger.py, services/fuse/src/tuning.py
  • Licence: services/agent-rs/src/server.rs, services/kex/src/middleware/license_check.py, LICENSING.md, CONTRIBUTING.md, SECURITY.md
  • Schema: services/api-rs/migrations/044_knowledge_corrections.sql, 049, 050, 062, 081, 083, 086, 092, 096, 099
  • Agent surface: services/mcp/src/index.ts
  • Docs: docs/knowledge-removal.md, docs/security/2026-09-17-chunk-scope.md
  • Tests: services/kex/tests/test_search_scope.py, services/kex/tests/test_code_job.py, inline #[cfg(test)] modules in services/api-rs/src

Recorded searches

Run from the repository root at the pinned commit with /usr/bin/git grep.

  • No writer reads node corrections. git grep -n -E "element_kind *= *'node'" -- services/kex services/fuse returns nothing; the same pattern with 'edge' returns services/kex/src/kg_builder.py:383 and :398.
  • No statement updates or deletes a correction. git grep -n -i -E '(update|delete from) +knowledge_corrections' -- services returns nothing.
  • The validity columns have no writer. git grep -n -E 'valid_from|valid_to' -- services returns the declarations in services/api-rs/migrations/059_source_documents.sql:26-27 and services/api-rs/migrations/062_fact_conflicts.sql:31, :50-51, and unrelated ensure_valid_token lines in connectors.rs.
  • No test exercises the correction skip. git grep -n -E '_load_corrected_triples|corrected' -- services/kex/tests returns patches to an empty set and corrected=set() arguments, beside corrected_type fields in an entity-verification test.
  • Only the gateway tags agent notes. git grep -n -F 'agent_store' -- services/api-rs/src services/mcp/src services/kex/src returns services/api-rs/src/routes/agent.rs:1681, :1684, comments and a test in kex.rs, and services/kex/src/trust.py:5, :28.
  • The dense channel reads no archive flag. git grep -n -w archived -- services/kex/src/main.py returns the lexical clauses at :1700-1702, :1729-1730 and the lessons query at :2102.
  • CI runs no pytest and no API tests. git grep -n -E 'pytest|cargo test' -- .github returns .github/workflows/build-push.yml:204, the licence agent's cargo test.
  • audit_log has no entity_type column. git grep -n -E 'entity_type|entity_id' -- services/api-rs/migrations returns ontology columns in 007_ontologies.sql and entity_types in 027_pii_log.sql only.
  • No agent tool resolves a review. In the tool schema at services/api-rs/src/routes/agent.rs:376-435, a case-insensitive search for resolve, approve, dismiss or merge_review counts 0.
  • No paper. CITATION.cff is absent; git grep -n -i -E 'arxiv|doi\.org|bibtex' returns one link in a blog post under services/portal/src/pages/blog/content/.
  • No prior atlas name. RENAME-PLAN.md records the rename from BorgHive, and node uris carry a databorg: prefix; grep -rl -i -E 'borghive|databorg|gctrl' content/ in the atlas returns nothing.

History

2026-12-04 — 58266c05…. First reading, from the 2026-12-04 triage shortlist, at the head of main; triage assessed 0a076661e085, which the depth-1 clone does not hold. Screened: 44 files; two auto-run surfaces (an LFS filter in .gitattributes for the fusion-engine jars, skipped on clone, and an npx start command in smithery.yaml); one build-time execution point (n8n-nodes-gctrl/package.json's prepublishOnly); 28 dependency surfaces inside the cooldown, a count the depth-1 clone inflates; 13 unpinned surfaces. Nothing was installed, built or run. Three marks (section 9).