IF Commons GitHub

AnyFS Serve: physical

0004Active

0004-anyfs-serve-physical · owner if · domain commons

Requirements

FR-001checkpassing

serveStore MUST host the handler of a store on the loopback address 127.0.0.1 with a port that the program gives or the system chooses, MUST give the address it listens on and a way to stop it, and MUST give an error value, never throw, where it cannot listen.

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

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

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

Tests: passed: suite/physical.test.ts over a store in memory and a store in a folder, a client with fetch writes, reads, lists, ; passed: suite/physical.test.ts serveStore hosts a store on the loopback, gives its address and a way to stop it, and give

FR-002checkpassing

Where the program gives no way to know who asks, the server MUST make a token of 32 random bytes, accept it as a bearer token and as the password of Basic with any user name, and tell the program the token once so that it can show it to the person who started the server; the server MUST NOT write the token to a log or to an event.

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

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

Written in: anyfs-serve/src/physical/serve.ts

Tests: passed: suite/physical.test.ts with no way to know who asks the server makes a 64-digit token, tells the program once, ac

FR-003checkpassing

An address other than the loopback MUST be listened on only where the program gives an exposure that names the hosts that may be asked for, and the handler MUST refuse a request whose Host is not one of them; an event MUST hold the method, the path, the status, the kind of fidelity and the time, and no credential and no body.

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

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

Written in: anyfs-serve/src/physical/serve.ts

Tests: passed: suite/physical.test.ts the server answers only the hosts it was given: the loopback names, or the hosts of an exp

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.

Out of scope

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

Edge cases

  • A port that is already taken is an error value that names it, 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.