.agents/memory/2026-02-23-identity-files-missing-from-harness-configs.md

25 lines
1.7 KiB
Markdown

# 2026-02-23 Session Notes
## Identity Files Missing from Harness Configs
User presented a detailed plan to fix a critical discrepancy between the Signet source files at `~/.agents/` and what reaches Claude Code and OpenCode. Three identity files are completely absent from generated harness configs:
- **SOUL.md** — formatting rules, tone/style, reasoning methodology
- **IDENTITY.md** — agent name, speaking mannerisms, emoticon preferences
- **USER.md** — user profile, timezone, discord IDs, trust permissions, project locations
Both harnesses use dual channels for identity: static config files (`~/.claude/CLAUDE.md` and `~/.config/opencode/AGENTS.md`) and dynamic session-start hook injection. Currently both channels only include AGENTS.md content.
## Implementation Plan Overview
The plan addresses five distinct code locations:
1. **hooks.ts** — Add `readIdentityFile()` helper; update `handleSessionStart()` to inject SOUL.md, IDENTITY.md, USER.md before MEMORY.md
2. **daemon.ts** — Refactor `syncHarnessConfigs()` to compose all identity files; expand file watcher trigger to include SOUL.md, IDENTITY.md, USER.md
3. **connector-claude-code** — Update `generateClaudeMd()` and `generateFromIdentity()` to append all identity files
4. **connector-opencode** — Update `generateAgentsMd()` to include all identity files
5. **Python templates** — Update both `generate-harness-configs.py` scripts to read all identity files
The final injection order for session-start hook: memory header → AGENTS.md → SOUL.md → IDENTITY.md → USER.md → MEMORY.md → DB memories.
Verification includes build passes, typecheck, testing hook output, daemon restart with file edits, and generated file structure validation.