Skip to content

Commit e64dee4

Browse files
committed
docs: build comprehensive audience-first documentation
1 parent 2c3ce7f commit e64dee4

23 files changed

+1165
-4
lines changed

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,27 @@ rlm-core powers these projects:
158158

159159
## Documentation
160160

161-
- [Unified Library Design](docs/unified-rlm-library-design.md) - Architecture overview
162-
- [Migration Spec: recurse](docs/migration-spec-recurse.md) - Go integration guide
163-
- [Migration Spec: rlm-claude-code](docs/migration-spec-rlm-claude-code.md) - Python integration guide
164-
- [Implementation Roadmap](docs/implementation-roadmap.md) - Development phases
161+
### Start Here
162+
- [Documentation Portal](docs/README.md) - Role-based index and workflow-oriented navigation.
163+
- [User Guide](docs/user-guide/README.md) - New user to power-user guidance.
164+
- [Developer Guide](docs/developer-guide/README.md) - Setup, gates, and contribution workflow.
165+
- [Internals](docs/internals/README.md) - Architecture, OODA flow, and module map.
166+
- [Troubleshooting](docs/troubleshooting/README.md) - Incident triage and diagnostics checklists.
167+
168+
### Conceptual and Architecture
169+
- [Concepts](docs/concepts/README.md) - Mental model and system vocabulary.
170+
- [Unified Library Design](docs/unified-rlm-library-design.md) - Long-form architecture background.
171+
- [Lean Formal Verification Design](docs/lean-formal-verification-design.md) - Formal methods design rationale.
172+
- [ADR Index](docs/adr/) - Decision records and architectural tradeoffs.
173+
174+
### Specifications and Planning
175+
- [Spec Contracts](docs/spec/) - Canonical feature-level specifications (SPEC-20 through SPEC-27).
176+
- [Execution Plan](docs/execution-plan/README.md) - Program execution, evidence, and governance operations.
177+
- [Implementation Roadmap](docs/implementation-roadmap.md) - Development phases.
178+
179+
### Integration and Migration
180+
- [Migration Spec: recurse](docs/migration-spec-recurse.md) - Go integration plan.
181+
- [Migration Spec: rlm-claude-code](docs/migration-spec-rlm-claude-code.md) - Python/plugin integration plan.
165182

166183
## License
167184

docs/README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Loop Documentation
2+
3+
Welcome to the part of the project where we admit future-you exists.
4+
5+
This documentation is organized by audience and workflow, not by who happened to write the last markdown file at 2:13 AM.
6+
7+
## Choose Your Path
8+
9+
| If you are... | Start here | Then go to |
10+
|---|---|---|
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/) |
15+
16+
## Documentation Map
17+
18+
### User-Facing
19+
- [User Guide](./user-guide/README.md): Start-to-finish guidance by skill level.
20+
- [Workflow Recipes](./user-guide/workflow-recipes.md): End-to-end task playbooks.
21+
- [Power User Playbook](./user-guide/power-user-playbook.md): Performance, scale, and control.
22+
23+
### Developer-Facing
24+
- [Developer Guide](./developer-guide/README.md): Build and change Loop safely.
25+
- [Setup](./developer-guide/setup.md): Environment bootstrap.
26+
- [Quality Gates](./developer-guide/quality-gates.md): Tests, checks, governance.
27+
- [Contribution Workflow](./developer-guide/contribution-workflow.md): Branch-to-merge routine.
28+
29+
### Architecture and Internals
30+
- [Concepts](./concepts/README.md): Mental models and design vocabulary.
31+
- [Internals](./internals/README.md): Runtime architecture and module boundaries.
32+
- [Architecture](./internals/architecture.md): System structure and data flow.
33+
- [OODA + Execution Flow](./internals/ooda-and-execution.md): Observe/Orient/Decide/Act mapping.
34+
- [Module Map](./internals/module-map.md): Where behavior actually lives.
35+
36+
### Operational and Recovery
37+
- [Troubleshooting](./troubleshooting/README.md): Fast diagnosis and fix paths.
38+
- [Common Issues](./troubleshooting/common-issues.md): Known failure patterns.
39+
- [Diagnostics Checklist](./troubleshooting/diagnostics-checklist.md): Structured incident capture.
40+
41+
### Reference and Specifications
42+
- [Specification Set](./spec/): Canonical feature contracts (SPEC-20 through SPEC-27).
43+
- [Execution Plan](./execution-plan/README.md): Program-level planning, evidence, and governance.
44+
- [Architecture Decisions](./adr/): Long-lived technical decisions and context.
45+
- [Glossary](./glossary.md): Shared terms and definitions.
46+
- [Writing Style](./writing-style.md): Documentation voice and formatting contract.
47+
48+
## Documentation Principles
49+
50+
1. Behavior over aspiration: document what exists and runs.
51+
2. Workflow over component: prefer "how to get outcome X" over "here is a list of modules".
52+
3. Reproducibility over vibes: include concrete commands and expected outputs.
53+
4. Honesty over smoothness: if something is sharp, say so plainly.
54+
5. Friendly precision: direct writing, with enough personality that reading it does not feel like filing taxes.
55+
56+
## Suggested Reading Order
57+
58+
1. [Concepts: Mental Model](./concepts/mental-model.md)
59+
2. [User Guide](./user-guide/README.md)
60+
3. [Developer Setup](./developer-guide/setup.md)
61+
4. [Internals Architecture](./internals/architecture.md)
62+
5. [Troubleshooting](./troubleshooting/README.md)
63+
64+
## Scope Note
65+
66+
The docs in this folder are the operational surface. Deep design history and migration rationale still live in long-form docs such as:
67+
- `docs/unified-rlm-library-design.md`
68+
- `docs/lean-formal-verification-design.md`
69+
- `docs/migration-spec-recurse.md`
70+
- `docs/migration-spec-rlm-claude-code.md`
71+
72+
Those are excellent references; they are not where a newcomer should start unless they really enjoy scrolling.

docs/concepts/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Concepts
2+
3+
This section explains how to think about Loop before you care about where any specific function lives.
4+
5+
## Start Here
6+
7+
- [Mental Model](./mental-model.md)
8+
9+
## Conceptual Layers
10+
11+
1. **Intent Layer**: User goals and jobs-to-be-done.
12+
2. **Orchestration Layer**: Complexity classification, decomposition, and execution strategy.
13+
3. **Evidence Layer**: Memory, traces, and verification artifacts.
14+
4. **Assurance Layer**: Tests, policy gates, compatibility checks, and release controls.
15+
16+
## Why This Matters
17+
18+
If you skip conceptual grounding and start from implementation details, everything feels random.
19+
20+
If you start here, the codebase reads like a system instead of a haunted attic.

docs/concepts/mental-model.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Loop Mental Model
2+
3+
Loop is a runtime for turning "this problem is too big" into "this is a sequence of tractable decisions with receipts".
4+
5+
## The Core Loop
6+
7+
1. **Observe**
8+
- Collect user intent, context state, and relevant file/tool signals.
9+
10+
2. **Orient**
11+
- Classify complexity and decide whether recursive orchestration is warranted.
12+
- Externalize context into a structure that modules can reason over.
13+
14+
3. **Decide**
15+
- Choose model, budget posture, decomposition strategy, and validation depth.
16+
17+
4. **Act**
18+
- Execute module flows, produce outputs, persist traces/evidence, and report outcomes.
19+
20+
The cycle repeats until quality and completion criteria are met.
21+
22+
## Design Tensions
23+
24+
### Speed vs Certainty
25+
- Fast path gives quick iteration.
26+
- Deep path increases cost but catches mistakes earlier.
27+
- Loop makes this tradeoff explicit via mode selection and policy gates.
28+
29+
### Flexibility vs Reproducibility
30+
- Dynamic runtime behaviors are useful.
31+
- Production workflows need deterministic checks.
32+
- Loop uses typed signatures, structured events, and governance gates to keep both.
33+
34+
### Automation vs Human Control
35+
- Automation scales throughput.
36+
- Humans still own risk decisions.
37+
- Loop supports policy-based enforcement and evidence-first handoff.
38+
39+
## What "Good" Looks Like
40+
41+
A healthy Loop workflow has:
42+
- Clear intent capture.
43+
- Explicit strategy selection.
44+
- Traceable execution decisions.
45+
- Evidence for claims.
46+
- Reproducible quality checks.
47+
48+
Or, put differently: fewer mysteries and fewer surprises during push.

docs/developer-guide/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Developer Guide
2+
3+
This guide is for contributors changing code in Loop itself.
4+
5+
## Start Here
6+
7+
1. [Setup](./setup.md)
8+
2. [Quality Gates](./quality-gates.md)
9+
3. [Contribution Workflow](./contribution-workflow.md)
10+
11+
## Development Contract
12+
13+
1. Build and tests must pass locally.
14+
2. Governance gates must pass.
15+
3. Behavior changes must be documented.
16+
4. Evidence must exist for critical claims.
17+
5. Push-ready means actually pushed, not emotionally prepared.
18+
19+
## Scope Notes
20+
21+
- Runtime planning and multi-session execution rules: `docs/execution-plan/`
22+
- Feature contracts: `docs/spec/`
23+
- Architecture rationale: `docs/adr/`
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Contribution Workflow
2+
3+
A disciplined path from idea to merged, reproducible change.
4+
5+
## 1. Intake and Scope
6+
7+
1. Understand the user/job outcome.
8+
2. Confirm existing issue context (`bd ready`, `bd show <id>`).
9+
3. Claim work (`bd update <id> --status in_progress`).
10+
11+
## 2. Implement in Small Increments
12+
13+
1. Make scoped changes.
14+
2. Add or update tests with behavior changes.
15+
3. Keep docs aligned in the same change set.
16+
17+
## 3. Validate Continuously
18+
19+
1. Run targeted tests during development.
20+
2. Run `make check` before commit.
21+
3. Run governance gates before push.
22+
23+
## 4. Close Work Properly
24+
25+
1. `bd close <id> --reason "implemented + verified"`
26+
2. `bd sync`
27+
3. `git add ...`
28+
4. `git commit -m "type: summary"`
29+
5. `git push`
30+
31+
## 5. Verify Landing
32+
33+
1. `git status` shows clean working tree.
34+
2. Branch is up to date with remote.
35+
3. Issue tracker reflects final status.
36+
37+
## Documentation Requirements
38+
39+
For notable changes, include:
40+
1. What changed.
41+
2. Why it changed.
42+
3. How it was validated.
43+
4. Where evidence lives.
44+
45+
## Anti-Patterns to Avoid
46+
47+
1. Large mixed-purpose commits.
48+
2. Undocumented behavior changes.
49+
3. Skipping gates because "it worked once locally".
50+
4. Leaving local-only commits at session end.
51+
52+
In short: ship predictably, not poetically.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Quality Gates
2+
3+
Loop uses layered quality gates: local correctness, policy enforcement, and release-grade verification.
4+
5+
## Gate Layers
6+
7+
### Layer 1: Local correctness
8+
9+
```bash
10+
make check
11+
```
12+
13+
Runs:
14+
- Type checks
15+
- Tests
16+
17+
### Layer 2: Governance review
18+
19+
```bash
20+
./scripts/dp review --json
21+
./scripts/dp verify --json
22+
```
23+
24+
Purpose:
25+
- Consistent, machine-readable status
26+
- Standardized workflow enforcement
27+
28+
### Layer 3: Enforcement gates
29+
30+
```bash
31+
./scripts/dp enforce pre-commit --policy dp-policy.json --json
32+
./scripts/dp enforce pre-push --policy dp-policy.json --json
33+
```
34+
35+
Purpose:
36+
- Block policy violations before commit/push boundaries
37+
38+
## Required Interpretation Rules
39+
40+
1. Exit code is authoritative.
41+
2. JSON `ok` is authoritative.
42+
3. Warnings are not failures, but they are not decorative either.
43+
44+
## Failure Protocol
45+
46+
When a gate fails:
47+
1. Re-run same command to confirm.
48+
2. Isolate first failing step.
49+
3. Fix root cause.
50+
4. Re-run full gate chain.
51+
52+
No partial-pass narratives.
53+
54+
## Suggested Daily Rhythm
55+
56+
1. During iteration: targeted tests.
57+
2. Before commit: `make check`.
58+
3. Before push: full `dp` enforcement chain.
59+
60+
## Evidence Logging
61+
62+
For major changes, capture outputs into:
63+
- `docs/execution-plan/evidence/<date>/<scope>/...`
64+
65+
This makes reviews faster and postmortems less fictional.

docs/developer-guide/setup.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Developer Setup
2+
3+
## Toolchain
4+
5+
Install and verify:
6+
7+
```bash
8+
rustc --version
9+
python3 --version
10+
go version
11+
uv --version
12+
```
13+
14+
Recommended minimums:
15+
- Rust 1.75+
16+
- Python 3.11+
17+
- Go 1.22+
18+
19+
## Repository Bootstrap
20+
21+
```bash
22+
git clone https://github.com/rand/loop.git
23+
cd loop
24+
```
25+
26+
Build Rust core:
27+
28+
```bash
29+
cd rlm-core
30+
cargo build --release
31+
```
32+
33+
## Python Binding Setup
34+
35+
```bash
36+
cd /Users/rand/src/loop/rlm-core/python
37+
uv sync
38+
uv run maturin develop --release
39+
```
40+
41+
## Go Binding Setup
42+
43+
```bash
44+
cd /Users/rand/src/loop/rlm-core
45+
test -f target/release/librlm_core.a || cargo build --release --lib
46+
47+
cd /Users/rand/src/loop/rlm-core/go/rlmcore
48+
go test ./...
49+
```
50+
51+
## Fast Sanity Check
52+
53+
From repository root:
54+
55+
```bash
56+
make check
57+
./scripts/dp review --json
58+
```
59+
60+
If both pass, you have a working developer environment.
61+
62+
## Environment Tips
63+
64+
1. Run commands from repository root unless a doc says otherwise.
65+
2. Prefer offline-capable iterations where practical.
66+
3. Keep evidence files in `docs/execution-plan/evidence/...` for nontrivial validations.
67+
68+
## When Setup Fails
69+
70+
Go directly to:
71+
- [Common Issues](../troubleshooting/common-issues.md)
72+
- [Diagnostics Checklist](../troubleshooting/diagnostics-checklist.md)

0 commit comments

Comments
 (0)