Skip to content

fix(conductor): write the plan's worker count as the goal's concurrency cap - #37652

Closed
buluoray wants to merge 1 commit into
mainfrom
crew/slack/plan-concurrency-cap
Closed

buluoray wants to merge 1 commit into
mainfrom
crew/slack/plan-concurrency-cap

Conversation

@buluoray

@buluoray buluoray commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Part of #37361

Problem / Motivation

Goal: A Bot runs no more workers at once than its approved plan said, unless the user raises the number.

A goal conductor's plan names its concurrency ("two or three"), but nothing writes that number into the work ledger. The ledger's concurrency_cap stays at its default of 32, so the plan's number is prose that nothing enforces. In the report on #37361 the Bot ran far more workers at once than its plan said.

Why it matters

Every worker the conductor starts beyond its plan costs model time, opens more pull requests and makes the goal harder to follow. The ledger already refuses a create past concurrency_cap; it just never receives the plan's number.

Not a goal

What changed (motivation → approach → change)

The plan's worker count never reached the ledger, because the rules told the conductor to write concurrency_cap only for a bound the user set. The conductor now writes the number its approved plan named as concurrency_cap, with the goal record, before its first create. A number the user sets wins. A range like "two or three" writes the upper end. Only the user can raise it. The plan has to state concurrency as one number of items running at once. The goal-conductor skill (src/kiro_crew/builtin_skills/goal-conductor/SKILL.md), the two conductor prompt rules, the concurrency_cap parameter text of work_ledger_record and the work-ledger doc now say the same thing.

This changes a recorded owner decision. rfc-work-ledger-concurrency-cap.md §7.2 says only a number the user sets is concurrency_cap, and resource_status sizes each wave. This PR counts the number in a plan the owner approved as one the user set. The RFC for #37361 (#37649, merged as a draft) lists this as open decision 7, with the recommendation "yes". It is not decided yet, so this PR waits on the owner's decision before it merges.

Backwards compatibility

Compatible: only instructions and a parameter description change; the ledger accepts the same concurrency_cap values (1 to 32) and a goal with none written keeps the default of 32.

Removes nothing: no field, path, validator or record is removed or narrowed.

Tests

test/test_conductor_plan_concurrency_cap.py pins that the goal-conductor skill, the conductor's resource_wave and spend_bounded rules, and the concurrency_cap parameter description all tell the conductor to write the plan's number as the cap before the first create, and to raise it only on the user's word. All five tests fail on the parent commit and pass on this head. Reverting only the SKILL.md change turns the two skill tests red (prove.py cannot revert Markdown, so that check was by hand).

test/test_agent_refactor_spec_bytes.py and test/test_agent_refactor_contracts.py pin the bytes of the written conductor specs and of _CONDUCTOR_SYSTEM_PROMPT. Their stored digests for kirocrew-conductor.json, kirocrew-ledger-conductor.json and _CONDUCTOR_SYSTEM_PROMPT are refreshed to the new prompt text; no other digest moved.

Proof: PROVEN test/test_agent_refactor_contracts.py::test_every_pre_split_name_resolves_with_its_pre_split_shape, test/test_agent_refactor_spec_bytes.py::test_every_written_spec_matches_the_pre_split_bytes[clean_over_customized], test/test_agent_refactor_spec_bytes.py::test_every_written_spec_matches_the_pre_split_bytes[customized], test/test_agent_refactor_spec_bytes.py::test_every_written_spec_matches_the_pre_split_bytes[forks], test/test_agent_refactor_spec_bytes.py::test_every_written_spec_matches_the_pre_split_bytes[fresh] (head 9fb1f89)

Determinism: 20/20 runs at -n0, 10/10 at -n 4 beside test/test_mcp_work.py and test/test_mate_conductor_parity.py, and green in a shuffled order. The tests only read static text, so no clock, thread or shared state is involved.

Manual verification

N/A — the change is prompt and skill text, and the tests read the exact text a conductor receives.

Related Issues

Part of #37361

Sibling sweep

Swept: git grep -n "concurrency_cap\|a bound the user set" -- src/
Sibling: src/kiro_crew/agent_parts/spec_prompts.py -- changed here
Sibling: src/kiro_crew/mcp_work.py -- changed here
Sibling: src/kiro_crew/docs/work-ledger.md -- changed here
Sibling: src/kiro_crew/work_ledger_writes.py -- not affected -- its refusal already says only the user raises the cap

Pattern harvest

Not generalizable: the defect is one rule that named only the user's number as the cap; it has no code shape a lint could match.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 15, 2026 17:39
@buluoray
buluoray enabled auto-merge (squash) November 15, 2026 17:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 7f9f171058898b1cb49ebd23356bad762e929df1 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🔴 BLOCK

Premise-level review of 7f9f171058898b1cb49ebd23356bad762e929df1 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: BLOCK

Product-shape change without accepted RFC: every goal conductor now writes its own plan's worker count as concurrency_cap by default. The implemented RFC §7.2 says the opposite, and the RFC for #37361 is still draft.

Notes

What this change ships

