@hobin/developer 0.1.8 → 0.1.10

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 (66) hide show
  1. package/README.md +215 -372
  2. package/REFERENCE_ROUTING.md +243 -0
  3. package/extensions/compaction-language.ts +303 -0
  4. package/extensions/developer.ts +607 -20
  5. package/extensions/machine.ts +45 -0
  6. package/extensions/references/behavior-preserving-structural-change.md +87 -8
  7. package/extensions/skills.ts +330 -52
  8. package/extensions/state.ts +227 -2
  9. package/package.json +9 -3
  10. package/skills/abstraction-review/SKILL.md +37 -23
  11. package/skills/abstraction-review/reference-policy.json +66 -0
  12. package/skills/abstraction-review/references/field-card.md +113 -168
  13. package/skills/abstraction-review/references/repair-table.md +66 -80
  14. package/skills/abstraction-review/references/worked-examples.md +79 -256
  15. package/skills/model/SKILL.md +31 -13
  16. package/skills/model/reference-policy.json +96 -0
  17. package/skills/model/references/contract-and-replacement-models.md +112 -0
  18. package/skills/model/references/logic-query-semantics.md +89 -0
  19. package/skills/model/references/planning-models.md +75 -0
  20. package/skills/model/references/problem-modeling.md +143 -276
  21. package/skills/model/references/proof-obligations.md +71 -0
  22. package/skills/model/references/relational-constraint-models.md +110 -0
  23. package/skills/model/references/solver-result-boundaries.md +83 -0
  24. package/skills/model/references/temporal-behavior-models.md +106 -0
  25. package/skills/naming-judgment/SKILL.md +17 -4
  26. package/skills/naming-judgment/reference-policy.json +29 -0
  27. package/skills/naming-judgment/references/domain-naming.md +29 -10
  28. package/skills/schedule/SKILL.md +16 -6
  29. package/skills/schedule/reference-policy.json +29 -0
  30. package/skills/schedule/references/structural-change-timing.md +81 -18
  31. package/skills/signal/SKILL.md +17 -6
  32. package/skills/signal/reference-policy.json +29 -0
  33. package/skills/signal/references/structural-movement.md +87 -14
  34. package/skills/sketch/SKILL.md +38 -42
  35. package/skills/sketch/reference-policy.json +212 -0
  36. package/skills/sketch/references/accumulator-invariants.md +125 -0
  37. package/skills/sketch/references/closure-and-conventional-interfaces.md +87 -0
  38. package/skills/sketch/references/composition-by-wishes.md +69 -0
  39. package/skills/sketch/references/data-driven-design.md +99 -22
  40. package/skills/sketch/references/data-shape-template-catalog.md +58 -19
  41. package/skills/sketch/references/design-levels-and-boundaries.md +133 -0
  42. package/skills/sketch/references/earned-abstraction.md +75 -0
  43. package/skills/sketch/references/generative-recursion.md +122 -0
  44. package/skills/sketch/references/generic-dispatch-systems.md +75 -0
  45. package/skills/sketch/references/language-semantics.md +82 -0
  46. package/skills/sketch/references/meaning-preserving-conversions.md +69 -0
  47. package/skills/sketch/references/process-shape-and-resources.md +157 -0
  48. package/skills/sketch/references/representation-barriers.md +73 -0
  49. package/skills/sketch/references/responsibility-and-collaboration.md +108 -0
  50. package/skills/sketch/references/runtime-and-compilation.md +84 -0
  51. package/skills/sketch/references/selection-and-creation.md +76 -0
  52. package/skills/sketch/references/state-history-and-order.md +126 -0
  53. package/skills/sketch/references/type-transitions.md +54 -0
  54. package/skills/sketch/references/variation-roles.md +59 -0
  55. package/skills/verify/SKILL.md +17 -6
  56. package/skills/verify/reference-policy.json +30 -0
  57. package/skills/verify/references/verifier-selection-and-pass-but-wrong.md +152 -192
  58. package/SOURCES.md +0 -104
  59. package/skills/abstraction-review/references/recipe-cards.md +0 -322
  60. package/skills/model/references/worked-models-and-specialized-techniques.md +0 -218
  61. package/skills/sketch/references/abstraction-barriers-and-closure.md +0 -160
  62. package/skills/sketch/references/abstraction-composition-and-state.md +0 -184
  63. package/skills/sketch/references/composition-generative-recursion-and-accumulators.md +0 -196
  64. package/skills/sketch/references/generic-operations-and-languages.md +0 -134
  65. package/skills/sketch/references/processes-state-and-time.md +0 -171
  66. package/skills/sketch/references/responsibility-and-variation.md +0 -245
