Skip to content

Context system: records, lint, event triggers, staged routines, factories (0.4.0) - #7

Merged
moderniselife merged 1 commit into
mainfrom
feat/context-system
Nov 23, 2026
Merged

moderniselife merged 1 commit into
mainfrom
feat/context-system

Conversation

@moderniselife

Copy link
Copy Markdown
Owner

Why

This makes a brain work as the one governed context system that people and agents share. The shape follows Notion's essay A new shape for work, and it happens automatically: it's built into new brains, the tools, and the agent instructions.

What

  • Records. A small ontology: shared/{projects,people,teams,customers,meetings,documents}/, one file per thing, linked with [[type/id]].

    • record_save merges fields.
    • record_get returns the record, the title and status of everything it links to, and what links back.
  • Lint. Run it with brainium lint or brain_lint. Every new brain also gets a weekly brain-health routine (an upkeep job, so no approval is needed). It reports:

    • unsigned notes
    • missing record fields
    • broken links
    • stale records (live but untouched for 30 days, or past review_by)
    • misfiled records
    • factories without exactly one production prompt, or without evals

    The report goes to shared/health.md.

  • Routines.

    • on: globs run a routine when brain files change. Changes are debounced, and the changed paths are passed in.
    • stage: shadow|limited|full with limit.
    • New prompt and shell routines start in shadow.
  • Factories. Agent cards carry kind, team and maintainers. New prompts/ (testing, production or retired) and evals/ templates.

  • Signing. Every note names its agent, including notes in the agent's own folder.

  • Repo → brain. A repo's .brainium.json ({ "brain": "NAME" }) sends "auto" writes to that brain.

  • Fix. init-brain inside an existing repo uses that repo instead of running git init.

  • Docs and instructions. New docs/CONTEXT-SYSTEM.md. The skills, Cursor rule and MCP instructions now teach records, signing, lint and staged routines.

Testing

  • New cli/test/context.test.mjs (8 tests): records and links, lint (each check), .brainium.json, file triggers with debounce, stage prefaces, a triggered shell routine end to end, factory cards, and nested brains.
  • npm test: 51/51 pass.

🤖 Generated with Claude Code

…ries (0.4.0)

- Records: shared/{projects,people,teams,customers,meetings,documents}/,
  one file per thing linked with [[type/id]]; record_save merges fields,
  record_get follows links one hop and lists backlinks.
- Lint (brainium lint, brain_lint, weekly brain-health routine in every
  new brain): unsigned notes, missing record fields, broken links, stale
  records, misfiled records, factories without one production prompt or
  evals. Writes shared/health.md.
- Routines: on: globs run a routine when brain files change (debounced,
  changed paths passed in); stage: shadow|limited|full with limit; new
  prompt/shell routines start in shadow.
- Factories: agent cards carry kind/team/maintainers; prompts/ and evals/
  templates.
- Every note names its agent, also in the agent's own folder.
- .brainium.json lets a repo send auto writes to a named brain.
- A brain created inside another repo uses that repo instead of git init.
- docs/CONTEXT-SYSTEM.md; skills and MCP instructions teach the new tools.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@moderniselife
moderniselife merged commit d3ad711 into main Nov 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant