Skip to content

Add focused property-based tests for import, chunking, export, and dedup invariants #44

@edheltzel

Description

@edheltzel

Goal

Use property-based tests where they prove invariants that example tests miss, without adding test theater.

Dependencies

Acceptance criteria

  • Add fast-check or an equivalent Bun-compatible property-test library using the project’s existing dependency style.
  • All property tests run under bun test.
  • Conversation import normalization properties cover:
    • required fields are preserved/derived correctly.
    • invalid and empty inputs are rejected deterministically.
    • the same input produces deterministic normalized output.
  • SQLite chunking properties cover:
    • order preservation.
    • exactly-once processing.
    • boundary sizes 0, 1, 499, 500, 501, 999, 1000, 1001, and larger N.
  • Export properties, once Add mem export with JSON, Markdown, SQL dump, and SQLite backup formats #43 exists, cover:
    • JSON structural stability for generated records.
    • Markdown structural stability for generated records.
    • provenance presence for provenance-bearing exported tables.
    • manifest counts match exported records.
  • Dedup properties, once Add non-destructive dedup with provenance-aware survivor selection #45 exists, cover:
    • idempotence.
    • survivor priority by provenance.
    • non-duplicate preservation.
    • duplicate lineage remains auditable after repeated runs.
  • Properties should test invariants, not current default strings or formatting details.
  • Keep generated test sizes bounded so the suite remains practical under normal bun test runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs:humanRequires human implementationtype:featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions