IF Commons GitHub

AnyFS SQL: governance

0002Active

0002-sql-governance · owner if · domain commons

Requirements

FR-001checkpassing

The dialects MUST be the closed list sqlite, postgres and duckdb, each with the hard limit of one value in that engine, and the largest object a store holds MUST default to 64 MiB and MUST NOT be raised above the limit of the engine.

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

Proved by: anyfs-sql/suite/governance.test.ts

Written in: anyfs-sql/src/governance/dialect.ts

Tests: passed: suite/governance.test.ts the dialects are three, each with a hard limit, and the default largest object is 64 MiB a

FR-002checkpassing

A prefix and a schema MUST be made only by parseWord (lower case letters, digits and underscores, starting with a letter, at most 32 characters), a naming MUST default its prefix to anyfs, and the table of a role MUST be the prefix, an underscore and the role.

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

Proved by: anyfs-sql/suite/governance.test.ts

Written in: anyfs-sql/src/governance/naming.ts

Tests: passed: suite/governance.test.ts a word of a name is lower case letters, digits and underscores from a letter, the default

FR-003checkpassing

The layout MUST be documented as data (LAYOUT: each column of each table with what it holds, what it means and the version that added it), the version of the layout MUST be SCHEMA_VERSION, and the plan of the migrations MUST list each version in order with whether it takes something away.

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

Proved by: anyfs-sql/suite/governance.test.ts

Written in: anyfs-sql/src/governance/schema.ts

Tests: passed: suite/governance.test.ts the layout is documented column by column and agrees with the tables the migrations make,

FR-004checkpassing

The media type of a path MUST be the one its last extension says in a closed table, MUST be none for a name with no extension in the table, and MUST NOT be guessed from the bytes.

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

Proved by: anyfs-sql/suite/governance.test.ts

Written in: anyfs-sql/src/governance/media.ts

Tests: passed: suite/governance.test.ts the media type of a path is the one its last extension says, none for a name with no known

Acceptance scenarios

  1. Given the text Fleet-1, When a word is made, Then it is refused, per FR-002.
  2. Given no options, When a naming is made, Then its versions table is anyfs_versions, per FR-002.
  3. Given a/b.json, When its media type is asked, Then it is application/json, per FR-004.

Out of scope

  • Media types from the bytes of an object.

Edge cases

  • A name with a dot first and no other (.json) has no extension (FR-004).

Assumptions

Open questions

  • None.

Key entities

  • Port, Dialect, Layout, Revision.

Success criteria

SC-001success criterion

Every behaviour is tested on the real engines in memory or in temporary folders, 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.