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

- `npm install -g @richardyu114/moryn` Evidence: `README.md` Claim: `clm_0003` supported 0.86
- `git clone https://github.com/Richardyu114/Moryn.git` Evidence: `README.md` Claim: `clm_0004` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Sandbox-trial permissions first
- **Why**: The project has signals of install commands, host configuration, or local writes; do not go straight into your primary environment—trial it in isolation first.

### 30-Second Read

- **What to do now**: Sandbox-trial permissions first
- **Minimum safe next step**: Run Prompt Preview first; if you still want to install, trial only in an isolated environment
- **Do not trust yet**: Tool permission boundaries cannot be trusted before install.
- **Continuing will touch**: Command execution, Local environment or project files, Host AI context

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

- **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`
- **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.)
- **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.
- **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_0005` 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_0006` 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: 52
- Important-file coverage: 40/52
- Evidence index entries: 40
- Role / Skill entries: 8

### 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 moryn, 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 moryn 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 moryn, 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 8 role / Skill / project-doc entries.

- **Moryn** (project_doc): Moryn is a local-first, user-owned, auditable context store and handoff layer for multi-agent, multi-device AI work. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **Moryn Design Spec** (project_doc): Status: Approved for initial design documentation Date: 2026-05-27 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/moryn-design.md`
- **Agent Install Prompt** (project_doc): Moryn is designed for agents to operate directly across a multi-agent, multi-device store. Give the agent a goal and let it choose when to call moryn ; the user should only be interrupted for choices that require user authority or private information. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/agent-install-prompt.md`
- **Agent Workflow** (project_doc): Moryn exposes a lifecycle protocol for agents that need reliable setup, context bootstrapping, status updates, and handoffs across tools. The store is multi-agent and multi-device: host identity is provenance, while memory, skills, session summaries, and handoff context belong to the user-owned Moryn store. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/agent-workflow.md`
- **Contracts** (project_doc): Moryn responses are designed for agents that need stable paths, executable follow-up actions, and structured recovery data. This document summarizes the public contracts. The complete machine-readable source is available at runtime. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/contracts.md`
- **Moryn Dashboard** (project_doc): The Moryn dashboard is a local observability surface for checking memory, sync, handoffs, and recent agent activity. It is implemented in the CLI as a server-rendered HTML page with optional live refresh. It does not require a frontend build, hosted backend, database, or external service. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/dashboard.md`
- **Development** (project_doc): This document covers local development, release checks, package contents, and public-repo hygiene for Moryn. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/development.md`
- **Moryn Implementation Roadmap** (project_doc): This roadmap tracks the public first-version status and release acceptance criteria. Detailed protocol design lives in moryn-design.md moryn-design.md . Agent usage details live in agent-workflow.md agent-workflow.md . Machine-readable contracts are summarized in contracts.md contracts.md . Dashboard usage lives in dashboard.md dashboard.md . Public docs keep the product truth in README.md, docs/moryn-design.md, doc… Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/implementation-roadmap.md`

## Evidence Index

- Indexed 40 evidence entries.

