brain-ingest-gate
Pre-write quality gate for content entering the brain. No raw copies: a bare cp/mv into the brain repo is a bug. Before any new page lands, resolve named…
When the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER
$ npx -y skills add garrytan/gbrain --skill correction-pipeline --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/correction-pipelineContext preview
The summary Claude sees to decide when to auto-load this skill.
When the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER
name: correction-pipeline version: 1.0.0 description: | When the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER identity, bad facts row) or a hallucination (LLM confabulated from partial signals). triggers: - "that's wrong" - "that's not true" - "I never said that" - "where did you get that" - "you got that wrong" - "correct that fact" - "root-cause this error" mutating: true writes_pages: true writes_to: - people/ - companies/ - concepts/ upstream: correction-pipeline@fc834ee
> **Convention:** see [conventions/brain-first.md](../conventions/brain-first.md) > — Step 1 of the root-cause chain IS the brain-first lookup chain (`search` > for exact tokens, `query` for concept-shaped questions) before anything else. > > **Convention:** see [_brain-filing-rules.md](../_brain-filing-rules.md) — > corrections edit pages in place; the page stays filed by primary subject.
ANY factual error the user identifies. No exceptions. No "I'll note that."
(Routing here is a harness convention, not a mechanical guarantee — but once this skill is in play, the no-exceptions contract above is the discipline.)
1. **Acknowledge the error.** Don't defend. Don't explain. Just: "You're right. I got that wrong." 2. **Quote the specific wrong claim** so the user can see you know exactly what was wrong. 3. **State the correct fact** as the user gave it.
Run these steps IN ORDER. Report findings to the user.
gbrain search "<relevant terms>" --limit 10
For concept-shaped or synonym-phrased claims, escalate to `gbrain query "<question>"` (LLM expansion recovers phrasings `search` misses). Also grep the brain repo checkout directly — resolve it once from config:
BRAIN_DIR=$(gbrain config get sync.repo_path) grep -ri "<wrong claim terms>" "$BRAIN_DIR/people/" "$BRAIN_DIR/companies/" "$BRAIN_DIR/concepts/" 2>/dev/null
**Question:** Is the wrong fact IN the brain? If yes → the brain is the contamination source. Fix the brain page (Step 6).
Grep the harness's always-loaded memory files (e.g. the workspace `MEMORY.md` and any `memory/*.md` companions — the exact location depends on your harness):
grep -ri "<wrong claim terms>" <memory files> 2>/dev/null
**Question:** Is the wrong fact in memory? If yes → memory is the contamination source. Fix the memory file.
grep -i "<relevant terms>" <workspace>/SOUL.md <workspace>/USER.md 2>/dev/null
**Question:** Is there a misleading passage that could have led to the wrong inference? SOUL.md and USER.md are in every context window — a vague or ambiguous line here propagates into every session.
**Important:** on gbrain installs these files are RENDERED from the bootstrap answer bank (`state/interview.json`). Note the finding here; the fix goes through the answer bank in Step 6, never through a direct edit.
gbrain recall <entity-slug> # facts about the subject, newest first gbrain recall --grep "<claim terms>" # substring filter when the entity is unclear
Is there a wrong fact with high confidence? Note its fact id.
| Classification | Description | Fix surface | |----------------|-------------|-------------| | **BRAIN_ERROR** | Wrong fact exists in a brain page | Edit the page in the brain repo, commit, re-sync | | **MEMORY_ERROR** | Wrong fact exists in memory files | Fix the memory file | | **SOUL_USER_ERROR** | Misleading passage in SOUL.md or USER.md | Fix the ANSWER BANK, re-render — never the rendered file | | **FACTS_TABLE_ERROR** | Wrong fact in the gbrain facts table | `recall` → `forget <fact-id>` → `remember` the correction | | **HALLUCINATION** | No source — LLM confabulated from partial signals | Name the contamination vector (what partial signals led to it), write a guard fact | | **STALE_DATA** | Fact was once true but is no longer | Update the source with current truth; supersede the stale fact | | **CROSS_CONTAMINATION** | Correct fact about person A attributed to person B | Fix attribution in the source — on BOTH entities |
`[Source: user correction, YYYY-MM-DD]` on the corrected line. Commit, then `gbrain sync` so the DB reflects the fix. (Editing the DB row without the repo file — or vice versa — leaves the two out of agreement until the next sync overwrites one of them.)
rendered files, and a hand edit is silently lost on the next render. Fix the underlying answer in the shared bootstrap answer bank, then re-render:
gbrain bootstrap interview --set KEY "corrected value" # verbatim, user's words gbrain bootstrap interview --show # read back gbrain bootstrap interview --status # get the confirm hash gbrain bootstrap interview --confirm <hash> gbrain bootstrap render --only SOUL.md --force # repeat per affected file
The full interview discipline (read-back ritual, verbatim answers, backup behavior) lives in `skills/soul-audit/SKILL.md` — route through it for anything beyond a single-key fix.
provenance:
gbrain recall <entity-slug> # find the fact id gbrain forget <fact-id>
Give the agent you already use a memory you control. GBrain stores explicit facts with their sources, supports corrections and withdrawal, and makes the same memory available across your agents.
Repo: garrytan/gbrain
Pre-write quality gate for content entering the brain. No raw copies: a bare cp/mv into the brain repo is a bug. Before any new page lands, resolve named…
When you report a brain page to the user — created, edited, committed, or relayed from a subagent — a working link is part of the deliverable, in the SAME…
Brain knowledge base operations. The core read/write cycle: brain-first lookup, read-enrich-write loop, source attribution, ambient enrichment, back-linking.…
Deduplicate and synthesize raw concept stubs into a tiered intellectual map (T1 Canon to T4 Riff), tracing idea evolution across sources over time. Transforms…
Token-hygiene audit of the always-loaded context stack — CLAUDE.md, AGENTS.md, auto-memory MEMORY.md, and the bootstrap-rendered identity files (SOUL.md,…
Confirmation gate before any bulk delete, cleanup, or destructive operation that could result in data loss — shell-level (rm -rf, git rm, bulk sed) or…