brain-framework 21.4.1__tar.gz → 23.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brain_framework-23.0.0/PKG-INFO +189 -0
- brain_framework-23.0.0/README.md +155 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/THIRD_PARTY_NOTICES.md +11 -11
- {brain_framework-21.4.1 → brain_framework-23.0.0}/pyproject.toml +19 -5
- {brain_framework-21.4.1 → brain_framework-23.0.0}/pyproject.toml.orig +20 -7
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/__init__.py +10 -1
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/assistants.py +295 -80
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/cli.py +411 -157
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/collect.py +208 -65
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/config.py +145 -147
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/evaluate.py +6 -11
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/graph.py +69 -89
- brain_framework-23.0.0/src/bf/guide.py +75 -0
- brain_framework-23.0.0/src/bf/guides/authoring.md +58 -0
- brain_framework-23.0.0/src/bf/guides/events.md +60 -0
- brain_framework-23.0.0/src/bf/guides/getting-started.md +73 -0
- brain_framework-23.0.0/src/bf/guides/index.md +37 -0
- brain_framework-23.0.0/src/bf/guides/jobs.md +61 -0
- brain_framework-23.0.0/src/bf/guides/operations.md +64 -0
- brain_framework-23.0.0/src/bf/guides/reference.md +68 -0
- brain_framework-23.0.0/src/bf/guides/retrieval.md +60 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/health.py +128 -119
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/history.py +21 -11
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/index.py +64 -63
- brain_framework-23.0.0/src/bf/install.py +314 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/links.py +38 -30
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/markdown.py +8 -2
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/mcp.py +14 -15
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/models.py +402 -258
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/ontology.py +49 -127
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/pages.py +474 -520
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/replies.py +142 -158
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/retrieve.py +178 -329
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/runtime.py +408 -65
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/schemas.py +11 -7
- brain_framework-23.0.0/src/bf/skills/bf/SKILL.md +35 -0
- brain_framework-23.0.0/src/bf/starter/AGENTS.md +21 -0
- brain_framework-23.0.0/src/bf/starter/gitignore +7 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/storage.py +50 -153
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/update.py +78 -19
- brain_framework-23.0.0/src/bf/usage.py +326 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/validate.py +103 -20
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/watch.py +30 -9
- brain_framework-21.4.1/PKG-INFO +0 -310
- brain_framework-21.4.1/README.md +0 -276
- brain_framework-21.4.1/src/bf/install.py +0 -136
- brain_framework-21.4.1/src/bf/skills/README.md +0 -59
- brain_framework-21.4.1/src/bf/skills/bf-action/SKILL.md +0 -53
- brain_framework-21.4.1/src/bf/skills/bf-action/references/actions.md +0 -27
- brain_framework-21.4.1/src/bf/skills/bf-action/references/context.md +0 -21
- brain_framework-21.4.1/src/bf/skills/bf-action/references/handoff.md +0 -42
- brain_framework-21.4.1/src/bf/skills/bf-action/scripts/check-handoff.py +0 -129
- brain_framework-21.4.1/src/bf/skills/bf-action/scripts/new-action.py +0 -148
- brain_framework-21.4.1/src/bf/skills/bf-action/templates/action.md +0 -37
- brain_framework-21.4.1/src/bf/skills/bf-maintain/SKILL.md +0 -58
- brain_framework-21.4.1/src/bf/skills/bf-maintain/references/conflicts.md +0 -14
- brain_framework-21.4.1/src/bf/skills/bf-maintain/references/integrations.md +0 -92
- brain_framework-21.4.1/src/bf/skills/bf-maintain/references/operations.md +0 -67
- brain_framework-21.4.1/src/bf/skills/bf-setup/SKILL.md +0 -64
- brain_framework-21.4.1/src/bf/skills/bf-setup/references/discovery.md +0 -32
- brain_framework-21.4.1/src/bf/skills/bf-setup/references/import.md +0 -36
- brain_framework-21.4.1/src/bf/skills/bf-setup/references/scan.md +0 -27
- brain_framework-21.4.1/src/bf/skills/bf-setup/scripts/inventory.py +0 -182
- brain_framework-21.4.1/src/bf/skills/bf-use/SKILL.md +0 -74
- brain_framework-21.4.1/src/bf/skills/bf-use/references/consolidate.md +0 -9
- brain_framework-21.4.1/src/bf/skills/bf-use/references/decisions.md +0 -31
- brain_framework-21.4.1/src/bf/skills/bf-use/references/evidence.md +0 -50
- brain_framework-21.4.1/src/bf/skills/bf-use/references/learn.md +0 -39
- brain_framework-21.4.1/src/bf/skills/bf-use/references/links.md +0 -59
- brain_framework-21.4.1/src/bf/skills/bf-use/references/retrieval.md +0 -39
- brain_framework-21.4.1/src/bf/skills/bf-use/references/review.md +0 -10
- brain_framework-21.4.1/src/bf/skills/bf-use/references/share.md +0 -12
- brain_framework-21.4.1/src/bf/skills/bf-use/scripts/evidence.py +0 -343
- brain_framework-21.4.1/src/bf/skills/bf-use/scripts/guarded-write.py +0 -359
- brain_framework-21.4.1/src/bf/skills/bf-use/templates/concept.md +0 -16
- brain_framework-21.4.1/src/bf/skills/bf-use/templates/project.md +0 -29
- brain_framework-21.4.1/src/bf/starter/AGENTS.md +0 -23
- brain_framework-21.4.1/src/bf/starter/gitignore +0 -8
- brain_framework-21.4.1/src/bf/usage.py +0 -346
- {brain_framework-21.4.1 → brain_framework-23.0.0}/LICENSE +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/__main__.py +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/channels.py +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/messages.py +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/py.typed +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/records.py +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/starter/concepts/index.md +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/starter/concepts/welcome.md +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/starter/evals/retrieval.yaml +0 -0
- {brain_framework-21.4.1 → brain_framework-23.0.0}/src/bf/watch_settings.py +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: brain-framework
|
|
3
|
+
Version: 23.0.0
|
|
4
|
+
Summary: Brain Framework is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an ontology you declare, lets any agent harness search and read offline, and wakes your harness when declarative when: rules or reviewed gates spot new evidence.
|
|
5
|
+
Keywords: ai,ai-agents,agent-memory,agent-skills,agents-md,context-engineering,knowledge-graph,knowledge-management,local-first,mcp,model-context-protocol,ontology,personal-knowledge-management,python,second-brain
|
|
6
|
+
Author: Médéric Hurier
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: Topic :: Text Processing :: Indexing
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Dist: markdown-it-py>=4.2.0,<5
|
|
21
|
+
Requires-Dist: pydantic>=2.13.5,<3
|
|
22
|
+
Requires-Dist: pyyaml>=6.0.3,<7
|
|
23
|
+
Requires-Dist: rich>=15.0.0,<16
|
|
24
|
+
Requires-Dist: typer>=0.27.2
|
|
25
|
+
Requires-Dist: mcp>=2.1.1,<3 ; extra == 'mcp'
|
|
26
|
+
Requires-Python: >=3.14
|
|
27
|
+
Project-URL: Changelog, https://fmind.github.io/brain-framework/changelog/
|
|
28
|
+
Project-URL: Documentation, https://fmind.github.io/brain-framework/
|
|
29
|
+
Project-URL: Issues, https://github.com/fmind/brain-framework/issues
|
|
30
|
+
Project-URL: Repository, https://github.com/fmind/brain-framework
|
|
31
|
+
Project-URL: Security, https://github.com/fmind/brain-framework/security/policy
|
|
32
|
+
Provides-Extra: mcp
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img
|
|
37
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
|
|
38
|
+
alt="Brain Framework: a robot head whose shell opens on a brain, above twin aperture eyes"
|
|
39
|
+
width="256"
|
|
40
|
+
height="256"
|
|
41
|
+
>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
# Brain Framework 🧠
|
|
45
|
+
|
|
46
|
+
**🧠 Brain Framework: from information to informed actions.**
|
|
47
|
+
|
|
48
|
+
Brain Framework (BF) is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an explicit ontology, lets any agent harness search and read offline, and wakes your harness when declarative `when:` rules or reviewed gates spot new evidence.
|
|
49
|
+
|
|
50
|
+
- **Plain files you own, open to any agent.** Markdown notes (`projects/`, `concepts/`, `actions/`) and JSON records (`memories/`), reached through the `bf` CLI, [MCP](https://fmind.github.io/brain-framework/docs/mcp/), [Agent Skills](https://agentskills.io/specification) and `AGENTS.md`.
|
|
51
|
+
- **Explicit graph and provenance.** `bf.yaml` maps provider fields into shared relations once at collection. Every claim keeps its source record, and `newer_evidence` flags notes when upstream evidence changes.
|
|
52
|
+
- **Controlled autonomy.** Built-in `when:` gates (`sources`, `review`, `actions`, `attention`) wake your harness offline with zero wasted model runs, and `propose: true` lets read-only assistants draft validated `ACTION.md` proposals.
|
|
53
|
+
|
|
54
|
+
[](https://github.com/fmind/brain-framework/actions/workflows/ci.yml) [](https://pypi.org/project/brain-framework/) [](https://pypi.org/project/brain-framework/) [](https://github.com/fmind/brain-framework/blob/main/LICENSE)
|
|
55
|
+
|
|
56
|
+
[Try it](https://github.com/fmind/brain-framework#try-it) · [How it works](https://github.com/fmind/brain-framework#how-it-works) · [Agents](https://github.com/fmind/brain-framework#open-your-agent-in-your-brain) · [Your tools](https://github.com/fmind/brain-framework#bring-your-tools) · [Proactive agents](https://github.com/fmind/brain-framework#let-your-agent-come-to-you) · [Boundaries](https://github.com/fmind/brain-framework#good-to-know) · [Documentation](https://fmind.github.io/brain-framework/)
|
|
57
|
+
|
|
58
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
|
|
59
|
+
<img
|
|
60
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
|
|
61
|
+
alt="The Brain Framework loop: sensors gather evidence into a brain folder; bf.yaml declares the ontology, sensors, routines, assistants, channels and watch settings; memories, projects, concepts and actions form a knowledge graph; agents read context, act and compile outcomes back."
|
|
62
|
+
width="960"
|
|
63
|
+
>
|
|
64
|
+
</a>
|
|
65
|
+
|
|
66
|
+
## Try it
|
|
67
|
+
|
|
68
|
+
Requires Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/) — no model or cloud account needed:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv tool install --python 3.14 brain-framework
|
|
72
|
+
bf init ~/brain && cd ~/brain
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Save `projects/new-website.md`:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
---
|
|
79
|
+
type: project
|
|
80
|
+
status: draft
|
|
81
|
+
updated: 2026-11-01
|
|
82
|
+
summary: Launch a product website that helps visitors understand the product.
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
# New website
|
|
86
|
+
|
|
87
|
+
## Decision
|
|
88
|
+
|
|
89
|
+
Start with a single product page because visitors need a clear explanation before signing up.
|
|
90
|
+
|
|
91
|
+
## Next actions
|
|
92
|
+
|
|
93
|
+
- [ ] Draft the product page.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Search and read the exact section:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bf search "visitors clear explanation"
|
|
100
|
+
bf read projects/new-website.md#decision
|
|
101
|
+
bf validate && bf eval
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Continue with [Getting started](https://fmind.github.io/brain-framework/docs/getting-started/) or the [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/) across Workspace, Jira, GitHub and Google Cloud fixtures.
|
|
105
|
+
|
|
106
|
+
## How it works
|
|
107
|
+
|
|
108
|
+
Five steps run in one loop: **gather → normalize → organize and connect → act → learn.**
|
|
109
|
+
|
|
110
|
+
| Folder | Role |
|
|
111
|
+
| ----------- | ------------------------------------------------------------------------------------------------------- |
|
|
112
|
+
| `memories/` | Collected JSON records keyed by SHA-256 of `id`, with provenance, `@type`, `relations` and `attributes` |
|
|
113
|
+
| `projects/` | Project state (`Now`), decisions (`Decision`) and open tasks (`Next actions`) |
|
|
114
|
+
| `concepts/` | Durable reusable patterns and reference syntheses |
|
|
115
|
+
| `actions/` | Tracked work sessions (`draft` open, `stable` settled, `deprecated` retired) |
|
|
116
|
+
| `sensors/` | Stdlib scripts (built on `_sensor.py`) printing JSON or JSONL from your tools |
|
|
117
|
+
| `routines/` | Deterministic scripts (built on `_bf.py`) run on intervals, `at` or Git hooks |
|
|
118
|
+
|
|
119
|
+
`bf.yaml` declares shared [fields and mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings), [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [assistants](https://fmind.github.io/brain-framework/docs/prompts/). A disposable SQLite cache in `.bf/` powers offline BM25 search, graph backlinks (`bf read project:new-website`), triage (`bf read review`) and JSONL exports (`bf export --kind items`). See the [directory reference](https://fmind.github.io/brain-framework/docs/brain/#directory-reference).
|
|
120
|
+
|
|
121
|
+
## Open your agent in your brain
|
|
122
|
+
|
|
123
|
+
Install the packaged `/bf` skill for [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://openai.com/codex/), [GitHub Copilot](https://github.com/features/copilot) or any [Agent Skills](https://agentskills.io/specification) host:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bf skill install --global # ~/.agents/skills/bf (and links ~/.claude/skills/bf if present)
|
|
127
|
+
bf skill install # inside a brain: skills/bf, linked to .agents/skills/bf and .claude/skills/bf
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The `/bf` router connects your harness to built-in offline documentation via `bf guide`:
|
|
131
|
+
|
|
132
|
+
- **`bf guide retrieval`**: orient with `bf read review`, verify and cite `SOURCE:ID` refs and export graph claims.
|
|
133
|
+
- **`bf guide authoring`**: update owning `projects/` and `concepts/`, manage tracked `actions/` (`bf action new`, `bf action status`) and connect entities.
|
|
134
|
+
- **`bf guide getting-started` / `bf guide operations`**: initialize or register brains, run [MCP](https://fmind.github.io/brain-framework/docs/mcp/), validate, evaluate and troubleshoot.
|
|
135
|
+
- **`bf guide jobs` / `bf guide events`**: configure sensors, routines, assistants and `bf watch`, recover queues and use Git hooks.
|
|
136
|
+
|
|
137
|
+
See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and optional repository [hooks](https://github.com/fmind/brain-framework/tree/main/examples/hooks).
|
|
138
|
+
|
|
139
|
+
## Bring your tools
|
|
140
|
+
|
|
141
|
+
Copy a reviewed stdlib sensor into `sensors/` alongside [`_sensor.py`](https://github.com/fmind/brain-framework/blob/main/examples/sensors/_sensor.py): [local documents](https://github.com/fmind/brain-framework/blob/main/examples/sensors/local-documents.py), [highlights](https://github.com/fmind/brain-framework/blob/main/examples/sensors/highlights.py), [Git history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/git-history.py), [GitHub history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/github-history.md), [Google Calendar](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-calendar.py), [Gmail headers](https://github.com/fmind/brain-framework/blob/main/examples/sensors/gmail-headers.py), [Drive folders](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-drive-folders.py), or [any source you can script](https://fmind.github.io/brain-framework/docs/sensors/#any-source-you-can-script). Keep them fresh in a terminal or [background service](https://fmind.github.io/brain-framework/docs/schedule/) with `bf watch` ([offline demo](https://github.com/fmind/brain-framework/tree/main/examples/watch)):
|
|
142
|
+
|
|
143
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
|
|
144
|
+
<img
|
|
145
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg"
|
|
146
|
+
alt="Watch dashboard for the fictional offline demo: five sensors sorted by state, with a failed sensor's details beside their last success, next due time, item count and record changes."
|
|
147
|
+
width="960"
|
|
148
|
+
>
|
|
149
|
+
</a>
|
|
150
|
+
|
|
151
|
+
## Let your agent come to you
|
|
152
|
+
|
|
153
|
+
An [assistant](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when `when:` matches:
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
assistants:
|
|
157
|
+
triage:
|
|
158
|
+
prompt: prompts/triage.md
|
|
159
|
+
command:
|
|
160
|
+
[
|
|
161
|
+
claude,
|
|
162
|
+
--print,
|
|
163
|
+
--output-format,
|
|
164
|
+
json,
|
|
165
|
+
--json-schema,
|
|
166
|
+
"{{schema}}",
|
|
167
|
+
--tools,
|
|
168
|
+
"Read,Grep,Glob,Bash",
|
|
169
|
+
--allowedTools,
|
|
170
|
+
"Bash(bf read *),Bash(bf search *)",
|
|
171
|
+
--permission-mode,
|
|
172
|
+
dontAsk,
|
|
173
|
+
]
|
|
174
|
+
reply: { path: /structured_output }
|
|
175
|
+
propose: true
|
|
176
|
+
post: desktop
|
|
177
|
+
schedules:
|
|
178
|
+
mail: { every: 600, when: { sources: [mail] } }
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`when:` checks SQLite with zero subprocesses, passes new events to your harness, posts replies to your [channel](https://fmind.github.io/brain-framework/docs/channels/) and saves validated `draft` `ACTION.md` proposals when `propose: true`. See [safe prompts](https://fmind.github.io/brain-framework/docs/prompts/#keep-prompts-safe) and [propose, then act](https://fmind.github.io/brain-framework/docs/prompts/#propose-then-act).
|
|
182
|
+
|
|
183
|
+
## Good to know
|
|
184
|
+
|
|
185
|
+
1. **Local-first and private.** No BF server, account or telemetry; retrieval is 100% offline ([privacy and security](https://fmind.github.io/brain-framework/docs/privacy/)).
|
|
186
|
+
1. **Harnesses reason; BF verifies.** BF runs no LLM and ships no provider SDKs or embeddings (`bf export --kind items` feeds external retrievers; [what BF does not do](https://fmind.github.io/brain-framework/docs/concepts/#what-bf-does-not-do)).
|
|
187
|
+
1. **Git-native collaboration.** Version notes, ontology, programs and evals in Git while keeping local memories and `.bf/` caches out of shared history; major releases batch breaking changes cleanly ([versioning](https://fmind.github.io/brain-framework/docs/upgrades/#versioning-and-stability)).
|
|
188
|
+
|
|
189
|
+
[Commands](https://fmind.github.io/brain-framework/docs/commands/) · [Issues](https://github.com/fmind/brain-framework/issues) · [Contribute](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) · [Governance](https://github.com/fmind/brain-framework/blob/main/GOVERNANCE.md) · [MIT License](https://github.com/fmind/brain-framework/blob/main/LICENSE) · [Third-party notices](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md)
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img
|
|
3
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
|
|
4
|
+
alt="Brain Framework: a robot head whose shell opens on a brain, above twin aperture eyes"
|
|
5
|
+
width="256"
|
|
6
|
+
height="256"
|
|
7
|
+
>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
# Brain Framework 🧠
|
|
11
|
+
|
|
12
|
+
**🧠 Brain Framework: from information to informed actions.**
|
|
13
|
+
|
|
14
|
+
Brain Framework (BF) is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an explicit ontology, lets any agent harness search and read offline, and wakes your harness when declarative `when:` rules or reviewed gates spot new evidence.
|
|
15
|
+
|
|
16
|
+
- **Plain files you own, open to any agent.** Markdown notes (`projects/`, `concepts/`, `actions/`) and JSON records (`memories/`), reached through the `bf` CLI, [MCP](https://fmind.github.io/brain-framework/docs/mcp/), [Agent Skills](https://agentskills.io/specification) and `AGENTS.md`.
|
|
17
|
+
- **Explicit graph and provenance.** `bf.yaml` maps provider fields into shared relations once at collection. Every claim keeps its source record, and `newer_evidence` flags notes when upstream evidence changes.
|
|
18
|
+
- **Controlled autonomy.** Built-in `when:` gates (`sources`, `review`, `actions`, `attention`) wake your harness offline with zero wasted model runs, and `propose: true` lets read-only assistants draft validated `ACTION.md` proposals.
|
|
19
|
+
|
|
20
|
+
[](https://github.com/fmind/brain-framework/actions/workflows/ci.yml) [](https://pypi.org/project/brain-framework/) [](https://pypi.org/project/brain-framework/) [](https://github.com/fmind/brain-framework/blob/main/LICENSE)
|
|
21
|
+
|
|
22
|
+
[Try it](https://github.com/fmind/brain-framework#try-it) · [How it works](https://github.com/fmind/brain-framework#how-it-works) · [Agents](https://github.com/fmind/brain-framework#open-your-agent-in-your-brain) · [Your tools](https://github.com/fmind/brain-framework#bring-your-tools) · [Proactive agents](https://github.com/fmind/brain-framework#let-your-agent-come-to-you) · [Boundaries](https://github.com/fmind/brain-framework#good-to-know) · [Documentation](https://fmind.github.io/brain-framework/)
|
|
23
|
+
|
|
24
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
|
|
25
|
+
<img
|
|
26
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
|
|
27
|
+
alt="The Brain Framework loop: sensors gather evidence into a brain folder; bf.yaml declares the ontology, sensors, routines, assistants, channels and watch settings; memories, projects, concepts and actions form a knowledge graph; agents read context, act and compile outcomes back."
|
|
28
|
+
width="960"
|
|
29
|
+
>
|
|
30
|
+
</a>
|
|
31
|
+
|
|
32
|
+
## Try it
|
|
33
|
+
|
|
34
|
+
Requires Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/) — no model or cloud account needed:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uv tool install --python 3.14 brain-framework
|
|
38
|
+
bf init ~/brain && cd ~/brain
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Save `projects/new-website.md`:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
---
|
|
45
|
+
type: project
|
|
46
|
+
status: draft
|
|
47
|
+
updated: 2026-11-01
|
|
48
|
+
summary: Launch a product website that helps visitors understand the product.
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
# New website
|
|
52
|
+
|
|
53
|
+
## Decision
|
|
54
|
+
|
|
55
|
+
Start with a single product page because visitors need a clear explanation before signing up.
|
|
56
|
+
|
|
57
|
+
## Next actions
|
|
58
|
+
|
|
59
|
+
- [ ] Draft the product page.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Search and read the exact section:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bf search "visitors clear explanation"
|
|
66
|
+
bf read projects/new-website.md#decision
|
|
67
|
+
bf validate && bf eval
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Continue with [Getting started](https://fmind.github.io/brain-framework/docs/getting-started/) or the [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/) across Workspace, Jira, GitHub and Google Cloud fixtures.
|
|
71
|
+
|
|
72
|
+
## How it works
|
|
73
|
+
|
|
74
|
+
Five steps run in one loop: **gather → normalize → organize and connect → act → learn.**
|
|
75
|
+
|
|
76
|
+
| Folder | Role |
|
|
77
|
+
| ----------- | ------------------------------------------------------------------------------------------------------- |
|
|
78
|
+
| `memories/` | Collected JSON records keyed by SHA-256 of `id`, with provenance, `@type`, `relations` and `attributes` |
|
|
79
|
+
| `projects/` | Project state (`Now`), decisions (`Decision`) and open tasks (`Next actions`) |
|
|
80
|
+
| `concepts/` | Durable reusable patterns and reference syntheses |
|
|
81
|
+
| `actions/` | Tracked work sessions (`draft` open, `stable` settled, `deprecated` retired) |
|
|
82
|
+
| `sensors/` | Stdlib scripts (built on `_sensor.py`) printing JSON or JSONL from your tools |
|
|
83
|
+
| `routines/` | Deterministic scripts (built on `_bf.py`) run on intervals, `at` or Git hooks |
|
|
84
|
+
|
|
85
|
+
`bf.yaml` declares shared [fields and mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings), [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [assistants](https://fmind.github.io/brain-framework/docs/prompts/). A disposable SQLite cache in `.bf/` powers offline BM25 search, graph backlinks (`bf read project:new-website`), triage (`bf read review`) and JSONL exports (`bf export --kind items`). See the [directory reference](https://fmind.github.io/brain-framework/docs/brain/#directory-reference).
|
|
86
|
+
|
|
87
|
+
## Open your agent in your brain
|
|
88
|
+
|
|
89
|
+
Install the packaged `/bf` skill for [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://openai.com/codex/), [GitHub Copilot](https://github.com/features/copilot) or any [Agent Skills](https://agentskills.io/specification) host:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
bf skill install --global # ~/.agents/skills/bf (and links ~/.claude/skills/bf if present)
|
|
93
|
+
bf skill install # inside a brain: skills/bf, linked to .agents/skills/bf and .claude/skills/bf
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The `/bf` router connects your harness to built-in offline documentation via `bf guide`:
|
|
97
|
+
|
|
98
|
+
- **`bf guide retrieval`**: orient with `bf read review`, verify and cite `SOURCE:ID` refs and export graph claims.
|
|
99
|
+
- **`bf guide authoring`**: update owning `projects/` and `concepts/`, manage tracked `actions/` (`bf action new`, `bf action status`) and connect entities.
|
|
100
|
+
- **`bf guide getting-started` / `bf guide operations`**: initialize or register brains, run [MCP](https://fmind.github.io/brain-framework/docs/mcp/), validate, evaluate and troubleshoot.
|
|
101
|
+
- **`bf guide jobs` / `bf guide events`**: configure sensors, routines, assistants and `bf watch`, recover queues and use Git hooks.
|
|
102
|
+
|
|
103
|
+
See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and optional repository [hooks](https://github.com/fmind/brain-framework/tree/main/examples/hooks).
|
|
104
|
+
|
|
105
|
+
## Bring your tools
|
|
106
|
+
|
|
107
|
+
Copy a reviewed stdlib sensor into `sensors/` alongside [`_sensor.py`](https://github.com/fmind/brain-framework/blob/main/examples/sensors/_sensor.py): [local documents](https://github.com/fmind/brain-framework/blob/main/examples/sensors/local-documents.py), [highlights](https://github.com/fmind/brain-framework/blob/main/examples/sensors/highlights.py), [Git history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/git-history.py), [GitHub history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/github-history.md), [Google Calendar](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-calendar.py), [Gmail headers](https://github.com/fmind/brain-framework/blob/main/examples/sensors/gmail-headers.py), [Drive folders](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-drive-folders.py), or [any source you can script](https://fmind.github.io/brain-framework/docs/sensors/#any-source-you-can-script). Keep them fresh in a terminal or [background service](https://fmind.github.io/brain-framework/docs/schedule/) with `bf watch` ([offline demo](https://github.com/fmind/brain-framework/tree/main/examples/watch)):
|
|
108
|
+
|
|
109
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
|
|
110
|
+
<img
|
|
111
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg"
|
|
112
|
+
alt="Watch dashboard for the fictional offline demo: five sensors sorted by state, with a failed sensor's details beside their last success, next due time, item count and record changes."
|
|
113
|
+
width="960"
|
|
114
|
+
>
|
|
115
|
+
</a>
|
|
116
|
+
|
|
117
|
+
## Let your agent come to you
|
|
118
|
+
|
|
119
|
+
An [assistant](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when `when:` matches:
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
assistants:
|
|
123
|
+
triage:
|
|
124
|
+
prompt: prompts/triage.md
|
|
125
|
+
command:
|
|
126
|
+
[
|
|
127
|
+
claude,
|
|
128
|
+
--print,
|
|
129
|
+
--output-format,
|
|
130
|
+
json,
|
|
131
|
+
--json-schema,
|
|
132
|
+
"{{schema}}",
|
|
133
|
+
--tools,
|
|
134
|
+
"Read,Grep,Glob,Bash",
|
|
135
|
+
--allowedTools,
|
|
136
|
+
"Bash(bf read *),Bash(bf search *)",
|
|
137
|
+
--permission-mode,
|
|
138
|
+
dontAsk,
|
|
139
|
+
]
|
|
140
|
+
reply: { path: /structured_output }
|
|
141
|
+
propose: true
|
|
142
|
+
post: desktop
|
|
143
|
+
schedules:
|
|
144
|
+
mail: { every: 600, when: { sources: [mail] } }
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`when:` checks SQLite with zero subprocesses, passes new events to your harness, posts replies to your [channel](https://fmind.github.io/brain-framework/docs/channels/) and saves validated `draft` `ACTION.md` proposals when `propose: true`. See [safe prompts](https://fmind.github.io/brain-framework/docs/prompts/#keep-prompts-safe) and [propose, then act](https://fmind.github.io/brain-framework/docs/prompts/#propose-then-act).
|
|
148
|
+
|
|
149
|
+
## Good to know
|
|
150
|
+
|
|
151
|
+
1. **Local-first and private.** No BF server, account or telemetry; retrieval is 100% offline ([privacy and security](https://fmind.github.io/brain-framework/docs/privacy/)).
|
|
152
|
+
1. **Harnesses reason; BF verifies.** BF runs no LLM and ships no provider SDKs or embeddings (`bf export --kind items` feeds external retrievers; [what BF does not do](https://fmind.github.io/brain-framework/docs/concepts/#what-bf-does-not-do)).
|
|
153
|
+
1. **Git-native collaboration.** Version notes, ontology, programs and evals in Git while keeping local memories and `.bf/` caches out of shared history; major releases batch breaking changes cleanly ([versioning](https://fmind.github.io/brain-framework/docs/upgrades/#versioning-and-stability)).
|
|
154
|
+
|
|
155
|
+
[Commands](https://fmind.github.io/brain-framework/docs/commands/) · [Issues](https://github.com/fmind/brain-framework/issues) · [Contribute](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) · [Governance](https://github.com/fmind/brain-framework/blob/main/GOVERNANCE.md) · [MIT License](https://github.com/fmind/brain-framework/blob/main/LICENSE) · [Third-party notices](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md)
|
|
@@ -4,15 +4,15 @@ Brain Framework depends on the following non-development Python distributions on
|
|
|
4
4
|
|
|
5
5
|
License expressions come from the installed distribution metadata. Legal text is copied from the corresponding installed wheel files and formatted only as Markdown text blocks. The Brain Framework project itself is licensed separately in `LICENSE`.
|
|
6
6
|
|
|
7
|
-
## annotated-doc 0.0.
|
|
7
|
+
## annotated-doc 0.0.6
|
|
8
8
|
|
|
9
9
|
Source: <https://github.com/fastapi/annotated-doc>
|
|
10
10
|
|
|
11
11
|
License: `MIT`
|
|
12
12
|
|
|
13
|
-
Evidence: `annotated_doc-0.0.
|
|
13
|
+
Evidence: `annotated_doc-0.0.6.dist-info/licenses/LICENSE`
|
|
14
14
|
|
|
15
|
-
### annotated_doc-0.0.
|
|
15
|
+
### annotated_doc-0.0.6.dist-info/licenses/LICENSE
|
|
16
16
|
|
|
17
17
|
```text
|
|
18
18
|
The MIT License (MIT)
|
|
@@ -682,15 +682,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
682
682
|
THE SOFTWARE.
|
|
683
683
|
```
|
|
684
684
|
|
|
685
|
-
## markdown-it-py 4.
|
|
685
|
+
## markdown-it-py 4.3.0
|
|
686
686
|
|
|
687
687
|
Source: <https://github.com/executablebooks/markdown-it-py>
|
|
688
688
|
|
|
689
689
|
License: `MIT`
|
|
690
690
|
|
|
691
|
-
Evidence: `markdown_it_py-4.
|
|
691
|
+
Evidence: `markdown_it_py-4.3.0.dist-info/licenses/LICENSE`
|
|
692
692
|
|
|
693
|
-
### markdown_it_py-4.
|
|
693
|
+
### markdown_it_py-4.3.0.dist-info/licenses/LICENSE
|
|
694
694
|
|
|
695
695
|
```text
|
|
696
696
|
MIT License
|
|
@@ -716,9 +716,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
716
716
|
SOFTWARE.
|
|
717
717
|
```
|
|
718
718
|
|
|
719
|
-
Evidence: `markdown_it_py-4.
|
|
719
|
+
Evidence: `markdown_it_py-4.3.0.dist-info/licenses/LICENSE.markdown-it`
|
|
720
720
|
|
|
721
|
-
### markdown_it_py-4.
|
|
721
|
+
### markdown_it_py-4.3.0.dist-info/licenses/LICENSE.markdown-it
|
|
722
722
|
|
|
723
723
|
```text
|
|
724
724
|
Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
|
|
@@ -1749,7 +1749,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
1749
1749
|
THE SOFTWARE.
|
|
1750
1750
|
```
|
|
1751
1751
|
|
|
1752
|
-
## typer 0.
|
|
1752
|
+
## typer 0.29.0
|
|
1753
1753
|
|
|
1754
1754
|
Source: <https://github.com/fastapi/typer>
|
|
1755
1755
|
|
|
@@ -1757,9 +1757,9 @@ License: `MIT`
|
|
|
1757
1757
|
|
|
1758
1758
|
The distribution vendors code adapted from Click in `typer/_click/`; its bundled `BSD-3-Clause` license is included below.
|
|
1759
1759
|
|
|
1760
|
-
Evidence: `typer-0.
|
|
1760
|
+
Evidence: `typer-0.29.0.dist-info/licenses/LICENSE`
|
|
1761
1761
|
|
|
1762
|
-
### typer-0.
|
|
1762
|
+
### typer-0.29.0.dist-info/licenses/LICENSE
|
|
1763
1763
|
|
|
1764
1764
|
```text
|
|
1765
1765
|
The MIT License (MIT)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "brain-framework"
|
|
3
|
-
version = "
|
|
4
|
-
description = "Brain Framework is a local-first brain for you and your AI agents. It
|
|
3
|
+
version = "23.0.0"
|
|
4
|
+
description = "Brain Framework is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an ontology you declare, lets any agent harness search and read offline, and wakes your harness when declarative when: rules or reviewed gates spot new evidence."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.14"
|
|
7
7
|
license = "MIT"
|
|
@@ -43,7 +43,7 @@ dependencies = [
|
|
|
43
43
|
"pydantic>=2.13.5,<3",
|
|
44
44
|
"pyyaml>=6.0.3,<7",
|
|
45
45
|
"rich>=15.0.0,<16",
|
|
46
|
-
"typer>=0.27.2
|
|
46
|
+
"typer>=0.27.2",
|
|
47
47
|
]
|
|
48
48
|
|
|
49
49
|
[[project.authors]]
|
|
@@ -78,7 +78,6 @@ src = [
|
|
|
78
78
|
extend-exclude = ["*.md"]
|
|
79
79
|
|
|
80
80
|
[tool.ruff.per-file-target-version]
|
|
81
|
-
"src/bf/skills/*/scripts/*.py" = "py311"
|
|
82
81
|
"examples/**/*.py" = "py311"
|
|
83
82
|
|
|
84
83
|
[tool.ruff.format]
|
|
@@ -131,12 +130,26 @@ ignore = [
|
|
|
131
130
|
]
|
|
132
131
|
|
|
133
132
|
[tool.ruff.lint.per-file-ignores]
|
|
134
|
-
"examples
|
|
133
|
+
"examples/**/_bf.py" = [
|
|
134
|
+
"A002",
|
|
135
|
+
"S603",
|
|
136
|
+
"S607",
|
|
137
|
+
]
|
|
138
|
+
"examples/channels/**" = ["S603"]
|
|
139
|
+
"examples/hooks/**" = [
|
|
140
|
+
"BLE001",
|
|
141
|
+
"S607",
|
|
142
|
+
]
|
|
135
143
|
"examples/sensors/**" = [
|
|
136
144
|
"S603",
|
|
137
145
|
"S607",
|
|
138
146
|
"T201",
|
|
139
147
|
]
|
|
148
|
+
"examples/sensors/_sensor.py" = [
|
|
149
|
+
"A002",
|
|
150
|
+
"BLE001",
|
|
151
|
+
"S310",
|
|
152
|
+
]
|
|
140
153
|
"tests/**" = [
|
|
141
154
|
"BLE001",
|
|
142
155
|
"S101",
|
|
@@ -162,6 +175,7 @@ patch = ["subprocess"]
|
|
|
162
175
|
|
|
163
176
|
[tool.coverage.report]
|
|
164
177
|
fail_under = 95
|
|
178
|
+
precision = 2
|
|
165
179
|
show_missing = true
|
|
166
180
|
skip_covered = true
|
|
167
181
|
skip_empty = true
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
|
|
2
2
|
[project]
|
|
3
3
|
name = "brain-framework"
|
|
4
|
-
version = "
|
|
5
|
-
description = "Brain Framework is a local-first brain for you and your AI agents. It
|
|
4
|
+
version = "23.0.0"
|
|
5
|
+
description = "Brain Framework is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an ontology you declare, lets any agent harness search and read offline, and wakes your harness when declarative when: rules or reviewed gates spot new evidence."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.14"
|
|
8
8
|
license = "MIT"
|
|
@@ -42,9 +42,7 @@ dependencies = [
|
|
|
42
42
|
"pydantic>=2.13.5,<3",
|
|
43
43
|
"pyyaml>=6.0.3,<7",
|
|
44
44
|
"rich>=15.0.0,<16",
|
|
45
|
-
|
|
46
|
-
# raise the cap together with that call.
|
|
47
|
-
"typer>=0.27.2,<0.29",
|
|
45
|
+
"typer>=0.27.2",
|
|
48
46
|
]
|
|
49
47
|
|
|
50
48
|
[project.optional-dependencies]
|
|
@@ -92,8 +90,8 @@ dev = [
|
|
|
92
90
|
line-length = 120
|
|
93
91
|
src = ["src", "tests"]
|
|
94
92
|
extend-exclude = ["*.md"] # dprint owns Markdown, including its Python code blocks.
|
|
95
|
-
#
|
|
96
|
-
per-file-target-version = { "
|
|
93
|
+
# Copied examples run with the host's python3, not the package interpreter.
|
|
94
|
+
per-file-target-version = { "examples/**/*.py" = "py311" }
|
|
97
95
|
|
|
98
96
|
[tool.ruff.format]
|
|
99
97
|
docstring-code-format = true
|
|
@@ -145,14 +143,28 @@ ignore = [
|
|
|
145
143
|
]
|
|
146
144
|
|
|
147
145
|
[tool.ruff.lint.per-file-ignores]
|
|
146
|
+
"examples/**/_bf.py" = [
|
|
147
|
+
"A002", # `emit_receipt(id=...)` matches BF's channel receipt field name.
|
|
148
|
+
"S603", # Helpers invoke `bf` with literal argv lists and no shell.
|
|
149
|
+
"S607", # `bf` is resolved on the PATH Brain Framework or the host provides.
|
|
150
|
+
]
|
|
151
|
+
"examples/channels/**" = [
|
|
152
|
+
"S603", # Channel adapters invoke notifier CLIs with literal argv lists and no shell.
|
|
153
|
+
]
|
|
148
154
|
"examples/hooks/**" = [
|
|
149
155
|
"BLE001", # Silent hooks must exit 0 with no output on any unexpected error.
|
|
156
|
+
"S607", # Hooks resolve `git` by bare name on PATH with literal arguments.
|
|
150
157
|
]
|
|
151
158
|
"examples/sensors/**" = [
|
|
152
159
|
"S603", # Adapters invoke provider CLIs with literal argv lists; no shell is involved.
|
|
153
160
|
"S607", # Provider CLIs are resolved by bare name on the PATH Brain Framework sanitizes.
|
|
154
161
|
"T201", # Adapters print exactly one JSON array to stdout.
|
|
155
162
|
]
|
|
163
|
+
"examples/sensors/_sensor.py" = [
|
|
164
|
+
"A002", # `record(id=...)` matches BF's record field name.
|
|
165
|
+
"BLE001", # `main()` and `cli()` catch unexpected exceptions so tracebacks never quote provider data.
|
|
166
|
+
"S310", # `fetch()` rejects non-HTTPS schemes, credentials and cross-host redirects before opening.
|
|
167
|
+
]
|
|
156
168
|
"tests/**" = [
|
|
157
169
|
"BLE001", # Worker-thread test helpers record any exception so the test thread can assert on it.
|
|
158
170
|
"S101", # pytest assertions are the test contract.
|
|
@@ -183,6 +195,7 @@ patch = ["subprocess"]
|
|
|
183
195
|
|
|
184
196
|
[tool.coverage.report]
|
|
185
197
|
fail_under = 95
|
|
198
|
+
precision = 2
|
|
186
199
|
show_missing = true
|
|
187
200
|
skip_covered = true
|
|
188
201
|
skip_empty = true
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""🧠 Brain Framework: from information to informed actions."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import sys
|
|
4
5
|
|
|
5
|
-
__version__ = "
|
|
6
|
+
__version__ = "23.0.0"
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def main() -> None:
|
|
@@ -10,6 +11,14 @@ def main() -> None:
|
|
|
10
11
|
# Locks and process groups use POSIX primitives; fail clearly before importing them elsewhere.
|
|
11
12
|
if os.name != "posix":
|
|
12
13
|
raise SystemExit("bf: Brain Framework requires Linux or macOS")
|
|
14
|
+
if sys.argv[1:] == ["--version"] and sys.stdout is not None:
|
|
15
|
+
try:
|
|
16
|
+
sys.stdout.buffer.write(f"{__version__}\n".encode())
|
|
17
|
+
sys.stdout.flush()
|
|
18
|
+
except OSError:
|
|
19
|
+
pass
|
|
20
|
+
else:
|
|
21
|
+
return
|
|
13
22
|
from bf.cli import main as run
|
|
14
23
|
|
|
15
24
|
run()
|