{"id":51231197,"url":"https://github.com/jeremylongshore/governed-second-brain-plugin","last_synced_at":"2026-06-28T16:30:54.642Z","repository":{"id":365362853,"uuid":"1271735409","full_name":"jeremylongshore/governed-second-brain-plugin","owner":"jeremylongshore","description":"Governed Second Brain — a local-first, in-process Claude Code + Cowork plugin. Turn your own files into cited (qmd://) memory with a tamper-evident, SHA-256 hash-chained audit trail. No daemon, no network.","archived":false,"fork":false,"pushed_at":"2026-06-25T18:26:45.000Z","size":595,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T20:13:02.145Z","etag":null,"topics":["audit-trail","citations","claude-code","cowork","governance","governed-second-brain","knowledge-management","local-first","mcp","plugin","qmd","rag","second-brain"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremylongshore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-17T00:58:55.000Z","updated_at":"2026-06-25T18:29:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jeremylongshore/governed-second-brain-plugin","commit_stats":null,"previous_names":["jeremylongshore/governed-second-brain-plugin"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jeremylongshore/governed-second-brain-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremylongshore%2Fgoverned-second-brain-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremylongshore%2Fgoverned-second-brain-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremylongshore%2Fgoverned-second-brain-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremylongshore%2Fgoverned-second-brain-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremylongshore","download_url":"https://codeload.github.com/jeremylongshore/governed-second-brain-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremylongshore%2Fgoverned-second-brain-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34896652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audit-trail","citations","claude-code","cowork","governance","governed-second-brain","knowledge-management","local-first","mcp","plugin","qmd","rag","second-brain"],"created_at":"2026-06-28T16:30:53.899Z","updated_at":"2026-06-28T16:30:54.633Z","avatar_url":"https://github.com/jeremylongshore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGoverned Second Brain — the plugin\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  A local-first Claude Code + Cowork plugin: turn \u003cem\u003eyour own\u003c/em\u003e files into a governed,\n  \u003ccode\u003eqmd://\u003c/code\u003e-cited second brain with a tamper-evident, SHA-256 hash-chained audit trail.\u003cbr\u003e\n  \u003cstrong\u003eCompile, then govern.\u003c/strong\u003e One plugin, two modes: \u003cstrong\u003elocal\u003c/strong\u003e (default — in-process, no daemon, no network, no API key for retrieval) or \u003cstrong\u003eteam\u003c/strong\u003e (proxy to a shared governed brain over your network).\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-Apache--2.0-10b981?style=flat-square\" alt=\"License: Apache-2.0\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/local--first-in--process-0ea5e9?style=flat-square\" alt=\"local-first\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/MCP-stdio-8b5cf6?style=flat-square\" alt=\"MCP stdio\"\u003e\n\u003c/p\u003e\n\n---\n\n## 📍 This product lives in two homes\n\n| | Repo | What it is |\n|---|---|---|\n| **Landing / thesis** | **[intent-solutions-io/governed-second-brain](https://github.com/intent-solutions-io/governed-second-brain)** | The umbrella — *why* this exists, the competitive teardown, the \"Compile, Then Govern\" thesis, the receipts argument. Start here for the **story**. |\n| **The plugin** (you are here) | **[jeremylongshore/governed-second-brain-plugin](https://github.com/jeremylongshore/governed-second-brain-plugin)** | The installable code — the local stdio MCP server + skills. Start here to **run it**. |\n\nIt stacks on three engines:\n\n| Engine | Repo | Layer |\n|---|---|---|\n| **ICO** | [jeremylongshore/intentional-cognition-os](https://github.com/jeremylongshore/intentional-cognition-os) | **Compile** — derive knowledge from a corpus (optional; the only part that egresses) |\n| **INTKB** | [jeremylongshore/qmd-team-intent-kb](https://github.com/jeremylongshore/qmd-team-intent-kb) | **Govern** — deterministic dedupe → policy → promote + the hash-chained audit |\n| **qmd** | [tobi/qmd](https://github.com/tobi/qmd) | **Retrieve** — on-device search; every hit is a `qmd://` citation |\n\nThis plugin **bundles** the compiled INTKB packages, so it runs the govern + retrieve loop fully\nin-process — the engines stay independent repos; nothing here forks or privatizes them.\n\n## What it does\n\nMost \"AI memory\" gives an agent better *recall*. This does two things the category skips: it\n**governs** what's allowed to become durable memory (deterministic dedupe / policy / promotion — by\ncode, not a model), and it ships a **receipt** — a `qmd://` citation plus a SHA-256 hash-chained audit\nevent — for every write. Runs on your machine; your files never leave it (retrieval is local; the\noptional ICO *compile* step is the only thing that egresses, and it's opt-in).\n\n### Tool surface\n\n| Tool | Kind | What it does |\n|---|---|---|\n| `brain_search` | read | Cited search over your governed memory (`qmd://` receipts), in-process |\n| `brain_status` | read | Counts by lifecycle state + category |\n| `brain_audit_verify` | read | Verify the audit trail — the SHA-256 hash chain **and** the external anchor log; flags any tamper |\n| `brain_capture` | write | Capture a fact as a governance **proposal** (to the local spool) |\n| `brain_govern` | write | Drain the spool → dedupe → policy → **promote**, with a hash-chained audit receipt — daemon-free |\n| `brain_transition` | write | Retire / re-lifecycle a memory (audited) |\n\nTwo skills front these: **`/brain`** (cited answers) and **`/brain-save`** (governed capture).\n\n## What the receipt does *not* do\n\nHonesty is the point of a receipt. The chain gives you **tamper-*detection*** — integrity + ordering,\nso an edited or reordered record is caught by `verify`. It is **not** tamper-proof: on your own machine\na writer with access can edit an event *and* re-hash the chain forward. Within a single trust boundary\n(your machine) that's exactly the integrity guarantee you want; cross-actor non-repudiation needs an\nexternal chain-head anchor (on the roadmap). It is **not** a blockchain and **not** immutable storage.\n\n## Install\n\nOne command, two modes:\n\n```bash\n# A) zero-egress (default for regulated/client data) — nothing leaves the machine\nnpx governed-second-brain init \u003cyour-folder\u003e --index-only\n\n# B) full compile — ICO derives knowledge (6 passes) before governing; opt-in egress to DeepSeek\nDEEPSEEK_API_KEY=… npx governed-second-brain init \u003cyour-folder\u003e\n```\n\nIt builds a governed, `qmd://`-cited, hash-chained-audited brain under `~/.teamkb`, installs the native\ndep per-platform, and **auto-registers the MCP server with Claude Code** (`claude mcp add`; `--no-register`\nto skip). Full mode runs a loud pre-flight consent (your file text goes to DeepSeek; `--yes` to skip the\nprompt). Requires Node 20+, a C/C++ toolchain (for `better-sqlite3`), and `qmd` 2.x on PATH for retrieval.\n\nAfter it finishes, start a new Claude Code session — the `governed-brain` tools are live. For the\n`/brain` and `/brain-save` skills too, `claude plugin install governed-second-brain`.\n\n### Team mode — point it at a shared brain\n\nThe **same** plugin runs in **team mode** when `TEAMKB_API_URL` is set: instead of an in-process local\nbrain, it proxies to a shared governed-brain HTTP API (INTKB's `apps/api`) over your network — so a\nwhole team queries and contributes to **one** governed brain. Set two environment variables:\n\n- **`TEAMKB_API_URL`** — your team brain's API base (e.g. `http://\u003chost\u003e:3847`)\n- **`TEAMKB_API_TOKEN`** — your personal bearer token (issued by the brain's operator)\n\nYou need network reachability to that API — typically a private network / VPN such as **Tailscale**\n(the brain is meant to stay off the public internet). The dispatcher auto-detects mode from\n`TEAMKB_API_URL`: set → team, unset → local. Same `/brain` + `/brain-save` skills either way.\n\nIn team mode the tool surface is **`brain_search`** (read) + **`brain_capture`** (propose) +\n**`brain_transition`** (admin-only) — govern runs server-side, so there's no client `brain_govern`:\n**the model proposes, the server disposes**, and each promotion gets a hash-chained receipt. A member\ntoken can read + propose; admin actions (transition) return a clear 403 otherwise.\n\n\u003e Team mode is **dependency-free** — it uses only `fetch` + the MCP SDK, never the native store — so it\n\u003e runs straight from a marketplace clone with zero build.\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eBuild from source\u003c/strong\u003e (to hack on the runtime)\u003c/summary\u003e\n\n```bash\npnpm -C ../qmd-team-intent-kb build   # the bundle inlines INTKB's compiled packages (sibling checkout, built)\npnpm install \u0026\u0026 pnpm build            # esbuild → plugin-runtime/governed-brain.cjs\nnode bin/init.mjs init \u003cyour-folder\u003e --index-only\n```\n\u003c/details\u003e\n\n**Supply chain (shipped in 0.1.4):** npm **provenance** (via the CI release workflow) and the\n`gsb.lock.json` reproducible pin — the exact ICO × INTKB × qmd × plugin tuple, verified by a\nhermetic full-chain CI smoke against the pinned set.\n\n**Coming:** automatic Cowork MCP registration.\n\n## License\n\nApache-2.0. The umbrella and both engine repos are Apache-2.0; qmd (upstream) is MIT by its author,\n[@tobi](https://github.com/tobi).\n\n---\n\n\u003cp align=\"center\"\u003e\n  Built by \u003ca href=\"https://github.com/jeremylongshore\"\u003eJeremy Longshore\u003c/a\u003e ·\n  \u003ca href=\"https://intentsolutions.io/\"\u003eIntent Solutions\u003c/a\u003e ·\n  thesis at \u003ca href=\"https://github.com/intent-solutions-io/governed-second-brain\"\u003eintent-solutions-io/governed-second-brain\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremylongshore%2Fgoverned-second-brain-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremylongshore%2Fgoverned-second-brain-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremylongshore%2Fgoverned-second-brain-plugin/lists"}