- **Moryn** (documentation): Moryn is a local-first, user-owned, auditable context store and handoff layer for multi-agent, multi-device AI work. Evidence: `README.md`
- **Package** (package_manifest): { "name": "@richardyu114/moryn", "version": "0.1.1", "description": "Local-first memory, skill, and handoff layer for AI agents.", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } }, "bin": { "moryn": "dist/cli.js", "moryn-agent-smoke": "scripts/agent-lifecycle-smoke.js", "moryn-dogfood-demo": "scripts/dogfood-demo-smoke.js" }, "keywords": "agent", "memory", "mcp", "handoff", "cli", "local-first" , "files": "dist", "README.md", "docs/agent-install-prompt.md", "docs/agent-workflow.md", "docs/contracts.md", "docs/dashboard.md", "docs/development.md", "docs/implementation-roadmap.md", "doc… Evidence: `package.json`
- **Moryn Design Spec** (documentation): Status: Approved for initial design documentation Date: 2026-05-27 Evidence: `docs/moryn-design.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`
- **Agent Install Prompt** (documentation): Moryn is designed for agents to operate directly across a multi-agent, multi-device store. Give the agent a goal and let it choose when to call moryn ; the user should only be interrupted for choices that require user authority or private information. Evidence: `docs/agent-install-prompt.md`
- **Agent Workflow** (documentation): Moryn exposes a lifecycle protocol for agents that need reliable setup, context bootstrapping, status updates, and handoffs across tools. The store is multi-agent and multi-device: host identity is provenance, while memory, skills, session summaries, and handoff context belong to the user-owned Moryn store. Evidence: `docs/agent-workflow.md`
- **Contracts** (documentation): Moryn responses are designed for agents that need stable paths, executable follow-up actions, and structured recovery data. This document summarizes the public contracts. The complete machine-readable source is available at runtime. Evidence: `docs/contracts.md`
- **Moryn Dashboard** (documentation): The Moryn dashboard is a local observability surface for checking memory, sync, handoffs, and recent agent activity. It is implemented in the CLI as a server-rendered HTML page with optional live refresh. It does not require a frontend build, hosted backend, database, or external service. Evidence: `docs/dashboard.md`
- **Development** (documentation): This document covers local development, release checks, package contents, and public-repo hygiene for Moryn. Evidence: `docs/development.md`
- **Moryn Implementation Roadmap** (documentation): This roadmap tracks the public first-version status and release acceptance criteria. Detailed protocol design lives in moryn-design.md moryn-design.md . Agent usage details live in agent-workflow.md agent-workflow.md . Machine-readable contracts are summarized in contracts.md contracts.md . Dashboard usage lives in dashboard.md dashboard.md . Public docs keep the product truth in README.md, docs/moryn-design.md, docs/agent-workflow.md, docs/dashboard.md, and docs/contracts.md. Temporary development plans are not part of the public package. Evidence: `docs/implementation-roadmap.md`
- **Cli** (source_file): import { join } from "node:path"; import { homedir } from "node:os"; import { Command, CommanderError } from "commander"; import { getOperationContract, getOperationContractByCliCommand, getOperationContractByMcpTool, getOperationContractIndex, getOperationContracts, getSelectionSourceContracts, captureSession, contextPack, planInstall, setupWizard, version } from "./index.js"; import { OperationContractLookupConflictError, OperationContractLookupError, type OperationArgumentMetadata, type OperationContract, type OperationContractLookupOption } from "./operation-contracts.js"; import { agentDoctor, agentEnter, agentFinish, agentGuide, agentStart, agentStatus } from "./core/agent-lifecycle.j… Evidence: `src/cli.ts`
- **Vitest.Config** (source_file): import { defineConfig } from "vitest/config"; Evidence: `vitest.config.ts`
- **Agent Identity** (source_file): export interface AgentIdentityDisplay { client: string; family: string; confidence: "known" "generic" "unknown"; raw client: string; } ⋮---- function titleCase value: string : string ⋮---- export function normalizeAgentIdentity rawClient: string undefined : AgentIdentityDisplay Evidence: `src/core/agent-identity.ts`
- **Agent Lifecycle** (source_file): import { access } from "node:fs/promises"; import { createEngine } from "./engine.js"; import { initializeStore, readStoreConfig } from "./config.js"; import { resolveProjectContext, type ProjectContext, type SyncMode } from "./project.js"; import { displayRecordText } from "./content-text.js"; import type { MorynRecord, RecordSource } from "./types.js"; import { getGitSyncStatus, initializeGitSync, pullGitSync, pushGitSync, SYNC STATUS SELECTION SOURCES, type GitSyncResult, type GitSyncStatus } from "../sync/git.js"; import { toErrorEnvelope, type MorynErrorEnvelope } from "./errors.js"; import { actionExecution, actionSafety, type ActionExecution, type ActionSafety } from "./action-safety… Evidence: `src/core/agent-lifecycle.ts`
- **Autocapture Policy** (source_file): import { displayRecordText } from "./content-text.js"; import type { MorynRecord, RecordState } from "./types.js"; ⋮---- export type AutocapturePolicyDecision = "capture" "review" "archive"; export type AutocapturePolicyRoute = "auto capture" "manual review" "policy archive"; export type AutocapturePolicyDashboardSurface = "handoff" "capture inbox" "capture policy"; export type AutocapturePolicyRuleId = "low risk handoff auto capture" "review risk marker" "default review for agent handoff" "smoke test marker" "duplicate text"; ⋮---- export interface AutocapturePolicy { id: "default autocapture policy"; version: 1; mode: "policy review"; auto canonical: false; canonical requires user action:… Evidence: `src/core/autocapture-policy.ts`
- **Capture Policy Report** (source_file): import { operationArgumentsByTool } from "../operation-contracts.js"; import { actionExecution, actionSafety } from "./action-safety.js"; import { actionInterfaces, type ActionInterfaces } from "./action-interfaces.js"; import { DEFAULT AUTOCAPTURE POLICY, type AutocapturePolicyDecision, type AutocapturePolicyRuleId } from "./autocapture-policy.js"; import { currentAutocaptureDecisionForRecord, currentPolicyTreatsAsLowRiskCapture } from "./capture-review.js"; import { displayRecordText } from "./content-text.js"; import { commandForTimelineContext } from "./errors.js"; import type { MorynEvent, MorynRecord, RecordState } from "./types.js"; import { withPhasesByName, withRequiredFieldsByName… Evidence: `src/core/capture-policy-report.ts`
- **Capture Review** (source_file): import { evaluateAutocapturePolicy, type AutocapturePolicyResult } from "./autocapture-policy.js"; import { displayRecordText } from "./content-text.js"; import type { MorynRecord } from "./types.js"; ⋮---- function capturePayload record: MorynRecord : Record undefined ⋮---- function capturePolicy record: MorynRecord : Record undefined ⋮---- function policyRequestsCaptureReview policy: Record : boolean ⋮---- function hasStoredReviewPolicy record: MorynRecord : boolean ⋮---- function isAutocaptureRecord record: MorynRecord : boolean ⋮---- function captureString record: MorynRecord, key: string : string undefined ⋮---- function hostForRecord record: MorynRecord : string ⋮---- export function… Evidence: `src/core/capture-review.ts`
- **Config** (source_file): import { mkdir, readFile, writeFile } from "node:fs/promises"; import { join } from "node:path"; import { z } from "zod"; import { createId } from "./id.js"; ⋮---- export type StoreConfig = z.infer ; ⋮---- export interface InitializeStoreResult { config: StoreConfig; store: string; artifacts: { config: string; }; selection sources: typeof STORE INIT SELECTION SOURCES; } ⋮---- export interface InitializeStoreOptions { now?: = string; id?: = string; repair?: boolean; } ⋮---- function isNotFoundError error: unknown : boolean ⋮---- class StorePathArgumentError extends Error ⋮---- constructor storePath: unknown ⋮---- class StoreRepairArgumentError extends Error ⋮---- constructor repair: unknown… Evidence: `src/core/config.ts`
- **Derived** (source_file): import { mkdir, readFile, rm, stat, writeFile } from "node:fs/promises"; import { dirname, join } from "node:path"; import { setTimeout as delay } from "node:timers/promises"; import { replayEvents } from "./replay.js"; import { readEvents } from "./store.js"; import type { MorynRecord } from "./types.js"; import { displayRecordText, searchableRecordText } from "./content-text.js"; ⋮---- export interface RebuildResult { ok: true; records: number; projects: string ; skills: number; artifacts: { snapshots: { user: string; projects by id: Record ; skills: string; }; indexes: { recall: string; sync cursors: string; }; }; selection sources: typeof REBUILD SELECTION SOURCES; } ⋮---- function hasE… Evidence: `src/core/derived.ts`
- **Dogfood Report** (source_file): import { operationArgumentsByTool } from "../operation-contracts.js"; import { actionExecution, actionSafety } from "./action-safety.js"; import { actionInterfaces, type ActionInterfaces } from "./action-interfaces.js"; import { isCaptureReviewCandidate } from "./capture-review.js"; import { displayRecordText } from "./content-text.js"; import { commandForTimelineContext } from "./errors.js"; import type { MorynEvent, MorynRecord, RecordKind, RecordState } from "./types.js"; import { withPhasesByName, withRequiredFieldsByName, type RequiredFieldMetadata } from "./workflow.js"; ⋮---- export interface DogfoodReportInput { project id?: string; limit?: number; include private?: boolean; } ⋮----… Evidence: `src/core/dogfood-report.ts`
- **Engine** (source_file): import { appendEvent, readEvents } from "./store.js"; import { rebuildDerivedViews } from "./derived.js"; import { applyRecordPatch, replayEvents } from "./replay.js"; import { PROVENANCE METHODS, RECORD KINDS, RECORD PRIORITIES, RECORD SCOPES, RECORD STATES, isoDateTimeSchema, isValidPatchPath, recordKindSchema, recordPrioritySchema, recordScopeSchema, recordSourceSchema, recordStateSchema, parseRecord } from "./schema.js"; import { detectSensitiveContent, redactSensitiveContent, sensitiveScanText } from "./sensitive.js"; import type { MorynEvent, MorynRecord, RecordKind, RecordPriority, RecordProvenance, RecordScope, RecordSource, RecordState } from "./types.js"; import { commandForPromot… Evidence: `src/core/engine.ts`
- **Host Adapter Registry** (source_file): export type HostAdapterId = "claude" "codex" "gemini" "cursor" "shell"; ⋮---- export type HostAdapter = { id: HostAdapterId; display name: string; normalized client: HostAdapterId; aliases: string ; detection signals: string ; supported install steps: string ; mcp registration: { command: string; notes: string ; }; lifecycle prompt: string; capture strategy: { default command: string; records: string ; }; limitations: string ; }; ⋮---- function cloneHostAdapter adapter: HostAdapter : HostAdapter ⋮---- export function normalizeHostId host?: string : HostAdapterId ⋮---- export function getHostAdapters : HostAdapter ⋮---- export function getHostAdapter host?: string : HostAdapter undefined Evidence: `src/core/host-adapter-registry.ts`
- **Host Adapters** (source_file): import { agentStart } from "./agent-lifecycle.js"; import { evaluateAutocapturePolicy, type AutocapturePolicyResult } from "./autocapture-policy.js"; import { createEngine } from "./engine.js"; import { getHostAdapter, getHostAdapters, normalizeHostId, type HostAdapter, type HostAdapterId } from "./host-adapter-registry.js"; import { resolveProjectContext } from "./project.js"; import type { MorynRecord, RecordSource } from "./types.js"; ⋮---- export type InstallPlanAction = { action: "initialize store" "initialize project" "register mcp" "context pack" "capture session"; title: string; command: string; safe to auto run: boolean; writes: "none" "moryn store" "project config"; adapter?: Host… Evidence: `src/core/host-adapters.ts`
- **Memory Doctor** (source_file): import { operationArgumentsByTool } from "../operation-contracts.js"; import { actionExecution, actionSafety } from "./action-safety.js"; import { actionInterfaces, type ActionInterfaces } from "./action-interfaces.js"; import { commandForArchiveContext, commandForLinkContext, commandForPromoteContext, commandForReviseContext, commandForTimelineContext } from "./errors.js"; import { displayRecordText } from "./content-text.js"; import type { MorynRecord, RecordKind, RecordState } from "./types.js"; import { withPhasesByName, withRequiredFieldsByName, type RequiredFieldMetadata } from "./workflow.js"; ⋮---- export interface MemoryDoctorInput { project id?: string; limit?: number; include pri… Evidence: `src/core/memory-doctor.ts`
- **Memory Lifecycle** (source_file): import { operationArgumentsByTool } from "../operation-contracts.js"; import { actionExecution, actionSafety } from "./action-safety.js"; import { actionInterfaces, type ActionInterfaces } from "./action-interfaces.js"; import { commandForArchiveContext, commandForRecallContext, commandForTimelineContext } from "./errors.js"; import type { MorynRecord, RecordKind, RecordState } from "./types.js"; import { withPhasesByName, withRequiredFieldsByName, type RequiredFieldMetadata } from "./workflow.js"; ⋮---- export interface MemoryLifecycleInput { project id?: string; limit?: number; include private?: boolean; now?: string; } ⋮---- export interface MemoryLifecycleDiagnoseInput extends MemoryLif… Evidence: `src/core/memory-lifecycle.ts`
- **Replay** (source_file): import type { MorynEvent, MorynRecord, RecordState } from "./types.js"; import { parseRecord } from "./schema.js"; ⋮---- type ReplayFailure = "invalid replay result" "missing replay target" "invalid state transition"; ⋮---- interface ReplayRecoveryHint { failure: ReplayFailure; event id: string; event op: MorynEvent "op" ; record id?: string; label?: string; inspect: { event source: string; rebuild with: "moryn rebuild"; }; } ⋮---- class ReplayHistoryError extends Error ⋮---- constructor message: string, event: MorynEvent, hint: Omit ⋮---- function setPath target: Record , path: string, value: unknown : void ⋮---- export function applyRecordPatch record: MorynRecord, patch: Record : MorynRe… Evidence: `src/core/replay.ts`
- **Schema** (source_file): import { z } from "zod"; import type { MorynEvent } from "./types.js"; ⋮---- export function isValidPatchPath path: string : boolean ⋮---- export type ParsedRecord = z.infer ; ⋮---- export type ParsedEvent = z.infer ; ⋮---- interface SchemaValidationIssue { code: string; path: Array ; path string: string; message: string; expected?: unknown; } ⋮---- function pathString path: Array : string ⋮---- function validationIssue issue: z.core.$ZodIssue : SchemaValidationIssue ⋮---- class MorynSchemaValidationError extends Error ⋮---- constructor schema: "record" "event", error: z.ZodError ⋮---- export function parseRecord input: unknown : ParsedRecord ⋮---- export function parseEvent input: unknown… Evidence: `src/core/schema.ts`
- **Setup Wizard** (source_file): import { join, resolve } from "node:path"; import { stat } from "node:fs/promises"; import { readStoreConfig, initializeStore } from "./config.js"; import { readProjectConfig, initializeProjectConfig } from "./project.js"; import { normalizeHostId, planInstall, type HostAdapterId, type InstallPlanAction } from "./host-adapters.js"; ⋮---- export type SetupWizardCheckId = "store" "project" "sync" "host adapter"; export type SetupWizardCheckStatus = "ready" "missing" "manual" "skipped"; export type SetupWizardMode = "dry run" "apply"; export type SetupWizardStatus = "ready" "needs setup"; ⋮---- export type SetupWizardCheck = { id: SetupWizardCheckId; status: SetupWizardCheckStatus; message: st… Evidence: `src/core/setup-wizard.ts`
- **Store** (source_file): import { access, mkdir, readdir, readFile, rename, rm, writeFile } from "node:fs/promises"; import { dirname, join } from "node:path"; import type { MorynEvent } from "./types.js"; import { parseEvent } from "./schema.js"; import { detectSensitiveContent, sensitiveScanText } from "./sensitive.js"; import { readStoreConfig, validateStorePath } from "./config.js"; ⋮---- function monthFromIso iso: string : string ⋮---- function deviceFromEvent event: MorynEvent : string ⋮---- class EventPathComponentArgumentError extends Error ⋮---- constructor name: string, value: string ⋮---- function assertSafeEventPathComponent value: string, name: string : void ⋮---- function eventPath storePath: string,… Evidence: `src/core/store.ts`
- **Types** (source_file): export type RecordKind = "memory" "skill" "soul" "session summary" "agent note"; export type RecordState = "raw" "candidate" "canonical" "archived" "quarantined"; export type RecordScope = "global" "project" "topic" "session" "artifact"; export type RecordPriority = "low" "normal" "high"; export type RecordVisibility = "active" "archived" "quarantined"; ⋮---- export interface RecordContent { text?: string; format?: "text" "json"; key: string : unknown; } ⋮---- export interface RecordSource { client: string; session id?: string; model?: string; device id?: string; } ⋮---- export interface RecordProvenance { derived from?: string ; reason?: string; method?: "agent-proposed" "rule-promoted" "u… Evidence: `src/core/types.ts`
- **Server** (source_file): import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { getOperationContract, getOperationContractByCliCommand, getOperationContractByMcpTool, getOperationContractIndex, getOperationContracts, getSelectionSourceContracts, captureSession, contextPack, planInstall, setupWizard, version } from "../index.js"; import { OperationContractLookupConflictError, OperationContractLookupError, type OperationContractLookupOption, operationArgumentsByTool, type OperationArgumentMetadata, validateOperationContractIndexArgument, validateOperationContractLookupArgument } from "../o… Evidence: `src/mcp/server.ts`
- **Dashboard Maintenance** (source_file): import { createHash } from "node:crypto"; import { displayRecordText } from "../core/content-text.js"; import { createEngine } from "../core/engine.js"; import { replayEvents } from "../core/replay.js"; import { readEvents } from "../core/store.js"; import type { MorynRecord, RecordState } from "../core/types.js"; ⋮---- export type DashboardMaintenancePlanType = "project identity repair" "candidate noise archive"; ⋮---- export interface DashboardMaintenanceSafetyCheck { id: "dry run completed" "target project explicit" "candidate noise detected" "no private records" "append only"; label: string; ok: boolean; } ⋮---- export interface DashboardMaintenanceDecisionCard { title: string; issue: s… Evidence: `src/observability/dashboard-maintenance.ts`
- **Dashboard** (source_file): import { execFile } from "node:child process"; import { mkdir, writeFile } from "node:fs/promises"; import { createServer, type IncomingMessage, type Server, type ServerResponse } from "node:http"; import type { AddressInfo } from "node:net"; import { join } from "node:path"; import { pathToFileURL } from "node:url"; import { promisify } from "node:util"; import { normalizeAgentIdentity } from "../core/agent-identity.js"; import { DEFAULT AUTOCAPTURE POLICY, type AutocapturePolicyDecision, type AutocapturePolicyRuleId } from "../core/autocapture-policy.js"; import { diagnoseCapturePolicy, type CapturePolicyResult } from "../core/capture-policy-report.js"; import { currentAutocaptureDecision… Evidence: `src/observability/dashboard.ts`
- **Tsconfig** (structured_config): { "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true, "outDir": "dist", "rootDir": "src", "declaration": true, "sourceMap": true }, "include": "src/ / .ts" , "exclude": "dist", "node modules" } Evidence: `tsconfig.json`
- **.gitignore** (source_file): .worktrees/ node modules/ dist/ coverage/ docs/releases/ docs/superpowers/ /.moryn/ /.moryn.json /.gemini/ .tgz Evidence: `.gitignore`
- **Agent Lifecycle Smoke** (source_file): function log message ⋮---- function parseArgs argv ⋮---- async function run command, args, options = ⋮---- async function runJson command, args, options = ⋮---- function requireAction actions, action, tool ⋮---- function requireChange output, summary ⋮---- function requireRecentChange output, summary ⋮---- async function resolveMorynCommand useSource ⋮---- async function main Evidence: `scripts/agent-lifecycle-smoke.js`
- **Dogfood Demo Smoke** (source_file): function log message ⋮---- function parseArgs argv ⋮---- async function run command, args, options = ⋮---- async function runJson command, args, options = ⋮---- async function resolveMorynCommand useSource ⋮---- function requireMatch value, expected, message ⋮---- async function main Evidence: `scripts/dogfood-demo-smoke.js`
- **Release Check** (source_file): import { execFile } from "node:child process"; import { mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join, resolve } from "node:path"; import { pathToFileURL } from "node:url"; import { promisify } from "node:util"; ⋮---- interface RunOptions { cwd?: string; env?: NodeJS.ProcessEnv; } ⋮---- function log message: string : void ⋮---- async function run command: string, args: string , options: RunOptions = ⋮---- export function assertSafePackageFiles files: string : void ⋮---- export function assertPackageFilesComplete files: string : void ⋮---- async function assertPackageContentsAreSafe : Promise ⋮---- async function runPrivateGitRemoteValidation remote:… Evidence: `scripts/release-check.ts`
- **Index** (source_file): import { DISCOVERED LIFECYCLE STEP SELECTION SOURCES, DISCOVER PROJECT SELECTION SOURCES, DOCTOR SELECTION SOURCES, GUIDE ENTRYPOINT SELECTION SOURCES, GUIDE LIFECYCLE STEP SELECTION SOURCES, GUIDE SELECTION SOURCES, HANDOFF SELECTION SOURCES, LIFECYCLE ACTION SELECTION SOURCES, LIFECYCLE NEXT SELECTION SOURCES } from "./core/agent-lifecycle.js"; import { STORE INIT SELECTION SOURCES } from "./core/config.js"; import { DEFAULT AUTOCAPTURE POLICY } from "./core/autocapture-policy.js"; import { REBUILD SELECTION SOURCES } from "./core/derived.js"; import { CAPTURE POLICY SELECTION SOURCES } from "./core/capture-policy-report.js"; import { DOGFOOD REPORT SELECTION SOURCES } from "./core/dogfoo… Evidence: `src/index.ts`
- **Operation Contracts** (source_file): import { actionExecution, actionSafety, type ActionExecution, type ActionSafety } from "./core/action-safety.js"; import { commandLineForCliInterface } from "./core/cli-command-line.js"; import { PROJECT SYNC MODE INPUTS } from "./core/project.js"; import { PROVENANCE METHODS, RECORD KINDS, RECORD PRIORITIES, RECORD SCOPES, RECORD STATES } from "./core/schema.js"; import { requiredFieldsByName, type RequiredFieldMetadata } from "./core/workflow.js"; ⋮---- type OperationCategory = "setup" "core" "sync" "lifecycle" "contracts" "maintenance" "observability"; ⋮---- type OperationInterfaces = { cli: { command: string; command line: string; argv: string ; executable: string; args: string ; exec f… Evidence: `src/operation-contracts.ts`

## 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`, `package.json`, `docs/moryn-design.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: `README.md`, `package.json`, `docs/moryn-design.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 & System Architecture**: importance `high`
  - source_paths: README.md, src/core/types.ts, src/core/schema.ts, src/core/engine.ts, src/core/store.ts
- **Agent Integration & Command Surface**: importance `high`
  - source_paths: src/cli.ts, src/mcp/server.ts, src/core/host-adapter-registry.ts, src/core/host-adapters.ts, src/core/agent-lifecycle.ts
- **Memory Lifecycle, Capture & Safety Model**: importance `high`
  - source_paths: src/core/capture-review.ts, src/core/autocapture-policy.ts, src/core/capture-policy-report.ts, src/core/memory-lifecycle.ts, src/core/memory-doctor.ts
- **Dashboard, Sync & Operations**: importance `high`
  - source_paths: src/observability/dashboard.ts, src/observability/dashboard-maintenance.ts, src/core/replay.ts, src/core/derived.ts, src/core/config.ts

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `cb7fede3ca38a199798d34ecec0d50fa4b069786`
- inspected_files: `README.md`, `package.json`, `docs/agent-install-prompt.md`, `docs/agent-workflow.md`, `docs/contracts.md`, `docs/dashboard.md`, `docs/development.md`, `docs/implementation-roadmap.md`, `docs/moryn-design.md`, `src/cli.ts`, `src/core/action-interfaces.ts`, `src/core/action-safety.ts`, `src/core/agent-identity.ts`, `src/core/agent-lifecycle.ts`, `src/core/autocapture-policy.ts`, `src/core/capture-policy-report.ts`, `src/core/capture-review.ts`, `src/core/cli-command-line.ts`, `src/core/config.ts`, `src/core/content-text.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/Richardyu114/Moryn
- 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/Richardyu114/Moryn
- 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/Richardyu114/Moryn
- 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/Richardyu114/Moryn
- 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/Richardyu114/Moryn
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
