swarm-controller: harden the review classifier's real reviews
Follow-ups from the review of #5142. A `Done` answer with fewer or more rows than the classifications sent, or none, now posts the no-verdict comment instead of the classifier's overall verdict, so a short answer can't approve. Requests are accepted per repo, PR and head into a set bounded at the two running plus eight waiting. A request for a key already running or waiting starts nothing and logs at info; a request with every place taken starts no run and posts a no-verdict comment saying so. Before, every delivery spawned a task waiting on the semaphore, so toggling the review request queued one paid run per toggle. Table cells get a zero-width space after `#`, `!`, `://` and `www.`, so a model's reason can't render an issue or PR reference or a bare URL as a link. The secret publisher's policy denies the classifier's forge token leaf, the way #5139 denied Grafana's admin password, with a module-eval-bao-grants arm pinning it. The controller posts reviews with whatever token is there, so a publisher write picked the account reviews come from. Closes #5143, part of #5096.
This commit is contained in:
parent
133d5578d2
commit
60ea7fdc04
10 changed files with 447 additions and 50 deletions
|
|
@ -74,7 +74,7 @@ of the cell says how.
|
|||
| `swarm/services/<clientId>/oidc/client` | authelia | that service's own reader, under its own certificate — the queue responder's under `swarm-nats-auth`'s, the homeserver's under `swarm-matrix-ctl`'s, the forge's under `swarm-forge-publisher`'s, the review classifier's under `swarm-review-classifier`'s; the bao UI's by the store's granter | must be stated | must be stated |
|
||||
| `swarm/services/ci-runner/registration-token` | `swarm-controller`, from the forge's admin API, at start and in a five-minute pass; its grant on the path is write-only | `swarm-bao-ci-runner` on the runner's host, under the runner's own certificate, into a file only `swarm-ci-runner-register` in the runner's container loads; no other principal's policy reads it | ❌ the forge hands out one token until an admin resets it; the controller writes a reset token within five minutes | ❌ `swarm-bao-ci-runner` reads it when it starts, at boot or deploy, and restarts the runner when the value changed |
|
||||
| `swarm/services/review-classifier/anthropic-api-key` | the operator, by hand in the store's UI, field `api_key` | `swarm-review-classifier` in its container, under its own certificate, at the start of every run; held for that run and handed to `claude`'s environment only; no other principal's policy reads it | ❌ an operator's key; replaced by writing a new one | ✅ read on every run, so a written or removed key takes effect on the next run |
|
||||
| `swarm/services/review-classifier/forge/token` | `swarm-controller`, with the forge's admin API, for its `review-classifier` account, at start and in a five-minute pass | `swarm-controller` under its own certificate, before it decides whether to mint, and on every review it posts as the account; the classifier service's policy doesn't read it | ✅ the controller's pass re-mints when the stored token is missing or no longer matches the forge (last eight characters and scopes) | ✅ the controller reads the store on every review it posts |
|
||||
| `swarm/services/review-classifier/forge/token` | `swarm-controller`, with the forge's admin API, for its `review-classifier` account, at start and in a five-minute pass; the secret publisher's policy denies it | `swarm-controller` under its own certificate, before it decides whether to mint, and on every review it posts as the account; the classifier service's policy doesn't read it | ✅ the controller's pass re-mints when the stored token is missing or no longer matches the forge (last eight characters and scopes) | ✅ the controller reads the store on every review it posts |
|
||||
| _(not in the store)_ a hive's mTLS leaf | the store's own PKI, or an operator placing it by hand | its own client, off disk — the exception above, because it's what makes every other row's pull possible | must be stated | must be stated |
|
||||
|
||||
<!-- vale write-good.Passive = YES -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue