@turri-dev/cli 0.1.4-next.5a94e68 → 0.1.4-next.afc43a8
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/docs/authoring-plain.md
CHANGED
|
@@ -158,13 +158,15 @@ an agent has to decide to go and read.
|
|
|
158
158
|
| `import-modules.md`, `requires-modules.md` | the two ways modules build on each other |
|
|
159
159
|
| `exported-concepts.md`, `required-concepts.md` | which concepts cross module boundaries |
|
|
160
160
|
| `integrations.md` (+ standalone, embedded, embedded testing) | specs for REST API integrations, deployed standalone or embedded in an existing codebase |
|
|
161
|
+
| `turri-regeneration.md` | how turri regenerates a spec change - as a spec diff, wherever it sits, in the chain's tip - so a spec is placed by what it means, never to spare regeneration |
|
|
161
162
|
| `stdlib.md` | the standard library: when to import which template, and every template with what it is and where it is, read from `stdlib/` |
|
|
162
163
|
|
|
163
164
|
The ones that shape a spec most:
|
|
164
165
|
|
|
165
166
|
- **One functionality is at most ~200 lines of code.** A bigger one is split before it is written
|
|
166
167
|
(`analyze-if-func-spec-too-complex`, `break-down-func-spec`).
|
|
167
|
-
- **Functional specs are in build order.** Each is rendered on top of the ones before it
|
|
168
|
+
- **Functional specs are in build order.** Each is rendered on top of the ones before it - which is
|
|
169
|
+
what a spec may assume, not what a change costs: a spec inserted anywhere is regenerated alone.
|
|
168
170
|
- **They state facts, with a concrete subject.** "A :User: can add a :Task:" - not "Implement
|
|
169
171
|
adding tasks", not "The system should…".
|
|
170
172
|
- **Nothing a test cannot check.** No `robust`, `seamless`, `as appropriate`; state the checkable
|
|
@@ -65,6 +65,7 @@ GOOD — statements of fact with concrete subjects:
|
|
|
65
65
|
- The renderer has **no knowledge of future specs** — only previously rendered specs are in context
|
|
66
66
|
- A new spec can reference behavior from earlier specs but cannot assume anything about specs that come after it
|
|
67
67
|
- Functional specs from `requires` modules are treated as previous requirements — transitively, across the whole ancestor chain
|
|
68
|
+
- This order is about what a spec may assume, not what a change costs: turri regenerates a change as a spec diff wherever it sits (`turri-regeneration.md`)
|
|
68
69
|
|
|
69
70
|
## No conflicts
|
|
70
71
|
- The new spec must not contradict any existing functional spec
|
|
@@ -75,9 +75,11 @@ Parameters are key-value pairs; the template reads them as `{{ variable_name }}`
|
|
|
75
75
|
|
|
76
76
|
## When an earlier test fails after a render
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Each functional spec is written knowing the ones before it and none after it - a required module's
|
|
79
|
+
specs count as before - so a spec may rely on what earlier ones say, never on later ones. This is
|
|
80
|
+
about what a spec may assume, not what a change costs (`turri-regeneration.md`). After each
|
|
81
|
+
render every conformance test so far runs again. A test that passed before and fails now means one
|
|
82
|
+
of:
|
|
81
83
|
|
|
82
84
|
1. the new code does not satisfy its spec;
|
|
83
85
|
2. the test does not test its spec accurately;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: How turri regenerates the code from a spec change - by spec diff, in the chain's tip - so a spec is placed by what it means, never by what regenerating it would cost
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# How turri regenerates the code
|
|
6
|
+
|
|
7
|
+
The other rules say what a spec means. This one says what turri does with a change to it, so that
|
|
8
|
+
where a change goes is never decided by a wrong idea of what it costs.
|
|
9
|
+
|
|
10
|
+
## A change is regenerated as a spec diff
|
|
11
|
+
|
|
12
|
+
- turri regenerates the code from spec diffs: what changed between the spec the code was built from
|
|
13
|
+
and the spec now
|
|
14
|
+
- A functional spec added, changed or taken out is that change alone, wherever it sits - first, in the
|
|
15
|
+
middle or last of its module
|
|
16
|
+
- The specs around it are not regenerated because their position or numbering moved, and nothing after
|
|
17
|
+
it is built again. A spec inserted in the middle is one addition
|
|
18
|
+
- "Specs render top to bottom, each knowing only the ones before it" is about what a spec may assume
|
|
19
|
+
(`func-specs.md`), not about what a change costs
|
|
20
|
+
|
|
21
|
+
## A change is regenerated in the chain's tip
|
|
22
|
+
|
|
23
|
+
- A chain's code lives in its tip - the furthest module built on it. The modules below it keep the
|
|
24
|
+
code they were built with
|
|
25
|
+
- A change to any module of the chain, the base's included, is regenerated in the tip's code - not in
|
|
26
|
+
the module the change was made in
|
|
27
|
+
- Putting a change in a lower module costs no more than putting it in the tip, and saves nothing
|
|
28
|
+
either
|
|
29
|
+
|
|
30
|
+
## So place a spec by what it means
|
|
31
|
+
|
|
32
|
+
- Put a functional spec where it belongs: in the module that owns the concern, at the point in its
|
|
33
|
+
order where what it relies on has been said
|
|
34
|
+
- Never put a spec at the end of a module, or in the tip, only to spare regeneration - it spares none
|
|
35
|
+
- What does cost more is asked for outright, never brought on by placement: regenerating a functional
|
|
36
|
+
spec again, or a module or chain from scratch
|