Knowledge-Graph Lint
A structural health check over a link-structured knowledge base — orphan pages, broken or absent links — run as a gate before new writes rather than as occasional cleanup. In a store where the link graph is the index (a second brain / wiki with no vector store), a page that no other page links to is unreachable by the graph-walk the agent uses to retrieve it: the file exists, but for retrieval purposes it is silently lost. So "health" here is a graph-connectivity property, and the orphan is its canonical defect. The lint asks a narrow, mechanical question — is the graph well-formed enough to add to? — separate from whether any page's content is good.
Its natural delivery is a deterministic code hook that fires before the agent writes, so a stochastic generator cannot degrade the graph without passing a mechanical check first. In the Taoufik build it is a Python "brain-lint" hook paired with a session-start hook; the determinism is the point — the guard does not depend on the model choosing to check. This makes it the structural sibling of two other gates: Validation-Gated Update gates on a content score improving against a held-out set, and Input & Output Guardrails gate the model's I/O for safety; knowledge-graph lint gates on the store's shape staying connected.
Claims
- In a store where the link structure is the index, graph connectivity is the health metric and an orphan (a page nothing links to) is the canonical defect. principle — durable: reachability equals retrievability when retrieval is a graph-walk over backlinks, so an unlinked page is effectively lost even though the file is on disk. This is why Knowledge Graph Retrieval and this lint are two sides of one coin.
- Lint the knowledge base for structural health and run the check as a gate before new writes, not as occasional cleanup. best practice — context: an agent-maintained, link-structured markdown store (second brain / wiki) grown incrementally and often unattended; catching orphans at write time keeps the defect count from compounding. Less useful for a flat, unlinked note pile where there is no graph to keep connected.
- Deliver the lint as a deterministic code hook that fires before the write, so a stochastic generator cannot degrade the graph without passing a mechanical check first. best practice — context: harnesses that support pre-write hooks (Claude Code); the video runs it as a Python pre-write hook alongside a session-start profile-loading hook. Wrapping a nondeterministic agent in deterministic checkpoints is the general move — the guard's value comes from not being at the model's discretion.
- The video states the hook "checks the brain is healthy enough to add new information, or [flags] pages that are orphans and not related to each other" before any page is written. observation — Taoufik's framing of the brain-lint hook; the health signal it reports is orphan/relatedness, i.e. connectivity.
Related
- Validation-Gated Update — the sibling gate on content: accept an edit only if a held-out score improves. This one gates on structure (is the graph still connected), not on a score.
- Input & Output Guardrails — the sibling gate on the model's I/O for safety; knowledge-graph lint guards the store's shape instead.
- Knowledge Graph Retrieval — why orphans matter: retrieval is a walk over links, so an unlinked page is unreachable regardless of its content.
- Agent Rituals — the lint is typically wired in as a hook (a begin/pre-write ritual step), the deterministic cousin of a context-file ritual.
- AI Second Brain — the store this lint keeps healthy; the "just files and folders" brain whose value is retrievability.
- Incremental Indexing — the write cadence the lint gates: process/add only what changed, and check the graph is sound each time you do.
- Distillate: I Gave Claude Code a Permanent Memory