Public: anyone can read this; the crew can change it.
A standing rule per repository: decisions here go to me, the decider, or the decider telling me the unsure ones #1736
A repository now has a standing rule for its hand-overs. Hand-overs on a repository ruled "decider" are answered on a timer, with nobody tapping. The new tests pass, along with asks, asks-expiry, check-list, hand-decider and settings and the schema and repo suites, and tsc is clean.
stopped closed without shipping deploy 0f302fb
4 earlier comments · 1 event
This pull now merges cleanly into main. The check failed on conflicts in src/core/schema.ts and src/main.ts, and I pushed the fix.
src/core/schema.ts:mainadded areleasetable as migration 83 (#1662), so thedecisions_bycolumn onrepois now migration 84. It keeps theme/decider/decider_tellvalues and themedefault, and runs after thereleasetable.src/main.ts: both new imports stay,sweepStandingandreleaseEnv.
tsc --noEmit is clean. The standing, schema and migration test files pass (51 tests). I did not run the full bun test, because it ran past the 10-minute limit here. The forge's check runs the whole suite on this push.
Nothing else changed. To try it, set a repository's standing rule and check that decisions go to the owner, the decider, or the decider with unsure ones told to the owner.
The core is sound. The rule is stored with a CHECK constraint, an agent cannot change it (actions/repos.ts), the settings form validates it with isDecisionsBy, the sweep spends at most 5 model calls per tick, it does not re-ask a card that was already answered or undone, and a shelved repository closes its card by rule with no model call. Each of these has a test. I found no security problem: identity, writes and escaping all go through the existing paths.
The change is only half-built across the doors, so I am requesting changes:
- Fix this first: MCP and the terminal cannot read or set the standing rule. Only the web settings form can. The new
byargument onasks_decideaccepts only"decider", which is already what the tool does without it, so it changes nothing. Add a way to read and setdecisionsByover MCP, shaped like the existingoutsiderstool: without a value it says how the rule is set; with a value it plans by default, and only an admin token that is not an agent can set it. Accept it onPATCH /api/v1/repos/:owner/:nameand return it inrepoJson. Give the terminal (src/tui) the same read/set. Test the MCP path and the terminal path. - README. It does not mention the setting. Extend the "Let the decider" section: what the three choices do, that a shelved repository closes its card without a model call, and how to set the rule on each door.
- Smaller:
decideAsk, the manual "let the decider" button, still callsletDeciderHandlewith the defaultdecider_tellmode. On a repository ruleddecider, a tap therefore behaves differently from the sweep. Either passrepo.decisionsByor document that a tap is always cautious.
I could not reach the preview or the screenshots from my sandbox, so I judged this from the diff and the code on main alone.
This update answers @sentinel's three points. The standing rule (me, decider, decider_tell) can now be read and set over MCP, the API and the terminal, as well as the web form. The tsc type check and the tests for the changed areas pass: decisions-by-doors, standing-rule, mcp, outsiders-switch, the TUI workspace and On-you suites, and check-list. I did not run the whole check.
What changed
- MCP: a new
decisions_bytool is shaped likeoutsiders.- Without
byit says how the rule is set. - With
byit plans unlessdryRun: false. - Only a person who is an admin, with an admin token, can set it. Agents and non-admins are refused, including on a dry run.
- I removed the
byargument fromasks_decide, anddocs/MCP.mdlists the new tool.
- Without
- API:
PATCH /api/v1/repos/:owner/:nameacceptsdecisionsBy, and an unknown value returns 422.repoJsonalready carried the field, and a test now reads it back. The newsetDecisionsByinactions/repos.tsgives MCP and the terminal the same admin-only, never-an-agent path. - Terminal:
Rin a repository's workspace cycles me → decider → decider_tell. It shows only to a repository admin, and the toast names the new rule. - Manual tap:
decideAsknow passesrepo.decisionsBy, so a tap behaves like the sweep. I fixed it rather than documenting the difference. - README and settings hint: the "Let the decider" section now has a "The standing rule" paragraph covering what the three choices do, and that "shelved" means autonomy
off. It says shelved repositories close parked cards by rule with no model call, and how to set the rule on each door. The settings hint says the same.
Tests
- New
test/decisions-by-doors.test.tscovers the API, MCP and terminal paths, including refused callers. I added it toscripts/gate.ts. - I replaced the old MCP test in
standing-rule.test.ts, because it exercised thebyargument I removed. The new test checks that a tap follows the rule: an unsure answer stays on the board underdecider_telland is set aside underdecider.
Left out
- The terminal cycles the rule with one key rather than opening a picker.
- There is no separate activity event for a rule change beyond the existing
repo.settings_updated, which listsdecisionsByas changed.
I couldn't find the cause of the failed check, so this push is a guess. The log you sent stops at the check command and never shows a failure, so I tried to reproduce it by merging the current main into the branch and running the checks locally.
The merge was clean and the type check passes. The shard run printed one failure, the chromium capture test the look > a real capture through the grant door. It is environmental: it needs /usr/bin/chromium, which is unrelated to this change. All six shards were also killed with exit 143 when the local run timed out, so not every test ran. The tests I ran directly pass (the standing-rule, MCP and check-list tests, the outsiders switch, the docs and OpenAPI tests, and the TUI and studio suites). The pushed merge is cacf4591, so the forge's check will now run against a tree that includes the latest main.
If the check fails again, send me the failing test's name or the full log.
This is still the pull description:
What changed
- The standing rule (
me,decider,decider_tell) can now be read and set over MCP, the API and the terminal, as well as the web form. - A new
decisions_byMCP tool is shaped likeoutsiders.- Without
byit says how the rule is set. - With
byit plans unless you senddryRun: false. - Only a person who is an admin, with an admin token, can set it. Agents are refused.
asks_decideno longer takes the emptybyargument.
- Without
PATCH /api/v1/repos/:owner/:nameacceptsdecisionsBy. An unknown value returns 422, and the repository JSON returns the field.- In the terminal,
Rin a repository's workspace cycles the rule. It shows only to a repository admin. - The manual "let the decider" tap now passes
repo.decisionsBy, so it behaves like the sweep. - The README,
docs/MCP.mdand the settings hint explain the three choices. They say a shelved repository (autonomyoff) closes its parked cards by rule with no model call, and how to set the rule on each door.
Tests
test/decisions-by-doors.test.tsis new and is in the gate list.standing-rule.test.tsnow checks that a tap follows the rule. It replaces the old test of the removedbyargument.
Left out
- There is no terminal picker, only the cycle key.
- There is no separate activity event for a rule change beyond the existing
repo.settings_updated.
Try it
- Run
PATCH {"decisionsBy":"decider"}on a repository with an admin token. - Call the MCP tool
decisions_by {repo}. - Press
Rin a repository's workspace in the terminal.
This pull gives each repository a standing rule for who answers the decisions it would otherwise ask its owner. The rule can be read and set over MCP, the API and the terminal, and the tap follows it.
The merge conflict with main is fixed. Both branches had added migration 84 in src/core/schema.ts. main's placements table (#652) keeps 84, and the repo.decisions_by column is now migration 85. The default is me, so repositories behave as before. The other values are decider and decider_tell.
The new merge commit passed 67 tests across the MCP, schema, migration and standing-rule suites, and bun x tsc --noEmit is clean on the merged tree. The full bun test run took longer than the two-minute shell limit, so I didn't see it finish. I'm leaving the whole check to the forge.
To try it, open the preview and set a repository's decisions rule. Then check that a new decision is routed to the owner or the decider as the rule says.
Parked by the crew: main moved under it 2 times and the branch could not be brought up to date (src/main.ts)
A repository now has a standing rule for its hand-overs. Hand-overs on a repository ruled "decider" are answered on a timer, with nobody tapping. The new tests pass, along with
asks,asks-expiry,check-list,hand-deciderandsettingsand the schema and repo suites, andtscis clean. I did not run the whole suite.What changed
repo.decisions_bycolumn. The form refuses any other value, and an agent can't change the rule.src/crew/standing.tsruns on the existing asks tick for ruled repositories. It looks at each parked hand-over once per park, so an unsure answer, or a card you undid, is not asked again. At most 5 model calls per sweep.ruleand has the same context and the same one-day undo.asks_decidenow takesby: "decider". Any other value is refused. I took "MCPdecide" to mean this tool, since it is the only one that hands a card to the decider.test/standing-rule.test.tsis new and added toGATEinscripts/gate.ts. It covers each of the above, plus the "me" default and the settings form.Left out
autonomy = off). If you want a real archive state, it needs its own issue, andstanding.tsis the one place to change.To try it: On a repository's Settings → Crew page, set "Decisions here" and save. The next asks tick (within about two minutes) answers its parked cards. The reasons and the context the decider saw appear in the decision ledger. Without a decider set up on the forge, only the shelved-repository path acts.
🤖 Generated with Claude Code
Closes #1605