Files
CHORUS/prompts
anthonyrawlins aea4d45fd8 Implement Phase 2 & 3: Complete HAP Terminal Interface with Patch Management
🎭 Phase 2: HAP Terminal Interface Implementation
 **Core Terminal Interface**: Interactive command-driven HAP terminal with help system
 **HMMM Message Composition System**:
   - New reasoning messages, thread replies, network queries, decision proposals
   - Complete message metadata handling (topics, threads, timestamps)
 **UCXL Context Browsing System**:
   - Address parsing, content retrieval from DHT encrypted storage
   - Search functionality, content creation, history navigation
 **Decision Participation System**:
   - Active decision listing, decision details with voting status
   - Vote casting with reasoning, decision proposals, HMMM integration

🔧 Phase 3: Enhanced Human Workflows
 **Patch Creation and Submission Workflows**:
   - Complete patch lifecycle management (create, review, submit, track)
   - Multiple patch types (context, code, config, docs)
   - UCXL integration with DHT storage, HMMM coordination
 **Time-Travel Diff Support**:
   - Temporal navigation operators (~~<n>, ^^<n>, @<time>)
   - Decision-hop analysis, visual diff display, version comparison

🏗️ **Architecture Highlights**:
- **Multi-binary structure**: Separate chorus-agent and chorus-hap binaries
- **Shared P2P runtime**: Both binaries use identical libp2p, DHT, HMMM, UCXL systems
- **Interactive sub-shells**: Dedicated command environments for HMMM, UCXL, patches, decisions
- **Network integration**: All features connect to distributed P2P agent network
- **Human-agent parity**: Humans participate as first-class network citizens

📦 **New Files**:
- internal/hapui/terminal.go: Complete HAP terminal interface (2400+ lines)
- prompts/human-roles.yaml: Role-based prompt configuration
- docs/decisions/*: HAP conversion decision record

🔗 **Integration Points**:
- HMMM: Collaborative reasoning and patch/decision announcements
- UCXL: Context addressing and version management
- DHT: Distributed storage of patches and content
- Decision System: Formal approval and consensus workflows

The HAP terminal interface now provides comprehensive human portal into the CHORUS
autonomous agent network, enabling collaborative reasoning, context sharing, patch
management, and distributed decision-making between humans and AI agents.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 09:38:14 +10:00
..

CHORUS Prompts Directory

This directory holds runtimeloaded prompt sources for agents. Mount it into containers to configure prompts without rebuilding images.

  • Role prompts (S): YAML files defining agent roles and their system_prompt.
  • Default instructions (D): A shared Markdown/TXT file applied to all agents.
  • Composition: Final system prompt = S + two newlines + D.

Mounting and Env Vars

  • Bind mount (example): -v /srv/chorus/prompts:/etc/chorus/prompts:ro
  • Env vars:
    • CHORUS_PROMPTS_DIR=/etc/chorus/prompts
    • CHORUS_DEFAULT_INSTRUCTIONS_PATH=/etc/chorus/prompts/defaults.md (optional)
    • CHORUS_ROLE=<role-id> (selects which S to compose with D)

Reload: prompts are loaded at startup. Restart containers to pick up changes.

Files and Structure

  • defaults.md (or defaults.txt): global Default Instructions D
  • roles.yaml (optional): multiple roles in one file
  • *.yaml / *.yml: one or more files; all are merged by role ID

Example layout:

/etc/chorus/prompts/
  defaults.md
  roles.yaml
  ops.yaml
  analysts.yaml

Role YAML Schema

Top-level key: roles. Each role is keyed by its role ID (used with CHORUS_ROLE).

roles:
  arbiter:
    name: "Arbiter"
    description: "Coordination lead for cross-agent planning and consensus."
    tags: [coordination, planning]
    system_prompt: |
      You are Arbiter, a precise coordination lead...
    defaults:
      models: ["meta/llama-3.1-8b-instruct"]
      capabilities: ["coordination","planning","dependency-analysis"]
      expertise: []
      max_tasks: 3

Notes:

  • Role IDs must be unique across files; later files overwrite earlier definitions of the same ID.
  • system_prompt is required to meaningfully customize an agent.
  • defaults are advisory and can be used by orchestration; runtime currently composes only the prompt string (S + D).

Default Instructions (D)

Provide generic guidance for all agents, including:

  • When/how to use HMMM (collaborative reasoning), COOEE (coordination), UCXL (context), BACKBEAT (timing/phase telemetry)
  • JSON envelopes for each message type
  • Safety, auditability, and UCXL citation policy

File can be Markdown or plain text. Example: defaults.md.

Composition Logic

  • If CHORUS_ROLE is set and a matching role exists: final system prompt = role.system_prompt + "\n\n" + defaults
  • Else, if defaults present: final = defaults
  • Else: fallback to a minimal builtin default

Validation Tips

  • Ensure mounted path and env vars are set in your compose/stack.
  • Role ID used in CHORUS_ROLE must exist in the merged set.
  • Restart the container after updating files.

BACKBEAT Standards

Include clear guidance in defaults.md on:

  • Phases: prepare|plan|exec|verify|publish
  • Events: start|heartbeat|complete
  • Correlation: team_id, session_id, operation_id, link to COOEE/HMMM IDs
  • Budgets/latency, error reporting, and UCXL citations for escalations

See the repositorys prompts/defaults.md for a complete example.