~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

harness: the compatibility check kept apart from the checks the gates run

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:compat-isolation

Adding other PDSes to the compatibility check had started to leave branches through harness/checks/, the checks spec-pds's gates run. This keeps those checks as they were for spec-pds, and gives each later implementation one place to differ. It changes no behaviour.

Claude Opus 5.5 · high

What changes

harness/lib/server.mjs holds what a check may take of the server beyond the protocol: own(), can(setting), pageApi() and issuer(side). Every cand.adapter.own, cand.adapter.unsupported.X and cand.adapter.pageApi that checks/ read inline now asks it, and no check names an implementation.

Compat-only setup leaves checks/. claimAccount, which makes a one-account server's account, moves to lib/areas.mjs, the compatibility run itself.

harness/lib/adapters/ has a module per implementation (spec-pds, zds, vlpds, pds.js), common.mjs for what they share (process, container, rotation key, form sign-in), and index.mjs for the contract and the list. It replaces the one growing adapters.mjs.

compare.mjs --tally <file> writes how many requests of each kind a run made, with any port a kind names written as <port>. Two runs of one seed write the same file.

The rule, in compat/README.md ("Adding an implementation") and AGENTS.md:

  • An implementation brings an adapter and the settings it cannot be given.
  • A difference the protocol allows becomes a capability in spec/COMPAT.md. It is answered in lib/server.mjs or handled in lib/areas.mjs, and is the same for spec-pds as before.
  • Its own quirks are differences or skipped checks, never a check bent around them.
  • A change of the second kind shows spec-pds's tallies unchanged for a few seeds.

Why

Each implementation so far added a conditional somewhere in checks/: the KEM key and limit numbers behind own, consent narrowing, one account, a rotation key the harness can't sign with, a separate issuer. The next ones would need more, such as tranquil's TLS and per-account rotation keys. Gathering every such read behind one module, with a rule and a way to show spec-pds is untouched, keeps the gates' suite what it is.

I considered a rewriting proxy in front of each server so the checks see a uniform one, and ruled it out. DPoP signs the URL a request goes to, so the harness still has to speak each server's scheme itself. Anything that rewrites bodies would also change what is measured.

How it was checked

  • spec-pds, before and after: compare.mjs --steps 400, seeds 1 and 2, on main and on this branch with the same binary. The same requests of every kind, by tally. The same check was first run on 567c1b0, before rebasing: seeds 1 and 2 matched there too, at 371 and 357 kinds.
  • The compatibility run: pds.js's sessions, records, identity and firehose areas at 200 steps make the same checks as its earlier run, with the same failures. The only exception is appPasswords, which gave 37 or 38 failures of 46 across runs, a matter of timing. zds's and vlpds's sessions areas start and run as before.
  • just gates: passes; all 7 code runs and all 17 harness runs, the browser runs of the authorization pages among them. just quick passes but for one run; see Shortcomings.

Shortcomings

just quick's crash run (seed 21; the gates' crash run is seed 24, which passes) fails on this machine at its last step: the server's log has no trace export failed line after an OTLP receiver outage. 567c1b0, this branch's parent, fails it the same way with the same binary, so this change doesn't cause it; the step is timing-sensitive. It is not among the gates' runs.

Review

A quick look. The moves are mechanical. lib/server.mjs and the rule in compat/README.md are the parts to read.

Approved

This is a refactor with no change in behaviour. It moves the adapters into harness/lib/adapters/, adds lib/server.mjs, moves claimAccount into lib/areas.mjs, and adds --tally.

I read every changed file. The adapter modules match the old adapters.mjs. That includes the unsupported reasons, the start and signIn bodies, child and container, and MAIL_DIR, which stays private to the spec-pds adapter.

  • No remaining adapter reads in checks/. A search of the branch finds no adapter. there. Each own(), can(x) (written as !unsupported.x) and pageApi() call keeps the old logic and the same order of evaluation, so the seeded draws are unchanged. In updateHandle and clientLogin, chance() is still drawn before can() is asked. That order matters for the claim that spec-pds's runs are the same.
  • Harness only. No check is loosened and no server code changes, so spec/ needs no edit.
  • Docs. The README and compat/README.md describe what exists, with no history in them.
  • Stale paths. Only the base's lib/adapters.mjs paths remain.
  • Excuses. The pull adds none to harness/conformance.yaml.

Two optional points. --tally is written on process.on('exit') in report.mjs. A run killed by a signal won't write it, which is fine for the use you describe. The seed 21 crash-run failure is already on the parent commit and is not caused by this pull.

Merged as 58c4669