@hobin/developer 0.1.0
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/LICENSE +21 -0
- package/README.md +231 -0
- package/extensions/developer.ts +700 -0
- package/extensions/skills.ts +89 -0
- package/extensions/state.ts +283 -0
- package/extensions/tool-policy.ts +65 -0
- package/extensions/tui.ts +391 -0
- package/package.json +43 -0
- package/skills/abstraction-review/SKILL.md +87 -0
- package/skills/abstraction-review/references/field-card.md +209 -0
- package/skills/abstraction-review/references/recipe-cards.md +255 -0
- package/skills/abstraction-review/references/repair-table.md +98 -0
- package/skills/abstraction-review/references/worked-examples.md +306 -0
- package/skills/adversarial-eval/SKILL.md +87 -0
- package/skills/model/SKILL.md +76 -0
- package/skills/model/references/problem-modeling.md +262 -0
- package/skills/naming-judgment/SKILL.md +77 -0
- package/skills/naming-judgment/references/elements-of-clojure-naming.md +74 -0
- package/skills/schedule/SKILL.md +71 -0
- package/skills/signal/SKILL.md +75 -0
- package/skills/sketch/SKILL.md +70 -0
- package/skills/specify/SKILL.md +67 -0
- package/skills/verify/SKILL.md +71 -0
- package/skills/visualize/SKILL.md +65 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Abstraction Review Field Card
|
|
2
|
+
|
|
3
|
+
Use this reference when a review should produce more than a paragraph of advice.
|
|
4
|
+
The goal is to turn a wished abstraction into an artifact with a stop check.
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Operating Loop
|
|
9
|
+
- Field Card
|
|
10
|
+
- Source Modes
|
|
11
|
+
- Good Wish Test
|
|
12
|
+
- Recipe-Grade Gate
|
|
13
|
+
- Layer Router
|
|
14
|
+
- Minimal Output
|
|
15
|
+
- Self-Application Check
|
|
16
|
+
|
|
17
|
+
## Operating Loop
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
pressure
|
|
21
|
+
-> wish
|
|
22
|
+
-> layer
|
|
23
|
+
-> recipe card
|
|
24
|
+
-> output artifact
|
|
25
|
+
-> observable stop
|
|
26
|
+
-> repair decision
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The wish opens freedom; the stop check brings the review back to evidence.
|
|
30
|
+
Failure is not handled by a better name. Failure exposes a broken layer,
|
|
31
|
+
contract, or missing artifact.
|
|
32
|
+
|
|
33
|
+
## Field Card
|
|
34
|
+
|
|
35
|
+
Fill this card for serious reviews.
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Candidate:
|
|
39
|
+
What wished interface, helper, boundary, condition model, or abstraction is
|
|
40
|
+
being judged?
|
|
41
|
+
|
|
42
|
+
Source and confidence:
|
|
43
|
+
Where did the candidate come from, and how strong is the evidence?
|
|
44
|
+
|
|
45
|
+
Pressure:
|
|
46
|
+
What complexity, repetition, variation, history, or representation detail is
|
|
47
|
+
this candidate supposed to remove?
|
|
48
|
+
|
|
49
|
+
Wish:
|
|
50
|
+
In the better world, what would callers be able to say or do?
|
|
51
|
+
|
|
52
|
+
Mismatch:
|
|
53
|
+
What currently breaks or might break that wish?
|
|
54
|
+
|
|
55
|
+
Timing:
|
|
56
|
+
pre-implementation / post-implementation
|
|
57
|
+
|
|
58
|
+
Layer:
|
|
59
|
+
Language / Unit / Law / Boundary / Engine / Time / Run
|
|
60
|
+
|
|
61
|
+
Recipe:
|
|
62
|
+
Which narrow card is being executed?
|
|
63
|
+
|
|
64
|
+
Input artifact:
|
|
65
|
+
What concrete input must be written before judgment?
|
|
66
|
+
|
|
67
|
+
Derivation:
|
|
68
|
+
How does that input constrain the output?
|
|
69
|
+
|
|
70
|
+
Contract:
|
|
71
|
+
What can callers or future users rely on?
|
|
72
|
+
|
|
73
|
+
Hidden detail:
|
|
74
|
+
What representation, policy, timing, history, cost, or process detail should
|
|
75
|
+
callers not depend on?
|
|
76
|
+
|
|
77
|
+
Output artifact:
|
|
78
|
+
What table, graph, contract, invariant, trace, or decision remains?
|
|
79
|
+
|
|
80
|
+
Stop:
|
|
81
|
+
What observable check decides pass/fail?
|
|
82
|
+
|
|
83
|
+
Evidence and gaps:
|
|
84
|
+
What evidence supports the decision, and what would change it?
|
|
85
|
+
|
|
86
|
+
Decision:
|
|
87
|
+
keep / revise-surface / revise-model / split / reject / defer
|
|
88
|
+
|
|
89
|
+
Open consequence:
|
|
90
|
+
What remains unresolved after this review?
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Source Modes
|
|
94
|
+
|
|
95
|
+
Use the candidate source to choose evidence and timing.
|
|
96
|
+
|
|
97
|
+
| Source | Review pressure | Evidence to require |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| design draft wished interface | Is the wish implementable and bounded? | caller contract, representative cases, hidden detail, planned stop |
|
|
100
|
+
| structural observation | Is the movement real abstraction or local churn? | before/after diff, repeated movement, condition relation |
|
|
101
|
+
| user-proposed API/helper | Is it domain language or implementation-shaped naming? | wished use, caller obligations, failure modes |
|
|
102
|
+
| existing implementation | Does code still match the abstraction promise? | tests, trace, cost, call sites, hidden coupling |
|
|
103
|
+
| skill/workflow update | Will future agents behave differently? | trigger wording, reference routing, realistic invocation |
|
|
104
|
+
|
|
105
|
+
## Good Wish Test
|
|
106
|
+
|
|
107
|
+
A wish is strong enough to review when it exposes a small language, not merely a
|
|
108
|
+
preferred name.
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
primitive words:
|
|
112
|
+
What operations can be trusted without re-opening implementation detail?
|
|
113
|
+
|
|
114
|
+
means of combination:
|
|
115
|
+
How do smaller units produce larger valid units?
|
|
116
|
+
|
|
117
|
+
means of abstraction:
|
|
118
|
+
How is a repeated composition or method given a reusable handle?
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Reject or revise a wish when:
|
|
122
|
+
|
|
123
|
+
- it only renames current representation shape;
|
|
124
|
+
- it has no caller contract or failure mode;
|
|
125
|
+
- its result cannot be composed or intentionally finalized;
|
|
126
|
+
- no preserved meaning, invariant, or policy owner is visible;
|
|
127
|
+
- it hides cost, history, order, or mutation that callers must understand.
|
|
128
|
+
|
|
129
|
+
## Recipe-Grade Gate
|
|
130
|
+
|
|
131
|
+
A review is recipe-grade only when this sentence can be filled:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
Given <input artifact>,
|
|
135
|
+
derive <output artifact>
|
|
136
|
+
by <rule>,
|
|
137
|
+
then check <observable stop>.
|
|
138
|
+
If it fails, repair <layer, contract, or artifact>.
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If the sentence cannot be filled:
|
|
142
|
+
|
|
143
|
+
| What it is | Missing | Review consequence |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| Advice | trigger, artifact, stop check | keep as explanation; do not promote |
|
|
146
|
+
| Heuristic | derivation from input to output | read `repair-table.md` or expose the missing model |
|
|
147
|
+
| Candidate recipe | derivation is still loose | run one worked case |
|
|
148
|
+
| Recipe-grade | trigger, input, rule, output, stop, repair all exist | use in the review |
|
|
149
|
+
|
|
150
|
+
## Layer Router
|
|
151
|
+
|
|
152
|
+
| Symptom | Layer | First card |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| The problem vocabulary is missing or misleading | Language | Notation As Data |
|
|
155
|
+
| Similar functions, workflows, or tests move together | Language/Unit | Movement Pattern Extraction |
|
|
156
|
+
| Operation results do not remain composable | Unit | Closure Composition Unit |
|
|
157
|
+
| A loop, state transition, or contract has no preserved meaning | Law | Invariant Iteration |
|
|
158
|
+
| Callers must know raw representation or hidden policy | Boundary | Data Abstraction Boundary |
|
|
159
|
+
| New variants keep changing old conditionals | Engine | Dispatch Registration |
|
|
160
|
+
| Conversion works but meaning loss is hidden | Engine/Law | Meaning-Preserving Path |
|
|
161
|
+
| Same call depends on past interaction | Time | History Placement |
|
|
162
|
+
| Event order changes correctness | Time/Run | Event Order Protection |
|
|
163
|
+
| Result is right but process, cost, sharing, or stack shape is wrong | Run | Procedure -> Process Reality Check |
|
|
164
|
+
|
|
165
|
+
When the symptom is clearer than the layer, open `repair-table.md`.
|
|
166
|
+
|
|
167
|
+
## Minimal Output
|
|
168
|
+
|
|
169
|
+
For a compact user-facing review, show:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
Candidate:
|
|
173
|
+
Source and confidence:
|
|
174
|
+
Layer:
|
|
175
|
+
Recipe:
|
|
176
|
+
Input artifact:
|
|
177
|
+
Derivation rule:
|
|
178
|
+
Contract:
|
|
179
|
+
Hidden detail:
|
|
180
|
+
Output artifact:
|
|
181
|
+
Stop check:
|
|
182
|
+
Evidence and gaps:
|
|
183
|
+
Decision:
|
|
184
|
+
Open consequence:
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
When this review is part of a larger task, return the decision and its open
|
|
188
|
+
consequence. The caller or orchestrator decides what happens next. Otherwise,
|
|
189
|
+
stop at the review result. The card must be complete enough that a later person
|
|
190
|
+
or agent can use it without reconstructing the reasoning.
|
|
191
|
+
|
|
192
|
+
## Self-Application Check
|
|
193
|
+
|
|
194
|
+
When the candidate is a skill, workflow, recipe, or reference update, review the
|
|
195
|
+
update with the same card.
|
|
196
|
+
|
|
197
|
+
Map the layers this way:
|
|
198
|
+
|
|
199
|
+
| Skill update surface | Review layer |
|
|
200
|
+
| --- | --- |
|
|
201
|
+
| trigger wording, user-facing command language | Language |
|
|
202
|
+
| skill responsibility and core question | Boundary |
|
|
203
|
+
| recipe-grade invariant or stop condition | Law |
|
|
204
|
+
| progressive disclosure and reference routing | Engine |
|
|
205
|
+
| whether future agents actually read enough context | Run |
|
|
206
|
+
|
|
207
|
+
The stop check should be a realistic invocation, self-review card, or
|
|
208
|
+
forward-test prompt. If the review cannot name what future behavior changes, the
|
|
209
|
+
update is probably documentation, not a stable workflow abstraction.
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Abstraction Review Recipe Cards
|
|
2
|
+
|
|
3
|
+
Use this deck when the review needs a construction rule, not only a layer name.
|
|
4
|
+
Each card must produce an artifact and a stop check.
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Pocket Deck
|
|
9
|
+
- Procedure -> Process Reality Check
|
|
10
|
+
- Movement Pattern Extraction
|
|
11
|
+
- Invariant Iteration
|
|
12
|
+
- Data Abstraction Boundary
|
|
13
|
+
- Closure Composition Unit
|
|
14
|
+
- Dispatch Registration
|
|
15
|
+
- Meaning-Preserving Path
|
|
16
|
+
- Notation As Data
|
|
17
|
+
- History Placement
|
|
18
|
+
- Event Order Protection
|
|
19
|
+
|
|
20
|
+
## Pocket Deck
|
|
21
|
+
|
|
22
|
+
| Card | Trigger | Fill first | Derive | Stop | Repair if fails |
|
|
23
|
+
| --- | --- | --- | --- | --- | --- |
|
|
24
|
+
| Procedure -> Process Reality Check | Result is plausible but process shape is unclear | procedure text, sample input, expected result | trace deferred work, state updates, duplicated work, cost | result, shape, and cost are all explainable | move to Law or Time |
|
|
25
|
+
| Movement Pattern Extraction | Similar cases move together but differ in stable roles | concrete cases side by side, common movement, varying roles | keep common movement as body; lift stable variation roles to parameters, callbacks, or strategies | old cases become simple calls and new case is expressible | split, inline, or return to Language |
|
|
26
|
+
| Invariant Iteration | Recursion or state should become a stable transition | original meaning, state variables, transition candidate | write `processed meaning + remaining meaning = original meaning` using the domain operation | initial, step, and final checks pass | return to Run trace or reduce state variables |
|
|
27
|
+
| Data Abstraction Boundary | Caller knows raw representation | domain value, operations, representation candidates | create constructor, selector, predicate, and operation vocabulary | caller code stops touching raw representation | move to Unit or Engine |
|
|
28
|
+
| Closure Composition Unit | Operation results cannot feed later operations | candidate unit, operation list, preserved meaning | mark closed operations vs observers/finalizers | closed operations build larger values of the same unit | move final effect outside the unit |
|
|
29
|
+
| Dispatch Registration | New type/provider/case changes old branches | variant axis, operation axis, current branches | turn each branch into `(variant, operation) -> method` | fake variant is added by registration only | choose axes again or use Meaning-Preserving Path |
|
|
30
|
+
| Meaning-Preserving Path | Mixed worlds need operation without hidden loss | source worlds, operation, candidate paths | draw direct/coerce/canonicalize/reject graph | legal path, loss, and unsupported cases are explicit | narrow preserved meaning or reject |
|
|
31
|
+
| Notation As Data | String/index manipulation stands in for semantic rules | expression cases, parts, transformations | make predicate/selector/constructor vocabulary | rewrite rule ignores raw layout | move to Boundary or Engine |
|
|
32
|
+
| History Placement | Same call depends on history | behavior, required history, interaction model | choose pure, local state, or stream/log placement | hidden summary or explicit history matches contract | move to Event Order or Boundary |
|
|
33
|
+
| Event Order Protection | Interleaving changes correctness | events, shared meaning, possible interleavings | state order law and protected region or merge policy | forbidden interleaving is blocked for a stated reason | narrow order law or return to History |
|
|
34
|
+
|
|
35
|
+
## Card Details
|
|
36
|
+
|
|
37
|
+
### Procedure -> Process Reality Check
|
|
38
|
+
|
|
39
|
+
Use when code is textually simple but execution may grow the wrong process.
|
|
40
|
+
|
|
41
|
+
Output artifact:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
process trace:
|
|
45
|
+
input -> stage -> stage -> result
|
|
46
|
+
shape:
|
|
47
|
+
recursive / iterative / tree / delayed / stateful
|
|
48
|
+
cost note:
|
|
49
|
+
time, space, duplicated work, hidden order
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Promote only if the abstraction promise includes the real process shape, not
|
|
53
|
+
just the returned value.
|
|
54
|
+
|
|
55
|
+
### Movement Pattern Extraction
|
|
56
|
+
|
|
57
|
+
Use when abstraction pressure comes from repeated movement, not from a single
|
|
58
|
+
interface wish.
|
|
59
|
+
|
|
60
|
+
Input artifact:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
cases:
|
|
64
|
+
two or more concrete functions, workflows, tests, or traces
|
|
65
|
+
common movement:
|
|
66
|
+
steps that move together across cases
|
|
67
|
+
variation roles:
|
|
68
|
+
stable differences such as predicate, term, next, combine, strategy, policy
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Derivation:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
body:
|
|
75
|
+
keep the common movement
|
|
76
|
+
parameters:
|
|
77
|
+
lift stable variation roles
|
|
78
|
+
name:
|
|
79
|
+
describe the concept, not the implementation trick
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Output artifact:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
abstraction candidate:
|
|
86
|
+
name, signature, body skeleton
|
|
87
|
+
role table:
|
|
88
|
+
case -> variation role values
|
|
89
|
+
process note:
|
|
90
|
+
whether the generated process/cost changes
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Stop check: each old case is a simple call, and at least one realistic new case
|
|
94
|
+
can be expressed without adding a new option that exposes internals.
|
|
95
|
+
|
|
96
|
+
Reject if the cases only look textually similar but carry different
|
|
97
|
+
responsibilities. Split if variation roles are not stable.
|
|
98
|
+
|
|
99
|
+
### Invariant Iteration
|
|
100
|
+
|
|
101
|
+
Use when state variables or accumulators need meaning.
|
|
102
|
+
|
|
103
|
+
Output artifact:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
invariant:
|
|
107
|
+
what state variables preserve
|
|
108
|
+
initial:
|
|
109
|
+
why the invariant starts true
|
|
110
|
+
transition:
|
|
111
|
+
why one step keeps it true
|
|
112
|
+
final:
|
|
113
|
+
why termination exposes the answer
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If the invariant is hard to state, decide `revise-model`. If it is true but
|
|
117
|
+
expensive, review representation or operation placement.
|
|
118
|
+
|
|
119
|
+
### Data Abstraction Boundary
|
|
120
|
+
|
|
121
|
+
Use when callers know too much.
|
|
122
|
+
|
|
123
|
+
Output artifact:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
public handles:
|
|
127
|
+
constructors / selectors / predicates / generic operations
|
|
128
|
+
representation law:
|
|
129
|
+
what callers may trust
|
|
130
|
+
hidden freedom:
|
|
131
|
+
internal details that may change
|
|
132
|
+
creation policy:
|
|
133
|
+
validation / normalization / simplification location
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
If no detail is hidden, reject or inline. If policy is hidden in consumers,
|
|
137
|
+
decide `revise-surface`.
|
|
138
|
+
|
|
139
|
+
### Closure Composition Unit
|
|
140
|
+
|
|
141
|
+
Use when the goal is an algebra of reusable pieces.
|
|
142
|
+
|
|
143
|
+
Output artifact:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
unit predicate:
|
|
147
|
+
what belongs to the world
|
|
148
|
+
closed operations:
|
|
149
|
+
unit -> unit, unit x unit -> unit
|
|
150
|
+
observers/finalizers:
|
|
151
|
+
unit -> outside
|
|
152
|
+
illegal move:
|
|
153
|
+
operation that leaks or breaks the unit
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Do not make everything chainable. Preserve the central unit and move final
|
|
157
|
+
effects to an explicit boundary.
|
|
158
|
+
|
|
159
|
+
### Dispatch Registration
|
|
160
|
+
|
|
161
|
+
Use when variation should be additive.
|
|
162
|
+
|
|
163
|
+
Output artifact:
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
table:
|
|
167
|
+
variants x operations
|
|
168
|
+
registration:
|
|
169
|
+
register(variant, operation, method)
|
|
170
|
+
lookup:
|
|
171
|
+
applyGeneric(operation, value...)
|
|
172
|
+
unsupported:
|
|
173
|
+
explicit missing capability policy
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Stop check: add a fake variant. Existing callers and existing variant packages
|
|
177
|
+
should not know its representation.
|
|
178
|
+
|
|
179
|
+
### Meaning-Preserving Path
|
|
180
|
+
|
|
181
|
+
Use when values cross worlds.
|
|
182
|
+
|
|
183
|
+
Output artifact:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
conversion graph:
|
|
187
|
+
source -> target paths
|
|
188
|
+
preserved meaning:
|
|
189
|
+
what must survive conversion
|
|
190
|
+
policy:
|
|
191
|
+
direct / raise / canonicalize / reject
|
|
192
|
+
loss note:
|
|
193
|
+
precision, identity, ordering, capability
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Unsupported is a legitimate boundary, not a failure, when meaning cannot be
|
|
197
|
+
preserved.
|
|
198
|
+
|
|
199
|
+
### Notation As Data
|
|
200
|
+
|
|
201
|
+
Use when a language, expression, query, or formula must be inspected or
|
|
202
|
+
rewritten.
|
|
203
|
+
|
|
204
|
+
Output artifact:
|
|
205
|
+
|
|
206
|
+
```text
|
|
207
|
+
expression boundary:
|
|
208
|
+
predicates / selectors / constructors
|
|
209
|
+
transform rules:
|
|
210
|
+
algorithms written against the boundary
|
|
211
|
+
render/evaluate boundary:
|
|
212
|
+
where data becomes displayed or executable again
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
If transformation rules depend on indexes or string layout, the boundary is not
|
|
216
|
+
real yet.
|
|
217
|
+
|
|
218
|
+
### History Placement
|
|
219
|
+
|
|
220
|
+
Use when current behavior cannot be understood from current input alone.
|
|
221
|
+
|
|
222
|
+
Output artifact:
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
placement:
|
|
226
|
+
pure / local state / stream-log
|
|
227
|
+
state contract:
|
|
228
|
+
what hidden state summarizes
|
|
229
|
+
stream contract:
|
|
230
|
+
what each time-indexed value means
|
|
231
|
+
order risk:
|
|
232
|
+
where histories merge or conflict
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Local state hides history for API simplicity. Stream/log exposes history for
|
|
236
|
+
composition, replay, audit, and merge reasoning.
|
|
237
|
+
|
|
238
|
+
### Event Order Protection
|
|
239
|
+
|
|
240
|
+
Use when order is part of meaning.
|
|
241
|
+
|
|
242
|
+
Output artifact:
|
|
243
|
+
|
|
244
|
+
```text
|
|
245
|
+
order law:
|
|
246
|
+
required happens-before relation
|
|
247
|
+
protected region:
|
|
248
|
+
steps that must appear atomic
|
|
249
|
+
mechanism:
|
|
250
|
+
lock / transaction / queue / serializer / merge policy
|
|
251
|
+
cost:
|
|
252
|
+
waiting, reduced parallelism, fairness tradeoff
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
If everything must be serialized, the order law is probably too broad.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Abstraction Review Repair Table
|
|
2
|
+
|
|
3
|
+
Use this table when a wished abstraction failed, or when the observed symptom is
|
|
4
|
+
clearer than the broken layer.
|
|
5
|
+
|
|
6
|
+
## Diagnostic Loop
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
observed mismatch
|
|
10
|
+
-> evidence
|
|
11
|
+
-> broken layer hypothesis
|
|
12
|
+
-> recipe card
|
|
13
|
+
-> repair output
|
|
14
|
+
-> re-run same symptom
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Do not jump from mismatch to a better name. Names can be repair outputs, but the
|
|
18
|
+
repair must change a layer, contract, or artifact.
|
|
19
|
+
|
|
20
|
+
## Repair Log
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
Observed symptom:
|
|
24
|
+
Evidence:
|
|
25
|
+
Broken layer hypothesis:
|
|
26
|
+
Selected recipe:
|
|
27
|
+
Repair output:
|
|
28
|
+
Re-run result:
|
|
29
|
+
Open consequence:
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If the repair output is empty, the review only explained the problem.
|
|
33
|
+
|
|
34
|
+
## Repair Matrix
|
|
35
|
+
|
|
36
|
+
| Symptom | Suspect layer | First repair | Output to create | Stop check |
|
|
37
|
+
| --- | --- | --- | --- | --- |
|
|
38
|
+
| Helpers have nice names but the domain rule is invisible | Language | Restate desired vocabulary | primitive/combination/abstraction vocabulary | new case can be spoken without representation detail |
|
|
39
|
+
| Similar functions differ only by predicate, term, next step, or strategy | Language/Unit | Movement Pattern Extraction | common movement plus variation role table | old cases become simple calls |
|
|
40
|
+
| Similar-looking code has different responsibilities | Unit/Boundary | Reject or split the abstraction | responsibility split note | no shared unit is promoted |
|
|
41
|
+
| Caller reads object fields, list indexes, tags, or provider-specific shape | Boundary | Data Abstraction Boundary | constructor/selector/predicate/operation list | caller no longer touches representation primitive |
|
|
42
|
+
| Operation result cannot be fed into later operations | Unit | Closure Composition Unit | closed operation table | closed operations build larger units |
|
|
43
|
+
| Chainable API forces final side effects into the chain | Unit/Boundary | Split closed operations from finalizers | observer/finalizer boundary | closed operations and boundary effects are distinct |
|
|
44
|
+
| State variables have no meaning | Law | Invariant Iteration | invariant statement | initial/step/final checks pass |
|
|
45
|
+
| Loop is fast but correctness cannot be explained | Law/Run | Invariant + process trace | invariant and process trace | correctness follows from preserved meaning |
|
|
46
|
+
| Recursive version is clear but stack or deferred work grows | Run | Procedure -> Process, then Invariant | shape note and accumulator option | shape change is explicit |
|
|
47
|
+
| Constructor, validator, and normalizer are scattered | Boundary/Engine | Creation policy boundary | creation policy note | value enters the world through one gate |
|
|
48
|
+
| Constructor is too expensive | Engine/Run | Cost placement decision | create/read/update cost note | cost owner is explicit |
|
|
49
|
+
| New representation changes old code | Engine | Dispatch Registration | variant x operation table | new row/package is enough |
|
|
50
|
+
| New operation changes every variant | Engine | Re-evaluate row/column axis | axis decision | frequently growing axis is explicit |
|
|
51
|
+
| Mixed types explode into direct cases | Engine/Law | Meaning-Preserving Path | conversion graph | legal, loss, and unsupported paths are visible |
|
|
52
|
+
| Conversion loses precision, identity, order, or capability | Law | Narrow preserved meaning | loss note | loss appears in contract |
|
|
53
|
+
| Expression rewrite uses strings or indexes | Language/Boundary | Notation As Data | expression selectors/constructors | rules ignore raw layout |
|
|
54
|
+
| AST exists but transforms are representation-specific | Boundary | Data Abstraction Boundary | representation-independent rules | representation can change |
|
|
55
|
+
| Same call returns different results after prior interactions | Time | History Placement | state/history contract | history location is explicit |
|
|
56
|
+
| Caller keeps passing previous state everywhere | Time/Boundary | History Placement | local state decision | burden is intentionally hidden or kept explicit |
|
|
57
|
+
| Local state makes testing/reasoning hard | Time/Run | History Placement + process trace | hidden history note | loss of referential transparency is accepted |
|
|
58
|
+
| Undo, replay, audit, or collaboration needs past events | Time | History as stream/log | stream/log decision | history is manipulable data |
|
|
59
|
+
| Stream merge changes meaning | Time/Run | Event Order Protection | merge/order policy | forbidden interleaving is explainable |
|
|
60
|
+
| Concurrent read-compute-write breaks invariant | Time/Run | Event Order Protection | protected region | invariant-breaking interleaving is blocked |
|
|
61
|
+
| Lock/serializer blocks too much | Time/Engine | Narrow the order law | smaller protected relation | only meaningful order is protected |
|
|
62
|
+
| Generic abstraction is clean but slow | Run/Engine | Procedure -> Process | cost surface | dispatch/lookup/coercion cost is visible |
|
|
63
|
+
| Everything feels abstract and nothing is actionable | Run | Field Card + Recipe Cards | selected recipe card | trigger/input/output/stop are filled |
|
|
64
|
+
|
|
65
|
+
## Collision Rules
|
|
66
|
+
|
|
67
|
+
| Collision | Prefer first when evidence says... | Then check... |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| Language vs Boundary | caller has no useful words except representation details | whether a boundary is still needed after vocabulary exists |
|
|
70
|
+
| Movement vs Duplication | cases share behavior roles, not just text | whether old cases become simpler and responsibility stays coherent |
|
|
71
|
+
| Unit vs Boundary | results leave the composable world | observer/finalizer separation |
|
|
72
|
+
| Law vs Run | result is right but why is unclear | invariant first, then process shape |
|
|
73
|
+
| Boundary vs Engine | caller knows internal details | boundary first, then registry/table placement |
|
|
74
|
+
| Engine vs Law | dispatch/conversion works but meaning loss hides | preserved meaning, then path graph |
|
|
75
|
+
| Time vs Boundary | same call changes with history | whether history is public contract or hidden state |
|
|
76
|
+
| Time vs Run | delayed execution or event order changes correctness | order law or process trace |
|
|
77
|
+
| Run vs Engine | abstraction is semantically right but costs too much | cost trace, then dispatch/coercion placement |
|
|
78
|
+
|
|
79
|
+
## Exit Checks
|
|
80
|
+
|
|
81
|
+
Before leaving the table, check:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
Symptom:
|
|
85
|
+
Did the review name the actual mismatch?
|
|
86
|
+
|
|
87
|
+
Evidence:
|
|
88
|
+
Was the mismatch observed in caller code, trace, test, cost, history, or order?
|
|
89
|
+
|
|
90
|
+
Layer:
|
|
91
|
+
Is the layer a likely cause, not merely a consequence?
|
|
92
|
+
|
|
93
|
+
Recipe:
|
|
94
|
+
Does the selected card require an output artifact?
|
|
95
|
+
|
|
96
|
+
Re-run:
|
|
97
|
+
Did the same symptom disappear, remain, or become a new symptom?
|
|
98
|
+
```
|