# peon-mem - 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 peon-mem. 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

- **AI researchers or builders of research-oriented Agents**: The README clearly centers on research, experiment, or paper workflows. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **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_0003` 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

- `npm install -g peon-mem && peon-mem install` Evidence: `README.md` Claim: `clm_0004` supported 0.86
- `git clone https://github.com/VineetV2/peon-mem && cd peon-mem` Evidence: `README.md` Claim: `clm_0005` supported 0.86
- `npm install && npm run build` Evidence: `README.md` Claim: `clm_0006` supported 0.86
- `curl http://127.0.0.1:3737/health        # → {"ok":true}` Evidence: `README.md` Claim: `clm_0007` supported 0.86
- `claude mcp add peon -- node /ABSOLUTE/PATH/TO/peon/dist/index.js` Evidence: `README.md` Claim: `clm_0008` supported 0.86
- `curl "http://127.0.0.1:3737/context?projectPath=$PWD&query=test"   # JSON context` Evidence: `README.md` Claim: `clm_0009` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Needs admin / security approval
- **Why**: Continuing may involve secrets, accounts, external services, or sensitive context; get admin or security approval first.

### 30-Second Read

- **What to do now**: Needs admin / security approval
- **Minimum safe next step**: Run Prompt Preview first; if credentials or an enterprise environment are involved, get approval before trialing
- **Do not trust yet**: Tool permission boundaries cannot be trusted before install.
- **Continuing will touch**: Command execution, Local environment or project files, Environment variables / API keys

### What You Can Trust Now

- **Target-audience signal: AI researchers or builders of research-oriented Agents** (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
- **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_0003` 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_0004` supported 0.86

### What You Cannot Trust Yet

- **Tool permission boundaries cannot be trusted before install.** (unverified): MCP/tool projects usually touch files, the network, the browser, or external APIs, so permissions and logs must be checked for real.
- **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.
- **Do the install commands require network access, permissions, or global writes?** (unverified): This affects install risk in both enterprise and personal environments. Evidence: `README.md`

### What Continuing Will Touch

- **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`
- **Environment variables / API keys**: Project entry docs explicitly showing API key, token, secret, or account credential configuration. Why: If a real install needs credentials, use test credentials first and go through a permission/compliance review. 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 a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (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.)
- **Do not use real production credentials**: Once an environment variable / API key enters the host or toolchain, it can create account and compliance risk. (applies when: When environment signals like API, TOKEN, KEY, or SECRET appear.)
- **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.
- **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.
- **Be ready to revoke test API keys or tokens**: If test credentials leak or are misused, you can cut losses quickly.
- **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_0010` 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_0011` 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: 93
- Important-file coverage: 40/93
- Evidence index entries: 78
- Role / Skill entries: 2

### 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 peon-mem, 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 peon-mem 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 peon-mem, 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 2 role / Skill / project-doc entries.

- **🧠 Peon — a memory brain for your AI coding agents** (project_doc): 🧠 Peon — a memory brain for your AI coding agents Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **eval-results — Peon's committed eval ledger** (project_doc): eval-results — Peon's committed eval ledger Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `eval-results/README.md`

## Evidence Index

- Indexed 78 evidence entries.

- **🧠 Peon — a memory brain for your AI coding agents** (documentation): 🧠 Peon — a memory brain for your AI coding agents Evidence: `README.md`
- **eval-results — Peon's committed eval ledger** (documentation): eval-results — Peon's committed eval ledger Evidence: `eval-results/README.md`
- **Package** (package_manifest): { "name": "peon-mem", "version": "1.0.0", "type": "module", "main": "dist/index.js", "bin": { "peon-mem": "bin/peon-mem.mjs", "peon-mcp": "dist/index.js", "peon-daemon": "dist/daemon-cli.js" }, "scripts": { "build": "tsc -p tsconfig.json", "daemon": "node dist/daemon-cli.js", "install:peon": "node scripts/install-peon.mjs", "evaluate": "node scripts/evaluate-peon.mjs", "eval": "node scripts/eval-retrieval-labeled.mjs run", "typecheck": "tsc -p tsconfig.json --noEmit", "test": "PEON QUERY EMBED CACHE=/tmp/peon-test-query-embed-cache.jsonl vitest run", "prepublishOnly": "npm run build && npm test" }, "dependencies": { "@modelcontextprotocol/sdk": "^1.23.0" }, "description": "Local-first hiera… Evidence: `package.json`
- **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`
- **Peon Mem** (source_file): const log = s const act = desc, fn = ⋮---- async function ask q, def ⋮---- function which bin function backupWrite file, content ⋮---- function detectApps ⋮---- function wireClaude function wireCodex function wireJsonMcp name, file ⋮---- function wireVsCode file function wireZed file ⋮---- function installService memoryHome ⋮---- async function health Evidence: `bin/peon-mem.mjs`
- **Claude Peon Hook** (source_file): function resolveProjectPath p ⋮---- async function ensurePeonSession ⋮---- async function recordWithSession ctx, run ⋮---- async function trackTokenUsage input, projectPath, externalSessionId ⋮---- function formatToolUse input ⋮---- function summarize value ⋮---- async function postJson path, body ⋮---- async function getProjectContext projectPath, query ⋮---- async function buildSubagentContext task, projectPath ⋮---- local = formatRelevantMemory await getProjectContext projectPath, query ; // already carries the directive } catch { / best effort / } ⋮---- } catch { / best effort / } ⋮---- return ${PEON FIRST DIRECTIVE}\n${cross} ; // cross-only path needs the directive ⋮---- async functio… Evidence: `scripts/claude-peon-hook.mjs`
- **Token Ab Monitor** (source_file): Peon · Token A/B Monitor :root { --bg: 0e0e10; --bg2: 1a1a1d; --bg3: 242428; --border: 2e2e33; --text: e8e8ec; --muted: 7a7a85; --green: 3dd68c; --red: f87171; --blue: 60a5fa; --yellow: fbbf24; --purple: a78bfa; --mono: "JetBrains Mono", "Fira Code", monospace; } { box-sizing: border-box; margin: 0; padding: 0; } body { background: var --bg ; color: var --text ; font-family: system-ui, sans-serif; font-size: 14px; min-height: 100vh; } header { background: var --bg2 ; border-bottom: 1px solid var --border ; padding: 14px 24px; display: flex; align-items: center; gap: 12px; } header h1 { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; } header .sub { color: var --muted ; font-size:… Evidence: `scripts/token-ab-monitor.html`
- **Brain** (source_file): import type { MemoryRecord } from "./types.js"; import { detectMemoryConflicts } from "./quality.js"; import { detectDuplicates } from "./overview.js"; import { applyMerge } from "./memory-mutations.js"; ⋮---- export type BrainActionType = "reinforce" "resolve conflict" "merge duplicate" "compress cluster"; ⋮---- export interface BrainAction { type: BrainActionType; detail: string; affectedIds: string ; } ⋮---- export interface SleepCycleResult { records: MemoryRecord ; actions: BrainAction ; } ⋮---- function isProtected record: MemoryRecord, protectGlobalScope = true : boolean ⋮---- function clamp01 value: number : number ⋮---- function baseStrength record: MemoryRecord : number ⋮---- expo… Evidence: `src/brain.ts`
- **Config** (source_file): import { existsSync, readFileSync } from "node:fs"; import { dirname, join, parse } from "node:path"; ⋮---- export type PeonProvider = "openrouter" "openai" "anthropic" "ollama"; ⋮---- export interface PeonConfig { provider: PeonProvider; llmApiKey?: string; llmBaseUrl: string; openRouterApiKey?: string; processingModel: string; embeddingModel?: string; embeddingMode: "off" "local" "api" "ollama"; ollamaBaseUrl?: string; memoryDirName: string; flushMinChars: number; aiMode: "off" "gated"; } ⋮---- type Env = Record ; ⋮---- function optional value: string undefined : string undefined ⋮---- function numberFromEnv value: string undefined, fallback: number : number ⋮---- function resolveEmbeddin… Evidence: `src/config.ts`
- **Daemon Cli** (source_file): import { startPeonDaemon } from "./daemon.js"; ⋮---- async function daemonAlreadyHealthy : Promise ⋮---- function isAddrInUse error: unknown : boolean ⋮---- async function shutdown : Promise Evidence: `src/daemon-cli.ts`
- **Daemon** (source_file): import { createServer, type IncomingMessage, type Server, type ServerResponse } from "node:http"; import { existsSync } from "node:fs"; import { mkdir, readFile, writeFile } from "node:fs/promises"; import { AddressInfo } from "node:net"; import { homedir, tmpdir } from "node:os"; import { basename, dirname, join } from "node:path"; import { URL } from "node:url"; import { PeonLogger } from "./logger.js"; import { renderMonitorHtml } from "./monitor.js"; import { renderTokenAbMonitorHtml } from "./token-ab-monitor.js"; import type { ConsolidationStats } from "./processor.js"; import { SessionIndex } from "./session-index.js"; import { createPeonTools } from "./tools.js"; import { summarizeB… Evidence: `src/daemon.ts`
- **Hyde** (source_file): import type { PeonConfig } from "./config.js"; import type { FetchLike } from "./reranker.js"; ⋮---- export interface HydeOptions { config: PeonConfig; model?: string; fetchImpl?: FetchLike; maxChars?: number; } ⋮---- export interface HydeResult { expanded: string; hypothetical: string; } ⋮---- export async function expandQuery query: string undefined, options: HydeOptions : Promise Evidence: `src/hyde.ts`
- **Index** (source_file): import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { createPeonTools, type CrossProjectSearchToolResult, type SearchMemoryToolResult } from "./tools.js"; import type { BrainInspection, ProjectContext } from "./types.js"; ⋮---- const projectName = path: string : string ⋮---- function compactContext ctx: ProjectContext : string ⋮---- function compactSearch result: SearchMemoryToolResult : string ⋮---- function compactBrain result: BrainInspection : string ⋮---- function compactCrossProject result: CrossProjectSearchToolResult : string Evidence: `src/index.ts`
- **Injection** (source_file): import { diversifyByMMR, rankMemoryRecords, type RankedMemoryRecord, type RetrievalReason } from "./retrieval.js"; import type { MemoryRecord, MemoryScope, MemoryStatus, MemoryType } from "./types.js"; ⋮---- export interface BuildContextInjectionOptions { projectResults: RankedMemoryRecord ; globalRecords: MemoryRecord ; query?: string; maxChars: number; includeInactive?: boolean; now?: Date string number; } ⋮---- export interface SelectedInjectionMetadata { id: string; scope: MemoryScope; type: MemoryType; status: MemoryStatus; score: number; whySelected: string; source: MemoryRecord "source" ; chars: number; } ⋮---- export type OmittedInjectionReason = "suppressed status" "max chars"; ⋮--… Evidence: `src/injection.ts`
- **Memory Mutations** (source_file): import type { MemoryRecord, MemoryStatus } from "./types.js"; ⋮---- export interface MemoryPatch { content?: string; importance?: number; confidence?: number; status?: MemoryStatus; pinned?: boolean; } ⋮---- function clamp value: number : number ⋮---- function touch record: MemoryRecord, now: string : MemoryRecord ⋮---- export function applyUpdate records: readonly MemoryRecord , id: string, patch: MemoryPatch, now: string : MemoryRecord ⋮---- export function applyDelete records: readonly MemoryRecord , id: string : MemoryRecord ⋮---- export function applyPin records: readonly MemoryRecord , id: string, pinned: boolean, now: string : MemoryRecord ⋮---- export function applyMerge records: re… Evidence: `src/memory-mutations.ts`
- **Memory Store** (source_file): import { appendFile, mkdir, readFile, rename, writeFile } from "node:fs/promises"; import { existsSync } from "node:fs"; import { basename, join } from "node:path"; import { loadPeonConfig, type PeonConfig } from "./config.js"; import { EmbeddingStore } from "./embedding-store.js"; import { cosineSimilarity, createEmbeddingClient, type EmbeddingClient } from "./embeddings.js"; import type { MemoryQualityReport } from "./quality.js"; import { applyDelete, applyMerge, applyPin, applyUpdate, type MemoryPatch } from "./memory-mutations.js"; import { runSleepCycle, type BrainAction, type Summarizer } from "./brain.js"; import { readdir, rm } from "node:fs/promises"; import { rankMemoryRecords as… Evidence: `src/memory-store.ts`
- **Monitor** (source_file): export function renderMonitorHtml : string Evidence: `src/monitor.ts`
- **Processor** (source_file): import { PeonMemoryStore } from "./memory-store.js"; import { loadPeonConfig, type PeonConfig } from "./config.js"; import { createQualityReport } from "./quality.js"; import { extractDomainEntitiesViaModel } from "./entity-extraction.js"; import type { ConsolidationOperation, MemoryRecord, MemoryRecordInput, MemoryStatus, MemoryType, ProcessedMemory } from "./types.js"; ⋮---- export interface MemoryModelResult { content: string; model: string; estimatedTokens: number; } ⋮---- export interface MemoryModelClient { processMemory input: { rawMemory: string; existingMemory?: string; config: PeonConfig; reason: string } : Promise ; } ⋮---- processMemory input: ⋮---- export interface ProcessMemor… Evidence: `src/processor.ts`
- **Reranker** (source_file): import type { PeonConfig } from "./config.js"; import type { RankedMemoryRecord } from "./retrieval.js"; ⋮---- export type FetchLike = url: string, init: RequestInit = Promise ; json : Promise } ; ⋮---- export interface RerankOptions { config: PeonConfig; topK?: number; model?: string; fetchImpl?: FetchLike; snippetChars?: number; } ⋮---- export async function rerankRecords query: string undefined, records: RankedMemoryRecord , options: RerankOptions : Promise ⋮---- // Cheap exits — never pay an LLM call when it cannot help. ⋮---- // Apply the model's order to the head, then append any head items it omitted in their // original order , then the untouched tail. Guarantees a permutation of th… Evidence: `src/reranker.ts`
- **Retrieval** (source_file): import { cosineSimilarity, type EmbeddingVector } from "./embeddings.js"; import { canonicalizeEntity } from "./entities.js"; import type { MemoryRecord, MemoryType } from "./types.js"; ⋮---- export type RetrievalReasonKind = "query term" "entity" "file" "type" "quality" "recency" "status" "semantic"; ⋮---- export interface RetrievalReason { kind: RetrievalReasonKind; label: string; score: number; } ⋮---- export interface RankedMemoryRecord { record: MemoryRecord; score: number; reasons: RetrievalReason ; explanation: string; } ⋮---- export interface SemanticRetrievalInput { queryVector: EmbeddingVector; vectorById: Map ; weight?: number; minSimilarity?: number; } ⋮---- export interface Ret… Evidence: `src/retrieval.ts`
- **Session Index** (source_file): import { mkdir, readFile, writeFile } from "node:fs/promises"; import { homedir } from "node:os"; import { dirname, join } from "node:path"; ⋮---- export interface SessionIndexRecord { sessionId: string; projectPath: string; client: string; cwd: string; startedAt: string; } ⋮---- export function defaultSessionIndexPath : string ⋮---- export class SessionIndex ⋮---- constructor private readonly filePath: string = defaultSessionIndexPath ⋮---- async get sessionId: string : Promise ⋮---- async set record: SessionIndexRecord : Promise ⋮---- async remove sessionId: string : Promise ⋮---- async active : Promise ⋮---- async prune now: number, maxAgeMs: number : Promise ⋮---- private async load : P… Evidence: `src/session-index.ts`
- **Token Ab Monitor** (source_file): import { readFileSync } from "node:fs"; import { join, dirname } from "node:path"; import { fileURLToPath } from "node:url"; ⋮---- export function renderTokenAbMonitorHtml : string Evidence: `src/token-ab-monitor.ts`
- **Tools** (source_file): import { basename } from "node:path"; import { loadPeonConfig } from "./config.js"; import { createEmbeddingClient } from "./embeddings.js"; import { PeonMemoryStore } from "./memory-store.js"; import { PeonMemoryProcessor, type MaybeProcessMemoryResult, type ProcessMemoryResult } from "./processor.js"; import { selectMemoryRecordsForContext, type RankedMemoryRecord } from "./retrieval.js"; import { createQualityReport, type MemoryQualityReport } from "./quality.js"; import { PeonGlobalMemoryStore, type GlobalMemorySource } from "./global-memory.js"; import { redactSecrets } from "./injection.js"; import { selectGloballyPromotable } from "./global-promotion.js"; import type { BrainAction }… Evidence: `src/tools.ts`
- **Types** (source_file): export type PeonRole = "user" "assistant" "system"; ⋮---- export interface PeonSession { id: string; projectPath: string; client: string; cwd: string; startedAt: string; endedAt?: string; } ⋮---- export interface PeonEvent { id: string; sessionId: string; type: string; content: string; createdAt: string; role?: PeonRole; } ⋮---- export interface ProjectContext { summary: string; memories: string; decisions: string; preferences: string; openQuestions: string; artifacts: string; timeline: string; episodes?: string; meta?: { compacted: boolean; maxChars: number; }; recalledIds?: string ; headline?: string; global?: string; } ⋮---- export interface ProcessedMemory { summary: string; decisions:… Evidence: `src/types.ts`
- **Vitest.Config** (source_file): import { defineConfig } from "vitest/config"; Evidence: `vitest.config.ts`
- **Tsconfig** (structured_config): { "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true, "resolveJsonModule": true, "outDir": "dist", "rootDir": "src", "declaration": true }, "include": "src/ / .ts" } Evidence: `tsconfig.json`
- **.gitignore** (source_file): node modules/ .env .peon/ .log .bak Evidence: `.gitignore`
- **Install** (source_file): set -euo pipefail APP DIR="${PEON INSTALL DIR:-$HOME/.peon-mem}" echo "🧠 Installing Peon → $APP DIR" command -v node /dev/null { echo "node = 20 required https://nodejs.org "; exit 1; } command -v git /dev/null { echo "git required"; exit 1; } if -d "$APP DIR/.git" ; then git -C "$APP DIR" pull --ff-only else git clone --depth 1 https://github.com/VineetV2/peon-mem "$APP DIR" fi cd "$APP DIR" npm install --omit=dev --silent BIN TARGET="$APP DIR/bin/peon-mem.mjs" for B in "$ npm prefix -g 2 /dev/null /bin" /usr/local/bin "$HOME/.local/bin"; do if -d "$B" && -w "$B" ; then ln -sf "$BIN TARGET" "$B/peon-mem" && echo "✔ CLI linked: $B/peon-mem" && break; fi done echo exec node "$BIN TARGET" ins… Evidence: `install.sh`
- **Eval Retrieval Labeled** (source_file): async function chat messages, temperature = 0 const parseNums = s = const qrelsPath = out ⋮---- async function build ⋮---- async function run ⋮---- const pct = x ⋮---- const dp = x = $ const dm = x = $ Evidence: `scripts/eval-retrieval-labeled.mjs`
- **Eval Retrieval** (source_file): async function genQuery belief ⋮---- async function build ⋮---- async function run items ⋮---- const pct = x Evidence: `scripts/eval-retrieval.mjs`
- **Evaluate Peon** (source_file): function readOption name ⋮---- async function exists path Evidence: `scripts/evaluate-peon.mjs`
- **Install Peon Stl** (source_file): const sh = cmd, args = ⋮---- function bootout Evidence: `scripts/install-peon-stl.mjs`
- **Install Peon** (source_file): export async function main argv, options = ⋮---- export function parseInstallArgs argv, cwd = process.cwd ⋮---- export function buildInstallPlan ⋮---- export async function collectChecks projectPath, packageDir ⋮---- export function formatTextReport plan ⋮---- export function formatWritePlan plan ⋮---- function formatHelp ⋮---- function formatChecks checks ⋮---- function buildNextCommands ⋮---- function setAction current, next ⋮---- function normalizeUrl value ⋮---- async function exists path ⋮---- function isMain moduleUrl, argvPath ⋮---- function indent value, spaces ⋮---- function shellQuote value Evidence: `scripts/install-peon.mjs`
- **Longmemeval Eval** (source_file): async function chat model, messages, temperature = 0 ⋮---- // ── Peon: ingest haystack → consolidate OR keep raw → retrieve ── async function peonMemoryFor q ⋮---- async function read question, questionDate, memory ⋮---- function judgePrompt task, question, answer, response, abstention ⋮---- async function grade q, hyp Evidence: `scripts/longmemeval-eval.mjs`
- **Peon Report** (source_file): function readJsonl path ⋮---- function readJson path ⋮---- function analyze projectPath ⋮---- const sum = arr, key ⋮---- function fmt n ⋮---- function printReport a Evidence: `scripts/peon-report.mjs`
- **Peon Stl** (source_file): function parseLines raw ⋮---- function readJsonlTail path, capBytes = LOG TAIL CAP BYTES const readJsonl = p function readJson path const ts = e const within = e = const fmt = n ⋮---- function countWithin path ⋮---- function canonicalProject p / Which Peon path a request belongs to: injection serving memory vs recording capturing it . / function classifyPath path ⋮---- function isRealProject p function discoverProjects logEntries ⋮---- function resolveOpenRouterKey ⋮---- } catch { / unreadable .env → keep climbing / } ⋮---- // ---------- daemon log ---------- ⋮---- for const e of LOG if e.projectPath e.projectPath = canonicalProject e.projectPath ; // fold worktrees into parent ⋮---- functi… Evidence: `scripts/peon-stl.mjs`
- **Compression** (source_file): import type { PeonConfig } from "./config.js"; import type { Summarizer, TopicCluster } from "./brain.js"; ⋮---- export function createClusterSummarizer config: PeonConfig : Summarizer null Evidence: `src/compression.ts`
- **Embedding Store** (source_file): import { mkdir, readFile, rename, stat, writeFile } from "node:fs/promises"; import { dirname, join } from "node:path"; import { contentHash, type EmbeddingClient, type EmbeddingVector } from "./embeddings.js"; import type { MemoryRecord } from "./types.js"; ⋮---- export interface StoredEmbedding { id: string; model: string; hash: string; vector: EmbeddingVector; } ⋮---- export interface SyncResult { vectorById: Map ; computed: number; reused: number; pruned: number; } ⋮---- export class EmbeddingStore ⋮---- private constructor private readonly filePath: string ⋮---- static async open memoryDir: string : Promise ⋮---- async load : Promise ⋮---- // skip malformed lines — never let a bad vect… Evidence: `src/embedding-store.ts`
- **Embeddings** (source_file): import { appendFileSync, closeSync, mkdirSync, openSync, readSync, statSync } from "node:fs"; import { homedir } from "node:os"; import { dirname, join } from "node:path"; import type { PeonConfig } from "./config.js"; ⋮---- export type EmbeddingVector = number ; ⋮---- export interface EmbeddingClient { readonly model: string; embed texts: string : Promise ; } ⋮---- embed texts: string : Promise ; ⋮---- export function cosineSimilarity a: EmbeddingVector, b: EmbeddingVector : number ⋮---- export function l2normalize vector: EmbeddingVector : EmbeddingVector ⋮---- export function localEmbed text: string, dim: number = LOCAL EMBEDDING DIM : EmbeddingVector ⋮---- export function contentHash te… Evidence: `src/embeddings.ts`
- **Entities** (source_file): export type EntityNamespace = "code" "domain"; export type EntityKind = "file" "symbol" "concept"; ⋮---- export interface CanonicalEntity { key: string; name: string; kind: EntityKind; namespace: EntityNamespace; } ⋮---- export function canonicalizeEntity raw: string : CanonicalEntity null ⋮---- // Normalize separators, drop a leading "./" and a leading truncation marker "..."/"…src/…" . // NOTE: we deliberately do NOT blind-strip a leading numeric segment — the SRC ROOT slice and // parent/basename fallback below already collapse the "2/" phantom from "Project x 2" WITHOUT // eating real numeric directories like "2024/notes.md". ⋮---- // With a known source root, key from there so all pref… Evidence: `src/entities.ts`
- **Entity Extraction** (source_file): import type { PeonConfig } from "./config.js"; import type { FetchLike } from "./reranker.js"; ⋮---- export interface ExtractItem { key: string; content: string; } ⋮---- export interface ExtractOptions { config: PeonConfig; model?: string; fetchImpl?: FetchLike; maxItems?: number; snippetChars?: number; } ⋮---- export async function extractDomainEntitiesViaModel items: ExtractItem , options: ExtractOptions : Promise ⋮---- return out; // any failure → deterministic-only ⋮---- / Tolerant parse of {n, entities: ... }, ... from a model response. / export function parseEntityArray content: string : Array< ⋮---- function truncate text: string, max: number : string Evidence: `src/entity-extraction.ts`
- **Eval Metrics** (source_file): export function recallAtK retrieved: readonly string , relevant: ReadonlySet , k: number : number ⋮---- export function reciprocalRank retrieved: readonly string , relevant: ReadonlySet : number ⋮---- export function ndcgAtK retrieved: readonly string , relevant: ReadonlySet , k: number : number ⋮---- export interface QueryScore { recall: number; rr: number; ndcg: number; } ⋮---- export function scoreQuery retrieved: readonly string , relevant: ReadonlySet , k: number : QueryScore ⋮---- export interface AggregateScore { queries: number; recallAtK: number; mrr: number; ndcgAtK: number; } ⋮---- export function aggregate scores: readonly QueryScore : AggregateScore Evidence: `src/eval-metrics.ts`
- **Evaluation** (source_file): import { readFile } from "node:fs/promises"; import { join } from "node:path"; ⋮---- export type EvaluationTextInput = string string ; ⋮---- export interface ExpectedMemoryInput { id?: string; content: string; } ⋮---- export interface ProcessingJobInput { status?: "processed" "skipped" "failed" string; model?: string; reason?: string; estimatedTokens?: number; } ⋮---- export interface EvaluationInput { expectedMemories: Array ; retrievedText?: EvaluationTextInput; injectedText?: EvaluationTextInput; processingJobs?: ProcessingJobInput ; } ⋮---- export interface EvaluationReport { expectedCount: number; observedItemCount: number; matchedExpectedCount: number; matchedObservedItemCount: number… Evidence: `src/evaluation.ts`
- **Global Extraction** (source_file): import type { PeonConfig } from "./config.js"; import type { MemoryRecord } from "./types.js"; ⋮---- export type GlobalExtractor = records: readonly MemoryRecord = Promise ; ⋮---- export function createGlobalExtractor config: PeonConfig : GlobalExtractor null ⋮---- / Tolerant parse of the model's reply into a clean string list. / export function parseStringArray content: string : string Evidence: `src/global-extraction.ts`
- **Global Memory** (source_file): import { randomUUID } from "node:crypto"; import { appendFile, mkdir, readFile, writeFile } from "node:fs/promises"; import { homedir } from "node:os"; import { join } from "node:path"; import type { MemoryRecord, MemoryRecordInput, MemoryStatus, MemoryType } from "./types.js"; ⋮---- export interface OpenGlobalMemoryStoreOptions { globalDir?: string; } ⋮---- export interface ListGlobalMemoryOptions { query?: string; type?: MemoryType; status?: MemoryStatus; } ⋮---- export interface GlobalMemorySource { kind?: MemoryRecord "source" "kind" ; reason?: string; } ⋮---- export class PeonGlobalMemoryStore ⋮---- private constructor private readonly globalDir: string ⋮---- static defaultDirectory :… Evidence: `src/global-memory.ts`
- **Global Promotion** (source_file): import type { MemoryRecord, MemoryType } from "./types.js"; ⋮---- export interface PromotionPolicy { promotableTypes?: readonly MemoryType ; } ⋮---- export function isGloballyPromotable record: MemoryRecord, policy: PromotionPolicy = ⋮---- export function selectGloballyPromotable records: readonly MemoryRecord , policy: PromotionPolicy = {} : MemoryRecord Evidence: `src/global-promotion.ts`
- **Logger** (source_file): import { appendFile, mkdir, readFile } from "node:fs/promises"; import { homedir } from "node:os"; import { join } from "node:path"; ⋮---- export interface PeonLoggerOptions { logDir?: string; } ⋮---- export interface PeonLogEntry { id: string; type: string; createdAt: string; key: string : unknown; } ⋮---- export class PeonLogger ⋮---- constructor options: PeonLoggerOptions = ⋮---- async log type: string, fields: Record = ⋮---- async recent limit = 100 : Promise ⋮---- private async enqueueWrite line: string : Promise ⋮---- const write = async = ⋮---- function sanitize fields: Record : Record Evidence: `src/logger.ts`
- **Overview** (source_file): import type { MemoryRecord } from "./types.js"; import type { SelectedInjectionMetadata } from "./injection.js"; ⋮---- export interface BeliefCounts { active: number; superseded: number; conflicts: number; stale: number; archived: number; summaries: number; pinned: number; total: number; } ⋮---- export function summarizeBeliefs records: readonly MemoryRecord : BeliefCounts ⋮---- export interface ProjectSummary { projectPath: string; active: number; } ⋮---- export function filterStrayProjects projects: readonly T : T ⋮---- export interface DuplicatePair { aId: string; aContent: string; bId: string; bContent: string; similarity: number; } ⋮---- function wordSet text: string : Set ⋮---- functi… Evidence: `src/overview.ts`
- **Quality** (source_file): import type { MemoryRecord, MemoryStatus } from "./types.js"; ⋮---- export interface DuplicateMemoryRecord { duplicateId: string; keptId: string; key: string; } ⋮---- export interface DeduplicateMemoryRecordsResult { records: MemoryRecord ; duplicates: DuplicateMemoryRecord ; } ⋮---- export interface MemoryConflict { entity: string; leftId: string; rightId: string; reason: string; } ⋮---- export interface StaleMemoryOptions { now?: Date; staleAfterDays?: number; } ⋮---- export interface MarkStaleMemoryRecordsResult { records: MemoryRecord ; staleIds: string ; } ⋮---- export interface PromoteMemoryRecordsOptions { repeatedContent?: string ; importantTerms?: string ; repeatThreshold?: number;… Evidence: `src/quality.ts`
- **Recuration** (source_file): import type { PeonConfig } from "./config.js"; import type { MemoryRecord } from "./types.js"; ⋮---- export type Recurator = records: readonly MemoryRecord = Promise ; ⋮---- export function createRecurator config: PeonConfig : Recurator null ⋮---- async function judgeBatch config: PeonConfig, batch: readonly MemoryRecord : Promise ⋮---- / Tolerant parse of the model's id list. / export function parseIdArray content: string : string Evidence: `src/recuration.ts`
- **Temporal** (source_file): import type { MemoryRecord } from "./types.js"; ⋮---- function ms value: string number Date : number ⋮---- export function currentAsOf records: MemoryRecord , at: string number Date : MemoryRecord ⋮---- export type ChangeKind = "added" "superseded" "retired"; ⋮---- export interface ChangeEntry { kind: ChangeKind; at: string; record: MemoryRecord; replacementId?: string; } ⋮---- export function changesBetween records: MemoryRecord , from: string number Date, to: string number Date : ChangeEntry Evidence: `src/temporal.ts`
- **Brain.Test** (source_file): import { describe, expect, test } from "vitest"; import { reinforce, resolveConflicts, autoMergeDuplicates, findTopicClusters, compressTopicClusters, runSleepCycle } from "../src/brain.js"; import type { MemoryRecord } from "../src/types.js"; ⋮---- function rec over: Partial : MemoryRecord ⋮---- const summarize = async Evidence: `test/brain.test.ts`
- **Canonical Project Path.Test** (source_file): import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, describe, expect, it } from "vitest"; import { canonicalProjectPath } from "../src/daemon.js"; ⋮---- function makeTree ⋮---- const brain = p: string = ⋮---- writeFileSync join home, "proj", "thesis", ".peon", "root" , "" ; // boundary marker Evidence: `test/canonical-project-path.test.ts`
- **Claude Hook.Test** (source_file): import { spawn } from "node:child process"; import { mkdtemp, readFile, rm } from "node:fs/promises"; import { mkdtempSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, beforeEach, describe, expect, test } from "vitest"; import { startPeonDaemon, type PeonDaemonHandle } from "../src/daemon.js"; ⋮---- expect bash .toBe "" ; // non-web tools produce no output no overhead/noise ⋮---- // Turn 1 establishes the session + the hook's local cache. ⋮---- async function runHook input: unknown, options: ⋮---- async function runHookRaw rawInput: string, options: ⋮---- async function postJson url: string, body: unknown : Promise Evidence: `test/claude-hook.test.ts`
- **Codex Hook.Test** (source_file): import { spawn } from "node:child process"; import { mkdtemp, readFile, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, beforeEach, describe, expect, test } from "vitest"; import { startPeonDaemon, type PeonDaemonHandle } from "../src/daemon.js"; ⋮---- async function runCodexHook input: unknown : Promise Evidence: `test/codex-hook.test.ts`
- **Config.Test** (source_file): import { describe, expect, it } from "vitest"; import { loadPeonConfig } from "../src/config.js"; Evidence: `test/config.test.ts`
- **Consolidation.Test** (source_file): import { mkdtemp } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { describe, expect, test } from "vitest"; import { PeonMemoryStore, memoryRecordId } from "../src/memory-store.js"; import { PeonMemoryProcessor } from "../src/processor.js"; import { buildContextInjection } from "../src/injection.js"; import type { ProcessedMemory } from "../src/types.js"; ⋮---- function emptyProcessed over: Partial = ⋮---- async function freshProject prefix: string : Promise< Evidence: `test/consolidation.test.ts`
- **Cross Project.Test** (source_file): import { mkdtempSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, describe, expect, test } from "vitest"; import { PeonMemoryProcessor } from "../src/processor.js"; import { createPeonTools } from "../src/tools.js"; import type { ProcessedMemory } from "../src/types.js"; ⋮---- function tempProject prefix: string : string function processed over: Partial = Evidence: `test/cross-project.test.ts`
- **Daemon Client.Test** (source_file): import { mkdtemp } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, beforeEach, describe, expect, test } from "vitest"; import { startPeonDaemon, type PeonDaemonHandle } from "../src/daemon.js"; import { createPeonTools } from "../src/tools.js"; Evidence: `test/daemon-client.test.ts`
- **Daemon.Test** (source_file): import { mkdtemp, readFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, beforeEach, describe, expect, test } from "vitest"; import { startPeonDaemon, type PeonDaemonHandle } from "../src/daemon.js"; ⋮---- async function postJson url: string, body: unknown : Promise Evidence: `test/daemon.test.ts`
- The remaining 18 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: `README.md`, `eval-results/README.md`, `package.json`
- **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: `README.md`, `eval-results/README.md`, `package.json`

## 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.

- **Introduction to Peon**: importance `high`
  - source_paths: README.md, src/index.ts, src/types.ts, src/config.ts, package.json
- **Architecture, Daemon, and MCP Infrastructure**: importance `high`
  - source_paths: src/daemon.ts, src/daemon-cli.ts, src/brain.ts, src/tools.ts, src/index.ts
- **Memory Model, Consolidation, and Retrieval**: importance `high`
  - source_paths: src/memory-store.ts, src/memory-mutations.ts, src/processor.ts, src/retrieval.ts, src/reranker.ts
- **Agent Integration, Deployment, Monitoring, and Evaluation**: importance `high`
  - source_paths: scripts/claude-peon-hook.mjs, scripts/codex-peon-hook.mjs, src/injection.ts, src/monitor.ts, src/token-ab-monitor.ts

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `4e8d00e7927569f6cdc33cb8854e8fb6f246d3eb`
- inspected_files: `README.md`, `package.json`, `docs/superpowers/specs/2026-06-21-peon-knowledge-base-design.md`, `src/brain.ts`, `src/compression.ts`, `src/config.ts`, `src/daemon-cli.ts`, `src/daemon.ts`, `src/embedding-store.ts`, `src/embeddings.ts`, `src/entities.ts`, `src/entity-extraction.ts`, `src/eval-metrics.ts`, `src/evaluation.ts`, `src/global-extraction.ts`, `src/global-memory.ts`, `src/global-promotion.ts`, `src/hyde.ts`, `src/index.ts`, `src/injection.ts`

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: 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/VineetV2/peon-mem
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: no_demo
- 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: downstream_validation.risk_items | https://github.com/VineetV2/peon-mem
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Security or permission risk requires verification

- Trigger: no_demo
- 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: risks.scoring_risks | https://github.com/VineetV2/peon-mem
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Maintenance risk requires verification

- Trigger: issue_or_pr_quality=unknown。
- 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: evidence.maintainer_signals | https://github.com/VineetV2/peon-mem
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Maintenance risk requires verification

- Trigger: release_recency=unknown。
- 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: evidence.maintainer_signals | https://github.com/VineetV2/peon-mem
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
