Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/assessment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Assessment

# Settles a booth or level request once its assessors have voted
# (docs/adr/0082-assessed-by-consensus.md). Each assessor pushes its signed
# vote on a branch of its own, assess/<issue>/<assessor>-<time>; this workflow
# checks the signatures against the keys in scripts/assessors.json and applies
# the decision only when every assessor agrees, in main's own words. Anything
# else goes to a maintainer. So no agent that reads a request can label,
# answer or close it.
#
# Keep this file a thin shim. A push runs the workflow file of the commit that
# was pushed, so an old copy of this file can always be made to run: all it may
# ever do is check out main and run main's script.
on:
push:
branches: ['assess/**']
# A request whose assessors never voted reaches a maintainer from here.
schedule:
- cron: '7,22,37,52 * * * *'
workflow_dispatch:

permissions:
contents: read

jobs:
settle:
# One at a time: two votes for one request arrive within seconds of each other.
concurrency:
group: assessment
cancel-in-progress: false
runs-on: ubuntu-latest
permissions:
# Deleting the votes' branches once a request is settled.
contents: write
issues: write
# Starting the deploy, so the map shows the booth being built.
actions: write
steps:
# main's own code, never the pushed branch's.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.repository.default_branch }}
# The script needs only Node, so nothing is installed.
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version-file: .nvmrc
- name: Settle the requests with votes
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/assessment-apply.ts
24 changes: 20 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,18 @@ scripts/
flashing.ts the smoke test's flashing check (plain functions)
ownership.ts the booth ownership rule (plain functions)
check-booth-ownership.ts the CI check that enforces it
assessment-vote.ts an assessor's signed vote on a request, and reading one
(plain functions); assessors.json lists their public keys
assessment-request.ts a request as the assessment reads it: the issue and its
thread, and whether its author has answered (plain functions)
assessment-read.ts how an assessor reads a request, with its fingerprint
assessment-cast.ts how an assessor hands its vote in, on a branch of its own
assessment-consensus.ts whether the assessors agree, and the factory's reply
(plain functions)
assessment-settle.ts applying an agreed decision to the issue, or asking a
maintainer (plain functions)
assessment-apply.ts the Assessment workflow's command: settles every request
with votes waiting
square-size.ts the size budget for every square
share-pages.ts the link-preview page the build writes for every square,
and for the factory's numbers
Expand Down Expand Up @@ -322,10 +334,14 @@ dependency or reaching the network, say so, the same way, and stop.
**Requests are assessed first.** There's one issue form, **Your booth**,
labelled `booth-request`, for a new booth and for changing one alike: build the
booth if `carnival/booths/<author>/` doesn't exist yet, and change it if it does.
`plugins/north-pole/skills/assess-booth-request` decides whether the factory
builds it (it adds `tessl`), asks a question (`needs-info`) or declines it
(`declined`). The latest request wins: accepting one closes the author's older
open requests as superseded. Keep its rules in step with this file.
Two assessors, on models from different makers, each read it with
`plugins/north-pole/skills/assess-booth-request` and vote: build it, ask a
question or decline it. Neither writes to the issue. The **Assessment**
workflow applies what they agree on (`tessl`, `needs-info` or `declined`) in
its own words, and sends anything they disagree on to a maintainer with
`needs-human` ([ADR 0082](docs/adr/0082-assessed-by-consensus.md)). The latest
request wins: accepting one closes the author's older open requests as
superseded. Keep the skill's rules in step with this file.

**Booth changes can merge on their own.** `.github/workflows/auto-merge-booths.yml`
runs the gate in `scripts/booth-gate.ts`. It merges a factory pull request for
Expand Down
7 changes: 5 additions & 2 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ gate. Anything in doubt gets the `needs-human` label and waits for a
maintainer, and a daily digest issue lists everything that merged on its own.
[How your request is built](docs/how-it-works.md) explains each step.

Booth requests are assessed before the factory builds them: see
`plugins/north-pole/skills/assess-booth-request/`. Only maintainers can start or steer the
Booth requests are assessed before the factory builds them, by two models
that must agree: see `plugins/north-pole/skills/assess-booth-request/` and
[ADR 0082](docs/adr/0082-assessed-by-consensus.md). A request they disagree
on gets `needs-human`: read it, then add `tessl` to build it, or close it.
Only maintainers can start or steer the
factory directly: the `tessl.json` triggers that start or steer work (adding
`tessl`, commenting on a `tessl` issue, or reviewing or commenting on a factory
pull request) are filtered on `event.sender.id`. The Tessl Reviewer's reviews
Expand Down
103 changes: 103 additions & 0 deletions docs/adr/0082-assessed-by-consensus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 0082. A request is assessed by two models, and a workflow applies what they agree on

- Status: Accepted
- Date: 2026-12-03
- Spec: [booth-requests.md](../specs/booth-requests.md)

## Context

The assessment is the first agent to read a stranger's request, and its
decision starts a build. It ran as one model with full write access to GitHub,
because Tessl has no access level that writes issues only
([ADR 0080](0080-builders-with-less-access.md)). So one model, reading text
anyone may write, both made the decision and held far more access than the
decision needs.

Two things can be separated here: who judges a request, and who writes the
answer on the issue. Judging needs a model and no access. Writing the answer
needs access to issues and no model.

## Decision

