Skip to content

refactor(work-ledger): drop the advisory goal item cap and its notice - #33601

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
chore/drop-work-ledger-item-cap
Nov 9, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
chore/drop-work-ledger-item-cap

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Remove the work ledger's advisory goal item_cap and the conductor's one-time item-total notice, keeping the goal's item count readable.

Since #19338 item_cap refuses nothing. It only sets cap_exceeded, and the conductor prompt (spend_bounded) and the goal-conductor skill make the conductor give a one-time notice, tracked by an item_cap_notice session-ledger artifact it rewrites at every round close. The owner reports that nobody acts on the notice and it is raised on nearly every goal.

Why it matters

The notice is noise to the person, and it costs a prompt rule, a session-ledger write every round, a tool field and a header field on every goal.

Not a goal

  • Changing concurrency_cap (default 6) or MAX_ITEMS_PER_CONDUCTOR (32, wire code item_cap_exceeded).
  • Hiding the goal's item total: goal_items_used and created_total stay on work_ledger_read.
  • Requiring round reports to state the total.
  • The patrol_budget text in the same prompt and skill files (another PR).

What changed (motivation → approach → change)

Decision: rfc-drop-goal-item-cap.md (docs PR #33584, accepted; this PR rebases onto it once it merges). It supersedes rfc-conductor-item-total-notice.md and amends rfc-work-ledger-concurrency-cap.md §3/§5.

  • Store: ConductorRecord.item_cap, cap_exceeded, _stored_item_cap, DEFAULT_GOAL_ITEM_CAP, MAX_GOAL_ITEM_CAP removed (work_ledger_records.py, work_ledger.py facade, work_ledger_writes.py _write_goal / apply_conductor_action). The rebuild no longer carries a cached item_cap.
  • Tool: item_cap removed from the work_ledger_record JSON schema and _RECORD_FIELDS (mcp_work.py), the validator (opt_in_server_schemas.py) and the HTTP handler (work_ledger_conductor.py). work_ledger_read drops cap_exceeded and keeps goal_items_used (work_ledger_read.py); the warm task brief's conductor payload drops item_cap.
  • Prompt: the spend_bounded rule keeps the concurrency cap and the no-progress check and replaces the item-cap notice with one sentence: the total has no cap and reads as goal_items_used. The goal-conductor skill's "Item cap (advisory)" bullet becomes a short "Item total" bullet; src/kiro_crew/docs/work-ledger.md matches. The old skill text said to keep the count out of round reports. That rule served the one-time notice and goes with it. The new bullet says a round report can state goal_items_used, because the owner asked to keep the total visible for round reports. It permits, it does not require (RFC §4).
  • WORK_STORED_ITEM_LIMIT stays imported in work_ledger_records.py (with noqa: F401) because the work_ledger facade serves it from there.

Compat choice for an old caller passing item_cap to action=goal: reject. The schema already refuses any unknown field with a 400 that names it, before anything is written, so this needs no code. Ignoring would need a kept schema entry plus a drop path for a field with no effect, and the caller would believe a cap was set. The tool's advertised schema no longer lists the field, so a current conductor never sends it.

Backwards compatibility

Breaking: work_ledger_record action=goal item_cap=<N> is refused 400 (unknown field); work_ledger_read no longer returns item_cap or cap_exceeded. Writer sweep on origin/main @ 1e3b894 (git grep -nE "item_cap|cap_exceeded|item_cap_notice"): the only writers of item_cap were the conductor prompt and goal-conductor skill (both changed here) and tests (updated). No frontend, Bot prompt (crewmate_prompts.json), team-lead skill or system spec names it.

Stored headers that carry item_cap still read: ConductorRecord.from_dict ignores the key and the next header write drops it (test_a_stored_item_cap_from_an_old_header_is_ignored_and_dropped).

Reader: src/kiro_crew/dashboard/handlers/work_ledger_read.py:api_work_ledger_get -- chat|subagent -- drops cap_exceeded, still returns goal_items_used and created_total | test_the_read_carries_the_goal_total_and_no_item_cap
Reader: src/kiro_crew/dashboard/warm_task_brief.py:_conductor_payload -- crew page -- drops item_cap; _goal_progress reads only goal_items_used, goal_items_base, created_total | test/test_warm_task_brief_crew_mode.py
Reader: src/kiro_crew/work_ledger.py:rebuild_from_projection -- chat -- keeps concurrency_cap and goal_items_base from a clean cache | test_a_clean_rebuild_keeps_the_cached_goal_caps
Reader: src/kiro_crew/agent_parts/spec_prompts.py:spend_bounded -- chat -- notice text removed; conductor reads goal_items_used | test_back_to_back_rounds_keep_a_spend_bound
Reader: src/kiro_crew/builtin_skills/goal-conductor/SKILL.md:Item total -- chat|subagent -- notice and item_cap_notice artifact removed | test_back_to_back_rounds_keep_a_spend_bound
Reader: session ledger item_cap_notice artifact -- chat -- written only by the removed prompt rule; an existing value is an inert artifact string no code reads | git grep finds no reader in src/
Reader: src/kiro_crew/mcp_work.py:_tool_definitions -- chat|subagent -- schema no longer lists item_cap | test_the_tool_schemas_spell_the_stores_cap_ceilings

Tests

  • test_work_ledger_caps.py: item-cap tests rewritten as count tests (goal_items_used, new_goal, legacy headers) with no cap; new test_the_goal_total_is_counted_and_never_refused and test_a_stored_item_cap_from_an_old_header_is_ignored_and_dropped.
  • test_work_ledger_tools.py: the read carries goal_items_used/created_total and no item_cap/cap_exceeded; a goal write with item_cap is 400; schema and _RECORD_FIELDS no longer list it.
  • test_conductor_agent.py: prompt and skill still carry the concurrency cap and no-progress check, name goal_items_used, and carry no item_cap / cap_exceeded.
  • Updated pins: _CONDUCTOR_SYSTEM_PROMPT shape hash (test_agent_refactor_contracts.py), the kirocrew-conductor.json / kirocrew-ledger-conductor.json spec-byte goldens (test_agent_refactor_spec_bytes.py, re-pinned from CI's printed digests since they cannot be regenerated locally), facade inventory, projection, metrics, warm-brief and parity reason.

Local: 704 passed (work-ledger, conductor, probe, remote-dispatch files), then 85 related files: 3678 passed with 4 pin failures, all fixed and re-run green; flake8, black, isort and docs-lint clean on touched files.

Proof: not provable -- other: removal of an advisory field; no defect to revert

Manual verification

N/A — unit coverage sufficient: the change removes a field and prompt text; store, HTTP and schema paths are covered by the tests above.

Related Issues

Refs #19338, #22417, #33584

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.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 83136dc7b8b13462720006606e9369a45c28a7f2 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 83136dc

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

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 83136dc7b8b13462720006606e9369a45c28a7f2 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 added the readiness: action required A blocking check or review needs attention label Nov 9, 2026
@iamwhatever
iamwhatever force-pushed the chore/drop-work-ledger-item-cap branch from 26d1f83 to 11d6240 Compare November 9, 2026 02:45
@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 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks. The removed field had no readers left outside the patch, and the accepted RFC (#33584) covers the decision.

Notes

[DESIGN-REVIEWED] 83136dc

Description read

[DESCRIPTION-READ] 8b395a13d117f8f4cf10c79cb2be6f89239fbac0e8fffc8bf8ba82f9ee0fb52c

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 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 83136dc7b8b13462720006606e9369a45c28a7f2 — 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. Each removal follows the accepted RFC rfc-drop-goal-item-cap.md on the base. The one reversed pin, "keep it out of round reports", is declared, and RFC §2 and §4 cover it.

What this change ships

Inventory (8 items) — 8 justified

Intent: stop the goal conductor from giving a one-time "over 20 items" notice that nobody acts on, and keep the goal's item count readable. This is a removal (ADDITION-inverse), not a defect fix.

  1. The conductor no longer tells the user once that the goal passed 20 items — justified
  2. The conductor no longer rewrites an item_cap_notice artifact in its session ledger at every round close — justified
  3. work_ledger_record action=goal item_cap=N is now refused 400 as an unknown field — justified
  4. work_ledger_read no longer returns item_cap or cap_exceeded; goal_items_used and created_total stay — justified
  5. The skill now lets a round report state goal_items_used, which reverses "keep it out of round reports" — justified
  6. The crew-page warm brief's conductor payload drops item_cap — justified
  7. A stored header that still carries item_cap reads fine and loses the key on the next write — justified
  8. The public facade no longer serves DEFAULT_GOAL_ITEM_CAP or MAX_GOAL_ITEM_CAP — justified

[FIRST-PRINCIPLES-REVIEWED] 83136dc

Description read

[DESCRIPTION-READ] 3de9aac22e6f87abd1ba7a09301cada411ed26a5db608906447de95aa7cd7f61

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 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 83136dc7b8b13462720006606e9369a45c28a7f2 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 83136dc

Verdict parsed from the review's SHA-scoped output markers for commit 83136dc7b8b13462720006606e9369a45c28a7f2.

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

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@iamwhatever
iamwhatever force-pushed the chore/drop-work-ledger-item-cap branch from 11d6240 to 79124c3 Compare November 9, 2026 03:20
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 9, 2026
@iamwhatever
iamwhatever force-pushed the chore/drop-work-ledger-item-cap branch from 79124c3 to b45d002 Compare November 9, 2026 03:48
@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 readiness: checking Automated validation is still running labels Nov 9, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@iamwhatever
iamwhatever force-pushed the chore/drop-work-ledger-item-cap branch from b45d002 to 30d812f Compare November 9, 2026 05:23
@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 9, 2026
@iamwhatever
iamwhatever force-pushed the chore/drop-work-ledger-item-cap branch from 30d812f to 5f86e1f Compare November 9, 2026 05:59
@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 9, 2026
The goal's item_cap has refused nothing since #19338: it only set
cap_exceeded and made the conductor give a one-time notice tracked by an
item_cap_notice session-ledger artifact. Remove item_cap,
DEFAULT_GOAL_ITEM_CAP, MAX_GOAL_ITEM_CAP and cap_exceeded from the store,
the work_ledger_record schema and work_ledger_read, and the notice rule
from the conductor prompt, the goal-conductor skill and the work-ledger
doc. goal_items_used and created_total stay readable; concurrency_cap
and MAX_ITEMS_PER_CONDUCTOR are unchanged. Old headers carrying item_cap
read fine and drop the key on the next write; a caller still passing
item_cap is refused as an unknown field.

Implements rfc-drop-goal-item-cap.md (#33584).
@iamwhatever
iamwhatever force-pushed the chore/drop-work-ledger-item-cap branch from 5f86e1f to 83136dc Compare November 9, 2026 07:00
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@KiroCrewCaptain
KiroCrewCaptain merged commit 1c23741 into main Nov 9, 2026
188 of 199 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the chore/drop-work-ledger-item-cap branch November 9, 2026 10:16

@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.

Approving. On head 83136dc the review checked these points. Every writer and reader of item_cap, cap_exceeded and item_cap_notice is gone from src/ and website/. Every caller of _write_goal and apply_conductor_action was updated. An old on-disk header that still stores item_cap loads and then drops the key. A stale item_cap argument gets a 400 through the existing unknown-field path. The prompt hash, mate-parity and facade pins were re-pinned to match. The design is signed off by a maintainer through the accepted RFC (#33584).
Done well: both compatibility edges the RFC names are pinned by tests, and goal_items_used keeps its counting coverage after the cap tests went away.
Optional:

  • Update docs/request-for-change/rfc-drop-goal-item-cap.md frontmatter (status, implementation-prs: [33601], last-audited, audited-at) and the README.md:31 index row, which still says "Nothing built".
  • In test/test_conductor_agent.py, keep "items used: N of" not in text and "in every round report" not in text. They still pass, and they pin the rule that a round report may state the total but is never required to.
  • The body correctly calls this a breaking change, but the title says refactor:. A refactor!: or feat!: type would match that.

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 9, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving 83136dc as maintainer. 99 checks pass. The one red is the helper job "rerun / Re-run Sensitive Change Review", which failed at 10:16 UTC because it found no Sensitive Change Review run to rerun. Sensitive Change Review itself passed on this same head at 10:49 UTC, so the helper's red does not block.

This implements the item_cap removal from RFC #33584, and it loosens a soft limit:

  • ConductorRecord.item_cap, cap_exceeded, DEFAULT_GOAL_ITEM_CAP, MAX_GOAL_ITEM_CAP, the item_cap goal-write argument, its validator FieldSpec and its MCP schema property are all removed. The concurrency cap is unchanged, so spend stays bounded.
  • goal_items_used is still derived and returned on the conductor block, compact reads included, and new_goal=true still starts a new count.
  • An old header that stored item_cap still reads, and the next write drops the key. A goal write that still sends item_cap gets a 400 for an unknown field. The MCP schema no longer offers it, and the tests pin both cases.
  • The conductor prompt, the goal-conductor skill and work-ledger.md lose the one-time cap notice and its item_cap_notice bookkeeping.

I read the product hunks and the test changes. I found no regex in product code and no new refusal beyond the removed field.

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.

4 participants