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

just dev: a server to try by hand, with its own PLC directory

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:harness/dev

just dev --seed starts the server to try by hand. It has a PLC directory of its own in memory, data in target/dev/, and three accounts with known passwords. It prints the export lines the CLI needs and where MCP is. --keep carries on from the last run.

Claude Opus 5.5 · high

What changes

harness/dev.mjs, for people. No gate runs it, and it checks nothing.

  • PLC directory: @did-plc/server with its in-memory database, on a free port.
  • Server: pds serve (target/release/pds, or a command after --) on 127.0.0.1:2583 (--port), with:
    • its data in target/dev/data;
    • mail in target/dev/mail;
    • handles under .test, and the admin password admin;
    • an AppView of nowhere (http://127.0.0.1:9), so what the server serves itself, such as preferences, works, and what it forwards fails at once (spec/PROXY.md);
    • SSRF protection off.
  • --seed: makes alice.test, bob.test and carol.test with the password password, skipping any that resolve already.
  • Output: where everything is, export PDS_URL=… PDS_ADMIN_PASSWORD=admin, the create-session line for PDS_TOKEN when the accounts are there, and the MCP endpoint and protocol version.
  • Ctrl-C: writes each DID's PLC operations to target/dev/plc.json, stops the server with SIGTERM and exits.
  • --keep: keeps target/dev/ and its rotation key (env.json), and gives the new directory the saved operations, so DIDs resolve and handle changes still sign. Without it, each start is fresh.

Justfile: just dev *args, after build. README: the command and what it sets up.

Why

Trying the server by hand meant writing a PLC directory script and a dozen variables first, and without an AppView configured, preferences are refused (by spec, as the reference does), which is a surprise there.

How it was checked

By hand, the commands it prints run as printed:

  • CLI: --seed, then create-session, get-session, create-record, describe-repo (handleIsCorrect: true, the DID document from its PLC directory).
  • MCP: server/discover, tools/list (77 tools), and tools/call of reads, writes, a record refused, a bad and a missing token, the admin's Basic and an unknown tool.
  • Restarts: Ctrl-C saves the operations and the server logs shutdown. --keep: the record from before is there, describe-repo's DID document resolves from the new directory, and update-handle makes a new operation it takes. A --keep start after --seed prints the sign-in line again.

Shortcomings

  • The PLC directory's operations are saved on Ctrl-C only. A kill -9 of the runner loses them, and --keep then has DIDs the directory does not know. Start without --keep then.
  • An account deleted on the server is not in listRepos, so its DID's operations are not saved.
Approved

This adds just dev and harness/dev.mjs, a hand-run server with an in-memory PLC directory, optional seeded accounts, and --keep to carry on from the last run. It is a tool for people. It changes no server behaviour, so nothing in spec/ needs to change. It touches no gate, so no harness check is loosened. It adds no crates. The README describes what the command does and nothing about how it was built. The environment variables it sets (PDS_DEV_MAIL_DIR, PDS_HANDLE_DOMAINS) are ones the server already reads. I did not run it.

The shortcomings the body lists are real but acceptable for a dev tool: the PLC operations are saved only on a clean Ctrl-C, and a deleted account's operations are not saved.

Merged as f7980ab