Skip to content

v3.18.0: Brain Conventions, Dream Pass and Context Bill

Latest

Choose a tag to compare

@huytieu huytieu released this 03 Dec 12:53

Six new skills, filing rules and note conventions for the vault, maintenance tooling with hermetic tests, and an opt-in safety hook pack. This release answers issues #38, #41, #42, #48, and #52.

Added

Filing rules and note conventions

  • RESOLVER.md is the single filing-rules file. It holds the decision tree for the numbered folders, the tie-breakers, the notability gate for person and organization pages, and the exit rule for 00-inbox/. CLAUDE.md and AGENTS.md point to it.
  • docs/brain-conventions.md defines the two-zone page layout, back-links, source citations with precedence, exact-match identity, resolve-before-asking, dated relationships, typed relations: frontmatter, a trust rule for fetched text, protection of confirmed lines, and a staleness stamp.
  • BRAIN-HEALTHCHECK.md lists six metrics with healthy, review, and act-now thresholds. BRAIN-MAINTENANCE.md is the weekly and monthly runbook.

Six skills

  • /dream runs the vault upkeep in a fixed order and writes one morning note where each change has a stable id you can keep or undo. The first run only proposes changes.
  • /context-audit is a report-only audit of the always-loaded files. It ranks findings by tokens saved and edits nothing.
  • /skillify turns a workflow you did by hand into a tested skill, and guards edits to an existing skill with a before and after score. A skill stays only if it beats a bare prompt or ties at lower cost.
  • /digest pre-packs a long Markdown file, writes one note per section plus a parent note, and keeps every quote checkable against the raw file (#41). Conversion from PDF or DOCX stays outside COG.
  • /best-of-n is a selector that runs before a verification gate. It uses a pivot tournament of pairwise judgements, with every candidate in both slots and a weighted spread of grades.
  • /lizard folds ideas from a repo, article, or skill into your setup. It tags each idea ADOPT, ADAPT, DECIDE, EXISTS, or REJECT against what COG already does, treats fetched text as data, and records rejections so a later run does not repeat them.

Scripts, all standard library, each with --help and a hermetic test

  • scripts/brain-lint.py runs deterministic checks: back-links, orphans, inbox age, verbatim quotes, relations: targets, and stale notes. No model call.
  • scripts/context-bill.py estimates tokens for the always-loaded layer and each skill. docs/context-bill.md is generated from it, and scripts/context-budget.txt holds the budget that CI and the validator enforce.
  • scripts/check-skill-refs.py lists paths, slash commands, and subagent names that skills mention but that do not exist. scripts/skill-refs-allowlist.txt names the files that skills create at runtime.
  • .claude/skills/best-of-n/scripts/tournament.py and .claude/skills/digest/scripts/chunk_markdown.py do the arithmetic and the splitting for their skills.

Opt-in safety hooks

.claude/hooks/safety-gate.py denies or asks before destructive shell commands. .claude/hooks/secrets-guard.py blocks credential-shaped text in files git tracks and in network commands. scripts/install-hooks.sh previews, installs, checks, and removes the entries, and backs up your settings first. The updater ships the files and never edits your settings. See docs/hooks.md.

Skill quality policy

docs/skill-quality.md sets the rule that a skill earns its place: a goal, a done-means list, a triggers-eval.md file, and a comparison with a bare prompt. All six new skills ship a triggers-eval.md marked "not yet run". None has an eval-log.md or a recorded bare-prompt comparison yet, so they stay on probation until the first comparison runs.

Changed

  • 00-inbox/ has one definition everywhere. It holds permanent config files and unsorted captures, and a capture should leave within 7 days. The healthcheck flags older ones, and a capture you decline to move stays. /braindump and /url-dump end with an inbox filing step, /url-dump marks inbox notes status: "captured", and /knowledge-consolidation reads captured URL notes and offers to file consolidated ones. Nothing moves without a yes (#48).
  • /knowledge-consolidation reads the optional relations: frontmatter and reports dangling targets, open contradictions, and superseded notes outside the archive. It reports and never rewrites. The consolidation and people templates carry the field (#42). The issue asked for extension, aggregation, subset, contradiction, and deprecation. The vocabulary has four types, depends_on, supports, contradicts, and supersedes. Extension and subset map to depends_on, aggregation is a list of body links, and deprecation is supersedes. A type stays only when a check reads it. docs/brain-conventions.md gives the mapping. A supersedes target that moved to 00-inbox/archive/ counts as present.
  • /auto-research and worker-researcher read the web search provider from 00-inbox/MY-INTEGRATIONS.md. The built-in WebSearch and WebFetch tools are the default and no provider is named. A query carries only your research question, the first use of an external provider needs your yes, and every finding keeps its source URL and an excerpt (#52). Phase 2 threads now run as worker-researcher agents that write to a file and return the path, which matches the worker table in AGENTS.md.
  • team-brief routes its collectors to worker-data-collector and worker-file-ops. That landed in 3.17.0. This release adds PostHog to the worker-data-collector capability list, which the PostHog collector needs (#38).
  • ultragoal gains a reference bar in the charter and gauntlet rounds for bar-gated phases. A fresh-context critic compares the real artifact with the bar and names the largest gap each round. The loop ends on bar parity or when you call the phase ready. closed-loop points to /best-of-n for selection before the gate.
  • scripts/validate-agent-surface.sh also checks that every skill declares roles and integrations, that no skill or command count in the docs disagrees with the skills on disk, and that FRAMEWORK_FILES lists every shipped file and no missing one. With COG_MAINTAINER=1, which CI sets, it also runs the fast script tests, the dangling-reference check, the context budget, and the freshness of docs/context-bill.md.
  • scripts/brain-lint.py defaults to 7 days for the inbox and 90 days for stale notes, matching RESOLVER.md. Back-link suggestions and /dream use the format in docs/brain-conventions.md: a bullet under a dated heading, newest first. /dream skips a mention that adds no fact. The people template carries the <!-- timeline --> marker.
  • scripts/brain-lint.py finds the vault from vault_path in cog.local.yaml when you pass no --vault, so /dream, /digest, and the runbooks lint the real vault when it lives outside the repository. It still reads . when no file or key exists. A vault_path that does not exist is an error. The quote check also tests > blockquote lines, which is where /digest writes its passages, and it skips digest raw.md copies in the orphan and stale checks.
  • /digest links the raw copy from the parent note and writes every wikilink as a full path, because section names repeat across digests. The weekly and monthly maintenance notes go to 01-daily/maintenance/, so they do not count as orphans or go stale.
  • python3 scripts/context-bill.py --check reads scripts/context-budget.txt when you pass no limits, as CLAUDE.md and /context-audit already said.
  • /lizard asks before it applies any change that adds a shell, network, send, hook, permission, or setting step, or edits a file that every session loads. It applies nothing unattended from a source that is not yours. /auto-research asks for authorization to use an external search provider before it launches workers, and worker-researcher uses the built-in tools unless the lead's prompt states that you authorized a provider.
  • /update-cog lists framework files by pointing to FRAMEWORK_FILES, runs the mirror rebuild and the validator after an update, and no longer claims that .gitignore excludes your content.
  • Counts say 49 skills everywhere. Em dashes are gone from README.md, CLAUDE.md, AGENTS.md, GEMINI.md, WORKFLOW.md, SETUP.md, CONTRIBUTING.md, docs/SKILL-DISTILLATION.md, and the update-cog skill, and the CLAUDE.md response style bans them.
  • README gains a "When COG Is the Wrong Tool" section. A vault that fits in one context window needs only grep and a bare prompt, and COG has no embedding search.

Fixed

  • scripts/brain-lint.py quotes --fix appended new claims with a 2-space indent even when the existing unverified_claims list was flush with its key, which left the frontmatter invalid. It now copies the indent of the first existing item. It also decodes the note strictly and skips a note that is not valid UTF-8, instead of writing replacement characters, and it writes through a symlink and keeps the file mode.
  • scripts/install-hooks.sh matches only the exact commands it writes. A hook of your own with the same file name is no longer counted as installed or removed by --uninstall, and a settings file with a wrong hooks shape exits with a clear message.
  • cog-update.sh aborted on a seed file whose path crosses a symlink, such as a linked 05-knowledge folder, after it had written the framework files and before the mirror rebuild and the validator. It now skips that seed file with a warning and finishes the run.
  • cog-update.sh left files it wrote with mode 0600 (or 0711 for scripts), because mktemp creates private files and a bare chmod +x keeps them private. It now sets 644 and 755, as a checkout would.
  • lane-classify.sh sent any task that contained "product" or "productivity" to the full lane, because prod matched as a prefix. It now matches prod and production as whole words.
  • Twenty-two skills had no roles or integrations frontmatter, which CONTRIBUTING.md requires. They have both now.
  • Dangling references: kit.toml (a file no checkout has) is gone from three skills, loop-ledger.tsv has a stated row format, harvest no longer points at a hook that does not ship, and the /copy alias is removed from lizard.
  • README.md no longer claims that cross-references update automatically or quotes results that have no source in the repository. The FAQ describes the update prompts as they work.
  • The README and AGENTS.md no longer call fix-agent and harvest-curator read-only.
  • .github/MARKETPLACE.md is no longer listed in .gitignore while it is tracked and shipped.
  • Two planning documents under .claude/ no longer name the author's private vault or any competitor.
  • task-verifier, ultragoal, and museum-art no longer name a private browser tool.

Credits

From garrytan/gbrain: the single filing-rules file, the notability gate, back-links, source precedence, exact-match identity, dated relationships, the trust rule for fetched text, protection of confirmed lines, the nightly maintenance cycle behind /dream, mechanical checks beside model-written notes, the skillify meta-skill, routing evals, and a report-only context audit. gbrain keeps its pages in a database. COG keeps plain Markdown and adopts the conventions, not the engine.

From garrytan/gstack: the published per-skill context bill, the cut list and the earn-its-place rule, the two-tier ask and deny design of the safety gate, the redaction check before data leaves the machine, and the skill-reference drift test behind check-skill-refs.py.

From the maintainer's own vault: /lizard, /best-of-n (the pivot tournament follows the llm-as-a-verifier project), and the reference bar and gauntlet rounds in ultragoal (from the Gauntlet Loop).

From issues: #38 worker routing, #41 /digest, #42 relations: frontmatter, #48 the 00-inbox/ lifecycle, and #52 the search provider setting.

Upgrading from 3.17.0

Run ./cog-update.sh. The safety hooks are not installed for you. To turn them on, run scripts/install-hooks.sh for a preview, then scripts/install-hooks.sh --apply. The first /dream run only proposes changes.

Upgrading from 3.16.1 or earlier

Run ./cog-update.sh twice, and answer the prompts on the first run instead of using --force. The old script cannot restart itself and knows only its own file list, so the first run installs the new updater and the rewritten validator but not the six new skills, the scripts, the hooks, or the new root documents. The second run, with the new updater, installs them. The first run may end with one syntax-error or command not found line, because the old script replaced itself while running. The validator the old script runs may report parity or coverage findings that the first run cannot fix. The second run clears them.