IF Commons GitHub

AnyFS Bridge: conformance

0005Active

0005-bridge-conformance · owner if · domain commons

Requirements

FR-001checkpassing

The library MUST give a suite of laws that a backend runs with a function that makes a pair of empty stores: a plan changes neither store, a plan is deterministic, a copy makes the destination hold the source and a check then finds nothing, a copy never deletes, a sync is idempotent, a sync over its allowance is refused, a plan whose source changed is refused, and an update does not replace a file that changed after the plan where the destination can tell; and every law MUST hold between stores in memory and in a folder in every pairing and for a destination with no cas.

Enforced (check): .github: cd commons/anyfs-bridge && bun run verify — suite/conformance.test.ts

Proved by: anyfs-bridge/suite/conformance.test.ts

Written in: anyfs-bridge/src/conformance/mod.ts

Tests: passed: suite/conformance.test.ts every law holds between two stores in memory, and the suite has a law for each promise of ; passed: suite/conformance.test.ts every law holds in every pairing of a store in memory and a store in a folder; passed: suite/conformance.test.ts the laws hold for a destination that cannot compare and write: its writes are unguarded, a

FR-002checkpassing

A pair that breaks a law MUST fail that law with a sentence that names what differed, and a store that cannot be listed MUST fail the laws that list and MUST NOT make the suite throw.

Enforced (check): .github: cd commons/anyfs-bridge && bun run verify — suite/conformance.test.ts

Proved by: anyfs-bridge/suite/conformance.test.ts

Tests: passed: suite/conformance.test.ts a destination that says it deleted and did not breaks the laws of a sync, and the suite na; passed: suite/conformance.test.ts a pair whose stores cannot be listed fails every law with a sentence, and nothing is throw

Acceptance scenarios

  1. Given two stores in memory, When the suite runs, Then every law passes, per FR-001.
  2. Given a destination that says it deleted and did not, When the suite runs, Then the law of the idempotent sync fails with its name, per FR-002.

Out of scope

  • Laws of a transfer between three stores or of a mirror: they are held by the tests of the library (0004-bridge-twoway).

Edge cases

  • A law that needs cas returns where the destination has none (FR-001).

Assumptions

  • The function that makes a pair makes new, empty stores for each law.

Open questions

  • None.

Key entities

  • BridgeCase, Pair, MakePair.

Success criteria

SC-001success criterion

Every behaviour is tested over stores in memory and, where it touches a file system, stores in a folder, with no network and no real time.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No company fact is asserted here
  • [x] Every open item is marked, not silently decided

Titles, headings, exports, tables, columns and requirements. Esc closes.