Skip to content

Add an in-memory optimistic-concurrency contract fixture #21

Description

@jonathanmcmichael

Outcome

Provide a test-only in-memory ProjectRepository proving the current optimistic-version contract before a PostgreSQL driver or schema is chosen.

Truth source

Synthetic sequence: initial save with no expected version returns version 1; save with expected version 1 returns version 2; a second save expecting version 1 returns VersionConflict and does not change stored content.

Invariants

  • the fake implements the public repository port rather than creating another API
  • project UUID is the lookup identity
  • conflicts never partially write
  • no database URL, driver, or schema choice enters the fixture

Expected scope

Add a persistence truth fixture or focused test support under rustit-fixtures and exercise the asynchronous port deterministically.

Non-goals

PostgreSQL, PostGIS, migrations, multi-project transactions, offline storage, and production locking.

Acceptance and evidence

  • the three-step version sequence matches the truth source
  • load returns the last successful project and version
  • stale save leaves version and project unchanged
  • missing project behavior is explicit
  • cargo xtask verify passes

Dependencies: #10 and the existing ProjectRepository contract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-readyPortable work packet ready for human-and-AI implementationarea:persistencePersistence, transactions, history, and concurrencyhelp wantedExtra attention is neededkind:fixtureSynthetic truth fixture or minimized failure casereview:rustRust API or implementation review requestedsize:sOne narrow crate slicestate:readyReady for a contributor to claim

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions