{"id":49031328,"url":"https://github.com/patrickkidd/hurin","last_synced_at":"2026-04-19T09:31:04.426Z","repository":{"id":342186691,"uuid":"1167557743","full_name":"patrickkidd/hurin","owner":"patrickkidd","description":"OpenClaw Software Dev Architecture and Config","archived":false,"fork":false,"pushed_at":"2026-03-13T09:05:24.000Z","size":3358,"stargazers_count":2,"open_issues_count":15,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-13T20:43:50.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickkidd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-26T12:30:43.000Z","updated_at":"2026-03-13T09:05:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/patrickkidd/hurin","commit_stats":null,"previous_names":["patrickkidd/hurin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patrickkidd/hurin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fhurin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fhurin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fhurin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fhurin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickkidd","download_url":"https://codeload.github.com/patrickkidd/hurin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fhurin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32001751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-19T09:31:03.700Z","updated_at":"2026-04-19T09:31:04.420Z","avatar_url":"https://github.com/patrickkidd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hurin — OpenClaw Agent Deployment\n\nThis is the configuration repo for **hurin**, an [OpenClaw](https://openclaw.ai) agent deployment running on a Linux VPS (2GB RAM). It drives a 2-tier AI development team that autonomously implements features, reviews PRs, and provides strategic briefings for the [Family Diagram](https://alaskafamilysystems.com) product suite.\n\n**New here? Read [`QUICKSTART.md`](QUICKSTART.md)** — what to do next, first week checklist, daily workflow.\n\n## What This Repo Contains\n\nThis is not application code. It's the operational configuration, scripts, prompts, and architecture decision records for a single-machine OpenClaw deployment. The product repos it operates on are:\n\n| Repo | Role |\n|------|------|\n| `patrickkidd/familydiagram` | Desktop/mobile app (PyQt5/QML, existing product) |\n| `patrickkidd/btcopilot` | Personal app backend (Flask, AI/ML, clinical model) |\n| `patrickkidd/fdserver` | Server (Flask, PostgreSQL, Celery) |\n\nAll three repos are checked out as submodules under `workspace-hurin/theapp/`.\n\n---\n\n## Architecture Overview\n\nA 2-tier, 3-agent architecture where specialist agents (MiniMax M2.5) delegate all code intelligence to Claude Code (Opus 4.6) running at $0 on the Anthropic Max plan. See [ADR-0008](adrs/ADR-0008-three-agent-architecture.md).\n\n```\nPatrick (Discord)\n  |\n  v\nOpenClaw Gateway (systemd service, port 18789)\n  |\n  +--\u003e Huor (Team Lead, #team-lead + #tasks)\n  |      |--- Task execution: cc-query.py (sync), task spawn (background)\n  |      |--- GitHub monitoring: cron every 15min (github-poll.py)\n  |      |--- Weekly synthesis: cron Monday 9:15 AM (run-synthesis.py)\n  |      └--- Anomaly detection, auto-spawn pipeline\n  |\n  +--\u003e Tuor (Co-Founder, #co-founder)\n  |      |--- 9 lens strategic briefings (co-founder-sdk.py)\n  |      |--- Action pipeline: approve, refine, propose\n  |      └--- KB-aware analysis, writes findings to knowledge/\n  |\n  +--\u003e Beren (Chief of Staff, #chief-of-staff)\n         |--- Strategic digests (Tue + Fri, chief-of-staff.py)\n         └--- Meta-orchestration, system evaluation\n\nAll agents: MiniMax M2.5 (~$0.01/msg) → Claude Code Opus 4.6 ($0)\n```\n\n**Húrin** is the platform (Linux VPS, repo, user account), not an agent.\n\n### Why 2-Tier?\n\nAn earlier 3-tier design (hurin -\u003e beren/tuor coordinators -\u003e Claude Code) had a Haiku-class intelligence bottleneck at the coordinator layer. Prompt quality turned out to be the single highest-leverage variable, and having a small model write coding prompts was a net negative. Collapsing to 2 tiers — smart router + Opus brain — eliminated the bottleneck entirely. See [ADR-0001](adrs/ADR-0001-agent-swarm.md) for the full rationale.\n\n### Cost Model\n\n| Component | Model | Cost |\n|-----------|-------|------|\n| Huor/Tuor/Beren (agents) | MiniMax M2.5 | ~$0.01/message ($3-27/month total) |\n| Claude Code (brain) | Opus 4.6 | $0 (Max plan CLI) |\n| Co-founder briefings | Opus 4.6 | $0 (Max plan CLI) |\n| Team lead synthesis | Opus 4.6 | $0 (Max plan CLI) |\n| PR reviews | Opus 4.6 | $0 (Max plan CLI) |\n\nAll intelligence work is $0. The only API cost is agent routing on MiniMax M2.5.\n\n---\n\n## Runtime Components\n\nTwo systemd services and five cron jobs form the runtime:\n\n### Systemd Services\n\n| Label | Script | Role |\n|-------|--------|------|\n| `openclaw-gateway` | `openclaw gateway` | OpenClaw proxy on port 18789 (loopback), runs 3 Discord bots |\n| `openclaw-taskdaemon` | `monitor/task-daemon.py` | Drains task queue, executes CC tasks via Agent SDK |\n\nRestart: `systemctl --user restart openclaw-\u003cname\u003e`\n\n### Cron\n\n| Schedule | Script | Purpose |\n|----------|--------|---------|\n| `*/15 7-21 * * *` | `team-lead/github-poll.sh` | GitHub poll, metrics, anomaly detection, telemetry |\n| `15 9 * * 1` | `team-lead/manual-synthesis.sh` | Weekly synthesis (Opus), Discord post, auto-spawn |\n| `3 9 * * 2,5` | `chief-of-staff/chief-of-staff.py` | Strategic digest (Tue + Fri) |\n| `30 9 * * 1` | `monitor/board-reconcile.py` | GitHub project board reconciliation |\n| 9 rotating | `co-founder/co-founder.sh \u003clens\u003e` | Strategic briefings (currently paused) |\n\n---\n\n## How Work Gets Done\n\n### The Workflow: Message to Merged PR\n\n1. Patrick posts a task in Discord `#team-lead`\n2. Huor triages: handle directly (simple query) or delegate to CC\n3. For investigations: Huor calls `cc-query.py` (Mode 1 — sync), which creates a Discord thread in `#tasks` showing CC's progress in real time\n4. CC investigates, Huor relays the report to Patrick\n5. On approval, Huor runs `task spawn` (Mode 2 — background)\n6. Task daemon picks up within 30 seconds, creates a git worktree, symlinks `.venv`, runs Agent SDK `query()`\n7. Discord thread streams tool calls and text in real time\n8. CC reads the repo's `CLAUDE.md` files, implements the change, creates a PR\n9. `review-prs.sh` (every 15 min) posts an automated Claude review on the PR\n10. On success: daemon pings with PR URL\n11. On failure: Ralph Loop auto-respawns with session resume (up to 3x)\n12. Patrick reviews and merges\n\n### Definition of Done\n\nA task is complete when:\n- PR created (no direct commits to main)\n- No merge conflicts\n- CI passing (all checks green)\n- Automated Claude review passed\n- Screenshots included if UI change\n- Tests added or updated\n\n### Ralph Loop (Failure Recovery)\n\nWhen a task fails without producing a PR:\n1. Task daemon captures failure context from the last 50 lines of output\n2. If respawn count \u003c 3: auto-respawns with SDK session resume (full context preserved)\n3. The respawn prompt includes the failure output and asks CC to try a different approach\n4. After 3 failed attempts: marked as `failed`, Patrick notified\n\nNo human involvement in failure recovery — the daemon handles retries with full session context.\n\n### Live Steering\n\nPatrick can redirect running tasks by replying in the task's Discord thread. Thread replies are picked up by the steer poller and delivered to CC as live messages.\n\n### Task CLI\n\n```bash\ntask spawn \u003crepo\u003e \u003cid\u003e '\u003cdesc\u003e' [--issue #]   # Enqueue (daemon picks up in \u003c=30s)\ntask watch \u003cid\u003e                                # Tail JSONL log\ntask status [id]                               # Registry status\ntask list                                      # Queued + running + pr_open\ntask kill \u003cid\u003e                                 # Write kill sentinel\ntask follow-up \u003cid\u003e \u003cmessage\u003e                  # Resume completed task's session\n```\n\n---\n\n## Agents\n\nThree specialist agents, each with their own Discord bot, workspace, and scoped responsibilities. All run on MiniMax M2.5 (Sonnet-tier) with the same tool lockdown.\n\n### Structural Enforcement\n\nAll agents' tool allowlist is limited to:\n- `exec` — run shell commands\n- `sessions_list`, `sessions_history`, `session_status`, `sessions_send` — session introspection + agent-to-agent\n\nThe `read`, `write`, and `edit` tools are **removed at the OpenClaw config level**. See [ADR-0003](adrs/ADR-0003-hurin-lockdown-validation.md).\n\n### Huor (Team Lead)\n\nPrimary agent. Channels: `#team-lead`, `#tasks`. Workspace: `workspace-huor/`.\n\nTriage rule: *\"Can I answer this with `exec` commands I already know, without needing to understand application code?\"*\n- **Yes** → handle directly\n- **No** → delegate to CC via `cc-query.py` or `task spawn`\n- **Not sure** → delegate to CC (cost is $0)\n\nOwns: task execution, GitHub monitoring (cron), weekly synthesis (cron), anomaly detection, project board management.\n\n### Tuor (Co-Founder)\n\nChannel: `#co-founder`. Workspace: `workspace-tuor/`.\n\nOwns: 9-lens strategic briefings, product vision, market research, KB-aware analysis, action pipeline.\n\n### Beren (Chief of Staff)\n\nChannel: `#chief-of-staff`. Workspace: `workspace-beren/`.\n\nOwns: strategic digests (Tue + Fri), meta-orchestration, system evaluation, recommendations.\n\n### Config Tuning (2GB RAM VPS)\n\n```json\n{\n  \"maxConcurrent\": 2,\n  \"subagents\": { \"maxConcurrent\": 4 },\n  \"contextTokens\": 64000,\n  \"thinkingDefault\": \"off\"\n}\n```\n\n- `maxConcurrent: 2` — prevents swap thrashing on 2GB VPS\n- `thinkingDefault: \"off\"` — agents don't need reasoning, saves tokens\n- Idle session reset at 15 minutes bounds context growth costs\n\n---\n\n## Co-Founder System\n\nA scheduled strategic briefing system that runs Claude Code through different \"lenses\" on a cron schedule, posting to a dedicated Discord channel and maintaining a persistent journal.\n\n### How It Works\n\n1. Cron triggers `co-founder-sdk.py \u003clens\u003e` (or on-demand via `/cofounder`)\n2. Reads the lens prompt from `lenses/\u003cname\u003e.md`\n3. Loads relevant KB entries from `knowledge/` (domain, market, etc.)\n4. Feeds the last 100 lines of `journal.md` for continuity\n5. Fetches recent master commit activity (avoids conflicting proposals)\n6. Runs Agent SDK `query()` with Opus 4.6, 10-turn budget\n7. Saves the full briefing to `briefings/\u003clens\u003e-\u003cdate\u003e.md`\n8. Appends to `journal.md` (capped at 1000 lines)\n9. Extracts structured action items (if any)\n10. Posts to Discord `#co-founder` (split at 1900 chars)\n11. **NEW:** Writes new research findings back to `knowledge/`\n\n### Lens Rotation\n\n| Time (AKST) | Days | Lens | Focus |\n|-------------|------|------|-------|\n| 6:00 AM | Mon, Thu | project-pulse | MVP progress, blockers, priorities |\n| 2:00 PM | Mon, Thu | wild-ideas | Creative brainstorming |\n| 2:00 PM | Tue, Fri | architecture | Tech debt, patterns, risks |\n| 1:00 PM | Wed | product-vision | User experience, product direction |\n| 3:00 PM | Wed | customer-support | Support patterns, community |\n| 10:00 AM | Sat | market-research | Competitors, AI news |\n| 11:00 AM | Sat | process-retro | Dev process efficiency |\n| 10:00 AM | Sun | website-audit | Website conversion/UX/SEO |\n| 10:01 AM | 1st \u0026 15th | training-programs | Outreach, partnerships |\n\nEach run gives CC 10 agentic turns. Output is unconstrained — CC writes as much as the analysis warrants. Session IDs are saved for follow-up conversations via `/cofounder followup \u003clens\u003e \u003cquestion\u003e`.\n\n### Action Pipeline\n\nBriefings can optionally produce structured action items. These are quality-gated — most briefings produce zero actions by design. When they do appear:\n\n- Every action becomes a GitHub Issue (source of truth)\n- Revenue-impacting items go to `#quick-wins`, others to `#co-founder`\n- All actions require Patrick's approval before spawning\n- `/cofounder approve \u003cid\u003e` enqueues to the task daemon\n- `/cofounder refine \u003cid\u003e \u003cfeedback\u003e` iterates on the plan via session resumption\n\nSee [ADR-0004](adrs/ADR-0004-co-founder-system.md) and [ADR-0005](adrs/ADR-0005-action-system.md).\n\n---\n\n## Team Lead System\n\nA management layer that sits between strategy (co-founder briefings) and execution (task daemon), providing metrics, synthesis, and proactive task spawning. Runs as two cron jobs (replaced the `openclaw-teamlead.service` daemon — see [ADR-0008](adrs/ADR-0008-three-agent-architecture.md)).\n\n### What It Does\n\n- **Polls GitHub** (cron, every 15min 7AM-10PM) — PRs, CI, issues, Project #4 state\n- **Computes metrics** — fuzzy goal completion %, velocity, cycle time, success rate\n- **Detects anomalies** — stale PRs, broken CI, stuck tasks, goal regression, velocity stalls\n- **Synthesizes weekly** (cron, Monday 9:15 AM) — Agent SDK `query()` with Opus 4.6, 10-turn budget\n- **Auto-spawns tasks** — 100% automatable tasks that map to MVP goals (via spawn policy engine)\n- **On-demand** via `/teamlead` skill\n\n### Fuzzy Goal Completion\n\nGoals are tracked via GitHub Project #4's Status field (\"Goal 1\", \"Goal 2\", \"Goal 3\"). Per-issue weighting:\n\n| Issue State | Weight |\n|-------------|--------|\n| Open, no activity | 0% |\n| Open, active branch commits | 20% |\n| Open, PR in draft | 30% |\n| Open, PR in review / CI running | 70% |\n| PR merged / issue closed | 100% |\n\nEffort labels (`effort:large` = 3x, `effort:medium` = 2x, `effort:small` = 1x) adjust the weighting.\n\n### Progressive Autonomy (3 Tiers)\n\n| Tier | Capabilities |\n|------|-------------|\n| **1** (default) | Observe + recommend. Auto-spawn 100% automatable tasks only. |\n| **2** | Also: reorder queue, spawn follow-ups on stale PRs, flag blockers, kill stuck tasks |\n| **3** | Full queue management: spawn human-in-loop tasks, reprioritize based on goal risk, decompose large tasks |\n\nCurrently running at Tier 1 with spawn policy engine governing per-category autonomy. See Self-Evolving System section above.\n\n### Proactive Velocity Features\n\n- **Unblocked task detection** — when a PR merges, checks what it unblocks and spawns if automatable\n- **Parallelization** — identifies tasks with no mutual dependencies for concurrent execution\n- **Decomposition suggestions** — suggests breaking down stale large tasks into CC-friendly subtasks\n- **Quick win mining** — scans open issues, TODOs, and briefings for small automatable improvements\n\nSee [ADR-0006](adrs/ADR-0006-team-lead-daemon.md) (superseded by [ADR-0008](adrs/ADR-0008-three-agent-architecture.md)).\n\n---\n\n## Self-Evolving System\n\nA self-improvement layer that gives the agent system perception, memory, reasoning, and adaptation. See [ADR-0007](adrs/ADR-0007-self-evolving-system.md).\n\n### Knowledge Base (`knowledge/`)\n\nStructured memory across 6 domains: `domain/`, `market/`, `technical/`, `strategy/`, `self/`, `users/`. Co-founder lenses read relevant KB entries before analysis and write NEW findings back. Seeded from trust ledger analysis, CC session learnings, and prompt archaeology.\n\n### Spawn Policy Engine\n\nPer-category autonomy computed from trust ledger accuracy. Categories auto-graduate (\u003e=80% over 5+) to `auto_spawn` or get demoted (\u003c40% over 5+) to `blocked`. Default is `propose_only`.\n\nTeam-lead uses the policy engine when deciding whether to auto-spawn, propose, or block each candidate. Task daemon updates the policy after every PR outcome.\n\n### Telemetry (`monitor/telemetry.py`)\n\nPassive signal collection running every 15 min in team-lead:\n- PR review latency (time to merge/close)\n- Master commit topic clustering (prevents overlap with Patrick's work)\n- Compute ROI (Opus minutes on merged vs discarded)\n- Discord attention signals (reply counts as engagement proxy)\n\n### Learning Loops\n\n- **Session Learner** (`monitor/session_learner.py`): Analyzes Patrick's interactive CC sessions. Every manual session is a signal that hurin failed to handle something. Extracts capability gaps.\n- **Prompt Archaeology** (`monitor/analyze_prompts.py`): Compares merged vs closed PR prompt characteristics. Identifies what makes a good spawn prompt.\n- Both run weekly after team-lead synthesis.\n\n### Skills\n\n- `/research \u003ctopic\u003e` — Targeted web research, writes findings to KB\n- `/status` — System health + spawn policy + KB summary + telemetry highlights\n\n### Autonomy Tiers\n\n| Tier | Actions | Examples |\n|------|---------|---------|\n| 0 | Fully autonomous | KB updates, telemetry, policy recalc |\n| 1 | Autonomous + notify | auto_spawn tasks, research → KB |\n| 2 | Propose + wait | propose_only tasks, experiments |\n| 3 | Never autonomous | Merge, push, external comms |\n\nCategories graduate between tiers as accuracy improves.\n\n---\n\n## Prompt Caching\n\nhurin's system prompt (SOUL.md, AGENTS.md, TOOLS.md, etc.) is stable across turns. Caching reduces input costs.\n\n- **MiniMax M2.5:** `cacheRetention: \"short\"` (5-min TTL, matches conversation patterns)\n- **Heartbeat:** every 55 min to keep the cache warm\n- **Compaction:** fires at 54K tokens (64K context - 10K reserve floor)\n- **Cache trace:** logged to `logs/cache-trace.jsonl` for cost monitoring\n\nSee [ADR-0002](adrs/ADR-0002-prompt-caching.md).\n\n---\n\n## Discord Channels\n\n| Channel | Agent | Purpose |\n|---------|-------|---------|\n| `#team-lead` | Huor | Primary planning, task execution, synthesis, anomaly alerts |\n| `#tasks` | Huor | Task threads — daemon + cc-query stream progress, thread replies steer/resume tasks |\n| `#co-founder` | Tuor | Strategic briefings from the co-founder system |\n| `#chief-of-staff` | Beren | Strategic digests, system evaluation |\n\nDropped channels: `#planning` (merged into `#team-lead`), `#quick-wins` (paused), `#reviews` (unused).\n\n---\n\n## File Layout\n\n```\n~/.openclaw/                          # This repo (patrickkidd/hurin)\n  .gitattributes                      # git-crypt encryption rules\n  openclaw.json                       # Agent config, Discord bindings, model settings\n  secrets.json                        # API keys (gitignored)\n  git-crypt-key                       # Symmetric encryption key (gitignored — BACK THIS UP)\n  adrs/                               # Architecture Decision Records\n  chief-of-staff/                     # Opus meta-orchestrator\n    chief-of-staff.py                 # Main script\n    digests/                          # Strategic digests (encrypted)\n  co-founder/                         # Co-founder briefing system\n    co-founder.sh                     # Main runner (bash)\n    co-founder-sdk.py                 # Agent SDK runner (Python)\n    lenses/                           # 9+ lens prompt files\n    journal.md                        # Persistent memory (encrypted)\n    briefings/                        # Full briefing archives (encrypted)\n    actions/                          # Parsed action JSON files (encrypted)\n    memory/                           # Co-founder learned patterns (encrypted)\n  decisions/                          # Decision log\n    log.md                            # Strategic decisions (encrypted)\n  monitor/                            # Task execution infrastructure\n    task-daemon.py                    # Main daemon (Agent SDK, async Python)\n    task-cli.sh                       # CLI wrapper (task spawn/watch/kill/etc.)\n    cc-query.py                       # Sync CC wrapper for Mode 1\n    discord_relay.py                  # Discord thread streaming\n    trust_ledger.py                   # Trust tracking + spawn policy engine\n    telemetry.py                      # Passive signal collection\n    session_learner.py                # CC session transcript analyzer\n    analyze_prompts.py                # Prompt archaeology\n    board-reconcile.py                # GitHub project board reconciliation\n    feedback.py                       # Task outcome capture\n    task-logs/                        # JSONL logs per task (encrypted)\n    trust-ledger.json                 # Proposal accuracy tracking (encrypted)\n    channel-threads.json              # Discord thread registry (encrypted)\n    task-queue.json                   # Queue file (gitignored, ephemeral)\n    queue-prompts/                    # Prompt files for queued tasks (gitignored)\n    kill-sentinels/                   # Write \u003cid\u003e.kill to terminate tasks (gitignored)\n  knowledge/                          # Knowledge base (self-evolving system)\n    domain/                           # Bowen theory, genograms\n    market/                           # Competitors, conferences, AI therapy\n    technical/                        # Agent patterns, PR patterns\n    strategy/                         # MVP path, experiments\n    self/                             # Spawn policy, telemetry, capability gaps\n    users/                            # Communities, signals\n    index.md                          # Structure + staleness policy\n    research-log.md                   # Research agenda\n  drafts/                             # Content drafts (COS references)\n  analyses/                           # Analysis outputs\n  skills/                             # OpenClaw skill definitions\n    cofounder/                        # /cofounder skill\n    cos/                              # /cos (chief of staff) skill\n    research/                         # /research skill (KB research)\n    status/                           # /status skill (system dashboard)\n    task/                             # /task skill\n    teamlead/                         # /teamlead skill\n    trust/                            # /trust skill\n  team-lead/                          # Team lead system (cron, not daemon)\n    team_lead.py                      # Library module (importable functions)\n    config.py                         # Thresholds, quiet hours, autonomy tier\n    github-poll.py                    # Cron entry: GitHub poll + anomaly detection\n    github-poll.sh                    # Shell wrapper for cron\n    run-synthesis.py                  # Cron entry: weekly synthesis + auto-spawn\n    manual-synthesis.sh               # Shell wrapper for /teamlead skill + cron\n    anomaly-cooldowns.json            # Persisted anomaly cooldown state\n    syntheses/                        # Saved synthesis outputs (encrypted)\n  agents/                             # Per-agent OpenClaw configs\n    huor/agent/models.json            # MiniMax model definitions\n    tuor/agent/models.json\n    beren/agent/models.json\n  workspace-hurin/                     # Platform workspace (code checkouts)\n    theapp/                           # Monorepo (gitignored, checked out separately)\n      .clawdbot/active-tasks.json     # Task registry\n      btcopilot/, familydiagram/, fdserver/\n  workspace-huor/                     # Huor (Team Lead) agent workspace\n    SOUL.md, AGENTS.md, USER.md, TOOLS.md, IDENTITY.md, HEARTBEAT.md\n    PROJECT-BOARD-RULES.md\n  workspace-tuor/                     # Tuor (Co-Founder) agent workspace\n    SOUL.md, AGENTS.md, USER.md, TOOLS.md, IDENTITY.md\n  workspace-beren/                    # Beren (Chief of Staff) agent workspace\n    SOUL.md, AGENTS.md, USER.md, TOOLS.md, IDENTITY.md\n  workspace/                          # OpenClaw default workspace (templates)\n  archive/                            # Archived configs: teamlead-daemon-v1, agents-beren/tuor, monitor-v1\n```\n\n---\n\n## Worktree Strategy\n\nEach background task gets its own git worktree for isolation:\n- **Default:** symlink `.venv` from the main repo (0 bytes, instant)\n- **Dependency changes:** `uv sync` (fast via uv's hardlink cache)\n- **Capacity:** 2 concurrent worktrees fit on 2GB VPS (maxConcurrent: 2)\n- **Cleanup:** automatic after PR creation\n\n---\n\n## GitHub Project Board\n\nAll work is tracked on [GitHub Project #4](https://github.com/users/patrickkidd/projects/4) (\"Family Diagram\"). Goals are encoded as Status field values (\"Goal 1\", \"Goal 2\", \"Goal 3\"), not milestones.\n\nKey labels across all three product repos:\n- `co-founder`, `cf-spawned`, `cf-approved`, `cf-done`, `cf-pr-open` — co-founder system lifecycle\n- `velocity` — team-lead-spawned quick wins\n- `effort:small/medium/large` — used for weighted goal completion %\n- `reviewed-by-claude` — PR has been auto-reviewed\n\nSub-issues model dependencies within a milestone. Priority (P0-P3) encodes execution order. Same-priority issues are parallelizable.\n\n---\n\n## Administration\n\n### Health Check\n\n```bash\nopenclaw doctor\nopenclaw agents list              # Should show huor, tuor, beren\nopenclaw channels status --probe  # Live Discord connectivity\n```\n\n### Restart Services\n\n```bash\nopenclaw gateway restart\nsystemctl --user restart openclaw-taskdaemon\n# Team lead runs via cron, no service to restart\n```\n\n### Monitor Tasks\n\n```bash\ntask list                          # All tasks\ntask status \u003cid\u003e                   # Single task detail\ntask watch \u003cid\u003e                    # Live log tail\n```\n\n### Check Logs\n\n```bash\ntail ~/.openclaw/monitor/daemon.log        # Task daemon\ntail ~/.openclaw/team-lead/daemon.log      # Team lead\ntail ~/.openclaw/co-founder/cron.log       # Co-founder runs\ntail ~/.openclaw/logs/cache-trace.jsonl    # Prompt cache health\n```\n\n---\n\n## Architecture Decision Records\n\n| ADR | Status | Summary |\n|-----|--------|---------|\n| [ADR-0001](adrs/ADR-0001-agent-swarm.md) | Accepted | 2-tier agent architecture (hurin router + Claude Code brain) |\n| [ADR-0002](adrs/ADR-0002-prompt-caching.md) | Accepted | Prompt caching: short TTL, heartbeat keep-warm, cache diagnostics |\n| [ADR-0003](adrs/ADR-0003-hurin-lockdown-validation.md) | Accepted | Hurin tool lockdown after autonomous action incident |\n| [ADR-0004](adrs/ADR-0004-co-founder-system.md) | Accepted | Co-founder strategic briefing system (9 lenses, journal memory) |\n| [ADR-0005](adrs/ADR-0005-action-system.md) | Accepted | Quality-gated action pipeline with approval flow |\n| [ADR-0006](adrs/ADR-0006-team-lead-daemon.md) | Superseded | Team lead daemon: metrics, synthesis, auto-spawning (daemon replaced by cron in ADR-0008) |\n| [ADR-0007](adrs/ADR-0007-self-evolving-system.md) | Accepted | Self-evolving system: KB, telemetry, spawn policy, learning loops |\n| [ADR-0008](adrs/ADR-0008-three-agent-architecture.md) | Accepted | Three-agent architecture (Huor/Tuor/Beren) + daemon decomposition |\n\n---\n\n## Security Notes\n\n- **Secrets** live in `secrets.json` (gitignored). Keys: `anthropic-api-key`, `minimax-api-key`, `discord-bot-token`, `huor-discord-bot-token`, `tuor-discord-bot-token`, `beren-discord-bot-token`.\n- **Bot account:** `patrickkidd-hurin` (GitHub PAT in `monitor/hurin-bot-token`, also gitignored).\n- **Sandbox mode:** off (trusted local machine).\n- **`bypassPermissions`** on Agent SDK calls — appropriate for local execution.\n- **This repo is public.** Never commit secrets, tokens, or API keys to tracked files.\n\n### git-crypt (Encrypted Files)\n\nThis repo uses [git-crypt](https://github.com/AGWA/git-crypt) to encrypt sensitive operational data in-place. Source code, configs, skills, and architecture docs remain publicly readable. Briefings, syntheses, digests, telemetry, task logs, and the decision log are encrypted — anyone without the key sees binary blobs.\n\nSee `.gitattributes` for the full list of encrypted paths.\n\n#### Key Backup \u0026 Restore\n\nThe symmetric key is at `~/.openclaw/git-crypt-key` (gitignored). **Back it up alongside your other secrets:**\n\n```bash\n# Back up (copy next to your other secrets)\ncp ~/.openclaw/git-crypt-key ~/.ssh/git-crypt-key.bak\n\n# Restore on a new machine\ngit clone git@github.com:patrickkidd/hurin.git ~/.openclaw\ngit-crypt unlock /path/to/git-crypt-key\n```\n\nWithout the key, encrypted files appear as binary blobs. With it, everything is transparently decrypted on checkout. There is no password — **the key file IS the secret.**\n\n**All secrets to back up:**\n\n| Secret | Location |\n|--------|----------|\n| SSH keys | `~/.ssh/` |\n| API keys | `~/.openclaw/secrets.json` |\n| git-crypt key | `~/.openclaw/git-crypt-key` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickkidd%2Fhurin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickkidd%2Fhurin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickkidd%2Fhurin/lists"}