Skip to content

tdd: a hand-ordered test passes for an invariant-over-sequence contract that seeded interleaving breaks #1489

Backlog

Description

@holyshine11

Before filing

  • I've read SCOPE.md and checked .out-of-scope/, and this isn't covered by either.
  • This issue is about one problem.
  • I searched open and closed issues for a duplicate.

Skill

tdd

What went wrong

  1. The feature was document version restore (rewind a work log to rebuild a past state) over two documents. The contract is "after restore, state equals the snapshot", which must hold after any sequence of ops.
  2. Following the skill, the agent wrote one hand-ordered test: every op once, all document A ops, then all document B ops. It passed.
  3. A seeded random interleaving across both documents, with restore and save inserted mid-sequence, then found two real bugs: hidden state was not captured in the restore record, and position gaps broke a contiguity assumption.

The skill's guidance (one seam, one test, expected values from an independent source) doesn't cover contracts that are invariants over sequences. For those, a single hand-ordered example passes while real orderings fail.

Proposed change

For invariant-over-sequence contracts (undo/redo, rewind, sync, replay), add one seeded interleaved run that includes the restore op itself. Assert at every step against snapshots taken during the run. Keep each failing seed as a deterministic regression test.

Activity

  1. added
    needs-triage
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions