@nurix/etna 0.20.25 → 0.20.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/data/harness-index.json +1 -1
  2. package/data/harnesses/code/CLAUDE.md +4 -4
  3. package/data/harnesses/code/agents/bookkeeper.md +1 -1
  4. package/data/harnesses/code/agents/change-review.md +1 -1
  5. package/data/harnesses/code/agents/lld-mode.md +1 -1
  6. package/data/harnesses/code/agents/maintenance.md +7 -9
  7. package/data/harnesses/code/docs/structure.md +133 -71
  8. package/data/harnesses/code/harness.json +4 -4
  9. package/data/harnesses/code/hooks/awareness.mjs +0 -10
  10. package/data/harnesses/code/hooks/lib/ownership.mjs +4 -2
  11. package/data/harnesses/code/hooks/lib/sweep.mjs +4 -8
  12. package/data/harnesses/code/skills/documentation/SKILL.md +22 -11
  13. package/data/harnesses/code/skills/documentation/references/examples.md +29 -25
  14. package/data/harnesses/code/skills/documentation/references/frontmatter.md +3 -3
  15. package/data/harnesses/code/skills/documentation/references/style-guide.md +211 -292
  16. package/data/harnesses/code/skills/documentation/references/untemplated.md +4 -2
  17. package/data/harnesses/code/skills/documentation/scripts/doc-lint.mjs +104 -2
  18. package/data/harnesses/code/skills/documentation/templates/Readme.md +4 -3
  19. package/data/harnesses/code/skills/documentation/templates/bookkeeping.md +1 -1
  20. package/data/harnesses/code/skills/documentation/templates/docs-readme.md +15 -36
  21. package/data/harnesses/code/skills/documentation/templates/doctrine.md +81 -0
  22. package/data/harnesses/code/skills/documentation/templates/feature.md +63 -119
  23. package/data/harnesses/code/skills/documentation/templates/handover.md +174 -0
  24. package/data/harnesses/code/skills/documentation/templates/operations-procedure.md +1 -1
  25. package/data/harnesses/code/skills/documentation/templates/package.md +49 -92
  26. package/data/harnesses/code/skills/documentation/templates/root-readme.md +103 -65
  27. package/data/harnesses/code/skills/documentation/templates/setup.md +138 -0
  28. package/data/harnesses/code/skills/documentation/templates/system.md +45 -107
  29. package/data/harnesses/delivery/agents/lld-mode.md +1 -1
  30. package/data/harnesses/delivery/agents/maintenance.md +7 -9
  31. package/data/harnesses/delivery/harness.json +2 -2
  32. package/data/harnesses/delivery/skills/documentation/SKILL.md +22 -11
  33. package/data/harnesses/delivery/skills/documentation/references/examples.md +29 -25
  34. package/data/harnesses/delivery/skills/documentation/references/frontmatter.md +3 -3
  35. package/data/harnesses/delivery/skills/documentation/references/style-guide.md +211 -292
  36. package/data/harnesses/delivery/skills/documentation/references/untemplated.md +4 -2
  37. package/data/harnesses/delivery/skills/documentation/scripts/doc-lint.mjs +104 -2
  38. package/data/harnesses/delivery/skills/documentation/templates/Readme.md +4 -3
  39. package/data/harnesses/delivery/skills/documentation/templates/bookkeeping.md +1 -1
  40. package/data/harnesses/delivery/skills/documentation/templates/docs-readme.md +15 -36
  41. package/data/harnesses/delivery/skills/documentation/templates/doctrine.md +81 -0
  42. package/data/harnesses/delivery/skills/documentation/templates/feature.md +63 -119
  43. package/data/harnesses/delivery/skills/documentation/templates/handover.md +174 -0
  44. package/data/harnesses/delivery/skills/documentation/templates/operations-procedure.md +1 -1
  45. package/data/harnesses/delivery/skills/documentation/templates/package.md +49 -92
  46. package/data/harnesses/delivery/skills/documentation/templates/root-readme.md +103 -65
  47. package/data/harnesses/delivery/skills/documentation/templates/setup.md +138 -0
  48. package/data/harnesses/delivery/skills/documentation/templates/system.md +45 -107
  49. package/data/harnesses/etna/agents/change-review.md +1 -1
  50. package/data/harnesses/etna/agents/lld-mode.md +1 -1
  51. package/data/harnesses/etna/agents/maintenance.md +7 -9
  52. package/data/harnesses/etna/harness.json +2 -2
  53. package/data/harnesses/etna/skills/documentation/SKILL.md +22 -11
  54. package/data/harnesses/etna/skills/documentation/references/examples.md +29 -25
  55. package/data/harnesses/etna/skills/documentation/references/frontmatter.md +3 -3
  56. package/data/harnesses/etna/skills/documentation/references/style-guide.md +211 -292
  57. package/data/harnesses/etna/skills/documentation/references/untemplated.md +4 -2
  58. package/data/harnesses/etna/skills/documentation/scripts/doc-lint.mjs +104 -2
  59. package/data/harnesses/etna/skills/documentation/templates/Readme.md +4 -3
  60. package/data/harnesses/etna/skills/documentation/templates/bookkeeping.md +1 -1
  61. package/data/harnesses/etna/skills/documentation/templates/docs-readme.md +15 -36
  62. package/data/harnesses/etna/skills/documentation/templates/doctrine.md +81 -0
  63. package/data/harnesses/etna/skills/documentation/templates/feature.md +63 -119
  64. package/data/harnesses/etna/skills/documentation/templates/handover.md +174 -0
  65. package/data/harnesses/etna/skills/documentation/templates/operations-procedure.md +1 -1
  66. package/data/harnesses/etna/skills/documentation/templates/package.md +49 -92
  67. package/data/harnesses/etna/skills/documentation/templates/root-readme.md +103 -65
  68. package/data/harnesses/etna/skills/documentation/templates/setup.md +138 -0
  69. package/data/harnesses/etna/skills/documentation/templates/system.md +45 -107
  70. package/lib/install/materialize.mjs +4 -12
  71. package/lib/install/plan.mjs +4 -11
  72. package/package.json +3 -2
  73. package/data/harnesses/code/skills/documentation/templates/structure.md +0 -71
  74. package/data/harnesses/delivery/skills/documentation/templates/structure.md +0 -71
  75. package/data/harnesses/etna/skills/documentation/templates/structure.md +0 -71
