Skip to content

Commit 4232260

Browse files
document v2 docgen workspace
1 parent 432c753 commit 4232260

1 file changed

Lines changed: 60 additions & 69 deletions

File tree

Lines changed: 60 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,67 @@
1-
# `.docgen` workspace
1+
# `.docgen` workspace — v2
22

3-
This directory is the explicit machine-readable state of Command Code DocGen Kit.
3+
This directory stores the machine-readable state of the token-efficient DocGen pipeline.
44

55
## Flow
66

77
```text
8-
source
9-
-> evidence/
10-
-> model/
8+
included text source
9+
-> index/inventory.json
10+
-> index/semantic.db
11+
-> context/** bounded packs
12+
-> model/** typed knowledge
1113
-> plan/manifest.json
12-
-> ../docs/**/*.md
13-
-> audit/
14+
-> ../docs/**/*.md + traceability/pages/*.json
15+
-> audit/**
16+
-> publish/**
1417
```
1518

1619
## Directories
1720

18-
- `config/` — project documentation policy, glossary, style, and Command Code runtime configuration.
19-
- `schemas/` — JSON contracts for generated intermediate artifacts.
20-
- `prompts/` — bounded stage prompts used by the orchestrator.
21-
- `evidence/` — source-grounded facts and their index.
22-
- `model/` — components, relationships, workflows, unknowns, and system model.
23-
- `plan/` — documentation manifest and incremental update plan.
24-
- `audit/` — per-page findings and aggregate audit index.
25-
- `runs/` — metadata for each orchestrated Command Code headless invocation.
26-
- `state/` — pipeline state, fingerprints, and compatibility report.
27-
28-
## Most important files
21+
- `config/` — runtime, budget, context, ignore, audit, and publishing policy.
22+
- `index/` — canonical inventory plus SQLite/FTS5 files, facts, source chunks, model items, and context metadata.
23+
- `context/` — content-addressed bounded inputs supplied to provider runs.
24+
- `model/` — core and enterprise typed semantic models.
25+
- `plan/` — the bounded page manifest.
26+
- `traceability/` — claim-level page sidecars and aggregate index.
27+
- `audit/` — deterministic checks, selective high-risk LLM audit, and quality summary.
28+
- `telemetry/` — provider-run JSONL telemetry.
29+
- `budget/` — current call/token budget report.
30+
- `runs/` — stdout/stderr logs for provider calls.
31+
- `publish/` — deterministic navigation and search metadata.
32+
- `state/` — content-hash stage and page checkpoints.
33+
- `migration-backup/` — archived v1 artifacts created by `docgen migrate`.
34+
35+
## Important files
2936

3037
```text
3138
config/documentation.json
32-
config/style-guide.md
33-
config/glossary.md
34-
evidence/index.json
35-
model/system.json
36-
plan/manifest.json
37-
audit/index.json
39+
index/inventory.json
40+
index/source-files.txt
41+
index/semantic.db
3842
state/state.json
39-
state/fingerprints.json
40-
state/compatibility.json
43+
plan/manifest.json
44+
traceability/index.json
45+
audit/quality-summary.json
46+
budget/report.json
47+
publish/navigation.json
48+
publish/search-index.json
4149
```
4250

43-
Do not treat generated documentation as more authoritative than source evidence. The pipeline intentionally preserves FACT / INFERENCE / UNKNOWN boundaries.
51+
## Provider boundary
4452

53+
Provider sessions may read only their declared `.docgen/context/**` pack and stage output paths. They may not scan repository source, query SQLite, load broad model directories, inspect unrelated pages, or delegate to installed agents. This boundary is enforced by hooks as well as prompts.
4554

46-
## Core knowledge models
55+
## Models
4756

48-
In addition to technical architecture, DocGen generates repository-local normalized models for business semantics, distinct flow types, and exhaustive interface/dependency catalogs:
57+
Core:
4958

59+
- `model/system.json`
5060
- `model/business.json`
5161
- `model/flows.json`
5262
- `model/catalogs.json`
5363

