Repository navigation
fix: turn main green after three concurrent merges (#25937) - #25947
Conversation
7e08250 to
a13e48f
Compare
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
Approving at a13e48f. An independent fix for the same three main reds reached the same diff: the four lock sites go through platform_compat.open_create_or_existing with O_CREAT dropped and O_NOFOLLOW/O_NONBLOCK kept; the security budget moves to the measured 32,909 with the reason (#25266 landed on top of #23499's raise); and the hook test only calls on_fire for the two prompt events, since #25127's Stop fire runs after the watchdog window. Reproduced both test reds on d328624 and saw 85 passed on the fixed tree for the ratchet, liveness and facade-mirror tests. Note: subagent_manager/run_turn.py is still 2,030 lines on main; #25950 splits it and will be rebased onto this.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: each of the three items fixes one red test on What this change shipsInventory (3 items) — 3 justifiedIntent: get
[FIRST-PRINCIPLES-REVIEWED] a13e48f Description read[DESCRIPTION-READ] 3c6780304188c0cd0ea5ee57ffa2fe13b67ea36516a77cfdbabfe87be7cb0f6c That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Each red test is traced to the merge that caused it, and each fix is the smallest one that works: the race-safe open helper the ratchet already names, a budget re-measured with a reason, and a probe limited to the two hook fires the test is about. Notes
[DESIGN-REVIEWED] a13e48f Description read[DESCRIPTION-READ] fbbc24d9fd94b29487ab37a769cceca50f6ed699aed71c71b4692cfccd3d3d65 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 |
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: |
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: |
Problem / Motivation
Goal: Turn
maingreen again: three backend tests fail on it after PRs that were each green alone merged within minutes of each other.On
mainat d328624 these three fail on every OS, so every open PR's backend shards fail too:test/test_dir_fd_create_race_ratchet.py::test_no_lock_file_is_created_with_a_nonexclusive_opentest/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budgettest/test_subagent_prompt_hooks.py::test_hook_time_is_not_charged_to_the_first_prompt_watchdogWhy it matters
Every open PR is red on its backend shards until these pass, so nothing can land green.
Not a goal
security/package's code.What changed (motivation → approach → change)
O_CREATand noO_EXCL, which can returnENOENTon Darwin when two callers raceplatform_compat.open_create_or_existing, the race-safe helper the ratchet namesredaction.pyby 10 lines and fit the old budget aloneStophook fire after a child prompt ends; the test's probe ran in every fire, so it saw that third fire tooThe four lock sites are
cli_commands_secrets.py(_handle_secrets_authorize),history_locks.py(_try_acquire_named_sidecar),template_mcp_additions.py(_locked) andworkflows/library.py(create). Each keeps its other flags (O_NOFOLLOW,O_NONBLOCK), its mode and its fstat checks. The watchdog code is right: aStophook runs after the first prompt, outside the prompt-hook window.Backwards compatibility
Compatible: each lock file is still created owner-only when absent and opened when present; only the create step is now exclusive.
Removes nothing: no path, key, record or function goes away.
Tests
The three node ids above fail on
mainat d328624 and pass on this head. Related suites pass: secrets authorize, template MCP additions, workflows library and service, history locking and bindings, staging sweep, the full ratchet, liveness and prompt-hook files (800 tests).Proof: not provable -- other: the lock fix is guarded by the unchanged ratchet test, red on main and green here
Manual verification
N/A — the failing tests are the check, and they run in CI.
Related Issues
Closes #25937
Sibling sweep
Swept: the lock ratchet's own scan of
src/kiro_crew/foros.openof a lock path withO_CREATand noO_EXCLSibling: src/kiro_crew/sel_append.py -- not affected -- on the ratchet's allow-list, it opens the SEL data file under the chain lock
Pattern harvest
Not generalizable: each red is a merge race between PRs that were green alone; the ratchet and budget tests already catch the class.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)