core-hub/.claude/rules/session-protocol.md

49 lines
1.1 KiB
Markdown
Raw Normal View History

2026-06-27 08:22:42 +00:00
## Session Protocol
Dev Hub (State Hub API): http://127.0.0.1:8000
2026-06-27 11:00:12 +02:00
**Step 1 - Orient**
2026-06-27 08:22:42 +00:00
```bash
cat .custodian-brief.md
2026-06-27 11:00:12 +02:00
cat INTENT.md
cat SCOPE.md
ls workplans/
2026-06-27 08:22:42 +00:00
```
2026-06-27 11:00:12 +02:00
Use REST when MCP tools are unavailable:
2026-06-27 08:22:42 +00:00
```bash
2026-06-27 11:00:12 +02:00
curl -s "http://127.0.0.1:8000/workstreams/?topic_id=cee7bedf-2b48-46ef-8601-006474f2ad7a&status=active" | python3 -m json.tool
2026-06-27 08:22:42 +00:00
```
2026-06-27 11:00:12 +02:00
**Step 2 - Check inbox**
2026-06-27 08:22:42 +00:00
```bash
2026-06-27 11:00:12 +02:00
curl -s "http://127.0.0.1:8000/messages/?to_agent=core-hub&unread_only=true" | python3 -m json.tool
2026-06-27 08:22:42 +00:00
```
2026-06-27 11:00:12 +02:00
Mark read when handled.
**Step 3 - Scan workplans**
2026-06-27 08:22:42 +00:00
```bash
ls workplans/
```
2026-06-27 11:00:12 +02:00
For each file with `status: ready`, `active`, or `blocked`, note pending `wait`/`todo`/`progress` tasks.
2026-06-27 08:22:42 +00:00
2026-06-27 11:00:12 +02:00
**Step 4 - Work file-first**
2026-06-27 08:22:42 +00:00
2026-06-27 11:00:12 +02:00
State Hub is a read/cache/index layer. Work structure belongs in repo files under ADR-001.
2026-06-27 08:22:42 +00:00
2026-06-27 11:00:12 +02:00
**Session close**
2026-06-27 08:22:42 +00:00
```bash
2026-06-27 11:00:12 +02:00
cd ~/state-hub
make fix-consistency REPO=core-hub
2026-06-27 08:22:42 +00:00
curl -s -X POST http://127.0.0.1:8000/progress/ \
-H "Content-Type: application/json" \
2026-06-27 11:00:12 +02:00
-d '{"topic_id":"cee7bedf-2b48-46ef-8601-006474f2ad7a","event_type":"note","summary":"what changed","author":"codex"}'
2026-06-27 08:22:42 +00:00
```