@@ -7,7 +7,7 @@ description: "Use when creating or substantively editing ANY markdown doc — in
7
7
 
8
8
  **This skill is a template & generator library, not an orchestrator.** It supplies the templates, the frontmatter-derivation generator, and the co-authoring workflow that _agents_ call to produce individual docs. It does **not** baseline, audit, or reconcile a repo's doc tree — that is the **`maintenance` agent (baseline mode)**, which calls this skill for each template it scaffolds. Reach here to generate _one_ doc from a template; reach for the `maintenance` agent (baseline mode) to bring a whole repo into shape.
9
9
 
10
- Document contracts and architecture, not implementation details. Show function signatures and API shapes — never paste full implementations (they rot fast). Use ASCII diagrams over prose for flows. Only document state at persistence boundaries (Redux persistence, DB schemas, API shapes), not component-level or transient state. Mark deprecated fields with `// UNUSED:` comments stating why the field is dead now — never where it went or when it dies. Breaking changes belong in changelogs only, not module docs.
10
+ Document contracts and architecture, not implementation details. Signatures and API shapes belong in a reference document (an API reference, an environment registry); every other genre states design and promises and leaves mechanism to the code — never paste full implementations (they rot fast). A diagram sits beside the prose and never replaces it: ASCII for structure at rest, mermaid for behaviour over time (`references/style-guide.md` § Diagrams). Only document state at persistence boundaries (Redux persistence, DB schemas, API shapes), not component-level or transient state. Mark deprecated fields with `// UNUSED:` comments stating why the field is dead now — never where it went or when it dies. Breaking changes belong in changelogs only, not module docs.
11
11
 
12
12
  ---
13
13
 
@@ -42,9 +42,9 @@ Document contracts and architecture, not implementation details. Show function s
42
42
  | "Folded in from the `NuStack-X` repo (2026-06-12)." | "Vendor-connector catalogue; one subpath per vendor." |
