Artifact e71e7abc66cf5ba124fa5abd9a9519ed9fabec22a14d368327bd2c5b6c1ece1c:
- File docs/rfcs/0031-one-goal-one-consent.md — part of check-in [16353ad1a2] at 2026-11-20 12:28:43 on branch rfc-0031 — RFC 0031: one goal, one consent (refusals with a next step, waiting, the land grant, the quarry client) (user: dmestas, size: 29449) [annotate] [blame] [check-ins using]
- Feature Name:
one-goal-one-consent(a person says one thing, such as "my agent may land here when CI is green", approves it once, and can read whether it is done; a small client does the forge workflow in one command per goal) - Start Date: 2026-11-20
- Status: Accepted, 2026-11-20. Every decision is made (see Decisions); nothing here waits on an answer. Built in the order under Build order.
- Depends on: RFC 0007 (protected branches); RFC 0009 and 0019 (checks and runs); RFC 0006 (stacks); RFC 0021 and 0026 (agents, tokens); RFC 0027 and 0028 (asking your person, requests); RFC 0030 (setup by approval, pickup, the runner installer)
- Amends: RFC 0030 decision 5
(setup kind
landmints one token with both sync and api scopes; kindspushandreadare unchanged); RFC 0028 Standing approvals (one standing grant now exists, the land grant, and no general one) - Tracks: tickets #398, #434, #458, #459, #460, #461, #462, #463, #464 and danmestas/zit#356.
Summary
Landing a branch through the forge works, and takes too much knowing. "Let my agent land on green" is held as three unrelated records, the workflow is 400 lines of curl in a guide, a refusal states a fact and stops, and nobody can read in one line what a landing is waiting on.
This RFC changes five things. Every refusal names the next step. Every
open landing says what it waits on, in one sentence the forge composes.
A stack is tested once, at its top. One narrow standing grant exists:
agent A may land onto branch B of repository R when B's required checks
are green, asked for and approved as one sentence and revoked in one
place. And a small client, quarry, has five verbs: login, whoami,
land, status and api. The guides then lead with the client, and
each line of them that names a command or a permission is run by a
test.
Nothing changes on the Fossil wire.
Motivation
On 2026-11-20 one agent tried to push a stack to a repository and land it on green for its person. What it met:
- Its push credential, made by setup kind
push, could not call the API. The API answered a bare 401, counted each retry as a failed sign-in, and locked the address out (#458). - A second token, minted with the repository written
OWNER/NAME, reached no repository and failed the same silent way (#462). - A read credential could not open a landing, and nothing short of three grants let the agent arm one (#459, #461).
- Three arming requests were approved and armed nothing: the call
without
ondisarms, and the approval read as success (#463). - A merge conflict arrived as a failed check with no run id (#460).
- The landings had been opened locally and never pushed (danmestas/zit#356).
- A stack of five queued about ten runs of eight minutes each on a runner that takes one at a time (#464).
- The guide was wrong about who may read a CI log.
Each was answered that day by somebody who knew the code. The owner:
We need to prioritize making it super easy for the human. I want to do one thing, be okay that it's done, and know what that is.
and
In the future, my users won't be able to just call you and ask you for what they need.
So the forge has to hold the answer itself, at the moment of asking.
The eight symptoms have five causes:
- Grants are shaped like the mechanism. A role, a token's scope and ceiling, and a place among a branch's owners are three records on three pages. Nothing names the combination, so it cannot be asked for, shown or revoked as one thing. RFC 0028 held standing approvals back "until real volume shows which asks recur". One ask recurs: land on green.
- No client owns the forge workflow. zit is a version-control
tool; its
landing acceptis the store's merge and knows nothing of the forge's gates. Every agent re-implements the guide's curl. The right shape exists twice for narrower jobs: the runner installer andquarry pickup. - Refusals state a fact and stop. The server knew the token was a valid sync token, and knew whether asking would be admitted, and printed neither.
- Nothing composes "what is it waiting on". The facts are spread
over
unmet,neverRan,stale,untested,autoBy,autoWaiting,stackArmedBy,landing.conflictsand the requests page. - Prose is written beside the code.
docs/api.mdis generated and tested;/llms.txtanddocs/agents.mdare written by hand and drift.
Principles
Each is a rule a change passes or fails. The test that holds it is named, and lands with the build step given.
- Every refusal names the next step. A 401, 403, 404 on a known
route, 409 or 429 body carries
next. Test: a walk of the op registry fails for a refusal path without one (step 2). - One goal, one consent, one place to revoke. Test: the journey tests count approvals; a named goal that takes more than one fails (step 20).
- One sentence, said everywhere. What an agent may and may not do
is generated from the grant record. Test: the approval page,
whoami, the agent's page and the email carry the identical string for one grant (step 14). - An agent never holds more than the sentence said. The token's scopes, reach and ceiling are derived from the record that renders the sentence. Test: for generated grants, the minted token's limits equal the derivation, and no call sets them beside it (step 11).
- Asking never makes things worse. A valid credential at the wrong door is told what it is and is not counted as a failed sign-in. Test: fifty wrong-door calls on a valid token leave its address unheld (in flight, #458).
- Every wait names who or what it waits on. Test: over a matrix
of landing states, no open landing and no pending request lacks
waiting.onand a non-emptynext(step 5). - A command finishes the goal or says what is left. No exit 0
with a silent second step. Test: each client verb's journey ends
in "done" or in a
nextline (step 20). - What the client does, curl can do. The client holds credentials
and calls zit; rules and sentences live in the forge. Test: the
client prints the server's
nextandwaiting.saybyte for byte, and a build check refuses a sentence template under the client's package (step 16). - A doc line that names a command or a permission is run by a
test. Test: commands in
/llms.txtanddocs/agents.mdare extracted and run against a test forge; permission claims are a table checked against the registry (steps 21 and 22). Anextmay name a client command only once the client has that verb (step 16). - Answer on the surface already in hand. This RFC adds no page: every step below names the existing page, op or download it changes. This one is held in review, not by a test.
Design
quarry is the client. Each example shows the whole output. The
repository dmestas/website is a placeholder.
Refusals carry next
writeError and writeCodedError take an optional object:
{"error": "this is a sync token; the API takes an api token",
"code": "wrong_scope",
"next": {"say": "Get an api credential for this agent with one approval.",
"call": "POST /api/v1/setup/start",
"cmd": "quarry login --for land",
"ask": false,
"help": "/llms.txt#credentials"}}
say is one sentence. call is the API call that takes the next
step. cmd is the client command for it, present once that verb
ships. ask says whether the same call sent with Quarry-Ask would
be admitted (from the admission check in internal/api/ask.go).
help is an anchor, never the top of a page.
Particular refusals:
- Wrong scope. A token that resolves for another scope gets
wrong_scopeand no limiter miss. It proved it holds a real credential, so exempting it gives a guesser nothing. The limiter is otherwise unchanged. - Empty reach. A token whose stored repositories match none gets a 403 that says so.
- 403. The capability sentence gains
askand the call that asks. - 429. The hold says which credential caused it, when it lifts, and that a correct sign-in is refused meanwhile.
- 404 on
landing/{64 hex}. Says the landing may exist only in a local store, and to push. - Sync refusal on a protected branch. A locally accepted merge pushed by a non-owner is told "land it on the forge", with the call.
What a landing is waiting on
landing.get and landing.list gain
"waiting": {"on": "checks", "say": "check \"test\" is running, 2m",
"who": "", "next": {...}}
on is one of checks, conflict, approval, stale, never_ran,
stack, protection, nothing. The server composes it from fields
that exist. who names the person an approval waits on. The landing
page's header, the email and the push notification print say.
- A conflict is a state of its own with its files, never a failed
check, and
landing.updatesays before writing that the merge would conflict and where. - Every check carries its
runId. - A landing lists the requests waiting about it: id, sentence, asked when, of whom. Three pending approvals are three named rows.
- A decided request says what happened, in the past tense, on its row and in its notification: "Armed !43: lands when build and test are green", "Already disarmed: nothing changed", or "Approved, did not run: the branch moved; ask again".
$ quarry status !43
!43 parse-docs -> trunk open, not landing
blocked conflicts with trunk in internal/web/web.go, docs/api.md
next zit merge trunk, resolve, zit commit, quarry land
A stack is tested once
An open stack gets one run: its top merged onto the stack's target. When that passes, every rung is green by inclusion. Branch runs and pair runs of the rungs below are not queued. A moved rung restarts the top's run and no other.
Green by inclusion holds only for landing the stack whole. A rung that
is to land without the rungs above it, or that leaves the stack, gets
its own run against the target first, and waiting says so (stack,
then checks). So no check-in reaches a branch that was not tested as
the thing that landed.
The land grant
A new, narrow record beside branch protection:
agent A may accept landings onto branch B of repository R, through the forge's accept path, when every required check on B is green.
It carries the agent, the repository, the branch, what it covers, who
granted it and when. landing.accept, landing.auto and
landing.land admit a caller who holds i as now, or a matching
grant. The agent's role does not carry i.
- Who may grant. A person who may themselves accept onto B: they
hold
ion R, and are among B's owners where B is protected. The grant is checked against that person at every use, so it never outlives or exceeds their own right (RFC 0021: never more than its operator). - What it covers. By default, landings opened by the agent or by the person who granted. "Any landing onto B" is a choice on the consent page, off by default, and changes the sentence. A third party's green branch does not land because someone else's agent was told to tidy up.
- Checked when it lands, not only when armed. The sweep that lands an armed landing re-reads the grant, the checks and the grantor's right. A grant revoked between arming and green lands nothing.
- Recorded as "landed by A for PERSON" on the landing, the timeline and the settings log.
- One place to revoke.
/me/agents/Aopens with the sentence and one "Revoke everything" control, which ends the grant and the token together. B's protection settings list land grants beside owners, each with the same revoke. After a revoke the next call answers 403 with anext.
Getting one. Two ways, both one approval:
- A new agent: setup kind
land(agent.setupandsetup/start, RFC- takes one repository and a target branch. One act makes the agent, grants role developer, records the land grant and mints one token, collected by pickup. All or nothing, as setup is now.
- An agent that exists:
landing.grant, sent withQuarry-Ask. It is one approval and it stands until revoked.
The token of kind land. One token, scopes sync and api,
reaching the one repository. Its ceiling is fixed by the kind and is
not an input: the developer role's letters, with those needed to open
and comment on landings and to read CI; never i, never a. This
amends RFC 0030 decision 5 for this kind only: that decision makes a
pushing credential sync only, and here one credential both pushes and
calls the API, so there is one thing to hold and to revoke and the
consent page states both scopes. No browser sign-in is possible with
it.
The sentence. One struct holds the grant. It renders the sentence and derives the token's scopes, reach and ceiling; nothing else sets them. The required checks are read from B when the sentence is rendered, so it stays true as they change.
website-land may push branches to dmestas/website, open landings, and land its own and yours on trunk when its required checks (build, test) are green. It may not land over a failed check, change settings, or reach any other repository. Revoke any time at Your agents > website-land.
Security invariants
The land grant keeps each of these. Each has one test named for it,
landed with the step given, and step 15 is an adversarial review that
tries to break them before kind land is offered on the forge.
- It never lands over red checks. A grant admits an accept only when every required check on B is green for the exact check-in that would land. Pending, stale, never-ran and conflict all refuse (step 12).
- It never uses override.
overrideon any accept call by a grant holder is refused, and a grant is not among the things that satisfy an override's own check (step 12). - It never writes the branch over sync. The sync front does not read grants. A grant holder who pushes a merge to protected B is refused exactly as before (step 12).
- It is refused when the branch has no required checks. At grant time, with the next step ("trunk has no required checks, so this would let A land anything; set them at ..."), and again at land time if they were removed since (steps 11 and 12).
- It is revocable in one place. One control ends the grant and the token; an armed landing does not land afterwards (step 14).
- The sentence and the limits have one source. The sentence the person approves is generated from the same record that sets the token's scopes, reach and ceiling (step 11).
- It never exceeds the grantor. A grantor who can no longer accept onto B grants nothing; the grant stops working without being deleted, and says why (step 12).
Unchanged and relied on: setup cannot grant admin, a client cannot choose its own ceiling, a token value is never printed or passed through a person, and approval happens only in a signed-in browser or the phone app.
The client
Five verbs in a new internal/forgeclient beside
internal/pickupclient, in the quarry binary and in the small
static download the forge serves at /runner/. That download becomes
quarry, a client-only build; quarry-runner stays as an alias of
it.
| Verb | Does |
|---|---|
login [URL] [--for land\|push\|read] |
Makes a pickup key, starts a setup, prints the code and link, waits, collects, stores the token in the OS keychain (a 0600 file where there is none), saves the zit remote and login |
whoami |
me.account and the sentence: may, may not, token life, revoke link |
land [BRANCH\|!N] [--stack] [--watch] [--ask WHY] |
Pushes if the forge lacks the tip, opens a landing if none is open, arms it, says what it waits on |
status [!N] [--watch] [--log] |
Prints waiting; --watch follows the event stream to the outcome; --log prints the failed step's tail |
api METHOD PATH [-d JSON] [--ask WHY] |
Any op with the stored token, never on the command line |
$ quarry login --for land
Open https://zeitforge.app/setup and type KQ4T-9XWM (10 minutes)
Waiting for your approval ...
Signed in to zeitforge.app as website-land, an agent of dmestas.
may push to dmestas/website; open landings; land its own and
yours on trunk when build and test are green
may not land over a failed check; change settings
token in the login keychain; ends after 90 days unused
revoke https://zeitforge.app/me/agents/website-land
Next: quarry land
$ quarry land --stack
Pushed 3 branches to dmestas/website.
!41 parse-fix -> trunk opened
!42 parse-tests -> !41 opened
!43 parse-docs -> !42 opened
Armed. The stack lands itself when its top is green (build, test).
Follow it: quarry status !43 --watch
Rules:
- No logic the API lacks. Errors print the server's
next; status prints the server'swaiting.say. - No approving from the terminal. Approval stays on the web and the phone, where a signed-in person is proven. The terminal prints the link, waits, and prints the outcome: one browser visit per goal, none after.
--helpon each verb fits one screen and ends with an example.-F jsonon every verb. Exit codes followpickupclient: 0 done, 1 refused, 2 usage, 3 still waiting.landexits 0 once armed; with--watchit exits non-zero if the landing does not land.- Five verbs. A sixth needs a journey that fails without it.
zit lists login, land and status as pass-throughs, the way
zit ui runs quarry ui ($ZIT_QUARRY, else quarry on the path).
The code is quarry's: zit carries no forge call, no token store and no
pickup, and a stock fossil user lands without zit.
Guides proven by code
/llms.txtopens with the three commands above. The wire format moves behind one link, to anchors in the generateddocs/api.md, and stays tested.- Commands in
/llms.txtanddocs/agents.mdare extracted and run against a test forge. "Who may" claims are a table checked against the registry'sCapsandAuth. GET /api/v1gains each op's needed letter and whether an agent may ask for it.docs/landings.mdnames the forge path first and no longer giveszit landing acceptas the way to land on a forge.
Fossil compatibility
No wire change: no new card, artifact, pragma or sync behaviour. The
land grant, waiting, next and the stack run are forge records and
API fields, outside the repository. The sync front still decides a
push by letters and branch protection alone and does not read grants.
The client works beside fossil push and fossil clone as it does
beside zit: a stock fossil user pushes a branch with fossil and runs
quarry land BRANCH.
Already in flight
Counted toward the stages below, and not repeated as steps:
| Work | Counts toward |
|---|---|
| !1396: a token is replaced with one approval | Principle 2; stage A |
| !1397: a repository-limited token reads its own sign-offs | Stage B (#461 item 6); the client's wait loop in step 16 |
branch for #458: a wrong-scope token gets wrong_scope and is not counted toward the lockout |
Principle 5; step 1 adds its next and closes the ticket |
branch for #462: OWNER/NAME resolves on token and grant ops |
Step 3 finishes and closes the ticket |
branch for #463: landing.auto requires on; the approval says arm or disarm |
Step 7 finishes and closes the ticket |
danmestas/zit#356: landing open does not push |
Step 23, in zit's repository; step 4 covers the forge's side |
Build order
Each step is one landing and lands alone. "Sign-off" marks a step that changes something a person sees: the owner approves the real output on real data before it lands. "Needs" lists earlier steps; a step with none can start now.
Stage A. Refusals that teach
nexton errors, and the wrong-door refusals. Thenextobject onwriteErrorandwriteCodedError;wrong_scopeand the 429 hold carry it; the kinds table in the guides says apushtoken cannot call the API and that a public CI log needs no token. Test: a sync token at the API getswrong_scopewith anext, fifty times, and its address is not held. Needs: the #458 branch. Closes #458.askon a 403, and no refusal withoutnext. Test: the registry walk of principle 1; a 403 whoseaskis true succeeds when resent withQuarry-Ask. Needs: 1.- Empty reach is a 403 that says so; pages show resolved
repositories. Test: a token minted with
OWNER/NAMElands a call on the repository; one whose reach matches nothing gets the 403 and no limiter miss; the approval page andme.accountlist resolved names. Needs: 1, the #462 branch. Closes #462. - The local-only and forge-path hints. The 404 on a 64-hex
landing id; the sync refusal on a protected branch. Test: each body
carries its
next. Needs: 1.
Stage B. What it is waiting on
waitingonlanding.getandlanding.list. Test: the matrix of principle 6. Needs: 1.- Conflict as a state, the update preflight, and
runIdon every check. Test: a conflicting branch readswaiting.on: conflictwith its files and has no failed check;landing.updaterefuses beforehand and names them; every check on a landing has a run id that fetches its log. Needs: 5. Closes #460. - A landing lists its requests; a decided request says what happened. Test: three pending asks are three rows with distinct sentences; approving an arm reads "Armed ..." and approving a disarm of an unarmed landing reads "Already disarmed: nothing changed". Needs: 5, the #463 branch. Closes #463.
- The landing page, email and push print
waiting.say. Sign-off. Test: one landing in each state shows the same string on all three, by data hook. Needs: 5, 6, 7.
Stage C. A stack is tested once
- One run at the top. Rungs green by inclusion; branch and pair runs of lower rungs not queued; a moved rung restarts only the top's run. Test: a five-rung stack queues one run; moving rung two cancels and queues one. Needs: none.
- A rung landing alone is tested alone. A split, or an accept of
a rung without those above it, queues that rung's own run and
waits on it;
waitingreadsstackfor a rung held by inclusion. Test: accepting rung one of a green stack by itself does not land until its own run is green. Needs: 5, 9. Closes #464.
Stage D. The land grant
- The record, the sentence and the derivation. Storage;
landing.grant(askable),landing.grant.list,landing.grant.revoke; refusal when B has no required checks. Test: invariants 4 (grant time) and 6. Needs: 2. - The accept path honours the grant.
landing.accept,landing.auto,landing.landand the sweep admit a matching grant; coverage defaults to the agent's and grantor's landings; "landed by A for PERSON". Test: invariants 1, 2, 3, 4 (land time) and 7; a third party's landing is refused under the default and admitted under "any". Needs: 10, 11. - Setup kind
land.agent.setupandsetup/starttake the kind and a branch; one transaction makes agent, role, grant and token. Test: an approved request yields a token with scopessyncandapi, one repository and the kind's ceiling; a forced grant failure leaves no account. Needs: 3, 11, 12. Closes #459. - The consent page, the agent's page and the protection list. Sign-off. The sentence, the "any landing" choice, "Revoke everything", grants listed beside B's owners. Test: principle 3; invariant 5. Needs: 13.
- Adversarial review of the grant. A reviewer who did not write
steps 11 to 14 tries each invariant; every finding becomes a test.
Kind
landis switched on for the forge only after it. Needs: 14.
Stage E. The client
forgeclient, the client-only build,loginandwhoami. The/runner/download becomesquarrywithquarry-runneras an alias;--for pushand--for readwork at once,--for landafter step 15. From here anextmay carrycmd. Test: against a test forge,loginends with a stored token and no value on the terminal; principle 8's build check; everycmdin anextnames a verb the build has. Needs: 2.api. Test: a call with--askfiles a request and exits 3 while it waits; the token never appears in the process list. Needs: 16.status. Test: eachwaiting.onprints its three lines;--watchexits when the landing lands;--logprints the failed step. Needs: 6, 7, 16.land. Test: from a checkout with an unpushed branch, one command ends with the landing open and armed;--stackopens a chain and arms it; a refusal prints the server'snext. Needs: 15, 18. Closes #461.- The journeys run in CI. New person with
login --for land; an agent landing a stack; a person asking why not; an agent refused and recovering with--ask. Each as written above, approvals counted. Test: principles 2 and 7. Needs: 19.
Stage F. Guides proven by code
GET /api/v1carries letters and askability; the permission table test. Test: changing an op'sCapswithout the guide fails. Needs: 2.- The guides lead with the client.
/llms.txt,docs/agents.mdanddocs/landings.mdas under Guides proven by code. Test: extracted commands run green;/llms.txtis shorter than at the start of this RFC. Needs: 20, 21.
Stage G. The zit seam (landed in zit's repository, tracked there)
zit landing openpushes, or says plainly that it has not. danmestas/zit#356. Needs: none.zit landing acceptwith a saved remote says it merged locally and that no forge gate was consulted. Needs: none.zit login,zit landandzit statuspass through toquarry. Needs: 19.
Done means #398's own test, for landing: a cold agent given only the forge's address lands a branch on green with one approval and no question to anyone but its person. #398 and #434 stay open for their other items.
Not in this RFC
- No general standing-approval engine. One grant recurs; it is built.
- Agents are not made branch owners as a shortcut to landing.
- No forge call, token store or pickup in zit.
- The client does not mirror the API: five verbs, one of them
api. - No MCP server, SDK, TUI, dashboard or second documentation site.
- The sign-in limiter is not loosened in general.
- A new confusion is not answered with more prose in
/llms.txt: the refusal is fixed, or the line is generated.
Decisions
Settled by the owner on 2026-11-20 ("Yes, build it all"):
- The forge workflow lives in a small quarry client. zit lists
login,landandstatusas pass-throughs, the wayzit uiruns quarry. - A standing "may land" exists as a narrow land grant: not branch ownership, and not a general standing-approval engine.
- A land grant covers landings opened by the agent or its person by default. "Any landing" is a visible choice on the consent page.
- Setup kind
landmints one token with sync and api scopes, limited to the repository. This amends RFC 0030 decision 5 for this kind. - A valid token at the wrong door is not counted as a failed sign-in.
- The verbs are
login,whoami,land,statusandapi. The download isquarry, client-only, withquarry-runnerkept as an alias. - No approving from the terminal. Approval stays on the web or the phone; the terminal prints the link, waits, and prints the outcome.
/llms.txtleads with the client; the wire format is one link away and still tested.
Decided here, reversible:
nextcarries the API call from step 1 and the client command only once the verb exists. Reason: a refusal must not name a command nobody can run.- A land grant is checked against its grantor at every use. Reason: an agent never holds more than its person (RFC 0021), and a grantor who leaves must not leave a standing grant behind.
- A grant is re-read when an armed landing lands. Reason: a revoke has to stop what was already armed, or "one place to revoke" is not true.
- The sentence names the branch's required checks as they are when read, not as they were when granted. Reason: the sentence must stay true; a branch left with none refuses the grant instead.
- Testing a stack once (#464) is a stage of its own, before the grant. Reason: "green" for a rung has to be defined before a grant may act on it.
- Kind
landtakes one repository and one branch. Reason: the sentence stays one sentence; a second repository is a second approval. - The grant is its own review step, and kind
landis off on the forge until it passes. Reason: it is the one change here that lets something reach a protected branch without a person present.