Inventory (5 items) — 2 justified

Intent: a Bot runs no more workers at once than its approved plan said. FIX in name, but it reverses a default.

  1. A goal's plan must give concurrency as one number of items running at once — rides along
  2. By default the conductor writes the plan's number into concurrency_cap before its first create — undeclared as a default change: it reverses §7.2
  3. The conductor no longer "carries no number of its own" (wave rule rewritten in the skill, resource_wave and spend_bounded) — symptom-level
  4. The concurrency_cap parameter text and the work-ledger doc now say the plan's number is the cap — justified
  5. Spec-byte and prompt digests refreshed, plus new text-pin tests — justified

Blockers

product-shape change without accepted RFC: the conductor caps its own concurrency by default — product-shape
Trigger: item 2. resource_wave changes from "Carry no number of your own: a bound the user set is the goal's concurrency_cap" to "The concurrency your plan names is the goal's concurrency_cap: write it … before the first create". rfc-work-ledger-concurrency-cap.md (implemented), §7.2: "It is the user's way to set a bound". rfc-goal-limits-and-done-check.md is draft on the base. The description admits: "It is not decided yet."
Outcome: every goal conductor, Bot and Ultra Mode, gets a cap the owner's §7 decision removed, and nobody has recorded a decision to bring it back.
Clears when: an RFC covering "the plan's concurrency becomes the goal's concurrency_cap" is merged as non-draft on the base (then push or rebase), or a maintainer posts /ai-review override first-principles 7f9f171058898b1cb49ebd23356bad762e929df1 product-shape: <decision>.

[FIRST-PRINCIPLES-REVIEWED] 7f9f171

Description read

[DESCRIPTION-READ] c83670a9c59a21ae2446061744d6c7b364ae94a015a168ae3a2fc25ed280cc3b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 7f9f171058898b1cb49ebd23356bad762e929df1 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The change only edits prompt text and a reversal is a clean revert. It does go against RFC §7.2 ("a bound the user set is concurrency_cap"), and the author says it waits for the owner's decision.

Notes

  • docs/request-for-change/rfc-work-ledger-concurrency-cap.md §7.2 is not in the diff. If this merges, the RFC will say only the user's number is the cap while the skill, both prompt rules, mcp_work.py and work-ledger.md say the plan's number is too. Once the owner decides, update §7.2 or supersede it in the same commit.
  • Only the prompt enforces "raise it only when the user says so": the conductor can still raise the cap itself with action=goal concurrency_cap=<N>. If the report on A Bot given a goal does not converge: it creates work for itself faster than it closes it, and the owner cannot tell where it stands #37361 recurs, the next step is to move the plan's number, or the right to raise it, into code.
  • The diff also changes the kirocrew-team-lead.json digests, but the description lists only the conductor and ledger-conductor specs as moved. Either confirm that the team lead now getting the same cap rule is intended, or name it in the description.

[DESIGN-REVIEWED] 7f9f171

Description read

[DESCRIPTION-READ] 5f90a5a71b76f124fa500b457b0f5dfbe39ed9301351f33dad1bf81aa77dffa5

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — 🔴 changes requested (blocking)

Reviewed 7f9f171058898b1cb49ebd23356bad762e929df1 — this comment is updated in place on each push.

Blocking: this PR overturns the repository owner's accepted §7.2 decision on concurrency_cap, and nothing amends it. The draft RFC that would authorize the change says this PR waits on its open decision 7 and closes if that decision is not accepted.

BLOCKING — src/kiro_crew/builtin_skills/goal-conductor/SKILL.md:616
+ with the goal record, before the first create: the number the user set, / + else the concurrency your approved plan named. A plan that says "two or
Trigger: a goal conductor (team lead, or a Bot through _LEDGER_CONDUCTOR_RULES["resource_wave"] / spend_bounded in spec_prompts.py) writes a plan naming "two or three" workers. It then calls work_ledger_record action=goal concurrency_cap=3, and the 4th create hits live.concurrency_cap in _admit_create_locked (work_ledger_writes.py:515).
Outcome: when resource_status reads ample, the ledger still refuses ready items with goal_concurrency_cap_reached. The owner explicitly rejected this in rfc-work-ledger-concurrency-cap.md §7 ("we should not micro-manage; rely on probing resources"; only a bound the user sets is concurrency_cap). rfc-goal-limits-and-done-check.md:393-403 (status: draft) says #37652 lands only if decision 7 is accepted. Under "Skip the gate" no person approves the plan at all. The implemented RFC also stops matching the code.
Anchor: defect
Fix: hold the PR until decision 7 in rfc-goal-limits-and-done-check.md is accepted. Then amend rfc-work-ledger-concurrency-cap.md §7.2 in the same change, and say what a gate-skipped plan writes.

[BLOCK-MERGE] 7f9f171
[OPUS-REVIEWED] 7f9f171

Verdict parsed from the review's SHA-scoped output markers for commit 7f9f171058898b1cb49ebd23356bad762e929df1.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 7f9f171058898b1cb49ebd23356bad762e929df1 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 7f9f171058898b1cb49ebd23356bad762e929df1 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7f9f171

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 7f9f171058898b1cb49ebd23356bad762e929df1 false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

