brainiac-cli 0.16.0__py3-none-any.whl

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.
Files changed (77) hide show
  1. brain/__init__.py +39 -0
  2. brain/__main__.py +14 -0
  3. brain/_assets/AGENTS.md +564 -0
  4. brain/_assets/overlay/template/brand/brand-guide.md +24 -0
  5. brain/_assets/overlay/template/keywords/glossary.md +15 -0
  6. brain/_assets/overlay/template/people/roster.md +14 -0
  7. brain/_assets/overlay/template/voice/voice-profile.md +34 -0
  8. brain/_assets/routines/manifest.json +257 -0
  9. brain/_assets/scripts/brain-brief-mac.plist +59 -0
  10. brain/_assets/scripts/brain-brief.sh +74 -0
  11. brain/_assets/scripts/brain-synthesis-mac.plist +48 -0
  12. brain/_assets/scripts/brain-synthesis.sh +214 -0
  13. brain/_assets/scripts/install-brief-mac.sh +152 -0
  14. brain/_assets/scripts/install-brief-windows.ps1 +97 -0
  15. brain/_assets/scripts/register_tasks.py +386 -0
  16. brain/_assets/templates/company.md +21 -0
  17. brain/_assets/templates/concept.md +27 -0
  18. brain/_assets/templates/daily.md +20 -0
  19. brain/_assets/templates/decision.md +42 -0
  20. brain/_assets/templates/meeting.md +33 -0
  21. brain/_assets/templates/person.md +20 -0
  22. brain/_assets/templates/project.md +23 -0
  23. brain/_assets/templates/state-moc.md +40 -0
  24. brain/_version.py +12 -0
  25. brain/anchor.py +121 -0
  26. brain/audit.py +422 -0
  27. brain/backup.py +210 -0
  28. brain/brief.py +417 -0
  29. brain/capture.py +117 -0
  30. brain/chunk.py +249 -0
  31. brain/classification.py +134 -0
  32. brain/cli.py +1906 -0
  33. brain/config.py +368 -0
  34. brain/connect.py +362 -0
  35. brain/context.py +108 -0
  36. brain/core.py +3018 -0
  37. brain/doctor.py +1161 -0
  38. brain/egress.py +148 -0
  39. brain/embed.py +857 -0
  40. brain/encryption.py +217 -0
  41. brain/frontmatter.py +102 -0
  42. brain/golden_probe.py +678 -0
  43. brain/graph.py +369 -0
  44. brain/graphify.py +352 -0
  45. brain/index.py +1576 -0
  46. brain/ingest/__init__.py +19 -0
  47. brain/ingest/handlers/__init__.py +43 -0
  48. brain/ingest/handlers/base.py +95 -0
  49. brain/ingest/handlers/docx.py +78 -0
  50. brain/ingest/handlers/email.py +228 -0
  51. brain/ingest/handlers/html.py +142 -0
  52. brain/ingest/handlers/image.py +91 -0
  53. brain/ingest/handlers/pdf.py +99 -0
  54. brain/ingest/handlers/pptx.py +69 -0
  55. brain/ingest/handlers/tables.py +41 -0
  56. brain/ingest/handlers/text.py +43 -0
  57. brain/ingest/handlers/xlsx.py +100 -0
  58. brain/ingest/handlers/zip.py +163 -0
  59. brain/ingest/pipeline.py +839 -0
  60. brain/ingest/transcript.py +158 -0
  61. brain/init.py +870 -0
  62. brain/maintenance.py +2266 -0
  63. brain/mcp_adapter.py +217 -0
  64. brain/multihop.py +232 -0
  65. brain/notes.py +195 -0
  66. brain/overlay.py +183 -0
  67. brain/projection.py +79 -0
  68. brain/rerank.py +425 -0
  69. brain/snapshot.py +231 -0
  70. brain/update.py +743 -0
  71. brain/vectors.py +225 -0
  72. brainiac_cli-0.16.0.dist-info/METADATA +306 -0
  73. brainiac_cli-0.16.0.dist-info/RECORD +77 -0
  74. brainiac_cli-0.16.0.dist-info/WHEEL +5 -0
  75. brainiac_cli-0.16.0.dist-info/entry_points.txt +4 -0
  76. brainiac_cli-0.16.0.dist-info/licenses/LICENSE +202 -0
  77. brainiac_cli-0.16.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,14 @@
