IF Commons GitHub

Presets

0021Active

0021-sql-presets · owner if · domain data

The presets

FR-001checkpassing

preset MUST give, for each of the four names (team-managed, dba-managed, reviewed-convergence, autonomous-convergence), the strategy it uses, the settings of that strategy, the settings of the safety features, of idempotency and of the plan report, and what plan and execute are given (the transforms in the order quarantine, locks, validation, verification, then idempotency; whether a step that only the ledger keeps from running twice is refused; and the retry), and MUST refuse, as an error value, a name that is not one of the four.

Enforced (check): .github: cd commons/data && bun run verify — suite/presets.test.ts: each of the four presets is a strategy with its features and settings, a name that is not one of them is refused, and every preset has the safety features and idempotency on

Proved by: data/suite/presets.test.ts

Written in: data/sql/presets/mod.ts

Tests: passed: suite/presets.test.ts each of the four presets is a strategy with its features and settings, a name that is not

FR-002checkpassing

team-managed MUST use the history strategy delivered by the pipeline; dba-managed MUST use the history strategy delivered as a release package, with a guard the dialect cannot write refused and a step that only the ledger keeps from running twice refused, because a person runs those files by hand and may run them twice; reviewed-convergence MUST use the convergence strategy with reviewed approval; and autonomous-convergence MUST use it with autonomous approval, the default policy that only adds, a lock timeout shorter than the other presets and more attempts, because a first access must not hold an application's start for long.

Enforced (check): .github: cd commons/data && bun run verify — suite/presets.test.ts: each of the four presets is a strategy with its features and settings, a name that is not one of them is refused, and every preset has the safety features and idempotency on

Proved by: data/suite/presets.test.ts

Tests: passed: suite/presets.test.ts each of the four presets is a strategy with its features and settings, a name that is not

FR-003checkpassing

Every preset MUST have idempotency, quarantine instead of drop, lock discipline and generated verification on, and the plan report on, unless the project turns one off; and where quarantine is on, a convergence preset MUST leave the tables it keeps aside out of what the reader reads, and the integrations' ledger table, so that what was quarantined and what was loaded is not found as drift and a second apply still finds nothing to do.

Enforced (check): .github: cd commons/data && bun run verify — suite/presets.test.ts: each of the four presets is a strategy with its features and settings, a name that is not one of them is refused, and every preset has the safety features and idempotency on

Proved by: data/suite/presets.test.ts

Tests: passed: suite/presets.test.ts each of the four presets is a strategy with its features and settings, a name that is not

Changing a preset

FR-004checkpassing

A project's changes to the settings of the strategy, of safety, of idempotency or of the plan report MUST be taken over the preset's, setting by setting (what it does not say stays the preset's), and a change to the settings of a strategy the preset does not use MUST be refused as an error value naming both.

Enforced (check): .github: cd commons/data && bun run verify — suite/presets.test.ts: a project's changes are taken over the preset's setting by setting, and settings for a strategy the preset does not use are refused

Proved by: data/suite/presets.test.ts

Tests: passed: suite/presets.test.ts a project's changes are taken over the preset's setting by setting, and settings for a str

Working end to end

FR-005checkpassing

On real engines, autonomous-convergence MUST bring a database to the state wanted on first access, hold a plan that does not only add and change nothing, and find the next access current; and reviewed-convergence MUST propose a plan, apply it only with the hash of the approved text, and find a second apply has nothing to do.

Enforced (check): .github: cd commons/data && bun run verify — suite/presets.test.ts: on three engines autonomous-convergence applies what adds on first access, holds what does not and finds the next access current, and reviewed-convergence applies only the approved text, once

Proved by: data/suite/presets.test.ts

Tests: passed: suite/presets.test.ts on three engines autonomous-convergence applies what adds on first access, holds what does

Out of scope

  • A preset for a product's file format: interchange is on the roadmap.
  • A choice between presets made by the library: the project's.

Edge cases

  • A name that is a product (flyway): refused, per FR-001.
  • A project that turns every feature off: allowed, and said by the settings it gets back, per FR-003.
  • Settings given for convergence to team-managed: refused, per FR-004.

Assumptions

  • A preset is data: nothing is applied by choosing it.

Open questions

OQ-1open question

Whether presets can be given by a project's own name for its own compositions.

Key entities

  • Preset - a named composition of a strategy and features, with each setting.
  • Strategy - history or convergence.

Success criteria

SC-001success criterion

A project says how its team works and gets a reliable setup, and changes only what it must.

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

Cited by

Data, sql/presets/mod

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