# localharness - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for localharness. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0002` supported 0.86

## What It Can Do

- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `README.md` Claim: `clm_0001` supported 0.86

## How to Start

- `git clone https://github.com/ahwurm/localharness.git` Evidence: `README.md` Claim: `clm_0003` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Trial role matching first
- **Why**: This project is more of a role library; the core risk is picking the wrong role or treating role copy as execution capability. Trial role matching with Prompt Preview first, then decide whether to sandbox-import it.

### 30-Second Read

- **What to do now**: Trial role matching first
- **Minimum safe next step**: Trial role matching with Prompt Preview first; import in isolation only once satisfied
- **Do not trust yet**: Role quality and task fit cannot be trusted directly.
- **Continuing will touch**: Role selection bias, Command execution, Local environment or project files

### What You Can Trust Now

- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `README.md` Claim: `clm_0001` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0003` supported 0.86

### What You Cannot Trust Yet

- **Role quality and task fit cannot be trusted directly.** (unverified): A role library proves there are many roles; it does not prove each one fits your specific task or that a role produces high-quality results.
- **Do not treat role copy as real execution capability.** (unverified): Before install you can only judge whether the role description and task profile match; you cannot prove it can complete the task inside the host AI.
- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior.
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.

### What Continuing Will Touch

- **Role selection bias**: The user's judgment about which expert role should handle the task. Why: Picking the wrong role makes the AI answer from the wrong expert perspective, wasting time or misleading decisions.
- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `README.md`
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `README.md`
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use an interactive trial to verify the task profile and role match first; do not import the whole role library up front. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Keep a record of the original role selection**: If output goes off-topic, you can return to the task-profiling stage and reselect a role instead of pushing on with the wrong one.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0004` inferred 0.45
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `README.md` Claim: `clm_0005` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `README.md` Claim: `clm_0001` supported 0.86

### Context Scale

- Total files: 202
- Important-file coverage: 40/202
- Evidence index entries: 75
- Role / Skill entries: 25

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for localharness, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat localharness as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for localharness, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 25 role / Skill / project-doc entries.