@@ -0,0 +1,83 @@
1
+ # Solver Result Boundaries
2
+
3
+ Use this reference when the model must interpret bounded counterexample search,
4
+ satisfiability, feasibility, or optimization status.
5
+
6
+ ## Encoding Before Status
7
+
8
+ Separate:
9
+
10
+ ```text
11
+ variables and domains
12
+ hard constraints
13
+ optional objective or ranking
14
+ solution equivalence
15
+ finite scope and search reductions
16
+ encoding assumptions
17
+ ```
18
+
19
+ A mathematically optimal solution can still be operationally wrong when the
20
+ objective encodes the wrong preference.
21
+
22
+ ## Satisfiable Witness And Bound
23
+
24
+ A bounded result supports only its scope and configuration. Record one
25
+ satisfiable witness for the assumptions so an inconsistent model cannot make
26
+ implications pass vacuously.
27
+
28
+ ```text
29
+ scope and bounds
30
+ property checked
31
+ valid witness
32
+ counterexample result
33
+ unknown or incomplete paths
34
+ ```
35
+
36
+ Absence of a counterexample inside a bound is not an unbounded proof.
37
+
38
+ ## Preserve Result States
39
+
40
+ Keep exposed statuses distinct:
41
+
42
+ ```text
43
+ satisfiable | unsatisfiable | unknown | timeout | error
44
+ unbounded | feasible | proven-optimal
45
+ ```
46
+
47
+ A feasible result is not an optimality proof. `unknown` is neither satisfaction
48
+ nor impossibility. Specialization trades modeling flexibility for runtime and
49
+ predictability; state that ability-guarantee exchange.
50
+
51
+ ## Artifact
52
+
53
+ ```text
54
+ Variables, domains, and hard constraints:
55
+ Objective and solution equivalence:
56
+ Scope, bounds, and reductions:
57
+ Encoding assumptions:
58
+ Satisfiable witness:
59
+ Exact result status and meaning:
60
+ Counterexample or solution:
61
+ Unmodeled product observers:
62
+ Residual and verification target:
63
+ ```
64
+
65
+ ## Stop And Separation
66
+
67
+ Stop when the reported claim is no broader than the encoded model, bound, witness,
68
+ and exact result status.
69
+
70
+ Use `proof-obligations` for deductive implementation conformance,
71
+ `logic-query-semantics` for answer enumeration/search semantics, and `verify` for
72
+ tool execution relevance.
73
+
74
+ ## Source Trace
75
+
76
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0:
77
+ Chapters 9-11, pp. 100-155, for bounded models, solver encodings,
78
+ satisfiability, feasibility, optimization, and result states. Recorded beta
79
+ defects are excluded.
80
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
81
+ Interpretation of Computer Programs*, Second Edition,
82
+ Section 3.3.5
83
+ calibrates relation propagation and contradiction, not modern solver status.
@@ -0,0 +1,106 @@
1
+ # Temporal Behavior Models
2
+
3
+ Use this reference when correct snapshots are insufficient and the judgment
4
+ depends on histories, retries, stale events, concurrency, or progress.
5
+
6
+ ## Behavior Before State Names
7
+
8
+ Define a temporal model in this order:
9
+
10
+ ```text
11
+ initial states
12
+ admitted actions and their enabling conditions
13
+ next-state effects and unchanged fields
14
+ safety: forbidden histories
15
+ progress: required eventual behavior
16
+ stuttering or termination semantics
17
+ fairness assumptions by action
18
+ observable refinement boundary
19
+ ```
20
+
21
+ A list of enums is not a temporal model. Every action needs a frame condition so
22
+ omitted state does not change accidentally.
23
+
24
+ ## Representative Retry Model
25
+
26
+ ```text
27
+ Payment = Created
28
+ | Authorizing(attempt, requestId)
29
+ | Authorized(paymentId)
30
+ | Failed(reason)
31
+
32
+ Authorize(id): Created -> Authorizing(1, id)
33
+ Retry(id2): Authorizing(n, _) -> Authorizing(n + 1, id2)
34
+ Approved(id, payment):
35
+ Authorizing(_, id) -> Authorized(payment)
36
+ Approved(staleId, _):
37
+ Authorizing(_, currentId) -> unchanged when staleId != currentId
38
+ ```
39
+
40
+ ```text
41
+ safety: authorization is recorded at most once
42
+ progress assumption: an enabled live attempt eventually receives a response,
43
+ and retries are finite
44
+ ```
45
+
46
+ Exercise stale, duplicate, reordered, retry, cancellation, and concurrent traces.
47
+ One test per state cannot distinguish these histories.
48
+
49
+ ## Stuttering, Termination, And Valid Behavior
50
+
51
+ State whether a completed system may stop or is modeled by repeated unchanged
52
+ steps. Exhibit at least one valid behavior so inconsistent assumptions cannot
53
+ make every implication vacuously true.
54
+
55
+ Fairness must name:
56
+
57
+ - the action it applies to;
58
+ - whether enablement must be continuous or only repeated;
59
+ - the environment assumption that makes the requirement plausible.
60
+
61
+ Safety does not imply progress. Fairness does not repair an action that is never
62
+ enabled.
63
+
64
+ ## Refinement Observer
65
+
66
+ An implementation refines an abstract model only when each observable
67
+ implementation behavior is allowed by the abstract specification, possibly after
68
+ an explicit mapping. Declare which intermediate states, failures, timing, or
69
+ effects the observer can see. An abstract atomic action cannot justify visible
70
+ partial states without a refinement argument.
71
+
72
+ ## Artifact
73
+
74
+ ```text
75
+ State variables and initial states:
76
+ Actions, guards, effects, and frame conditions:
77
+ Representative valid trace:
78
+ Stale / duplicate / reordered / retry / concurrent traces:
79
+ Safety properties:
80
+ Progress properties:
81
+ Stuttering or termination semantics:
82
+ Fairness scope and environment assumptions:
83
+ Refinement mapping and observers:
84
+ Guarantee owners and verification targets:
85
+ ```
86
+
87
+ ## Stop And Separation
88
+
89
+ Stop when the model distinguishes all consequential histories and every safety or
90
+ progress claim has assumptions and a counterexample trace.
91
+
92
+ Hand off to `sketch` when state ownership or event APIs must be designed, to
93
+ `verify` when the model exists but traces are unexercised, and to
94
+ `planning-models` when the main question is finding one goal-directed action
95
+ sequence rather than admitting all valid behaviors.
96
+
97
+ ## Source Trace
98
+
99
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0:
100
+ Chapters 9-10, pp. 100-138, for bounded instances, actions, safety, liveness,
101
+ stuttering, fairness, and refinement. Recorded beta defects are excluded.
102
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
103
+ Interpretation of Computer Programs*, Second Edition:
104
+ Section 3.1
105
+ and Section 3.4
106
+ for history, identity, assignment, and allowed concurrent histories.
@@ -12,6 +12,19 @@ Choose names that preserve domain sense across implementation change.
12
12
  What domain sense should this name expose, what detail should it hide, and what
13
13
  change boundary should it preserve?
14
14
 
15
+ ## Judgment Spine
16
+
17
+ ```text
18
+ callers and audience
19
+ -> sign / current referent / relied-upon sense
20
+ -> expected evolution and effect boundary
21
+ -> reveal/hide decision
22
+ -> bounded rename map + unchanged checks
23
+ ```
24
+
25
+ If the sense cannot stabilize without redesigning responsibility or policy, hand
26
+ off instead of hiding that work in a rename.
27
+
15
28
  ## Inputs
16
29
 
17
30
  - Current name and the code or artifact it identifies
@@ -79,7 +92,7 @@ Reuse does not prove that a generic name is sound.
79
92
 
80
93
  ## Reference Routing
81
94
 
82
- Read [the domain naming reference](references/domain-naming.md) for
83
- subtle, disputed, or recurring naming pressure. Also read it when the apparent
84
- naming problem may involve false indirection, a data-scope crossing, an effect
85
- hidden by a pure-sounding word, or responsibility-derived vocabulary.
95
+ The machine-readable [reference policy](reference-policy.json) is the routing
96
+ authority. Its routed extension refines the sense step, declares the rename
97
+ artifact and stop, and names when model or design work owns the instability. Use
98
+ the exemption only when no trigger applies and cite its evidence.
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 2,
3
+ "routes": [
4
+ {
5
+ "id": "domain-sense-boundary",
6
+ "question": "Which stable sense should this sign expose to its audience while hiding the current implementation referent?",
7
+ "trigger": "Naming pressure is subtle, disputed, recurring, effect-hiding, responsibility-derived, false indirection, or crosses data/module scope so stable sense cannot be read directly from nearby callers.",
8
+ "method_step": "after inspecting callers and audience, distinguish sign, referent, relied-upon sense, expected evolution, reveal/hide boundary, and effects",
9
+ "references": [
10
+ "references/domain-naming.md"
11
+ ],
12
+ "artifacts": [
13
+ "a sign/referent/sense and audience map",
14
+ "the smallest rename map with reveal/hide rationale",
15
+ "behavior, effect, convention, and scope checks"
16
+ ],
17
+ "stop": "The proposed name is narrow and locally consistent for the relied-upon sense, and no architectural redesign is hidden in the rename.",
18
+ "separate_when": "The sense cannot be stable until product meaning, ownership, process, or candidate validity is resolved; hand off to model, sketch, or abstraction-review."
19
+ }
20
+ ],
21
+ "exemption": {
22
+ "when": "Nearby callers, tests, audience, effects, and conventions make the stable sense and smallest rename direct, with no disputed evolution, scope, indirection, or responsibility boundary.",
23
+ "evidence": [
24
+ "the inspected callers and audience",
25
+ "the current referent and relied-upon sense",
26
+ "the bounded rename scope and unchanged behavior"
27
+ ]
28
+ }
29
+ }
@@ -5,6 +5,10 @@ misleading, effect-hiding, or disputed across callers. This capability judges
5
5
  the word and the sense readers may rely on; it does not redesign the surrounding
6
6
  module or process.
7
7
 
8
+ It extends `naming-judgment` at the sense step: distinguish sign, current
9
+ referent, relied-upon sense, audience, and expected evolution, then produce one
10
+ bounded rename map. An unstable responsibility is a handoff, not a naming task.
11
+
8
12
  ## Narrow And Consistent
9
13
 
10
14
  A useful name is both narrow and consistent:
@@ -28,8 +32,13 @@ referent: the current value, function, type, or implementation
28
32
  sense: the stable properties readers understand and rely on
29
33
  ```
30
34
 
31
- Judge the name around its sense. Complete this statement before proposing a
32
- rename:
35
+ Judge the name around its sense. Equal current referents do not establish equal
36
+ sense: two values or implementations may need distinct names because readers
37
+ expect them to evolve independently. Conversely, two distinct signs should not
38
+ invent a future divergence nobody intends. Record that evolution observer before
39
+ merging or splitting vocabulary.
40
+
41
+ Complete this statement before proposing a rename:
33
42
 
34
43
  ```text
35
44
  <old> says <current sense>, but callers rely on <actual sense>.
@@ -191,12 +200,22 @@ Naming judgment is weak when:
191
200
 
192
201
  ## Source Trace
193
202
 
194
- - Zachary Tellman, *Elements of Clojure*, 2019: the Names chapter on narrow and
195
- consistent names, sign/referent/sense, naming data, functions, and macros; the
196
- Indirection and Composition chapters inform effect and context boundaries but
197
- their architectural decisions are owned by `sketch` and
198
- `abstraction-review`.
203
+ - Zachary Tellman, *Elements of Clojure*, Leanpub edition published 2019-02-11,
204
+ cross-checked against the public
205
+ first-printing manuscript:
206
+ Names, public-manuscript pp. 7-26, for narrow and consistent names,
207
+ sign/referent/sense, expected evolution, audience, and naming data, functions,
208
+ and macros; Idioms pp. 40-45 and 58-61 for dynamic-scope/effect and absence
209
+ boundaries; Indirection pp. 64-95 for context and interface sense; and
210
+ Composition pp. 98-119 for process effects. Architectural decisions remain
211
+ owned by `sketch` and `abstraction-review`;
212
+ recorded source defects and Clojure-specific naming syntax are not universal
213
+ rules.
199
214
  - Sandi Metz, Katrina Owen, and TJ Stankus, *99 Bottles of OOP*, Second
