Skip to content

fix: 0.12.x backport batch 5 (work ledger accepted close, kas connect) - #35576

Merged
buluoray merged 2 commits into
release/0.12.0from
crew/slack/backport-batch-5-0.12.0
Nov 11, 2026
Merged

buluoray merged 2 commits into
release/0.12.0from
crew/slack/backport-batch-5-0.12.0

Conversation

@buluoray

@buluoray buluoray commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring two fixes that merged on main today to 0.12.x: the work ledger refuses close state=accepted on 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 head 3d06d4604b14 (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 with git cherry-pick -x:

Pick Main commit What 0.12.x users get
#35469 81c04e4f3111e4c1c530335090173fd083c547db A conductor can no longer close a work item as accepted unless the item's latest verdict is pass. The refusal names the step to take first. A user on 0.12.1.2 reported items closed as accepted with no verdict.
#35396 fd94582e20f61ffee8c9dc4eae40a8a4f69a1c6e When the KAS engine failed to refresh a saved connection token, Connect now replaces it. Before, the dead token stayed and the connection could not be repaired from the dashboard.

This 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 accepted close 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, the apply_conductor_action docstring: took the pick's close line ("accepted only on an item whose verdict is pass") and kept release's goal line, which still lists item_cap. Main has removed that field; release has not. No code line was hand-resolved.

Backwards compatibility

#35469 is breaking, as on main: action=close state=accepted on an item whose latest verdict is not pass is refused with an error that names the remedy (record action=verdict first). Every other close state is unchanged. Readers on release/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 state description's wording changes; the route's 400 reaches the conductor as before
Reader: 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 accepted close of it is now refused with the message naming rejected and abandoned
Reader: 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 11, 2026 20:40
@buluoray
buluoray requested review from dodgeblaster and removed request for a team November 11, 2026 20:40
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 11, 2026
@buluoray
buluoray force-pushed the crew/slack/backport-batch-5-0.12.0 branch from 77c1b43 to af8e7e5 Compare November 11, 2026 21:12
@buluoray buluoray changed the title fix: 0.12.x backport batch 5 (batch write guard on by default) fix: 0.12.x backport batch 5 (work ledger accepted close, kas connect) Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 41c04284af59c46691e045e035c52ba13ba9c601 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 41c0428

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

@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 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 41c04284af59c46691e045e035c52ba13ba9c601 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 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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 accepted close.

Notes

  • Shipping a refusal that breaks callers in a patch release is a policy decision for the release owner. The pick is easy to revert, and the refusal text tells the conductor what to do instead. That makes the risk reversible, so it doesn't block.

[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 .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 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 41c04284af59c46691e045e035c52ba13ba9c601 — 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

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 ships

Inventory (5 items) — 5 justified

Intent: 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.

  1. A conductor's close state=accepted on an item whose latest verdict is not pass is now refused, and the error names the remedy — justified
  2. The state tool description now says accepted needs a pass verdict first — justified
  3. The user doc work-ledger.md now says only a pass allows an accepted close — justified
  4. Connect now runs sign-in, instead of failing with mint_server_failed, when the engine reports the server failed but saved tokens exist — justified
  5. The connections spec gets a row for the failed-with-saved-tokens report — justified

[FIRST-PRINCIPLES-REVIEWED] 41c0428

Description read

[DESCRIPTION-READ] 94d82e08bb5e49fffa5aa8d8d5cd4230568f329b06ed50128a63cf86a49f2f1a

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 41c04284af59c46691e045e035c52ba13ba9c601 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 41c0428

Verdict parsed from the review's SHA-scoped output markers for commit 41c04284af59c46691e045e035c52ba13ba9c601.

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

…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)
@buluoray
buluoray force-pushed the crew/slack/backport-batch-5-0.12.0 branch from af8e7e5 to 41c0428 Compare November 11, 2026 21:38
@buluoray
buluoray merged commit 5fde7bd into release/0.12.0 Nov 11, 2026
24 of 34 checks passed
@buluoray
buluoray deleted the crew/slack/backport-batch-5-0.12.0 branch November 11, 2026 22:19
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 11, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Thanks, Ray. A note for the release record: this merged onto release/0.12.0 at 22:19 UTC, a few minutes after v0.12.2-rc.2 was tagged on b659923422, so it is not in 0.12.2. The maintainer chose not to cut another RC for it, partly because #35469 changes behaviour (an accepted close now needs a pass verdict), which is a better fit for a minor release. Both fixes reach users with 0.13.0 from main. The stable v0.12.2 tag goes on b659923422, so release/0.12.0 now runs ahead of 0.12.2.

AI-assisted, sent by Kiro Crew Captain

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