Harness Intelligence Wiki
SpecsCLIProperty Testing in Delivery

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 effect pin (4.0.0-beta.101) to latest (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.md shows, under each - Axiom: line in both the Glossary decision entry and the status ### Axioms list, an indented Checkable as: <Property Pattern> | model | type | not-checkable line.
    • Covers: OUT-001
    • Architecture: AC-001, FLOW-001-STEP-001
  • AC-002: create-spec/assets/SPEC-TEMPLATE.md has a ## Spec Invariants section directly after ## Acceptance Criteria with columns INV | Rule | Source (Q anchor) | Form | Pattern | Seam | Model, Form values example | property | stateful-property | model | type, and a "none" rule; create-spec assigns INV-nnn ids that cite their source grill question.
    • Covers: OUT-001
    • Architecture: AC-002, FLOW-001-STEP-003
  • AC-003: create-plan/references/plan-schema.md lists task fields test_form (Form values plus not_applicable), invariant_refs ([INV-nnn] or none) and sensitivity_evidence (blank in the plan), and its example task shows all three; tdd-shaping.md states how to set them.
    • Covers: OUT-001
    • Architecture: AC-003, FLOW-001-STEP-004
  • AC-004: implement-spec/references/parallel-worker-brief.md Task Result and implement-spec/references/lifecycle.md TDD completion contract carry test_form, invariant_refs and sensitivity_evidence.
    • Covers: OUT-001, OUT-003
    • Architecture: AC-004, FLOW-001-STEP-004, FLOW-002-STEP-005
  • AC-005: tdd/properties.md exists 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.md names 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.md has no Refactor workflow step, its description says "red-green" instead of "red-green-refactor", tdd/refactoring.md is deleted, and tdd/UPSTREAM.md records these local adaptations; refactoring stays with the per-task $simplify step 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.md exists with the five-step procedure (name the Mutant; apply and show the landed diff; run and require failure for the expected reason; revert and show git diff --quiet; record), and tdd/SKILL.md states 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 tdd rules require a Sensitivity Proof for every first-run-pass test, every first-run-pass property and every committed Model invariant, recorded in sensitivity_evidence and never in red_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 the implement-spec parent Task Gate runs git diff --quiet on 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.md exists and covers Arbitrary.schema, it.prop and it.effect.prop, Schema.Finite for JSON-stored numbers, per-test { arbitrary: { runs: 25 } } for DB-backed properties, Arbitrary.configureGlobal in 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 effect skill targets the API of the npm latest effect and @effect/vitest release, tells agents on any other version to verify the API with opensrc, has a Branch Chooser line in SKILL.md and a pointer in references/TESTING.md, and has no beta-names note.
    • Covers: OUT-004
    • Architecture: AC-012, ARC-004
  • AC-013: A model-checking skill exists at skills/languages/typescript/model-checking/ with the exact pin tsprover@0.0.2 and no separate tla-ts pin (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.ts lint-ignore rule.
    • Covers: OUT-005
    • Architecture: AC-013, ARC-005, FLOW-003-STEP-007
  • AC-014: create-architecture has 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 with npx --yes tsprover@0.0.2 <path>, records a ## Models row (flow, model path, invariants, state count, Sensitivity Proof) in the template, and returns architecture-not-ready with 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, pin tsprover as an exact devDependency (Q40), add a check:models script that runs tsprover, 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.md has one bullet under "Unsupported evidence" with category test_gap that reports an INV without a test of its Form, a first-run-pass test without sensitivity_evidence, Generator Narrowing or rule loosening without recorded approval, and a Model that diverges from ## Models; review-phase scripts are unchanged.
    • Covers: OUT-006
    • Architecture: AC-016, ARC-008, FLOW-001-STEP-007
  • AC-017: make-tsuite/references/audit-portfolio.md merge disposition states that an input-only-varying example group becomes one property and each existing input stays as a Pinned Replay, and make-tsuite/references/implement-suite.md links tdd/sensitivity.md in place of "a mutation in a disposable copy".
    • Covers: OUT-007
    • Architecture: AC-017, ARC-009
  • AC-018: debugging-phase/SKILL.md step 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.md directs close wiki synthesis to create or update a root GLOSSARY-MAP.md in the upstream map format (one line per context with its domains/<context>-glossary.mdx path) whenever it publishes a glossary page, and ask-hi/references/known-gaps.md no longer lists the glossary-location gap.
    • Covers: OUT-008
    • Architecture: AC-019, ARC-011
  • AC-020: After hi update at the new Baseline, a TypeScript consumer project has the model-checking skill through the typescript Pack and every changed skill file; BASELINE_CHANGELOG.md Unreleased describes 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-checking guidance passes tsprover with 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/skills on its checked-out main branch, then reach HI through bun run sync:skills and the release workflow (root CLAUDE.md shared-skills rule).
  • Every skill edit loads and applies writing-for-agents.
  • tdd/properties.md stays language-neutral; Effect API specifics live only in the effect skill (Q3, Q8, Q28).
  • tsprover stays pinned to an exact version everywhere; it brings the tla-ts it runs (Q10, Q29, Q40).
  • Generator Narrowing or rule loosening needs recorded human approval (status Axioms).

Dependency Readiness

Ready.

  • tsprover@0.0.2 on npm, which depends on tla-ts ^0.0.2 (MIT; aidenybai/tla-ts b1578d0); smoke-tested on 2026-10-29 (Brief §6).
  • effect@4.1.0 and @effect/vitest@4.1.0 on npm latest; API read on 2026-10-29 (Arbitrary.d.ts:364,765,214,178-184; vitest prop :91,132).
  • Skills source wearedevpunks/skills 348c3a3d672eb28011848fada17611281a06447c.

Branch/Base Intent

Touched RepositoryBranchParent or baseChild branch constraintEvidence
wearedevpunks/skillsmainmain at 348c3a3d672eNo alternate branch or worktree (root CLAUDE.md shared-skills rule); no pull requestroot CLAUDE.md
wearedevpunks/harness-intelligenceteam/stefan/property-testing-deliveryorigin/main at 7d869ace03d2One pull requestthis branch holds the grill, architecture and spec
collective-intelligence-platform/ci-appthrowaway pilot and replay branchesthe #402 branch team/stefan/action-plan-platform; the commit before the #381 fixNothing merges; no pull requestQ6

Architecture Source

Accepted Technical Decisions

  • Spec Invariant ids INV-nnn assigned by create-spec; grill axioms carry only the Checkable as: hint (Q9, Q25; ARC-001).
  • Sensitivity Proof evidence in sensitivity_evidence; red_evidence keeps 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 (effect Arbitrary.d.ts:129) (Q22).
  • Models: tsprover@0.0.2 only (Q40); drafted in <spec-folder>/models/<flow>.proof.ts, checked with npx --yes tsprover@0.0.2 <path>, moved by a plan task to <feature-or-service>/<flow>.proof.ts, run by check:models in 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.json includes **/*.ts) and are not projected (sync-content.mjs:912); a lint ignore for **/*.proof.ts is added only when a rule fires (Q39).
  • model-checking lives in the typescript Pack; callers use it when installed (Q29).
  • GLOSSARY-MAP.md is created lazily by requirements-grill close wiki synthesis; no Registry artifact kind and no CLI change (Q35; ARC-011, ARC-012).
  • Refactoring stays with $simplify once 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:models fails 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 update dry run in a TypeScript consumer.
  • Behavior: the ci-app pilot (tsprover exit status and trace) and the #381 replay (property failure output).

Parked Decisions

DecisionOwnerResume trigger
Python guidance (Q7)UserA Python consumer project needs property guidance
Tool-based mutation testing P5 (Q12)UserA make-tsuite audit needs a mutation score
Full upstream drift adoption P4 (Q13)UserA separate delivery is opened

Decision Log

DecisionEvidenceRationale
Properties plus model checking; Quint, LemmaScript, proofs rejectedQ10Bugs are lifecycle and concurrency faults; tsprover models are TypeScript with no JVM
Model step in create-architectureQ11, Q30A design fault returns to the grill before the spec
Sensitivity Proof for every first-run passQ12, Q15A test that never failed proves nothing
effect guidance follows npm latestQ8User: "@latest tag"
Python parkedQ7User decision
GLOSSARY-MAP.md by grill close, lazilyQ35No new Registry artifact kind; Baseline-only release
Pin tsprover only; ghost consumer state in ModelsQ40, Q41T8 showed tsprover@0.0.2 always runs tla-ts 0.0.2; the #402 guarantee needs client state

On this page