200
- Edition, version 2.2.2, 2024: chapters 2, 4, 5, and 9 on exposing
201
- responsibilities, provisional names, deriving names from responsibilities,
202
- naming classes, and communicating with future readers.
215
+ Edition, version 2.2.2, 2024: Chapter 1, pp. 12-13; Chapter 2, pp. 37-43;
216
+ Chapter 3, pp. 63-64; Chapter 4, pp. 75-99; Chapter 5, pp. 112-113;
217
+ Chapter 6, pp. 159-160; Chapter 8, pp. 196-216; and Chapter 9, pp. 237-243
218
+ and 257-259, on implementation-shaped names, sender knowledge, provisional
219
+ names, deriving names from responsibilities, receiver-supplied context,
220
+ sender-oriented requests, naming classes, and communicating with future
221
+ readers.
@@ -11,6 +11,18 @@ Decide when a concrete structural move belongs.
11
11
 
12
12
  When should this candidate be done: now, after, or never?
13
13
 
14
+ ## Judgment Spine
15
+
16
+ ```text
17
+ stable concrete candidate
18
+ -> current dependency and invariant pressure
19
+ -> guarantee gained / ability lost
20
+ -> reversibility, delay cost, and nested work
21
+ -> now | after(immediate/later + reopen) | never
22
+ ```
23
+
24
+ Timing cannot stabilize a candidate whose meaning or surface is still unresolved.
25
+
14
26
  ## Inputs
15
27
 
16
28
  - Concrete candidate and scope
@@ -20,12 +32,10 @@ When should this candidate be done: now, after, or never?
20
32
 
21
33
  ## Reference Routing
22
34
 
23
- Read [the structural change timing reference](references/structural-change-timing.md)
24
- when a behavior change and structural change compete, when `now` would remove
25
- meaningful implementation freedom, or when reversibility, nested work, and cost
26
- of delay point in different directions. Also read it when an `after` decision
27
- needs an observable reopen condition. A small, reversible candidate whose
28
- timing follows directly from the current invariant does not need the reference.
35
+ The machine-readable [reference policy](reference-policy.json) is the routing
36
+ authority. Its routed extension refines the tradeoff step, declares the timing
37
+ artifact and stop, and names when an unstable candidate must be handed back. Use
38
+ the exemption only when no trigger applies and cite its evidence.
29
39
 
30
40
  ## Output
31
41
 
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 2,
3
+ "routes": [
4
+ {
5
+ "id": "structural-timing-tradeoff",
6
+ "question": "Should this concrete structural candidate happen now, after, or never for the current accepted work?",
7
+ "trigger": "Behavior and structural change compete, doing structure now may remove meaningful ability, reversibility and delay cost conflict, nested work is consequential, or an after decision needs an observable reopen condition.",
8
+ "method_step": "after confirming a concrete candidate, compare current invariant pressure, gained guarantee, lost ability, observer-relative reversibility, delay cost, nested work, optionality, and batch boundary",
9
+ "references": [
10
+ "references/structural-change-timing.md"
11
+ ],
12
+ "artifacts": [
13
+ "a now/after/never timing matrix",
14
+ "guarantee-versus-ability and reversibility evidence",
15
+ "an after mode and observable reopen condition when applicable"
16
+ ],
17
+ "stop": "One timing outcome follows from current evidence without inventing product priority or treating future flexibility as free value.",
18
+ "separate_when": "The candidate surface, meaning, or stability is unresolved; hand back to sketch, model, signal, or abstraction-review before scheduling."
19
+ }
20
+ ],
21
+ "exemption": {
22
+ "when": "A small reversible candidate has a direct timing consequence from the current invariant, with no behavior/structure conflict, lost ability, nested work, or meaningful delay tradeoff.",
23
+ "evidence": [
24
+ "the exact candidate and current dependency",
25
+ "the direct invariant and reversibility evidence",
26
+ "the outcome and any immediate follow-up boundary"
27
+ ]
28
+ }
29
+ }
@@ -4,6 +4,10 @@ Use this reference when a concrete refactor or abstraction candidate competes
4
4
  with a behavior change, and timing depends on reversibility, optionality,
