Property Testing in Delivery
Spec: Property Testing in Delivery
Context
Agents that run the Harness delivery skills write example tests only. In
ci-app, 3,211 test files hold no property test, and several shipped bugs
(#310, #347, #356, #363, #381) broke rules that a property or a Model would
have caught. This capability makes the delivery skills carry each
human-approved rule down to executable evidence: a property test, a stateful
property, or a Model that tsprover checks. It also adds the Mutation Testing
principle as a Sensitivity Proof, aligns tdd with two upstream changes, and
fixes how skills find the wiki-hosted glossaries.
Actors: an operating agent that runs requirements-grill,
create-architecture, create-spec, create-plan, implement-spec with
tdd, review-phase, make-tsuite and debugging-phase in a consumer
repository; a human who approves the spec and the plan.
Terms follow the Test Evidence Glossary: Spec Invariant, Property, Property Pattern, Generator, Generator Narrowing, Counterexample, Replay Token, Pinned Replay, Model, Mutant, Sensitivity Proof, Tautological Test.
Non-Goals
- Python guidance (
python-testing-patterns, Hypothesis) (Q7). - Binary-level proof, proved twins in Lean/Dafny/Rocq, LemmaScript, Quint (Q10).
- Tool-based mutation testing such as Stryker or mutmut (Q12).
- Full adoption of upstream drift in
tdd,codebase-design,domain-modeling(Q13). - Moving HI's own
effectpin (4.0.0-beta.101) tolatest(Q8). - An npm CLI release (Q35).
Requirements and Outcomes
OUT-001: Spec Invariants travel from the grill to the plan
A rule accepted in the grill reaches the spec as a numbered Spec Invariant and reaches each plan task as a declared test form, so later stages cite the rule instead of re-deriving it.
Architecture: OUT-001, ARC-001, FLOW-001.
OUT-002: tdd teaches property testing
tdd gives agents one language-neutral reference for when and how to write
a property, and its loop matches the accepted upstream changes.
Architecture: OUT-002, ARC-002, FLOW-001.
OUT-003: A test that never failed needs a Sensitivity Proof
Every test that passes on its first run shows, with a named Mutant, that it can fail, and the proof never leaks a fault into the tree.
Architecture: OUT-003, ARC-003, FLOW-002.
OUT-004: The effect skill teaches Schema, Arbitrary and it.effect.prop
Agents in Effect projects write properties with the API of the npm latest
effect release.
Architecture: OUT-004, ARC-004.
OUT-005: Concurrency and lifecycle designs are model-checked
Flows that meet the trigger get a TypeScript Model checked by tsprover
before the spec exists, the Model moves beside the code and runs in CI, and
its traces become Pinned Replays on the real code.
Architecture: OUT-005, ARC-005, ARC-006, ARC-007, FLOW-003.
OUT-006: Review reports missing test evidence
The review Spec Axis reports uncovered Spec Invariants, missing Sensitivity Proofs, unapproved Generator Narrowing or rule loosening, and Model drift.
Architecture: OUT-006, ARC-008, FLOW-001.
OUT-007: Suite cleanup and bug fixes produce properties
make-tsuite and debugging-phase turn repeated examples and fixed bugs
into properties under the same evidence rules.
Architecture: OUT-007, ARC-009, ARC-010, FLOW-004.
OUT-008: Skills find the wiki-hosted glossaries
Skills that read GLOSSARY.md find the project's wiki glossaries through a
root GLOSSARY-MAP.md.
Architecture: OUT-008, ARC-011.
OUT-009: The change ships as a Baseline release
Consumer projects receive every skill change and the new model-checking
skill through hi update, with no CLI release.
Architecture: OUT-009, ARC-012.
OUT-010: The guidance is proven on real ci-app bugs
A Model pilot and a bug replay show that the new guidance finds real faults.
Architecture: OUT-010, ARC-013.
Acceptance Criteria
- AC-001:
requirements-grill/references/artifact-output.mdshows, under each- Axiom:line in both the Glossary decision entry and the status### Axiomslist, an indentedCheckable as: <Property Pattern> | model | type | not-checkableline.- Covers: OUT-001
- Architecture: AC-001, FLOW-001-STEP-001
- AC-002:
create-spec/assets/SPEC-TEMPLATE.mdhas a## Spec Invariantssection directly after## Acceptance Criteriawith columnsINV | Rule | Source (Q anchor) | Form | Pattern | Seam | Model, Form valuesexample | property | stateful-property | model | type, and a "none" rule;create-specassignsINV-nnnids that cite their source grill question.- Covers: OUT-001
- Architecture: AC-002, FLOW-001-STEP-003
- AC-003:
create-plan/references/plan-schema.mdlists task fieldstest_form(Form values plusnot_applicable),invariant_refs([INV-nnn]ornone) andsensitivity_evidence(blank in the plan), and its example task shows all three;tdd-shaping.mdstates how to set them.- Covers: OUT-001
- Architecture: AC-003, FLOW-001-STEP-004
- AC-004:
implement-spec/references/parallel-worker-brief.mdTask Result andimplement-spec/references/lifecycle.mdTDD completion contract carrytest_form,invariant_refsandsensitivity_evidence.- Covers: OUT-001, OUT-003
- Architecture: AC-004, FLOW-001-STEP-004, FLOW-002-STEP-005
- AC-005:
tdd/properties.mdexists and contains the nine Property Patterns, each with its spec signal and typical Mutant; the slice order (example RED → GREEN, then property RED → GREEN; a pure total function may start with the property); generator rules (no Generator Narrowing, ids from small pools); the Pinned Replay form (explicit input literal, Replay Token in evidence only); the run policy; stateful command-sequence properties; and Model trace → Pinned Replay.- Covers: OUT-002
- Architecture: AC-005, ARC-002, FLOW-001-STEP-005, FLOW-003-STEP-006
- AC-006:
tdd/high-signal-tests.mdnames the Tautological anti-pattern and warns that an oracle that copies the code is tautological.- Covers: OUT-002
- Architecture: AC-006, ARC-002
- AC-007:
tdd/SKILL.mdhas no Refactor workflow step, its description says "red-green" instead of "red-green-refactor",tdd/refactoring.mdis deleted, andtdd/UPSTREAM.mdrecords these local adaptations; refactoring stays with the per-task$simplifystep and the review smell baseline, with no new review obligation.- Covers: OUT-002
- Architecture: AC-007, ARC-002, FLOW-001-STEP-006
- AC-008:
tdd/sensitivity.mdexists with the five-step procedure (name the Mutant; apply and show the landed diff; run and require failure for the expected reason; revert and showgit diff --quiet; record), andtdd/SKILL.mdstates beside the Hard Law that a test that never failed is not evidence.- Covers: OUT-003
- Architecture: AC-008, ARC-003, FLOW-002-STEP-004
- AC-009: The
tddrules require a Sensitivity Proof for every first-run-pass test, every first-run-pass property and every committed Model invariant, recorded insensitivity_evidenceand never inred_evidence.- Covers: OUT-003
- Architecture: AC-009, FLOW-002-STEP-001, FLOW-002-STEP-005
- AC-010: The procedure keeps the Mutant inside the worker's Active Write Scope or records
sensitivity_evidence: parent_required, and theimplement-specparent Task Gate runsgit diff --quieton every recorded Mutant file and blocks the task when a Mutant remains.- Covers: OUT-003
- Architecture: AC-010, FLOW-002-STEP-003, FLOW-002-STEP-006
- AC-011:
effect/references/PROPERTY_TESTING.mdexists and coversArbitrary.schema,it.propandit.effect.prop,Schema.Finitefor JSON-stored numbers, per-test{ arbitrary: { runs: 25 } }for DB-backed properties,Arbitrary.configureGlobalin the vitest setup for local deep runs, stateful properties as a Schema array of tagged commands with a fresh fixture per evaluation, no mutation of generated values, and the Replay Token in evidence only.- Covers: OUT-004
- Architecture: AC-011, ARC-004
- AC-012: The
effectskill targets the API of the npmlatesteffectand@effect/vitestrelease, tells agents on any other version to verify the API withopensrc, has a Branch Chooser line inSKILL.mdand a pointer inreferences/TESTING.md, and has no beta-names note.- Covers: OUT-004
- Architecture: AC-012, ARC-004
- AC-013: A
model-checkingskill exists atskills/languages/typescript/model-checking/with the exact pintsprover@0.0.2and no separatetla-tspin (Q40), ghost variables for consumer state (Q41), the trigger rule, Model rules (finite parameter types, guards,@fair/@leadsTo,@constraint), the Model Sensitivity Proof (remove a guard → violation), the trace → Pinned Replay mapping, the CI step, the pin-bump rerun rule and the scoped**/*.proof.tslint-ignore rule.- Covers: OUT-005
- Architecture: AC-013, ARC-005, FLOW-003-STEP-007
- AC-014:
create-architecturehas a model step between its flow-lenses and compile steps that, for each flow matching the trigger, writes<spec-folder>/models/<flow>.proof.ts, checks it withnpx --yes tsprover@0.0.2 <path>, records a## Modelsrow (flow, model path, invariants, state count, Sensitivity Proof) in the template, and returnsarchitecture-not-readywith the trace as an L2 compile gap on a violation.- Covers: OUT-005
- Architecture: AC-014, ARC-006, FLOW-003-STEP-001, FLOW-003-STEP-002, FLOW-003-STEP-003, FLOW-003-STEP-004
- AC-015: The skills direct one plan task to move each Model to
<feature-or-service>/<flow>.proof.ts, pintsproveras an exact devDependency (Q40), add acheck:modelsscript that runstsprover, and run it in CI, where a violation fails the build.- Covers: OUT-005
- Architecture: AC-015, ARC-007, FLOW-003-STEP-005
- AC-016:
review-phase/references/axis-spec.mdhas one bullet under "Unsupported evidence" with categorytest_gapthat reports anINVwithout a test of its Form, a first-run-pass test withoutsensitivity_evidence, Generator Narrowing or rule loosening without recorded approval, and a Model that diverges from## Models;review-phasescripts are unchanged.- Covers: OUT-006
- Architecture: AC-016, ARC-008, FLOW-001-STEP-007
- AC-017:
make-tsuite/references/audit-portfolio.mdmerge disposition states that an input-only-varying example group becomes one property and each existing input stays as a Pinned Replay, andmake-tsuite/references/implement-suite.mdlinkstdd/sensitivity.mdin place of "a mutation in a disposable copy".- Covers: OUT-007
- Architecture: AC-017, ARC-009
- AC-018:
debugging-phase/SKILL.mdstep 7 Verify says that when the fixed bug breaks a Property Pattern rule the fix adds a property whose Sensitivity Proof reverts the fix, and that a Spec Invariant row is added only for delivery-scoped debugging.- Covers: OUT-007
- Architecture: AC-018, ARC-010, FLOW-004-STEP-001
- AC-019:
requirements-grill/references/wiki-output.mddirects close wiki synthesis to create or update a rootGLOSSARY-MAP.mdin the upstream map format (one line per context with itsdomains/<context>-glossary.mdxpath) whenever it publishes a glossary page, andask-hi/references/known-gaps.mdno longer lists the glossary-location gap.- Covers: OUT-008
- Architecture: AC-019, ARC-011
- AC-020: After
hi updateat the new Baseline, a TypeScript consumer project has themodel-checkingskill through thetypescriptPack and every changed skill file;BASELINE_CHANGELOG.mdUnreleaseddescribes the change with compatibility notes; no CLI package version changes.- Covers: OUT-009
- Architecture: AC-020, ARC-012
- AC-021: The HI wiki skill pages that list Packs, skills and
tdd/review behavior describe the new and changed skills.- Covers: OUT-009
- Architecture: AC-021, ARC-012
- AC-022: On a throwaway ci-app branch, a Model of the #402 entity change log and SSE resync written under the new
model-checkingguidance passestsproverwith a recorded Model Sensitivity Proof, or reports a violation trace that is recorded as a design finding.- Covers: OUT-010
- Architecture: AC-022, ARC-013
- AC-023: On a throwaway ci-app branch at the commit before the #381 fix, an agent that reads only the new skills and the #381 requirement writes a property that fails; nothing from the replay merges.
- Covers: OUT-010
- Architecture: AC-023, ARC-013
Spec Invariants
none — this capability changes skill text; its rules are checked by the acceptance criteria and the skills repository contract tests.
Constraints
- Skill sources change only in
wearedevpunks/skillson its checked-outmainbranch, then reach HI throughbun run sync:skillsand the release workflow (root CLAUDE.md shared-skills rule). - Every skill edit loads and applies
writing-for-agents. tdd/properties.mdstays language-neutral; Effect API specifics live only in theeffectskill (Q3, Q8, Q28).tsproverstays pinned to an exact version everywhere; it brings thetla-tsit runs (Q10, Q29, Q40).- Generator Narrowing or rule loosening needs recorded human approval (status Axioms).
Dependency Readiness
Ready.
tsprover@0.0.2on npm, which depends ontla-ts ^0.0.2(MIT;aidenybai/tla-tsb1578d0); smoke-tested on 2026-10-29 (Brief §6).effect@4.1.0and@effect/vitest@4.1.0on npmlatest; API read on 2026-10-29 (Arbitrary.d.ts:364,765,214,178-184; vitestprop:91,132).- Skills source
wearedevpunks/skills348c3a3d672eb28011848fada17611281a06447c.
Branch/Base Intent
| Touched Repository | Branch | Parent or base | Child branch constraint | Evidence |
|---|---|---|---|---|
wearedevpunks/skills | main | main at 348c3a3d672e | No alternate branch or worktree (root CLAUDE.md shared-skills rule); no pull request | root CLAUDE.md |
wearedevpunks/harness-intelligence | team/stefan/property-testing-delivery | origin/main at 7d869ace03d2 | One pull request | this branch holds the grill, architecture and spec |
collective-intelligence-platform/ci-app | throwaway pilot and replay branches | the #402 branch team/stefan/action-plan-platform; the commit before the #381 fix | Nothing merges; no pull request | Q6 |
Architecture Source
- Blob: https://github.com/wearedevpunks/harness-intelligence/blob/44e28b23f3a4bd1cf474e62593b0b3e7886f9fa0/apps/wiki/content/docs/project/specs/cli/property-testing-delivery/ARCHITECTURE.md
- Commit:
44e28b23f3a4bd1cf474e62593b0b3e7886f9fa0 - Path:
apps/wiki/content/docs/project/specs/cli/property-testing-delivery/ARCHITECTURE.md - Content sha256:
546c125a5d052de5e1ddd3e15f59e040f907bfde17e767d35e6601780a1d8c15
Accepted Technical Decisions
- Spec Invariant ids
INV-nnnassigned bycreate-spec; grill axioms carry only theCheckable as:hint (Q9, Q25; ARC-001). - Sensitivity Proof evidence in
sensitivity_evidence;red_evidencekeeps meaning a genuine pre-implementation failure (Q18; FLOW-002-STEP-005). - Pinned Replay is an explicit input literal in an example test named after
the rule, because a Replay Token reproduces only from the same
implementation (
effectArbitrary.d.ts:129) (Q22). - Models:
tsprover@0.0.2only (Q40); drafted in<spec-folder>/models/<flow>.proof.ts, checked withnpx --yes tsprover@0.0.2 <path>, moved by a plan task to<feature-or-service>/<flow>.proof.ts, run bycheck:modelsin CI; a pin bump reruns every Model and its Sensitivity Proof (Q19, Q20, Q30, Q31, Q38; ARC-005–ARC-007). - Model drafts stay type-checked (wiki
tsconfig.jsonincludes**/*.ts) and are not projected (sync-content.mjs:912); a lint ignore for**/*.proof.tsis added only when a rule fires (Q39). model-checkinglives in thetypescriptPack; callers use it when installed (Q29).GLOSSARY-MAP.mdis created lazily byrequirements-grillclose wiki synthesis; no Registry artifact kind and no CLI change (Q35; ARC-011, ARC-012).- Refactoring stays with
$simplifyonce GREEN (implement-spec/references/parallel-worker-brief.md:58) and the review smell baseline (axis-standards.md:30) (Q17).
Accepted Testing Decisions
- Properties run in CI: pure ones at the default run count, DB-backed ones at
{ arbitrary: { runs: 25 } }; deep runs happen locally at RED/GREEN; every found Counterexample becomes a Pinned Replay (Q5, Q28). - A violation from
check:modelsfails CI (Q11, Q31). - Acceptance evidence: the #402 Model pilot and the #381 throwaway replay (Q6).
Verification Seams
- Skill text: the skills repository contract tests (
node --test tests/*.test.mjs) and a read of each changed file against its acceptance criterion. - Distribution: HI registry and catalog tests plus a
hi updatedry run in a TypeScript consumer. - Behavior: the ci-app pilot (
tsproverexit status and trace) and the #381 replay (property failure output).
Parked Decisions
| Decision | Owner | Resume trigger |
|---|---|---|
| Python guidance (Q7) | User | A Python consumer project needs property guidance |
| Tool-based mutation testing P5 (Q12) | User | A make-tsuite audit needs a mutation score |
| Full upstream drift adoption P4 (Q13) | User | A separate delivery is opened |
Decision Log
| Decision | Evidence | Rationale |
|---|---|---|
| Properties plus model checking; Quint, LemmaScript, proofs rejected | Q10 | Bugs are lifecycle and concurrency faults; tsprover models are TypeScript with no JVM |
Model step in create-architecture | Q11, Q30 | A design fault returns to the grill before the spec |
| Sensitivity Proof for every first-run pass | Q12, Q15 | A test that never failed proves nothing |
effect guidance follows npm latest | Q8 | User: "@latest tag" |
| Python parked | Q7 | User decision |
GLOSSARY-MAP.md by grill close, lazily | Q35 | No new Registry artifact kind; Baseline-only release |
Pin tsprover only; ghost consumer state in Models | Q40, Q41 | T8 showed tsprover@0.0.2 always runs tla-ts 0.0.2; the #402 guarantee needs client state |