Repository navigation
refactor(knowledge): label backends through the pool's _label helper - #32201
Conversation
|
CI attribution for head
|
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the four call sites now go through the module's existing [DESIGN-REVIEWED] 9b79031 Description read[DESCRIPTION-READ] 48cbe2cfd56d7fbf0911037376e1c728d7d0417147d58a6598c736d24d10e401 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 blocks. The PR swaps in a call to a helper the same module already defines and changes no behaviour. Notes
What this change shipsInventory (1 items) — 0 justifiedIntent: make the knowledge pool's worker logs name a backend through the module's single label helper. Refactor, no behaviour change (neither a fix nor an addition).
[FIRST-PRINCIPLES-REVIEWED] 9b79031 Description read[DESCRIPTION-READ] 727f09a4df47767c683ece2ddd942661d5ab5fd759776c2b843aeae60bdfc947 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsI checked the four changed call sites against the repository code. Each one now calls the module's No findings. [OPUS-REVIEWED] 9b79031 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: |
d133173 to
f382bf1
Compare
|
Rebased onto |
f382bf1 to
9b79031
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: refactor (1 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: four log calls use the existing _label helper, which returns the same POLICY_ID_BY_BACKEND lookup they inlined; no behaviour change.
Problem / Motivation
Goal: Make the knowledge pool's worker logs name a backend the one way the module already defines, with no change to behaviour.
knowledge/llm_pool.pyhas a helper,_label(backend), that gives a backend's policy id for messages (Kiro CLI shows askiro, not""). The fallback messages and one zero-tool restart message already use it. Four other log calls inAcpWorkerwrite the same lookup out by hand asPOLICY_ID_BY_BACKEND.get(x, x).Why it matters
When a module has two ways to spell one label, the next change to how a backend is named in messages updates the helper and misses the four hand-written copies. The startup, restart, refusal and unsupported-effort logs would then name the backend differently from the fallback message about the same worker.
Not a goal
knowledge/.ingestion.pyhand-builds its_gateand_insert_jobclosures twice, iningest_fileandingest_text. That file's structure is pinned by AST ratchet tests (test_knowledge_ingest_created_ids.py,test_knowledge_ingestion_off_loop.py) and touched by two open PRs, so it is left alone.embedder.py:_fresh_cached_availability. The detector matched it againstmodel_resident_async, but the two do not compute the same value.authorize_upload_rootcopies across the discord, feishu, webex and wecom renderers. They span four packages.What changed (motivation → approach → change)
src/kiro_crew/knowledge/llm_pool.py: four log arguments inAcpWorker, at spawn, the restart after an unconfirmed zero-tool spec, the refusal when a spec has no"tools": [], and the unsupported-effort warning, now call_label(x)instead ofPOLICY_ID_BY_BACKEND.get(x, x)._label's body is that exact expression. No import changes, because_labelstill readsPOLICY_ID_BY_BACKEND.Backwards compatibility
Compatible: each call returns the same string from the same module global, so every log line is byte-identical.
Removes nothing: no name, key or path is deleted. The four expressions are replaced by a call that returns the same value.
Tests
No test added or changed: the rewrite produces the same log arguments, so a test has nothing new to observe.
Proof: not provable -- other: behaviour-preserving call-site dedup, no production behaviour to revert
test_llm_pool.py,test_llm_pool_lifecycle.py,test_llm_pool_effort.py,test_llm_pool_enterprise_floor.py,test_llm_pool_ccworker.py,test_knowledge_spec_repair.py,test_knowledge_effort_pools.py,test_knowledge_harness_refusal_ingest.py,test_claude_zero_tools.py,test_acp_goose_backend.py,test_acp_pi_backend_session.py,test_knowledge_owner_gate.pyandtest_knowledge_budget.py. All 454 passed.scripts/scrub-lint.shdoes not exist in the tree.git merge-treeagainst the open fix(knowledge): [Crew pulse] reset pool workers in place after every call #31762 and feat(git): switch branches from the Git panel and composer chip #17628, which also touchllm_pool.py, shows this hunk auto-merging. Each PR's conflict set is the same with and without this commit.code-review.ymlgreps and theclaude-review.ymlbar; behaviour preservation (helper body, argument types, test patches, source pins, imports, comments); and keystone, boot path and harness parity. None found anything, so there was nothing to verify or drop. Thecodex-review.ymlseverity sections were not read by that reviewer.Manual verification
N/A: the replaced expressions and the helper are the same expression, so no path can behave differently.
Screenshots / video
Why no screenshot: backend-only change to log arguments in one Python module; no page, route or rendered string changes.
Related Issues
Part of #16523
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.