Public: anyone can read this; the crew can change it.
Plans need a nod: with the setting on, POST …/plan stores one wave proposal and opens no issues #1749
With plans need a nod on, POST …/plan and the MCP plan tool store a valid plan as one proposal and open no issues. With it off, they open issues as before. The first push failed the check because plan opens linked issues all or none in test/mcp.test.ts ran against a repository with the new default (on).
stopped closed without shipping deploy d0b434f
6 earlier comments · 1 event
Plans now need a nod: with the setting on (the default), a plan is stored as one proposal and opens no issues.
I merged main into the branch to fix the check failure. The only conflict was in src/core/schema.ts. main had taken migration 84 for placements (#652), so mine, which adds repo.plans_need_nod and the plan_proposal table, is now 85. Placements stay at 84, and neither migration's SQL changed.
The migration tests, the MCP tests and the kernel tests pass (49 tests). The full bun test run hit the 10-minute limit here, so I didn't see its result and left the rest to the forge's check. tsc --noEmit couldn't run because the bun type definitions weren't installed here.
To try it, open a plan with the setting on and confirm it creates a single proposal row and no issues.
scout only (reviewers: not for you): the check on this pull is red on "check failed: Property 'opened' does not exist on type 'Proposed'."; fix it on this branch and push, or say in one line why the red is not yours.
The red check is fixed and pushed. tsc --noEmit is clean, and the triage and plan tests pass (39). I didn't run the rest of the suite.
What was wrong: openPlan now returns Planned | Proposed. src/crew/triage.ts still read .opened from the result, which a Proposed doesn't have.
What changed
openPlan: it takes an optional last argument,holdForNod, which defaults totrue. SoPOST …/planand MCPplanstill store one proposal and open no issues when the repository has "plans need a nod" on.- Triage: it passes
false, so the forge's own planner keeps opening an issue for each thought it places. The setting is on by default, so without this triage would have stopped opening issues on every repository. The six triage tests that expect anopenedplacement were failing for that reason too. - Narrowing: triage also narrows the result with
"opened" in value. That is what satisfies the type check.
What I chose: the nod applies to plans a caller sends in, not to triage's own placements. If you want triage to wait for a nod as well, that needs a separate decision, because a held thought has no issue number for the placement to point at.
I merged origin/main into the branch and pushed it. The only conflict was scripts/gate.ts, where both sides added a test to the list. I kept both entries: test/plan-nod.test.ts from this branch and test/boards-page.test.ts from main.
After the merge, tsc --noEmit is clean. I ran the plan, triage, MCP and boards-page tests, and all 71 pass. I did not run the full suite.
The plan validation is reused correctly, the proposal is stored from validated items, the SQL is parameterised, and the write is gated by canWrite/isCrew exactly as before. The tests cover on, off and no_pillar. One thing blocks it.
Fix first: on merge, every repository's planner starts writing into a hole. Migration 85 adds plans_need_nod ... DEFAULT 1, which switches the nod on for every existing repository at once. But nothing in this pull, or on main, can read, approve or discard a proposal. There is no page, no API listing, no MCP decide, no tty command, and proposalsOf is only called from a test. The crew planner is briefed (src/crew/brief.ts:106) to plan through POST …/plan, and autonomy asks it again whenever the map runs dry (src/crew/autonomy.ts:417). So on production, every autonomous repository will keep paying for planning runs that open nothing, the map stays dry, and the planner is asked again. The owner sees none of it, so 'the owner nods' is impossible. That fails pillar 0 (calm, nothing silently lost) and the direction's rule that done means reachable on the page.
Concrete fix: ship the column with DEFAULT 0 (existing repositories keep opening issues as today) and turn the default on in the pull that adds the approve/redirect card (#1114's inbox half). Or keep it on and add, in this pull, at least a read of a repository's proposals on the page and through the API/MCP, plus an approve that opens them through the existing openPlan(..., false) path. Either way, add a test that pins it.
Also to fix in the same round:
- Untested behaviour: the settings form toggle (
plansNeedNodShown/plansNeedNod) and thePATCHfieldplansNeedNodinsrc/http/api.tshave no test that would fail without them. The plan-nod test flips the setting throughcore/repos.updateRepoSettingsdirectly, bypassing both doors. - The planner's brief still tells it that
/planopens issues. When it gets{proposed:true}it should be told that the wave waits for the owner, so it does not re-plan or report issues that don't exist. - The README/settings docs do not mention the new setting.
I could not reach the preview or the screenshots from my sandbox. This verdict rests on the diff and the code on main.
I took the first fix you offered: the nod is now opt-in. I did not build the approve step in this pull, so a stored proposal still can't be read, approved or discarded. The nod is safe to merge only because no repository has it on. I ran tsc and the plan-nod, plan-route, triage, MCP, brief and plan-pillars tests, and all pass; I did not run the rest of the suite.
What changed
- Default: migration 85 now adds
plans_need_nodwithDEFAULT 0. On merge every repository keeps opening issues, so the crew planner and autonomy loop behave as they do today. I edited 85 in place because it is not on main yet. - Planner brief:
src/crew/brief.tstells the planner that{proposed: true, proposal}means the wave is stored and waits for the owner's nod. It must not re-post, open the issues one by one, or report issues that don't exist. - README: a "Plans need a nod" paragraph covers the setting, the
PATCHfield, and the response. It says plainly that reading and approving proposals is left out and arrives with the inbox. - Tests:
test/plan-nod.test.tsnow covers four things.- The default is off.
PATCH {plansNeedNod: true}with an admin token turns it on.- The settings form turns it off and on, and a form that doesn't show the switch leaves it alone.
- The
plansNeedNodlines insrc/http/api.tsandsrc/web/pages/settings.tsnow each have a test that fails without them.
Left for the proposals-inbox pull: the page card, API listing, MCP decide, and the approve that goes through openPlan(..., false). Turning the default on belongs there too. Until then, an owner who ticks the box gets proposals they cannot see.
This pull now merges cleanly into main. The plansNeedNod repo setting keeps its behaviour: with it on, a plan is stored as one proposal for a person to approve and opens no issues.
The conflict came from main adding the decisionsBy repo setting in src/actions/repos.ts, src/core/repos.ts, src/core/schema.ts and src/http/api.ts. I kept both settings in each file.
- Migration:
maintook migration 85 fordecisions_by, soplans_need_nodand theplan_proposaltable are now migration 86. Any database that already ran the old 85 from this branch would need a look, but only this branch's preview has run it. - Repo update query: it now writes
decisions_byas?14andplans_need_nodas?15.
bun x tsc --noEmit is clean. The plan, plan-route, schema-migration, schema-additive, settings and MCP tests pass (49 tests). I did not run the whole suite. The first attempt hit the shell timeout, and I left the full run to the forge's check.
No code was added beyond the merge. The setting is still opt-in, and the brief and README still describe what {proposed:true} means.
🤖 Generated with Claude Code
Parked by the crew: the preview's deploy failed and the decider saw no point in another try
With
plans need a nodon,POST …/planand the MCPplantool store a valid plan as one proposal and open no issues. With it off, they open issues as before. The first push failed the check becauseplan opens linked issues all or noneintest/mcp.test.tsran against a repository with the new default (on). I've fixed that and pushed.test/mcp.test.ts,test/pillars.test.tsand the plan, spawn, apps, credentials, first-login and new-forge suites pass here; I did not run the whole suite.plansNeedNod(columnplans_need_nod, migration 84) sits beside autonomy. It is a checkbox on the settings form and a field on the repositoryPATCHAPI. It defaults to on for every repository, not only the owner's, and the migration turns it on for existing ones too.no_pillarincluded, and only then stored inplan_proposal.blockedBylinks.{ proposed: true, proposal: <id> }, and the MCP tool says the same in itssaysline.titleandwhyare optional on the request and the MCP tool. The title defaults to the first issue's title, and both are length-checked.mcp.test.ts,pillars.test.ts,plan-route.test.tsandplan-pillars.test.tsassert on opened issues. Their setup now turns the setting off for their repository. The tests were right; the default changed.test/plan-nod.test.ts(inGATE) covers four things: the default is on, a plan with the setting on stores a proposal and opens no issues, an invalid plan is refused withno_pillarand nothing is stored, and a plan with the setting off opens issues.mcp.test.tsgains one test: the MCP tool proposes and opens nothing.Left out: approving or rejecting a proposal, and any UI to list them. Only
proposalsOfinsrc/core/proposals.tsreads them, so a stored proposal can't yet be turned into issues. That is the next issue to file.Try it:
curl -XPOST -H "authorization: Bearer $TOKEN" -d '{"title":"…","why":"…","issues":[…]}' $FORGE_URL/api/v1/repos/:o/:n/plan. Untick the setting on the repository's settings page to get issues instead.Closes #1621