43
43
  | "was X, now Y", "the old worker", "Phase 2 softened this", "v1 → v2" | The current fact, with no predecessor named |
44
44
 
45
- The journey — dates, migrations, progress, supersessions — lives only in records (`docs/history/`); when reality changes, a truth document simply becomes correct. The full strip-list and the record-side rules: [`references/style-guide.md`](references/style-guide.md) § The Two Natures — Tense & History.
45
+ The journey — dates, migrations, progress, supersessions — lives only in records (`docs/history/`); when reality changes, a truth document simply becomes correct. The full strip-list and the record-side rules: [`references/style-guide.md`](references/style-guide.md) § The Two Natures — tense and history.
46
46
 
47
- **A date in a truth document is a defect, and the list of exceptions is closed.** Not a softened preference: a truth document carries no dated line at all, because a date answers *when did this happen*, which is a record's question, and a reader who needs the answer is reading the wrong file. The four exceptions, and there are no others: the frontmatter's tooling keys (`last-reviewed:`, `last-updated:`, `rev:` — written by tooling, never by you), an Architecture Decision's **Decision Changelog** tail, `docs/structure.md`'s **Health Log** tail, and a dated path inside a link or code span, which is a *citation* of a record rather than a claim about the present.
47
+ **A date in a truth document is a defect, and the list of exceptions is closed.** Not a softened preference: a truth document carries no dated line at all, because a date answers *when did this happen*, which is a record's question, and a reader who needs the answer is reading the wrong file. The three exceptions, and there are no others: the frontmatter's tooling keys (`last-reviewed:`, `last-updated:`, `rev:` — written by tooling, never by you), an Architecture Decision's **Decision Changelog** tail, and a dated path inside a link or code span, which is a *citation* of a record rather than a claim about the present. The `maintenance` agent's Health Log is a record of its own (`docs/history/health-log.md`), not a tail on a truth document.
48
48
 
49
49
  **Cite a record by what it is, never by when it was.** `the dev reset runbook` links to the file; "the 2026-09-13 reset" states a date the reader must now keep in their head and that goes stale as soon as a second reset happens. The link carries the date in its path, where it belongs, and the prose stays true forever.
50
50
 
@@ -70,9 +70,14 @@ The two guarantees are complementary and both break on mixing: a reader holding
70
70
 
71
71
  - **Truth documents never narrate history** — the § Present tense, always rule above, applied to this nature. When the system changes, the change-story goes to `docs/history/` (a changelog entry) and the truth document simply becomes correct in present tense. When you find historical narration in a truth document, rewrite it to the present-tense fact and let the record carry the story.
72
72
  - **Records are never edited to match the present.** A completed plan stays wrong-in-hindsight; a changelog entry describes close-time state; a scope change gets a *new* dated record that links back, never an edit to a frozen one.
