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

Tests reach the reference PDS and PLC, on the space alpha in CI

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:harness/reference-pds

What changes

The tests reach a real network. harness/pds.mjs runs the reference PDS and a PLC directory (@atproto/dev-env), makes accounts, and prints where they are, as knotless's harness does, less the gateway and lexicon setup only knotless needs; its packages are knotless's harness's, the same pinned versions. tests/common/net.rs starts it once for a test binary that asks.

CI runs it on the space alpha. test.yml builds @atproto/dev-env at the alpha commit knotless's tests pin (11c5d98), as knotless's workflow does, and keeps the build, Node and the harness's packages between runs; GROUP_HOST_DEV_ENV points the harness at it.

The first test against it, tests/interop.rs: a group made with the real PLC directory, its genesis taken and its document served with the host as its PDS, its handle, and its account's signing key; then, on the alpha, a member on the reference PDS asks it for a delegation token to the group's members space, and the token verifies with atproto::space_auth as the host will check it, aud and sub included.

Why

Space repos and being their authority (steps 4b and 4c) are protocol flows between servers, which the vectors that pin the primitives cannot check. A real member's PDS and directory catch where the host and the reference part before groups and membership are built on them.

How it was checked

Locally on npm's stock PDS: the directory half passes, the delegation half skips as it has no spaces. On the alpha, this pull's own test check is the first run.

Shortcomings

The first run builds the alpha, some minutes; after, it is cached. A member's OAuth login is not needed yet: the reference mints a delegation token for a full-access password session, as its handler shows.

Approved

This adds a Node harness (harness/pds.mjs) that runs the reference PDS and PLC, a tests/common/net.rs that starts it once per test binary, a CI test.yml that builds the space alpha at the pinned commit with caching, and a first interop test. The test covers the PLC genesis and document, and a delegation token verified with space_auth. I read every file except harness/package-lock.json, which is 9,487 generated lines. The code looks correct: Node 24.22.1 matches .node-version, the harness stops when stdin closes, and the test skips cleanly without spaces. The lint, web and lexicons checks pass or skip; the test check was still running when I looked. The alpha build and the delegation half are only exercised there, so don't merge until it passes.

Two small things, neither blocking:

  • harness/package.json adds @playwright/test as a devDependency. Nothing in the repo uses it, and the pull doesn't mention it. Drop it, or say what it's for.
  • AGENTS.md asks for environment variables to be listed in docs/reference/config.md. GROUP_HOST_DEV_ENV is only described in development.md. That's reasonable for a test-only variable, but it's a deviation.
harness/package.jsonline 10Outdated

These lines can no longer be read.

review.knotless.dev

@playwright/test isn't referenced anywhere in the repo, and the pull doesn't say why it's added. It is also installed by npm ci --omit=dev's counterpart in just setup. Remove it unless something needs it.

Approved

The new commit (15db7ed) adds a build:ui step for @atproto/oauth-provider-ui to the alpha build, because the PDS won't start without that bundle. It also bumps ALPHA_BUILD to 2, so the cache rebuilds. That is the right fix and the right cache invalidation. The check, web and lexicons checks pass or skip; the test check is still running. As before, the alpha build and the delegation half only run there, so wait for it to pass before merging.

My earlier two notes were not acted on, and neither blocks the merge:

  • @playwright/test is still in harness/package.json.
  • GROUP_HOST_DEV_ENV is still missing from docs/reference/config.md.
Merged as ec99af8