1
+ ---
2
+ overlay_type: people
3
+ title: "People roster — starter template"
4
+ updated: 2026-07-01
5
+ ---
6
+
7
+ # People roster
8
+
9
+ List the always-on people this owner's notes reference, with role (not
10
+ necessarily a full bio) so disambiguation has a decoder.
11
+
12
+ | Name / role | Relationship | Notes |
13
+ |---|---|---|
14
+ | `<Name or Role>` | `<e.g. manager, counterparty, direct report>` | `<one line>` |
@@ -0,0 +1,34 @@
1
+ ---
2
+ overlay_type: voice
3
+ title: "Voice profile — starter template"
4
+ updated: 2026-07-01
5
+ ---
6
+
7
+ # Voice profile
8
+
9
+ Fill in the durable writing voice for this owner. Drafting-facing kernel
10
+ skills (`save-conversation`, `promote`, `curation`) read this wherever they
11
+ produce audience-facing prose under this owner's name.
12
+
13
+ ## Tone
14
+
15
+ <!-- e.g. direct, technically deep, business-value focused -->
16
+
17
+ ## Register
18
+
19
+ <!-- the target register — a durable, stable-over-time voice vs. the
20
+ "AI-polished" register, which is usually the explicit anti-pattern -->
21
+
22
+ ## Sign-off repertoire
23
+
24
+ <!-- allowed closings, e.g.: Best regards / Thanks / Cheers -->
25
+ <!-- and an explicit NEVER list, e.g.: never "Warm regards," -->
26
+
27
+ ## Languages
28
+
29
+ <!-- which language(s) this owner writes in; which language to answer in -->
30
+
31
+ ## Sample snippets
32
+
33
+ <!-- 2-3 short curated samples (a real sent email opener, a memo line) that
34
+ exemplify the voice in practice -->
@@ -0,0 +1,257 @@
1
+ {
2
+ "manifest_version": "1",
3
+ "issued": "2026-06-30",
4
+ "session": "s13",
5
+ "purpose": "Host/VM-aware scheduled-task manifest for the brain product. One entry per live maintenance task, naming its cadence, command, connectors, and RUNTIME (host-write vs vm-read+draft). Consumed by scripts/register_tasks.py (the s07 registrar) and by routines/task-registrar's per-client registration steps.",
6
+ "locked_counts": {
7
+ "note": "THE LOCK (C-s02, ratified; AMENDED 2026-07-11 by owner decision): host os_scheduled budget is 2 — (1) brain-nightly (the maintenance umbrella) and (2) brain-synthesis (weekly headless kb-curator session; synthesis needs a model the engine deliberately does not hold). Any entry beyond these, or any os_scheduled=true entry on the VM, is a budget breach — amend locked_counts here first.",
8
+ "host_os_scheduled": 2,
9
+ "vm_os_scheduled": 0
10
+ },
11
+ "tasks": [
12
+ {
13
+ "id": "brain-nightly",
14
+ "display_name": "brain-nightly (THE maintenance umbrella — hourly)",
15
+ "folds": [
16
+ "chief-of-staff-nightly",
17
+ "daily-check (daily branch)",
18
+ "recommendations-aging (daily branch, unconditional file scan)",
19
+ "health (Monday branch)",
20
+ "integrity-scan (Tuesday branch)",
21
+ "ingestion-digest-weekly (Sunday branch)",
22
+ "curation (Sunday branch: stale-link + revisit-sample scan)",
23
+ "promotion-scan (Sunday branch: host brain promote-scan verb)",
24
+ "graphify-discovery (1st-of-month branch, REAL bounded build, ADR-0003 Ruling 6/(a))",
25
+ "inbox-ingest (daily branch, drain via sync)"
26
+ ],
27
+ "disposition": "FOLD",
28
+ "runtime": "host-write",
29
+ "os_scheduled": true,
30
+ "persistence_cost": 1,
31
+ "cadence": "HOURLY (StartInterval 3600; amended 2026-07-11, owner decision: ingestion must be frequent — a captured document is searchable within the hour, not the next morning). Every firing runs the unconditional work (workspace sweep + inbox ingest + capture drain + incremental sync + snapshot publish + self-organization folds — all idempotent/incremental, single-runner lock prevents overlap); the date-gated branches (Mon=health, Tue=integrity, Sun=digest+curate+promote-scan, 1st=graphify) still fire once per their own schedule via .brain/maintain-state.json markers (ADR-0003 Ruling 5/(d) due-since-last-run).",
32
+ "command": "brain maintain --json",
33
+ "command_notes": "brain maintain is the umbrella CLI verb (src/brain/core.py BrainCore.maintain, src/brain/maintenance.py maintain_branches): it runs sync --publish + brief + a cheap unconditional recommendations-aging scan every run, then runs health/integrity/digest for real on their date-gated day (1st-of-month graphify now invokes a REAL bounded build via BrainCore.graphify -- ADR-0003 Ruling 6/(a) supersedes this manifest's earlier row-7 \"documented only\" disposition; see the graphify-discovery row below). The Sunday digest branch now ALSO runs curate (stale-wikilink-target detection + an age x centrality revisit sample) and promote-scan, queuing findings into .brain/memory/hot.md (idempotent per branch/run-date via a hot.md idempotency-key marker); the graphify branch queues its own egress-gated link candidates into hot.md the same way. A single-runner file lock (.brain/maintain.lock) makes a concurrent maintain skip rather than race; a crash mid-branch leaves that branch's last-run marker unadvanced (still due next run) without blocking the branches that already succeeded. .brain/maintain-state.json is ONE file serving both the catch-up markers and the heartbeat (brain status surfaces a stale >48h daily branch or repeated branch failures) -- the same file src/brain/config.py maintain_state_path() and the session-start.sh hook's stale-nightly check both read. This single command IS the full date-gated heartbeat this manifest's locked_counts promises. Nightly REGISTRATION (not what it runs) is owned by /brainiac-install (per-vault launchd label com.profile-a-brain.daily-brief / Windows task brain-daily-brief, via `brain init --full --apply`) -- see docs/adr/0003-parity-architecture.md 'Settled context'; this manifest's registration block below documents the underlying scripts /brainiac-install drives.",
34
+ "connectors": [
35
+ "macOS launchd (LaunchAgent com.profile-a-brain.daily-brief)",
36
+ "Windows Task Scheduler (task brain-daily-brief)"
37
+ ],
38
+ "registration": {
39
+ "mac": {
40
+ "mechanism": "launchd LaunchAgent",
41
+ "label": "com.profile-a-brain.daily-brief",
42
+ "install_script": "scripts/install-brief-mac.sh",
43
+ "plist": "scripts/brain-brief-mac.plist",
44
+ "runtime_script": "scripts/brain-brief.sh"
45
+ },
46
+ "windows": {
47
+ "mechanism": "Task Scheduler",
48
+ "task_name": "brain-daily-brief",
49
+ "install_script": "scripts/install-brief-windows.ps1"
50
+ }
51
+ },
52
+ "vm_eligible": false,
53
+ "notes": "Host-only by construction -- the VM has no scheduler and registers nothing (client-access-model.md). Every write/sign/maintenance verb is refused on role=vm before BrainCore is constructed."
54
+ },
55
+ {
56
+ "id": "daily-check",
57
+ "source_task": "owner-vault-daily-check",
58
+ "disposition": "FOLD",
59
+ "runtime": "host-write",
60
+ "os_scheduled": false,
61
+ "persistence_cost": 0,
62
+ "cadence": "daily branch of brain-nightly (zero extra OS entries); standalone form is on-invoke",
63
+ "command": "brain check --json",
64
+ "connectors": [],
65
+ "vm_eligible": false,
66
+ "notes": "Index reconcile + drain drafts + status. _index.md regen stays vault-overlay (no brain equivalent)."
67
+ },
68
+ {
69
+ "id": "health",
70
+ "source_task": "owner-vault-health",
71
+ "disposition": "FOLD",
72
+ "runtime": "host-write",
73
+ "os_scheduled": false,
74
+ "persistence_cost": 0,
75
+ "cadence": "Monday branch of brain-nightly; standalone form is on-invoke",
76
+ "command": "brain health --json",
77
+ "connectors": [],
78
+ "vm_eligible": false,
79
+ "notes": "status + audit-chain verify + substrate self-test. Residual Obsidian/Bases-core plugin-hash check (if any client still runs Obsidian in parallel) stays a vault-overlay step, not a brain verb."
80
+ },
81
+ {
82
+ "id": "integrity-scan",
83
+ "source_task": "owner-vault-integrity-scan",
84
+ "disposition": "FOLD",
85
+ "runtime": "host-write",
86
+ "os_scheduled": false,
87
+ "persistence_cost": 0,
88
+ "cadence": "Tuesday branch of brain-nightly; standalone form is on-invoke",
89
+ "command": "brain integrity --min-score 0.95 --json",
90
+ "connectors": [],
91
+ "vm_eligible": false,
92
+ "notes": "Audit-chain verify + corpus-wide near-dup scan directly over the brain vector backend (e5-small ONNX) -- no MCP round-trip. Near-dup bands re-baselined for e5-small per execution-contract.md S5."
93
+ },
94
+ {
95
+ "id": "curation",
96
+ "source_task": "owner-vault-curation (kb-curator: audit / lint-orphans / lint-stale / lint-callouts / propose-cleanup / refresh-index / rotate-logs)",
97
+ "disposition": "FOLD",
98
+ "runtime": "host-write",
99
+ "os_scheduled": false,
100
+ "persistence_cost": 0,
101
+ "cadence": "Sunday branch of brain-nightly (zero extra OS entries, AUT-02); standalone form (`brain curate`) is on-invoke on host",
102
+ "command": "brain curate --json -- refresh-index + unclassified-notes lint + stale-wikilink-target detection + an age x whole-corpus-PageRank-centrality revisit sample (all now brain-retrieval-engine checks, ADR-0003 Ruling 5); orphan/contradiction/callout lint stays the .claude/skills/curation kernel skill (vault-graph structure, no brain-retrieval equivalent)",
103
+ "connectors": [],
104
+ "vm_eligible": false,
105
+ "notes": "AUT-02 (s08) moved stale-link + revisit-sample OUT of 'no brain equivalent' and into `brain curate` proper, reusing the existing src/brain/graph.py wikilink-BFS+PPR module (whole-corpus PageRank, superseding that module's previously-documented 'global centrality is gap G3, age-only fallback'). The .claude/skills/curation kernel skill stays the on-invoke DEEPER interactive surface (orphans/contradictions/callouts) and now documents that the engine runs its half of the scan every Sunday automatically. Findings queue into .brain/memory/hot.md via the Sunday brain-nightly branch, idempotent per run-date. Registration: /brainiac-install (no new OS task -- folds into the existing brain-nightly registration)."
106
+ },
107
+ {
108
+ "id": "promotion-scan",
109
+ "source_task": "owner-vault-promotion-scan",
110
+ "disposition": "FOLD (host Sunday) + ON-INVOKE (VM triage)",
111
+ "runtime": "host-write (scheduled) / vm-read+draft (on-invoke)",
112
+ "os_scheduled": false,
113
+ "persistence_cost": 0,
114
+ "cadence": "Sunday branch of brain-nightly for the host `brain promote-scan` verb (zero extra OS entries, AUT-02); the VM-eligible triage form is separately on-invoke (Cowork, surfaced at bootstrap or fired manually -- never OS-scheduled, per the locked VM=0 budget)",
115
+ "command": "Host Sunday fold: `brain promote-scan --json` (opens the index; findings queue into .brain/memory/hot.md). VM on-invoke triage:\nbrain bases-query --where status=candidate --max-tier Internal --json # find candidates (VM-allowed, no index-open) \nbrain search \"<topic>\" --max-tier Internal --json # corroborate \nbrain draft-capture --content \"<proposal>\" # stage an unsigned DRAFT, drained+signed by the next host `brain sync`",
116
+ "command_notes": "The host-only `brain promote-scan` CLI verb (added in C-s03/CUT-03) is the DIFFERENT, more powerful host-side triage ritual that opens the index -- it is refused on role=vm, and as of AUT-02 (s08) it ALSO runs automatically as part of the Sunday brain-nightly branch. The VM-eligible on-invoke form is unchanged and uses only bases-query/search/draft-capture, all on the VM_ALLOWED list (src/brain/cli.py).",
117
+ "connectors": [
118
+ "Cowork chat session (manual paste-prompt; poke-only trigger, no cron)"
119
+ ],
120
+ "vm_eligible": true,
121
+ "notes": "Promotion itself stays a human (P-10-equivalent) gate in BOTH forms; the host Sunday fold is triage-only (queues a hot.md entry, never auto-promotes). See routines/task-registrar's Cowork paste-prompt for the VM form. Registration for the host fold: /brainiac-install (no new OS task)."
122
+ },
123
+ {
124
+ "id": "inbox-ingest",
125
+ "source_task": "owner-vault-inbox-ingest",
126
+ "disposition": "FOLD",
127
+ "runtime": "host-write",
128
+ "os_scheduled": false,
129
+ "persistence_cost": 0,
130
+ "cadence": "daily branch of brain-nightly (drain via sync); standalone/event-driven form is on-invoke on host",
131
+ "command": "brain sync --json",
132
+ "connectors": [],
133
+ "vm_eligible": false,
134
+ "notes": "Binary-extraction pipeline stays overlay tooling; only its re-index step folds to brain sync (the incremental indexer IS the drain)."
135
+ },
136
+ {
137
+ "id": "graphify-discovery",
138
+ "source_task": "owner-vault-graphify-discovery",
139
+ "disposition": "FOLD",
140
+ "runtime": "host-write",
141
+ "os_scheduled": false,
142
+ "persistence_cost": 0,
143
+ "cadence": "monthly (1st), REAL build inside the graphify branch of brain-nightly (ADR-0003 Ruling 6/(a)); standalone form (`brain graphify`) is on-invoke on host",
144
+ "command": "brain graphify --json",
145
+ "connectors": [],
146
+ "vm_eligible": false,
147
+ "notes": "ADR-0003 Ruling 6/(a) SUPERSEDES this manifest's earlier task-disposition row 7 (\"documented only\" -- no clean fold, unbounded runtime risk). Both grounds are resolved by design: src/brain/graphify.py gives maintain a single function to call (clean fold), and three caps bound the monthly run -- a corpus-manifest drift gate (no-op in ms when unchanged), embedding reuse (never re-embeds), and a self-reported wall-clock budget (target <=60s at current corpus scale, action_required past 5min). brain maintain's graphify branch now sets invoked=true and calls BrainCore.graphify (src/brain/core.py), which builds a stamped `authoritative:false` graph.json (wikilink edges + capped, scored INFERRED embedding-neighbour edges) atomically to .brain/graph/, and queues egress-gated link candidates into .brain/memory/hot.md for human review (graphify never auto-writes a link into a note). `brain status` surfaces the build's generation/age. `brain graph-expand --use-inferred` can optionally consume the INFERRED edges as extra discovery-only traversal input."
148
+ },
149
+ {
150
+ "id": "autoresearch-cascade",
151
+ "source_task": "owner-vault-autoresearch-cascade",
152
+ "disposition": "ON-INVOKE",
153
+ "runtime": "host",
154
+ "os_scheduled": false,
155
+ "persistence_cost": 0,
156
+ "cadence": "on-invoke only, recommended quarterly BY CONVENTION -- documented here as prose, never a cron/schedule entry (ADR-0003 Ruling 7: too judgment-laden for the nightly heartbeat, needs a human to read the evidence before a kept change becomes a shipped default)",
157
+ "command": ".claude/skills/autoresearch/SKILL.md -- bounded loop: eval/capture_run.py (baseline + one-parameter-change candidate) -> eval/harness_direct.py -> eval/gate.py --metric recall@20 -> keep (non-inferior AND improved) or revert; every iteration writes eval/runs/autoresearch-*.json",
158
+ "command_notes": "AUT-04 (session s11) REPOINTS this row from an earlier placeholder ('autoresearch cascade' as a manual search+draft-capture research helper, which was VM-eligible) to the ADR-0003 Ruling 7 design actually built: a retrieval-PARAMETER self-tuning loop. It needs the profile-a-brain dev checkout (src/, eval/, the golden set + qrels the real owner vault was graded against) -- not something the sandboxed Cowork VM (vault/.brain/ runtime + published snapshot only, no eval/ or src/ on that mount) can run. Hence runtime=host, vm_eligible=false (was true under the old placeholder). It never edits src/brain/ -- a KEPT change is evidence + a recommendation; applying it to the shipped CLI/BrainCore defaults is a separate, human-reviewed code change.",
159
+ "connectors": [
160
+ "Claude Code / any harness with a full profile-a-brain repo checkout on PATH (src/, eval/) -- NOT a Cowork VM session",
161
+ "external research connectors stay human-initiated (egress posture, unchanged)"
162
+ ],
163
+ "vm_eligible": false,
164
+ "notes": "An analyst job, not a heartbeat. Evidence artifacts under eval/runs/autoresearch-*.json carry a top-level `captured` ISO field src/brain/core.py's `_autoresearch_status` reads for the morning brief's staleness line (ADR-0003 2026-07-05/s09 Amendment) -- so even a quarter where every candidate was reverted still refreshes the signal that the poke happened. See .claude/skills/autoresearch/SKILL.md for the full bounded-loop contract."
165
+ },
166
+ {
167
+ "id": "ingestion-digest-weekly",
168
+ "source_task": "owner-vault-ingestion-digest-weekly",
169
+ "disposition": "FOLD",
170
+ "runtime": "host-write (scheduled emission) / vm-read+draft (on-invoke)",
171
+ "os_scheduled": false,
172
+ "persistence_cost": 0,
173
+ "cadence": "Sunday branch of brain-nightly for the scheduled emission (folded, host, zero extra OS entries); on-demand VM form is on-invoke",
174
+ "command": "brain digest --days 7 --json",
175
+ "connectors": [
176
+ "Cowork chat session (on-invoke VM form only; manual paste-prompt; poke-only trigger, no cron)"
177
+ ],
178
+ "vm_eligible": true,
179
+ "notes": "`digest` is on the VM_ALLOWED list (read-only), so the on-demand form can run directly in Cowork without a paste-prompt registrar step if the owner just wants a one-off read. The registrar's Cowork prompt offers it as a named poke-only trigger purely for convenience (avoid retyping)."
180
+ },
181
+ {
182
+ "id": "recommendations-aging",
183
+ "source_task": "owner-vault-recommendations-aging",
184
+ "disposition": "FOLD",
185
+ "runtime": "host-write",
186
+ "os_scheduled": false,
187
+ "persistence_cost": 0,
188
+ "cadence": "daily branch of brain-nightly (unconditional cheap file scan, no separate branch, MEM-03); zero extra OS entries",
189
+ "command": "(no standalone CLI verb -- an in-process file scan inside `brain maintain`'s daily branch: src/brain/core.py BrainCore._recommendations_aging_fold, src/brain/maintenance.py recommendations_aging_scan)",
190
+ "command_notes": "Reads/writes .brain/memory/recommendations-open.jsonl (lifecycle: open -> aging [implicit: an open entry past the aging threshold, default 14 days] -> surfaced -> resolved) and appends surfaced entries to .brain/memory/hot.md, idempotently (an entry is queued into hot.md exactly once, guarded both by the JSONL status flip and a hot.md idempotency-key marker). Resolving a recommendation (removing it from the open file, logging it to .brain/memory/recommendations-log.md) is a documented convention (maintenance.resolve_recommendation), same as hot.md's own owner-clears-an-entry etiquette -- no CLI verb yet.",
191
+ "connectors": [],
192
+ "vm_eligible": false,
193
+ "notes": "MEM-03 (s08) promoted this from an overlay-only pass-through to a real brain-nightly fold, porting the reference organization's `_recommendations_open.jsonl`/`_recommendations_log.md` SCHEMA (never content, ADR-0003 Appendix B). Registration: /brainiac-install (no new OS task)."
194
+ },
195
+ {
196
+ "id": "handoff-freshness",
197
+ "source_task": "owner-vault-handoff-freshness",
198
+ "disposition": "OVERLAY-ONLY",
199
+ "runtime": "host-write",
200
+ "os_scheduled": false,
201
+ "persistence_cost": 0,
202
+ "cadence": "on-invoke (host) -- no SC/Bases/cascade coupling",
203
+ "command": "(vault-specific overlay tooling -- no brain CLI equivalent)",
204
+ "connectors": [],
205
+ "vm_eligible": false,
206
+ "notes": "Roster reconciliation: the live-vault roster carries a couple of near-pure pass-throughs beyond this manifest's disposition-tagged tasks (see totals.check) -- trivially OVERLAY-ONLY / HOST / ON-INVOKE, zero OS entries, no brain CLI equivalent."
207
+ },
208
+ {
209
+ "id": "write-audit",
210
+ "source_task": "owner-vault-write-audit",
211
+ "disposition": "OVERLAY-ONLY",
212
+ "runtime": "host-write",
213
+ "os_scheduled": false,
214
+ "persistence_cost": 0,
215
+ "cadence": "on-invoke (host) -- audits the vault's own audit chain + git coexistence, not the brain's",
216
+ "command": "(vault-specific overlay tooling; brain's own chain is verified separately via `brain verify-audit` / `brain anchor` / `brain verify-anchor`)",
217
+ "connectors": [],
218
+ "vm_eligible": false,
219
+ "notes": "Roster reconciliation: the live-vault roster carries a couple of near-pure pass-throughs beyond this manifest's disposition-tagged tasks (see totals.check) -- trivially OVERLAY-ONLY / HOST / ON-INVOKE, zero OS entries, no brain CLI equivalent."
220
+ },
221
+ {
222
+ "id": "brain-synthesis-weekly",
223
+ "display_name": "brain-synthesis (weekly model-backed synthesis session)",
224
+ "folds": [
225
+ "kb-curator weekly pass: state/MOC refresh from the week's raw ingests, promote-scan candidate promotion, index.md stamps, sync --publish"
226
+ ],
227
+ "disposition": "SCHEDULED-SESSION",
228
+ "runtime": "host-write",
229
+ "os_scheduled": true,
230
+ "persistence_cost": 1,
231
+ "cadence": "weekly Sunday 08:00 host local time (one hour after the nightly, so promote-scan/digest output is fresh); registry-driven — iterates every host vault in ~/.brainiac/workspaces.json, so a new install is covered with zero extra wiring",
232
+ "command": "scripts/brain-synthesis.sh (launchd label com.brainiac.synthesis)",
233
+ "notes": "Owner decision 2026-07-11: metadata automation (nightly folds) closed every organization gap except SYNTHESIS, which needs a model. Headless Claude Code session, bounded by --max-turns, scoped allowedTools, per-vault kb-curator skill required (skips loudly otherwise). Burns model credits weekly — cadence is the owner's dial."
234
+ },
235
+ {
236
+ "id": "offhost-watchdog",
237
+ "display_name": "off-host watchdog of last resort (WD-01)",
238
+ "disposition": "APP-SCHEDULED-NOTE (never os_scheduled)",
239
+ "runtime": "local script (available now) / cloud routine (spec'd, DEFERRED pending a remote-read transport)",
240
+ "os_scheduled": false,
241
+ "persistence_cost": 0,
242
+ "cadence": "intended weekly, via a Claude `/schedule` cloud routine — NOT an OS scheduler entry, so it survives launchd's own death (the exact failure mode it exists to catch). Deliberately excluded from `locked_counts.host_os_scheduled`: that budget counts OS-level schedulers (launchd/Task Scheduler) on THIS host; a cloud routine runs on Anthropic's own cron infrastructure, a different substrate entirely.",
243
+ "command": "python3 scripts/offhost_watchdog_check.py [--json] [--no-notify] -- iterates every host vault in ~/.brainiac/workspaces.json, calls brain.maintenance.offhost_watchdog_findings(vault) per vault, fires ONE macOS notification (the existing OBS-02 osascript channel, brain.maintenance.fire_notification) on any breach, silent otherwise",
244
+ "command_notes": "WD-03/WD-01 (s07, 2026-07-12): offhost_watchdog_findings keys freshness on the LATEST health-history record's `ts` (a precise ISO datetime, written every hourly maintain run) rather than maintain-state.json's `last_run` (an ISO DATE, which can only express staleness in whole-day/24h steps -- too coarse for a 26h threshold). It delegates to the UNCHANGED synthesis_heartbeat_finding (WATCHDOG-01, commit d28c0ce) and health_trend for the other two checks -- extends that shipped pattern rather than rebuilding it. OWNER DECISION 2026-07-12: only the LOCAL leg (this row) ships this session; the off-host CLOUD leg (a real /schedule routine reading this data remotely) is DEFERRED -- verified via the schedule skill's own documentation that a cloud routine \"cannot access local files, local services, or local environment variables\", so there is no remote-read channel for it yet. No new outbound egress or credentials were introduced. See docs/operations/wd01-offhost-watchdog-spec.md (the routine PROMPT + registration instructions for once a remote-read channel exists) and docs/operations/wd01-deferred-cloud-leg.md (what's missing + the revisit trigger).",
245
+ "connectors": [],
246
+ "vm_eligible": false,
247
+ "notes": "Tests: tests/test_offhost_watchdog.py -- a forced-stale fixture proves the breach path fires (and that a fresh heartbeat / no-history-at-all both stay silent). This row is intentionally the FIRST manifest entry of its kind (app-scheduled, not OS-scheduled) -- there is no prior precedent to reconcile against."
248
+ }
249
+ ],
250
+ "totals": {
251
+ "tasks_listed": 14,
252
+ "host_os_scheduled_entries": 1,
253
+ "vm_os_scheduled_entries": 0,
254
+ "vm_eligible_on_invoke_tasks": 2,
255
+ "check": "14 manifest rows = 1 umbrella (brain-nightly) + 10 disposition-tagged tasks it folds/hosts/on-invokes + 2 roster-reconciliation pass-throughs (handoff-freshness, write-audit) + 1 app-scheduled-note (offhost-watchdog, s07/WD-01) that deliberately sits OUTSIDE locked_counts (it is not an OS scheduler entry). recommendations-aging moved from a roster pass-through to a real brain-nightly FOLD in AUT-02/MEM-03 (s08). persistence accounting matches this manifest's locked_counts exactly: 1 host, 0 VM (offhost-watchdog adds 0 to both, by design). autoresearch-cascade dropped from vm_eligible_on_invoke_tasks (3 -> 2) in AUT-04/s11: it needs the profile-a-brain dev checkout (src/, eval/), not something a Cowork VM session (vault/.brain/ runtime only) can run -- see that row's command_notes."
256
+ }
257
+ }
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <!-- brain-daily-brief — macOS launchd LaunchAgent (UX-02)
4
+ Install: BRAIN_VAULT=/path/to/vault bash scripts/install-brief-mac.sh
5
+ Uninstall: launchctl unload ~/Library/LaunchAgents/com.brainiac.nightly.<id>.plist
6
+ rm ~/Library/LaunchAgents/com.brainiac.nightly.<id>.plist
7
+ Logs: ~/Library/Logs/brain/brief-YYYY-MM-DD.log
8
+ Task name: com.brainiac.nightly.<id> (per-vault; <id> = 8-hex vault slug, rendered by install-brief-mac.sh)
9
+ -->
10
+ <plist version="1.0">
11
+ <dict>
12
+ <key>Label</key>
13
+ <string>LABEL_PLACEHOLDER</string>
14
+
15
+ <key>ProgramArguments</key>
16
+ <array>
17
+ <string>/bin/bash</string>
18
+ <string>SCRIPTS_DIR/brain-brief.sh</string>
19
+ </array>
20
+
21
+ <!-- BRAIN_VAULT and BRAIN_AUDIT_KEY_PEM are substituted by install-brief-mac.sh.
22
+ The signing key is read from the macOS Keychain at install time and written
23
+ here; it is never stored in the source tree. -->
24
+ <key>EnvironmentVariables</key>
25
+ <dict>
26
+ <key>BRAIN_VAULT</key>
27
+ <string>VAULT_PATH</string>
28
+ <key>BRAIN_AUDIT_KEY_PEM</key>
29
+ <string>AUDIT_KEY_PEM_PLACEHOLDER</string>
30
+ <key>BRAIN_LOG_DIR</key>
31
+ <string>HOME_DIR/.brain/logs</string>
32
+ <!-- Workspace sweep sources (WSP-01, optional): os.pathsep-separated
33
+ folders whose SETTLED top-level files auto-flow into
34
+ <vault>/inbox/. `path=N` sets a per-dir age gate in days;
35
+ `path=0` = capture-inbox mode (same-day, 15-min write guard).
36
+ Empty = sweep disabled. Set per vault at install time. -->
37
+ <key>BRAIN_WORKSPACE_SWEEP_DIRS</key>
38
+ <string>SWEEP_DIRS_PLACEHOLDER</string>
39
+ </dict>
40
+
41
+ <!-- HOURLY (owner decision 2026-07-11: ingestion is frequent — a
42
+ captured document is searchable within the hour). Every firing runs
43
+ the incremental/idempotent work (sweep + ingest + drain + sync +
44
+ snapshot + self-organization folds); weekly/monthly branches stay
45
+ date-gated inside `brain maintain` via .brain/maintain-state.json,
46
+ so higher frequency never multiplies the heavy branches. -->
47
+ <key>StartInterval</key>
48
+ <integer>3600</integer>
49
+
50
+ <key>StandardOutPath</key>
51
+ <string>HOME_DIR/.brain/logs/launchd-brief-stdout.log</string>
52
+ <key>StandardErrorPath</key>
53
+ <string>HOME_DIR/.brain/logs/launchd-brief-stderr.log</string>
54
+
55
+ <!-- Do NOT run immediately on load — wait for the first scheduled time. -->
56
+ <key>RunAtLoad</key>
57
+ <false/>
58
+ </dict>
59
+ </plist>
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env bash
2
+ # brain-daily-brief — THE single sanctioned host scheduled task (`brain-nightly`,
3
+ # persistence-budget.md THE LOCK). Runs the `brain maintain` umbrella, which is
4
+ # sync --publish + brief PLUS the date-gated branches (Mon=health, Tue=integrity,
5
+ # Sun=digest, 1st=graphify-documented-only) -- see src/brain/core.py
6
+ # BrainCore.maintain + src/brain/maintenance.py maintain_branches.
7
+ #
8
+ # Invoked by macOS launchd (brain-brief-mac.plist) or Windows Task Scheduler
9
+ # (install-brief-windows.ps1). This script is the ONE sanctioned automated
10
+ # brain invocation and the guaranteed daily capture-drain FLOOR.
11
+ #
12
+ # Task name: brain-daily-brief (per-vault launchd label com.brainiac.nightly.<id> /
13
+ # Windows task brain-daily-brief-<id>) -- the manifest entry for this
14
+ # task is routines/manifest.json id "brain-nightly". Stable IDs
15
+ # are kept unchanged across this s07 script update so an existing
16
+ # registration is NOT duplicated by the idempotent registrar
17
+ # (scripts/register_tasks.py) -- only its invoked command changed.
18
+ # User context: current user (LaunchAgent / Task Scheduler user-level)
19
+ # Schedule: daily 07:00 (see installer scripts); date-gated branches fire
20
+ # INSIDE this one run -- see routines/manifest.json + persistence-budget.md.
21
+ # Logs: $BRAIN_LOG_DIR/brief-YYYY-MM-DD.log (30-day rotation)
22
+ # Uninstall: see scripts/install-brief-mac.sh or install-brief-windows.ps1
23
+ #
24
+ # Security note: the audit signing key is resolved AT RUNTIME by
25
+ # resolve_signing_key() (env BRAIN_AUDIT_KEY_PEM -> keychain fallthrough).
26
+ # The key is NEVER stored in this file, and on macOS it is no longer baked
27
+ # into the launchd plist either — the drain reads the Keychain when it runs
28
+ # (fails closed if locked/absent). BRAIN_AUDIT_KEY_PEM in the plist env is
29
+ # only populated when the operator explicitly injected it at install time.
30
+ # Windows: same — the task action carries no key; brain resolves it from the
31
+ # Credential Manager (keyring) at runtime.
32
+ #
33
+ # Threat model: see docs/operations/s09-evidence.md § Scheduled-task threat model.
34
+ #
35
+ # OBS-02 degradation alarm: `brain maintain` itself fires the macOS
36
+ # notification (src/brain/maintenance.py fire_notification, invoked from
37
+ # BrainCore.maintain) for any trend regression, tripped watchdog finding, or
38
+ # blocked>0 outcome — deduplicated per finding per day under
39
+ # .brain/notify-sent/. Set BRAIN_NOTIFY=off in this process's environment to
40
+ # disable; non-macOS hosts degrade to a log-only no-op automatically.
41
+ set -euo pipefail
42
+
43
+ LOGDIR="${BRAIN_LOG_DIR:-$HOME/.brain/logs}"
44
+ mkdir -p "$LOGDIR"
45
+ LOG="$LOGDIR/brief-$(date +%Y-%m-%d).log"
46
+
47
+ # Resolve the brain binary explicitly: launchd runs with a minimal PATH
48
+ # (/usr/bin:/bin:...) that does NOT include ~/.local/bin or the install venv,
49
+ # so a bare `brain` fails with "command not found" under the scheduled run.
50
+ # Prefer the canonical install venv; fall back to PATH for dev/manual runs.
51
+ BRAIN_BIN="${BRAIN_BIN:-}"
52
+ if [ -z "$BRAIN_BIN" ]; then
53
+ if [ -x "$HOME/.brainiac/venv/bin/brain" ]; then
54
+ BRAIN_BIN="$HOME/.brainiac/venv/bin/brain"
55
+ else
56
+ BRAIN_BIN="$(command -v brain || true)"
57
+ fi
58
+ fi
59
+ if [ -z "$BRAIN_BIN" ]; then
60
+ echo "brain-brief: no brain binary found (venv missing and not on PATH)" >> "$LOG"
61
+ exit 1
62
+ fi
63
+
64
+ {
65
+ echo "=== brain-daily-brief / brain-nightly $(date -u +%Y-%m-%dT%H:%M:%SZ) ==="
66
+ # maintain: sync --publish (drain pending captures + reconcile index +
67
+ # republish snapshot) + brief, THEN whichever of health/integrity/digest is
68
+ # due today (date-gated). graphify is documented-only (no build invoked --
69
+ # the discovery graph stays separate tooling per task-disposition.md row 7).
70
+ "$BRAIN_BIN" maintain --json
71
+ } >> "$LOG" 2>&1
72
+
73
+ # Rotate logs older than 30 days.
74
+ find "$LOGDIR" -name 'brief-*.log' -mtime +30 -delete 2>/dev/null || true
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <!-- brain-synthesis — the SECOND sanctioned host scheduled task
5
+ (routines/manifest.json id brain-synthesis-weekly; THE LOCK host=2).
6
+ ONE per HOST, not per vault: scripts/brain-synthesis.sh iterates every
7
+ host vault in ~/.brainiac/workspaces.json, so a newly installed vault is
8
+ covered with zero extra wiring. Weekly Sun 08:00, one hour after the
9
+ hourly umbrella has refreshed promote-scan/digest output. Requires the
10
+ `claude` CLI + a kb-curator skill in the workspace; skips loudly
11
+ otherwise (see the script header). -->
12
+ <dict>
13
+ <key>Label</key>
14
+ <string>com.brainiac.synthesis</string>
15
+
16
+ <key>ProgramArguments</key>
17
+ <array>
18
+ <string>/bin/bash</string>
19
+ <string>SCRIPTS_DIR/brain-synthesis.sh</string>
20
+ </array>
21
+
22
+ <key>EnvironmentVariables</key>
23
+ <dict>
24
+ <key>BRAIN_LOG_DIR</key>
25
+ <string>HOME_DIR/.brain/logs</string>
26
+ <key>PATH</key>
27
+ <string>HOME_DIR/.local/bin:HOME_DIR/.brainiac/venv/bin:/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin</string>
28
+ </dict>
29
+
30
+ <key>StartCalendarInterval</key>
31
+ <dict>
32
+ <key>Weekday</key>
33
+ <integer>0</integer>
34
+ <key>Hour</key>
35
+ <integer>8</integer>
36
+ <key>Minute</key>
37
+ <integer>0</integer>
38
+ </dict>
39
+
40
+ <key>StandardOutPath</key>
41
+ <string>HOME_DIR/.brain/logs/launchd-synthesis-stdout.log</string>
42
+ <key>StandardErrorPath</key>
43
+ <string>HOME_DIR/.brain/logs/launchd-synthesis-stderr.log</string>
44
+
45
+ <key>RunAtLoad</key>
46
+ <false/>
47
+ </dict>
48
+ </plist>