73
- - **Two sanctioned bridges — head is truth, tail is provenance.** An **Architecture Decision (AD)** ends with a **Decision Changelog** (for a decision, the journey — what each revision reversed and what triggered it — is part of the reasoning), and `docs/structure.md` ends with the maintenance agent's **Health Log** (tooling-stamped audit rows, the structural cousin of `last-reviewed:`). In both, the body stays current-truth-only; the tail carries the dates. No other truth document carries dated history.
73
+ - **Two sanctioned bridges — head is truth, tail is provenance.** An **Architecture Decision (AD)** ends with a **Decision Changelog** (for a decision, the journey — what each revision reversed and what triggered it — is part of the reasoning), and the `maintenance` agent's **Health Log** lives in `docs/history/health-log.md`, an append-only record. The AD body stays current-truth-only; the tail carries the dates. No other truth document carries dated history. `docs/structure.md` is harness-owned — written whole by the installer, never edited by hand or by a skill; only its `harness-version` frontmatter is stamped, by the `maintenance` agent.
74
+ - **Indexes describe directories, never files.** `docs/README.md` — the top-level index of the documentation folder — is a description of its directories: one entry per folder saying what the folder holds, who reads it and how its files are named. It carries no file list and no file tree: not a per-file row, not a `├──` tree of files, not a tree at all — `docs/structure.md` is the one place the tree lives, as the authority on placement. The same holds for a `README.md` / `Readme.md` at any level of `docs/`. `ls` is the roster, and the ownership index is how a document is found for a path. A per-file row has to be edited on every add, rename and retirement, so the index's history records roster churn instead of what the index said, and a reader cannot tell when the index itself changed. The only files an index may link are the mandated scaffolds (`structure.md`, `operations/setup.md`, `history/CHANGELOG.md`, `history/backlog.md`, `memory/main.md`) and a sibling folder's own `Readme.md`. `scripts/doc-lint.mjs` blocks the rest as `index-lists-files`, and blocks a tree drawn in a folder index as `index-file-tree`. An inverse (which checklists verify a feature, which docs a folder holds) is generated, never written.
74
75
  - **Truth documents cite records for the _why_, never the _when_.** `Provenance: AD-002` is good; "decided in AD-002 and shipped 2026-06-13" is not. Routing/index docs point only to truth documents as a topic's authority — never a plan or changelog entry as the "read first" source. (An index _of the records themselves_ — a History section listing `plans/`, `changelog/` — is sanctioned.)
75
76
 
77
+ **A document is intent and promises; facts are the graph's.** An owning document (feature, package, system) answers why the product is shaped this way and what it promises, and names the objects it designs in `objects:`. Every computable fact — a table's columns and vocabularies, a foreign key and its delete rule, which function writes which column, which route sits behind which guard, which code a refusal answers, which file holds what — is the code graph's to compute (`docs/architecture/systems/knowledge-layer.md`), and a hand-typed copy of it is the defect this rule removes: it reads as authoritative and is wrong the day the code moves. Mechanism stays in the code, reasons stay in the document, and the document points by object and symbol name, never by line number. `doc-lint` blocks the retired mechanism sections in an owning document (`mechanism-section`) and an owning document without `objects:`. `keywords:` is not a key: an object's name is its discovery term. **The body is scanned by people** — sharp bullets under noun-phrase headings, each a bold noun-phrase label, a colon, then one or two plain sentences; code named only where a person types or sees it, or at a cross-cutting seam the graph would not lead a reader to (a middleware, a gate, a hook, a shared store); every other pointer in the closing **For the agent** footer. The owning genres read Scope · Flows (Flow for a system, Usage for a package) · Decisions · Promises · Gaps · For the agent (`references/style-guide.md` § Labels, § Owning documents — the body and the footer; `doc-lint` warns `body-identifier`, `clause-label` and `second-person`).
78
+
79
+ **Every document that explains is written from the outside in, and every sentence passes the stability test.** Open on the question and its boundary, then the model with its numbered principles, then the parts and how they relate, then each part's decisions — and stop at the genre's deepest layer: decisions for doctrine, cross-package behaviour for a system, the public contract for a package, the full user-facing behaviour for a feature. A sentence that would have to change when a function is renamed, a file moves, or a route, column or error code changes is the code's, not the document's. The code is the authority on *what*; the document is the authority on *why*, and a disagreement on *why* is a defect to raise. **Every heading and every bold bullet label is a noun phrase** — it names; it has no verb, so it carries no tense, person or voice ("Decisions", never "What was decided"; "Organization user:", never "You already belong to an organization:"), and the sentence after it is third person ("user lands…", never "you land…"). The layers, the test, the label rule and the per-genre depth table are [`references/style-guide.md`](references/style-guide.md) § Shape — the model first, the detail after, and § Labels.
80
+
76
81
  **No empty stubs.** Never leave a template section as an empty placeholder — omit any section with nothing real to say (each template declares its required core; everything else is optional). Write an explicit "None" only where the absence itself is information (e.g., a plan's Cross-Module Contracts Affected, an LLD's Ownership Conflicts). An empty table stub reads as "not yet researched"; an omitted section reads as "doesn't apply" — keep those meanings distinct.
77
82
 
