# stansite An atproto labeler for account signals derived from standard.site publications. The values match panoptiblog's account rows, so the labeler and the rankings page describe an account the same way. It serves `com.atproto.label.queryLabels`, `com.atproto.label.subscribeLabels`, `/.well-known/did.json` and `/health`. Labels are signed with a secp256k1 key and are informational; nothing here blurs or hides content. ## Running ```sh npm --prefix labeler install LABELER_DID=did:web:labeler.test \ LABELER_SIGNING_KEY= \ LABELER_PDS=https://pds.test \ PANOPTIBLOG_DATA_FILE=../scripts/panoptiblog/out/panoptiblog.json \ PORT=3000 \ node labeler/src/server.mjs ``` The dataset comes from `PANOPTIBLOG_DATA_URL` (the published `accounts.json`, which carries every account the percentiles are computed against) or `PANOPTIBLOG_DATA_FILE` for a local run. It is re-read every fifteen minutes; labels that disappear are emitted as negations. ## Provisioning The deployment is gated by `labeler_enabled` in `infra/labeler.tf`. Before enabling it: 1. Generate a secp256k1 key. Keep the private key out of this repository and put its hex in a Secrets Manager secret. 2. Choose a `did:web` identity whose host serves this service. The default is `did:web:stansite.substandard.blog`; the service answers its DID document at `/.well-known/did.json` with the public key derived from the signing key. 3. Set `labeler_pds` to the PDS that hosts the labeler account's repository. 4. Set `labeler_pds`, `labeler_signing_key_secret_arn` and `labeler_enabled = true` in `infra/terraform.tfvars.json`, then run `labeler/deploy.sh`. 5. Publish the service record with `npm --prefix labeler run publish-service-record` once the DID document answers. The record declares every value the service emits. The DID document, the account's repository and the service record are three different things. The service owns the first, the PDS owns the second, and the publish script writes the third. ## Key handling `LABELER_SIGNING_KEY` is read from the environment and used only to sign. The service never writes it, prints it or derives the DID document from a separate public key: the multibase in the DID document is derived from the same key. ## Limits - Label history is in memory. A restart begins a new sequence, so a client resuming an old cursor gets `FutureCursor` and must start from zero. - `queryLabels` paginates with an index cursor. A client only has to return the cursor it was given. - The label set is a snapshot of the published dataset; the account rows are recomputed by the indexer, not here.