@hobin/developer 0.1.7 → 0.1.9

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 +212 -355
  2. package/REFERENCE_ROUTING.md +243 -0
  3. package/extensions/developer.ts +601 -23
  4. package/extensions/machine.ts +45 -0
  5. package/extensions/references/behavior-preserving-structural-change.md +87 -8
  6. package/extensions/skills.ts +330 -52
  7. package/extensions/state.ts +227 -2
  8. package/extensions/tool-policy.ts +87 -0
  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,84 @@
1
+ # Runtime And Compilation
2
+
3
+ Use this reference after [Language Semantics](language-semantics.md) when the
4
+ accepted language must be interpreted, lowered, compiled, optimized, or mixed
5
+ across execution modes.
6
+
7
+ ## Execution Convention
8
+
9
+ ```text
10
+ inputs and result location
11
+ control/continuation owner
12
+ state modified and state live across nested work
13
+ error/cancellation transfer
14
+ allocation roots, identity, and release
15
+ interpreted/compiled or old/new interoperation
16
+ ```
17
+
18
+ A language contract does not implement this convention; the runtime must preserve
19
+ its declared observers.
20
+
21
+ ## Effect Summaries
22
+
23
+ Attach conservative summaries to generated fragments:
24
+
25
+ ```text
26
+ needs | modifies | allocates | performs | may-fail
27
+ ```
28
+
29
+ A composition may omit a save, lookup, or check only when the summary proves it
30
+ unneeded. Missing an effect can produce pass-but-wrong execution;
31
+ over-approximating usually loses optimization.
32
+
33
+ ## Optimization Guard
34
+
35
+ ```text
36
+ assumption:
37
+ proof or runtime guard:
38
+ fallback:
39
+ observers preserved:
40
+ ```
41
+
42
+ Lexical addressing, primitive inlining, or direct transfer must preserve scope,
43
+ rebinding, evaluation order, errors, effects, and tail-space promises. Tail calls
44
+ require direct control transfer without a frame retained solely for return.
45
+
46
+ Mixed execution requires a shared calling convention or an explicit adapter.
47
+ State the complete root set, object identity across movement, external handles,
48
+ capacity, release, and out-of-memory behavior.
49
+
50
+ ## Artifact
51
+
52
+ ```text
53
+ Source language observers:
54
+ Calling and result convention:
55
+ Control, live state, save/restore, error, and cancellation:
56
+ Effect summaries:
57
+ Optimization assumptions, guards, and fallback:
58
+ Tail-space obligation:
59
+ Roots, identity, capacity, handles, and release:
60
+ Interoperation adapter:
61
+ Trace or generated-fragment check:
62
+ ```
63
+
64
+ ## Stop And Separation
65
+
66
+ Stop when a representative nested call and optimized fragment preserve the
67
+ accepted language observers under explicit guards, and roots/release/interoperation
68
+ are complete enough to falsify runtime claims.
69
+
70
+ Return to `language-semantics` when program meaning remains unsettled. Use
71
+ `process-shape-and-resources` for ordinary non-language process boundaries.
72
+
73
+ ## Source Trace
74
+
75
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
76
+ Interpretation of Computer Programs*, Second Edition:
77
+ Section 5.1,
78
+ Section 5.3,
79
+ Section 5.4,
80
+ and Section 5.5
81
+ for calling conventions, explicit control, effect/liveness summaries, roots,
82
+ tail calls, compilation guards, and mixed execution.
83
+ - Validation taxonomies, migrations, production capacity, and rollout protocols
84
+ are Developer adaptations, not SICP claims.
@@ -0,0 +1,76 @@
1
+ # Selection And Creation
2
+
3
+ Use this reference when the accepted design must decide which concrete variant to
4
+ construct or supply at a boundary.
5
+
6
+ ## Selection Policy
7
+
8
+ State:
9
+
10
+ ```text
11
+ available variants and selection input
12
+ owner of dispatch key
13
+ predicate overlap and precedence
14
+ conflict/duplicate policy
15
+ unsupported case
16
+ visibility and load order
17
+ ```
18
+
19
+ Moving predicates into data or registration relocates precedence ownership; it
20
+ does not remove it.
21
+
22
+ ## Creation Continuum
23
+
24
+ Compare:
25
+
26
+ ```text
27
+ local conditional
28
+ configurable mapping
29
+ registration
30
+ self-registration
31
+ automatic discovery
32
+ ```
33
+
34
+ For each mechanism ask who knows variants, how a new one appears, how duplicates
35
+ and unsupported cases fail, and which reflection, naming, startup, deployment,
36
+ and test assumptions it adds.
37
+
38
+ Choose the least powerful mechanism satisfying real extension pressure. Moving
39
+ creation to the composition edge keeps concrete names out of domain collaboration
40
+ but does not eliminate selection responsibility or automatically eliminate a
41
+ factory.
42
+
43
+ ## Artifact
44
+
45
+ ```text
46
+ Accepted creation pressure:
47
+ Variants and selection input:
48
+ Selection owner:
49
+ Overlap, precedence, duplicate, unsupported, and load-order policy:
50
+ Creation mechanism and assumptions:
51
+ Local conditional/mapping/registration/discovery comparison:
52
+ Fake variant and startup-failure checks:
53
+ Deferred openness:
54
+ ```
55
+
56
+ ## Stop And Separation
57
+
58
+ Stop when selection has one owner, conflicts and failures are visible, and the
59
+ creation mechanism is no more open or operationally powerful than accepted
60
+ pressure requires.
61
+
62
+ Use `variation-roles-and-transitions` when the caller role itself is unresolved,
63
+ `generic-dispatch-systems` for a full representation-operation matrix, and
64
+ `abstraction-review` for promotion of a concrete factory/registry boundary.
65
+
66
+ ## Source Trace
67
+
68
+ - Sandi Metz, Katrina Owen, and TJ Stankus, *99 Bottles of OOP*, Second Edition,
69
+ v2.2.2, Chapters 6-8, pp. 155-225, for factories, dependency inversion,
70
+ creation at the edge, forwarding, and the distinction between moving creation
71
+ and eliminating a factory.
72
+ - Zachary Tellman, *Elements of Clojure*, Leanpub 2019-02-11, Indirection,
73
+ public-manuscript pp. 64-69 and 90-95, for ordered dispatch conflicts,
74
+ openness cost, participant pressure, and interface calcification.
75
+ - Automatic discovery, startup visibility, and deployment checks are Developer
76
+ adaptations of those boundaries.
@@ -0,0 +1,126 @@
1
+ # State, History, And Order
2
+
3
+ Use this reference when identical explicit inputs can produce different outcomes
4
+ because of prior interactions, identity, aliases, event order, or retained
5
+ history.
6
+
7
+ ## State Is A History Summary
8
+
9
+ ```text
10
+ account.withdraw(40) -> Accepted
11
+ account.withdraw(40) -> Rejected
12
+ ```
13
+
14
+ If history explains the difference, fill:
15
+
16
+ ```text
17
+ required history
18
+ sufficient current summary
19
+ owner and writers
20
+ identity and aliases
21
+ transition law
22
+ persistence or replay boundary
23
+ ```
24
+
25
+ Do not store the whole past when a sufficient summary preserves all required
26
+ behavior. Do not claim a summary is sufficient when audit, replay, merge, or
27
+ causal evidence is a product requirement.
28
+
29
+ ## Explicit Transition Surface
30
+
31
+ ```text
32
+ Payment = Created | Authorizing(attempt, requestId)
33
+ | Authorized(id) | Failed(reason)
34
+
35
+ transition(Created, Authorize) -> Authorizing(1, requestId)
36
+ transition(Authorizing(_, current), Approved(stale)) -> unchanged
37
+ transition(Authorizing(_, current), Approved(current)) -> Authorized(id)
38
+ ```
39
+
40
+ State events, guards, next states, unchanged fields, invalid events, and
41
+ idempotency. A correct enum without transitions is not a correct history model.
42
+
43
+ Cover stale, duplicate, reordered, retried, and concurrent events. If those rules
44
+ are still product policy, return to `model` rather than choosing a mechanism.
45
+
46
+ ## Identity, Aliases, And Mutation Graphs
47
+
48
+ Equal current values may denote different histories. Multiple references may
49
+ observe the same mutation. Record:
50
+
51
+ - identity rule;
52
+ - alias sources and newly introduced sharing edges;
53
+ - cycle and visited-scope policy;
54
+ - which transitions preserve or break sharing;
55
+ - cache or denormalized-field consistency.
56
+
57
+ A local mutation is modular only when a coherent history owner and its observer
58
+ boundary remain clear.
59
+
60
+ ## Event Order And Atomicity
61
+
62
+ State the smallest required order law. For withdrawal:
63
+
64
+ ```text
65
+ read balance -> check funds -> write next balance
66
+ ```
67
+
68
+ must behave as one protected transition for one account. Do not begin with
69
+ “serialize everything.” Choose lock, transaction, queue, compare-and-swap, or
70
+ merge only after naming the forbidden interleaving, cross-resource scope,
71
+ waiting cost, and progress obligation.
72
+
73
+ Per-object protection cannot preserve an invariant spanning several resources
74
+ unless the coordination scope spans them or the model permits convergence.
75
+
76
+ ## Streams And Logs
77
+
78
+ ```text
79
+ events -> fold(transition, initialState) -> currentState
80
+ ```
81
+
82
+ A log exposes history for replay, audit, merge, or time travel, but adds ordering,
83
+ versioning, retention, identity, and reconstruction costs. A stream of states and
84
+ an event log are different contracts.
85
+
86
+ For delayed streams record demand, memoization, producer/consumer pace, buffer or
87
+ backpressure, replayability, retained prefixes, effects, failure, and
88
+ cancellation. Laziness moves time obligations; it does not remove them.
89
+
90
+ ## Artifact
91
+
92
+ ```text
93
+ Required history and sufficient summary:
94
+ Owner, writers, identity, and aliases:
95
+ States, events, transitions, and unchanged fields:
96
+ Stale, duplicate, retry, reorder, and invalid policy:
97
+ Order/atomicity law and forbidden interleaving:
98
+ Cross-resource coordination scope:
99
+ Stream/log meaning, demand, retention, and replay:
100
+ Alternative local-state or explicit-history representation:
101
+ Checks and residual policy:
102
+ ```
103
+
104
+ ## Stop And Separation
105
+
106
+ Stop when the state representation explains every admitted history, one owner
107
+ controls each transition, and order/identity/log observers are explicit.
108
+
109
+ Use `process-shape-and-resources` for wait, capacity, stack, or lifetime without
110
+ product history; return to `model/temporal-behavior-models` when allowed histories
111
+ or fairness remain unresolved; use `verify` when the design exists but traces are
112
+ not exercised.
113
+
114
+ ## Source Trace
115
+
116
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
117
+ Interpretation of Computer Programs*, Second Edition:
118
+ Section 3.1,
119
+ Section 3.3,
120
+ Section 3.4, and
121
+ Section 3.5
122
+ for history, identity, mutation graphs, concurrency, streams, demand, and
123
+ memoization.
124
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0, Chapters 9-10, calibrates
125
+ state/action, stale event, safety/progress, and refinement distinctions; the
126
+ accepted temporal policy itself remains owned by `model`.
@@ -0,0 +1,54 @@
1
+ # Type Transitions
2
+
3
+ Use this reference when an accepted event or operation transforms one domain type
4
+ into another and the design must preserve meaning across the boundary.
5
+
6
+ ## Transition Contract
7
+
8
+ ```text
9
+ source type
10
+ triggering operation or event
11
+ target type
12
+ preconditions
13
+ meaning preserved
14
+ source facts consumed or retained
15
+ boundary or terminal behavior
16
+ failure result
17
+ who selects or constructs the target
18
+ ```
19
+
20
+ A transition that does not preserve a common role may require an explicit result
21
+ type rather than inheritance. The target should not select itself when the needed
22
+ selection knowledge belongs to a caller or creation boundary.
23
+
24
+ ## Artifact
25
+
26
+ ```text
27
+ Source and target types:
28
+ Event/operation and preconditions:
29
+ Preserved meaning:
30
+ Consumed, retained, and newly created facts:
31
+ Terminal/boundary behavior:
32
+ Failure and unsupported transitions:
33
+ Selection/construction owner:
34
+ Transition examples and checks:
35
+ ```
36
+
37
+ ## Stop And Separation
38
+
39
+ Stop when every accepted source state has one explicit target/failure meaning and
40
+ preserved facts can be checked without relying on representation coincidence.
41
+
42
+ Use `variation-roles` when several implementations share one protocol,
43
+ `selection-and-creation` when target selection is independently unresolved, and
44
+ `model/temporal-behavior` when order among transitions remains product policy.
45
+
46
+ ## Source Trace
47
+
48
+ - Sandi Metz, Katrina Owen, and TJ Stankus, *99 Bottles of OOP*, Second Edition,
49
+ v2.2.2, Chapters 6-7, pp. 155-187, for type transitions, target selection, and
50
+ the boundary between polymorphic role and a changed type.
51
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
52
+ Interpretation of Computer Programs*, Second Edition,
53
+ Section 2.5
54
+ calibrates operations whose results move between representation systems.
@@ -0,0 +1,59 @@
1
+ # Variation Roles
2
+
3
+ Use this reference when accepted variants may share one caller protocol without
4
+ exposing concrete type.
5
+
6
+ ## Role And Substitution
7
+
8
+ State:
9
+
10
+ ```text
11
+ caller messages
12
+ preconditions
13
+ result meaning
14
+ failure outcomes
15
+ effects and ordering
16
+ unsupported cases
17
+ implementations
18
+ ```
19
+
20
+ Every implementation must preserve caller expectations. A variant requiring
21
+ stronger inputs or producing different result/effect meaning may need a narrower
22
+ role.
23
+
24
+ Conditionals remain appropriate when variants are local, finite, readable, and
25
+ owned together. Polymorphism is justified when accepted variants repeatedly
26
+ force old behavior owners to change and callers can remain ignorant of concrete
27
+ types.
28
+
29
+ ## Artifact
30
+
31
+ ```text
32
+ Accepted variation pressure:
33
+ Caller role contract:
34
+ Implementations:
35
+ Precondition/result/failure/effect substitution checks:
36
+ Unsupported cases:
37
+ Direct-conditional alternative:
38
+ Transfer implementation:
39
+ Deferred variants:
40
+ ```
41
+
42
+ ## Stop And Separation
43
+
44
+ Stop when every admitted implementation substitutes for all declared observers
45
+ and one transfer implementation fits without adding a type test or flag to the
46
+ caller contract.
47
+
48
+ Use `type-transitions` when one domain type becomes another,
49
+ `selection-and-creation` when choosing/constructing a variant is independent,
50
+ and `model/contract-replacement` when role compatibility itself is disputed.
51
+ Route a shaped role candidate to `abstraction-review` for promotion.
52
+
53
+ ## Source Trace
54
+
55
+ - Sandi Metz, Katrina Owen, and TJ Stankus, *99 Bottles of OOP*, Second Edition,
56
+ v2.2.2, Chapters 5-6, pp. 102-170, for responsibility separation, role
57
+ substitution, and polymorphic movement.
58
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0, Chapter 5, pp. 47-60,
59
+ calibrates caller-contract replacement and observer-relative preservation.
@@ -11,6 +11,19 @@ Map evidence to claims without turning green checks into broader proof.
11
11
 
