Repository navigation
fix(doctor): stop flagging skills and the MCP daemon as stale across two installs - #21680
Conversation
|
Determinism evidence for the tests this PR adds (head Node ids (10 items, counting parametrized cases): The tests use only temp directories and monkeypatched fingerprints and pids. They use no clock, sleep, network or real daemon. Related set after rebasing onto Local review on the pre-rebase head |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Before merging, confirm that a gateway from this install cannot adopt a daemon with a git stamp when it runs an [DESIGN-REVIEWED] ec3f906 Description read[DESCRIPTION-READ] 3502bc12ef79ece901ae990481b947b7062b7d3f3b6a70bdd8c052237f39423c 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 Nothing to check. What this change shipsInventory (6 items) — 6 justifiedIntent: stop
[FIRST-PRINCIPLES-REVIEWED] ec3f906 Description read[DESCRIPTION-READ] 61f95f2fe757ca27023c46ebae25d33cec82dc8e4d06966444a88aa6acab754c That sha256 names the PR description this verdict read. Recompute it with |
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: |
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: |
df83326 to
f51a296
Compare
|
|
|
Pushed This head fixes the Opus spec finding and the Design punchline, and answers the First Principles punchline with code evidence. See the three disposition comments above. Process disclosure: the repair-routing rule says AI-review fixes go to a model-pinned fix subagent. I made both edits in the parent session instead. One is a doc sentence and the other is one wording line on the doctor info row, with its test assertion. A separate claude-opus-5.5 verifier then read both diffs and reported both items closed with no new Critical/High findings. After the rebase, the related tests (535) and the black, isort, flake8, mypy, comment-history and docs-lint checks are green locally. |
|
self-added: yes
|
|
|
f51a296 to
2741dd4
Compare
|
|
buluoray
left a comment
There was a problem hiding this comment.
Approving at 2741dd4. The range-diff against f51a296 shows the same patch rebased onto current main with no code change. The skill-currency change only leaves pycache out of a comparison reached after the installed copy is proven to be the one the sync wrote, so any source or SKILL.md difference still reads behind and a cache added to the installed copy still reads edited. Mutating owner liveness, same_scheme, the cache filter in both directions, the opt-out fallback and the cache-free comparison each reddens a named test; the daemon-control and skill-currency tests pass on this head. CI was still running with 0 failed when I checked.
Follow-up, not blocking: the stamp rule is not fixed by where the package root sits. _git_fingerprint returns None and code_fingerprint falls back to the mtime rule when no trusted git is found, rev-parse fails, git diff errors, or a call hits the 5 s timeout (code_fingerprint.py:84, 96, 123-127). A daemon this install spawned in such a moment carries an mtime stamp while doctor computes a git one; its owner is this install own live gateway, so doctor_checks/mcp.py:375 reports it as another install and records no issue even if it is truly stale. Requiring that the owner is not this install gateway (or that the daemon root differs) before that branch, with a test for git-vs-mtime under the local gateway, would close it.
2741dd4 to
48797d0
Compare
|
Rebased: main moved in docs/system-specs/modules/cli.md (same file, no conflict), src/kiro_crew/doctor_checks/ and test/test_cli_doctor_refactor_report.py since this head started CI (96c9588 -> 175e6f6); the stale head's runs were cancelled and CI is re-running. New head 117806c; related tests (571 passed, including test_cli_doctor_refactor_report.py and test_ledger_sweep.py) and docs-lint green locally. |
117806c to
5b5d602
Compare
|
|
|
Backend Tests (3.12, 1) and (Windows) (1) are red on head 5b5d602 at test/test_history_bindings.py::test_the_member_set_is_the_frozen_inventory@tree_scan_history_bindings. That is main's red, not this PR's: the frozen inventory lacks the members added by 8335fa0 (#21108), the test fails the same way locally, and this PR touches no history module. The fix is open in #21792. This PR waits for it: no rerun and no override. Once #21792 merges, it rebases onto that fix. |
|
Rebased onto 943a4e5, which carries the main-red fix #21792 for test/test_history_bindings.py::test_the_member_set_is_the_frozen_inventory (the two Backend Tests reds and the Coverage Gate fail-closed on head 5b5d602). New head ec3f906; related tests plus test_history_bindings.py (712) green locally; CI re-running. |
5b5d602 to
ec3f906
Compare
|
|
Review-ready at head
This Crew does not merge, approve or enable auto-merge. The merge is the maintainer's call. CREW-22688 and #20629 stay open until the merge. |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (7 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: doctor no longer flags byte-identical built-in skills (bytecode caches excluded) or another install's MCP daemon (different fingerprint scheme, live owner) as stale; tests added. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/cli.md, docs/system-specs/modules/mcp-gateway-daemon-lifecycle.md.
Problem / Motivation
Goal: On a machine with both a source checkout and the desktop app,
kirocrew doctorstops reporting byte-identical built-in skills as "does not match" and stops reporting the other install's MCP gateway daemon as stale.With an app install and a source checkout on one machine, the gateway (and its skill sync) runs from the checkout while
kirocrew doctorruns from the app. Doctor then flags 12 built-in skills as "does not match" and flags the MCP gateway daemon as running a different code revision. Neither clears after a restart, or after moving the skills out and letting the sync reinstall them.Why it matters
Doctor exits with issues on a healthy machine, and its prescribed fixes (restart, move the skill out) cannot clear them. An operator learns to ignore the Installed Skill Currency and MCP daemon rows, so a real stale skill or a real stale daemon goes unnoticed.
Not a goal
What changed (motivation → approach → change)
Doctor stops reporting a false mismatch when the skill sync and doctor come from two installs built from the same sources.
scripts/__pycache__. The marker records the checkout's tree, and the 12 flagged skills are exactly the ones withscripts/*.py.__pycache__left out of both. Equal means in step.mtime:stamp. Two stamps from different rules are never equal.code_fingerprint.same_schemespots stamps from different rules. When a live gateway owns that daemon, doctor prints it as another install's, names the owner pid to stop if that gateway should no longer run, adds no issue and prescribes no restart. With no live owner it stays an issue, since this install's gateway may have adopted it.The skill half lives in
src/kiro_crew/skills_builtin_provenance.py:_tree_entriesand_skill_tree_fingerprinttake askip_bytecode_cachesflag that only the currency check sets. That comparison runs only after the ownership check passed with caches included, so a cache added to the installed copy still reads as edited, and the sync is unchanged. The daemon half issame_schemeinsrc/kiro_crew/code_fingerprint.pyand its one caller insrc/kiro_crew/doctor_checks/mcp.py. The doctor rows are described indocs/system-specs/modules/cli.mdanddocs/system-specs/modules/mcp-gateway-daemon-lifecycle.md.Backwards compatibility
Compatible: doctor output only. Two rows move from ❌ to ✅ or ⏹ in the cross-install case; every same-install verdict is unchanged.
Removes nothing: no key, marker, function or verdict state is removed, and the provenance marker format is unchanged.
Tests
test/test_skill_install_currency.py: a checkout-synced copy judged against an app tree with caches reads in sync, and the reverse direction does too. A carried Context-budget opt-out across installs reads in sync. A real script change across installs still reads behind. A cache added to the installed copy still reads edited.test/test_mcp_gateway_daemon_control.py: a git-stamped daemon under anmtime:doctor (and the reverse) with a live owner is printed as another install's with no issue. The same daemon with no owner or a gone owner is still an issue namingkirocrew restart, and so are twomtime:stamps that differ.Manual verification
N/A — unit coverage sufficient: both rows are pure functions of on-disk trees and the daemon pong, which the tests build directly.
Related Issues
Closes #20629
Pattern harvest
Rule candidate: review-prompt
Pattern: an identity check that compares two installs' build outputs (bytecode caches, stamps from different rules) instead of their sources reports a mismatch no restart can clear.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)