78
83
  **No redirect docs.** When moving a doc to a new location, delete the old file entirely. Update all references (cross-doc links, memory files) to point to the new path. Never leave a stub file that says "Moved to X" — redirect docs rot, clutter the repo, and create false search hits.
@@ -87,6 +92,7 @@ The two guarantees are complementary and both break on mixing: a reader holding
87
92
  | Document feature/module (LLD) | [`templates/feature.md`](templates/feature.md) |
88
93
  | Document data flow / state / Redux | [`templates/feature.md`](templates/feature.md) — they are sections of the feature doc |
89
94
  | Document a workspace package (`docs/architecture/packages/{package}.md`) | [`templates/package.md`](templates/package.md) — the **residual** owner of `packages/{name}/**`: its manifest, build, entry, layout and every behavior no system or feature doc claims at higher specificity |
95
+ | Document one concern the platform handles everywhere (`docs/architecture/common/{concern}.md`) — authentication, storage, the API protocol | [`templates/doctrine.md`](templates/doctrine.md) — the design and its principles, no mechanism; owns no code, and surfaces bind to it through `applies:` |
90
96
  | Document one system spanning packages (`docs/architecture/systems/{system}.md`) | [`templates/system.md`](templates/system.md) — one machine end to end; its `owns:` names the machine's subtrees, narrower than the package glob, so it wins by specificity. Not a screen — a system doc written as a giant feature doc is the mistake it prevents |
91
97
  | Create/update changelog entry | [`templates/changelog-entry.md`](templates/changelog-entry.md) (record — one per unit of work; carries the refinement fields, frozen inside its commit, distilled by the `retro` agent) |
92
98
  | Create/update plan | [`templates/plan.md`](templates/plan.md) (record) |
@@ -102,14 +108,16 @@ The two guarantees are complementary and both break on mixing: a reader holding
102
108
  | What a person sees and can do on a surface (UX behavior) | [`templates/ux-behavior.md`](templates/ux-behavior.md) — decides observable behavior BEFORE the code; per-surface in `docs/features/{surface}-ux.md` owning the component globs, cross-cutting in `docs/architecture/`. Not the checklist, which only verifies it |
103
109
  | Behavioral checklist for one feature (`docs/tests/{feature}.md`) | [`templates/behavioral-checklist.md`](templates/behavioral-checklist.md) — the verification gate's driving script, and the source its suite tests are drawn from |
104
110
  | Acceptance criteria for one capability (`docs/acceptance/{capability}.md`) | [`templates/acceptance-criteria.md`](templates/acceptance-criteria.md) — the promises the built product must keep, as stable `AC-n` keyed assert lines verification surfaces parse as claims |
105
- | Recurring procedure/setup | [`templates/operations-procedure.md`](templates/operations-procedure.md) |
111
+ | Machine setup / first run / stack (one per repo, `docs/operations/setup.md`) | [`templates/setup.md`](templates/setup.md) |
112
+ | Recurring procedure (develop, deploy, rotate, diagnose) | [`templates/operations-procedure.md`](templates/operations-procedure.md) |
106
113
  | Cold-start build order (implementation map) | [`templates/implementation-map.md`](templates/implementation-map.md) — authored by the executing session at build start, updated in place as waves complete |
107
114
  | Capture mid-execution knowledge (`docs/history/journal.md`) | [`templates/journal.md`](templates/journal.md) (record — append-only; a row resolves by landing in its owning doc) |
108
115
  | Bookkeeping work queue (`docs/operations/bookkeeping.md`) | [`templates/bookkeeping.md`](templates/bookkeeping.md) — machine-read row grammar; appended by hooks and sessions, drained by the `bookkeeper` agent, walled at Stop and commit |
109
116
  | One-shot migration/upgrade | [`templates/migration-runbook.md`](templates/migration-runbook.md) (record) |
117
+ | Hand-over at the end of an unattended or multi-session build (`docs/history/handovers/YYYY-MM-DD-{slug}.md`) | [`templates/handover.md`](templates/handover.md) (record) — a decision queue, an undo manual and a resume file: a verdict token and scoreboard, the acts only the owner can take today, everything that left the repository with its exact undo, a ten-minute path to seeing it work, every ruling taken on the owner's behalf with its authority and how to overturn it; then the successor half — proof, state re-provable by command, open loops, discoveries |
110
118
  | Add to protected files | [`templates/protected-files.md`](templates/protected-files.md) |
