Repository navigation
refactor(work-ledger): keep only the critical create refusal from host pressure - #37164
Conversation
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This walks #36481 back to the one guard the owner kept, and nothing in the tree still reads Notes
[DESIGN-REVIEWED] e0a19a0 Description read[DESCRIPTION-READ] 4f51868dc327c0fa51089f56fc07550ab89e25db2c5fc3b33c60f27c65378d14 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 (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This PR only removes code. It takes out the host-pressure record, the wake and the prompt rule from #36481, and keeps the critical What this change shipsInventory (8 items) — 8 justifiedIntent: return host-memory handling to one guard (a
[FIRST-PRINCIPLES-REVIEWED] e0a19a0 Description read[DESCRIPTION-READ] 0da06e786ab851baad6eea12bf04c01716ca7483228f820287cc60fc934f7d60 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] e0a19a0 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 13% chance that this change introduces a defect, above the 12% limit for approving on its own. This PR removes everything #36481 added for host memory pressure (the record, the notifier writes and wake, the probe wake, the read field and the conductor rule) and keeps only the 409 create refusal at critical memory, renamed to host_memory_critical. The RFC on the base branch already records the owner's withdrawal and the rename. I found no remaining code or test that uses a removed name, the kept refusal is tested, and the refusal code still maps to 409. Two things are not blocking: the golden prompt fixture was rolled back to stale text (nothing tests it), and one RFC line still mentions host_pressure. 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 |
1645e5c to
ce5d952
Compare
ce5d952 to
d9a2291
Compare
…t pressure The repository owner narrowed rfc-work-ledger-resource-pressure on 2026-11-14: the conductor checks resource_status before it dispatches, and only one piece of code stays. This removes the rest of #36481: - src/kiro_crew/host_pressure.py (the host record) and its RESERVED_ROOT_DIRS slot - ResourcePressureNotifier's episode id, pressure_sink, level-change wake and pending flush (back to its pre-#36481 behaviour) - the pressure wake in conductor_wake and WorkLedgerProbe - conductor.host_pressure in work_ledger_read - the host_pressure conductor rule in spec_prompts, crewmate_prompts.json and goal-conductor SKILL.md, its parity anchor, and its work-ledger.md section - test/test_work_ledger_host_pressure.py; the golden and spec-byte pins go back to their pre-#36481 values Kept: _refuse_if_host_critical in _create_item (409 via the live admission_check). Its code is renamed host_pressure_critical -> host_memory_critical, since nothing named host_pressure is left. Its tests move to test/test_work_ledger_host_memory_refusal.py. The withdrawal itself is recorded in the RFC by #37170, which lands first.
d9a2291 to
e0a19a0
Compare
|
First Principles follow-up: the withdrawal this PR implements is now on main. #37170 merged as ecbe3c4 (2026-11-15T12:39:53Z). It marks the record + wake parts of rfc-work-ledger-resource-pressure.md as withdrawn by the owner (critical create refusal stays), updates the README status row, and fully withdraws the person-wait-release RFC. This PR is rebased onto main 0fc6bc6 (head e0a19a0), which contains #37170, so the earlier First Principles blocks (e.g. span d23a55875b63 / a1371fcd8411, all 'withdrawal must land on main first') no longer apply. If the lane flags a span on the new head, I will answer it with a per-span disposition. |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Verified on this head: each src hunk reverses its counterpart in #36481 (cf638b8). The one exception is _refuse_if_host_critical, which is kept. It still runs a live admission_check() under the conductor lock, after the caps and before any write. A grep of src/, test/ and website/ finds no remaining reader of host_pressure, wake_all_for_pressure, PRESSURE_ITEM_ID, flush_pressure or host_pressure_critical. No release branch or tag contains cf638b8, so the code rename reaches no shipped client. The moved refusal tests are deterministic, stay inside tmp_path, and still assert that a refused create writes no bytes.
This is a careful trim. It keeps exactly the guard the owner asked for, and the withdrawal was recorded on main in #37170 before the code goes.
The design is signed off under the standing maintainer sign-off for changes by team members.
Optional:
test/fixtures/crewmate_prompts/ledger.golden.txt: the hunk restores the pre-#36481 bytes in full, which also rolls back wording from other merged prompt changes.scripts/crewmate_prompt_preview.py --fixture ledger --difftherefore shows unrelated drift on this head. Running--writeon the head, or deleting only the host_pressure block from main's version, would fix it. No test compares this file. #37619 also edits it, so expect a conflict there.- The
refactor:type reads as no behaviour change, but this removes the conductor pressure wake and the pause rule, and renames the 409 code. The body says so, butrevert:would match the diff better. docs/request-for-change/rfc-work-ledger-concurrency-cap.md:182still says to follow the pressure RFC on ahost_pressurerecord. That record no longer exists, so a small follow-up could drop the clause.
Problem / Motivation
Goal: Host memory pressure keeps only one guard: a work-ledger
createis refused while memory is critical; the ledger record, the conductor wake and the pause rule from #36481 are removed.The repository owner, on reading what #36481 shipped: "我的想法是缩小,其实只要给个简单指示,说明派活要先查资源,然后给AI工具查资源不就好了?为什么改那么多代码" and "开精简 PR,只留 critical 拒绝。" In English: the conductor only needs a short rule to check resources before it dispatches, and it already has the
resource_statustool for that; keep only the critical refusal.Why it matters
#36481 added about 1,000 lines (a host record file, a notifier sink, a wake path through
conductor_wakeandWorkLedgerProbe, a read field, and a conductor rule) for something the existingresource_statustool already tells a conductor. Every one of those parts is code to keep correct, and the conductor prompt pays for the extra rule on every turn. The owner wants the smaller shape.Not a goal
resource_status,admission_checkor the[RESOURCES]turn line.host_pressurereferences themselves.What changed (motivation → approach → change)
The owner narrowed the decision, so this PR takes #36481 back to what main had before it, except for the one guard the owner kept.
host_pressure.py) and its reservedhost/directory (work_ledger_store.py); the record writes and level-change wake innotifications/resource_pressure.py; the pressure wake inconductor_wake.pyandprobes/work_ledger.py;conductor.host_pressureinwork_ledger_read; thehost_pressureconductor rule in both conductors' prompts, its parity anchor and its section inwork-ledger.md. The prompt golden and spec-byte pins go back to their pre-feat(work-ledger): host memory pressure goes on the ledger and wakes the conductor #36481 values._refuse_if_host_criticalin_create_item(work_ledger_writes.py). Acreateis still refused 409 while the liveadmission_check()refuses. Its code is renamedhost_memory_critical(fieldhost_memory) inwork_ledger_records.pyand thesrc/kiro_crew/work_ledger.pyfacade, since nothing namedhost_pressureis left. Its tests move to a small file of their own.Product shape: this removes a conductor behaviour (pause dispatch on a pressure wake) that the RFC on main records as decided. The owner's withdrawal is recorded in rfc-work-ledger-resource-pressure.md by its own docs PR, #37170, which lands first; this PR then rebases onto it. This PR changes no RFC.
Backwards compatibility
Breaking: the 409 refusal code
host_pressure_criticalbecomeshost_memory_critical, andwork_ledger_readno longer returnsconductor.host_pressure. Writer sweep on origin/main @ 16e11a1: every reader of both is in this diff (the conductor rule inspec_prompts.py,crewmate_prompts.json,goal-conductor/SKILL.md,work-ledger.md, and the tests); the website has none. #36481 merged today and is in no release tag.Reader: src/kiro_crew/agent_parts/spec_prompts.py:_LEDGER_CONDUCTOR_RULES -- chat -- the
host_pressurerule that read the field is removed in this diff; test/test_crewmate_prompts.py pins the resultReader: src/kiro_crew/builtin_skills/goal-conductor/SKILL.md -- chat -- the section that read the field is removed; test/test_mate_conductor_parity.py
Reader: src/kiro_crew/dashboard/handlers/work_ledger_refusals.py:_CODE_STATUS -- crew page -- maps the renamed code to 409; test/test_work_ledger_tools.py::test_every_store_code_maps_to_the_status_the_rfc_tabulates
Reader: src/kiro_crew/ledger_sweep.py:_RESERVED_ROOT_DIR_NAMES -- release --
hostis no longer reserved; a leftoverwork-ledger/host/from a main build of today has no breadcrumb, so the sweep reports it for a human and never deletes itTests
test/test_work_ledger_host_memory_refusal.py(moved from the deleted file): acreateat critical is refusedhost_memory_critical, names what lifts it and writes nothing; tight, unknown and ample admit;agent.admission_gate: falseadmits at critical.test/test_work_ledger_host_pressure.pyis deleted: the rest of it covered the removed record, wake and probe.ledger.golden.txt,test_agent_refactor_spec_bytes.py,test_agent_refactor_contracts.py, the parity anchor.Local, related files only: 544 passed across the refusal, tools, parity, prompt, spec-byte, conductor-wake, probe, notifier and read tests (
-n 2). Determinism: the new file passed 5 repeats and once in reversed order. isort, flake8, mypy, docs-lint, the flake-pattern ratchet and the repo semgrep rules are clean.Manual verification
N/A — unit coverage sufficient: the kept refusal is unchanged code with its tests, and the rest is a return to main's pre-#36481 files.
Related Issues
Part of #36301
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)