- **Reference Architectures** (project_doc): LocalHarness is developed and tested against two concrete hardware targets. Every harness default should work out of the box on both; per-hardware setup and tuning notes are in gaps.md gaps.md . Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/reference-architectures/README.md`
- **LocalHarness** (project_doc): ! GitHub stars https://img.shields.io/github/stars/ahwurm/localharness?style=social https://github.com/ahwurm/localharness/stargazers ! License: MIT https://img.shields.io/badge/License-MIT-blue.svg LICENSE Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **Examples** (project_doc): Runnable, validated examples of LocalHarness configuration. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `examples/README.md`
- **Contributing** (project_doc): Thanks for considering a contribution to LocalHarness. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CONTRIBUTING.md`
- **Running agents locally: where LocalHarness fits** (project_doc): Running agents locally: where LocalHarness fits Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/running-agents-locally.md`
- **Reference Architecture A — NVIDIA DGX Spark** (project_doc): Reference Architecture A — NVIDIA DGX Spark Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/reference-architectures/dgx-spark.md`
- **Setup & Tuning Notes — Reference Architectures** (project_doc): Setup & Tuning Notes — Reference Architectures Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/reference-architectures/gaps.md`
- **Reference Architecture B — Base Mac mini** (project_doc): Reference Architecture B — Base Mac mini Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/reference-architectures/mac-mini.md`
- **Spec 00: Architecture Overview** (project_doc): Project: LocalHarness Version: v1 Status: Authoritative — implement against this document Last updated: 2026-05-23 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/00-architecture-overview.md`
- **Spec 01: Event Bus** (project_doc): Project: LocalHarness Component: core/events.py , core/bus.py , core/types.py Layer: 1 Foundation Status: Authoritative — implement against this document Last updated: 2026-05-23 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/01-event-bus.md`
- **Spec 02: LLM Provider Layer** (project_doc): Component: src/localharness/provider/ Requirements: PROV-01, PROV-02, PROV-03, PROV-04, SETUP-01, SETUP-02, SETUP-03 Dependencies: core/types.py , config/models.py Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/02-provider.md`
- **Spec 03: Agent Loop** (project_doc): Component: src/localharness/agent/loop.py Requirements: LOOP-01, LOOP-02, LOOP-03, LOOP-04, LOOP-05 Dependencies: core/events.py , core/bus.py , core/types.py , config/models.py , provider/client.py , tools/registry.py , tools/hooks.py , agent/context.py , agent/permissions.py , memory/history.py Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/03-agent-loop.md`
- **Spec 04: Tool System** (project_doc): Component: src/localharness/tools/ Requirements covered: TOOL-01, TOOL-02, TOOL-03, TOOL-04 Dependencies: core/events.py , config/models.py Stability: UNSTABLE v1 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/04-tool-system.md`
- **Spec 04b: MCP Integration** (project_doc): Component: src/localharness/tools/mcp.py Requirements covered: TOOL-05 Dependencies: tools/registry.py spec 04 , config/models.py , core/events.py Library: mcp official Python SDK , Python 3.12+ Stability: UNSTABLE v1 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/04b-mcp-integration.md`
- **Spec 05: Memory System** (project_doc): Component: src/localharness/memory/ + cli/session accumulator.py Requirements: MEM-01..04, WRITE-01..06, RANK-01..05, HIER-02..04, CONS-01..06, COLL-01..04, PGATE-01..04, SESS-02..05, TIME-01..04 Status: v2 predictive — supersedes the v1 three-tier-scope spec Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/05-memory.md`
- **Spec 06: Configuration System** (project_doc): Project: LocalHarness Component: config/models.py , config/loader.py , config/defaults.py Layer: 1 models + 2 loader Status: Authoritative — implement against this document Last updated: 2026-05-23 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/06-config.md`
- **Spec 07: Orchestrator** (project_doc): Component: src/localharness/orchestrator/ Requirements: ORCH-01, ORCH-02, ORCH-03, ORCH-04 Status: v1 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/07-orchestrator.md`
- **Spec 08: Context Management** (project_doc): Component: src/localharness/agent/context.py Requirements: CTX-01, CTX-02, CTX-03, LOOP-02 Dependencies: core/types.py , config/models.py , provider/client.py Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/08-context-management.md`
- **Spec 09: Hooks and Plugins** (project_doc): Component: src/localharness/tools/hooks.py , src/localharness/plugins/ Requirements covered: HOOK-01, HOOK-02, HOOK-03 Dependencies: tools/registry.py spec 04 , core/events.py Library: pluggy 1.6.0, importlib.metadata stdlib Stability: UNSTABLE v1 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/09-hooks-plugins.md`
- **Spec 10: CLI** (project_doc): Component: src/localharness/cli/ Requirements: CLI-01, CLI-02, CLI-03, CLI-04, CLI-05, CLI-06, SETUP-01, SETUP-02, SETUP-03, SETUP-04, CHAN-01, CHAN-02 Status: v1 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/10-cli.md`
- **Spec 11: Channel System** (project_doc): Component: src/localharness/channels/ Requirements: CHAN-01, CHAN-02, CHAN-03 Status: v1 TerminalChannel only; Discord/Slack/webhook deferred to v2 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/11-channels.md`
- **Spec 12: Audit & Observability** (project_doc): Component: src/localharness/audit/ Requirements: v1 structlog JSONL , v2 hash-chained audit, GUARDRAILS.md Status: v1 core + v2 design spec Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/specs/12-audit.md`
- **Changelog** (project_doc): All notable changes to LocalHarness are documented here. The format follows Keep a Changelog https://keepachangelog.com/ , and the project adheres to Semantic Versioning https://semver.org/ pre-1.0: interfaces may change . Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CHANGELOG.md`
- **Code of Conduct** (project_doc): LocalHarness adopts the Contributor Covenant https://www.contributor-covenant.org , version 2.1, as its Code of Conduct. The full text is published at . Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CODE_OF_CONDUCT.md`
- **Security Policy** (project_doc): LocalHarness is early-stage v0.x . Security fixes land on the latest main ; there are no long-term-support branches yet. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `SECURITY.md`

## Evidence Index

- Indexed 75 evidence entries.