12
12
  What claims does the available evidence support?
13
13
 
14
+ ## Judgment Spine
15
+
16
+ ```text
17
+ claim and observer
18
+ -> cheapest relevant falsifier
19
+ -> executed evidence and provenance
20
+ -> plausible pass-but-wrong implementation
21
+ -> strongest supported claim + explicit residual
22
+ ```
23
+
24
+ Green execution is only an observation until relevance and counterexample
25
+ coverage connect it to the claim.
26
+
14
27
  ## Inputs
15
28
 
16
29
  - Claims under review
@@ -20,12 +33,10 @@ What claims does the available evidence support?
20
33
 
21
34
  ## Reference Routing
22
35
 
23
- Read [the verifier selection and pass-but-wrong reference](references/verifier-selection-and-pass-but-wrong.md)
24
- when several claims need different evidence, a passing command may not exercise
25
- the accepted meaning, source compatibility matters, or behavior can pass while
26
- structure degrades. Also read it before a consequential completion claim whose
27
- verifier relevance or residual risk is unclear. A narrow claim with direct,
28
- relevant evidence does not need the reference.
36
+ The machine-readable [reference policy](reference-policy.json) is the routing
37
+ authority. Its routed extension refines claim splitting, verifier relevance, and
38
+ pass-but-wrong search, then declares the evidence artifact, stop, and handoff.
39
+ Use the exemption only when no trigger applies and cite its evidence.
29
40
 
