diff --git a/docs/superpowers/plans/2026-06-02-agent-config-refresh.md b/docs/superpowers/plans/2026-06-02-agent-config-refresh.md new file mode 100644 index 00000000..ee5b4a55 --- /dev/null +++ b/docs/superpowers/plans/2026-06-02-agent-config-refresh.md @@ -0,0 +1,458 @@ +# Agent Config Refresh Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Apply the explicit divergence model to `AGENTS.md`, `CLAUDE.md`, and `GEMINI.md`. `AGENTS.md` becomes a thin pointer document (~1K). `CLAUDE.md` becomes a 1-line deprecation stub. `GEMINI.md` is lightly refreshed to remove any content that should have moved to `AGENTS.md`. Light verification pass (not rewrites) on the skill files in `.agents/`, `.gemini/`, and the legacy `.claude/commands/`. + +**Architecture:** Single-agent sequential execution. Each top-level file is its own task. Skill file verification is a separate task that touches many files but only makes surgical edits where drift is found. + +**Tech Stack:** Manual Slop's MCP research tools. Git for version control. + +**Spec:** `docs/superpowers/specs/2026-06-02-comprehensive-documentation-refresh-design.md` §6 (Sub-Track 3). + +**Depends on:** Sub-Track 1 (`docs_layer_refresh_20260602`) must complete first. The human-facing docs are the source of truth that the agent config files point to. + +--- + +## Execution Constraints + +These apply to every task in this plan: + +- **No subagents.** Execute as a single agent. +- **Pre-edit checkpoint:** Before any file edit, run `git add .`. +- **Per-file atomic commits:** One file = one commit. The skill file verification task may have many commits (one per file) since there are many files, but each is still atomic. +- **Commit message format:** `docs(): `. +- **Git note format:** Attach a 3-8 line rationale to each commit. +- **The "no content duplication" rule:** After this plan completes, a section header that appears in 2+ of `AGENTS.md`/`CLAUDE.md`/`GEMINI.md` must be either (a) a short pointer (≤3 lines) to the canonical home, or (b) a violation to fix. + +--- + +## Task 1: Rewrite `AGENTS.md` to a Thin Pointer + +**Files:** +- Modify: `AGENTS.md` (current size ~5.4K) + +**Target structure:** A thin orientation document of ~1K that: +- Describes what Manual Slop is (1-2 sentences) +- States the conductor convention (1 paragraph) +- Lists the canonical locations for agent guidance (with file links) +- Lists the 5-6 most critical project-wide anti-patterns +- Points to `docs/Readme.md` for human-facing docs + +**Specific target content (use as a starting template, adapt to current state):** + +```markdown +# AGENTS.md + +## What This Is + +Manual Slop is a local GUI orchestrator for LLM-driven coding sessions. It bridges high-latency AI reasoning with a low-latency ImGui render loop via a thread-safe async pipeline; every AI-generated payload passes through a human-auditable gate before execution. + +## The Conductor Convention + +All AI agents consuming this project must read `./conductor/workflow.md` and treat `./conductor/tracks.md` as the task registry. Track implementation follows the TDD protocol documented in `conductor/workflow.md` with per-file atomic commits and git notes. + +## Guidance for AI Agents + +Detailed agent guidance lives in the following locations — read these directly, do not duplicate content here: + +- **Operational workflow:** `conductor/workflow.md` +- **Code style and process:** `conductor/product-guidelines.md` +- **Tech stack and constraints:** `conductor/tech-stack.md` +- **Product context:** `conductor/product.md` +- **MMA orchestrator role:** `mma-orchestrator/SKILL.md` +- **Tier 1 (Orchestrator):** `.agents/skills/mma-tier1-orchestrator/SKILL.md` +- **Tier 2 (Tech Lead):** `.agents/skills/mma-tier2-tech-lead/SKILL.md` +- **Tier 3 (Worker):** `.agents/skills/mma-tier3-worker/SKILL.md` +- **Tier 4 (QA):** `.agents/skills/mma-tier4-qa/SKILL.md` + +## Human-Facing Documentation + +For understanding, using, and maintaining the tool, see `docs/Readme.md` and the guides it indexes. + +## Critical Anti-Patterns + +- Do not read full files >50 lines without first using `py_get_skeleton` or `get_file_summary` +- Do not modify the tech stack without updating `conductor/tech-stack.md` first +- Do not implement code directly as Tier 2 — delegate to Tier 3 workers (or in the case of this docs track, do it yourself as a single agent) +- Do not skip TDD — write failing tests before implementation +- Do not batch commits — commit per-task for atomic rollback +- Do not add comments to source code; documentation lives in `/docs` +``` + +- [ ] **Step 1.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 1.2: Read the current `AGENTS.md`** + +Use `manual-slop_read_file` (the file is small enough to read in full). + +- [ ] **Step 1.3: Inventory what content currently lives in `AGENTS.md`** + +For each major section in the current file, note: +- **Keep here:** Project-level orientation, anti-patterns, the conductor convention +- **Move to `conductor/workflow.md`:** Workflow details +- **Move to `conductor/product-guidelines.md`:** Style rules +- **Move to `conductor/tech-stack.md`:** Tech stack details +- **Move to `conductor/product.md`:** Feature descriptions +- **Move to `mma-orchestrator/SKILL.md`:** MMA role details +- **Move to the relevant `.agents/skills/*/SKILL.md`:** Tier-specific guidance +- **Move to `docs/Readme.md`:** Anything that documents the tool for humans (not agents) + +- [ ] **Step 1.4: Verify the target skill files exist and have the content** + +Before writing `AGENTS.md`, confirm: +- `mma-orchestrator/SKILL.md` exists +- `.agents/skills/mma-tier1-orchestrator/SKILL.md` exists +- `.agents/skills/mma-tier2-tech-lead/SKILL.md` exists +- `.agents/skills/mma-tier3-worker/SKILL.md` exists +- `.agents/skills/mma-tier4-qa/SKILL.md` exists +- `conductor/workflow.md` exists +- `conductor/product-guidelines.md` exists +- `conductor/tech-stack.md` exists +- `conductor/product.md` exists +- `docs/Readme.md` exists (and is updated per Sub-Track 1) + +If any are missing, do NOT write `AGENTS.md` until they exist. (They should exist by the time Sub-Track 3 runs, since Sub-Track 1 has completed.) + +- [ ] **Step 1.5: Write the new `AGENTS.md`** + +Use the target structure above as a starting template. Adapt the language to match the project's style. Keep the file under 1.5K. + +- [ ] **Step 1.6: Validate all cross-doc links in the new file** + +For every `[text](./relative/path)` or file mention: +- Use `manual-slop_search_files` to confirm the target exists +- If broken, fix the link or remove the mention + +- [ ] **Step 1.7: Confirm size is reasonable** + +```powershell +(Get-Item C:\projects\manual_slop\AGENTS.md).Length +``` + +Should be ≤ 1500 bytes. If larger, trim. + +- [ ] **Step 1.8: Commit** + +```powershell +git -C C:\projects\manual_slop add AGENTS.md +git -C C:\projects\manual_slop commit -m "docs(agents): rewrite as thin pointer document; defer to skill files and conductor docs" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Reduced from [N]K to ~1K. Content relocated to: [list canonical homes]. Anti-patterns compressed to 6 most critical." $_ } +``` + +--- + +## Task 2: Replace `CLAUDE.md` with a 1-Line Stub + +**Files:** +- Modify: `CLAUDE.md` (current size ~6.7K) + +**Target content:** A 1-line deprecation stub that preserves the file's existence for any external tooling that may reference it. + +- [ ] **Step 2.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 2.2: Read the current `CLAUDE.md`** + +- [ ] **Step 2.3: Verify no external scripts reference the CLAUDE.md content** + +Use `manual-slop_py_find_usages` to grep for any code that reads CLAUDE.md's specific sections. If anything does, the stub approach still works (the script will get a 1-line file instead of the rich content, but it's a graceful failure). + +If critical tooling depends on the rich content, flag this to the user before continuing. + +- [ ] **Step 2.4: Write the stub** + +```markdown +# CLAUDE.md + +This project is no longer actively used with Claude Code. For project context, see `AGENTS.md`. The conductor system in `./conductor/` is the cross-tool abstraction and works with any agent toolchain. +``` + +- [ ] **Step 2.5: Confirm size is small** + +```powershell +(Get-Item C:\projects\manual_slop\CLAUDE.md).Length +``` + +Should be ≤ 500 bytes. + +- [ ] **Step 2.6: Commit** + +```powershell +git -C C:\projects\manual_slop add CLAUDE.md +git -C C:\projects\manual_slop commit -m "docs(claude): replace with deprecation stub; project no longer uses Claude Code" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Reduced from [N]K to stub. Preserves file existence for any legacy tooling. Project migrated to Gemini CLI + OpenCode." $_ } +``` + +--- + +## Task 3: Refresh `GEMINI.md` + +**Files:** +- Modify: `GEMINI.md` (current size ~3.8K) +- Reference: `conductor/product.md` (now updated per Sub-Track 2), `conductor/tech-stack.md`, `src/gemini_cli_adapter.py` + +**Scope:** This file should contain ONLY Gemini-CLI-specific content. Any content that was previously shared with `AGENTS.md` and has been relocated should now point to `AGENTS.md` instead. + +- [ ] **Step 3.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 3.2: Read the current `GEMINI.md`** + +- [ ] **Step 3.3: Identify any content in `GEMINI.md` that is not Gemini-specific** + +For each section, ask: "Would this content be useful to an agent that is NOT using Gemini CLI?" If yes, it should be in `AGENTS.md` or a conductor doc, not here. + +Likely candidates to move out (or point to canonical home): +- General MMA tier descriptions (should be in `AGENTS.md` or `mma-orchestrator/SKILL.md`) +- General session startup checklist (should be in `AGENTS.md`) +- General anti-patterns (should be in `AGENTS.md` or `conductor/product-guidelines.md`) + +Content that should stay (Gemini-CLI-specific): +- Gemini model routing per MMA tier +- `activate_skill` usage for MMA roles +- Gemini CLI bridge architecture (`gemini_cli_adapter.py`, `GEMINI_CLI_HOOK_CONTEXT`, synchronous HITL approval) +- Gemini-specific caching/TTL behavior +- Provider-specific quirks (cache rebuilding at 90% TTL, server-side context cache) +- `gemini-3.1-pro-preview` / `gemini-3-flash-preview` / `gemini-2.5-flash-lite` model names + +- [ ] **Step 3.4: Rewrite `GEMINI.md` to contain only Gemini-CLI-specific content** + +For each non-Gemini-specific section, replace with a short pointer to the canonical home (e.g., "See `AGENTS.md` for the MMA tier overview. This document covers Gemini-CLI-specific implementation only."). + +- [ ] **Step 3.5: Verify Gemini-specific content is accurate** + +For each Gemini-specific claim: +- Verify model names match `conductor/tech-stack.md` +- Verify TTL/cache behavior matches `src/ai_client.py` and `src/gemini_cli_adapter.py` +- Verify the bridge architecture description matches the actual code + +- [ ] **Step 3.6: Validate all cross-doc links** + +- [ ] **Step 3.7: Commit** + +```powershell +git -C C:\projects\manual_slop add GEMINI.md +git -C C:\projects\manual_slop commit -m "docs(gemini): refresh and reduce to Gemini-CLI-specific content" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Replaced [N] sections with pointers to AGENTS.md. Kept [list of Gemini-specific sections]." $_ } +``` + +--- + +## Task 4: Light Verification of `.agents/skills/*/SKILL.md` and `mma-orchestrator/SKILL.md` + +**Files:** +- Read: `mma-orchestrator/SKILL.md` (~9.3K) +- Read: `.agents/skills/mma-tier1-orchestrator/SKILL.md` (~2.4K) +- Read: `.agents/skills/mma-tier2-tech-lead/SKILL.md` (~3.8K) +- Read: `.agents/skills/mma-tier3-worker/SKILL.md` +- Read: `.agents/skills/mma-tier4-qa/SKILL.md` (~813 bytes) +- Read: `.agents/skills/mma-orchestrator/SKILL.md` (~9.7K) + +**Scope:** This is a LIGHT verification pass. For each file: +1. Read it +2. Confirm it covers the role accurately (cross-reference with the orchestrator skill's role description) +3. If drift is found, make a surgical fix +4. If the file is fundamentally outdated, FLAG for a separate track — do NOT rewrite wholesale here + +- [ ] **Step 4.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 4.2: Read the canonical orchestrator skill** + +Use `manual-slop_read_file` on `mma-orchestrator/SKILL.md`. This is the source of truth for the MMA architecture. + +- [ ] **Step 4.3: For each tier skill (1-4), verify role accuracy** + +For each `.agents/skills/mma-tierN-*/SKILL.md`: +- Read it (use `manual-slop_read_file`) +- Cross-reference with the orchestrator skill's description of the tier +- Note any drift: missing responsibilities, stale model names, wrong tool references + +- [ ] **Step 4.4: For each drift found, make a surgical fix** + +If the drift is small (a model name, a tool name, a single responsibility statement): +- Make the fix in place +- Commit per file + +If the drift is large (the whole role description is outdated): +- DO NOT rewrite in this plan +- Note it in the commit message +- Add a task to a SEPARATE follow-up track (do not create new tasks in this plan) + +- [ ] **Step 4.5: For each file with a surgical fix, commit** + +```powershell +git -C C:\projects\manual_slop add .agents/skills/mma-tierN-*/SKILL.md +git -C C:\projects\manual_slop commit -m "docs(skills): fix drift in [tierN] skill - [specific fix]" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Found drift: [description]. Surgical fix applied: [what changed]. Larger rewrites deferred to [reason]." $_ } +``` + +- [ ] **Step 4.6: If no drift is found, commit an empty verification log** + +```powershell +git -C C:\projects\manual_slop commit --allow-empty -m "docs(skills): verify all 5 skill files are coherent with orchestrator SKILL.md" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Read all 5 skill files. Cross-referenced with orchestrator SKILL.md. No drift found." $_ } +``` + +--- + +## Task 5: Light Verification of `.gemini/...` Mirrors + +**Files:** +- Read: `.gemini/skills/mma-orchestrator/SKILL.md` +- Read: `.gemini/skills/mma-tier1-orchestrator/SKILL.md` +- Read: `.gemini/skills/mma-tier2-tech-lead/SKILL.md` +- Read: `.gemini/skills/mma-tier3-worker/SKILL.md` +- Read: `.gemini/skills/mma-tier4-qa/SKILL.md` +- Read: `.gemini/agents/tier1-orchestrator.md` +- Read: `.gemini/agents/tier2-tech-lead.md` +- Read: `.gemini/agents/tier3-worker.md` +- Read: `.gemini/agents/tier4-qa.md` + +**Scope:** Compare the `.gemini/` mirror files against their canonical counterparts (`.agents/...`). If drift is found, fix it. This is the same LIGHT verification as Task 4 but for the Gemini-specific mirrors. + +- [ ] **Step 5.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 5.2: For each `.gemini/...` file, compare to its canonical counterpart** + +For each file: +- Read both the mirror and the canonical +- Diff them +- If different, determine which is the source of truth +- If the mirror is stale, fix it to match the canonical (or vice versa, depending on the file's role) + +- [ ] **Step 5.3: For each drift found, commit per file** + +```powershell +git -C C:\projects\manual_slop add .gemini/[path] +git -C C:\projects\manual_slop commit -m "docs(gemini-mirror): sync [file] with [canonical source]" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Mirror was out of sync. Updated to match canonical [path]." $_ } +``` + +--- + +## Task 6: Light Verification of `.claude/commands/*.md` (Legacy) + +**Files:** +- Read: every file in `.claude/commands/` (9 files per the directory listing) + +**Scope:** These are legacy files for backward compatibility. Lightly verify they still work and don't reference removed features. Do NOT rewrite — they are legacy. + +- [ ] **Step 6.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 6.2: Read each file and check for broken references** + +For each `.claude/commands/*.md`: +- Use `manual-slop_read_file` (they're small) +- Check for references to removed features (e.g., `gui_legacy.py`, `tkinter`, removed modules) +- Check for links that no longer resolve + +- [ ] **Step 6.3: For each broken reference, decide** + +Options: +- (a) Fix the broken reference (small edit) +- (b) Add a "(DEPRECATED)" notice to the file +- (c) Leave alone (legacy) + +Default: (a) if it's a trivial fix (e.g., a link to a renamed file). (b) if the whole file is suspect. (c) if it's working and just old. + +- [ ] **Step 6.4: For each file with a fix, commit per file** + +```powershell +git -C C:\projects\manual_slop add .claude/commands/[file] +git -C C:\projects\manual_slop commit -m "docs(claude-commands): fix broken reference in [file]" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Found broken reference to [X]. Fixed by [what]." $_ } +``` + +--- + +## Task 7: Sub-Track 3 Verification (Drift Check) + +- [ ] **Step 7.1: Section header drift audit** + +For the section headers that should have been relocated, confirm each appears in at most one of `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`: + +```powershell +$headers = @("Session Startup", "Conductor System", "MMA 4-Tier", "Anti-Patterns", "Development Workflow", "Code Style", "MCP Tool") +foreach ($h in $headers) { + $inAgents = Select-String -Path C:\projects\manual_slop\AGENTS.md -Pattern $h -SimpleMatch -Quiet + $inClaude = Select-String -Path C:\projects\manual_slop\CLAUDE.md -Pattern $h -SimpleMatch -Quiet + $inGemini = Select-String -Path C:\projects\manual_slop\GEMINI.md -Pattern $h -SimpleMatch -Quiet + $count = @($inAgents, $inClaude, $inGemini) | Where-Object { $_ } | Measure-Object | Select-Object -ExpandProperty Count + if ($count -gt 1) { Write-Host "DRIFT: '$h' appears in $count files" } +} +``` + +If any header appears in 2+ files, the divergence model is violated. Either: +- (a) The duplicate is a short pointer (≤3 lines) → OK +- (b) The duplicate is full content → Fix by relocating + +- [ ] **Step 7.2: Size sanity check** + +```powershell +(Get-Item C:\projects\manual_slop\AGENTS.md).Length +(Get-Item C:\projects\manual_slop\CLAUDE.md).Length +(Get-Item C:\projects\manual_slop\GEMINI.md).Length +``` + +- AGENTS.md should be ≤ 1.5K +- CLAUDE.md should be ≤ 500 bytes +- GEMINI.md can be larger (Gemini-specific content is allowed) but should not contain duplicated agent-orientation content + +- [ ] **Step 7.3: Link validation** + +For every `[text](./relative/path)` in each of the 3 files, verify the target exists. + +- [ ] **Step 7.4: Per-file commit verification** + +```powershell +git -C C:\projects\manual_slop log --oneline -- AGENTS.md CLAUDE.md GEMINI.md .agents/ .gemini/ .claude/ | head -30 +``` + +Confirm every file has its own commit history (not batched). + +- [ ] **Step 7.5: Git note verification** + +```powershell +git -C C:\projects\manual_slop log --format="%H" -- AGENTS.md CLAUDE.md GEMINI.md .agents/ .gemini/ .claude/ | Select-Object -First 20 | ForEach-Object { $note = git -C C:\projects\manual_slop notes show $_ 2>$null; if (-not $note) { Write-Host "MISSING NOTE: $_" } } +``` + +- [ ] **Step 7.6: Phase completion checkpoint** + +Per the project's Phase Completion Verification protocol in `conductor/workflow.md`: +- Run the automated test suite +- Present the verification report to the user +- Get user sign-off +- Create the checkpoint commit: `conductor(checkpoint): Sub-Track 3 (agent config refresh) complete` +- Attach the verification report as a git note + +--- + +## Self-Review (after writing this plan) + +1. **Spec coverage:** Spec §6 has 6 phases (3.1-3.6). Tasks 1-3 cover 3.1-3.3. Tasks 4-6 cover 3.4-3.5 (skills, mirrors, legacy commands). Task 7 covers 3.6 (verification). ✓ All phases covered. +2. **Placeholder scan:** No "TBD" / "TODO" markers. The "If drift is found, fix it; if fundamentally outdated, flag for separate track" decision rule is explicit in Task 4.4. ✓ +3. **Type/symbol consistency:** File paths, section header names, and the drift audit script are all consistent. ✓ +4. **Risk check:** The stub approach for CLAUDE.md preserves compatibility. The "light verification, flag for separate track" pattern prevents scope creep. The drift audit script in Step 7.1 is concrete and runnable. ✓ diff --git a/docs/superpowers/plans/2026-06-02-conductor-docs-refresh.md b/docs/superpowers/plans/2026-06-02-conductor-docs-refresh.md new file mode 100644 index 00000000..5fa25414 --- /dev/null +++ b/docs/superpowers/plans/2026-06-02-conductor-docs-refresh.md @@ -0,0 +1,339 @@ +# Conductor Docs Refresh Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Sync the source-of-truth conductor docs (`conductor/product.md`, `conductor/product-guidelines.md`, `conductor/tech-stack.md`, `conductor/workflow.md`, `conductor/index.md`) to reflect the current state of the codebase after 4 months of evolution since the last docs refresh. + +**Architecture:** Single-agent sequential execution. Each conductor doc is a self-contained task: audit current claims against the actual codebase, identify drift, rewrite stale sections, commit per-file, attach git note. No new conductor docs are written in this plan (those are out of scope per the spec). + +**Tech Stack:** Manual Slop's MCP research tools. Git for version control. Markdown for documentation. + +**Spec:** `docs/superpowers/specs/2026-06-02-comprehensive-documentation-refresh-design.md` §5 (Sub-Track 2). + +**Depends on:** Sub-Track 1 (`docs_layer_refresh_20260602`) must complete first. The human-facing docs layer is the source of truth that this plan syncs to. + +--- + +## Execution Constraints + +These apply to every task in this plan: + +- **No subagents.** Execute as a single agent. No Tier 3/Tier 4 delegation. No parallel workers. +- **Pre-edit checkpoint:** Before any file edit, run `git add .` to stage current state. +- **Per-file atomic commits:** One file = one commit. Never batch. +- **Commit message format:** `docs(): `. +- **Git note format:** Attach a 3-8 line rationale to each commit. +- **Symbol parity:** Every class, function, module, or dep name in these docs must match the source. +- **The conductor docs are the source of truth** for the rest of the project. Anything documented here must be verifiable in the codebase. + +--- + +## Task 1: Sync `conductor/product.md` + +**Files:** +- Modify: `conductor/product.md` (current size ~23.1K) +- Reference: `src/` directory (every module), `docs/Readme.md` (now updated per Sub-Track 1), `docs/guide_*.md` + +**Scope:** This is the product vision / feature list document. Every feature claim must correspond to a real subsystem. Every subsystem should appear. No "planned" or "in progress" features should be listed as if they exist (unless they're in the active backlog). + +- [ ] **Step 1.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 1.2: Read the current `conductor/product.md`** + +Use `manual-slop_get_file_summary` first, then `manual-slop_get_file_slice` for sections. + +- [ ] **Step 1.3: Inventory every src/ module** + +Use `manual-slop_list_directory path="C:\projects\manual_slop\src"` to get the current module list. For each module, use `manual-slop_get_file_summary` to understand its purpose. + +Map each module to a feature. Note: the modules in `src/` are the source of truth for what exists. + +- [ ] **Step 1.4: Compare modules to feature claims in `product.md`** + +Build a comparison: +- **Modules in `src/` not mentioned in `product.md`:** [list] — these are missing features +- **Features in `product.md` with no corresponding module:** [list] — these are stale claims +- **Features with a module that does something different than `product.md` claims:** [list] — these are stale descriptions + +- [ ] **Step 1.5: Add missing features** + +For each module not mentioned in `product.md`: +- Find the most relevant existing section in `product.md` +- Add a sub-bullet or paragraph describing the feature +- Use the gap analysis from Sub-Track 1's `gap_analysis.md` as a cross-reference + +Pay particular attention to: RAG, Beads, Hot Reload, Discussion Metrics/Compression, Command Palette, Structural File Editor, NERV Theme, Persona Editor, Workspace Profiles, History (undo/redo), External MCP, Synced HITL Bridge, External Editor Integration. + +- [ ] **Step 1.6: Remove or correct stale claims** + +For each feature claim that no longer matches the code: +- If the feature was removed, delete the claim +- If the feature was renamed or restructured, update the description +- If the feature was culled (per the Culling Candidates report), remove the claim + +- [ ] **Step 1.7: Update the "Primary Use Cases" section** + +If real-world usage patterns have evolved (e.g., the user mentioned Claude is no longer used), update the use cases to reflect actual current usage. + +- [ ] **Step 1.8: Validate all cross-doc links** + +For every `[text](./relative/path)` in the modified `product.md`, verify the target exists. + +- [ ] **Step 1.9: Commit per-section (one commit per logical group of changes)** + +For example: +- If you added 5 new features, that's 1 commit: `docs(product): add RAG, Beads, Hot Reload, and 2 more features` +- If you corrected 3 stale claims, that's 1 commit: `docs(product): correct stale claims for X, Y, Z` +- If you removed 2 culled features, that's 1 commit: `docs(product): remove culled features X, Y` + +```powershell +git -C C:\projects\manual_slop add conductor/product.md +git -C C:\projects\manual_slop commit -m "docs(product): " +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Sync rationale: [what was stale, what was added, what was removed]." $_ } +``` + +--- + +## Task 2: Sync `conductor/tech-stack.md` + +**Files:** +- Modify: `conductor/tech-stack.md` +- Reference: `pyproject.toml`, `requirements.txt`, `src/` (every module) + +**Scope:** Every entry must be a real Python dep (verify in `pyproject.toml` or `requirements.txt`) or a real `src/` module. No "we use X" claims without verification. + +- [ ] **Step 2.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 2.2: Read the current `conductor/tech-stack.md`** + +- [ ] **Step 2.3: Read `pyproject.toml` to get the canonical dep list** + +Use `manual-slop_read_file` (it's small). + +- [ ] **Step 2.4: For each dep claim in `tech-stack.md`, verify it exists in `pyproject.toml`** + +Use `manual-slop_py_find_usages` or grep to confirm. Flag any claim that doesn't match. + +- [ ] **Step 2.5: For each `src/` module claim in `tech-stack.md`, verify it exists** + +Use `manual-slop_search_files` to confirm. + +- [ ] **Step 2.6: Add missing deps and modules** + +Likely missing entries (verify via Step 2.3-2.5): +- `chromadb` (RAG) +- `dolt` or any Beads dep +- `psutil` (performance monitoring) +- `pywin32` (window frame manipulation) +- `pydantic` (if used) +- New `src/` modules: `rag_engine.py`, `beads_client.py`, `hot_reloader.py`, `history.py`, `workspace_manager.py`, `theme_nerv.py`, `theme_nerv_fx.py`, `personas.py`, `presets.py`, `context_presets.py`, `tool_bias.py`, `tool_presets.py`, `synthesis_formatter.py`, `imgui_scopes.py`, etc. + +- [ ] **Step 2.7: Remove or correct stale claims** + +- [ ] **Step 2.8: Validate all cross-doc links** + +- [ ] **Step 2.9: Commit per-section** + +```powershell +git -C C:\projects\manual_slop add conductor/tech-stack.md +git -C C:\projects\manual_slop commit -m "docs(tech-stack): " +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Sync rationale: [added X deps/modules, removed Y stale claims]." $_ } +``` + +--- + +## Task 3: Sync `conductor/workflow.md` + +**Files:** +- Modify: `conductor/workflow.md` (current size ~25.2K) +- Reference: 5-10 recent completed tracks (read their `plan.md` files), the test suite, the pre-commit/lint scripts + +**Scope:** The task lifecycle, TDD protocol, phase completion verification, checkpointing. This is the document every conductor-driven agent reads. It must match actual practice. + +- [ ] **Step 3.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 3.2: Read the current `conductor/workflow.md`** + +- [ ] **Step 3.3: Spot-check 5 recent completed tracks for workflow compliance** + +Pick 5 tracks from `conductor/archive/` or `conductor/tracks/` (use `manual-slop_list_directory`). For each: +- Read its `plan.md` and `spec.md` +- Compare the actual workflow followed (commits, tests, checkpoint) to what `workflow.md` prescribes +- Note any drift: did the track skip a phase? Add a step that isn't in `workflow.md`? Skip a verification step? + +- [ ] **Step 3.4: Update `workflow.md` to match actual practice** + +If a phase is being consistently skipped, either (a) update the docs to make it optional, or (b) flag the drift and ask the user. Default: (a) — update the docs to match reality, then enforce via a future lint script (which is out of scope for this track). + +- [ ] **Step 3.5: Update the Phase Completion Verification section** + +Verify the protocol description matches the actual steps in recent tracks. Update if needed. + +- [ ] **Step 3.6: Update the Commit Guidelines section** + +Verify the message format examples match recent commits. Run `git log --oneline -20` to see the recent style. + +- [ ] **Step 3.7: Validate all cross-doc links** + +- [ ] **Step 3.8: Commit per-section** + +```powershell +git -C C:\projects\manual_slop add conductor/workflow.md +git -C C:\projects\manual_slop commit -m "docs(workflow): " +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Sync rationale: [drift findings and corrections]." $_ } +``` + +--- + +## Task 4: Sync `conductor/product-guidelines.md` + +**Files:** +- Modify: `conductor/product-guidelines.md` (current size ~6.6K) +- Reference: `src/app_controller.py`, `src/gui_2.py`, `src/imgui_scopes.py`, `scripts/check_imgui_scopes.py`, recent track style + +**Scope:** The AI-Optimized Python Style (1-space indent, no comments, type hints), Modular Controller Pattern, UI Delegation Pattern, Mandatory ImGui Verification, Structural Dependency Mapping (SDM) docstrings. These rules must match the actual code in `src/`. + +- [ ] **Step 4.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 4.2: Read the current `conductor/product-guidelines.md`** + +- [ ] **Step 4.3: Spot-check the style claims against actual `src/` code** + +For each style rule, sample 3 random files in `src/` and verify the rule is followed: +- **1-space indentation:** Use `manual-slop_get_file_slice` on a few files, look for any 4-space or tab-indented lines +- **No comments:** Use `grep` (via `manual-slop_run_powershell`) to find `#` characters in `src/*.py` (excluding shebangs, type comments, etc.) +- **Type hints:** Sample a few public function signatures +- **Modular Controller Pattern:** Check `src/app_controller.py` for module-level functions +- **UI Delegation Pattern:** Check `src/gui_2.py` for `render_xxx` module-level functions +- **SDM docstrings:** Check 3 random functions for `[C: ...]` and `[M: ...]` tags + +- [ ] **Step 4.4: Update the guidelines to match reality** + +If a rule is no longer followed: +- Option (a): Update the rule to be more accurate +- Option (b): Flag the drift and ask the user + +Default: (a) — but flag any major drift in the commit message so the user is aware. + +- [ ] **Step 4.5: Verify the Mandatory ImGui Verification claim** + +Check that `scripts/check_imgui_scopes.py` exists and works. If it's been replaced by `src/imgui_scopes.py` and a different linter, update the docs. + +- [ ] **Step 4.6: Validate all cross-doc links** + +- [ ] **Step 4.7: Commit per-section** + +```powershell +git -C C:\projects\manual_slop add conductor/product-guidelines.md +git -C C:\projects\manual_slop commit -m "docs(guidelines): " +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Sync rationale: [style drift findings, corrections made]." $_ } +``` + +--- + +## Task 5: Update `conductor/index.md` + +**Files:** +- Modify: `conductor/index.md` (current size 334 bytes) +- Reference: every file in `conductor/` + +**Scope:** The conductor directory index. Must link to all major conductor files. + +- [ ] **Step 5.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 5.2: Inventory `conductor/` directory** + +Use `manual-slop_get_tree path="C:\projects\manual_slop\conductor" max_depth=2`. + +- [ ] **Step 5.3: Identify any major conductor file not linked from `index.md`** + +Likely candidates: `conductor/code_styleguides/`, `conductor/fix_test_suite_failures_20260516.md`, any new top-level files. + +- [ ] **Step 5.4: Update `index.md` to link the missing files** + +- [ ] **Step 5.5: Validate all cross-doc links** + +- [ ] **Step 5.6: Commit** + +```powershell +git -C C:\projects\manual_slop add conductor/index.md +git -C C:\projects\manual_slop commit -m "docs(conductor): update index with [list of newly-linked files]" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Added links to [list]." $_ } +``` + +--- + +## Task 6: Sub-Track 2 Verification + +- [ ] **Step 6.1: Dep coverage audit** + +For every Python dep in `pyproject.toml`, confirm it appears in `conductor/tech-stack.md`. Use: + +```powershell +$deps = (Get-Content C:\projects\manual_slop\pyproject.toml | Select-String '^\s*"?[a-zA-Z][a-zA-Z0-9_-]*[><=~]' | ForEach-Object { ($_.ToString().Trim() -split '["><=~]')[0].Trim() } | Sort-Object -Unique) +foreach ($dep in $deps) { if (-not (Select-String -Path C:\projects\manual_slop\conductor\tech-stack.md -Pattern $dep -SimpleMatch -Quiet)) { Write-Host "MISSING: $dep" } } +``` + +- [ ] **Step 6.2: Module coverage audit** + +For every `.py` file in `src/`, confirm it appears in `conductor/tech-stack.md` or `conductor/product.md`. Use: + +```powershell +Get-ChildItem C:\projects\manual_slop\src\*.py | ForEach-Object { $name = $_.BaseName; if (-not (Select-String -Path C:\projects\manual_slop\conductor\tech-stack.md, C:\projects\manual_slop\conductor\product.md -Pattern $name -SimpleMatch -Quiet)) { Write-Host "MISSING: $name" } } +``` + +- [ ] **Step 6.3: Feature claim verification** + +For 3 random features claimed in `conductor/product.md`, verify each has a corresponding module and that the module does what the claim says. Use `manual-slop_get_file_summary` on the relevant module. + +- [ ] **Step 6.4: Per-file commit verification** + +```powershell +git -C C:\projects\manual_slop log --oneline -- conductor/product.md conductor/product-guidelines.md conductor/tech-stack.md conductor/workflow.md conductor/index.md | head -20 +``` + +Confirm every file has its own commit history (not batched). + +- [ ] **Step 6.5: Git note verification** + +```powershell +git -C C:\projects\manual_slop log --format="%H" -- conductor/ | Select-Object -First 20 | ForEach-Object { $note = git -C C:\projects\manual_slop notes show $_ 2>$null; if (-not $note) { Write-Host "MISSING NOTE: $_" } } +``` + +- [ ] **Step 6.6: Phase completion checkpoint** + +Per the project's Phase Completion Verification protocol in `conductor/workflow.md`: +- Run the automated test suite (or at least smoke tests) +- Present the verification report to the user +- Get user sign-off +- Create the checkpoint commit: `conductor(checkpoint): Sub-Track 2 (conductor docs refresh) complete` +- Attach the verification report as a git note + +--- + +## Self-Review (after writing this plan) + +1. **Spec coverage:** Spec §5 has 6 phases (2.1-2.6). Tasks 1-5 cover 2.1-2.5. Task 6 covers 2.6 (verification). ✓ All phases covered. +2. **Placeholder scan:** No "TBD" / "TODO" markers. Specific file paths, commit commands, and verification scripts throughout. ✓ +3. **Type/symbol consistency:** Module names and dep names referenced consistently. The audit scripts in Task 6 are concrete and runnable. ✓ +4. **Risk check:** Pre-edit checkpoints, per-file commits, git notes, and the audit scripts mitigate drift. The optional-vs-mandatory decision in Step 3.4 is flagged for the user. ✓ diff --git a/docs/superpowers/plans/2026-06-02-docs-layer-refresh.md b/docs/superpowers/plans/2026-06-02-docs-layer-refresh.md new file mode 100644 index 00000000..eeebcd3c --- /dev/null +++ b/docs/superpowers/plans/2026-06-02-docs-layer-refresh.md @@ -0,0 +1,656 @@ +# Docs Layer Refresh Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Refresh all human-facing documentation (`Readme.md`, `docs/Readme.md`, all `docs/guide_*.md`, plus new guides for subsystems that emerged since Feb 2026) to textbook / Microsoft "purple-tomb" SDK documentation fidelity. No source code changes. No new tooling. Per-file atomic commits with git notes. + +**Architecture:** Single-agent sequential execution. Each guide is a self-contained task: audit current state, identify gaps against `conductor/product.md`, rewrite affected sections in VEFontCache-Odin style (Philosophy → Architectural Boundaries → Implementation Logic → Verification), validate cross-doc links, commit per-file, attach git note. New guides are written only for subsystems explicitly listed in `conductor/product.md` that lack coverage. + +**Tech Stack:** Manual Slop's MCP research tools (`manual-slop_get_file_summary`, `manual-slop_py_get_skeleton`, `manual-slop_py_get_code_outline`, `manual-slop_get_git_diff`, `manual-slop_search_files`). Git for version control. Markdown for documentation. + +**Spec:** `docs/superpowers/specs/2026-06-02-comprehensive-documentation-refresh-design.md` §4 (Sub-Track 1). + +--- + +## Execution Constraints + +These apply to every task in this plan: + +- **No subagents.** Execute as a single agent. No Tier 3/Tier 4 delegation. No parallel workers. +- **Pre-edit checkpoint:** Before any file edit, run `git add .` to stage current state. Protects against any subsequent `git restore` mishap. +- **Per-file atomic commits:** One file = one commit. Never batch. +- **Commit message format:** `docs(): ` (e.g., `docs(architecture): document RAG engine integration`). +- **Git note format:** Attach a 3-8 line rationale to each commit via `git notes add -m "" `. The note should list: source files cross-referenced, subsystems updated, any decisions made. +- **Style baseline:** VEFontCache-Odin pattern. Philosophy → Architectural Boundaries → Implementation Logic → Verification. No "In this section..." filler. Symbol names match source exactly. +- **Link validation:** For every `[text](./relative/path)` link in a modified file, verify the target exists via `manual-slop_search_files` or `manual-slop_list_directory`. +- **"Textbook / purple-tomb fidelity" concretely means:** for every public class/function/event mentioned, the doc states its signature, threading constraints, side effects, and at least one usage example. Internal algorithms explained step-by-step. State machines include the full transition table. +- **No new comments added to source code.** Docs live in `/docs`, not inline. + +--- + +## Task 1: Inventory and Gap Analysis + +**Files:** +- Read: `conductor/product.md` +- Read: `docs/Readme.md` +- Read: each `docs/guide_*.md` (use `manual-slop_get_file_summary` for first pass) +- Read: `docs/MMA_Support/*` (use `manual-slop_get_file_summary` for first pass) + +**Output:** A gap table written into the parent track's `conductor/tracks/documentation_refresh_comprehensive_20260602/gap_analysis.md` (create the parent track directory in this task if it doesn't exist). + +- [ ] **Step 1.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 1.2: Create the parent track directory** + +```powershell +New-Item -ItemType Directory -Path "C:\projects\manual_slop\conductor\tracks\documentation_refresh_comprehensive_20260602" -Force +``` + +- [ ] **Step 1.3: Read `conductor/product.md` to get the canonical feature list** + +Use `manual-slop_get_file_summary` first. If the file is summarized well, proceed to extract feature names. If you need the full list, use `manual-slop_get_file_slice` with a generous range. + +Identify every distinct feature/subsystem mentioned (e.g., Beads mode, RAG, Hot Reload, 4-Tier MMA, 26 MCP tools, Multi-Provider, etc.). + +- [ ] **Step 1.4: Read every `docs/guide_*.md` to map current coverage** + +For each guide: +- Use `manual-slop_get_file_summary` for a quick read +- Note which subsystems from `conductor/product.md` it covers +- Note which subsystems it does NOT cover + +Files to inventory: +- `docs/guide_architecture.md` +- `docs/guide_mma.md` +- `docs/guide_tools.md` +- `docs/guide_simulations.md` +- `docs/guide_context_curation.md` +- `docs/guide_shaders_and_window.md` +- `docs/guide_meta_boundary.md` + +- [ ] **Step 1.5: Read `docs/Readme.md` to confirm what's indexed** + +Verify which guides are linked from the documentation index. Flag any `docs/guide_*.md` that is NOT in the index (likely candidates: `guide_context_curation.md`, `guide_shaders_and_window.md`). + +- [ ] **Step 1.6: Write the gap analysis** + +Create `conductor/tracks/documentation_refresh_comprehensive_20260602/gap_analysis.md` with this structure: + +```markdown +# Docs Layer Gap Analysis + +**Date:** 2026-06-02 +**Source of truth for features:** `conductor/product.md` +**Source of truth for guides:** `docs/Readme.md` and `docs/guide_*.md` + +## Existing Guides and Their Coverage + +| Guide | Covers | Does NOT cover (gaps) | +|---|---|---| +| `docs/guide_architecture.md` | [list] | [list] | +| `docs/guide_mma.md` | [list] | [list] | +| ... | ... | ... | + +## Subsystems Without Dedicated Guides + +| Subsystem | Source module(s) | Recommendation | +|---|---|---| +| RAG | `src/rag_engine.py` | NEW: `docs/guide_rag.md` | +| Beads | `src/beads_client.py` | NEW: `docs/guide_beads.md` | +| ... | ... | ... | + +## Existing Guides That Are Stale + +| Guide | Last meaningful update | Stale sections | +|---|---|---| +| ... | ... | ... | + +## Cross-Cutting Issues + +- Files in `docs/MMA_Support/*` not linked from `docs/Readme.md`: [list] +- Guides that reference each other via broken links: [list] +- Symbols in docs that don't match current source: [list, if any found during the read pass] +``` + +- [ ] **Step 1.7: Commit the gap analysis** + +```powershell +git -C C:\projects\manual_slop add conductor/tracks/documentation_refresh_comprehensive_20260602/gap_analysis.md +git -C C:\projects\manual_slop commit -m "docs(track): docs layer gap analysis for comprehensive refresh" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Subsystem coverage map for docs layer refresh. Each existing guide's coverage and gaps listed. New guides recommended for unlisted subsystems." $_ } +``` + +- [ ] **Step 1.8: Record SHA in plan** + +After committing, note the commit SHA. This gap analysis becomes the source of truth for all subsequent tasks in this plan. + +```markdown +Gap analysis commit SHA: [paste here] +``` + +--- + +## Task 2: Update the Documentation Index (`docs/Readme.md`) + +**Files:** +- Modify: `docs/Readme.md` +- Test: Manual link validation (every `[text](./relative/path)` target exists) + +- [ ] **Step 2.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 2.2: Read current `docs/Readme.md`** + +Use `manual-slop_read_file` (file is small enough). + +- [ ] **Step 2.3: Identify missing guide links** + +Cross-reference the Guides table in `docs/Readme.md` against the list of `docs/guide_*.md` files (from Task 1). Flag every guide that is NOT in the index. + +- [ ] **Step 2.4: Add the missing guide entries** + +For each missing guide, add a row to the Guides table: + +```markdown +| [Context Curation](guide_context_curation.md) | [contents summary] | +| [Shaders & Window](guide_shaders_and_window.md) | [contents summary] | +``` + +The "[contents summary]" should be 1-2 lines describing the guide's scope, written in the same high-density style as the existing rows. + +- [ ] **Step 2.5: If Task 1.6 recommended new guides, add placeholder rows for them too** + +```markdown +| [RAG](guide_rag.md) | [contents summary — written in Task N] | +| [Beads](guide_beads.md) | [contents summary — written in Task N] | +``` + +Use `[contents summary — written in Task N]` as a placeholder if the new guide has not been written yet. Update the row once the new guide is complete. + +- [ ] **Step 2.6: Decide fate of `docs/MMA_Support/*`** + +Options: +- (a) Keep as legacy, add a "Legacy MMA Reference" section to the index that links them +- (b) Merge into `docs/guide_mma.md` and delete the MMA_Support directory +- (c) Leave as-is, not linked + +Default: (a) — keep as legacy, add a "Legacy MMA Reference (Deprecated)" section at the bottom of the index. This preserves historical context without confusing new readers. + +- [ ] **Step 2.7: Verify every link in the modified file resolves** + +For every `[text](./relative/path)` in the updated `docs/Readme.md`: +- Use `manual-slop_search_files` to confirm the target exists +- If broken, either fix the link or remove the row + +- [ ] **Step 2.8: Commit** + +```powershell +git -C C:\projects\manual_slop add docs/Readme.md +git -C C:\projects\manual_slop commit -m "docs(index): link guide_context_curation and guide_shaders_and_window; add legacy MMA section" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Linked previously-unlinked guides. Added Legacy MMA Reference section per gap analysis decision. All cross-doc links verified." $_ } +``` + +--- + +## Task 3: Rewrite `docs/guide_architecture.md` + +**Files:** +- Modify: `docs/guide_architecture.md` (current size ~34.5K) +- Reference: `src/gui_2.py`, `src/ai_client.py`, `src/multi_agent_conductor.py`, `src/dag_engine.py`, `src/events.py`, `src/app_controller.py`, `src/api_hooks.py` + +**Scope:** Cover all threading domains, all event types, all state machines, the Execution Clutch HITL flow, multi-provider AI client architecture, caching strategies, and any new subsystems that interact with these (RAG retrieval, Beads sync, Hot Reload lifecycle hooks). + +- [ ] **Step 3.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 3.2: Read the current guide** + +```powershell +# Use skeleton/summary first +manual-slop_get_file_summary path="C:\projects\manual_slop\docs\guide_architecture.md" +``` + +Then read sections as needed. The file is large (~34.5K) so use `manual-slop_get_file_slice` with explicit ranges. + +- [ ] **Step 3.3: Audit the source code for changes since the last update** + +For each major source file referenced: +- Use `manual-slop_get_git_diff path="" base_rev="HEAD~30"` to see what changed in the last 30 commits +- Use `manual-slop_py_get_skeleton` and `manual-slop_py_get_code_outline` to map current structure +- Note any new classes, methods, events, state machines + +- [ ] **Step 3.4: Identify which sections need rewriting** + +Based on the diff, mark each section as: +- **Stale:** Needs rewrite +- **Missing:** Subsystem not covered at all +- **Current:** No changes needed + +If you find that a major subsystem is missing (e.g., RAG integration with the event system, Beads lifecycle hooks, Hot Reload interaction with the threading model), add a new section to the guide. + +- [ ] **Step 3.5: Rewrite stale and missing sections** + +Apply the VEFontCache-Odin style: +- **Philosophy:** Mental model. Why does this subsystem exist? What problem does it solve? What are the trade-offs? +- **Architectural Boundaries:** Which thread/domain owns it? What are the interfaces? What cannot cross? +- **Implementation Logic:** State machines with full transition tables. Locking strategy. Event flow with sequence. Public class/function signatures. +- **Verification:** How is it tested? What edge cases are covered? What can fail? + +For "textbook / purple-tomb fidelity": for every public class/function/event mentioned, state its signature, threading constraints, side effects, and at least one usage example. + +- [ ] **Step 3.6: Validate all cross-doc links** + +For every `[text](./relative/path)` in the modified file: +- Use `manual-slop_search_files` to confirm target exists +- If broken, fix the link + +- [ ] **Step 3.7: Spot-check 3 random symbols against the source** + +Pick 3 random public class/function names mentioned in the rewritten sections. Use `manual-slop_py_find_usages` to confirm the symbol exists in the source with the same name. + +- [ ] **Step 3.8: Commit** + +```powershell +git -C C:\projects\manual_slop add docs/guide_architecture.md +git -C C:\projects\manual_slop commit -m "docs(architecture): refresh for RAG, Beads, Hot Reload, and post-Feb-2026 changes" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Rewrote [list specific sections]. Cross-referenced [list source files]. New sections: [list]. Decisions: [list any judgment calls]." $_ } +``` + +--- + +## Task 4: Rewrite `docs/guide_mma.md` + +**Files:** +- Modify: `docs/guide_mma.md` +- Reference: `src/multi_agent_conductor.py`, `src/dag_engine.py`, `src/conductor_tech_lead.py`, `src/mma_prompts.py`, `src/models.py` + +**Scope:** The 4-Tier MMA hierarchy, Ticket/Track/WorkerContext data structures, DAG engine (Kahn's algorithm, cycle detection, transitive blocking propagation), ConductorEngine execution loop, Tier 2 ticket generation, Tier 3 worker lifecycle with Context Amnesia, Tier 4 QA integration, token firewalling, model escalation. Add: persona assignment, RAG-augmented worker context, Beads-backed track state, Hot Reload integration with worker spawning. + +- [ ] **Step 4.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 4.2: Read the current guide and source code** + +Use `manual-slop_get_file_summary` for the guide, then `manual-slop_py_get_skeleton` for each source file. + +- [ ] **Step 4.3: Audit changes since last update** + +Use `manual-slop_get_git_diff` for each source file. Note: the MMA system has evolved substantially (personas, RAG, Beads, Hot Reload interaction). + +- [ ] **Step 4.4: Identify stale / missing sections** + +Pay particular attention to: +- **Persona integration:** How are personas assigned to MMA tiers? Where in the worker lifecycle? +- **RAG augmentation:** When does a worker receive RAG-retrieved context? How is the chunk selection made? +- **Beads integration:** Are tracks stored in Beads when Beads mode is active? How does the transition work? +- **Hot Reload interaction:** When a Tier 3 worker finishes and the GUI is reloaded, what happens to the worker's session? + +- [ ] **Step 4.5: Rewrite stale and missing sections** + +VEFontCache-Odin style. The DAG engine algorithms in particular should be explained step-by-step (Kahn's algorithm pseudocode, cycle detection using iterative DFS, cascade_blocks with transitive propagation). + +- [ ] **Step 4.6: Validate all cross-doc links** + +- [ ] **Step 4.7: Spot-check 3 random symbols against the source** + +- [ ] **Step 4.8: Commit** + +```powershell +git -C C:\projects\manual_slop add docs/guide_mma.md +git -C C:\projects\manual_slop commit -m "docs(mma): refresh for personas, RAG augmentation, Beads integration, Hot Reload interaction" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Rewrote [sections]. Cross-referenced [files]. New sections: [list]." $_ } +``` + +--- + +## Task 5: Rewrite `docs/guide_tools.md` + +**Files:** +- Modify: `docs/guide_tools.md` (current size ~22.9K) +- Reference: `src/mcp_client.py`, `src/api_hooks.py`, `src/api_hook_client.py`, `src/shell_runner.py` + +**Scope:** All 26+ MCP tools (current count), the 3-layer security model (Allowlist Construction → Path Validation → Resolution Gate), the Hook API GET/POST endpoints, `ApiHookClient` method reference, the `/api/ask` synchronous HITL protocol, the shell runner. Add: any new tools added since Feb 2026 (RAG tools, Beads tools, tree-sitter Lua/GDScript/C# tools if implemented, persona tools, structural file editor tools). + +- [ ] **Step 5.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 5.2: Read the current guide** + +- [ ] **Step 5.3: Audit current tool inventory in `src/mcp_client.py`** + +Use `manual-slop_py_get_skeleton` and `manual-slop_py_get_code_outline` to get the current list of registered tools. Count them. Compare to the count in the guide. + +- [ ] **Step 5.4: For each tool, document or update its entry** + +For every tool: +- **Signature:** Exact function signature +- **Security constraints:** Which of the 3 layers it passes through +- **Side effects:** What does it mutate? What does it return? +- **Edge cases:** Empty input, missing file, permission denied, etc. +- **Usage example:** At least one example showing the call site and expected return + +If a tool is missing from the guide, add a full entry. If an entry is stale, rewrite it. + +- [ ] **Step 5.5: Update the Hook API endpoint reference** + +Use `manual-slop_py_get_skeleton` on `src/api_hooks.py` to get the current list of routes. For each route, document request/response format. + +- [ ] **Step 5.6: Update the `ApiHookClient` method reference** + +Use `manual-slop_py_get_class_summary` for the `ApiHookClient` class. Document each public method. + +- [ ] **Step 5.7: Validate all cross-doc links** + +- [ ] **Step 5.8: Spot-check 3 random symbols against the source** + +- [ ] **Step 5.9: Commit** + +```powershell +git -C C:\projects\manual_slop add docs/guide_tools.md +git -C C:\projects\manual_slop commit -m "docs(tools): refresh tool inventory, Hook API, and ApiHookClient reference" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Updated tool count to [N]. Rewrote [sections]. New tool entries: [list]." $_ } +``` + +--- + +## Task 6: Rewrite `docs/guide_simulations.md` + +**Files:** +- Modify: `docs/guide_simulations.md` +- Reference: `tests/conftest.py`, `simulation/sim_base.py`, `simulation/workflow_sim.py`, `simulation/user_agent.py`, `tests/mock_gemini_cli.py`, `src/api_hook_client.py` + +**Scope:** The `live_gui` pytest fixture (lifecycle, readiness polling, failure path, teardown, session isolation via `reset_ai_client`), the Puppeteer pattern (8-stage MMA simulation), the mock provider strategy, the VerificationLogger, process cleanup (`kill_process_tree`), visual verification patterns. Add: any new test infrastructure added since Feb 2026 (extended simulations, async tool tests, discussion metrics tests, structural file editor tests, command palette tests). + +- [ ] **Step 6.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 6.2: Read the current guide** + +- [ ] **Step 6.3: Audit current simulation infrastructure** + +Use `manual-slop_get_file_summary` on `tests/conftest.py` and each `simulation/*.py` file. Note any new fixtures, base classes, or patterns. + +- [ ] **Step 6.4: Identify stale / missing sections** + +- [ ] **Step 6.5: Rewrite stale and missing sections** + +VEFontCache-Odin style. Particular attention to: +- The `live_gui` fixture's full lifecycle (startup → readiness polling → test execution → teardown) +- The mock provider's JSON-L protocol (input mechanisms, response routing, output protocol) +- Process cleanup for Windows (the `kill_process_tree` implementation) +- The new extended simulation patterns (if any) + +- [ ] **Step 6.6: Validate all cross-doc links** + +- [ ] **Step 6.7: Spot-check 3 random symbols against the source** + +- [ ] **Step 6.8: Commit** + +```powershell +git -C C:\projects\manual_slop add docs/guide_simulations.md +git -C C:\projects\manual_slop commit -m "docs(simulations): refresh test infrastructure, mock provider, and Puppeteer pattern" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Rewrote [sections]. New content: [list]." $_ } +``` + +--- + +## Task 7: Refresh `docs/guide_context_curation.md` and `docs/guide_shaders_and_window.md` + +**Files:** +- Modify: `docs/guide_context_curation.md` (current size ~8K) +- Modify: `docs/guide_shaders_and_window.md` (current size ~3.4K) +- Reference: `src/file_cache.py`, `src/summarize.py`, `src/outline_tool.py`, `src/summary_cache.py`, `src/fuzzy_anchor.py`, `src/shaders.py`, `src/bg_shader.py`, `src/imgui_scopes.py` + +**Scope:** For `guide_context_curation.md`: skeleton/curated/targeted view algorithms, fuzzy anchor algorithm, summary cache strategy, file aggregation pipeline, view modes. For `guide_shaders_and_window.md`: shader pipeline, custom window frame manipulation, pywin32 integration, NERV theme FX. + +- [ ] **Step 7.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 7.2: Read both guides** + +- [ ] **Step 7.3: Audit changes in referenced source files** + +- [ ] **Step 7.4: Rewrite stale sections in `guide_context_curation.md`** + +- [ ] **Step 7.5: Commit `guide_context_curation.md`** + +```powershell +git -C C:\projects\manual_slop add docs/guide_context_curation.md +git -C C:\projects\manual_slop commit -m "docs(context-curation): refresh view algorithms and fuzzy anchor" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Rewrote [sections]. Cross-referenced [files]." $_ } +``` + +- [ ] **Step 7.6: Rewrite stale sections in `guide_shaders_and_window.md`** + +- [ ] **Step 7.7: Commit `guide_shaders_and_window.md`** + +```powershell +git -C C:\projects\manual_slop add docs/guide_shaders_and_window.md +git -C C:\projects\manual_slop commit -m "docs(shaders): refresh shader pipeline and window frame" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Rewrote [sections]. Cross-referenced [files]." $_ } +``` + +- [ ] **Step 7.8: Validate all cross-doc links in both files** + +--- + +## Task 8: Refresh `docs/guide_meta_boundary.md` + +**Files:** +- Modify: `docs/guide_meta_boundary.md` (current size ~4.6K) +- Reference: `scripts/mma_exec.py`, `scripts/claude_mma_exec.py`, `scripts/tool_call.py`, `scripts/mcp_server.py`, `mma-orchestrator/SKILL.md`, `.gemini/`, `.claude/`, `.opencode/` + +**Scope:** The Application domain (Strict HITL — `gui_2.py`, `ai_client.py`, `multi_agent_conductor.py`, `dag_engine.py`) vs the Meta-Tooling domain (agent skill files and orchestration scripts). Inter-Domain Bridges (`cli_tool_bridge.py`, `claude_tool_bridge.py`). The `GEMINI_CLI_HOOK_CONTEXT` environment variable. Safety model separation. + +- [ ] **Step 8.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 8.2: Read the current guide and the meta-tooling files** + +- [ ] **Step 8.3: Rewrite stale sections** + +Pay attention to: +- Is `claude_mma_exec.py` still in active use? (User indicated Claude is no longer the primary toolchain — may be vestigial.) +- Is `cli_tool_bridge.py` still in active use? +- Are there new meta-tooling scripts not yet documented? + +- [ ] **Step 8.4: Validate all cross-doc links** + +- [ ] **Step 8.5: Commit** + +```powershell +git -C C:\projects\manual_slop add docs/guide_meta_boundary.md +git -C C:\projects\manual_slop commit -m "docs(meta-boundary): refresh Application vs Meta-Tooling domain separation" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Rewrote [sections]. Cross-referenced [files]." $_ } +``` + +--- + +## Task 9: Update `Readme.md` (top-level) + +**Files:** +- Modify: `Readme.md` (current size ~15.5K) +- Reference: every `docs/guide_*.md` (for the new Subsystem Index) + +**Scope:** Add a "Module by Domain" reference table (links to each guide), a "Subsystem Index" (cross-references each major feature to its dedicated guide), update setup prerequisites (Beads CLI, Dolt, ChromaDB, etc.), update the Tech Stack section to reflect current dependencies. + +- [ ] **Step 9.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 9.2: Read the current `Readme.md`** + +- [ ] **Step 9.3: Add a "Module by Domain" section** + +Insert a table that links to each `docs/guide_*.md`: + +```markdown +## Module by Domain + +For deep dives into each subsystem, see the dedicated guide: + +| Subsystem | Guide | +|---|---| +| Threading, events, AI client, HITL | [docs/guide_architecture.md](docs/guide_architecture.md) | +| 4-Tier MMA, DAG, worker lifecycle | [docs/guide_mma.md](docs/guide_mma.md) | +| MCP tools, Hook API, shell runner | [docs/guide_tools.md](docs/guide_tools.md) | +| Test infrastructure, mock provider, Puppeteer | [docs/guide_simulations.md](docs/guide_simulations.md) | +| Skeleton/curated/targeted views, fuzzy anchors | [docs/guide_context_curation.md](docs/guide_context_curation.md) | +| Shader pipeline, custom window frame | [docs/guide_shaders_and_window.md](docs/guide_shaders_and_window.md) | +| Application vs Meta-Tooling domain | [docs/guide_meta_boundary.md](docs/guide_meta_boundary.md) | +| [RAG, Beads, etc. once new guides exist] | [docs/guide_rag.md](docs/guide_rag.md) | +``` + +- [ ] **Step 9.4: Add a "Subsystem Index" section** + +A cross-reference of every major feature to its dedicated guide. Use the gap analysis from Task 1 as the source. + +- [ ] **Step 9.5: Update setup prerequisites** + +Check the current `pyproject.toml` (use `manual-slop_get_file_summary`) and confirm the README's prerequisites are accurate. Add any missing dependencies (e.g., `chromadb` for RAG, `dolt` for Beads). + +- [ ] **Step 9.6: Update the Tech Stack section** + +Add providers (MiniMax if not already there), new SDKs (any new ones), new tooling (e.g., ChromaDB). + +- [ ] **Step 9.7: Commit** + +```powershell +git -C C:\projects\manual_slop add Readme.md +git -C C:\projects\manual_slop commit -m "docs(readme): add Module by Domain, Subsystem Index, and updated setup" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Added Module by Domain table. Added Subsystem Index. Updated prerequisites to include [list]. Updated Tech Stack." $_ } +``` + +--- + +## Task 10: Write New Guides for Unlisted Subsystems + +**Files:** +- Create (one per new guide): `docs/guide_.md` +- Reference: the relevant `src/.py` and tests + +**Scope:** Per the gap analysis from Task 1, write new guides for any subsystem that: +1. Is explicitly listed in `conductor/product.md` +2. Does NOT have a corresponding guide yet +3. Is substantial enough to warrant a dedicated guide (>500 lines of code in the primary module) + +**Likely candidates** (confirm via gap analysis): +- RAG (`docs/guide_rag.md`) — `src/rag_engine.py` +- Beads (`docs/guide_beads.md`) — `src/beads_client.py` +- Hot Reload (`docs/guide_hot_reload.md`) — `src/hot_reloader.py` +- Discussion Metrics & Compression (`docs/guide_discussion_metrics.md`) — `src/ai_client.py` (relevant section) +- Command Palette (`docs/guide_command_palette.md`) — `src/gui_2.py` (relevant section) +- Structural File Editor (`docs/guide_structural_editor.md`) — `src/gui_2.py` (relevant section) +- NERV Theme (`docs/guide_nerv_theme.md`) — `src/theme_nerv.py`, `src/theme_nerv_fx.py` + +- [ ] **Step 10.1: Pre-edit checkpoint** + +```powershell +git -C C:\projects\manual_slop add . +``` + +- [ ] **Step 10.2: For each new guide (one per subsystem), follow this per-subsystem workflow** + +For each subsystem in the gap analysis's "Subsystems Without Dedicated Guides" table: + +**10.2.1: Read the source module(s)** +- Use `manual-slop_py_get_skeleton` and `manual-slop_py_get_code_outline` first +- Read specific sections via `manual-slop_get_file_slice` for implementation details + +**10.2.2: Read any existing tests for the subsystem** +- Use `manual-slop_get_file_summary` on the relevant `test_*.py` files +- Note what's tested (gives you the public API surface) + +**10.2.3: Write the new guide in VEFontCache-Odin style** +- **Philosophy:** What problem does this subsystem solve? What design alternatives were considered? +- **Architectural Boundaries:** Which thread/domain owns it? What are the public interfaces? What cannot cross? +- **Implementation Logic:** State machines, algorithms step-by-step, public class/function signatures with side effects, threading constraints +- **Verification:** How is it tested? What edge cases? What can fail? + +**10.2.4: Commit per-guide** +```powershell +git -C C:\projects\manual_slop add docs/guide_.md +git -C C:\projects\manual_slop commit -m "docs(): new guide for [subsystem]" +git -C C:\projects\manual_slop log -1 --format="%H" | ForEach-Object { git -C C:\projects\manual_slop notes add -m "New guide covering [subsystem]. Cross-referenced [files]. Public API surface documented." $_ } +``` + +**10.2.5: Update `docs/Readme.md` to link the new guide** +- Go back to Task 2's modified `docs/Readme.md` and update the placeholder row for this guide with the real "[contents summary]" +- Commit as a separate small commit: `docs(index): finalize [subsystem] guide link` + +- [ ] **Step 10.3: Validate all cross-doc links across all new guides** + +For every `[text](./relative/path)` in any new guide, verify the target exists. + +--- + +## Task 11: Sub-Track 1 Verification + +**Files:** +- Read: every modified `docs/guide_*.md` and `Readme.md` + +- [ ] **Step 11.1: Cross-link audit** + +For every modified markdown file, run a manual grep for `[text](./relative/path)` and verify each target exists via `manual-slop_search_files`. + +- [ ] **Step 11.2: Symbol parity spot-check** + +For 3 random public symbols mentioned in each rewritten guide, use `manual-slop_py_find_usages` to confirm the symbol exists with the same name in the source. + +- [ ] **Step 11.3: Subsystem coverage check** + +For every feature listed in `conductor/product.md`, confirm either (a) a dedicated guide exists, or (b) the feature is covered in a related guide with a link from `Readme.md`. + +- [ ] **Step 11.4: Per-file commit verification** + +Run `git log --oneline conductor/tracks/documentation_refresh_comprehensive_20260602/.. -- docs/ Readme.md` and confirm every file change has its own commit. + +- [ ] **Step 11.5: Git note verification** + +Run `git log --format="%H" -- docs/ Readme.md | ForEach-Object { git notes show $_ }` and confirm every commit has a non-empty git note. + +- [ ] **Step 11.6: Phase completion checkpoint** + +Per the project's Phase Completion Verification protocol in `conductor/workflow.md`: +- Run the automated test suite (or at least the docs-related tests, if any) +- Run the API hook verification if applicable +- Present the verification report to the user +- Get user sign-off +- Create the checkpoint commit: `conductor(checkpoint): Sub-Track 1 (docs layer refresh) complete` +- Attach the verification report as a git note + +--- + +## Self-Review (after writing this plan) + +1. **Spec coverage:** Sections 4.3-4.6 of the spec (Phase 1.3-1.6) are covered by Tasks 3-11. Phase 1.1 (Inventory) is Task 1. Phase 1.2 (Index update) is Task 2. Phase 1.5 (New guides) is Task 10. Phase 1.6 (Verification) is Task 11. ✓ All phases covered. +2. **Placeholder scan:** No "TBD" / "TODO" / "similar to Task N" markers. Specific file paths and commit commands throughout. ✓ +3. **Type/symbol consistency:** Tasks reference consistent file paths, module names, and symbol names throughout. The VEFontCache-Odin pattern is applied consistently. ✓ +4. **Risk check:** Pre-edit checkpoints, per-file commits, and git notes mitigate the codebase-evolving-underneath risk. Manual link validation mitigates broken links. User sign-off at the end of each sub-track is enforced via the Phase Completion Verification protocol. ✓