Skip to content

Commit 69341a7

Browse files
committed
docs: expand documentation architecture and workflow coverage
1 parent 4bb2f73 commit 69341a7

32 files changed

+1006
-26
lines changed

.beads/issues.jsonl

Lines changed: 28 additions & 2 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ SHELL := /bin/bash
22

33
LOOP_MIN_AVAILABLE_MIB ?= 3072
44

5-
.PHONY: check lint typecheck test coverage rustdoc-check py-integration-gate ignored-repl-gate proptest-gate claude-adapter-gate review verify
5+
.PHONY: check lint typecheck test coverage rustdoc-check py-integration-gate ignored-repl-gate proptest-gate claude-adapter-gate docs-check review verify
66

77
check: typecheck test
88

@@ -33,6 +33,9 @@ proptest-gate:
3333
claude-adapter-gate:
3434
LOOP_MIN_AVAILABLE_MIB=$(LOOP_MIN_AVAILABLE_MIB) ./scripts/run_vg_claude_adapter_e2e_gate.sh
3535

36-
review: typecheck rustdoc-check
36+
docs-check:
37+
./scripts/check_docs_style.sh
3738

38-
verify: check rustdoc-check py-integration-gate proptest-gate claude-adapter-gate
39+
review: typecheck rustdoc-check docs-check
40+
41+
verify: check rustdoc-check py-integration-gate proptest-gate claude-adapter-gate docs-check

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ rlm-core powers these projects:
159159
## Documentation
160160

161161
### Start Here
162+
- [Documentation Architecture](docs/DOCS-ARCHITECTURE.md) - How docs are organized, maintained, and kept truthful.
162163
- [Documentation Portal](docs/README.md) - Role-based index and workflow-oriented navigation.
163164
- [User Guide](docs/user-guide/README.md) - New user to power-user guidance.
164165
- [Developer Guide](docs/developer-guide/README.md) - Setup, gates, and contribution workflow.
166+
- [Reference Commands](docs/reference/command-reference.md) - Fast lookup for common workflows.
165167
- [API Docs Status](docs/developer-guide/api-docs-status.md) - What "documented" currently means, without fiction.
166168
- [Internals](docs/internals/README.md) - Architecture, OODA flow, and module map.
167169
- [Troubleshooting](docs/troubleshooting/README.md) - Incident triage and diagnostics checklists.

docs/DOCS-ARCHITECTURE.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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.

docs/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,50 @@ This documentation is organized by audience and workflow, not by who happened to
88

99
| If you are... | Start here | Then go to |
1010
|---|---|---|
11-
| New to Loop | [User Guide](./user-guide/README.md) | [Workflow Recipes](./user-guide/workflow-recipes.md) |
12-
| Building features | [Developer Guide](./developer-guide/README.md) | [Quality Gates](./developer-guide/quality-gates.md) |
13-
| Debugging internals | [Internals](./internals/README.md) | [Troubleshooting](./troubleshooting/README.md) |
14-
| Looking for architecture rationale | [Concepts](./concepts/README.md) | [ADR Index](./adr/) |
11+
| New to Loop | [User Guide](./user-guide/README.md) | [Learning Paths](./user-guide/learning-paths.md) |
12+
| Building features | [Developer Guide](./developer-guide/README.md) | [Workflow Cookbook](./developer-guide/workflow-cookbook.md) |
13+
| Debugging internals | [Internals](./internals/README.md) | [Runtime Walkthrough](./internals/runtime-walkthrough.md) |
14+
| Looking for architecture rationale | [Concepts](./concepts/README.md) | [System Principles](./concepts/principles.md) |
15+
| Looking up exact commands | [Reference](./reference/README.md) | [Command Reference](./reference/command-reference.md) |
1516

1617
## Documentation Map
1718

1819
### User-Facing
1920
- [User Guide](./user-guide/README.md): Start-to-finish guidance by skill level.
21+
- [Learning Paths](./user-guide/learning-paths.md): Guided progression for beginners through power users.
2022
- [Claude Code Adapter Guide](./user-guide/claude-code-adapter.md): Capability envelope, limits, and OODA behavior.
2123
- [Workflow Recipes](./user-guide/workflow-recipes.md): End-to-end task playbooks.
2224
- [Power User Playbook](./user-guide/power-user-playbook.md): Performance, scale, and control.
2325

