|
1 | 1 | <!-- COMMANDCODE-DOCGEN:START --> |
2 | | -# Documentation Engineering System |
| 2 | +# DocGen 2 Documentation Engineering |
3 | 3 |
|
4 | | -This repository contains an evidence-grounded documentation workflow under `.docgen/**` with published Markdown under `docs/**`. |
| 4 | +This repository uses a token-efficient, evidence-grounded documentation pipeline. Repository source is indexed once into `.docgen/index/semantic.db`; provider runs receive bounded `.docgen/context/**` packs rather than broad source access. |
5 | 5 |
|
6 | | -## Authority Order |
| 6 | +## Authority order |
7 | 7 |
|
8 | | -When documentation claims conflict, use this authority order: |
| 8 | +1. application source and executable behavior; |
| 9 | +2. configuration, API/message contracts, schemas, migrations, and deployment manifests; |
| 10 | +3. deterministic facts/source chunks in the semantic index; |
| 11 | +4. typed `.docgen/model/**` items; |
| 12 | +5. generated documentation. |
9 | 13 |
|
10 | | -1. application source code and executable behavior |
11 | | -2. configuration, contracts, schemas, migrations, and deployment manifests |
12 | | -3. generated evidence artifacts in `.docgen/evidence/**` |
13 | | -4. normalized models in `.docgen/model/**` |
14 | | -5. existing documentation |
| 14 | +Existing prose is not authoritative over contradictory source evidence. |
15 | 15 |
|
16 | | -Existing prose is never authoritative over contradictory source evidence. |
| 16 | +## Epistemic rules |
17 | 17 |
|
18 | | -## Epistemic Rules |
| 18 | +Material statements are `FACT`, `INFERENCE`, or `UNKNOWN`. |
19 | 19 |
|
20 | | -Important technical statements must be treated as one of: |
| 20 | +- `FACT` requires direct repository-relative evidence present in the canonical source inventory. |
| 21 | +- `INFERENCE` must identify supporting facts/model items. |
| 22 | +- `UNKNOWN` preserves missing or disputed information without guessing. |
21 | 23 |
|
22 | | -- `FACT`: directly supported by source evidence |
23 | | -- `INFERENCE`: derived from multiple facts; the supporting evidence must be recorded |
24 | | -- `UNKNOWN`: insufficient evidence; do not invent a conclusion |
| 24 | +Never invent endpoints, rules, states, integrations, ownership, security behavior, retry behavior, failure semantics, or operational guarantees. |
25 | 25 |
|
26 | | -Never invent endpoints, business rules, state transitions, integrations, data ownership, security behavior, retry behavior, failure semantics, or operational guarantees. |
27 | | - |
28 | | -## Documentation Workflow |
29 | | - |
30 | | -Use this order: |
| 26 | +## Workflow |
31 | 27 |
|
32 | 28 | ```text |
33 | | -discover -> analyze -> plan -> generate -> audit -> fix as needed |
| 29 | +index -> model -> plan -> generate -> audit -> publish |
34 | 30 | ``` |
35 | 31 |
|
36 | | -Do not skip directly from source code to broad user-facing documentation for non-trivial systems. |
37 | | - |
38 | | -## Artifact Boundaries |
| 32 | +Use `docgen all` or `docgen resume` for the complete content-hash-resumable pipeline. For a v1 project, run `docgen migrate` first. |
39 | 33 |
|
40 | | -- evidence: `.docgen/evidence/**` |
41 | | -- architecture/workflow model: `.docgen/model/**` |
42 | | -- documentation plan: `.docgen/plan/**` |
43 | | -- audit findings: `.docgen/audit/**` |
44 | | -- generated documentation: `docs/**` |
| 34 | +## Token boundary |
45 | 35 |
|
46 | | -DocGen workflows must not modify application source, build files, migrations, infrastructure, or tests. |
| 36 | +- source inventory: `.docgen/index/inventory.json` and `.docgen/index/source-files.txt`; |
| 37 | +- semantic index: `.docgen/index/semantic.db`; |
| 38 | +- bounded provider inputs: `.docgen/context/**`; |
| 39 | +- provider telemetry/budget: `.docgen/telemetry/**` and `.docgen/budget/report.json`; |
| 40 | +- typed models: `.docgen/model/**`; |
| 41 | +- page plan: `.docgen/plan/manifest.json`; |
| 42 | +- traceability: `.docgen/traceability/**`; |
| 43 | +- audit results: `.docgen/audit/**`; |
| 44 | +- published documentation: `docs/**`. |
47 | 45 |
|
48 | | -## Writing Standard |
| 46 | +Provider runs are context-only: they must not read repository source, the SQLite database, broad model directories, unrelated pages, agents, or skills. Deterministic index/render/audit code owns those boundaries. |
49 | 47 |
|
50 | | -Write for engineers who do not yet know the codebase. Prefer purpose, mental model, responsibilities, boundaries, interactions, workflows, state transitions, failure behavior, and actionable guides. Avoid file-by-file or class-by-class narration. |
51 | | - |
52 | | -Use standard Markdown and Mermaid. Keep claims precise and traceable to evidence. Mark genuine uncertainty instead of smoothing it over. |
53 | | -<!-- COMMANDCODE-DOCGEN:END --> |
| 48 | +## Writing standard |
54 | 49 |
|
| 50 | +Write for engineers who do not yet know the codebase. Prefer purpose, mental models, boundaries, interactions, lifecycles, branches, failure behavior, and actionable guidance over file-by-file narration. Use standard Markdown and Mermaid only. Keep claims precise and traceable. |
55 | 51 |
|
56 | | -## Source Inventory and Ignore Boundary |
| 52 | +## Enterprise and workspace depth |
57 | 53 |
|
58 | | -During DocGen workflows, repository source access must follow `.docgen/state/source-files.txt`. Do not read, search, cite, fingerprint, or use as FACT evidence any file excluded by `.gitignore`, `.docgenignore`, DocGen hard exclusions, or project `config.exclude`. Use explicit included paths or `docgen source-grep` instead of broad wildcard reads. |
| 54 | +When evidence supports it, model security, operations, testing, data governance, decisions, configuration, change impact, and ownership. Multi-repository workspace analysis consumes validated repository models and must preserve unresolved edges rather than inventing cross-service links. |
59 | 55 |
|
60 | | -## P1 Enterprise Depth |
61 | | - |
62 | | -When supported by evidence, build typed models for security, operations, testing, data governance, decisions, configuration, change impact, and ownership. Keep policy, business semantics, implementation behavior, operational guarantees, and inferred rationale epistemically distinct. Do not invent SLOs, permissions, owners, retention periods, recovery guarantees, or architectural rationale. |
63 | | - |
64 | | -## P3 system-of-systems workspace |
65 | | - |
66 | | -For multi-repository documentation, use `docgen workspace ...` from a parent workspace. Workspace analysis must consume validated `.docgen/model/**` artifacts from member repositories rather than bypassing repository ignore, binary, traceability, and contract boundaries. Cross-repository relationships require explicit contract/dependency evidence. All system diagrams use Mermaid. |
| 56 | +DocGen workflows may write only under `.docgen/**` and `docs/**`; they must not modify application source, build files, migrations, infrastructure, or tests. |
| 57 | +<!-- COMMANDCODE-DOCGEN:END --> |
0 commit comments