111
- | Create/update root README | [`templates/root-readme.md`](templates/root-readme.md) |
112
- | Scaffold a standard doc (docs index, `structure.md`, CHANGELOG, backlog, memory) | [`templates/Readme.md`](templates/Readme.md) — the index names each scaffold file |
119
+ | Create/update root README (outward opening in a user's terms, then orientation and routing for the team and agents — no install, stack, tree or chrome) | [`templates/root-readme.md`](templates/root-readme.md) |
120
+ | Scaffold a standard doc (docs index, CHANGELOG, backlog, memory) | [`templates/Readme.md`](templates/Readme.md) — the index names each scaffold file; `structure.md` is the installer's, never scaffolded |
113
121
  | Derive/update an owning doc's `owns:` (feature, package, system) | [`references/frontmatter.md`](references/frontmatter.md) |
114
122
  | Update existing doc | § Editing an existing doc (below) |
115
123
  | Instruction file (`CLAUDE.md`, a rule, an agent, skill prose) | [`references/instruction-style.md`](references/instruction-style.md) — not these templates; every-load prose stays lean, and the present-tense rule still applies |
@@ -135,6 +143,7 @@ The two guarantees are complementary and both break on mixing: a reader holding
135
143
  | Feature (LLD) | Truth | `kebab-case.md` | Living; `status:` `draft` → `active` → `deprecated` |
136
144
  | Package | Truth | `{package-folder}.md` | Living; `status:` as the feature doc |
137
145
  | System | Truth | `{machine}.md` | Living; `status:` as the feature doc |
146
+ | Doctrine | Truth | `{concern}.md` | Living; `status:` `draft` → `active` |
138
147
  | Architecture Decision | Truth | `AD-NNN-kebab-case.md` | Living; `Proposed` → `Accepted` → `Deprecated`; revisions rewrite the body + append to its Decision Changelog |
139
148
  | Steering docs (overview, domain model, glossary, non-goals, security, testing strategy) | Truth | fixed names | Living |
140
149
  | API reference / environment registry | Truth | fixed names | Living |
@@ -153,11 +162,13 @@ The two guarantees are complementary and both break on mixing: a reader holding
153
162
  **Frontmatter is compulsory on every document this skill authors** — `type:` (the genre) on every
154
163
  doc, plus the genre's own keys beside it; a document without its frontmatter fails the skill's
155
164
  contract and is not done. **There is no frontmatter-less genre.** A feature or UX doc carries the
156
- full set — `owns:` (required), `module:` (optional), `keywords:` (required), `status:` (required),
165
+ full set — `objects:` (required — the product objects the document designs), `owns:` (required until the graph computes ownership), `module:` (optional), `status:` (required),
157
166
  `applies:` (the architecture docs it obeys; omitted when none), optional `last-reviewed:`. A
158
167
  **package** doc (`docs/architecture/packages/`) and a **system** doc (`docs/architecture/systems/`)
159
168
  carry the same set minus `module:` — a package is already a bounded unit and a machine spanning
160
- packages belongs to no single context. A behavioral checklist (`docs/tests/`) carries
169
+ packages belongs to no single context. A **doctrine** doc (`docs/architecture/common/`)
170
+ carries `type: doctrine`, `status:` and `objects:` — no `owns:`, because doctrine governs code
171
+ without claiming it. A behavioral checklist (`docs/tests/`) carries
161
172
  `type: checklist` and `verifies:` — the doc whose promises it proves. An acceptance-criteria doc
162
173
  (`docs/acceptance/`) carries `type:` and `status:`.
163
174
 
@@ -175,9 +186,9 @@ update, and the `maintenance` agent's baseline pass, route there.
175
186
  | File | Use For |
176
187
  | --- | --- |
177
188
  | `templates/` | One file per template, indexed by [`Readme.md`](templates/Readme.md) — feature (LLD), changelog, plan, AD, steering docs, API reference, environment registry, operations procedure, migration runbook, protected files, READMEs, and the baseline scaffolds |
178
- | `references/style-guide.md` | Writing rules, formatting conventions, the two-natures tense rules |
189
+ | `references/style-guide.md` | The writing-style authority: the eight principles, depth per genre, the outside-in shape and stability test, noun-phrase labels and third-person voice, the owning document's body and footer, the two-natures tense rules, diagrams, headings, reference-document detail |
179
190
  | `references/instruction-style.md` | The style for instruction files (`CLAUDE.md`, rules, agents, skill prose) — the every-line test, armor vs. narration, voice, negative space |
180
- | `references/frontmatter.md` | Deriving a feature doc's `owns:` / `module:` / `keywords:` / `status:` from code |
191
+ | `references/frontmatter.md` | Deriving a feature doc's `objects:` / `owns:` / `module:` / `status:` from code |
181
192
  | `references/untemplated.md` | How to write a document no template covers (nature, placement, shape) + the co-authoring workflow |
182
193
  | `references/examples.md` | Good vs bad documentation examples |
183
194
  | `scripts/doc-lint.mjs` | Mechanical checks over written docs (tense narration, dates, stubs, redirects) — run over changed docs before finishing |
@@ -146,37 +146,41 @@ Replaced change-tracking merge with version-based conflict resolution.
146
146
 
147
147
  ---
148
148
 
149
- ## Example 4: Data Flow
149
+ ## Example 4: Flow
150
150
 
151
- ### ❌ Bad: Prose Description
151
+ ### ❌ Bad: Mechanism narrated in a paragraph
152
152
 
153
153
  ```markdown
154
+ ## Data Flow
155
+
154
156
  When the page loads, the useAppInit hook calls the syncData function. This function first fetches data from the server using the API. Then it gets the local data from Redux. After that, it compares versions...
155
157
  ```
156
158
 
157
- ### ✅ Good: Diagram + Key Points
159
+ **Problems:** names a hook, a function and a store that a rename would invalidate (the stability test); runs parallel cases together in one paragraph; gives a scanning reader no label to land on; "Data Flow" is a retired mechanism section.
158
160
 
159
- ```markdown
160
- ## Data Flow
161
+ ### ✅ Good: Labelled bullets, a role-level diagram beside them
161
162
 
162
- ┌─────────────────────────────────────────┐
163
- │ DATA SYNC │
164
- ├─────────────────────────────────────────┤
165
- │ │
166
- │ ┌──────┐ ┌──────┐ ┌──────┐ │
167
- │ │Server│────▶│Merge │────▶│Redux │ │
168
- │ │ API │ │ │ │Store │ │
169
- │ └──────┘ └──────┘ └──────┘ │
170
- │ │ │
171
- │ ▼ │
172
- │ Version Check │
173
- │ │
174
- └─────────────────────────────────────────┘
175
-
176
- **Trigger:** `useAppInit()` on page load
177
-
178
- **Version Rule:** Match → local wins, Mismatch → server wins
163
+ ````markdown
164
+ ## Flows
165
+
166
+ ### Page load
167
+
168
+ - **Fresh data:** the page fetches the server's copy and the local copy on every load; nothing is cached between visits.
169
+ - **Matching versions:** local changes win and are kept.
170
+ - **Mismatched versions:** the server's copy wins and local changes are dropped.
171
+
172
+ ```mermaid
173
+ sequenceDiagram
174
+ participant Page
175
+ participant Server
176
+ participant Store
177
+ Page->>Server: fetch the server's copy
178
+ Page->>Store: read the local copy
179
+ Page->>Store: write the merged copy
179
180
  ```
181
+ ````
182
+
183
+ **Why it works:** every fact is in the bullets, so a reader who greps finds it without the diagram; the labels are noun phrases a scanning reader lands on; the diagram names roles, never a function or a file, so no rename touches it.
180
184
 
181
185
  ---
182
186
 
@@ -242,7 +246,7 @@ The feature doc states only what is:
242
246
  ```markdown
243
247
  ## Export Pipeline
244
248
 
245
- `src/export/run.js` renders every export format from one job queue. Output is
249
+ The exporter renders every export format from one job queue. Output is
246
250
  buffered per job (streaming is out of scope — see `docs/history/backlog.md`).
247
251
  ```
248
252
 
@@ -272,8 +276,8 @@ Extracted export logic from the `reports` worker into `src/export/`.
272
276
  | ---------- | -------------------- | --------------------------- |
273
277
  | Code | Full implementations | Signatures + contracts |
274
278
  | State | Every occurrence | Persistence points only |
275
- | Flows | Prose paragraphs | ASCII diagrams |
279
+ | Flows | Paragraphs naming functions | Labelled bullets in plain words, a role-level diagram beside them |
276
280
  | Changelogs | "Updated X" | Function names + migrations |
277
281
  | Decisions | New doc per revision | One AD per subject, updated in place |
278
282
  | History | Narrated in the doc | Present-tense doc + dated record |
279
- | Length | 100+ lines | 20-40 lines |
283
+ | Length | Padded with mechanism | The genre's own expectation; length is a signal, never a target |
@@ -32,7 +32,7 @@ Every other genre owns no code and carries no `owns:`. That includes the cross-c
32
32
 
33
33
  ## How to derive the frontmatter
34
34
 
35
- An owning doc's ownership frontmatter is `owns:` (required), `module:` (optional — feature docs only; a package is already a bounded unit and a system spans contexts by definition), `keywords:` (required), and `status:` (required). An optional `last-reviewed:` date (stamped whenever the doc is substantively reviewed or updated) gives the `maintenance` agent a staleness signal to rank its audits by — it is tooling metadata, never narrated in the body. `type:` (required — the genre, enum = the template names) and `rev:` (generator-written generation stamp) are the same class: external tooling reads them, sessions **preserve them on edits** and never narrate or inject them. The `maintenance` agent stamps `type:` on docs that predate the key. `slug:` completes the set on generated docs: the identity key, minted once at creation and never re-derived from a display name — in the repo the filename is the slug, and the `maintenance` agent re-aligns the two when they diverge.
35
+ An owning doc's frontmatter is `objects:` (required — the product objects it designs, by their graph names; its discovery terms and its traced edge into the knowledge graph), `owns:` (required until the graph computes ownership from traces), `module:` (optional — feature docs only; a package is already a bounded unit and a system spans contexts by definition), and `status:` (required). An optional `last-reviewed:` date (stamped whenever the doc is substantively reviewed or updated) gives the `maintenance` agent a staleness signal to rank its audits by — it is tooling metadata, never narrated in the body. `type:` (required — the genre, enum = the template names) and `rev:` (generator-written generation stamp) are the same class: external tooling reads them, sessions **preserve them on edits** and never narrate or inject them. The `maintenance` agent stamps `type:` on docs that predate the key. `slug:` completes the set on generated docs: the identity key, minted once at creation and never re-derived from a display name — in the repo the filename is the slug, and the `maintenance` agent re-aligns the two when they diverge.
36
36
 
37
37
  **1. `owns:`** (the path scope)
38
38
 
@@ -59,9 +59,9 @@ Glob each pattern against the codebase. At `status: active`, drop any that match
59
59
 
60
60
  The single bounded-context label this feature belongs to, or omit it for a cross-cutting feature that belongs to no single context. A module is a label, not a folder — features sharing a `module:` value are what ties that module to code (a filter over the generated ownership index). Package and system docs omit it entirely.
61
61
 
62
- **3. `keywords:` & `status:`**
62
+ **3. `objects:` & `status:`**
63
63
 
64
- `keywords:` are the discovery terms topic→doc lookup rides. `status:` is `active`, `draft`, or `deprecated` — it steers the model toward live docs and away from draft/deprecated ones.
64
+ `objects:` names the product objects the document designs — the discovery terms topic→doc lookup rides, and the edge the knowledge graph renders each object's documents from. There is no `keywords:` key: an object's name is its discovery term. `status:` is `active`, `draft`, or `deprecated` — it steers the model toward live docs and away from draft/deprecated ones.
65
65
 
66
66
  ## The doc → doc edges
67
67