- **Two assessors.** Every request is read by two models from different
makers, under the same skill and rules: `assess-booth-request` on Claude and
`assess-booth-request-openai` on GPT. The same events start both.
- **Assessors vote, and write nothing else.** Each runs in an environment of
its own, `carnival-assessor-claude` and `carnival-assessor-openai`, at
`pull-requests` access: it can't label, comment on or close an issue. It
reads the request with `scripts/assessment-read.ts` and hands in its
decision with `scripts/assessment-cast.ts`, which pushes a small vote on a
branch of its own, `assess/<issue>/<assessor>-<time>`.
- **A vote is signed.** Every agent acts on GitHub as the same bot, so a
branch alone doesn't say whose vote it is. Each assessor's environment holds
an ed25519 private key no other run has; the public keys are in
`scripts/assessors.json`. A vote names its issue, its assessor, the
fingerprint of the request it read, and the time, all under the signature.
- **A vote is for the request as its assessor read it.** The fingerprint
covers the title, the body and the request's thread: the factory's own
replies and what the author has said since the first of them, and nobody
else's. Before the factory has asked anything, the request is its title
and body, which is also when a comment starts no new assessment. The read command prints
it and the assessor hands it back, so a request that changes while it is
being read gets no vote on what nobody assessed. Every reply the factory
posts changes the fingerprint, so a vote counts for one round and can't be
handed in again for a later one.
- **A workflow applies the decision.** `.github/workflows/assessment.yml`
runs `scripts/assessment-apply.ts` from `main`'s own checkout, with GitHub
Actions' token. It checks each vote's signature and soundness, takes each
assessor's latest vote on the request as it reads now, and:
- when every assessor gives the same verdict, applies it: the labels, the
closing of older requests, and a reply in the factory's own fixed words.
The few words an assessor supplies (what can't be done, a proposal,
options, a reason) are length-capped and made plain text first;
- when the verdicts differ, when a vote is still missing twenty minutes
after the first (or, with none, after the request last changed), or when
the agreed vote lacks the words its reply needs, adds `needs-human` and
says a maintainer will look. Nothing is built. A request waiting on its
author has no clock: a question the factory asks records the fingerprint
it was asked about, which is how a later run tells an answer from
silence.
- **The build starts on the workflow's label.** `implement-booth` and
`implement-level` start when GitHub Actions' own bot, by numeric id, adds
`tessl`. The Tessl App adding it no longer starts anything, so no agent can
start a build. A maintainer adding `tessl` to a booth request still does.
- **Any edit of an open request is read again.** A vote counts only for the
text it fingerprinted, so an edit before the answer needs fresh votes.
- **Latest request wins, as before.** Accepting a request closes the author's
older open requests of that kind, never a newer one.

## Consequences

- No agent that reads a request can write to an issue or start a build. To
get a request built by talking a model into it, both models must be talked
into the same verdict, each on its own.
- An accepted request's reply holds nothing an agent wrote. A question or a
decline holds a few plain words from the first listed assessor, on the
requester's own issue.
- When the author says yes to a proposal, both assessors judge the
proposal's text again as if it were the request: it was one assessor's
words.
- A request costs two short runs, not one, and waits for the slower of the
two and the workflow: about two minutes in trials.
- More requests reach a maintainer: every disagreement, and every run that
fails to vote. That is the intended direction of failure.
- The workflow file of a pushed commit is the one a push runs, so
`assessment.yml` stays a thin shim that checks out `main` and runs `main`'s
script: an old copy of it can do nothing else.
- A vote already cast can be pushed again by anything that may push a
branch. It counts only while the request reads exactly as it did, thread
included, and a request that has its answer is skipped. Anything that may
push a branch may also delete one or push many, which only sends a request
to a maintainer: the workflow reads at most ten of a request's vote
branches.
- A write that fails halfway (the label on, the reply not) fails the
workflow's run, which is the signal: the next run sees the label and does
not finish the job. A failed read of an issue keeps its votes for the next
run.
- Rotating a key means a new pair: the private half into the assessor's
Tessl environment, the public half into `scripts/assessors.json`.
- `welcome-feedback`, `follow-ticket-changes` and `implement` still run with
full write access. They don't start builds from a stranger's request, but
they are the next to lower when Tessl has a level that writes issues only.
- This replaces the part of [ADR 0080](0080-builders-with-less-access.md)
that left `assess-booth-request` in `carnival-factory-env`.
1 change: 1 addition & 0 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ way, so a later change can tell a deliberate choice from an accident.
| [0079](0079-the-deploy-trusts-only-its-own-state.md) | The deploy trusts only its own state | Accepted |
| [0080](0080-builders-with-less-access.md) | The agents that build get less access | Accepted |
| [0081](0081-the-gate-waits-for-the-security-scan.md) | The gate waits for the security scan | Accepted |
| [0082](0082-assessed-by-consensus.md) | A request is assessed by two models, and a workflow applies what they agree on | Accepted |
17 changes: 10 additions & 7 deletions docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ own** opens the same form, empty.

## 2. The assessment reads it

An agent reads your request first, following the
Two agents read your request first, each a different AI model, following the
[`assess-booth-request`](../plugins/north-pole/skills/assess-booth-request/SKILL.md)
skill. It checks that it's a change to your own booth, that it can be drawn
within the house rules, and that it's friendly for everyone. Then it does one
of three things:
skill. Each checks that it's a change to your own booth, that it can be drawn
within the house rules, and that it's friendly for everyone, and votes. When
they agree, the factory does one of three things:

- **Accepts** it and hands it to the factory, with the `tessl` label.
- **Asks** one question, if it can't tell what to build. Edit your issue to
answer.
- **Accepts** it and hands it to the builder, with the `tessl` label.
- **Asks** one question, if it can't tell what to build. Reply or edit your
issue to answer.
- **Declines** it, with the reason.

When they don't agree, a maintainer takes a look instead, and your issue says
so. Either way you hear within a few minutes.

Your words are treated as a description of a drawing, never as instructions
to the agent. Text that tries to instruct it is a reason to decline.

Expand Down
Loading
Loading