@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,112 @@
1
+ # Contract And Replacement Models
2
+
3
+ Use this reference after the general problem model when the unresolved question
4
+ is what callers may require, what implementations must guarantee, or whether a
5
+ new implementation can replace an old one for a declared observer.
6
+
7
+ ## Contract Relation
8
+
9
+ Model a callable or boundary as:
10
+
11
+ ```text
12
+ requires: facts the caller establishes
13
+ ensures: facts successful execution guarantees
14
+ invariant: facts preserved through relevant internal steps
15
+ failure: admitted error outcomes and when they become observable
16
+ observers: value, effects, order, errors, resource behavior, persisted/public form
17
+ ```
18
+
19
+ Composition is an implication check. If `A` calls `B`, facts established by `A`
20
+ must imply `B.requires`, and `B.ensures` must establish what the rest of `A`
21
+ needs. Locally correct contracts can still fail at their seam.
22
+
23
+ ## Replacement Relation
24
+
25
+ For existing callers, require at least:
26
+
27
+ ```text
28
+ old.requires => new.requires
29
+ new.ensures => old.ensures
30
+ ```
31
+
32
+ The new implementation must not demand more from old callers or promise less.
33
+ Apply the same relation to error behavior and every declared observer. Passing
34
+ old examples is sufficient only when those examples completely express the
35
+ chosen contract, which is uncommon.
36
+
37
+ For representation changes, write an abstraction or refinement mapping:
38
+
39
+ ```text
40
+ new representation/state/behavior
41
+ -> old abstract meaning observed by callers
42
+ ```
43
+
44
+ Every relevant new behavior must map to an admitted old behavior. Intermediate
45
+ states matter when callers can observe them.
46
+
47
+ ## Ability And Guarantee Check
48
+
49
+ A narrower enum, schema, or result type may strengthen guarantees while rejecting
50
+ previously valid input. Record:
51
+
52
+ ```text
53
+ old admitted ability:
54
+ new restriction:
55
+ guarantee gained:
56
+ old caller or stored value excluded:
57
+ explicit migration or breaking scope:
58
+ ```
59
+
60
+ Do not hide a breaking change behind the word `validation`.
61
+
62
+ ## Compatibility Beyond The Logical Contract
63
+
64
+ Actual systems may depend on behavior never written into the contract. Inspect:
65
+
66
+ - real callers and built consumers;
67
+ - persisted and serialized legacy forms;
68
+ - failure types and timing;
69
+ - ordering, effects, and resource observers;
70
+ - telemetry only as bounded evidence, never proof of absence;
71
+ - public documentation and known bugs that became de facto behavior.
72
+
73
+ Migration, rollout, coexistence, telemetry, and rollback protocols are Developer
74
+ adaptations. This model names their obligations but does not claim a source book
75
+ supplies a production procedure.
76
+
77
+ ## Artifact
78
+
79
+ ```text
80
+ Old requires / ensures / failures:
81
+ New requires / ensures / failures:
82
+ Declared observers:
83
+ Precondition implication:
84
+ Postcondition implication:
85
+ Refinement mapping:
86
+ Excluded old inputs or behaviors:
87
+ Actual caller and persistence evidence:
88
+ Compatibility decision or open policy:
89
+ Verification targets:
90
+ ```
91
+
92
+ ## Stop And Separation
93
+
94
+ Stop when every implication is supported, contradicted, or left as an explicit
95
+ compatibility question, and the observer set is named.
96
+
97
+ Hand off to `sketch` when adapters or a new boundary must be designed, to
98
+ `schedule` when migration timing is the question, and to `verify` when the model
99
+ exists but evidence for compatibility is missing.
100
+
101
+ ## Source Trace
102
+
103
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0:
104
+ Chapter 5, pp. 47-60, for contracts, composition, replacement, and accidental
105
+ observable behavior.
106
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
107
+ Interpretation of Computer Programs*, Second Edition:
108
+ Section 2.1
109
+ for abstraction mappings, representation laws, and observer-relative data
110
+ meaning.
111
+ - The explicit production compatibility inventory is a Developer adaptation of
112
+ those semantic obligations.
@@ -0,0 +1,89 @@
1
+ # Logic Query Semantics
2
+
3
+ Use this reference when facts and relations can yield zero, one, or many answers
4
+ and search behavior affects the meaning of an observed result.
5
+
6
+ ## Query Contract
7
+
8
+ State:
9
+
10
+ ```text
11
+ facts and derived rules
12
+ query variables
13
+ answer identity
14
+ derivation or proof identity
15
+ duplicate and aggregation policy
16
+ negation meaning
17
+ binding requirements
18
+ search order, fairness, and cycle policy
19
+ termination and resource bound
20
+ outcome vocabulary
21
+ ```
22
+
23
+ Different proofs may produce one domain answer. Decide whether aggregation uses a
24
+ set, bag, or proof count.
25
+
26
+ ## Negation And Failure
27
+
28
+ Negation-as-failure means the current knowledge base and search cannot derive the
29
+ goal. It is not classical falsehood about the world. Require variables used by
30
+ negation or host predicates to be bound when runtime meaning depends on binding
31
+ order.
32
+
33
+ Keep distinct:
34
+
35
+ ```text
36
+ answer
37
+ exhausted complete search
38
+ bounded unknown
39
+ timeout
40
+ language/runtime error
41
+ divergence before a later branch
42
+ ```
43
+
44
+ Failure to observe an answer proves absence only after a complete search
45
+ terminates conclusively.
46
+
47
+ ## Worked Shape
48
+
49
+ ```text
50
+ depends(api, domain)
51
+ depends(ui, api)
52
+ reachable(a, b) if depends(a, b)
53
+ reachable(a, c) if depends(a, b) and reachable(b, c)
54
+ ```
55
+
56
+ Query `reachable(ui, X)` must explain duplicate paths, cycles, answer identity,
57
+ and completion.
58
+
59
+ ## Artifact
60
+
61
+ ```text
62
+ Facts, rules, and query:
63
+ Answer versus proof identity:
64
+ Duplicate and aggregation policy:
65
+ Negation and binding semantics:
66
+ Search order, fairness, cycles, and termination:
67
+ Outcome states:
68
+ Known answer, duplicate, cycle, divergence, and no-answer cases:
69
+ ```
70
+
71
+ ## Stop And Separation
72
+
73
+ Stop when every observed empty/non-empty result has one defined interpretation
74
+ relative to search completion, duplicates, negation, and termination.
75
+
76
+ Use `planning-models` for legal action sequences toward a goal,
77
+ `solver-result-boundaries` for conclusive bounded status, and the `sketch`
78
+ language-semantics route when the query runtime must be designed.
79
+
80
+ ## Source Trace
81
+
82
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0:
83
+ Chapter 12, pp. 156-168, for zero/one/many answers, duplicates, negation,
84
+ search, and answer sets. Recorded Prolog and exercise defects are excluded.
85
+ - Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
86
+ Interpretation of Computer Programs*, Second Edition,
87
+ Section 4.4
88
+ for proof multiplicity, search order, closed-world negation, fairness, and
89
+ termination.
@@ -0,0 +1,75 @@
1
+ # Planning Models
2
+
3
+ Use this reference when the unresolved model is a legal sequence of actions from
4
+ an initial state to a goal, optionally ranked by cost.
5
+
6
+ ## Planning Contract
7
+
8
+ ```text
9
+ initial state
10
+ goal predicate
11
+ legal actions and preconditions
12
+ transition result
13
+ state invariant
14
+ optional action cost
15
+ plan equivalence
16
+ ```
17
+
18
+ Show every intermediate state. A plan is valid only when every action is enabled
19
+ and every intermediate state preserves the invariant.
20
+
21
+ ## Valid Is Not Preferred
22
+
23
+ A shortest plan under action count may not minimize risk, downtime, or version
24
+ skew. State the encoded objective and acceptable equal optima. Changing the cost
25
+ model can legitimately change the preferred plan without changing validity.
26
+
27
+ Failure to find a plan proves impossibility only when a complete search terminates
28
+ conclusively. Timeout, pruning, divergence, finite depth, or an omitted action
29
+ produce unknown or model gaps.
30
+
31
+ ## Worked Shape
32
+
33
+ ```text
34
+ state: servers with online/version
35
+ initial: all online at version 1
36
+ goal: all online at version 3
37
+ invariant: at least one server online
38
+ actions: takeOffline, upgrade, bringOnline
39
+ cost: action count plus optional version-skew penalty
40
+ ```
41
+
42
+ The artifact lists each intermediate state and checks the invariant before
43
+ comparing costs.
44
+
45
+ ## Artifact
46
+
47
+ ```text
48
+ Initial state and goal:
49
+ Actions, guards, and transitions:
50
+ State invariant:
51
+ Representative plan with intermediate states:
52
+ Invalid action or invariant-breaking plan:
53
+ Cost/objective and equivalent optima:
54
+ Search completeness and no-plan meaning:
55
+ Omitted actions or environmental assumptions:
56
+ ```
57
+
58
+ ## Stop And Separation
59
+
60
+ Stop when one valid and one invalid sequence are distinguishable, every
61
+ intermediate state is checked, and preferred/no-plan claims are relative to the
62
+ encoded objective and search completeness.
63
+
64
+ Use `temporal-behavior-models` when the question is all allowed histories rather
65
+ than one goal-directed sequence, `logic-query-semantics` for relational answer
66
+ semantics, and `solver-result-boundaries` for proven optimal or unsatisfiable
67
+ status.
68
+
69
+ ## Source Trace
70
+
71
+ - Hillel Wayne, *Logic for Programmers*, v0.14.0:
72
+ Chapters 11-12, pp. 139-168, for constraint planning, action sequences,
73
+ objective functions, and result boundaries. Recorded beta defects are excluded.
74
+ - The production rolling-upgrade example and operational risk objectives are
75
+ Developer adaptations; the source supplies the planning and search distinctions.