Skip to content

feat(conductor): share the long-task and team rules with the Bot and root the parity test at conductor mode's agent - #37725

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
test/teamlead-bot-parity
Nov 16, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
test/teamlead-bot-parity

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A Bot's conductor and conductor mode's conductor follow the same long-task and team rules every turn, and the parity test proves it against the agent conductor mode actually runs.

The long-task rules from #37030 (per-item budget, plan reviewer, hourly check on a quiet wake) live only in the goal-conductor skill, which a conductor may not re-read after compaction. The team lead's useful team rules (one owner per file, one integrator per output, author never tests own work, merging two lines, tracker, routine incidents, report before park) live only in the team-lead skill, which kirocrew-conductor and Bots never read. test/test_mate_conductor_parity.py hard-coded kirocrew-conductor as its root instead of reading crew_mode.crew_mode_agent().

Why it matters

The owner ruled that the Bot and conductor mode work the same way (2026-11-06) and that conductor mode runs on kirocrew-conductor with the team lead's rules folded into goal-conductor (docs/decisions/2026-11-15-conductor-mode-runs-on-the-conductor-by-default.md, landed by #37705). Rules that sit only in a skill are dropped after compaction; rules that sit in one agent's prompt drift from the other.

Not a goal

What changed (motivation → approach → change)

Rules every turn needs → one shared text both conductors render (_LEDGER_CONDUCTOR_RULES, the existing mechanism) → eight new keys, each placed in _CONDUCTOR_PROMPT_SECTIONS and named as a {placeholder} in crewmate_prompts.json conductor.patrol.

Rule (key) Source kirocrew-conductor charter Bot conductor.patrol goal-conductor skill
item_budget #37030 yes yes already (Dispatch a round)
own_files (one owner / one integrator / author never tests own work) team-lead §5 yes yes added
merge_lines team-lead §5 yes yes added
plan_reviewer #37030 yes yes already (Patrol step 3)
bar_pr_merged owner rule (acceptance bar is pr_merged for a PR the goal wants merged) yes yes added
wake_check (hourly quiet-floor check) #37030 yes yes already (Close the round)
routine_incidents goal-conductor / team-lead §5 yes yes already (Patrol)
report_before_park team-lead §6 yes yes added
tracker team-lead §5 yes (root-only section) no, ALLOWLIST prompt:tracker with reason added

Dropped, not folded (decision record): "When you keep a ledger", "your own loop is never an item", and the do-it-yourself bias. goal-conductor carries none of them.

Parity test (test/test_mate_conductor_parity.py):

  • Root is crew_mode.crew_mode_agent() (_ROOT), not a hard-coded name; the installer is looked up from it. test_conductor_mode_runs_the_charter_this_file_compares fails if the default moves to an agent whose prompt is not _CONDUCTOR_PROMPT_SECTIONS.
  • test_every_shared_rule_renders_on_both_installed_conductors: every _LEDGER_CONDUCTOR_RULES value is in the installed root spec's prompt AND in the Bot's rendered ledger text. Positive control test_the_render_check_sees_a_rule_lost_on_one_side drops wake_check from the Bot side and expects the failure.
  • test_the_long_task_and_team_rules_are_shared pins the eight keys on both sides.
  • CONDUCTOR_MODE_SKILL_ANCHORS gains anchors for the eight keys in goal-conductor.
  • The Bot comparison (prompt sections, servers, tools, grants, skills) is kept unchanged.

docs/system-specs/modules/crew-mode.md ("The two conductors stay in step") names the new shared rules and the new root.

Token cost per turn (chars / 4)

Agent Added per turn Where
kirocrew-conductor 3,432 chars ≈ 858 tokens (8 rules 2,984 + tracker 448); charter now 24,484 chars system prompt
kirocrew-mate-conductor (Bot with ledger) 2,976 chars ≈ 744 tokens conductor.patrol
kirocrew-team-lead (opt-in only) 0 in its prompt —
goal-conductor skill (any reader, only when read) 2,043 chars ≈ 510 tokens skill file

Backwards compatibility

Compatible: prompt text only; no config key, schema or API changes.

Removes nothing: every existing rule, section, allowlist entry and anchor stays; only additions.

Tests

  • test/test_mate_conductor_parity.py: four new tests above plus eight anchor entries; existing tests now read _ROOT.
  • test/test_agent_refactor_spec_bytes.py / test/test_agent_refactor_contracts.py: re-pinned kirocrew-conductor.json / kirocrew-ledger-conductor.json digests and the _CONDUCTOR_SYSTEM_PROMPT shape, because the charter text grew.
  • Local, under the test lock: every test file that names _CONDUCTOR_SYSTEM_PROMPT, _LEDGER_CONDUCTOR_RULES, conductor.patrol, goal-conductor/SKILL or crewmate_prompts, plus test_conductor_context_cap.py: 1115 passed.

Proof: not provable -- other: prompt-text feature, not a fix; the positive-control test is the guard check.

Manual verification

N/A — the rendered prompts of both agents are asserted directly by the new tests.

Related Issues

Follow-up

  • Delete kirocrew-team-lead (service_agents._install_team_lead_agent, _TEAM_LEAD_SYSTEM_PROMPT) and the team-lead skill once no install still sets agent.crew_mode_agent to it; then drop test_a_team_lead_set_as_the_conductor_reaches_goal_conductor.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

…root the parity test at conductor mode's agent

Per docs/decisions/2026-11-15-conductor-mode-runs-on-the-conductor-by-default.md:
eight rules move into _LEDGER_CONDUCTOR_RULES, so kirocrew-conductor's charter
and a Bot's conductor.patrol both render them every turn (item budget, one
owner per file / one integrator per output / author never tests own work,
merging two lines, plan reviewer, pr_merged bar, hourly quiet-wake check,
routine incidents, report before park). The tracker rule is root-only and
allowlisted. The team-lead rules worth keeping are folded into goal-conductor.
test_mate_conductor_parity.py now roots at crew_mode.crew_mode_agent() and
checks every shared rule is in both installed prompts.
@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 15, 2026 23:50
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

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

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

No design-level problem: the change is prompt text added through the existing shared-rule mechanism, it removes nothing, and the parity test now starts from the agent conductor mode actually runs.

Notes

  • _ROOT = crew_mode.crew_mode_agent() is evaluated once, when the module is imported. If that resolver ever reads the operator's config instead of a built-in default, the test picks its root from the host's state. Bind the default constant directly, or read it inside a fixture.

[DESIGN-REVIEWED] 218277c

Description read

[DESCRIPTION-READ] dee2ab3093a3eedc12ed2924fd56ebd240fd03cfd9a0d0a63ae97e7cb5139a34

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 218277cf499e1f0d81e7392e83cebe462788dc40 — 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: PASS

Nothing blocks. The one weak premise is the new pr_merged default for pull requests. Its only support is an unlinked "owner rule", and the RFC that proposed this shape was withdrawn.

Notes

  • Item 5 — inherited: the description's only support is "owner rule (acceptance bar is pr_merged for a PR the goal wants merged)". The base skill says "pr_checks is the common case". rfc-conductor-pr-land-tracking.md ("A PR item stays open until its pull request lands") is withdrawn on base. Subtraction: drop bar_pr_merged from _LEDGER_CONDUCTOR_RULES, _CONDUCTOR_PROMPT_SECTIONS, conductor.patrol, _NEW_SHARED and the goal-conductor skill paragraph, until a record exists.
  • Item 2 — duplicate of goal-conductor/SKILL.md:277 ("A file two items must both write has one owner item, named in both briefs."). The new skill paragraph opens by saying the same thing again, one line below it. Subtraction: delete that earlier sentence, or the new paragraph's first sentence.
  • Item 10 — one consumer, generalized: _ROOT_INSTALLERS is a dict with one entry, and getattr(agent, _ROOT_INSTALLERS[_ROOT])() always resolves to _install_conductor_agent. Subtraction: replace it with assert _ROOT == "kirocrew-conductor" and keep the direct installer call.