5
5
  invariant pressure, or the cost of delay.
6
6
 
7
+ It extends `schedule` only at the tradeoff step: derive one `now | after | never`
8
+ decision, its observer-relative reversibility, and its reopen condition. If the
9
+ candidate surface is still unstable, hand it back rather than timing a wish.
10
+
7
11
  ## Contents
8
12
 
9
13
  - Behavior And Structure
@@ -27,16 +31,20 @@ Separate two kinds of change before deciding timing:
27
31
  behavior.
28
32
 
29
33
  The same diff may contain both. Split them conceptually even when they are
30
- committed together. A structural candidate belongs now only when its timing can
31
- be justified by the current behavior or invariant—not merely by aesthetic
32
- preference.
34
+ committed together. Define the behavior observer before calling a change
35
+ structural: returned values may stay equal while effects, exception timing,
36
+ ordering, resource use, persisted forms, or public compatibility change. A
37
+ structural candidate belongs now only when its timing can be justified by the
38
+ current behavior or invariant—not merely by aesthetic preference.
33
39
 
34
40
  ## Small And Separate Structural Moves
35
41
 
36
42
  A tidying is a small, behavior-preserving structural move. Keep it small enough
37
43
  that the intended rearrangement, affected behavior evidence, and rollback are
38
44
  obvious. Separate it from behavior change in reasoning and, when practical, in
39
- the change history.
45
+ the change history. Separate pull requests are one workflow option, not the
46
+ definition: review latency, integration policy, deployment independence, and
47
+ team trust determine useful batch boundaries.
40
48
 
41
49
  Small does not mean arbitrary. A chain of tidyings can quietly become a redesign.
42
50
  After each move, ask whether the next one still lowers the cost of the accepted
@@ -56,8 +64,16 @@ This skill uses three outcomes:
56
64
  harmful, or has no evidence-backed pressure.
57
65
 
58
66
  The book distinguishes `first`, `after`, `later`, and `never`. This skill maps
59
- `first` to `now` and folds immediate follow-up and evidence-triggered `later`
60
- into `after`; the reopen condition preserves the important distinction.
67
+ `first` to `now` and folds both immediate follow-up and evidence-triggered
68
+ `later` into `after`. Preserve the distinction inside the decision:
69
+
70
+ ```text
71
+ after mode: immediate follow-up | evidence-triggered later
72
+ reopen: observation that starts a later move; `none` for immediate follow-up
73
+ ```
74
+
75
+ Do not use `never` to mean merely “not in this task.” It requires no credible
76
+ future behavior pressure or learning value within the admitted environment.
61
77
 
62
78
  ## Decision Procedure
63
79
 
@@ -70,9 +86,16 @@ Ask in order:
70
86
  5. What implementation freedom or alternate representation would it remove?
71
87
  6. Can a smaller type, contract, test, validation, adapter, or local movement
72
88
  provide the same guarantee?
73
- 7. How reversible is the move if the model changes?
89
+ 7. How reversible is the move if the model changes, and for which observer?
74
90
  8. What cost grows if the move is delayed?
75
91
  9. What nested work does doing it now create?
92
+ 10. Does the move pay off immediately through comprehension or a cheaper accepted
93
+ behavior change?
94
+ 11. If payoff is later, which credible behavior changes become cheaper and how
95
+ will that option be exercised?
96
+ 12. How confident are we that this specific movement removes the present obstacle?
97
+ 13. What batch, review, integration, and deployment boundaries keep the move
98
+ locally explainable?
76
99
 
77
100
  Choose `now` when the accepted work is otherwise blocked, unsafe, or difficult
78
101
  to verify for a concrete reason. Choose `after` when the move is plausible and