- **Reference Architectures** (documentation): LocalHarness is developed and tested against two concrete hardware targets. Every harness default should work out of the box on both; per-hardware setup and tuning notes are in gaps.md gaps.md . Evidence: `docs/reference-architectures/README.md`
- **LocalHarness** (documentation): ! GitHub stars https://img.shields.io/github/stars/ahwurm/localharness?style=social https://github.com/ahwurm/localharness/stargazers ! License: MIT https://img.shields.io/badge/License-MIT-blue.svg LICENSE Evidence: `README.md`
- **Examples** (documentation): Runnable, validated examples of LocalHarness configuration. Evidence: `examples/README.md`
- **Contributing** (documentation): Thanks for considering a contribution to LocalHarness. Evidence: `CONTRIBUTING.md`
- **License** (source_file): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Evidence: `LICENSE`
- **Running agents locally: where LocalHarness fits** (documentation): Running agents locally: where LocalHarness fits Evidence: `docs/running-agents-locally.md`
- **Reference Architecture A — NVIDIA DGX Spark** (documentation): Reference Architecture A — NVIDIA DGX Spark Evidence: `docs/reference-architectures/dgx-spark.md`
- **Setup & Tuning Notes — Reference Architectures** (documentation): Setup & Tuning Notes — Reference Architectures Evidence: `docs/reference-architectures/gaps.md`
- **Reference Architecture B — Base Mac mini** (documentation): Reference Architecture B — Base Mac mini Evidence: `docs/reference-architectures/mac-mini.md`
- **Spec 00: Architecture Overview** (documentation): Project: LocalHarness Version: v1 Status: Authoritative — implement against this document Last updated: 2026-05-23 Evidence: `docs/specs/00-architecture-overview.md`
- **Spec 01: Event Bus** (documentation): Project: LocalHarness Component: core/events.py , core/bus.py , core/types.py Layer: 1 Foundation Status: Authoritative — implement against this document Last updated: 2026-05-23 Evidence: `docs/specs/01-event-bus.md`
- **Spec 02: LLM Provider Layer** (documentation): Component: src/localharness/provider/ Requirements: PROV-01, PROV-02, PROV-03, PROV-04, SETUP-01, SETUP-02, SETUP-03 Dependencies: core/types.py , config/models.py Evidence: `docs/specs/02-provider.md`
- **Spec 03: Agent Loop** (documentation): Component: src/localharness/agent/loop.py Requirements: LOOP-01, LOOP-02, LOOP-03, LOOP-04, LOOP-05 Dependencies: core/events.py , core/bus.py , core/types.py , config/models.py , provider/client.py , tools/registry.py , tools/hooks.py , agent/context.py , agent/permissions.py , memory/history.py Evidence: `docs/specs/03-agent-loop.md`
- **Spec 04: Tool System** (documentation): Component: src/localharness/tools/ Requirements covered: TOOL-01, TOOL-02, TOOL-03, TOOL-04 Dependencies: core/events.py , config/models.py Stability: UNSTABLE v1 Evidence: `docs/specs/04-tool-system.md`
- **Spec 04b: MCP Integration** (documentation): Component: src/localharness/tools/mcp.py Requirements covered: TOOL-05 Dependencies: tools/registry.py spec 04 , config/models.py , core/events.py Library: mcp official Python SDK , Python 3.12+ Stability: UNSTABLE v1 Evidence: `docs/specs/04b-mcp-integration.md`
- **Spec 05: Memory System** (documentation): Component: src/localharness/memory/ + cli/session accumulator.py Requirements: MEM-01..04, WRITE-01..06, RANK-01..05, HIER-02..04, CONS-01..06, COLL-01..04, PGATE-01..04, SESS-02..05, TIME-01..04 Status: v2 predictive — supersedes the v1 three-tier-scope spec Evidence: `docs/specs/05-memory.md`
- **Spec 06: Configuration System** (documentation): Project: LocalHarness Component: config/models.py , config/loader.py , config/defaults.py Layer: 1 models + 2 loader Status: Authoritative — implement against this document Last updated: 2026-05-23 Evidence: `docs/specs/06-config.md`
- **Spec 07: Orchestrator** (documentation): Component: src/localharness/orchestrator/ Requirements: ORCH-01, ORCH-02, ORCH-03, ORCH-04 Status: v1 Evidence: `docs/specs/07-orchestrator.md`
- **Spec 08: Context Management** (documentation): Component: src/localharness/agent/context.py Requirements: CTX-01, CTX-02, CTX-03, LOOP-02 Dependencies: core/types.py , config/models.py , provider/client.py Evidence: `docs/specs/08-context-management.md`
- **Spec 09: Hooks and Plugins** (documentation): Component: src/localharness/tools/hooks.py , src/localharness/plugins/ Requirements covered: HOOK-01, HOOK-02, HOOK-03 Dependencies: tools/registry.py spec 04 , core/events.py Library: pluggy 1.6.0, importlib.metadata stdlib Stability: UNSTABLE v1 Evidence: `docs/specs/09-hooks-plugins.md`
- **Spec 10: CLI** (documentation): Component: src/localharness/cli/ Requirements: CLI-01, CLI-02, CLI-03, CLI-04, CLI-05, CLI-06, SETUP-01, SETUP-02, SETUP-03, SETUP-04, CHAN-01, CHAN-02 Status: v1 Evidence: `docs/specs/10-cli.md`
- **Spec 11: Channel System** (documentation): Component: src/localharness/channels/ Requirements: CHAN-01, CHAN-02, CHAN-03 Status: v1 TerminalChannel only; Discord/Slack/webhook deferred to v2 Evidence: `docs/specs/11-channels.md`
- **Spec 12: Audit & Observability** (documentation): Component: src/localharness/audit/ Requirements: v1 structlog JSONL , v2 hash-chained audit, GUARDRAILS.md Status: v1 core + v2 design spec Evidence: `docs/specs/12-audit.md`
- **Init** (source_file): version = "0.9.23" ⋮---- def resolved version - str Evidence: `src/localharness/__init__.py`
- **Init** (source_file): all = Evidence: `src/localharness/agent/__init__.py`
- **These runtimes serve NO /tokenize Ollama: /api/ only; LM Studio: none** (source_file): log = logging.getLogger "localharness.agent.context" ⋮---- RESPONSE RESERVE TOKENS: int = 4096 ⋮---- WEB EVICT USAGE FRACTION: float = 0.50 WEB EVICT KEEP LAST: int = 2 WEB EVICT MIN CHARS: int = 500 WEB TOOLS = frozenset {"web fetch", "web search"} WEB STUB PREFIX = " web output omitted" ⋮---- TOOL EVICT USAGE FRACTION: float = 0.50 TOOL EVICT KEEP LAST: int = 3 TOOL EVICT THRESHOLD CHARS: int = 8 000 TOOL STUB PREFIX = " tool result evicted" ⋮---- MAX COMPACTION FIRES PER TURN: int = 3 COMPACTION TARGET USAGE FRACTION: float = 0.60 ⋮---- Origin = Literal "trusted", "untrusted" STORE WEB MAX: int = 32 ⋮---- def content handle content: str - str ⋮---- class ContentStore ⋮---- def put self,… Evidence: `src/localharness/agent/context.py`
- **91: index into messages where THIS turn's assistant replies begin set right after the** (source_file): log = logging.getLogger "localharness.agent.loop" ⋮---- @dataclass class Session ⋮---- agent id: str session id: str messages: list Message iteration: int = 0 actions taken: int = 0 start time: float = field default factory=time.monotonic tool call log: list dict str, Any = field default factory=list summary: str = "" terminated reason: str None = None parse retries: int = 0 input tokens: int = 0 output tokens: int = 0 tokens estimated: bool = False act nudge used: bool = False 91: index into messages where THIS turn's assistant replies begin set right after the turn's user task is pushed . The CONFIRMED-sentinel summary fallback searches ONLY messages turn start idx: , so it can never spli… Evidence: `src/localharness/agent/loop.py`
- **Bare tool name pattern — any call to this tool is denied** (source_file): @dataclass class PermissionResult ⋮---- denied: bool reason: str = "" ⋮---- class PermissionEvaluator ⋮---- """Evaluates tool calls against deny patterns from PermissionConfig.""" ⋮---- def evaluate self, tool call: ToolCall, permissions: object - PermissionResult ⋮---- """Return PermissionResult denied=True if any deny pattern matches. Pattern format: 'tool name' or 'tool name arg glob ' Matching: tool name must match exactly; if arg glob present, any string value in tool call.arguments must match via fnmatch. """ deny patterns: list str = getattr permissions, "deny patterns", ⋮---- match = re.match r"^ a-z a-z0-9 ?:\ .+ \ ?$", pattern ⋮---- Bare tool name pattern — any call to this tool i… Evidence: `src/localharness/agent/permissions.py`
- **--- Cruncher J3 : faithful over-window reduce via harness-orchestrated map + model reduce -------** (source_file): log = logging.getLogger "localharness.agent.subagent" ⋮---- EXPLORE TOOLS: list str = "read", "glob", "grep" ⋮---- EXPLORE MAX ACTIONS = 8 EXPLORE MAX TOOL CALLS = EXPLORE MAX ACTIONS + 1 EXPLORE MAX DURATION MINUTES = 3.0 ⋮---- MAX DEPTH = 1 ⋮---- NON LEAF AGENTS: dict str, list str = {"web-researcher": "search-verifier" } ⋮---- EXPLORE ROLE = ⋮---- WEB TOOLS: list str = "web search", "web fetch", "web page query" ⋮---- WEB MAX ACTIONS = 56 WEB MAX TOOL CALLS = WEB MAX ACTIONS + 1 WEB MAX DURATION MINUTES = 20.0 ⋮---- WEB RESEARCHER ROLE BASE = ⋮---- WEB RESEARCHER VERIFY ADDENDUM = ⋮---- WEB RESEARCHER VERIFY ON REQUEST ADDENDUM = ⋮---- WEB RESEARCHER ROLE = WEB RESEARCHER ROLE BASE ⋮----… Evidence: `src/localharness/agent/subagent.py`
- **Init** (source_file): all = "ArchiveStore", "ArchiveEntry", "ArchiveQuery" Evidence: `src/localharness/autoresearch/__init__.py`
- **---------------------------------------------------------------------------** (source_file): CIRCUIT BREAKER N = 4 ⋮---- DEFAULT MAX ITERATIONS = 1000 ⋮---- def interpret exit code: int, entry, min lift: float None - tuple str, str ⋮---- lift = entry.train score if entry is not None else None ⋮---- @dataclass class RunSummary ⋮---- """The terminal artifact of a run: counts + consumption + the journal path. halt reason is one of "budget" "circuit breaker" "interrupt" "complete". top wins is a list of archive id, component, train score for the run-complete report. """ ⋮---- run id: str iterations: int = 0 adopted: int = 0 held: int = 0 rejected: int = 0 skipped: int = 0 failures: int = 0 seconds elapsed: float = 0.0 tokens spent: int = 0 top wins: list = field default factory=list jo… Evidence: `src/localharness/autoresearch/loop.py`
- **Init** (source_file): all = Evidence: `src/localharness/channels/__init__.py`
- **Input Router** (source_file): log = logging.getLogger name ⋮---- CompleteFn = Callable list dict , Awaitable str ⋮---- class Route str, Enum ⋮---- NUDGE = "nudge" QUEUE = "queue" ⋮---- @dataclass frozen=True class Decision ⋮---- route: Route tier: str reason: str ⋮---- FORCE PREFIX = "!" ⋮---- def strip force text: str - tuple str, bool ⋮---- FILLERS = frozenset {"ok", "okay", "hey", "please", "um", "uh", "yeah", "so", "hmm", "well"} ⋮---- NUDGE INITIAL = frozenset { ⋮---- QUEUE INITIAL = frozenset { ⋮---- CORRECTION RE = re.compile ⋮---- NEG AUX = frozenset { ⋮---- def has correction low: str - bool ⋮---- words = re.findall r" \w'./- +", low ⋮---- QUEUE PHRASE RE = re.compile ⋮---- def content words low: str - list str… Evidence: `src/localharness/channels/input_router.py`
- **38: reached but the reply isn't a model list — its OWN message, not "Is it running?".** (source_file): console = Console err console = Console stderr=True ⋮---- loader = ConfigLoader config dir=config dir ⋮---- harness = loader.load harness ⋮---- provider = harness.provider ⋮---- 38: reached but the reply isn't a model list — its OWN message, not "Is it running?". ⋮---- downloaded: list str = ⋮---- downloaded = m for m in managed server.list cached models if m not in live choices = live + downloaded current = provider.default model ⋮---- --- List --- ⋮---- mark = " active " if m == current else "" ⋮---- 50: a reachable server whose served/downloaded set omits the configured default otherwise shows NO active marker and no other signal — the moment of highest risk checking in on an unverified… Evidence: `src/localharness/cli/model_cmd.py`
- **Init** (source_file): all = Evidence: `src/localharness/core/__init__.py`
- **Bus** (source_file): log = structlog.get logger name ⋮---- E = TypeVar "E", bound=BaseEvent ⋮---- AsyncHandler = Callable Any , Coroutine Any, Any, None ⋮---- Handler = Callable Any , Any ⋮---- class SubscriptionHandle ⋮---- def init self, event key: str, wrapped handler: AsyncHandler - None ⋮---- class EventBus ⋮---- async def publish self, event: BaseEvent - AnyEvent ⋮---- seq = EventSeq self. next seq ⋮---- sequenced: AnyEvent = event.model copy update={"seq": seq} ⋮---- session file = self. session dir / f"{sequenced.session id}.jsonl" ⋮---- event key = type sequenced . name ⋮---- async def append jsonl self, path: Path, event: BaseEvent - None ⋮---- line = event.model dump json + "\n" ⋮---- async def deliv… Evidence: `src/localharness/core/bus.py`
- **Events** (source_file): class BaseEvent BaseModel ⋮---- model config = ConfigDict frozen=True ⋮---- id: str = Field default factory=lambda: str uuid.uuid4 seq: Optional EventSeq = Field default=None timestamp: datetime = Field default factory=lambda: datetime.now timezone.utc agent id: Optional AgentID = Field default=None session id: Optional SessionID = Field default=None parent id: Optional str = Field default=None ⋮---- class SystemReady BaseEvent ⋮---- event type: str = "SystemReady" config path: str provider base url: str provider type: Literal "ollama", "vllm", "llama cpp", "lm studio", "unknown" detected models: list str ⋮---- class AgentCreated BaseEvent ⋮---- event type: str = "AgentCreated" agent id: Ag… Evidence: `src/localharness/core/events.py`
- **Reduce** (source_file): @dataclass frozen=True class ReduceLevel ⋮---- level: int batches: list list str outputs: list str ⋮---- def batch by budget items: list str , budget: int - list list str ⋮---- batches: list list str = cur: list str = clen = 0 ⋮---- level = 0 trace: list ReduceLevel = ⋮---- batches = batch by budget items, budget ⋮---- outputs: list str = ⋮---- items = outputs Evidence: `src/localharness/core/reduce.py`
- **Types** (source_file): AgentID = NewType "AgentID", str SessionID = NewType "SessionID", str EventSeq = NewType "EventSeq", int ToolCallID = NewType "ToolCallID", str DivisionID = NewType "DivisionID", str OrgID = NewType "OrgID", str ⋮---- Message = dict str, Any ⋮---- ToolSchema = dict str, Any ⋮---- @dataclass class ToolCall ⋮---- name: str arguments: dict str, Any id: str = "" Evidence: `src/localharness/core/types.py`
- **Init** (source_file): all = Evidence: `src/localharness/memory/__init__.py`
- **Run-2 ruling 4 observability : EVERY chapter-writer attempt written or rejected, with** (source_file): log = logging.getLogger name ⋮---- WATERMARK KEY = "consolidation/last run" DEMOTED RS = 0.15 PROMOTED CONFIDENCE = 0.8 CLASSIFY BACKFILL CAP = 10 MICRO CLASSIFY CAP = 5 MICRO NAME CAP = 2 ⋮---- @dataclass class ConsolidationReport ⋮---- folded: int = 0 promoted: int = 0 decayed: int = 0 demoted: int = 0 replayed claims: int = 0 schemas written: int = 0 ⋮---- chapters folded: int = 0 chapters superseded by containment: int = 0 ⋮---- chapters absorption refused: int = 0 ⋮---- chapters revalidated: int = 0 chapters redrafted stale: int = 0 chapters retired stale: int = 0 ⋮---- chapters skipped stale: int = 0 reconciled: int = 0 mined: int = 0 tags proposed: int = 0 tags incorporated: int = 0… Evidence: `src/localharness/memory/consolidation.py`
- **Rename the candidate in place AND replace the "discovery candidate unincorporated "** (source_file): log = logging.getLogger name ⋮---- NAME MARKER = "Name this group of related memories" ⋮---- EMBED SIM = 0.55 MIN FACTORS = 2 FLOOR MEMBERS = 2 FLOOR SITTINGS = 2 INCORPORATE SCORE = 3.0 DECAY HALF LIFE S = 14 86400 PRUNE REUSE FLOOR = 0.5 PRUNE AGE S = 21 86400 MATCH JACCARD = 0.5 NAME MEMBERS SHOWN = 8 ⋮---- TRACE FANOUT CAP = 10 ⋮---- @dataclass class DiscoveryReport ⋮---- proposed: list str = field default factory=list incorporated: list str = field default factory=list merged: list str = field default factory=list pruned: list str = field default factory=list ⋮---- def is sitting prov: str - bool ⋮---- def cosine u: list float , v: list float - float ⋮---- dot = sum a b for a, b in zip… Evidence: `src/localharness/memory/discovery.py`
- **Payload-first dogfood 2026-07-02 : the index/search render ~100** (source_file): log = logging.getLogger name ⋮---- TIER CONFIDENCE = { PREVIEW CHARS = 160 ⋮---- def h8 parts: str - str ⋮---- def preview text: str None - str ⋮---- one = " ".join text or "" .split ⋮---- class WriteGate ⋮---- """Subscribes to the agent's bus events and writes gated fact candidates. Wired beside MemoryStore at startup start cmd when agent.memory.write gate enabled default True — config-off like the cruncher . """ ⋮---- def init self, store: "MemoryStore", bus: "EventBus", agent id: str - None ⋮---- PENDING TTL S = 2 3600.0 ⋮---- async def open self - None ⋮---- async def close self - None ⋮---- async def on observation self, event: "Observation" - None ⋮---- now = time.monotonic ⋮---- err… Evidence: `src/localharness/memory/gate.py`
- **Predictive Gate** (source_file): log = logging.getLogger name ⋮---- class PredictiveGate ⋮---- async def open self - None ⋮---- async def close self - None ⋮---- async def on action self, event: "Action" - None ⋮---- prior = await self. store.get tool prior event.tool name ⋮---- async def on observation self, event: "Observation" - None ⋮---- pending = self. pending.pop event.tool call id, None ⋮---- duration ms = max 0, int event.timestamp - action ts .total seconds 1000 is error = 1 if event.error is not None else 0 output len = len event.output or "" capped at 200 upstream 34-01 schema note ts = int event.timestamp.timestamp obs row id = await self. store.record tool observation ⋮---- min n = self. cfg.min prior n err s… Evidence: `src/localharness/memory/predictive_gate.py`
- **BUG 45 relatedness floor: a correction may only dispute a STAGED fact it is actually ABOUT —** (source_file): log = logging.getLogger name ⋮---- STAT WRITE QUADRANT = "surprising failure" CORRECTION WRITE FAMILIES = frozenset {"negation", "correction phrase"} ⋮---- def should write stat quadrant: str - bool ⋮---- def graded confidence score: float - float ⋮---- def correction in scope family: str None - bool ⋮---- STAT TIER TAG = "tier:surprising failure" CORRECTION TIER TAG = "tier:correction pending" SUSPECT SUPERSEDE CONFIDENCE = 0.6 QUARANTINE CONFIDENCE = 0.65 ⋮---- DISPUTE MARKER = " disputed by user correction — pending reconciliation " ⋮---- def h8 parts: str - str ⋮---- def preview text: str None, n: int = 180 - str ⋮---- one = " ".join text or "" .split ⋮---- BUG 45 relatedness floor: a c… Evidence: `src/localharness/memory/predictive_write_gate.py`
- **v2 supersede-not-overwrite : 'active' 'superseded'; superseded rows stay queryable** (source_file): log = logging.getLogger name ⋮---- @dataclass frozen=True class Fact ⋮---- key: str value: str agent id: str division id: str = "" org id: str = "" tags: list str = field default factory=list confidence: float = 1.0 source: str = "" created at: int = 0 updated at: int = 0 expires at: int None = None v2 supersede-not-overwrite : 'active' 'superseded'; superseded rows stay queryable via get fact history / include superseded but leave every hot path. status: str = "active" superseded by: int None = None ⋮---- provenance: str = "" id: int = 0 v3 RANK : trust/accessibility split + ACT-R use-counters + graph node kind. retrieval strength: float = 0.5 importance: float = 0.0 access count: int = 0… Evidence: `src/localharness/memory/sqlite.py`
- **Check ambiguity: top-2 within 0.10 delta** (source_file): class AgentCard BaseModel ⋮---- model config = ConfigDict frozen=True ⋮---- agent id: str name: str division id: str = "default" org id: str = "default" version: int = 1 ⋮---- description: str capabilities: list str = keywords: list str = input types: list str = "task description" output types: list str = "markdown report" example tasks: list str = ⋮---- model: str = "inherit" avg duration seconds: float = 0.0 avg action count: float = 0.0 success rate: float = 1.0 last session at: str None = None ⋮---- max context tokens: int = DEFAULT MAX CONTEXT TOKENS budget max actions: int = 100 budget max duration minutes: float = 30.0 ⋮---- status: Literal "active", "paused", "error" = "active" ⋮---… Evidence: `src/localharness/orchestrator/cards.py`
- **Router** (source_file): class AgentCreationFlow ⋮---- def init self, card registry: AgentCardRegistry - None ⋮---- @staticmethod def no config message - str ⋮---- def begin agent creation self, config dir: Path None = None - "AgentCreationWorkflow" ⋮---- @property def active workflow self - "AgentCreationWorkflow None" Evidence: `src/localharness/orchestrator/router.py`
- **Init** (source_file): all = Evidence: `src/localharness/provider/__init__.py`
- **---------------------------------------------------------------------------** (source_file): fcntl = None ⋮---- log = logging.getLogger name ⋮---- DEFAULT QUEUE WAIT SECONDS = 600.0 ⋮---- @dataclass class LLMConfig ⋮---- base url: str model: str api key: str = "none" ⋮---- timeout seconds: float = 600.0 connect timeout seconds: float = 5.0 ⋮---- queue wait seconds: float None = DEFAULT QUEUE WAIT SECONDS temperature: float = 0.6 max tokens: int = 4096 tool call mode: Literal "native", "xml", "text" = "native" context window: int = DEFAULT MAX CONTEXT TOKENS is local: bool = True extra headers: dict str, str = field default factory=dict stop sequences: list str = field default factory=list ⋮---- @dataclass class CapabilityResult ⋮---- tool call mode: Literal "native", "xml", "text"… Evidence: `src/localharness/provider/client.py`
- **---------------------------------------------------------------------------** (source_file): log = logging.getLogger name ⋮---- DEFAULT PORTS: list int = 8081, 8000, 11434, 1234, 8080 ⋮---- LOCAL INFERENCE TIMEOUT MIN: float = 300.0 ⋮---- LOCAL PATTERNS = re.compile ⋮---- ProviderType = Literal "ollama", "vllm", "llamacpp", "lmstudio", "unknown" ⋮---- @dataclass class DetectorResult ⋮---- found: bool provider type: ProviderType base url: str models: list str suggested model: str probe duration ms: float raw response: dict = field default factory=dict ⋮---- probe ports = ports if ports is not None else DEFAULT PORTS start = time.monotonic ⋮---- probe coros = probe port client, port, timeout seconds for port in probe ports results = await asyncio.gather probe coros, return exceptions… Evidence: `src/localharness/provider/detector.py`
- **Also strip orphaned tags opening ", "" .replace " ", ""** (source_file): log = logging.getLogger name ⋮---- THINK PATTERN = re.compile r"\s ", re.DOTALL ⋮---- def strip thinking tags text: str - str ⋮---- """Strip reasoning blocks from model output.""" ⋮---- text = THINK PATTERN.sub "", text Also strip orphaned tags opening ", "" .replace " ", "" ⋮---- def truncate after last tool call text: str - str ⋮---- """Drop prose trailing the last tool-call block. Text a model writes AFTER a tool call is speculation by construction — no result existed yet observed live: a 4B model narrating invented file contents after its , then trusting that narration over the real tool result on the next turn . Intended for the HISTORY copy of an assistant turn only; the event stream… Evidence: `src/localharness/provider/fn_call.py`
- **Refarch** (source_file): @dataclass frozen=True class RefArch ⋮---- key: str name: str status: str doc: str platform: str launch: str docker image: str None pip package: str None default model: str model note: str serve extra args: tuple str, ... context tokens: int ⋮---- DGX SPARK = RefArch ⋮---- MAC MINI = RefArch ⋮---- REF ARCHS: tuple RefArch, ... = DGX SPARK, MAC MINI Evidence: `src/localharness/provider/refarch.py`
- **---------------------------------------------------------------------------** (source_file): DOCKER CONTAINER NAME = "localharness-vllm" ⋮---- def server dir config dir: Path - Path ⋮---- def log path config dir: Path - Path ⋮---- def pid path config dir: Path - Path ⋮---- def venv vllm bin config dir: Path - Path ⋮---- def find vllm config dir: Path - str None ⋮---- venv bin = venv vllm bin config dir ⋮---- def install vllm venv config dir: Path, package: str - str ⋮---- venv = server dir config dir / "venv" ⋮---- uv = shutil.which "uv" ⋮---- install = uv, "pip", "install", "--python", str venv / "bin" / "python" , package ⋮---- bin path = venv vllm bin config dir ⋮---- def run streaming cmd: list str - None ⋮---- rc = subprocess.run cmd .returncode ⋮---- -------------------------… Evidence: `src/localharness/provider/server.py`
- **Init** (source_file): all = Evidence: `src/localharness/registry/__init__.py`
- **Init** (source_file): all = Evidence: `src/localharness/tools/__init__.py`
- **Init** (source_file): def bind agent store tools registry: ToolRegistry, store: Any - None Evidence: `src/localharness/tools/builtin/__init__.py`
- **Changelog** (documentation): All notable changes to LocalHarness are documented here. The format follows Keep a Changelog https://keepachangelog.com/ , and the project adheres to Semantic Versioning https://semver.org/ pre-1.0: interfaces may change . Evidence: `CHANGELOG.md`
- **Code of Conduct** (documentation): LocalHarness adopts the Contributor Covenant https://www.contributor-covenant.org , version 2.1, as its Code of Conduct. The full text is published at . Evidence: `CODE_OF_CONDUCT.md`
- **Security Policy** (documentation): LocalHarness is early-stage v0.x . Security fixes land on the latest main ; there are no long-term-support branches yet. Evidence: `SECURITY.md`
- The remaining 15 evidence entries are in `AI_CONTEXT_PACK.json` or `EVIDENCE_INDEX.json`.

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `docs/reference-architectures/README.md`, `README.md`, `examples/README.md`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `docs/reference-architectures/README.md`, `README.md`, `examples/README.md`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Overview and System Architecture**: importance `high`
  - source_paths: README.md, src/localharness/__init__.py, src/localharness/core/bus.py, src/localharness/core/events.py, src/localharness/core/reduce.py
- **Memory, Learning, and Recall Pipeline**: importance `high`
  - source_paths: src/localharness/memory/sqlite.py, src/localharness/memory/gate.py, src/localharness/memory/predictive_gate.py, src/localharness/memory/predictive_write_gate.py, src/localharness/memory/discovery.py
- **Agent Loop, Tooling, and Permissions**: importance `high`
  - source_paths: src/localharness/agent/loop.py, src/localharness/agent/context.py, src/localharness/agent/permissions.py, src/localharness/agent/subagent.py, src/localharness/orchestrator/router.py
- **Deployment, Benchmarking, and Operations**: importance `medium`
  - source_paths: src/localharness/provider/client.py, src/localharness/provider/server.py, src/localharness/provider/detector.py, src/localharness/provider/fn_call.py, src/localharness/provider/refarch.py

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `e248e31f7bd0e0c8e0dbe686ea023b9a02c79bbc`
- inspected_files: `README.md`, `pyproject.toml`, `uv.lock`, `docs/reference-architectures/README.md`, `docs/reference-architectures/dgx-spark.md`, `docs/reference-architectures/gaps.md`, `docs/reference-architectures/mac-mini.md`, `docs/running-agents-locally.md`, `docs/specs/00-architecture-overview.md`, `docs/specs/01-event-bus.md`, `docs/specs/02-provider.md`, `docs/specs/03-agent-loop.md`, `docs/specs/04-tool-system.md`, `docs/specs/04b-mcp-integration.md`, `docs/specs/05-memory.md`, `docs/specs/06-config.md`, `docs/specs/07-orchestrator.md`, `docs/specs/08-context-management.md`, `docs/specs/09-hooks-plugins.md`, `docs/specs/10-cli.md`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: Version banner reads stale install metadata on editable installs — shows old version after every source update
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Version banner reads stale install metadata on editable installs — shows old version after every source update. Context: Observed when using python
- Why it matters: Developers may fail before the first successful local run: Version banner reads stale install metadata on editable installs — shows old version after every source update
- Evidence: failure_mode_cluster:github_issue | https://github.com/ahwurm/localharness/issues/97
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Configuration risk requires verification

- Trigger: Developers should check this configuration risk before relying on the project: Zombie docker-run client defeats the managed server's dead-process fail-fast
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Zombie docker-run client defeats the managed server's dead-process fail-fast. Context: Observed when using docker
- Why it matters: Developers may misconfigure credentials, environment, or host setup: Zombie docker-run client defeats the managed server's dead-process fail-fast
- Evidence: failure_mode_cluster:github_issue | https://github.com/ahwurm/localharness/issues/99
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Capability evidence risk requires verification

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: capability.assumptions | https://github.com/ahwurm/localharness
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Runtime risk requires verification

- Trigger: Developers should check this runtime risk before relying on the project: Mid-turn tier-2 input classification is starved by the single-flight inference gate, and its failure path is silent
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Mid-turn tier-2 input classification is starved by the single-flight inference gate, and its failure path is silent. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Developers may hit a documented source-backed failure mode: Mid-turn tier-2 input classification is starved by the single-flight inference gate, and its failure path is silent
- Evidence: failure_mode_cluster:github_issue | https://github.com/ahwurm/localharness/issues/92
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