54-
Published diagrams are Mermaid-only.
55-
56-
## P0 trustworthiness artifacts
57-
58-
- `traceability/pages/*.json`: claim-level source mappings per page.
59-
- `traceability/index.json`: aggregated claims and source snapshot.
60-
- `traceability/contradictions.json`: conflicting subject/predicate claims.
61-
- `traceability/duplicates.json`: unintentional repeated claims.
62-
- `traceability/freshness.json`: page/input/source staleness status.
63-
- `audit/quality-summary.json`: evidence-centric quality metrics.
64-
65-
66-
## P1 enterprise-depth models
67-
68-
The enterprise stage produces repository-local typed models:
64+
Enterprise:
6965

7066
- `model/security.json`
7167
- `model/operations.json`
@@ -76,40 +72,35 @@ The enterprise stage produces repository-local typed models:
7672
- `model/change-impact.json`
7773
- `model/ownership.json`
7874

79-
These models cover trust boundaries, AuthN/AuthZ, ownership/RACI, operational health and recovery, test strategy, data correctness/governance, environment configuration, architectural rationale, and change blast radius.
75+
All material items and page claims preserve `FACT`, `INFERENCE`, and `UNKNOWN`. FACT requires evidence from `index/inventory.json`.
8076

81-
## Ignore-aware source inventory
77+
## Commands
8278

83-
DocGen follows repository `.gitignore` and root `.docgenignore`. The effective included source set is written to:
84-
85-
- `state/source-inventory.json`
86-
- `state/source-files.txt`
87-
- `state/ignore-report.json`
88-
89-
Ignored files are excluded from discovery, fingerprints, change detection, traceability, and FACT evidence. Use `docgen ignore`, `docgen source-list`, and `docgen source-grep` to inspect or search the effective source boundary.
90-
91-
## v0.9 P2 documentation experience
92-
93-
Published pages are classified by user intent: `tutorial`, `how-to`, `explanation`, `reference`, `runbook`, `decision-record`, `migration-guide`, or `troubleshooting`. DocGen deterministically produces:
94-
95-
- Markdown frontmatter;
96-
- `docs/llms.txt` and bounded `docs/llms-full.txt`;
97-
- `publish/navigation.json` and `publish/search-index.json`;
98-
- backlinks, aliases/redirects, orphan-page and examples indexes;
99-
- version, status, deprecation, replacement, and migration metadata.
79+
```bash
80+
docgen migrate # v1 repositories only
81+
docgen index # deterministic and incremental
82+
docgen model # two bounded synthesis calls
83+
docgen plan
84+
docgen generate # deterministic references + bounded narratives
85+
docgen audit # deterministic + selective risk audit
86+
docgen publish # no provider call
87+
docgen budget
88+
docgen status
89+
```
10090

101-
Run `docgen publish` to rebuild these assets without an LLM call.
91+
`docgen all` and `docgen resume` run the full content-hash-resumable flow.
10292

103-
## Binary and non-text token boundary
93+
## Ignore and binary boundary
10494

105-
Known images, audio/video, PDFs and office documents, archives, compiled artifacts, fonts, database files, keystores, invalid UTF-8, NUL-containing files, and oversized text are excluded from the canonical source inventory. The exclusion applies to reads, grep, fingerprints, change detection, freshness, and evidence validation. Configure the boundary under `ignore.binary` in `config/documentation.json`.
95+
`.gitignore`, `.docgenignore`, hard exclusions, binary signatures, invalid UTF-8, NUL bytes, and oversized text are applied before indexing. Use `docgen ignore`, `docgen source-list`, and `docgen source-grep` to inspect the effective source boundary.
10696

107-
## Multi-repository P3
97+
## Multi-repository workspace
10898

109-
This repository can be registered into a parent system workspace with:
99+
Register this repository into a parent workspace only after its models are current:
110100

111101
```bash
112102
docgen workspace add /path/to/this-repository
103+
docgen workspace all
113104
```
114105

115-
P3 consumes this repository's validated `.docgen/model/**`, catalogs, ownership, traceability, source fingerprint, and commit metadata. It does not blindly rescan ignored or binary source files.
106+
Workspace aggregation consumes validated repository models and hashes; it does not rescan source.

0 commit comments

Comments
 (0)