What this change ships

Inventory (10 items) — 7 justified

Intent: both conductors (a Bot's and conductor mode's) keep the long-task and team rules every turn, even after compaction; ADDITION.

  1. Each conductor gives every item a budget: <N>m time budget — justified
  2. One owner per file, one integrator per output, testing given to a different worker than the author — duplicate of SKILL.md:277 in the skill copy
  3. Merge two lines of work when they converge — justified
  4. A reviewer critiques the plan before the first round and at each round close — justified
  5. A code-PR item's bar is pr_merged and the patrol stays armed until merge — inherited, withdrawn RFC shape
  6. A quiet hourly wake checks each open item against its budget — justified
  7. Routine incidents are handled and recorded without asking the person — justified
  8. The conductor reports before it parks on a wait — justified
  9. Tracker rule in the root charter and skill, allowlisted off the Bot — justified
  10. Parity test roots at crew_mode_agent() and checks that every shared rule renders on both conductors — one consumer, generalized

[FIRST-PRINCIPLES-REVIEWED] 218277c

Description read

[DESCRIPTION-READ] 8dea54ff740e8d00fb1290b832df6a731aeb0934304bef30e1f0199c908c3fc7

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 218277cf499e1f0d81e7392e83cebe462788dc40 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 218277c

Verdict parsed from the review's SHA-scoped output markers for commit 218277cf499e1f0d81e7392e83cebe462788dc40.

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

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 218277cf499e1f0d81e7392e83cebe462788dc40 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 218277c

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

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 16, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates an 18% chance that this change introduces a defect, above the 12% limit for approving on its own.

Prompt-only change. It adds eight rules to _LEDGER_CONDUCTOR_RULES, and each one appears in both the root charter and the Bot's conductor.patrol. The root-only tracker rule is allowlisted with a reason, and the new goal-conductor skill text matches the anchors the test checks. The parity test's root now comes from crew_mode_agent(). It adds a check that each rule renders on both installed conductors, plus a working positive control. The re-pinned digests are consistent with the charter growing. The pr_merged bar with repo is supported by accept_eval and by the ledger's check that a bar is filled in. All CI checks and AI review lanes passed. The open questions are policy points, not concrete defects: pr_merged combined with the pending budget, and no written record for the pr_merged default.

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 218277cf49 · 262 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 16, 2026 01:39

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 218277c. The change is prompt text plus tests. The eight new shared rules in _LEDGER_CONDUCTOR_RULES reach both the root charter and the Bot's conductor.patrol by reference. Every new anchor phrase is present in the head goal-conductor skill. The re-pinned digests move only kirocrew-conductor.json, kirocrew-ledger-conductor.json and the _CONDUCTOR_SYSTEM_PROMPT shape. No grant, scope or gate code changes. PR Readiness is green on this head, and the branch merges cleanly onto current main.
Done well: each rule is written once and referenced from both sides. The new two-sided render test also ships with a positive control, which proves the test fails when one side loses a rule.
The design is signed off under the standing maintainer sign-off for changes by team members.
Optional:

  • bar_pr_merged and the 24h pending budget: is_pending_overdue exempts only human_approval, so a green PR that waits more than 48h for review can end up closed abandoned. Consider exempting items that are waiting on a merge, or moving this rule to its own PR with a decision record.
  • The routine_incidents prompt text leaves out three things the skill says: "save its unpushed work first", "regenerable build output", and the ask-case carve-out. Copying them over would keep the prompt rule as strong as the skill rule.
  • #37652 conflicts with this PR on the same prompt text and digest pins. Whichever PR lands second needs a rebase and a re-pin.

@KiroCrewCaptain
KiroCrewCaptain merged commit 1a626a6 into main Nov 16, 2026
98 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the test/teamlead-bot-parity branch November 16, 2026 01:39
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision 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