feat(brief): generate .custodian-brief.md per repo for offline worker orientation

Adds _write_custodian_brief() to consistency_check.py. After every fix_repo()
run, a .custodian-brief.md is written to the repo root with: domain, last-synced
timestamp, current repo goal, active workstreams with progress (done/total), and
the first 7 open tasks per workstream (blocked → in_progress → todo order) with
task IDs. The file is git-committed when content changes so remote workers (e.g.
CoulombCore) can pull it and orient without a live MCP connection.

Session protocol template and CLAUDE.md updated: read .custodian-brief.md first,
then call get_domain_summary() as an enhancement (skip if MCP unreachable).
This eliminates false "State hub is offline" alarms in subagents and remote workers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 17:48:36 +01:00
parent 075b34945f
commit df2d14bae0
2 changed files with 150 additions and 1 deletions

View File

@@ -3,10 +3,16 @@
State Hub: http://127.0.0.1:8000
**Step 1 — Orient**
Read the offline-safe brief first — it works without a live hub connection:
```bash
cat .custodian-brief.md
```
Then call the MCP tool for richer cross-domain context (skip if unreachable):
```
get_domain_summary("{DOMAIN}")
```
If offline: `cd ~/the-custodian/state-hub && make api`
If the hub is offline: `cd ~/the-custodian/state-hub && make api`
**Step 2 — Check inbox**
```