Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a070b5-4994-7271-bd8b-7c3dbcedec4b
3.7 KiB
Session Protocol
Dev Hub (State Hub API): http://127.0.0.1:8000
MCP server name in ~/.claude.json: dev-hub
Step 1 — Orient
Read the offline-safe brief first — it works without a live hub connection:
cat .custodian-brief.md
Then call the MCP tool for richer cross-domain context when MCP tools are exposed:
get_domain_summary("financials")
If MCP tools are unavailable in the current agent session, use the REST API:
curl -s "http://127.0.0.1:8000/state/summary" | python3 -m json.tool
If the hub is offline: cd ~/state-hub && make api
Step 2 — Check inbox With MCP tools:
get_messages(to_agent="commerce-canon", unread_only=True)
Mark read with mark_message_read(message_id). Reply or act on coordination
requests before proceeding.
Without MCP tools:
curl -s "http://127.0.0.1:8000/messages/?to_agent=commerce-canon&unread_only=true" \
| python3 -m json.tool
curl -s -X PATCH "http://127.0.0.1:8000/messages/<id>/read" \
-H "Content-Type: application/json" -d '{}'
Step 3 — Scan workplans
ls workplans/
For each file with status: ready, active, or blocked, note pending
wait/todo/progress tasks.
Step 4 — Present brief
- Active workplans for
financials— title, task counts, blocking decisions - Pending tasks from
workplans/+ any[repo:commerce-canon]hub tasks - Goal guidance — if
goal_guidancein summary:needs_workplan: surface as top action — "Repo goal '{title}' has no workplan yet"alignment_warnings: flag if active work is not aligned with current goal
- Suggested next action — highest-priority open item
- SBOM status — flag if
last_sbom_atis unset for this repo
If no workplans: follow First Session Protocol (first-session.md).
During work: record_decision() · add_progress_event() · resolve_decision()
State Hub is a read model. Never register workplans or tasks by hand (
create_workplan,create_task) — write the workplan file inworkplans/and runuv run --project ~/repo-manager rmgr sync --path . --push. Repo Manager assigns missing deterministic IDs; central derives the exact pushed Forgejo commit. Manual registration creates duplicate ownership. Work structure belongs in repo files (ADR-001).Legacy:
create_workstreamand/workstreams/remain as metered aliases — seeworkplan-convention.md(compatibility footnote).
Session close:
- Update workplan/task statuses in repo files.
- If marking a workplan finished: hand off residuals as live work
records first (intake with
origin: residual+origin_ref: <WP-id>, or a child workplan / decision / engagement). Do not leave actionable leftovers only as prose or inSCOPE.md. See work-record-types § Residuals. - Log progress (below).
uv run --project ~/repo-manager rmgr sync --path . --pushwhen workplan files changed. Usestatehub fix-consistencyseparately for a deep audit.
With MCP tools:
add_progress_event(summary="...", topic_id="fe2aaa78-9c20-4feb-b3d2-4fe0529572a3", workplan_id="<uuid>")
Without MCP tools:
curl -s -X POST http://127.0.0.1:8000/progress/ \
-H "Content-Type: application/json" \
-d '{"topic_id":"fe2aaa78-9c20-4feb-b3d2-4fe0529572a3","workplan_id":"<uuid>","event_type":"note","summary":"what changed","author":"codex"}'
If workplan files were modified, ensure the local copy is up to date first, then sync from the repo checkout:
git pull --ff-only
uv run --project ~/repo-manager rmgr sync --path . --push
The sync refuses uncommitted workplan files and a branch behind its upstream. This prevents a workstation projection from getting ahead of the forge source.