@@ -111,6 +134,24 @@ valid implementation paths.
111
134
 
112
135
  Do not confuse large effort with irreversibility. A large but isolated movement
113
136
  may remain reversible; a one-line public contract can be difficult to undo.
137
+ Assess reversibility against code rollback, persisted data, public consumers,
138
+ external effects, generated artifacts, deployment order, and the time during
139
+ which old and new forms coexist. “Can revert the commit” is not enough when an
140
+ observer has already acted on the new behavior or shape.
141
+
142
+ Treat optionality as a decision aid, not an options-pricing calculation. Name the
143
+ credible future behavior portfolio, the structural choice preserved, the cost of
144
+ exercising it, the period in which it remains useful, and the present premium.
145
+ Unspecified future flexibility is not an option, and uncertainty alone does not
146
+ make a structural investment valuable.
147
+
148
+ Judge structural excess against the environment the code serves now and is
149
+ credibly expected to serve. A broader model removes assumptions but grows the
150
+ conceptual surface. A public or multi-party interface can outlive every current
151
+ implementation, so let a boundary mature under local control before making it
152
+ foundational when possible. Conversely, replacing an accreted component from
153
+ scratch is costly; cut away only what current work can no longer use rather than
154
+ rebuilding merely to obtain a cleaner model.
114
155
 
115
156
  ## Nested Work Pressure
116
157
 
@@ -128,9 +169,14 @@ protecting the current invariant. If a small prerequisite is genuinely needed,
128
169
  schedule that prerequisite rather than the full idealized architecture.
129
170
 
130
171
  Also watch batch size and rhythm. Several individually safe moves can create a
131
- large review and debugging surface when chained without checkpoints. Prefer a
132
- rhythm of small structural movement, evidence, then behavior progress over a long
133
- cleanup prelude whose payoff cannot yet be observed.
172
+ large review and debugging surface when chained without checkpoints. Compare
173
+ fixed review/integration/deployment cost against collision delay, interactions
174
+ between moves, and speculative cleanup. Those curves are local measurements,
175
+ not universal laws. Integration and deployment may be separate events, and
176
+ unreviewed tidyings require earned evidence about tooling, checks, ownership,
177
+ and failure recovery—not a claim of absolute safety. Prefer a rhythm of small
178
+ structural movement, evidence, then behavior progress over a long cleanup prelude
179
+ whose payoff cannot yet be observed.
134
180
 
135
181
  ## Worked Timing Decision
136
182
 
@@ -205,13 +251,30 @@ The timing judgment is weak when:
205
251
  ## Source Trace
206
252
 
207
253
  - Kent Beck, *Tidy First?: A Personal Exercise in Empirical Software Design*,
208
- O'Reilly Media, 2023: behavior/structure separation, small tidyings,
209
- first/after/later/never decisions, batching, optionality, reversibility, and
210
- the economics of structural change.
254
+ First Edition, Second Release, O'Reilly Media, 2025-12-12:
255
+ Part II, Chapters 16-21, pp. 35-54, for separating behavior and structure,
256
+ chaining, batch costs, rhythm, untangling, and first/after/later/never timing;
257
+ and Part III, Chapters 23-31, pp. 61-87, for immediate behavior value,
258
+ optionality, cash-flow timing, reversibility, and change-relative coupling.
259
+ The package treats option pricing, Pareto/power-law claims, absolute safety,
260
+ integration-equals-deployment, and Constantine's Equivalence as heuristics or
261
+ excluded overclaims, not universal laws. Production migration, telemetry,
262
+ rollout, and rollback protocols remain Developer adaptations.
211
263
  - Sandi Metz, Katrina Owen, and TJ Stankus, *99 Bottles of OOP*, Second
212
- Edition, version 2.2.2, 2024: waiting for real change pressure, tolerating
213
- duplication, selecting a point of attack, gradual movement, and stable
214
- landings.
264
+ Edition, version 2.2.2, 2024: Chapter 1, pp. 2-22; Chapters 3-4,
265
+ pp. 51-101; and Chapter 8, pp. 188-192 and 223-225, on waiting for real
266
+ change pressure, tolerating informative duplication, selecting a point of
267
+ attack, gradual movement, stable landings, and deferring added indirection
268
+ whose current payoff is not justified.
269
+ - Zachary Tellman, *Elements of Clojure*, Leanpub edition published 2019-02-11,
270
+ cross-checked against the public
271
+ first-printing manuscript:
272
+ Indirection, public-manuscript pp. 81-95, for environment-relative
273
+ over-engineering, model growth, replacement cost, interface calcification,
274
+ and maturing externally visible boundaries. Production migration, telemetry,
275
+ rollout, and rollback protocols remain Developer adaptations.
215
276
  - Hillel Wayne, *Logic for Programmers*, version 0.14.0, May 4, 2026:
216
- ability-guarantee tradeoffs and replacement obligations that affect the cost
217
- and reversibility of a structural choice.
277
+ Chapter 2, pp. 16-17, for the bidirectional ability-guarantee tradeoff and
278
+ Chapter 5, pp. 55-60, for replacement obligations and observable accidental
279
+ contracts. Production migration, telemetry, and rollback economics remain
280
+ Developer adaptations.
@@ -11,6 +11,18 @@ Observe structural movement without promoting or scheduling it.
11
11
 
12
12
  What structural movement is actually visible in the evidence?
13
13
 
14
+ ## Judgment Spine
15
+
16
+ ```text
17
+ current pressure
18
+ -> closest comparable pair
19
+ -> one smallest meaningful difference
20
+ -> one behavior-preserving falsifying move
21
+ -> no-signal | horizontal | vertical | ambiguous
22
+ ```
23
+
24
+ The output is an observation and optional candidate, never a refactoring plan.
25
+
14
26
  ## Inputs
15
27
 
16
28
  - Requirement, code slice, diff, tests, command output, or UI state
@@ -20,12 +32,11 @@ What structural movement is actually visible in the evidence?
20
32
 
21
33
  ## Reference Routing
22
34
 
23
- Read [the structural movement reference](references/structural-movement.md)
24
- when duplication, parallel branches, similar tests, repeated UI states,
25
- conditionals, or a recent refactor need a behavior-preserving next move. Also
26
- read it when the horizontal/vertical distinction is consequential or the
27
- available checks may not keep a small movement green. A direct, evidence-backed
28
- observation with no proposed movement does not need the reference.
35
+ The machine-readable [reference policy](reference-policy.json) is the routing
36
+ authority. Its routed extension refines comparison and falsification, declares
37
+ the classification artifact and stop, and names when promotion or implementation
38
+ belongs elsewhere. Use the exemption only when no trigger applies and cite its
39
+ evidence.
29
40
 
30
41
  ## Output
31
42
 
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 2,
3
+ "routes": [
4
+ {
5
+ "id": "behavior-preserving-movement",
6
+ "question": "What smallest behavior-preserving observation move distinguishes incidental similarity from a durable structural candidate?",
7
+ "trigger": "Duplication, parallel branches, repeated tests/UI states, conditionals, a recent refactor, change-relative coupling, or model-code mismatch needs consequential horizontal-versus-vertical classification.",
8
+ "method_step": "select one comparable pair and one smallest difference, state the observer, propose one falsifying local move, then classify no-signal, horizontal, vertical, or ambiguous",
9
+ "references": [
10
+ "references/structural-movement.md"
11
+ ],
12
+ "artifacts": [
13
+ "a comparison table with one smallest difference",
14
+ "a behavior-preserving observation move and relevant check",
15
+ "a bounded structural classification and candidate only when vertical or ambiguous"
16
+ ],
17
+ "stop": "The selected difference is exposed and classified without performing the movement or promoting a destination abstraction.",
18
+ "separate_when": "The move would change accepted behavior, the candidate already needs review/timing, or the next implementation step is already justified."
19
+ }
20
+ ],
21
+ "exemption": {
22
+ "when": "The evidence supports a direct no-signal or local structural observation with no consequential proposed movement, horizontal/vertical ambiguity, coupling analysis, or model-code mismatch.",
23
+ "evidence": [
24
+ "the exact observed artifact",
25
+ "the current pressure or absence of pressure",
26
+ "the bounded classification and why no experiment is needed"
27
+ ]
28
+ }
29
+ }