Repository navigation
fix(work-ledger): count only open items toward the per-conductor cap - #13879
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
Round 1: Comment History Gate flagged |
GPT 5.6 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)Reviewed Opus 5 adjudication downgraded every blocking finding to advisory. Adjudication downgraded all 1 blocking finding(s) to advisory: the remedy each one requires is disproportionate to the harm it prevents. Read them as advice, not as merge conditions. Review detailsBLOCKING -- src/kiro_crew/work_ledger.py:1863 -- Legacy boards can under-seed the stored-item bound Adjudication (Opus 5) — is blocking on each finding proportionate?HARM: LOW — a board-scoped, loudly-reported loss of one repair capability; no write occurs and no data is lost when it fires. Conditions confirmed in this run: a header predating the counter reads REMEDY COST: both fixes the author would ship are large and permanent. "Seed from the fold" puts a crew-log projection read on the create path under the conductor lock — the very import [ADJUDICATION] 89be90a total=1 uphold=0 downgrade=1 |
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The lifetime wall reappears at 256: the PR's own queue conductor hits Watch
[DESIGN-REVIEWED] 89be90a Description read[DESCRIPTION-READ] 6de757462d6eb3d661c04a380e9b98584331b5ed8a1e871f4885aea0461a3dd6 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 |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The rebuild's fold-ceiling refusal is new code framed as pre-existing — "still refuses a full fold that reports omissions" — and it can seal a board against rebuild forever. Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: FIX — a conductor that closes its items can keep dispatching; the 32-cap counted closed history and killed queue conductors in a day (added test fails on base).
[FIRST-PRINCIPLES-REVIEWED] 89be90a Description read[DESCRIPTION-READ] ca8d7f6d9f190dc8f8ef4fd147b1c66080e492f0e006dcb130b7b9d1d985d911 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo blocking findings. FINDING — src/kiro_crew/work_ledger.py:2891 — the new ceiling guard reads FINDING — src/kiro_crew/work_ledger.py:1872 — the [OPUS-REVIEWED] 89be90a |
e67e7ae to
ccefe4e
Compare
|
Round 2 reply, applied in GPT 5.6 F1 — Design Review — create latency / listing payload. Bounded by the same change: First Principles — the RFC text. Not edited: the RFC is the record of the decision; the shipped doc ( Backend Lint & Type Check (3.12) on |
ccefe4e to
d37fc55
Compare
|
Round 3 reply, applied in GPT 5.6 F1 — Opus 5 F2 — Design Review / First Principles — no bound on retained history. Conceded as a real gap, and deliberately out of this PR's scope: bounding retention has to be NON-destructive — an archive move of closed records the way the operator-side archiver already does it (items older than a window moved to a sibling directory plus an index, nothing unlinked) — and it has to be inside the create's undo contract, which touches Backend Lint & Type Check (3.12). Green on |
d37fc55 to
a291887
Compare
|
Round 4 reply, applied in GPT 5.6 F1 — Opus 5 F1 — Opus 5 finding — the RFC's cap sentences. Updated: line 301 and the "Unbounded growth" line now name the open cap, the 256 closed-items board bound and the archive, and say what bounds the archive (the ledger's own retention: the sweep removes the directory with a finished ledger). Design / First Principles — growth bound. Addressed by the above: Gates on |
a291887 to
451437e
Compare
|
Round 5 reply, applied in GPT 5.6 F1 — GPT 5.6 F2 — Gates on |
451437e to
cdc0bd0
Compare
|
Round 9 reply, applied in Opus 5 BLOCKING — GPT 5.6 F2 — GPT 5.6 finding — Design Review / First Principles item 3 — the RFC's "Unbounded growth" paragraph asserts a bound the diff removed. The paragraph, the RFC's cap sentence and the shipped doc's Limits paragraph now state both bounds: 32 open items and 256 stored per conductor in total, closed items staying on the board until that stored bound, a board at it refusing further creates and reclaimed whole by the ledger sweep. "A ledger cannot grow without bound" is true as written. The doc ratchet ( First Principles item 7 / Design Review "phantom description" — the orphan Gates on |
25d9d56 to
db932d2
Compare
|
Round 10 reply, applied in GPT 5.6 BLOCKING — Docs. The shipped Limits paragraph and the RFC's cap sentence and Unbounded-growth paragraph now say the stored bound is counted off the item records on the board, a torn one included, rather than off the readable listing; the doc ratchet ( Gates on |
db932d2 to
6836d91
Compare
|
Round 11 reply, applied in GPT 5.6 BLOCKING — The torn-header case. The rebuild sets the counter from the record. Docs. The shipped Limits paragraph, the RFC's cap sentence, its rebuild paragraph and its Unbounded-growth paragraph state that the stored bound is a monotonic per-conductor create counter in the header, that record deletion does not reclaim capacity, that an unreadable header refuses a create, and that a rebuild sets the counter from the record; present tense throughout. Gates on |
MAX_ITEMS_PER_CONDUCTOR (32) bounds live fan-out, which is the only thing a per-conductor item cap is for. _create_item counts the OPEN items: an item in a terminal state (accepted, rejected, abandoned) stays on the board, listed and readable, and does not count. A queue conductor that mints one item per ticket and closes each as it lands otherwise exhausts the cap on its own history within a day, with nothing live behind the refusal. The open count comes from list_work_items, since only a readable record has a state; a torn record does not count there. The refusal names the open count. A second bound keeps the board's STORED total finite once closed items stay: MAX_STORED_ITEMS_PER_CONDUCTOR (256) bounds the creates a board admits over its life, open and closed together, and _create_item refuses past it with item_store_full (409) before the open-cap check, naming the create count, the bound and the remedy (kirocrew ledger-sweep --purge once every item is closed). Nothing evicts a record. The number is the crew log fold's per-board ceiling, WORK_ITEM_LIMIT, by construction: both read work_vocab.WORK_STORED_ITEM_LIMIT, the leaf the store and the fold already share. Every create the store admits is one recorded create, so a board the writer admits cannot overflow the fold; the fold is always the whole board, omitted stays 0, and the rebuild's ceiling guard (a full fold that reports omissions is refused with crew_log_incomplete) is defensive rather than the working path. Only a full fold reporting omissions is necessarily a prefix of the board; the comments say so. The stored bound is a monotonic counter, not a count of the files in items/. ConductorRecord gains created_total (default 0, no schema bump): _create_item re-reads the header under the conductor lock, seeds a zero counter once from the it_*.json stems the board holds (a header from before the field), refuses item_store_full at the bound, and otherwise bumps the counter and writes the header in the same hold as the item record, header first so a failure between the two leaves the counter ahead of the board and never behind it (the header is put back when the item write raises; every refusal, the item's own size included, is decided before the header write). The fold counts creates in an append-only log, so a record removed from the cache (torn, hand-deleted, lost, or removed per the cache_dirty remedy) still has its create there; a file count would admit one create more than the fold retains for every record it lost, and the ceiling guard would then refuse that board for good. Deleting a record reclaims nothing. A header that is present but unreadable under the lock refuses both conductor writers (no_ledger, the code the same header reads as everywhere else, with a message naming the torn header and the rebuild as the remedy) instead of standing the pre-lock snapshot in for it: the snapshot was read before every writer that held the lock since, so writing it back would put a lower count into the header a create then reads. rebuild_from_projection sets created_total to the records the rebuilt board holds, every item the fold retained plus every legacy record kept; omitted is not added, because past the ceiling guard the fold dropped no create and a non-zero omitted there counts entries that are not this board's creates. _stored_item_ids stays as the rebuild's lock roster and the one-time seed. The item-size ceiling check moves into _require_record_fits so the create can run it before the header write. Docs: the shipped Limits paragraph, the RFC's cap sentence, its rebuild paragraph and its Unbounded growth paragraph state both bounds (32 open, 256 created in total, a monotonic per-conductor counter in the header that record deletion does not lower), so the RFC's growth claim holds again. Tests: each terminal state frees its seat and the 33rd create lands; closed items past the open cap stay listed and readable; a board of closed records at the stored bound is refused with item_store_full, bytes untouched, the message naming count, bound and remedy, the counter at the bound; a full board with one record torn (listed one short, zero open) is refused and items/ is byte-identical; a full board with one record and its event log deleted is refused, items/ byte-identical and the header's counter unchanged; a header from before the counter is seeded from its records on the first create and refused at the bound on that seed; a torn header under the lock refuses both writers with nothing written; a rebuild sets the counter to the fold's item count whether the cache held more or less and the rebuilt counter drives the next create; a legacy board's rebuilt counter covers fold items plus kept legacy records; at both bounds the stored one speaks first; the stored bound equals the fold's ceiling; the route maps item_store_full to 409 and the status map stays exhaustive; a fold at the ceiling with omissions refuses the rebuild on a dirty cache and touches nothing; a full fold with none rebuilds; the doc ratchet pins both numbers.
6836d91 to
89be90a
Compare
|
State: head 89be90a is the round-11 change (the conductor header's Pausing further rounds -- what's left are design calls for you, not defects. The Design Review is advisory (CONCERNS) with two items only a human can clear:
Also on this head, the GPT 5.6 advisory (comment): legacy boards seed Say which way on 1 and 2 and I'll do the last round, or merge as-is if the recommendations work for you. |
|
Readiness sweep 2026-09-29 — held pending the author's open question to @smeyffret / @kyleseaman. Mechanically ready (label, required check, mergeable, no CHANGES_REQUESTED, no open threads). Not merged from the sweep because the author explicitly paused on two design calls: (1) the 256 lifetime-creates ceiling per conductor with no reclaim on close/delete (reset only by |
iamwhatever
left a comment
There was a problem hiding this comment.
Reviewed. The open cap counts only non-terminal items under the conductor lock; the stored bound (256) is checked before any write and the header counter is rolled back if the item write raises; old headers load with created_total defaulting to 0. No sandbox/auth/data-deletion touch. Tests cover the cap, the stored bound, unreadable records, the one-time seed, torn header and rebuild guard.
Minor, non-blocking: a header that exists but does not parse used to be repaired from the pre-lock snapshot; now goal/create refuse with no_ledger (ensure_conductor and rebuild still repair it). Worth one line in the description. Also no test pins the header rollback when the item write raises (work_ledger.py ~1912).
Problem / Motivation
Goal: A conductor that has closed its items can keep dispatching new ones -- the per-conductor cap bounds live fan-out, not the conductor's lifetime -- while the board's stored record count stays bounded.
kiro_crew/work_ledger.pycaps a conductor atMAX_ITEMS_PER_CONDUCTOR = 32items, and_create_itemcounts every recordlist_work_itemsreturns, closed ones included:A long-lived queue conductor that mints one item per ticket and closes each as it lands (about a hundred per oncall shift) hits
item_cap_exceededwithin a day, even though almost every item behind the refusal is alreadyaccepted/rejected/abandonedand nothing is live.Why it matters
The cap exists to bound live fan-out (the RFC lists it under "Unbounded growth"). Counted this way it instead bounds a conductor's lifetime: once it has closed 32 items it can never dispatch again, so every conductor that runs a queue rather than a one-shot goal is dead after its first day, and the only way out is deleting its own history. The refusal also names the wrong thing -- "conductor holds 32 items" -- when the conductor holds none open.
Not a goal
items-archive/, noclosed/subdirectory, no ring buffer, no automatic deletion. Closed records stay on the board until the operator retires the finished ledger withkirocrew ledger-sweep --purge._create_item's cap check:list_work_items,read_work_item, the census, the purge and every other reader keep returning and counting closed items as they do today.workfold -- its item ceiling, itsomittedaccounting,FOLD_STATE_VERSION-- or to thecrew_log_incompleterebuild guard beyond stating that it is now defensive.What changed (motivation → approach → change)
Symptom:
createrefused withitem_cap_exceededon a conductor with zero open items. Root cause: the cap compares againstlen(list_work_items(...)), andlist_work_items(deliberately) returns every readable record regardless ofstate, so closed items occupy seats forever. Change: two bounds, both checked under the conductor lock.Open cap (32,
MAX_ITEMS_PER_CONDUCTOR)._create_itemcounts only items whosestateis not inTERMINAL_ITEM_STATES(work_vocab.WORK_ITEM_STATESisopenplus the three terminal states), read offlist_work_items, since only a readable record has a state. Closed items stay on disk, are still returned bylist_work_items, still readable byread_work_item/read_work_brief, still counted by the purge census; no reader or layout changes. Two approaches were on the table:closed/subdirectory thatlist_work_itemsalso reads -- rejected as the larger blast radius:item_path,item_lock, the events path, bindings,census_itemsandpurge_conductorall derive paths from the flatitems/directory and would each need a second location.The refusal message says
open items.Stored bound (256,
MAX_STORED_ITEMS_PER_CONDUCTOR) as a monotonic create counter. With closed items staying on the board, the open cap alone would leave the board's total record count with no bound at all (AutoSDEa-bound-bounds-every-field-it-retains). So_create_itemalso refuses, BEFORE the open-cap check, when the board has createdMAX_STORED_ITEMS_PER_CONDUCTORitems over its life: codeitem_store_full(409, in the exhaustive store-code map and the RFC's error table),field: "items", a message naming the create count, the bound and the remedy --kirocrew ledger-sweep --purgeonce every item is closed, which removes the finished ledger whole. The bound is measured against a new header field,ConductorRecord.created_total(default 0, no schema bump), and NOT against the files underitems/: the crew log's fold counts creates in an append-only log, so a record removed from the cache -- torn, hand-deleted, lost, or removed per thecache_dirtyremedy -- still has its create there, and a file count would admit one create more than the fold retains for every record it lost. Under the conductor lock_create_itemre-reads the header (_header_under_lock), seeds a zero counter once from theit_*.jsonstems the board holds (a header from before the field -- a backfill that can only over-count the log, never under), refuses at the bound, and otherwise bumps the counter and writes the header in the same hold as the item record: header first, so a failure between the two leaves the counter ahead of the board and never behind it, with the header put back when the item write raises; every refusal, the item's own size ceiling included (_require_record_fits, factored out of_commit_item_lockedso the create can run it early), is decided before the header write, so a refused create leaves every file byte-identical. Deleting a record reclaims nothing._stored_item_idsstays as the rebuild's lock roster and the one-time seed. Nothing evicts a record; the board is a queue the operator retires, not a ring buffer.A torn header refuses instead of standing the snapshot in.
_header_under_lockrefuses both conductor writers when the header is present but unreadable under the lock (no_ledger, the code the same header reads as everywhere else in the module -- corruption reads as absent -- with a message naming the torn header andrebuild_from_projectionas the remedy). The pre-lock snapshot was read before every writer that held the lock since, so writing it back would put a lower create count into the header the next create reads (for agoal) or into the bound itself (for acreate), and admit creates past what the fold retains.The rebuild sets the counter from the record.
rebuild_from_projectionwrites the rebuilt header withcreated_totalequal to the records the rebuilt board holds -- every item the fold retained plus every legacy record kept (a legacy item's first recorded mutation materialises it in the fold, where it takes a slot). The fold'somittedis deliberately not added: past the ceiling guard the fold dropped no create, and a non-zeroomittedthere counts entries that are not this board's creates (stragglers of a purged board, parked lines), which would refuse creates a board has room for. The header write moves after the item pass, since that is where the legacy set is known; the whole rebuild is snapshotted and restored on failure as before.The fold's ceiling is the same number, by construction. The crew log's
workfold keeps a board's firstWORK_ITEM_LIMITitems and counts every later create inomitted(projection._work_step).WORK_ITEM_LIMITandMAX_STORED_ITEMS_PER_CONDUCTORboth readwork_vocab.WORK_STORED_ITEM_LIMIT(256) -- the leaf the store and the fold already share, because the fold may not import the store and the store may not load the crew log's storage subsystem on the boot path. Every create the store admits is one recorded create and the counter never goes down under the store's own writes, so a board the writer admits cannot overflow the fold: the fold is always the whole board andomittedstays 0.rebuild_from_projectionstill refuses a full fold that reports omissions (crew_log_incomplete) before the dirty-cache shortcut that trusts the fold over the cache -- only such a fold is necessarily a prefix of the board -- but with the two bounds equal that guard is defensive, not the working path, and the write/rebuild deadlock the design lanes described past 256 lifetime creates cannot arise: the 257th create is refused at the store instead of being recorded past the fold's ceiling. A full fold that omitted nothing is the whole board and rebuilds. No fold state changed (a stored-state change would moveFOLD_STATE_VERSION).Docs.
src/kiro_crew/docs/work-ledger.md(Limits) states both bounds, describes the counter (record deletion does not reclaim capacity; an unreadable header refuses a create; a rebuild sets the counter from the record) and points a full board at "Cleaning up finished ledgers"; its ratchet test pins both numbers off the store's constants. The RFC's cap sentence, its rebuild paragraph, its error table and its "Unbounded growth" paragraph state both bounds and the counter, so "A ledger cannot grow without bound" is true as written.WORK_ITEM_LIMIT's comment,WORK_STORED_ITEM_LIMIT's,MAX_ITEMS_PER_CONDUCTOR's,MAX_STORED_ITEMS_PER_CONDUCTOR's,ConductorRecord.created_total's and_create_item's docstring state the relationship.Backwards compatibility
Compatible for every board under 256 creates: every create that succeeded before still succeeds (the open count only shrinks the counted set);
item_cap_exceeded, itsfieldand the exception type are unchanged; no record layout or reader changes. The conductor header gains one field,created_total; a header without it loads as 0 and the first create on such a board seeds it from the records the board holds, so an existing board's bound starts where the board stands. Observable changes, all intended: a create that used to be refused because of closed items now succeeds; a create on a board that has created 256 items is refused with the new codeitem_store_full(409) whether or not its record files are all still present; a conductorgoalorcreatethat finds the header present but unreadable under the lock is refused withno_ledgerand a message naming the torn header, where it used to rewrite the header from the pre-lock snapshot; a rebuild of a board whose fold is at its 256-item ceiling AND reports omissions is refused instead of rewriting a prefix; a rebuilt header's counter is the record's count, not the cache's.Tests
test/test_work_ledger.pytest_the_item_cap_refuses_the_thirty_third_item(existing) -- 32 open items still refuse the 33rd, bytes untouched.test_closed_items_do_not_count_toward_the_item_cap[accepted | rejected | abandoned]-- 32 open, close one in each terminal state, the 33rd create lands; refusal text names the open count.test_closed_items_stay_on_disk_listed_and_readable_past_the_cap-- closed items past the open cap are still listed bylist_work_items, readable byread_work_item, counted by the census.test_the_stored_bound_refuses_a_create_on_a_board_of_closed_items-- a board that createdMAX_STORED_ITEMS_PER_CONDUCTORitems, every one closed (zero open), refuses the next create withitem_store_full,field == "items", the message naming the create count, the bound andkirocrew ledger-sweep --purge; every file underitems/unchanged; every closed record still listed and readable; the header's counter at the bound. The bound is patched small the way the projection tests patchWORK_ITEM_LIMIT; the number is pinned separately.test_the_stored_bound_counts_a_record_the_listing_cannot_read-- a full board with one record torn to{(listed one short, zero open) is refused withitem_store_full,items/byte-identical.test_removing_a_record_does_not_reclaim_stored_capacity-- a full board with one record file and its event log deleted (listed one short,_stored_item_idsone short) is refused withitem_store_full, the message saying removing a record reclaims nothing, every remaining file underitems/byte-identical, the header bytes unchanged andcreated_totalstill at the bound.test_a_header_from_before_the_counter_is_seeded_from_its_records_once-- a header with the field removed and two records loads as 0; the next create seeds it from the two records and bumps it to 3; with four records and the field removed again, the create at the bound is refused on the seed and writes nothing.test_a_torn_but_present_header_refuses_both_writers_under_the_lock-- with a readable pre-lock snapshot and the header then torn,_create_itemand_write_goalboth refuse withno_ledger, the message says the header is present but unreadable and names the rebuild, the torn bytes are untouched and no record is minted.test_the_stored_bound_is_checked_before_the_open_cap-- at both bounds at once the refusal isitem_store_full.test_the_stored_bound_is_the_folds_item_ceiling--MAX_STORED_ITEMS_PER_CONDUCTOR == projection.WORK_ITEM_LIMIT == work_vocab.WORK_STORED_ITEM_LIMIT, and the open cap is below it.test_caps_hold_their_rfc_values(existing) --MAX_ITEMS_PER_CONDUCTOR == 32,MAX_STORED_ITEMS_PER_CONDUCTOR == 256.test_a_record_lands_at_the_size_the_ceiling_measured(existing, adjusted) -- compares each record path against its last write, since the create rewrites the header after the bootstrap wrote it.test/test_work_ledger_tools.pytest_every_store_code_maps_to_the_status_the_rfc_tabulates(existing, exhaustive overCODE_*) --item_store_full: 409.test_item_store_full_is_409-- through the record route: a board of closed records at the bound answers 409item_store_full.test/test_work_ledger_projection.pytest_a_fold_at_its_item_ceiling_refuses_the_rebuild_even_on_a_dirty_cache-- a fold holdingWORK_ITEM_LIMITitems withomitted = 1, a live board with a newer item flagged dirty: the rebuild raisescrew_log_incomplete, every byte underitems/is unchanged, the newer item is still readable, the fold's item is not materialised, the dirty flag stands.test_a_full_fold_that_omitted_nothing_is_the_whole_board_and_rebuilds-- exactlyWORK_ITEM_LIMITitems andomitted == 0rebuilds.test_a_rebuild_sets_the_create_counter_to_what_the_record_holds-- a fold of one item withomitted = 3(stragglers, not creates) rebuilt over a cache header holding 7 and then 0 leavescreated_total == 1both times; the rebuilt counter drives the next create (refused at a bound of 1, lands at 2 and bumps to 2).test_items_from_before_the_projection_survive_a_rebuild(existing, extended) -- the rebuilt counter equals the fold's items plus the kept legacy records.test_a_rebuild_that_fails_part_way_leaves_the_cache_as_it_was(existing, comment adjusted) -- the header write now follows the item writes; the undo still restores every byte.test/test_work_ledger_doc.py-- the ratchet pins "32 open items per conductor" and "256 items stored per conductor in total" in the shipped page, both read off the constants.Run on
6836d91a3:scripts/check_black_formatting.py,scripts/check_subprocess_encoding.pyandscripts/check_comment_history.py(againstupstream/main) pass;black --check,isort --check-onlyandflake8clean on the touched files;mypyon the touched modules -> no issues;pytestovertest_work_ledger.py test_work_ledger_doc.py test_work_ledger_tools.py test_work_ledger_projection.py test_mcp_work.py test_ledger_sweep.py test_error_code_contract.py test_crew_log_projection.py test_conductor_agent.py test_ledger_conductor_agent.py test_worker_agent.py test_crew_log_crew_emitter.py-> 879 passed, 0 failed;test_crew_log_emit.py test_crew_log_crew_types.py test_doctor_deprecated_agents.py test_docs_lint_fact_checks.py-> 445 passed; the seven other files that touch the store (test_cron_locking_regression.py test_deploy_lock_truncate.py test_hooks_json_shared_file.py test_pid_lifecycle.py test_pipeline_conductor_agent.py test_remove_slot_for_history_key.py test_session_control_owner_dm.py) -> 709 passed;scripts/docs_lint.pyclean.Manual verification
N/A -- unit coverage sufficient: the new tests drive the real store on disk through
apply_conductor_action(create/close), which is the same call path thework_ledger_recordMCP tool takes, and the 409 mappings of both codes are covered through the record route intest_work_ledger_tools.py.Related Issues
None.
Pattern harvest
Rule candidate: review-prompt
Pattern: a resource cap enforced by counting every stored record, terminal ones included, instead of the live set it exists to bound -- the cap then measures history and refuses work once enough of it has finished. Its pair: narrowing such a cap to the live set without a second bound on the stored total, which removes the only bound the retained records had. A third: bounding a value the log counts monotonically (creates) by counting a cache that can shrink (files), so that losing or deleting a cached record reopens capacity the log has already spent.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)src/kiro_crew/docs/work-ledger.md,docs/request-for-change/rfc-conductor-work-ledger.md