|
| 1 | +# Documentation Architecture |
| 2 | + |
| 3 | +This document defines how documentation in Loop is organized, written, and maintained. |
| 4 | + |
| 5 | +If this file is doing its job, nobody needs to ask "where should this live?" during review. |
| 6 | + |
| 7 | +## Goals |
| 8 | + |
| 9 | +1. Make the project operable for newcomers and maintainers. |
| 10 | +2. Keep behavior docs close to runtime truth. |
| 11 | +3. Provide reliable pathways by role, skill level, and workflow. |
| 12 | +4. Keep writing precise, human, and useful under pressure. |
| 13 | + |
| 14 | +## Audience Map |
| 15 | + |
| 16 | +| Audience | Primary docs | What success looks like | |
| 17 | +|---|---|---| |
| 18 | +| New user | `docs/user-guide/quickstart.md`, `docs/user-guide/learning-paths.md` | Can run first successful checks and avoid common footguns | |
| 19 | +| Returning user | `docs/user-guide/workflow-recipes.md`, `docs/reference/command-reference.md` | Can select and run the right workflow quickly | |
| 20 | +| Power user | `docs/user-guide/power-user-playbook.md` | Can tune depth, cost, and assurance for high-stakes work | |
| 21 | +| Contributor | `docs/developer-guide/setup.md`, `docs/developer-guide/workflow-cookbook.md` | Can ship changes with tests, docs, and evidence | |
| 22 | +| Maintainer | `docs/developer-guide/quality-gates.md`, `docs/troubleshooting/incident-playbook.md` | Can diagnose failures and land safe changes predictably | |
| 23 | +| Runtime debugger | `docs/internals/architecture.md`, `docs/internals/runtime-walkthrough.md`, `docs/internals/module-map.md` | Can trace behavior from symptom to module | |
| 24 | +| Architecture reader | `docs/concepts/mental-model.md`, `docs/concepts/principles.md`, `docs/adr/` | Can explain why system tradeoffs exist | |
| 25 | + |
| 26 | +## Workflow Coverage |
| 27 | + |
| 28 | +| Workflow | Start | Deep dive | Closeout | |
| 29 | +|---|---|---|---| |
| 30 | +| First run | `docs/user-guide/quickstart.md` | `docs/user-guide/learning-paths.md` | `docs/troubleshooting/common-issues.md` | |
| 31 | +| Feature development | `docs/developer-guide/workflow-cookbook.md` | `docs/developer-guide/quality-gates.md` | `docs/developer-guide/contribution-workflow.md` | |
| 32 | +| Adapter behavior changes | `docs/user-guide/claude-code-adapter.md` | `docs/internals/ooda-and-execution.md` | `docs/developer-guide/quality-gates.md` | |
| 33 | +| Spec and formalization work | `docs/user-guide/workflow-recipes.md` | `docs/spec/`, `docs/internals/runtime-walkthrough.md` | `docs/execution-plan/VALIDATION-MATRIX.md` | |
| 34 | +| Incident triage | `docs/troubleshooting/incident-playbook.md` | `docs/troubleshooting/diagnostics-checklist.md` | `docs/troubleshooting/common-issues.md` | |
| 35 | +| Command lookup | `docs/reference/command-reference.md` | `Makefile`, `scripts/` | `docs/execution-plan/evidence/` | |
| 36 | + |
| 37 | +## Document Types |
| 38 | + |
| 39 | +1. Orientation docs: |
| 40 | + - Explain where to start and how to choose a path. |
| 41 | + - Examples: `docs/README.md`, section `README.md` files. |
| 42 | +2. Procedure docs: |
| 43 | + - Provide commands, success criteria, and failure protocol. |
| 44 | + - Examples: user recipes, developer workflow cookbook, quality gates. |
| 45 | +3. Concept docs: |
| 46 | + - Explain mental model and tradeoff logic. |
| 47 | + - Examples: `docs/concepts/*`. |
| 48 | +4. Internals docs: |
| 49 | + - Explain runtime behavior, module boundaries, and data flow. |
| 50 | + - Examples: `docs/internals/*`. |
| 51 | +5. Troubleshooting docs: |
| 52 | + - Turn symptoms into deterministic diagnosis and fixes. |
| 53 | + - Examples: `docs/troubleshooting/*`. |
| 54 | +6. Reference docs: |
| 55 | + - Fast lookup material, minimal narrative. |
| 56 | + - Examples: `docs/reference/*`, `docs/glossary.md`. |
| 57 | + |
| 58 | +## Quality Contract |
| 59 | + |
| 60 | +Every operational document should satisfy: |
| 61 | + |
| 62 | +1. Explicit target reader. |
| 63 | +2. Concrete commands for procedures. |
| 64 | +3. Clear expected outcomes. |
| 65 | +4. Link to adjacent docs instead of copy-paste duplication. |
| 66 | +5. No typographic em dash punctuation. |
| 67 | +6. No aspirational claims without verification path. |
| 68 | + |
| 69 | +## Change Protocol |
| 70 | + |
| 71 | +When behavior changes: |
| 72 | + |
| 73 | +1. Update code and docs in the same change set. |
| 74 | +2. Update the nearest section index if navigation changes. |
| 75 | +3. Record validation evidence for nontrivial claims. |
| 76 | +4. Re-run docs style checks (`make docs-check`). |
| 77 | + |
| 78 | +When docs structure changes: |
| 79 | + |
| 80 | +1. Update `README.md` at repo root. |
| 81 | +2. Update `docs/README.md`. |
| 82 | +3. Update affected section `README.md`. |
| 83 | +4. Add at least one cross-link from an existing high-traffic page. |
| 84 | + |
| 85 | +## Anti-Patterns |
| 86 | + |
| 87 | +1. "TBD" as permanent architecture. |
| 88 | +2. Procedures without success criteria. |
| 89 | +3. Claims that cannot be validated. |
| 90 | +4. New docs that are not linked from any index page. |
| 91 | +5. Deleting old docs without redirecting readers to replacement paths. |
| 92 | + |
| 93 | +## Ownership |
| 94 | + |
| 95 | +- System-wide docs ownership is shared by active maintainers. |
| 96 | +- Every merged behavior change is responsible for its own documentation updates. |
| 97 | +- During review, "works in code but not in docs" counts as incomplete. |
| 98 | + |
| 99 | +Documentation is part of the runtime interface. It just compiles in human brains instead of cargo. |
0 commit comments