Files
llm-connect/.claude/rules/session-protocol.md
tegwick 57b346bb8b chore(custodian): add CLAUDE.md and .claude/rules/ orientation files
Registers llm-connect with the Custodian agent system:
- CLAUDE.md: thin @-import index pointing to modular rules
- .claude/rules/session-protocol.md: orient with get_domain_summary("custodian")
- .claude/rules/repo-identity.md: domain=custodian, slug=llm-connect
- .claude/rules/first-session.md, workplan-convention.md, stack-and-commands.md,
  architecture.md, repo-boundary.md, agents.md, scope.md (stubs to fill in)
- session-protocol notes both local (:8000) and CoulombCore bridge (:18000) URLs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 23:15:29 +02:00

2.4 KiB

Session Protocol

State Hub: http://127.0.0.1:8000 (local) · http://127.0.0.1:18000 (CoulombCore via ops-bridge)

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 (skip if unreachable):

get_domain_summary("custodian")

If the hub is offline: cd ~/the-custodian/state-hub && make api

Step 2 — Check inbox

get_messages(to_agent="llm-connect", unread_only=True)

Mark read with mark_message_read(message_id). Reply or act on coordination requests before proceeding.

Step 3 — Scan workplans

ls workplans/

For each file with status: active, note pending todo/in_progress tasks.

Step 4 — Present brief

  1. Active workstreams for custodian — title, task counts, blocking decisions
  2. Pending tasks from workplans/ + any [repo:llm-connect] hub tasks
  3. Goal guidance — if goal_guidance in 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
  4. Suggested next action — highest-priority open item
  5. SBOM status — flag if last_sbom_at is unset for this repo

If no workstreams: follow First Session Protocol (first-session.md).

During work: record_decision() · add_progress_event() · resolve_decision()

State Hub is a read model. Bootstrap tools (create_workstream, create_task) are First Session Protocol only. Work structure belongs in repo files (ADR-001).

Session close:

add_progress_event(summary="...", topic_id="cee7bedf-2b48-46ef-8601-006474f2ad7a", workstream_id="<uuid>")

If workplan files were modified, ensure the local copy is up to date first:

git -C <repo_path> pull --ff-only
cd ~/the-custodian/state-hub && make fix-consistency REPO=llm-connect

For repos where implementation runs on a remote machine (e.g. CoulombCore), use the combined target which pulls before fixing:

cd ~/the-custodian/state-hub && make fix-consistency-remote REPO=llm-connect

C-15 (DB task ahead of file) is normal in multi-machine workflows — writeback will sync the file to match DB. C-16 (repo behind remote) blocks all writes until you pull — intentional to prevent clobbering remote progress.