30
41
  ## Output
31
42
 
@@ -0,0 +1,30 @@
1
+ {
2
+ "version": 2,
3
+ "routes": [
4
+ {
5
+ "id": "claim-evidence-gap",
6
+ "question": "What strongest claim does the executed evidence support after relevance and pass-but-wrong risk are considered?",
7
+ "trigger": "Several claims need different evidence, a green check may not exercise accepted meaning, source/version compatibility matters, behavior can pass while structure degrades, or a consequential completion claim has unclear verifier relevance or residual risk.",
8
+ "method_step": "split claims and observers, choose the cheapest falsifier, inspect execution/provenance, attempt a plausible wrong implementation, then narrow the supported claim",
9
+ "references": [
10
+ "references/verifier-selection-and-pass-but-wrong.md"
11
+ ],
12
+ "artifacts": [
13
+ "a claim/evidence/relevance matrix",
14
+ "requested-versus-exercised provenance",
15
+ "a plausible wrong shape, distinguishing check, strongest supported claim, and residual"
16
+ ],
17
+ "stop": "Every claim is supported, narrowed, contradicted, or explicitly unverified, and another verifier costs more than its expected information.",
18
+ "separate_when": "The claim itself or admitted model is unresolved, implementation repair is requested, or remaining acceptance is human-owned; hand off rather than broadening evidence."
19
+ }
20
+ ],
21
+ "exemption": {
22
+ "when": "One narrow claim has direct, relevant, source-matched evidence, no consequential structural observer, and no plausible cheap pass-but-wrong shape.",
23
+ "evidence": [
24
+ "the exact claim and observer",
25
+ "the directly relevant executed check",
26
+ "the source/version exercised",
27
+ "the attempted counterexample and bounded residual"
28
+ ]
29
+ }
30
+ }