Property Testing in Delivery Brainstorm Brief
Property Testing in Delivery Brainstorm Brief
Status: brainstorm closed on 2026-10-28 with the user and Manuel (SWE,
computation theory). Reopened and closed again on 2026-10-29 to add the
five engineering principles and TLA-ts. Input to requirements-phase. No
implementation has started.
1. Bounded System and Operators
- System. The Harness delivery skills that shape and run tests and
designs:
requirements-grill,create-architecture,create-spec,create-plan(TDD shaping and plan schema),implement-specwithtdd,review-phase(Spec Axis),make-tsuite,domain-modeling,wait-what, and theeffectskill. The skills' source iswearedevpunks/skills(local checkout~/repos/skills, branchmain). - Operators. Agents run these skills in consumer repositories (ci-app, apito, emera-platform). Humans approve specs and plans.
- Target languages. TypeScript (Effect) first. Python is an open fork (§5).
- Governing principles. The HI stack keeps Matt Pocock's five principles solid: Automated Review, Codebase Design, DDD & Ubiquitous Language, Mutation Testing, Feedback Loops.
2. Chosen Shape
A. Property testing through the pipeline
A human-approved rule moves down the pipeline until a test or a model enforces it:
requirements-grillaxioms carry a "checkable as" pattern hint.create-specrecords an invariant table: rule → pattern → seam.create-plantasks carrytest_formandinvariant_refs.tddgets aproperties.mdreference: the pattern catalog and the spec signals that select each pattern, the order inside a slice, no generator narrowing, and replay evidence.review-phaseSpec Axis checks that each invariant is covered in its declared form, and that any generator narrowing or rule loosening has recorded approval.make-tsuitemerges a group of example tests that differ only in their inputs into one property.- The
effectskill teachesSchema→Arbitrary→it.effect.prop, plus a stateful property: a Schema array of tagged commands run against a fresh fixture per evaluation.
Pattern catalog: preservation, equivalence, round-trip, membership/monotonic, idempotence, security gate, oracle, no defects, and stateful command sequence.
B. Model checking with tsprover + tla-ts (T1–T5)
- T1. Model checking returns, through
tsprover(TypeScript models,*.proof.ts) andtla-ts(TLC-compatible checker, no JVM), each at a pinned exact version. - T2.
create-architecturegets a model step. Trigger: two or more writers on shared state, a background job or retry that touches client-written state, recovery or resync, or a delivery guarantee. A violation trace returns as a compile gap torequirements-grill. - T3. A model lives next to the Effect service or feature it models,
scoped to one service; the composition file is the map. CI runs
tsproveron committed models and a violation fails CI. - T4. Each model counterexample trace becomes a Pinned Replay of a
stateful property on the real code (
tdd/properties.md). - T5. Acceptance pilot: the ci-app #402 entity change log and SSE resync, modeled before it ships.
C. Mutation testing as a Sensitivity Proof (P1)
A test that passes on its first run (a property against existing code, a
characterization test, a model invariant) counts as evidence only with a
Sensitivity Proof: a named mutant makes it fail, a diff against the pristine
file proves the mutant landed, and a revert diff proves the file is clean
again. It goes into tdd, tdd/properties.md and make-tsuite.
D. tdd alignment with upstream (P2 + refactor move)
- Add the upstream Tautological anti-pattern, with the oracle-property warning.
- Move refactoring out of the
tddloop, as upstream did; refactoring belongs to the per-task$simplifystep and to review.
E. Glossary path (P3)
Fix the gap between skills that read GLOSSARY.md and HI's wiki-hosted
glossaries (ask-hi/references/known-gaps.md:14). In scope for this
delivery.
3. Rejected Shapes
- Binary-level proof (Anthropic/Theorem method). V8 and CPython are too large and too dynamic.
- A proved twin in Lean, Dafny or Rocq. Too costly for bugs that are mostly lifecycle, environment and concurrency errors.
- LemmaScript. User: "confirmed no lemmascript". It is a tech preview,
cannot model real
await, and modelsnumberas an integer. - Quint. Superseded by tsprover + tla-ts: the same TLA+ semantics with TypeScript models and no new language.
- Tool-based mutation testing (P5, for example Stryker or mutmut).
Parked until a
make-tsuiteaudit needs a mutation score. - Full upstream drift adoption of
tdd,codebase-designanddomain-modeling(P4). Parked as a separate delivery; only §2.D comes in now.
4. User-Stated Preferences
- "we are to expand on how to encode this into tdd and the overall
delivery-phase skills, and to include guidance in
effectskill so we instruct about schema and arbitrary and it.effect.prop for property testing" - "ok then. we only go for property testing" (2026-10-28; superseded for model checking on 2026-10-29)
- "i agree with this" (the candidate set C1–C4, C7, C9, plus stateful properties).
- "so lets make sure that hour whole HI-stack keeps these principles solid and sound."
- "we could try reopening the formal verification thing (we discarded since it was java runtime based) and understand how it can be useful for us, where it can fit"
- On TLA-ts: T1 "yes good", T2 "yes", T3 "yes"; on the whole candidate set: "good agree all".
- On the glossary gap: "yes lets fix glossary path".
- On Tautological and the refactor move: "integrate these into our tdd then".
- On mutation testing: "ok lets fix this. how?"
- Manuel (Granola notes): "These patterns can be encoded into a skill so the AI knows where to apply property testing automatically."
5. Open Forks
- F1 Order inside a slice. Default: example tracer bullet first, then the property as a generalisation step. A pure total function may start with the property.
- F2 Run policy for properties. Default: CI runs every property. Pure properties use the default run count and DB-backed ones a reduced count. Each found counterexample becomes a pinned replay. Deep runs happen locally at RED/GREEN. Manuel proposed running properties locally only.
- F3 Proof of value. Default: one throwaway bug replay as acceptance evidence, plus the T5 pilot.
- F4 Python. Default: in scope. Add a pointer and Hypothesis specifics
to
python-testing-patterns. - F11 Sensitivity Proof scope. Default: every test that passes on its first run, every new property and every committed model invariant.
- Planning input for
create-plan, not a grill fork: rollout order C4 → C3 → C2 → C1, then C7.
6. Evidence Anchors
- Timing on
effect@4.0.1(machine load average ~16): 100 runs of a 10-field record take ~20 ms to generate; a JSON round-trip takes ~24 ms; 25 runs at 5 ms per case take ~135 ms. Generation costs ~0.15 ms per run; the code under test dominates. - The benchmark found a real defect:
Schema.NumbergeneratesNaN/Infinity, so a JSON round-trip fails;Schema.Finitepasses. - ci-app has 3,211 test files and no property tests (search on 2026-10-27).
- PR evidence: ci-app #310, #347, #353, #356, #363, #381; apito #34.
effect@4.0.1dist/Arbitrary.d.ts:schema,checkEffect,CheckOptions{runs,size,seed,replay},@stability unstable; it has no command or scheduler API.@effect/vitest@4.0.1:it.propandit.effect.propaccept Schemas or Arbitraries.aidenybai/tla-tsb1578d0; npmtla-ts@0.0.3(2026-10-29, MIT, no dependencies) andtsprover@0.0.2.check()returnsstatusand a structuredviolation.trace(action, label, state per step).- tsprover smoke test of #356 (two clients, refetch, hash job): the bug
model fails
staleOnlyByOtherClientwith tracesave("a")→hashJobin 0.73 s; the fixed model passes 109 states with liveness in 0.71 s; with@fairremoved, livenesshashPendingfails. mattpocock/skills59db609: no mutation-testing skill;diagnosing-bugs/SKILL.md:125requires adiffagainst a pristine copy to prove a forced mutation landed; upstreamtddhas the Tautological anti-pattern and "Refactoring is not part of the loop". HItddis pinned at62f43a1and still has a Refactor step (tdd/SKILL.md:118-128).implement-spec/references/parallel-worker-brief.md:58already runs$simplifyon each task's changed code once GREEN.- HI has no root
GLOSSARY.mdorGLOSSARY-MAP.md;domain-modelingandwait-whatreadGLOSSARY.md; 18 wikidomains/*-glossary.mdxpages exist;ask-hi/references/known-gaps.md:14records the gap.