@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.
@@ -0,0 +1,306 @@
1
+ # Abstraction Review Worked Examples
2
+
3
+ Use these examples to calibrate the review output. Keep user-facing answers
4
+ shorter unless the user asks for the full card.
5
+
6
+ Examples are abbreviated to show the main decision move. For a serious review,
7
+ also include the field-card sections for source and confidence, contract, hidden
8
+ detail, evidence and gaps, and open consequences.
9
+
10
+ ## Contents
11
+
12
+ - Example Selector
13
+ - Skill Update Self-Review
14
+ - Provider Integration
15
+ - Retry Helper From Repeated Movement
16
+ - Optional Default Semantics
17
+ - Symbolic Expression Rewrite
18
+ - Stateful Account
19
+ - Chainable Builder
20
+
21
+ ## Example Selector
22
+
23
+ Use the smallest example that matches the candidate shape. Do not read the full
24
+ file unless calibration is still unclear.
25
+
26
+ | Candidate shape | Example to read |
27
+ | --- | --- |
28
+ | skill, workflow, recipe, or instruction update | Skill Update Self-Review |
29
+ | generic operation, plugin/provider, type/case expansion | Provider Integration |
30
+ | repeated helper movement with stable roles | Retry Helper From Repeated Movement |
31
+ | optional, nullable, defaulted, or legacy value meaning | Optional Default Semantics |
32
+ | expression, formula, DSL, parser, or rewrite rule | Symbolic Expression Rewrite |
33
+ | local state, hidden history, audit, replay, or concurrency | Stateful Account |
34
+ | fluent API, builder, pipeline, or chainable surface | Chainable Builder |
35
+
36
+ ## Skill Update Self-Review
37
+
38
+ ```text
39
+ Candidate:
40
+ abstraction-review skill update with field-card, recipe-cards, repair-table,
41
+ and worked examples
42
+
43
+ Pressure:
44
+ The first version only classified candidates by layer. It could still collapse
45
+ into polished advice without a concrete artifact or stop check.
46
+
47
+ Wish:
48
+ A future agent can review an abstraction by producing a contract, hidden
49
+ detail, output artifact, observable stop check, and unresolved consequences.
50
+
51
+ Layer:
52
+ Boundary + Engine + Run
53
+
54
+ Recipe:
55
+ Data Abstraction Boundary for owned responsibility
56
+ Dispatch Registration for reference routing
57
+ Procedure -> Process Reality Check for whether agents will actually use it
58
+
59
+ Input artifact:
60
+ SKILL.md procedure, reference list, and current reference files
61
+
62
+ Derivation:
63
+ core question -> public contract
64
+ references -> conditional reference choices
65
+ realistic invocation -> run evidence
66
+
67
+ Output artifact:
68
+ skill boundary:
69
+ owns abstraction promotion judgment
70
+ does not create the design surface, choose timing, implement, or perform
71
+ final completion review
72
+ reference selector:
73
+ field-card for substantial review
74
+ recipe-cards for construction rules
75
+ repair-table for failed stop checks
76
+ worked-examples for calibration
77
+
78
+ Stop:
79
+ Given a proposed API, workflow, or skill update, the agent produces a review
80
+ card with output artifact and stop check instead of only saying "looks good."
81
+
82
+ Decision:
83
+ keep with calibration gap if no realistic invocation has been run yet
84
+ revise-surface if the skill cannot say when to read each reference
85
+ revise-model if the review invariant or condition space is unclear
86
+ ```
87
+
88
+ ## Provider Integration
89
+
90
+ ```text
91
+ Candidate:
92
+ charge(provider, amount) as a generic operation
93
+
94
+ Pressure:
95
+ Each new provider edits old switch statements and leaks provider fields.
96
+
97
+ Layer:
98
+ Engine + Boundary
99
+
100
+ Recipe:
101
+ Dispatch Registration, then Data Abstraction Boundary
102
+
103
+ Input artifact:
104
+ providers x operations table
105
+
106
+ Derivation:
107
+ each current branch -> one (provider, operation) method cell
108
+
109
+ Output artifact:
110
+ registerProvider(provider, { charge, refund })
111
+ charge(provider, amount)
112
+ unsupported refund policy
113
+
114
+ Stop:
115
+ add fake provider without changing caller code
116
+
117
+ Decision:
118
+ keep if unsupported cases are explicit; otherwise revise-surface
119
+ ```
120
+
121
+ ## Retry Helper From Repeated Movement
122
+
123
+ ```text
124
+ Candidate:
125
+ withRetry(operation, shouldRetry, delayStrategy, maxAttempts)
126
+
127
+ Pressure:
128
+ Several request functions repeat the same movement: run operation, inspect
129
+ failure, wait, retry, eventually fail.
130
+
131
+ Layer:
132
+ Language + Unit
133
+
134
+ Recipe:
135
+ Movement Pattern Extraction, then Procedure -> Process Reality Check
136
+
137
+ Input artifact:
138
+ cases:
139
+ fetchProfile, submitPayment, syncInventory
140
+ common movement:
141
+ attempt -> classify failure -> delay -> retry or give up
142
+ variation roles:
143
+ operation, shouldRetry, delayStrategy, maxAttempts
144
+
145
+ Derivation:
146
+ common movement becomes the helper body
147
+ variation roles become parameters or strategy callbacks
148
+
149
+ Output artifact:
150
+ withRetry signature
151
+ role table for existing cases
152
+ process note for total attempts and delay behavior
153
+
154
+ Stop:
155
+ old cases are simple calls and a new retrying operation needs no new branch in
156
+ withRetry
157
+
158
+ Decision:
159
+ keep if variation roles are stable; reject if each case has different
160
+ responsibility or product semantics
161
+ ```
162
+
163
+ ## Optional Default Semantics
164
+
165
+ ```text
166
+ Candidate:
167
+ readConfig("timeout") returns configured timeout or fallback
168
+
169
+ Pressure:
170
+ Missing values are handled differently by producers and consumers.
171
+
172
+ Layer:
173
+ Law + Boundary
174
+
175
+ Recipe:
176
+ Data Abstraction Boundary, then Meaning-Preserving Path
177
+
178
+ Input artifact:
179
+ states: missing / null / empty / configured / legacy
180
+ owner: producer / constructor / consumer fallback
181
+
182
+ Derivation:
183
+ decide which states preserve the same meaning and which are unsupported
184
+
185
+ Output artifact:
186
+ absence/default policy:
187
+ missing means <x>
188
+ null means <y>
189
+ fallback owner is <layer>
190
+ consumer fallback is defensive unless explicitly owned
191
+
192
+ Stop:
193
+ each state has one meaning, one enforcement layer, and one test target
194
+
195
+ Decision:
196
+ revise-model if missing/null/legacy meanings are not decided yet
197
+ ```
198
+
199
+ ## Symbolic Expression Rewrite
200
+
201
+ ```text
202
+ Candidate:
203
+ simplify(expression)
204
+
205
+ Pressure:
206
+ Rewrite rules are tied to list indexes or string positions.
207
+
208
+ Layer:
209
+ Language + Boundary
210
+
211
+ Recipe:
212
+ Notation As Data, then Data Abstraction Boundary
213
+
214
+ Input artifact:
215
+ expression cases: number, variable, sum, product
216
+
217
+ Derivation:
218
+ cases -> predicates; parts -> selectors; new expressions -> constructors
219
+
220
+ Output artifact:
221
+ isSum, addend, augend, makeSum
222
+ isProduct, multiplier, multiplicand, makeProduct
223
+
224
+ Stop:
225
+ rewrite rules use selectors/constructors, not raw layout
226
+
227
+ Decision:
228
+ keep after constructors own simplification policy; otherwise split policy
229
+ ```
230
+
231
+ ## Stateful Account
232
+
233
+ ```text
234
+ Candidate:
235
+ makeAccount(initialBalance).withdraw(amount)
236
+
237
+ Pressure:
238
+ Same method call can produce different results after previous calls.
239
+
240
+ Layer:
241
+ Time
242
+
243
+ Recipe:
244
+ History Placement
245
+
246
+ Input artifact:
247
+ required history: transaction sequence
248
+ sufficient summary: current balance
249
+ interaction model: single actor or concurrent actors
250
+
251
+ Derivation:
252
+ decide whether balance can be hidden local state or must be explicit stream/log
253
+
254
+ Output artifact:
255
+ balance is hidden summary of accepted transactions
256
+ transaction log is required if audit/replay/collaboration matters
257
+
258
+ Stop:
259
+ caller contract states whether history is hidden or explicit
260
+
261
+ Decision:
262
+ keep for single-actor local state; revise-model if concurrency/audit matters
263
+ ```
264
+
265
+ If concurrent withdrawals appear, run Event Order Protection:
266
+
267
+ ```text
268
+ order law:
269
+ read balance, decide sufficient funds, write new balance is one protected unit
270
+
271
+ stop:
272
+ forbidden interleaving cannot violate balance invariant
273
+ ```
274
+
275
+ ## Chainable Builder
276
+
277
+ ```text
278
+ Candidate:
279
+ query.where(...).orderBy(...).limit(...).execute()
280
+
281
+ Pressure:
282
+ Most operations compose, but execute leaves the query world.
283
+
284
+ Layer:
285
+ Unit + Boundary
286
+
287
+ Recipe:
288
+ Closure Composition Unit
289
+
290
+ Input artifact:
291
+ query unit, closed operations, finalizers
292
+
293
+ Derivation:
294
+ mark where/orderBy/limit as Query -> Query
295
+ mark execute as Query -> Result
296
+
297
+ Output artifact:
298
+ closed query builder vocabulary
299
+ explicit finalizer boundary
300
+
301
+ Stop:
302
+ all builder operations return Query; execute is intentionally outside
303
+
304
+ Decision:
305
+ keep if finalizer is not hidden as another closed operation
306
+ ```
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: adversarial-eval
3
+ description: "Design and run finite adversarial evaluations for Pi skills, packages, agent workflows, or implementation claims using exact source provenance, escalating counterexamples, hidden checks, failure classification, and a marginal-value stop rule. Use when ordinary checks may miss real workflow, compatibility, or pass-but-wrong failures."
4
+ ---
5
+
6
+ # Adversarial Eval
7
+
8
+ Design and run the smallest evaluation that can falsify the target claim.
9
+
10
+ ## Core Question
11
+
12
+ What adversarial evidence would expose the target's real failure modes?
13
+
14
+ ## Inputs
15
+
16
+ - Target, exact source or version, and falsifiable claims
17
+ - Existing tests, transcripts, reports, diffs, or recent failures
18
+ - Likely pass-but-wrong shapes and compatibility hazards
19
+ - Cost, time, mutation, and safety limits
20
+
21
+ ## Output
22
+
23
+ Lead with the target claim and observed failure mode; keep eval labels secondary.
24
+ Produce target provenance, claims and risk model, an escalating fixture ladder,
25
+ execution matrix, observed feedback, failure taxonomy, stop rule, and residual
26
+ risks. When used inside a larger task, return:
27
+
28
+ ```text
29
+ Status: resolved | needs-evidence | not-applicable | blocked
30
+ Result: evidence for or against the exact evaluated claim
31
+ Basis: fixtures, commands, transcripts, provenance, and observations
32
+ Open questions: untested failure modes or source gaps, or none
33
+ Artifacts: fixtures, execution matrix, feedback, and stop decision
34
+ ```
35
+
36
+ When reporting multiple claims or rounds, keep the local evidence auditable:
37
+
38
+ | Claim | Fixture or verifier | Observation | Classification | Residual |
39
+ | --- | --- | --- | --- | --- |
40
+
41
+ Use only the failure classes defined below. This table records evaluation
42
+ evidence; it does not choose another capability.
43
+
44
+ Return only this skill's judgment for the question at hand; leave subsequent
45
+ routing to the caller.
46
+
47
+ ## Completion
48
+
49
+ Finish when the highest-risk failure modes have been exercised, the last useful
50
+ round no longer changes a patch or decision, or the next round's expected
51
+ information is lower than its cost. Revisit after a new source version, failure
52
+ class, user regression, or compatibility path appears.
53
+
54
+ ## Method
55
+
56
+ 1. Bind the target to its requested and actual source or version.
57
+ 2. State a falsifiable behavioral claim.
58
+ 3. Build a risk model from likely hidden conditions, stale source, human-owned
59
+ decisions, mutation scope, and pass-but-wrong behavior.
60
+ 4. Choose the smallest useful ladder:
61
+ - `smoke`: metadata, syntax, manifest, or command health;
62
+ - `visible`: straight-line baseline behavior;
63
+ - `hidden-parent`: stronger local invariants and artifact checks;
64
+ - `adversarial`: ambiguous, conflicting, stale, stateful, or nested cases;
65
+ - `compatibility`: requested source versus actually loaded source;
66
+ - `gate-residual`: evidence or acceptance that must remain unresolved.
67
+ 5. For each round, state the claim, fixture, verifier, expected evidence,
68
+ failure meaning, mutation scope, and stop condition.
69
+ 6. Run each round within the declared mutation and safety limits, preserving
70
+ exact command, fixture, source, and observation provenance.
71
+ 7. Classify results as `pass`, `implementation-fail`, `model-or-spec-fail`,
72
+ `verifier-gap`, `blocked-environment`, `pass-but-wrong-risk`, or
73
+ `structural-degradation`.
74
+ 8. Add or rerun a round only when it can change the target claim or decision.
75
+
76
+ ## Missing Evidence
77
+
78
+ Return `needs-evidence` when a concrete fixture or exact-source run is still
79
+ available. Return `not-applicable` when the claim is not falsifiable. Return
80
+ `blocked` when the requested source or environment was not actually exercised.
81
+ Never count evidence from a mismatched source as a target failure.
82
+
83
+ ## Boundary
84
+
85
+ Do not import the target workflow's responsibilities, repair the evaluated
86
+ target, exceed the declared fixture mutation scope, or present evaluation
87
+ evidence as release approval.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: model
3
+ description: "Model the condition space behind a requirement, invariant, bug, policy, workflow, or code behavior using cases, predicates, rules, forbidden states, transitions, objectives, guarantee placement, and verification targets. Use when correctness depends on combinations, absence or default semantics, state, time, or policy interaction."
4
+ ---
5
+
6
+ # Model
7
+
8
+ Expose the condition space a valid implementation must satisfy.
9
+
10
+ ## Core Question
11
+
12
+ Which cases, rules, states, or transitions make the claim precise?
13
+
14
+ ## Inputs
15
+
16
+ - Requirement, invariant, policy, workflow, or code behavior
17
+ - Existing cases, tests, examples, and counterexamples
18
+ - Data shapes, states, transitions, and external constraints when relevant
19
+
20
+ ## Output
21
+
22
+ Lead with the user's product language; keep modeling labels secondary.
23
+ Produce the lightest useful model: domain, predicates or cases, facts, rules,
24
+ forbidden cases, transitions or objectives when relevant, guarantee placement,
25
+ and verification targets. When used inside a larger task, return:
26
+
27
+ ```text
28
+ Status: resolved | needs-evidence | not-applicable | blocked
29
+ Result: the condition model and its main consequences
30
+ Basis: requirement, invariant, code, tests, and explicit assumptions
31
+ Open questions: unresolved policy or evidence gaps, or none
32
+ Artifacts: case table, rules, transitions, or verification targets
33
+ ```
34
+
35
+ Return only this skill's judgment for the question at hand; leave subsequent
36
+ routing to the caller.
37
+
38
+ ## Completion
39
+
40
+ Finish when plausible counterexamples can be classified by the model and each
41
+ important rule has an observable verification target. Revisit when new cases,
42
+ states, transitions, or policy decisions invalidate the model.
43
+
44
+ ## Method
45
+
46
+ 1. Use an accepted invariant when available; otherwise label a provisional one.
47
+ 2. Choose the lightest sufficient depth:
48
+ - `light`: cases, constraints, and verification targets;
49
+ - `structured`: explicit rules, forbidden states, or transitions;
50
+ - `formal`: exhaustive combinations, temporal behavior, or solver-like
51
+ constraints when the cost of omission justifies it.
52
+ 3. Separate facts, decisions, assumptions, properties, and helper predicates.
53
+ 4. Make missing, undefined, null, empty, legacy, and configured states explicit
54
+ when absence matters. Name the policy owner and misplaced-default cases.
55
+ 5. Model transitions separately from current-state validity when order matters.
56
+ 6. Place each guarantee at the appropriate type, boundary, validation, test,
57
+ property, proof, model check, or human decision.
58
+ 7. Derive verification targets and the counterexample each target should catch.
59
+
60
+ ## Missing Evidence
61
+
62
+ Return `needs-evidence` when code, data, or examples can settle a case. Return
63
+ `blocked` when resolving the model would require inventing product policy.
64
+ Return `not-applicable` when no consequential condition space remains to model.
65
+ Keep provisional rules visibly provisional.
66
+
67
+ ## Boundary
68
+
69
+ Do not decide product scope, design the implementation surface, schedule
70
+ structural work, mutate artifacts, or make the final evidence judgment.
71
+
72
+ ## References
73
+
74
+ Read [the problem-modeling reference](references/problem-modeling.md) for
75
+ policy-heavy, stateful, optimization, safety-critical, or otherwise complex
76
+ condition spaces.