2426
### Developer-Facing
2527
- [Developer Guide](./developer-guide/README.md): Build and change Loop safely.
2628
- [Setup](./developer-guide/setup.md): Environment bootstrap.
29+
- [Workflow Cookbook](./developer-guide/workflow-cookbook.md): Change-type specific contribution runbooks.
2730
- [Quality Gates](./developer-guide/quality-gates.md): Tests, checks, governance.
2831
- [Contribution Workflow](./developer-guide/contribution-workflow.md): Branch-to-merge routine.
2932

3033
### Architecture and Internals
3134
- [Concepts](./concepts/README.md): Mental models and design vocabulary.
35+
- [System Principles](./concepts/principles.md): Decision criteria and tradeoff posture.
3236
- [Internals](./internals/README.md): Runtime architecture and module boundaries.
3337
- [Architecture](./internals/architecture.md): System structure and data flow.
3438
- [OODA + Execution Flow](./internals/ooda-and-execution.md): Observe/Orient/Decide/Act mapping.
39+
- [Runtime Walkthrough](./internals/runtime-walkthrough.md): Step-by-step request lifecycle trace.
3540
- [Python Orchestrator Swap Analysis](./internals/python-orchestrator-swap-analysis.md): Tradeoffs and decision framework for full Python orchestrator migration.
3641
- [Module Map](./internals/module-map.md): Where behavior actually lives.
3742

3843
### Operational and Recovery
3944
- [Troubleshooting](./troubleshooting/README.md): Fast diagnosis and fix paths.
45+
- [Incident Playbook](./troubleshooting/incident-playbook.md): Severity-based response and closure criteria.
4046
- [Common Issues](./troubleshooting/common-issues.md): Known failure patterns.
4147
- [Diagnostics Checklist](./troubleshooting/diagnostics-checklist.md): Structured incident capture.
4248

49+
### Reference
50+
- [Reference Index](./reference/README.md): Quick lookup section.
51+
- [Command Reference](./reference/command-reference.md): Canonical command map by workflow.
52+
4353
### Reference and Specifications
54+
- [Documentation Architecture](./DOCS-ARCHITECTURE.md): How docs are structured and maintained.
4455
- [Specification Set](./spec/): Canonical feature contracts (SPEC-20 through SPEC-27).
4556
- [Spec Lineage Status](./spec/SPEC-LINEAGE-STATUS.md): How origin-era design/migration specs map to current live status.
4657
- [Execution Plan](./execution-plan/README.md): Program-level planning, evidence, and governance.
@@ -59,10 +70,11 @@ This documentation is organized by audience and workflow, not by who happened to
5970
## Suggested Reading Order
6071

6172
1. [Concepts: Mental Model](./concepts/mental-model.md)
62-
2. [User Guide](./user-guide/README.md)
63-
3. [Developer Setup](./developer-guide/setup.md)
64-
4. [Internals Architecture](./internals/architecture.md)
65-
5. [Troubleshooting](./troubleshooting/README.md)
73+
2. [Concepts: System Principles](./concepts/principles.md)
74+
3. [User Guide](./user-guide/README.md)
75+
4. [Developer Setup](./developer-guide/setup.md)
76+
5. [Internals Architecture](./internals/architecture.md)
77+
6. [Troubleshooting](./troubleshooting/README.md)
6678

6779
## Scope Note
6880

docs/concepts/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ This section explains how to think about Loop before you care about where any sp
55
## Start Here
66

77
- [Mental Model](./mental-model.md)
8+
- [System Principles](./principles.md)
89

910
## Conceptual Layers
1011

1112
1. **Intent Layer**: User goals and jobs-to-be-done.
1213
2. **Orchestration Layer**: Complexity classification, decomposition, and execution strategy.
1314
3. **Evidence Layer**: Memory, traces, and verification artifacts.
1415
4. **Assurance Layer**: Tests, policy gates, compatibility checks, and release controls.
16+
5. **Decision Layer**: Principle-driven tradeoffs under real constraints.
1517

1618
## Why This Matters
1719

docs/concepts/mental-model.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ A healthy Loop workflow has:
4646
- Reproducible quality checks.
4747

4848
Or, put differently: fewer mysteries and fewer surprises during push.
49+
50+
Next read:
51+
- `principles.md` for decision criteria when tradeoffs appear.

docs/concepts/principles.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# System Principles
2+
3+
These principles explain how Loop is intended to behave when design tradeoffs appear.
4+
5+
If two choices both look reasonable, this file is the tie-breaker.
6+
7+
## 1. Evidence Beats Confidence
8+
9+
Claims about behavior should be backed by:
10+
11+
1. Passing checks and tests.
12+
2. Reproducible command output.
13+
3. Artifact paths for nontrivial validations.
14+
15+
Why:
16+
- Confidence is cheap and usually wrong at scale.
17+
- Evidence survives context switching.
18+
19+
## 2. Determinism Over Heroics
20+
21+
Operational workflows should prefer deterministic outcomes over fragile brilliance.
22+
23+
Examples:
24+
- Policy gates with machine-readable JSON output.
25+
- Stable command sequences in user and developer docs.
26+
- Explicit failure protocols in troubleshooting docs.
27+
28+
## 3. Contracts Before Convenience
29+
30+
External surfaces are contract-sensitive.
31+
Internal implementations can evolve, but behavioral contracts need deliberate change control.
32+
33+
Examples:
34+
- Compatibility helper surfaces for Python integration.
35+
- Feature contracts under `docs/spec/`.
36+
- Adapter efficacy gates that guard real scenarios.
37+
38+
## 4. Bounded Autonomy
39+
40+
Loop automates aggressively, but not infinitely.
41+
Activation, mode escalation, and memory use are bounded and observable.
42+
43+
Why:
44+
- Unbounded autonomy is just expensive drift.
45+
- Bounded systems are easier to debug and trust.
46+
47+
## 5. Practical Formalism
48+
49+
Formal methods are used where they add safety and leverage, not as decoration.
50+
51+
Examples:
52+
- Tiered formalization depth (`Types`, `Invariants`, `Contracts`, `FullProofs`).
53+
- Proof and sync paths integrated with governance gates.
54+
55+
## 6. Documentation Is Runtime Surface
56+
57+
Docs are part of the product interface.
58+
If behavior changes and docs do not, users still experience a bug.
59+
60+
Required habits:
61+
62+
1. Update docs in the same change set as behavior.
63+
2. Keep navigation indexes current.
64+
3. Keep procedures command-driven and falsifiable.
65+
66+
## 7. Friction Where It Matters
67+
68+
Loop adds process friction at high-risk boundaries:
69+
70+
1. Pre-commit and pre-push policy enforcement.
71+
2. Coverage and adapter efficacy gates.
72+
3. Evidence logging for significant changes.
73+
74+
That friction is intentional. It costs minutes now to save days later.
75+
76+
## Decision Questions
77+
78+
When unsure, ask:
79+
80+
1. Does this change improve reproducibility?
81+
2. Does it reduce hidden risk for users or maintainers?
82+
3. Can another engineer validate the same outcome independently?
83+
4. Is the behavior clear in both code and docs?
84+
85+
If the answer is mostly "no," it is not ready yet.

docs/developer-guide/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ This guide is for contributors changing code in Loop itself.
55
## Start Here
66

77
1. [Setup](./setup.md)
8-
2. [Quality Gates](./quality-gates.md)
9-
3. [Contribution Workflow](./contribution-workflow.md)
10-
4. [API Docs Status](./api-docs-status.md)
8+
2. [Workflow Cookbook](./workflow-cookbook.md)
9+
3. [Quality Gates](./quality-gates.md)
10+
4. [Contribution Workflow](./contribution-workflow.md)
11+
5. [API Docs Status](./api-docs-status.md)
1112

1213
## Development Contract
1314

@@ -22,3 +23,4 @@ This guide is for contributors changing code in Loop itself.
2223
- Runtime planning and multi-session execution rules: `docs/execution-plan/`
2324
- Feature contracts: `docs/spec/`
2425
- Architecture rationale: `docs/adr/`
26+
- Fast command lookup: `docs/reference/command-reference.md`

docs/developer-guide/contribution-workflow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ A disciplined path from idea to merged, reproducible change.
1818

1919
1. Run targeted tests during development.
2020
2. Run `make check` before commit.
21-
3. Run governance gates before push.
21+
3. Run `make docs-check` for docs/style safety.
22+
4. Run governance gates before push.
2223

2324
## 4. Close Work Properly
2425

0 commit comments

Comments
 (0)