@nurix/etna 0.20.29 → 0.20.31
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.
- package/data/harness-index.json +1 -1
- package/data/harnesses/code/CLAUDE.md +4 -4
- package/data/harnesses/code/agents/bookkeeper.md +2 -2
- package/data/harnesses/code/agents/change-review.md +3 -3
- package/data/harnesses/code/agents/lld-mode.md +3 -3
- package/data/harnesses/code/agents/maintenance.md +22 -19
- package/data/harnesses/code/agents/polygraph-finder.md +3 -3
- package/data/harnesses/code/agents/polygraph.md +4 -4
- package/data/harnesses/code/agents/retro.md +1 -1
- package/data/harnesses/code/codex/agents/bookkeeper.toml +7 -3
- package/data/harnesses/code/codex/agents/change-review.toml +3 -3
- package/data/harnesses/code/codex/agents/lld-mode.toml +3 -3
- package/data/harnesses/code/codex/agents/maintenance.toml +60 -37
- package/data/harnesses/code/codex/agents/polygraph-finder.toml +6 -2
- package/data/harnesses/code/codex/agents/polygraph.toml +4 -4
- package/data/harnesses/code/codex/agents/retro.toml +1 -1
- package/data/harnesses/code/docs/structure.md +15 -15
- package/data/harnesses/code/harness.json +2 -2
- package/data/harnesses/code/hooks/lib/ownership.mjs +12 -13
- package/data/harnesses/code/hooks/lib/sweep.mjs +1 -1
- package/data/harnesses/code/hooks/mount.mjs +17 -3
- package/data/harnesses/code/skills/documentation/SKILL.md +17 -27
- package/data/harnesses/code/skills/documentation/references/frontmatter.md +56 -62
- package/data/harnesses/code/skills/documentation/references/style-guide.md +2 -2
- package/data/harnesses/code/skills/documentation/scripts/doc-lint.mjs +1 -1
- package/data/harnesses/code/skills/documentation/templates/Readme.md +1 -1
- package/data/harnesses/code/skills/documentation/templates/docs-readme.md +1 -1
- package/data/harnesses/code/skills/documentation/templates/doctrine.md +2 -2
- package/data/harnesses/code/skills/documentation/templates/feature.md +3 -4
- package/data/harnesses/code/skills/documentation/templates/package.md +2 -3
- package/data/harnesses/code/skills/documentation/templates/root-readme.md +1 -1
- package/data/harnesses/code/skills/documentation/templates/system.md +2 -4
- package/data/harnesses/code/skills/documentation/templates/ux-behavior.md +4 -4
- package/data/harnesses/delivery/agents/lld-mode.md +3 -3
- package/data/harnesses/delivery/agents/maintenance.md +22 -19
- package/data/harnesses/delivery/agents/retro.md +1 -1
- package/data/harnesses/delivery/codex/agents/lld-mode.toml +3 -3
- package/data/harnesses/delivery/codex/agents/maintenance.toml +60 -37
- package/data/harnesses/delivery/codex/agents/retro.toml +1 -1
- package/data/harnesses/delivery/harness.json +2 -2
- package/data/harnesses/delivery/skills/documentation/SKILL.md +17 -27
- package/data/harnesses/delivery/skills/documentation/references/frontmatter.md +56 -62
- package/data/harnesses/delivery/skills/documentation/references/style-guide.md +2 -2
- package/data/harnesses/delivery/skills/documentation/scripts/doc-lint.mjs +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/Readme.md +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/docs-readme.md +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/doctrine.md +2 -2
- package/data/harnesses/delivery/skills/documentation/templates/feature.md +3 -4
- package/data/harnesses/delivery/skills/documentation/templates/package.md +2 -3
- package/data/harnesses/delivery/skills/documentation/templates/root-readme.md +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/system.md +2 -4
- package/data/harnesses/delivery/skills/documentation/templates/ux-behavior.md +4 -4
- package/data/harnesses/etna/agents/change-review.md +3 -3
- package/data/harnesses/etna/agents/lld-mode.md +3 -3
- package/data/harnesses/etna/agents/maintenance.md +22 -19
- package/data/harnesses/etna/agents/retro.md +1 -1
- package/data/harnesses/etna/codex/agents/change-review.toml +3 -3
- package/data/harnesses/etna/codex/agents/lld-mode.toml +3 -3
- package/data/harnesses/etna/codex/agents/maintenance.toml +60 -37
- package/data/harnesses/etna/codex/agents/retro.toml +1 -1
- package/data/harnesses/etna/harness.json +2 -2
- package/data/harnesses/etna/skills/documentation/SKILL.md +17 -27
- package/data/harnesses/etna/skills/documentation/references/frontmatter.md +56 -62
- package/data/harnesses/etna/skills/documentation/references/style-guide.md +2 -2
- package/data/harnesses/etna/skills/documentation/scripts/doc-lint.mjs +1 -1
- package/data/harnesses/etna/skills/documentation/templates/Readme.md +1 -1
- package/data/harnesses/etna/skills/documentation/templates/docs-readme.md +1 -1
- package/data/harnesses/etna/skills/documentation/templates/doctrine.md +2 -2
- package/data/harnesses/etna/skills/documentation/templates/feature.md +3 -4
- package/data/harnesses/etna/skills/documentation/templates/package.md +2 -3
- package/data/harnesses/etna/skills/documentation/templates/root-readme.md +1 -1
- package/data/harnesses/etna/skills/documentation/templates/system.md +2 -4
- package/data/harnesses/etna/skills/documentation/templates/ux-behavior.md +4 -4
- package/lib/install/mount.mjs +17 -3
- package/package.json +2 -2
|
@@ -1,90 +1,84 @@
|
|
|
1
|
-
# Frontmatter
|
|
1
|
+
# Frontmatter — documents in the knowledge graph
|
|
2
2
|
|
|
3
|
-
Load when: creating a
|
|
3
|
+
Load when: creating a document that carries frontmatter, updating one whose subject moved, or running a baseline or reconcile pass over many documents.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This reference states how a document joins the knowledge graph, and it is kept in step with the machine that reads it: the knowledge layer (`docs/architecture/systems/knowledge-layer.md` in a repository that carries it; § Documents and code). Where this reference and that design disagree, the design is the authority and this file is the defect.
|
|
6
6
|
|
|
7
|
-
## The
|
|
7
|
+
## The model
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
A document names the product objects it designs. Every other edge between a document and the code is either authored on the code's side or computed, never typed into the document.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Principles
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
1. **Objects as the document's edge:** a document's frontmatter carries `objects:`, the product objects it designs, by their register names. That is its one edge into the graph and its discovery terms.
|
|
14
|
+
2. **The header pointer as the code's edge:** a source file's path header names the document that holds its fuller account (the root instruction file's § File Structure). The pointer is authored on the code's side, a move carries it, and a new file without one is a lint.
|
|
15
|
+
3. **Computed ownership:** the object closure (document → objects → tables → their write, read and refusal sites → files) reaches files nobody listed. Where the header pointer and the closure disagree, the graph prints both. Which document speaks for a path is a query, answered per path on demand.
|
|
16
|
+
4. **Nothing recomputable stored:** a list of files, a list of consumers, or a list of governing documents typed into frontmatter is a copy of something the graph computes. It is stale the day the code moves, and it fails the stability test (`style-guide.md` § Shape — the model first, the detail after).
|
|
17
|
+
5. **One declaration, at the consuming end:** the edges a person must author (`objects:`, `verifies:`) are declared once, by the document that knows. Every inverse is generated, never authored.
|
|
14
18
|
|
|
15
|
-
##
|
|
19
|
+
## Keys by genre
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
| Genre | Keys |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Feature | `type`, `status`, `objects`, `module` (optional) · transitional `owns` |
|
|
24
|
+
| System | `type`, `status`, `objects` · transitional `owns` |
|
|
25
|
+
| Package | `type`, `status`, `objects` · transitional `owns` |
|
|
26
|
+
| Doctrine | `type`, `status`, `objects` |
|
|
27
|
+
| UX | `type`, `status`, `objects` · transitional `owns` when it speaks for a surface's components |
|
|
28
|
+
| Behavioral checklist | `type: checklist`, `verifies` |
|
|
29
|
+
| Acceptance criteria | `type`, `status` |
|
|
30
|
+
| Every other genre | `type`, plus its template's own keys |
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
Tooling keys sit beside these on any genre: `rev:` (a generator's generation stamp), `slug:` (the identity key on generated documents, minted once, and in the repository the filename), and `last-reviewed:` (stamped on a substantive review, the `maintenance` agent's staleness signal). Sessions preserve them on edits and never narrate or inject them. The `maintenance` agent stamps `type:` where it is missing.
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
## Keys
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
| --- | --- | --- |
|
|
27
|
-
| `package` (`docs/architecture/packages/`) | `packages/{name}/**` — the whole tree, one glob | Nothing; it is the **residual** owner and loses every narrower claim, keeping what no one else takes |
|
|
28
|
-
| `system` (`docs/architecture/systems/`) | the subtrees and exact files one machine is made of | Its globs are narrower than the package glob — specificity |
|
|
29
|
-
| `feature` (`docs/features/`) | one capability's or one surface's globs | Same — specificity over the package glob |
|
|
30
|
-
|
|
31
|
-
Every other genre owns no code and carries no `owns:`. That includes the cross-cutting doctrine in `docs/architecture/` (and `docs/architecture/common/`), which describes patterns rather than regions — a surface declares it is bound by one through `applies:`, and the doctrine never claims the surface back. Checklists, acceptance docs, ADs, operations procedures, research and brainstorm records own nothing.
|
|
32
|
-
|
|
33
|
-
## How to derive the frontmatter
|
|
34
|
-
|
|
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
|
-
|
|
37
|
-
**1. `owns:`** (the path scope)
|
|
36
|
+
### `objects:`
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
- **Values:** the product objects the document designs, by the names the object register uses (`docs/dna/objects/<group>.yaml`, the product-dna skill's). Where a repository has no register yet, the names its product model and its documents already use.
|
|
39
|
+
- **Meaning:** designs, not mentions. A feature that reads a session designs no session; the document that decides what a session is does.
|
|
40
|
+
- **Discovery:** there is no `keywords:` key. An object's name and its register aliases are its discovery terms.
|
|
41
|
+
- **Doctrine:** a doctrine document names the cross-cutting objects it governs (principal, credential, session). The surfaces bound by it are the documents that design or touch the same objects, which the closure computes.
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
### `status:`
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
- **Values:** `active`, `draft` or `deprecated`. It steers a reader toward live documents.
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
| -------------------------------------------- | ------------------------------------ |
|
|
47
|
-
| A feature's own directory | `src/feature/**` |
|
|
48
|
-
| A feature split across two directories | One glob each |
|
|
49
|
-
| A single entry-point file, and nothing beside it | The exact file path |
|
|
50
|
-
| A whole workspace package, residually | `packages/{name}/**` — one glob, on the package doc |
|
|
51
|
-
| A machine spanning packages | One glob or exact path per subtree it is made of, on the system doc |
|
|
52
|
-
| A shared file several features import | **Nothing — leave it unowned** |
|
|
47
|
+
### `module:`
|
|
53
48
|
|
|
54
|
-
**
|
|
49
|
+
- **Values:** one bounded-context label on a feature document, or omitted for a cross-cutting feature. A label, not a folder. Package and system documents omit it.
|
|
55
50
|
|
|
56
|
-
|
|
51
|
+
### `verifies:`
|
|
57
52
|
|
|
58
|
-
**
|
|
53
|
+
- **Values:** on a behavioral checklist, the repo-relative path of the feature or UX document whose promises it proves. One is the norm.
|
|
54
|
+
- **Authorship:** a checklist knows what it proves, and nothing in the code says so. A checklist with no `verifies:` is an orphan: nothing implicates it when its subject changes.
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
### `owns:` — transitional
|
|
61
57
|
|
|
62
|
-
**
|
|
58
|
+
- **Reason for the key:** the harness's ownership scan (`.claude/hooks/lib/ownership.mjs`) keys on `owns:` until it switches to the header pointers and the object closure, which is the knowledge layer's recorded gap. Until then the key keeps the session's ownership index and the doc-debt detectors working.
|
|
59
|
+
- **Form:** region globs only, one per region the document speaks for: `packages/{name}/**` on a package document, the machine's subtrees on a system document, a feature's own directory on a feature document. Never a list of individual files, and never a shared file several features import.
|
|
60
|
+
- **Growth:** none. A new document carries the region glob its genre needs and nothing more; an edit never adds file-level entries.
|
|
61
|
+
- **Retirement:** removed from every document in the same change that switches the scan, and this section with it.
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
## Retired keys
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
**`applies:`** — on a feature or UX doc, the architecture docs it obeys. Not "docs I read" and not "docs I mention" — **obligation**: a doctrine this surface is bound by, such that a change to the doctrine implicates this doc. The narrow reading is the load-bearing one; a key that collects everything consulted degrades into a bibliography and stops meaning anything. A feature bound by nothing cross-cutting omits the key.
|
|
73
|
-
|
|
74
|
-
Cross-cutting *contracts* remain diagnosed by the `boundary` skill from source, never persisted — `applies:` records which doctrine a surface answers to, not which code it touches.
|
|
65
|
+
| Key | Retired because | What replaces it |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| `applies:` | A list of governing documents is a hand-kept copy of a relationship the graph computes through the objects both documents name, and it drifts the way any copy does | The objects the doctrine and the surface share, computed; for people, the document's Scope section names its governing doctrine and what each settles |
|
|
68
|
+
| `keywords:` | An object's name and aliases are its discovery terms | `objects:` |
|
|
69
|
+
| A file-level `owns:` list | The header pointers and the object closure compute it | Region globs only, until the scan switches (above) |
|
|
75
70
|
|
|
76
|
-
|
|
71
|
+
An edit to a document that carries a retired key removes the key in the same edit.
|
|
77
72
|
|
|
78
|
-
|
|
73
|
+
## Not frontmatter, deliberately
|
|
79
74
|
|
|
80
|
-
|
|
75
|
+
- **`Pinned:`** stays a section-level line inside a checklist, naming the suite tests that guard that section. It is typed and resolved mechanically; hoisting it would flatten per-section detail into a document-level list.
|
|
76
|
+
- **Terminal and non-terminal edges:** a `Pinned:` reference terminates (a test file exists or it does not), so a resolver sweep checks it with no judgment. An `objects:` value is checked against the register by the graph's index-time lints. Whether a document still describes what its objects do needs a person or an agent to read both ends; no checker pretends otherwise.
|
|
81
77
|
|
|
82
78
|
## Rules
|
|
83
79
|
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
- **
|
|
89
|
-
- **Every edge value is a repo-relative doc path** (`docs/architecture/common/security.md`), never a bare filename and never a display title — the resolver is a path lookup, and a title changes without the file moving.
|
|
90
|
-
- **A dangling edge is a block, not a warning.** `verifies:` or `applies:` naming a doc that does not exist is a typo or a deletion; either way the graph is lying. Resolve at authoring time.
|
|
80
|
+
- **Inverses never authored:** no document lists its verifiers, its consumers, its governing doctrine's other surfaces, or the files that point at it. A hand-written "consumed by" table is a defect to delete.
|
|
81
|
+
- **Edge values:** `verifies:` values are repo-relative document paths, never a bare filename or a display title.
|
|
82
|
+
- **Dangling edges block:** a `verifies:` naming a document that does not exist, or an `objects:` value no register or product model knows, is a typo or a deletion. Resolve it at authoring time.
|
|
83
|
+
- **Index-time lints the graph prints:** a header pointing at a document that does not exist, a document no file points at, an object no document designs. They never fail a refresh; a session that sees one resolves it or files it.
|
|
84
|
+
- **Baseline and reconcile:** the `maintenance` agent stamps `type:` and `objects:`, reduces any file-level `owns:` list to its region globs, removes retired keys, and reports source files whose header names no document. Many documents ⇒ parallel sub-agents, one document each.
|
|
@@ -34,8 +34,8 @@ Every genre takes the same shape (principle 2) and the same labels (principle 5)
|
|
|
34
34
|
| Operations procedure, migration runbook | Truth, record | The exact commands, in order, with their expected output | Nothing. The detail is the point |
|
|
35
35
|
| Record (plan, changelog entry, journal, memory) | Record | Its template's fields, as of the moment it describes | Nothing. Its prose follows § Voice and § Labels; the dates and the journey are its own |
|
|
36
36
|
|
|
37
|
-
- **Owning documents:** feature, package and system are the three genres that
|
|
38
|
-
- **Doctrine:** the same shape and labels as an owning document,
|
|
37
|
+
- **Owning documents:** feature, package and system are the three genres that speak for code: source files name them in their headers, and the ownership scan resolves paths to them (`frontmatter.md`). They take principles 5 and 6 in full, their sections are fixed (§ Owning documents — the body and the footer), and `doc-lint` reads them.
|
|
38
|
+
- **Doctrine:** the same shape and labels as an owning document, speaking for no code and describing no mechanism. Its model layer may argue in paragraphs; below the model it is bullets like every other explaining document.
|
|
39
39
|
- **Reference documents and procedures:** the one place a signature, a shape, a variable table, a command list or a file path is the content. They keep the detail the owning genres hand to the graph (§ Reference documents).
|
|
40
40
|
- **Indexes:** a folder's `Readme.md` describes directories, never files; the root README follows `templates/root-readme.md`. Both take § Labels.
|
|
41
41
|
|
|
@@ -159,7 +159,7 @@ function lintFile(path, findings) {
|
|
|
159
159
|
}
|
|
160
160
|
if (scope === 'truth' && !isFolderIndex && /(^|\/)docs\/features\/[^/]+\.md$/.test(path)) {
|
|
161
161
|
const fm = text.startsWith('---') ? text.slice(0, text.indexOf('\n---', 3)) : '';
|
|
162
|
-
for (const key of ['
|
|
162
|
+
for (const key of ['objects:', 'status:', 'type:'])
|
|
163
163
|
if (!fm.includes(key)) findings.push({ path, n: 1, severity: 'block', id: 'feature-frontmatter', message: `feature doc missing \`${key}\` frontmatter` });
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -38,4 +38,4 @@ One file per template. Every template is either a **truth document** (states cur
|
|
|
38
38
|
|
|
39
39
|
**Baseline scaffolds** — files that must exist after every baseline (`docs/structure.md` is not among them: it is harness-owned, shipped whole by the installer and overwritten on every refresh, and has no template); the `maintenance` agent (baseline mode) creates any that are missing: [docs-readme.md](docs-readme.md), [changelog-index.md](changelog-index.md), [backlog.md](backlog.md), [memory-main.md](memory-main.md), [setup.md](setup.md) (when the repo has a lockfile and a runnable root script; never overwriting an existing first-run procedure), and [root-readme.md](root-readme.md) (never overwriting an existing root README).
|
|
40
40
|
|
|
41
|
-
**Ownership.** Three genres
|
|
41
|
+
**Ownership.** Three genres speak for code — **feature**, **package**, **system**. A document names the objects it designs in `objects:`; a source file names the document that speaks for it in its path header; which document speaks for a path is computed from those headers and the object closure, and answered per path by the ownership index (`references/frontmatter.md`). Until the harness's ownership scan switches to that computation, it reads a transitional `owns:` region glob on each of the three genres: `packages/{name}/**` on a package document (the residual owner), a machine's subtrees on a system document, a feature's own directory on a feature document; the narrower glob wins.
|
|
@@ -21,7 +21,7 @@ The design layer — [architecture/](architecture/): {what the folder holds —
|
|
|
21
21
|
|
|
22
22
|
## Features
|
|
23
23
|
|
|
24
|
-
[features/](features/) — one living reference per feature (how it works today), flat, named `{feature}.md`; each
|
|
24
|
+
[features/](features/) — one living reference per feature (how it works today), flat, named `{feature}.md`; each names the objects it designs in `objects:`, and the source files it speaks for name it in their headers. Find a feature by its name or by the ownership index, never by a row here.
|
|
25
25
|
|
|
26
26
|
## Tests
|
|
27
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Doctrine Documentation (docs/architecture/common/{concern}.md)
|
|
2
2
|
|
|
3
|
-
Truth document. Use for **one concern the platform handles everywhere**: authentication, authorization, storage, the API protocol, credentials, telemetry. One file per concern, named for the concern. A doctrine document
|
|
3
|
+
Truth document. Use for **one concern the platform handles everywhere**: authentication, authorization, storage, the API protocol, credentials, telemetry. One file per concern, named for the concern. A doctrine document speaks for no code: no source header names it, and it carries no `owns:`. The surfaces bound by it are the documents that design or touch the objects it governs, computed through those objects, and each names it in its Scope.
|
|
4
4
|
|
|
5
5
|
**A doctrine document states the design and nothing beneath it** (`references/style-guide.md` § Shape — the model first, the detail after). It is the most stable document in the tree, because it says why the platform is shaped the way it is, and that changes far less often than the code. It explains no mechanism: no function, file, column, cookie attribute, header value or per-route error code, since each of those fails the stability test. The code graph answers what the code does. This document answers why, and which principles any new code in the concern must keep.
|
|
6
6
|
|
|
@@ -77,5 +77,5 @@ Code cannot reveal what it does not yet do, so decided-but-unbuilt intent is one
|
|
|
77
77
|
| --- | --- |
|
|
78
78
|
| A tour of the code that implements the concern | The code graph |
|
|
79
79
|
| The catalog of routes, error codes or variables | An API reference or environment registry |
|
|
80
|
-
| The one feature that happens to use the concern most | That feature's own document, which
|
|
80
|
+
| The one feature that happens to use the concern most | That feature's own document, which names this doctrine in its Scope |
|
|
81
81
|
| The story of how the concern got this way | A decision record (`decisions/`) for the why, and the changelog for the when |
|
|
@@ -8,7 +8,7 @@ Truth document. Use for every feature in `docs/features/`: something a person po
|
|
|
8
8
|
- **Each bullet is a bold label, then one or two third-person sentences** saying what happens: "**Organization user:** user lands in their existing organization", never "you land…".
|
|
9
9
|
- **Flows carry the journey; Decisions carry the reasons; Promises run deepest.**
|
|
10
10
|
|
|
11
|
-
Every computable fact (columns, vocabularies, foreign keys, writers, routes, guards, files) is the code graph's (`docs/architecture/systems/knowledge-layer.md`), and a hand-typed copy is the defect this genre removes. Code is named only where a person types or sees it (a page, a command, a flag, an environment variable) or at a cross-cutting seam the graph would not lead a reader to.
|
|
11
|
+
The frontmatter names the objects the feature designs; which files it speaks for is computed from the source headers and the object closure, never listed (`references/frontmatter.md`). Every computable fact (columns, vocabularies, foreign keys, writers, routes, guards, files) is the code graph's (`docs/architecture/systems/knowledge-layer.md`), and a hand-typed copy is the defect this genre removes. Code is named only where a person types or sees it (a page, a command, a flag, an environment variable) or at a cross-cutting seam the graph would not lead a reader to.
|
|
12
12
|
|
|
13
13
|
**A feature document runs deepest toward its end.** Scope and Flows are the model and the journey. **Promises** goes as deep as the behaviour does: every state the surface can be in, every edge case, what a refusal tells the person, and the exact wording wherever the wording itself is promised. That depth is earned because a person or a test checks it and the code cannot state it as intent. It still stops before mechanism. A promise reads "a removed membership shows a panel, not a redirect", never which route answers it.
|
|
14
14
|
|
|
@@ -32,9 +32,8 @@ Nothing else. `doc-lint` blocks the retired mechanism sections (`mechanism-secti
|
|
|
32
32
|
type: feature # required tooling key — preserve, never narrate
|
|
33
33
|
status: active # required — active | draft | deprecated
|
|
34
34
|
objects: [device, credential grant] # required — the product objects this document designs, by their graph names
|
|
35
|
-
owns: ["packages/studio/src/server/routes/devices.ts"] # required until the graph computes ownership — the code this document speaks for; narrower glob wins
|
|
36
35
|
module: identity # optional — one bounded-context label
|
|
37
|
-
|
|
36
|
+
owns: ["packages/studio/src/server/devices/**"] # transitional — one region glob, read only by the ownership scan until it switches to header pointers (references/frontmatter.md)
|
|
38
37
|
---
|
|
39
38
|
```
|
|
40
39
|
|
|
@@ -90,6 +89,6 @@ No tables, routes or symbol rosters — those are the graph's.
|
|
|
90
89
|
| When | What is written |
|
|
91
90
|
| --- | --- |
|
|
92
91
|
| `status: draft` (design) | goal, Scope, Decisions, Promises (with gaps named), For the agent; the LLD research goes to the plan |
|
|
93
|
-
| `status: active` | Flows written from the shipped surface; `
|
|
92
|
+
| `status: active` | Flows written from the shipped surface; `objects:` confirmed against the register, and each owned source file's header names this document |
|
|
94
93
|
|
|
95
94
|
A feature whose code is gone is deleted, or `status: deprecated` with its footer pointing at what replaced it.
|
|
@@ -6,7 +6,7 @@ Truth document. Use for: **one workspace package** — one unit of distribution:
|
|
|
6
6
|
|
|
7
7
|
**A package document's deepest layer is its public contract** (`references/style-guide.md` § Shape — the model first, the detail after): the commands and flags a person types, the exports another package imports, what is installed and where. For a CLI the flags *are* the promise, so they belong in Usage. It stops before internal layout, build steps and which file holds what.
|
|
8
8
|
|
|
9
|
-
**A package document is the residual owner of its own tree.**
|
|
9
|
+
**A package document is the residual owner of its own tree.** Every file in the package whose header names no narrower document is its to speak for, so it loses to every system or feature document a header names. Until the ownership scan switches to header pointers, its transitional `owns:` is the whole package glob. The one enumerable fact it declares is the ownership table: which subtrees other documents speak for.
|
|
10
10
|
|
|
11
11
|
**Sharp, bulleted, labelled with noun phrases** (`references/style-guide.md` § Labels). Every section after the goal line is bullets under a noun-phrase heading, each bullet a bold noun-phrase label followed by one or two sentences.
|
|
12
12
|
|
|
@@ -29,8 +29,7 @@ Nothing else. The feature template's lint rules apply. Forty to a hundred and tw
|
|
|
29
29
|
type: package
|
|
30
30
|
status: active
|
|
31
31
|
objects: [nustack cli, device credential] # required — the objects this package designs or ships
|
|
32
|
-
owns: ["packages/{name}/**"] #
|
|
33
|
-
applies: [docs/architecture/common/api.md] # optional
|
|
32
|
+
owns: ["packages/{name}/**"] # transitional — the residual region glob, read only by the ownership scan until it switches to header pointers
|
|
34
33
|
---
|
|
35
34
|
```
|
|
36
35
|
|
|
@@ -37,7 +37,7 @@ Sections come in this order; 1 to 3 are the outward-facing first screen, 4 onwar
|
|
|
37
37
|
- **Relative links into the repo only.** Never an absolute repo URL. Never an external site as the home of a canonical doc.
|
|
38
38
|
- **Link folders and mandated scaffolds, never rosters.** The allowed targets are folders, `docs/README.md`, `docs/structure.md`, `docs/operations/setup.md`, `docs/history/CHANGELOG.md`, `docs/history/backlog.md`, `CLAUDE.md` and the owning docs in the Map. A procedure is named only where a Destinations row needs it. Every heading and table header is a noun phrase (`../references/style-guide.md` § Labels). Never list individual feature docs: the ownership index finds them.
|
|
39
39
|
- **No tree.** The Map stops at top-level units and never lists files. Mark paths that look primary but are not, for example "`legacy/`: reference only, never edited".
|
|
40
|
-
- **The Map is a coarse view of the ownership index, not a rival to it.** The Owning doc column names the doc
|
|
40
|
+
- **The Map is a coarse view of the ownership index, not a rival to it.** The Owning doc column names the doc the index resolves for that path. When the two disagree the index wins, and the Map row is fixed in the same change.
|
|
41
41
|
- **No version numbers and no dates.** Name the file that pins a version (`.nvmrc`, `packageManager`, `rust-toolchain.toml`). Write in the present tense, with no "coming soon" and no "as of".
|
|
42
42
|
- **State rules, don't argue them.** One line each. The reasoning lives in the linked doc, and agent process rules stay in `CLAUDE.md`.
|
|
43
43
|
- **Commands come from the repo.** Detect the package manager from the lockfile (`pnpm-lock.yaml` gives pnpm, `yarn.lock` gives yarn, otherwise npm). Use only scripts that exist, each with a trailing comment saying what it does.
|
|
@@ -6,7 +6,7 @@ Truth document. Use for: **one machine that spans packages**, which a person can
|
|
|
6
6
|
|
|
7
7
|
**A system document's deepest layer is the machine's behaviour across packages** (`references/style-guide.md` § Shape — the model first, the detail after): the order it runs in, the sequence and state diagrams at role level, the invariant that holds at each place where parts meet, and what re-drives a stall. That layer is earned because no single file shows a cross-package flow. It stops before per-function steps, tables, columns and routes.
|
|
8
8
|
|
|
9
|
-
**A system document
|
|
9
|
+
**A system document speaks for the files the machine is made of.** Their headers name it, which outranks the package document's residual claim. Until the ownership scan switches to header pointers, its transitional `owns:` names the machine's subtrees as region globs, narrower than the package glob; every glob matches a file on disk at `status: active`.
|
|
10
10
|
|
|
11
11
|
**Sharp, bulleted, labelled with noun phrases** (`references/style-guide.md` § Labels). The opening paragraph defines the machine; everything after it is bullets under noun-phrase headings, each bullet a bold noun-phrase label followed by one or two sentences.
|
|
12
12
|
|
|
@@ -28,10 +28,8 @@ Nothing else. The lint rules of the feature template apply. Sixty to a hundred a
|
|
|
28
28
|
type: system # required tooling key
|
|
29
29
|
status: active # required — draft = the machine as a whole does not run
|
|
30
30
|
objects: [run, run ledger, settlement] # required — the objects this machine owns or moves
|
|
31
|
-
owns: #
|
|
31
|
+
owns: # transitional — region globs, one per subtree; read only by the ownership scan until it switches to header pointers (references/frontmatter.md)
|
|
32
32
|
- packages/{pkg}/src/{machine}/**
|
|
33
|
-
applies: # optional — decisions and doctrine this machine is BOUND by
|
|
34
|
-
- docs/architecture/decisions/AD-0NN-{slug}.md
|
|
35
33
|
---
|
|
36
34
|
```
|
|
37
35
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Truth document.** States what a person sees and can do on a surface, and what the surface promises never to do. Present tense, like every truth document.
|
|
4
4
|
|
|
5
|
-
**`type: ux`**, plus `
|
|
5
|
+
**`type: ux`**, plus `status:` and `objects:` — the objects the surface presents (`references/frontmatter.md`). The doctrine it answers to (the state vocabulary, the routing doctrine, the information architecture) is named in its Purpose for people and computed through shared objects for tooling.
|
|
6
6
|
|
|
7
7
|
**Why this genre exists.** A feature doc (LLD) states what a feature is, how its data flows, and which contracts it honours — all of which stay plausibly true through a rewrite of the surface. Nothing else in the repo states what a person *observes*. So a change to the wire lands, the interface absorbs it, and the absorption reads as maintenance: no test fails, no lint fires, no document is contradicted. This document is the thing a silent change contradicts.
|
|
8
8
|
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
| The behavior is… | Where it lives |
|
|
14
14
|
| --- | --- |
|
|
15
|
-
| One surface's — a panel, an editor, a dialog | `docs/features/{surface}-ux.md
|
|
15
|
+
| One surface's — a panel, an editor, a dialog | `docs/features/{surface}-ux.md`; its component files' headers name it |
|
|
16
16
|
| Cross-cutting — routing, information architecture, the state vocabulary every surface obeys, presentation of streams | `docs/architecture/` — owns no code, like every architecture doc |
|
|
17
17
|
|
|
18
|
-
**Ownership:
|
|
18
|
+
**Ownership: a component file names one document in its header.** A surface's components are frequently already spoken for — by the page's feature document, by the feature behind one panel — and a file's header names exactly one document. Where the header already names the feature document, this document is named in that feature document's **coordinated edits** row instead, phrased as *different promises over the same files*, and the object closure links the two through the objects both name. Where no document speaks for the component yet, its header names this one.
|
|
19
19
|
|
|
20
|
-
That matters because a doc nothing implicates is a doc that rots, and a surface rewritten under an unimplicated document is the failure this genre exists to prevent. The coordinated-edit row is the weaker of the two bindings; prefer
|
|
20
|
+
That matters because a doc nothing implicates is a doc that rots, and a surface rewritten under an unimplicated document is the failure this genre exists to prevent. The coordinated-edit row is the weaker of the two bindings; prefer the header pointer wherever no document speaks for the component yet.
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
package/lib/install/mount.mjs
CHANGED
|
@@ -204,7 +204,7 @@ function removeEmptyParents(projectDir, rel) {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
//
|
|
207
|
+
// Fetches the manifest's mounted files that differ on disk, writes them deepest path first, then deletes owned names the manifest omits.
|
|
208
208
|
async function mountFromManifest({ projectDir, manifest, origin, cacheDir, fetchImpl, timeoutMs, priorOwned }) {
|
|
209
209
|
const all = mountedEntries(manifest);
|
|
210
210
|
const entries = admittedEntries(projectDir, all);
|
|
@@ -216,14 +216,28 @@ async function mountFromManifest({ projectDir, manifest, origin, cacheDir, fetch
|
|
|
216
216
|
const dest = join(projectDir, entry.path);
|
|
217
217
|
return !(existsSync(dest) && sha256Of(readFileSync(dest)) === entry.sha256);
|
|
218
218
|
});
|
|
219
|
+
// Booby trap: every live session in the checkout runs these hooks while the mount rewrites them.
|
|
220
|
+
// Writing as each fetch lands let `hooks/compliance.mjs` arrive seconds before a new `hooks/lib/`
|
|
221
|
+
// module it imports, and every hook call in that window died with ERR_MODULE_NOT_FOUND (3.20.1
|
|
222
|
+
// rollout, 2026-10-05). Fetch everything, then write locally, imports (deeper paths) before importers.
|
|
223
|
+
const fetched = [];
|
|
219
224
|
await eachLimited(stale, async (entry) => {
|
|
220
225
|
try {
|
|
221
|
-
|
|
222
|
-
written.push(entry.path);
|
|
226
|
+
fetched.push({ entry, bytes: await readObject({ origin, entry, cacheDir, fetchImpl, timeoutMs }) });
|
|
223
227
|
} catch {
|
|
224
228
|
failed.push(entry.path);
|
|
225
229
|
}
|
|
226
230
|
});
|
|
231
|
+
const depth = (path) => path.split('/').length;
|
|
232
|
+
fetched.sort((a, b) => depth(b.entry.path) - depth(a.entry.path) || a.entry.path.localeCompare(b.entry.path));
|
|
233
|
+
for (const { entry, bytes } of fetched) {
|
|
234
|
+
try {
|
|
235
|
+
writeAtomic(join(projectDir, entry.path), bytes);
|
|
236
|
+
written.push(entry.path);
|
|
237
|
+
} catch {
|
|
238
|
+
failed.push(entry.path);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
227
241
|
for (const rel of prunableFiles(projectDir, unionOwned(manifest.owned, priorOwned))) {
|
|
228
242
|
if (listed.has(rel)) continue;
|
|
229
243
|
rmSync(join(projectDir, rel), { force: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nurix/etna",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.31",
|
|
4
4
|
"description": "Bootstrap a project with a Nurix harness — writes the committed contract (CLAUDE.md, AGENTS.md, .claude/harness.json, settings.json, the mount hook) and mounts the harness itself, gitignored, from a bundled payload; sessions keep it current from the CDN.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"agent",
|
|
47
47
|
"plugin"
|
|
48
48
|
],
|
|
49
|
-
"etnaFingerprint": "
|
|
49
|
+
"etnaFingerprint": "1ced34191650"
|
|
50
50
|
}
|