Repository navigation
fix: 0.12.x backport batch 5 (work ledger accepted close, kas connect) - #35576
Conversation
77c1b43 to
af8e7e5
Compare
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: these are two cherry-picks of fixes already reviewed on main. The accepted-close refusal is breaking, and the description lists and accepts it with its readers. I found no in-tree caller outside that list that writes an Notes
[DESIGN-REVIEWED] 41c0428 Description read[DESCRIPTION-READ] 13fbb8919047fbea09f6f251038b5d49d247d1cf223df73ddeab00d1068803cc 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 Two cherry-picked fixes, each with a linked issue or a test that fails on base. No riders, no new surface, and neither one changes product shape. What this change shipsInventory (5 items) — 5 justifiedIntent: give 0.12.x users two fixes from main. Accepted work items must have a pass verdict, and Connect can repair a KAS connection whose token the engine failed to refresh. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 41c0428 Description read[DESCRIPTION-READ] 94d82e08bb5e49fffa5aa8d8d5cd4230568f329b06ed50128a63cf86a49f2f1a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…5469) work_ledger_record action=close with state accepted succeeded on an item with no verdict, or whose latest verdict was fail, so the board could show an item and its goal accepted when nothing passed it. The docs say acceptance is the evaluator's verdict and a worker's done is only a claim. The store's close now refuses accepted unless the item's stored verdict is pass, under the item lock it already holds, with the existing invalid_value code on state and a message naming the ways out (record the evaluator's verdict, or close rejected or abandoned). Rejected and abandoned closes are unchanged. The tool's state description and docs/work-ledger.md say the same; tests that closed an item accepted with no verdict record a pass first. Closes #34935 (cherry picked from commit 81c04e4)
…fresh (#35396) On KAS the engine drops a remote MCP server's saved tokens only when the vendor rejects a refresh with invalid_grant, invalid_client or unauthorized_client. Any other refusal (a 403 unknown_error, a 401 invalid_token) keeps the dead tokens in Crew's grant vault and reports the server failed, not awaiting sign-in. A chat then offers no sign-in, and Connect / "sign in again" ended the row at mint_server_failed before it ever sent the startOAuth reset that would replace them. The only way out was deleting <data home>/kas/mcp-grants by hand. mint_on_kas now treats a failed server whose url still has saved tokens as one that needs signing in: it starts the engine's sign-in, whose startOAuth reset drops every credential first. A failed server with no saved tokens still fails the row as before. Refs #34476 (cherry picked from commit fd94582)
af8e7e5 to
41c0428
Compare
|
Thanks, Ray. A note for the release record: this merged onto AI-assisted, sent by Kiro Crew Captain |
Problem / Motivation
Goal: Bring two fixes that merged on main today to 0.12.x: the work ledger refuses
close state=acceptedon an item with no pass verdict, and Connect can replace KAS tokens that the engine cannot refresh.Backport batch 5 onto
release/0.12.0. Rebased onto the release head3d06d4604b14(after #35596 and the 0.12.2 version commit); the rebase had no conflict and the test set was rerun there. One commit per pick, each made withgit cherry-pick -x:81c04e4f3111e4c1c530335090173fd083c547dbacceptedunless the item's latest verdict ispass. The refusal names the step to take first. A user on 0.12.1.2 reported items closed as accepted with no verdict.fd94582e20f61ffee8c9dc4eae40a8a4f69a1c6eThis PR first carried six batch write guard picks as well (#30964, #31274, #33570, #33582, #33819, #33844). They were taken out: #33582 turns the guard on by default, which its own PR calls breaking, and that is not a change for a patch release. The guard reaches users with the next version cut from main.
Why it matters
An
acceptedclose with no pass verdict records work as done that nobody checked (#34935). A connection whose token the engine cannot refresh stayed broken until someone edited the store by hand.Not a goal
What changed (motivation → approach → change)
#35396 applied with no conflict. #35469 had one. @bolichen97, please check it.
#35469, hand-resolved
src/kiro_crew/work_ledger_writes.py, theapply_conductor_actiondocstring: took the pick'scloseline ("acceptedonly on an item whoseverdictispass") and kept release'sgoalline, which still listsitem_cap. Main has removed that field; release has not. No code line was hand-resolved.Backwards compatibility
#35469 is breaking, as on main:
action=closestate=acceptedon an item whose latest verdict is notpassis refused with an error that names the remedy (recordaction=verdictfirst). Every other close state is unchanged. Readers onrelease/0.12.0, from the source PR:Reader: src/kiro_crew/dashboard/handlers/work_ledger_conductor.py:_write -- chat -- test_work_ledger_tools.py::test_item_closed_is_409_for_both_halves
Reader: src/kiro_crew/mcp_work.py:_ledger_tool_definitions -- chat -- only the
statedescription's wording changes; the route's 400 reaches the conductor as beforeReader: src/kiro_crew/remote_dispatch_mailbox.py:close_mailbox -- subagent -- closes abandoned, which needs no verdict; test_remote_dispatch_work_item.py::test_a_cancelled_close_still_closes_the_item
Reader: src/kiro_crew/mcp_dashboard_session_runs.py:_dispatch_cleanup -- chat -- closes abandoned, which needs no verdict
Reader: src/kiro_crew/dashboard/goal_setup.py:kickoff_prompt -- chat -- its research item has no bar and the prompt names no close state; an
acceptedclose of it is now refused with the message namingrejectedandabandonedReader: src/kiro_crew/agent_parts/spec_prompts.py:act_by_status -- chat -- the conductor prompt already records action=verdict before it closes by the answer
Reader: src/kiro_crew/crew_log/projection_work.py:_work_step -- crew page -- replays stored close events without the write path; test_work_ledger_projection_fold_state.py
Reader: src/kiro_crew/probes/work_ledger.py:ACCEPTED_STATE -- chat -- reads the closed state only; test_probe_work_ledger.py::test_every_item_closed_wakes_once_and_is_never_terminal
#35396 is compatible: it only changes what Connect does with a token that already failed to refresh.
Nothing is removed: no key, path or record.
Tests
Test changes come from the picks.
Run locally on head
41c04284af59, one pytest process per batch of 20 files, no xdist: the 131 test files on this branch that name the work ledger,mcp_work,mint_kas,apply_conductor_action, the ledger sweep or remote dispatch: 6,169 passed, 0 failed. flake8 and black on every Python file in the diff: clean.Proof: PROVEN test/test_connections_mint_kas.py::test_connect_replaces_saved_tokens_the_engine_failed_to_refresh, test/test_work_ledger.py::test_close_accepted_needs_a_pass_verdict[verdicts0], test/test_work_ledger.py::test_close_accepted_needs_a_pass_verdict[verdicts1], test/test_work_ledger.py::test_close_accepted_needs_a_pass_verdict[verdicts2], test/test_work_ledger.py::test_close_accepted_needs_a_pass_verdict[verdicts3] (head 41c0428)
Manual verification
N/A — unit coverage above; the same changes are on main.
Screenshots / video
Why no screenshot: the diff touches no frontend file.
Related Issues
Backport of #35469 and #35396. Refs #34935.
Sibling sweep
Siblings: none -- the backport touches the same sites the two PRs changed on main
Pattern harvest
Not generalizable: backport of already-reviewed fixes (#35469, #35396)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.