KiroCrewCaptain commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider raised 1 possible problem and estimates a 72% chance that this change introduces a defect; a person should check it.

This prompt-only change makes the conductor write its plan's worker count as the goal's concurrency_cap. That directly reverses the owner's 2026-11-13 decision in the implemented RFC rfc-work-ledger-concurrency-cap.md §7: no micro-managing, the cap is only for a bound the user sets, and resources decide the wave. No accepted RFC amendment or override covers the reversal, and it also changes the shared rule that Ultra Mode's conductor reads. Request changes until an RFC amendment lands or a maintainer records an override.

Things to check (possible problems the decider raised; at this confidence many turn out to be fine):

  • This changes a default the owner recorded two days earlier: every goal conductor would now bound itself at a number it picked for its plan, where the owner's ruling is that the user sets the bound and resources decide the wave. No RFC amendment or maintainer override covers it, and the PR's descript (src/⁠kiro_crew/agent_parts/spec_prompts.py, high)

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 9fb1f89402 · 126 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=ebe6efe49155
Disposition: needs-a-decision

  • product-shape change without accepted RFC: the plan's number becomes the cap

The finding is accurate: rfc-work-ledger-concurrency-cap.md §7.2 (implemented) names only a bound the user sets as concurrency_cap, and this PR also counts the approved plan's number.
The open RFC for #37361 (#37649, status draft) lists this branch as proposal-adjacent; it is not accepted on main, so it cannot clear the lane yet.
Question for the maintainer: should the number in a plan the user approved count as a bound the user set? If yes, record /ai-review override first-principles 324fabbf63bdc6ac961b479327fb48bf1a31fd71 product-shape: <decision>, or accept #37649 first and this PR rebases. If no, close this PR and keep §7.2 as written.

@buluoray
buluoray force-pushed the crew/slack/plan-concurrency-cap branch from 324fabb to 9fb1f89 Compare November 15, 2026 18:26
@buluoray

Copy link
Copy Markdown
Contributor Author

span=ecd02edd22be
Disposition: needs-a-decision

  • product-shape change without accepted RFC: the conductor sets its own concurrency cap

The finding is accurate: rfc-work-ledger-concurrency-cap.md §7.2 (implemented) names only a bound the user sets as concurrency_cap, and this PR also counts the approved plan's number.
The open RFC for #37361 (#37649, status draft) lists this branch as proposal-adjacent; it is not accepted on main, so it cannot clear the lane yet.
Question for the maintainer: should the number in a plan the user approved count as a bound the user set? If yes, record /ai-review override first-principles 9fb1f894029cd948c6d601a42ce0b42ded2221c2 product-shape: <decision>, or accept #37649 first and this PR rebases. If no, close this PR and keep §7.2 as written.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 15, 2026
@buluoray
buluoray force-pushed the crew/slack/plan-concurrency-cap branch from 9fb1f89 to d9a6988 Compare November 16, 2026 19:07
@buluoray

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in, and the RFC for #37361 (#37649) is merged. Its open decision 7 asks whether the plan's worker count is a bound the user set, which is the §7.2 question the First Principles lane raised here.

Conflicts resolved by keeping both sides:

  • spec_prompts.py: main's new heading ("they are bounded"), plus this PR's "the user's bound, else your plan's concurrency" wording.
  • goal-conductor/SKILL.md: main's go-ahead rule ("only when a person typed this turn"), plus this PR's "as one number"; the Concurrency cap bullet keeps this PR's rule on main's text.
  • test_agent_refactor_spec_bytes.py / test_agent_refactor_contracts.py: main's digests, then the conductor, ledger-conductor and team-lead specs re-pinned to this head. Every other spec's digest matched main's golden on this host.

Local: 1681 related backend tests pass, plus black, flake8, comment-history, brand and line-cap gates.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 16, 2026
@buluoray
buluoray force-pushed the crew/slack/plan-concurrency-cap branch from d9a6988 to 7f9f171 Compare November 16, 2026 19:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 16, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

span=9ad0ef453319
Disposition: needs-a-decision

@buluoray

Copy link
Copy Markdown
Contributor Author

span=1c12c52038a7
Disposition: needs-a-decision

  • goal-conductor/SKILL.md:616 overturns the owner's §7.2 decision. Correct, and it is the same question as the First Principles finding: is the approved plan's worker count a bound the user set? That is open decision 7 in rfc-goal-limits-and-done-check.md (draft, recommendation "yes"). This PR is held for the owner's decision. If yes, the same change amends rfc-work-ledger-concurrency-cap.md §7.2 and says what a gate-skipped plan writes; if no, this PR closes.

@buluoray

Copy link
Copy Markdown
Contributor Author

Closing per the owner's decision: an approved plan's worker count does not become the goal's concurrency cap. RFC #37649 section 7.2 stands as written.

@buluoray buluoray closed this Nov 16, 2026
auto-merge was automatically disabled November 16, 2026 19:34

Pull request was closed

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants