IF Commons GitHub

AnyFS Serve: governance

0002Active

0002-anyfs-serve-governance · owner if · domain commons

Requirements

FR-001checkpassing

The methods MUST be the closed union of twelve (OPTIONS, GET, HEAD, PUT, DELETE, MKCOL, COPY, MOVE, PROPFIND, PROPPATCH, LOCK, UNLOCK); parseMethod MUST give a method for exactly those upper-case names and nothing for any other text; allowedMethods MUST leave out the methods that change the store where it cannot write and LOCK and UNLOCK where locks are off.

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

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

Written in: anyfs-serve/src/governance/methods.ts, anyfs-serve/src/governance/mod.ts

Tests: passed: suite/governance.test.ts the methods are the twelve, a method is read only by its exact upper-case name, and a stor

FR-002checkpassing

The statuses MUST be a closed list, each with its words, and statusOfErrno MUST give a status for every code of the POSIX view in every context, as a table that the compiler holds to one entry for each code.

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

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

Written in: anyfs-serve/src/governance/status.ts

Tests: passed: suite/governance.test.ts every status has its words, and every code of the view has a status in every context

FR-003checkpassing

In the context of a new collection an existing name MUST be 405, in the context of an exclusive write or of a copy or move that may not overwrite it MUST be 412, and in any other context 409; ENOENT MUST be 404, ESTALE 412, EROFS and EACCES 403, EXDEV and EIO 502, ENOTSUP 501, EFBIG 413, EINVAL 400 and ENAMETOOLONG 414.

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

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

Written in: anyfs-serve/src/governance/status.ts

Tests: passed: suite/governance.test.ts an existing name is 405, 412 or 409 by what the request was doing, and the other codes hav

FR-004checkpassing

The content type of a name MUST be the one the table gives for its last extension in lower case, and application/octet-stream for a name with none, one that is only an extension and one the table does not know.

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

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

Written in: anyfs-serve/src/governance/mime.ts

Tests: passed: suite/governance.test.ts a content type is the table's for the last extension in lower case, and octet-stream for a

FR-005checkpassing

An exposure MUST be the loopback, or an address with at least one host that may be named in the Host header; expose MUST refuse an address that is empty or has space around it, no hosts, and a host with a path, a space or nothing; the hosts of the loopback MUST be 127.0.0.1, localhost and [::1].

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

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

Written in: anyfs-serve/src/governance/options.ts

Tests: passed: suite/governance.test.ts an exposure is the loopback or an address with hosts, and the loopback names three hosts

FR-006checkpassing

The limits MUST be whole numbers of at least 1, with the defaults of 64 MiB for an object, 1 MiB of XML nested 32 deep with 20000 parts, locks of an hour at most, 1000 of them and 10000 resources of an answer; withLimits MUST refuse any other number.

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

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

Written in: anyfs-serve/src/governance/options.ts

Tests: passed: suite/governance.test.ts the limits are whole numbers of at least 1 with the defaults, and a change that is not is

FR-007checkpassing

A name MUST be junk where it is .DS_Store, Thumbs.db, desktop.ini or begins with ._, and the policy for junk MUST be one of allow (the default), hide and refuse.

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

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

Written in: anyfs-serve/src/governance/options.ts

Tests: passed: suite/governance.test.ts junk names are the files a desktop makes by itself

FR-008checkpassing

The options for an empty collection MUST be markers (the default: an object of a reserved name is kept below it) and virtual (nothing is written), and for a name that is not in the normal form of Unicode nfc (the default: it is turned into it) and refuse.

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

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

Written in: anyfs-serve/src/governance/options.ts

Tests: passed: suite/governance.test.ts the options for empty collections and for names are closed lists with safe defaults

Acceptance scenarios

  1. Given the case of FR-001, When it is run, Then the requirement holds, per FR-001.
  2. Given the case of FR-002, When it is run, Then the requirement holds, per FR-002.
  3. Given the case of FR-003, When it is run, Then the requirement holds, per FR-003.
  4. Given the case of FR-004, When it is run, Then the requirement holds, per FR-004.
  5. Given the case of FR-005, When it is run, Then the requirement holds, per FR-005.
  6. Given the case of FR-006, When it is run, Then the requirement holds, per FR-006.
  7. Given the case of FR-007, When it is run, Then the requirement holds, per FR-007.
  8. Given the case of FR-008, When it is run, Then the requirement holds, per FR-008.

Out of scope

  • Properties stored by the server, shared locks and NFS: later specifications.

Edge cases

  • A method in lower case or with a space after it is no method, per FR-001.

Assumptions

  • The library @intellectual-frontiers/anyfs is the host of the family and @intellectual-frontiers/anyfs-posix gives the view that every method is carried out on.

Open questions

  • None.

Key entities

  • Handler - a function from a Request to a Response that serves one store.
  • Exposure - where the server may listen and which hosts it may be asked for.

Success criteria

SC-001success criterion

The tests of every requirement of the library pass on Bun and on Node 26.

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.