Repository navigation
fix(skills): page a large skill body through skill_search read - #14895
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the stateless per-page cost: each page re-reads and decodes the whole body (up to the 50 MiB cap), so a huge skill pays that per page. [DESIGN-REVIEWED] 8d6e965 Description read[DESCRIPTION-READ] 57ae4dc7e64cb64862a98206a716d4a4123639616a5437eb3d19d982eb6ee661 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 (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the narrowed whole-read band: bodies between the framing-reduced capacity (~97.5 KB) and 99,000 bytes now refuse-and-page where one call once delivered them. What this change shipsInventory (10 items) — 9 justifiedIntent: FIX — a skill the catalog lists but whose body exceeds one response is unreadable through
Checks run: [FIRST-PRINCIPLES-REVIEWED] 8d6e965 Description read[DESCRIPTION-READ] 79e3ef445194a009401d04077f8f6dcd7a639b8175ff6abfa181b9c939f67d9d That sha256 names the PR description this verdict read. Recompute it with |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
4fdd101 to
02cd0f4
Compare
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNo blocking issues; two advisory findings, both on how the new refusal path reports itself to the model. FINDING — src/kiro_crew/mcp_tools/skills.py:388 — a body whose one line exceeds the per-read capacity terminates the advertised paging loop with no way past it: FINDING — src/kiro_crew/skills.py:5470 — a confined project key read while [OPUS-REVIEWED] 8d6e965 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
02cd0f4 to
8928c3f
Compare
8928c3f to
0d308ba
Compare
0d308ba to
8c29297
Compare
8c29297 to
428b33a
Compare
|
CI note for head
This run was created at 07:52:17Z, twenty-two seconds before #15744 merged as |
428b33a to
2fd19f5
Compare
The exact read held a body to a 99,000-byte capacity with no way to ask for part of it, so a registered skill larger than that was searchable and recommended yet unreadable through its own tool, and every refusal on the read chain collapsed to None, leaving one sentence that named three causes without saying which one tripped. The capacity stays as the per-call page size: a tool response is cut at MAX_RESPONSE_LEN characters from the tail, so a body over it is refused whole rather than truncated. The read verb now takes offset and limit in lines, the unit the file and transcript readers already page in, and delivers as many whole lines as fit the capacity with the next offset in the header. A global body over the capacity is read again under the shared file safety cap to learn its size and serve its pages; a confined project body keeps PROJECT_SKILL_BODY_CAP as the bound on the whole file. The read chain classifies each refusal as outside the scope, unreadable or over the capacity, and the tool renders one message per reason, the last naming the body's size, the capacity and the paging parameters. The size a refusal names is the delivered text's, never the file's on disk, and the test holds that under a CRLF checkout, the shape a Windows text-mode write produces. A platform that cannot walk a project tree admits the test project through both gates a read passes, the enumeration and the trust verdict load_skill re-checks on its own, so the confined bound is what the test measures there as well. A confined body refused at a caller's smaller capacity is read again under the project cap, the bound the file has anyway, so a body under that cap pages at the capacity and a body over it is refused naming the project bound, never the page size.
2fd19f5 to
8d6e965
Compare
|
|
bolichen97
left a comment
There was a problem hiding this comment.
Approved: PR Readiness green on this head, merges cleanly into current main, no outstanding blocking review.
Problem / Motivation
Goal: An agent can read any skill its scope lists through
skill_search, however large, and a read that returns nothing says exactly why.skill_searchindexes, catalogs and recommends a skill whoseSKILL.mdis larger than 99,000 bytes, and thenskill_search(action='read', key=...)refuses to return that same body: the read verb has a 99,000-byte capacity and no way to read past it. The refusal is one sentence naming three unrelated causes -- "outside this scope, unreadable, or exceeds the 99,000-byte read capacity" -- with no byte count and no hint of which one tripped. In the field that sentence led an operator to conclude the skill was "bundled / not on disk" when the file was on disk, readable, and simply over the capacity.Why it matters
The largest, most detailed skills are exactly the ones an agent needs verbatim rather than from memory, and they are the ones the read verb rejects. The agent's only recourse is to leave the tool and read the raw file, which is what the tool's scope and confinement exist to avoid, or to reconstruct the procedure from stale memory. The catch-all error compounds it: it steers the reader toward a missing-file diagnosis for what is a size problem, so time is lost on a phantom.
Not a goal
PINNED_SKILL_BODIES_CAPon the required-skill pinning path -- the same number -- is not touched; the two values stay paired and would move together.action='search'oraction='list', whoseoffset/limitsemantics (result offset, result count) are unchanged.PROJECT_SKILL_BODY_CAP. That bound is the confinement of an attacker-controlled checkout and paging does not widen it.Noneread, deliberately left as they are: the required-skill startup path, whoseSkillContextCapacityErrornames both bounds and whose remedy (fewer or smalleralways: trueskills, a readable file) does not depend on which one tripped, and$keyactivation inresolve_dollar_skills, which skips a refused key by design so the message it decorates still renders. Classifying either changes startup and activation output, which is outside the read verb this PR fixes.handlers/prompts.py, search branch). Deliberately left: it is a search-result convenience, not a read, and its remedy is the exact read this PR fixes, which now says which condition tripped. Classifying it would changesearch/listoutput, which is out of this goal.What changed (motivation → approach → change)
Symptom: a registered, searchable skill of 119 KB is unreadable through its own tool, and the error does not say why.
Root cause, two halves. (1)
SkillsLoader.read_scoped_skillholds an exact read to a 99,000-byte bound with no way to ask for part of a body, so a larger body is refused outright; the bound exists becausesanitize_responsetruncates a tool response atMAX_RESPONSE_LEN(100,000) characters from the tail, which would silently drop a large body's closing instructions, and the loader's policy is to refuse rather than truncate. That policy is a recorded decision in_read_global_skill_text's docstring ("half a skill is not a smaller skill: it is a body whose instructions stop mid-sentence"), and this PR keeps it: a read that asks for no page is still refused whole (never silently truncated) and the refusal now names the size, the capacity and how to page; a page is the one sanctioned partial read, partial only because the caller asked for one, and it always says what remains and where the next page starts. The docstring records that contract in the same hunk. (2) Every refusal on the read chain collapses toNone: a key the scope does not hold, a file the fenced reader declines, and a body over the bound all reach the MCP tool as an empty match list, so the tool can only print one sentence naming all three. The causes are already distinguishable one frame down (FileTooLargeErrorversus aNoneread in that reader; an out-of-scope key or arepo_scopemismatch in the exact-read chain), so no detection is added: a reason is threaded from those sites to where the tool renders the string.Change:
SkillsLoader.read_scoped_skill_page(key, *, only, project_dir, offset, limit, capacity)is the read verb's face.offset/limitare LINES (0-based first line, most lines), the unit the built-in file reader andspawn_statusalready page in. With neither given, the body is delivered whole when it fits the capacity and refused with its size when it does not. With either given, as many whole lines fromoffsetas fit the capacity (at mostlimit) are returned with the next offset. The capacity bounds one delivery, not the file: a global body over it is read again under the shared 50 MiB file safety cap (the bound every unbudgeted skill read already has) to learn its size and serve its pages. A confined project body keepsPROJECT_SKILL_BODY_CAPas the bound on the whole file, so that refusal names the project bound and offers no page.read_scoped_skillkeeps its whole-or-Nonecontract for the required-skill and$keyactivation paths.load_skill,_read_global_skill_textand_exact_read_while_building(theSkillsLoadermethod and the function it delegates to insrc/kiro_crew/skill_runtime/search.py) take therefusal_reasonsout-parameter_read_enumerated_skill_bytesalready uses, and_read_exact_keyturns them into one of three reasons (outside_scope,unreadable,over_capacity). Once the scope holds a key, no failure to deliver its bytes is ever reported as a missing key.POST /api/skills/-/discover(and the compatible GET) accepts optionaloffset/limitfor a read plus an optionalcapacityrequest field that it clamps toSKILL_READ_CAPACITY(a caller can only SHRINK the page, never widen it); it returns apageblock (line_offset,line_count,total_lines,total_bytes,next_offset) beside a paged body, and answers a refused read with HTTP 200, an empty match list and arefusalblock naming the reason and the bound.src/kiro_crew/mcp_tools/skills.py) sizes the page for the WRAPPED response:build_tool_responsecuts a tool result atMAX_RESPONSE_LENcharacters from the tail, and the tool's own framing (header, page line, reference-data markers, the key repeated) sits around the page, so it renders that framing with an empty body and the widest numbers a page can carry, takes the length off the ceiling, and sends the remainder as the read'scapacity. Without that, a page sized to the bare ceiling plus a long key would lose its last lines to the cut while the next offset already counted them as delivered.offset/limitexactly when its caller gave them, renders one message per reason (the over-capacity one naming the body's size, the capacity for this key and the two paging parameters), and puts a page's navigation line in the HEADER ahead of the body, where tail truncation cannot reach it. The descriptor documents the two parameters' read meaning. The tool's audit record (SELlog_tool_invocationmetadata) of a refused read carries the refusal reason beside the match count.SKILL_READ_CAPACITYwith the mechanism it protects; its value is unchanged.Owning spec
docs/system-specs/modules/memory-skills-hooks.mdanddocs/architecture/mcp.mdare updated in the same commit.Backwards compatibility
Compatible: every call that works today keeps working. A read with no paging parameter of a body that fits returns byte-identical output;
search/listkeep theiroffset/limitsemantics; the gateway's read response keepsmatches/next_offsetand addspage/refusalbeside them, and its newcapacityrequest field is optional and shrink-only (absent means the ceiling);read_scoped_skillkeeps its signature and contract, and the readers' newrefusal_reasonskeyword is optional. An MCP tool talking to a gateway that predates therefusalblock prints one explicit "no reason was reported" line instead of guessing a reason.Tests
Red-first on
origin/main@cbe6d6a0de:test/test_skill_read_paging.pyran 15 failed / 2 passed before the change (python -m pytest test/test_skill_read_paging.py -n0). The two that passed are contract guards that must hold on both sides (a fitting body is returned whole without paging;read_scoped_skillkeeps its fits-or-Nonecontract). The two tests added for the local GPT lane's blockers were red on the first candidate head (a 90-segment key pushed a full page to 101,397 characters, past the 100,000 response cap; the pager's peak allocation on a 500,000-line body was 17 times the body) and are green now. Green after: 22 passed.TestPagedRead::test_a_body_over_the_capacity_is_read_whole_across_pages-- a 119,000+-byte registered skill: the plain read is refused naming its size, the capacity andoffset/limit; paging fromoffset=0until the answer names no next offset yields at least two pages, each within the capacity, whose concatenation equals the file. Red on main: the catch-all string.test_a_page_states_its_lines_and_bytes_against_the_whole,test_limit_bounds_the_page_in_lines,test_an_offset_past_the_end_is_an_empty_last_page_naming_the_count,test_a_read_without_paging_returns_a_fitting_body_whole-- the page header's line span, byte count and next offset;limitin lines; an offset past the end is an empty last page that names the line count (not an error); whole-mode output unchanged.TestRefusalMessages-- one test per branch asserting its own message and the absence of the other two: an unknown key is outside the scope; a hardlinkedSKILL.md(which the no-link reader refuses) is unreadable; an over-capacity body names size, cap and paging, on an LF fixture and on one written with CRLF endings (the size named is the delivered text's, never the file's on disk, which the CRLF fixture makes larger); a single line wider than the capacity is refused by line number. Red on main: every branch printed the same catch-all.TestGatewayContract-- the tool forwardsoffset/limitonly when given and always acapacitybelow the ceiling; a page of exactly the requested capacity under a 90-segment key still fits one response and loses no line (sanitize_responseleaves it untouched); each gatewayrefusalblock renders its own message; the route (GET and JSON POST) pages, diagnoses, answers an offset past the end with an empty page block carrying the line count, honours a smallercapacityand clamps a larger one to the ceiling.TestLoaderContract-- the pager's peak allocation on a 500,000-line body stays under three times the body (tracemalloc) while the page and the count are right;read_scoped_skillunchanged; a confined project body overPROJECT_SKILL_BODY_CAPis refused withconfined=True, the project bound and no size (never read past the bound), with the project granted natively and, in a sibling test, admitted by stub on a platform that cannot walk a project tree -- the Windows shape, forced on every platform; and a confined body under the project cap is paged at a caller's smaller capacity (10,000 bytes against a 20 KB body: page one with the next offset; the whole read refused with its size and the paging hint), while the bound refusal names the project cap whatever capacity was asked for.test/test_skills_composition_contract.py(main's frozenSkillsLoadersurface) registers the two members this PR adds (_read_exact_key,read_scoped_skill_page) and the three signaturesrefusal_reasonswidens (_exact_read_while_building,_read_global_skill_text,load_skill); without the five rows bothTestSurfacetests are red on this PR's surface, with them the file runs 85 passed.test_installed_post_exact_read_long_keys_and_scope_errorsstubsread_scoped_skill_page(the method the route now calls);test_regular_global_mapped_namespace_keeps_normal_readeraccepts the reader's newrefusal_reasonskeyword.Gates from the worktree:
scripts/check_black_formatting.pyandscripts/check_subprocess_encoding.py(both pass on the committed scope),isort,flake8,mypy(no issues in 1899 files),scripts/docs-lint.sh(all checks passed).scripts/local-gate.py: backend related set 36,841 passed, 35 failed, of which 34 fail identically on the unmodified base commit in a detached worktree (file explorer app, pipeline conductor skill contract, auto-improvement members -- none touch the changed modules) and 1 (test_mcp_gateway_adopted_daemon_repair.py::test_a_stale_survivor_is_repaired_end_to_end) passes when run alone; frontend related set 336 of 342 files passed, the 6 failing files fail identically on the unmodified base under the same symlinkednode_modules(Vite denies the out-of-tree module path), and this diff touches nowebsite/file.Manual verification
N/A -- unit coverage sufficient: the new tests drive the real loader on a temporary skills root through the MCP tool (unsigned path) and through the gateway route (signed path), so both transports of the read verb are exercised end to end. Rounds 5 and 6 (the rebases onto current
main) are evidenced mechanically: the gates and the named test files listed under Review lanes ran serially on each rebased head; no local review lane ran on them, and the CI lanes judge the pushed head.Screenshots / video
no-visual-delta
Why no screenshot: no user-visible frontend surface changes; the diff is loader, gateway route, MCP tool text and docs.
Related Issues
Fixes #14832
Pattern harvest
Rule candidate: review-prompt
Pattern: a refusal path that collapses distinct causes into one
None/empty result forces the user-facing message to enumerate every cause with "or"; classify at the point that knows the cause and render one message per class.Review lanes
One local round, one lane at a time, each pinned to the CI model (
kirocrew--readonly, read-only):gpt-5.6-sol) on the first candidate head: BLOCK, 2 blocking, 0 advisory. (1) Renderer framing sat outside the page budget, so a near-capacity page under a long key crossedMAX_RESPONSE_LENand the tail cut dropped lines the next offset had counted -- fixed: the tool derives the read's capacity from its own framing and the gateway clamps a caller's capacity to the ceiling (test_a_page_sized_to_the_requested_capacity_fits_the_response_for_any_key, red on that head). (2) The pager split a body of up to 50 MiB into three full line lists -- fixed: whole reads refuse before any scan, the count is a scan and only the page's lines are copied (test_the_pager_copies_only_the_page_out_of_a_newline_dense_body, red on that head). Both fixes are in this single commit.claude-opus-5) on the fixed head: PASS, no findings.claude-fable-5, hand-briefed from the base commit's contract with the workflow's three data files) on the fixed head: CONCERNS, 3 items, all answered in this commit: item 6 (the page block echoed acapacitynobody read) -- subtraction applied, the field is gone; item 5 (the gateway's shrink-onlycapacityrequest field was not declared) and item 8 (the audit record'srefusalreason was not declared) -- both declared in What changed above. A second FP pass on the head carrying those answers: CONCERNS, 2 items, both answered in this commit: item 3 (a fourth refusal reason for an offset past the last line duplicated the renderer's empty-page line) -- subtraction applied, the reason, its field and its message branch are gone and a past-the-end offset is an empty last page naming the count; item 2 (the search path's "Body unavailable or over budget" placeholder is a sibling of the collapsed refusal) -- declared as deliberately left under Not a goal, since it is search output and its remedy is the exact read this PR fixes. A third FP pass on the head carrying those answers: CONCERNS, 2 items, answered here without a code change. Item 1 asked for the paging to be deleted because an agent could read a global skill by its path with its own file reader; rebutted with the counted callers its own clearing condition asks for: the managed native skill startup views (thekirocrew-skill-view-*templates written byacp/skill_projection.py) and thekirocrew-heartbeattemplate declare@kirocrew-core/skill_search(or@kirocrew-core) and nofs_read, so for those agents the read verb is the only way to a skill body at all, and the issue's field case is exactly a body such an agent could not reach; the paging is also the direction the issue asks for and the scope this PR was opened under. Item 2 named two siblings of the collapsed refusal outside the read verb (the required-skill startup error's wording and$keyactivation's silent skip); both are listed as deliberately left under Not a goal with the reason. A fourth FP pass on the same head with this description: PASS (it counted the callers itself: 6 of the 52 installed@kirocrew-coretemplates have no file reader; its two "rides along" notes, the audit record's reason and the named constant, are declared above).The lanes judged the commit on its original base; before the push it was replayed onto fresh
main(which carries the pid-reader ratchet heal) with an identity proof: identical per-file numstat (7 files), identical 1,035+/-lines, byte-identical commit message. Gates re-run on the replayed head: 437 related tests passed, black/encoding ratchets, isort, flake8, mypy (1903 files), docs-lint, andpush_guard.py --require-single-on-baseSAFE.Round 3 (head
8928c3f332onmain@2e09b10304): the first CI round on02cd0f4decwas green on all six review lanes and red on two Windows shards.Backend Tests (Windows) (1)failed two of this PR's own tests, each on an assumption in the test, not on the code.test/test_skill_read_paging.py:194(test_an_over_capacity_body_names_size_cap_and_paging) measured the fixture withlen(path.read_bytes()). On Windows the text-modewrite_textin the fixture helper writes CRLF, so that figure counts one CR per line: 120,918 bytes on disk for the fixture's 1,835 lines against the 119,083 bytes the refusal names. The code has one source for that number:_page_skill_body(src/kiro_crew/skills.py:385) measures the UTF-8 size of the decoded body, whose newlines_decode_skill_text(src/kiro_crew/skills.py:825) has folded exactly as a text-mode read would; the page header's byte counts andtotal_bytescome from the same line. The capacity is a budget on what one response carries, so the delivered size is the one to name. The test now measures the delivered text and runs a second time on a fixture written in bytes with CRLF endings (_skill(..., newline="\r\n"),test/test_skill_read_paging.py:33), asserting the on-disk figure is not named; the docstring of_page_skill_bodypins that every size it reports is the delivered body's.test/test_skill_read_paging.py:471(test_a_confined_body_is_never_read_past_the_project_bound) admitted the project by stubbing only the enumeration (_iter) whereproject_skill_traversal_supported()is false, which it is on Windows (noO_DIRECTORY,O_NOFOLLOWordir_fd).load_skillre-checks the trust verdict on its own before it reaches the confined reader (src/kiro_crew/skills.py:4197, through_trusted_project_keyandskill_trust.canonical_key,src/kiro_crew/skill_trust.py:130, which answersNoneon such a platform), so the confined reader -- the only place the project bound is enforced -- was never reached, and_read_exact_key(src/kiro_crew/skills.py:8083) classified a visible entry with nosize_capasunreadable. In production on Windows the real enumeration lists no project rows, so a project key isoutside_scope; theunreadableoutcome exists only under the partial stub. The stub now covers both gates (_admit_project_without_traversal,test/test_skill_read_paging.py:505), and a sibling test (test_the_confined_bound_holds_where_projects_cannot_be_walked,:486) forcesproject_skill_traversal_supportedto false so the Windows shape runs on Linux and macOS as well.Red-first evidence: a Linux probe carrying the two original assertions against the two Windows shapes (a CRLF fixture;
project_skill_traversal_supportedforced false with the enumeration-only stub) failed with the same two lines CI printed --AssertionError: assert '120,918 bytes' in 'Error: skilllarge/procedureis 119,083 bytes; one read returns at most 98,664 bytes. ...'andAssertionError: assert 'unreadable' == 'over_capacity'-- and the changed file runs 21 passed after.Backend Tests (Windows) (4)'stest_diag_procs.py::test_a_read_refused_as_too_soon_does_not_restart_the_window("0.8s apart is under the floor") is the known Windows timing flake tracked in #13997 and #14183 and is not touched by this PR. Gates on this head: black ratchet, isort, flake8, mypy (1,903 files), harness parity, comment-history, subprocess-encoding, sync-io-in-async, cwd-relative reads, testpaths coverage, builtin-skill scope, loop-bound locks, brand name, feature map, changelog and decisions history, focus cue, docs-lint;push_guard.py --require-single-on-baseSAFE on2e09b10304; the replay onto that base carries a diff identical to the one judged (7 files, 1,055+/ 43-) and the same commit message plus one sentence per Windows fix.Round 4 (head
0d308badd0onmain@2e09b10304): the Round 3 CI was green on every shard and lane; the GPT lane's one advisory finding on8928c3f332(src/kiro_crew/skills.py:8032,max_bytes=capacityon the confined read) is a real defect in this PR's own code and is fixed here. Verification:read_scoped_skill_pagepassed the caller'scapacityas the first read's bound; for a confined entryload_skillclamps that bound tomin(max_bytes, PROJECT_SKILL_BODY_CAP)(src/kiro_crew/skills.py:4226), so a 20 KB project skill read atcapacity=10_000was refusedsize_capat 10,000 bytes, and the confined branch, which re-read nothing, answeredSkillReadRefusal(over_capacity, capacity=10000, confined=True)-- the project-bound message, naming a 10,000-byte bound the body does not exceed and offering no page. The gateway takescapacityfrom any client, so the contract this PR adds reaches the branch; the shipped MCP tool's own capacity (about 98,000 bytes) never drops under the project cap, so it did not. Fix: a body refused at the capacity is read again under the bound the whole file has anyway -- the shared file safety cap for a global body,PROJECT_SKILL_BODY_CAPfor a confined one -- and then paged at the capacity; a confined body is never read past the project cap, and a body over that cap is refused namingPROJECT_SKILL_BODY_CAP, not the caller's page size (read_scoped_skill_page,src/kiro_crew/skills.py:8033-8045; the spec paragraph indocs/system-specs/modules/memory-skills-hooks.mdsays the same). Pages stay the one sanctioned partial read: a whole read of that body at the smaller capacity is refused with its size and the paging hint (confined=False, since pages exist), and the default-capacity read still returns it whole. Red-first evidence on8928c3f332:test_a_confined_body_under_the_project_bound_pages_at_a_smaller_capacity(test/test_skill_read_paging.py:509) failed withSkillReadRefusal(reason='over_capacity', capacity=10000, size_bytes=None, confined=True, line=None)where a page was due, and the widened bound helper (_assert_confined_read_stops_at_the_bound,:563) failed twice withassert 10000 == 24750; the file runs 22 passed after. Gates on this head: black ratchet, isort, flake8, mypy (1,903 files), harness parity, comment-history, subprocess-encoding, sync-io-in-async, cwd-relative reads, testpaths coverage, builtin-skill scope, loop-bound locks, brand name, feature map, changelog and decisions history, focus cue, docs-lint;test_skill_mapping_and_lazy_default.py30 passed;push_guard.py --require-single-on-baseSAFE on2e09b10304; the commit message is Round 3's plus one sentence on this fix.Round 5 (head
8c292979f2onmain@ecdc59abf4): no new finding; this round brings the commit onto currentmain, which had moved 284 commits past2e09b10304and left the PR conflicting. One conflict, insrc/kiro_crew/skills.py: #15093 moved the body of_exact_read_while_buildingintosrc/kiro_crew/skill_runtime/search.pyand left theSkillsLoadermethod as a one-line delegation, while this PR had threadedrefusal_reasonsthrough that body. Resolution:main's move wins -- the body stays inskill_runtime/search.pyand the method stays a delegation -- and the PR'srefusal_reasonsis forwarded through it: the moved function takes the same optional parameter (defaultNone) and passes it toloader.load_skill, so a size-capped read during the first catalog walk still reportsover_capacity(+4/-1 insearch.py; takingmainverbatim would have silently turned that case intooutside_scope). The rebase also mettest/test_skills_composition_contract.py, new onmainwith #15093, which freezes the loader's member names and signatures: its twoTestSurfacetests were red on this PR's surface (two new members, three signatures widened byrefusal_reasons); the five rows are registered (+9/-5) and the file runs 85 passed. Commit count and message unchanged (byte-identical bygit cat-file); per-file+/-lines identical to Round 4 apart from the four lines of the while-building thread that moved with the body and the two files above. Gates on this head: black ratchet, isort, flake8, mypy (1,996 files), docs-lint, comment-history, harness parity;test_skill_read_paging.py22,test_skill_mapping_and_lazy_default.py30 and the composition contract 85 passed serially;push_guard.py --require-single-on-baseSAFE onecdc59abf4. Evidence for this round is mechanical only: no local review lane ran on it (the host was under its memory hold line when the round started); the CI lanes judge the pushed head.main's own CI on this base, run 36809266120 onecdc59abf4, is green on every shard. Reds on the threemainruns before it, none this PR's, cited in case a shard repeats one here:Backend Tests (Windows) (2)failedtest/test_native_skill_projection.py::test_a_lock_file_a_launcher_still_holds_is_never_sweptand::test_leftover_alias_lock_files_are_swept_only_when_provably_residueon 36798669577, 36804404043 and 36805671000, tracked as #15651;Backend Tests (3.12, 4)test/test_autonudge_refactor_contract.py::TestInstanceSeamsReachEveryInternalCaller::test_every_store_write_goes_through_write_state(file lock) is flake #15676, red on 36804404043 and green on 36805671000;Backend Tests (3.12, 8)test/test_members_dm_thread.py::TestMemberActivityRoute::test_unreadable_timestamps_are_skipped_not_sorted_as_garbagewas red once on 36798669577 and green since; Round 4'sBackend Tests (3.12, 2)lent-hop pair is flake #14742 and passes serially on this head. Coverage Gate and PR Readiness follow those shards.Round 6 (head
428b33af34onmain@6b033ab03a): no new finding; this round brings the commit onto currentmainagain, which had moved 61 commits pastecdc59abf4and left the PR conflicting. One conflict, intest/test_skills_composition_contract.py: #15660 registered its new_readable_frontmattermember and signature in the frozenSkillsLoadersurface, at the rows where this PR registers_read_exact_keyand widens_read_global_skill_text. Both sides add at one spot, so both are kept:main's row stands and this PR's rows stand beside it (the file's diff againstmainis exactly this PR's five rows and two names, as in Round 5). Nothing else needed a hand:main's changes tosrc/kiro_crew/skills.py(#15660's_readable_frontmatterand the BOM-tolerant decode) and to both docs files merged cleanly beside this PR's lines. Commit count and message unchanged (byte-identical bygit cat-file); the per-file+/-lines of the PR diff are identical on the old base and the new one (9 files). Gates on this head: black ratchet, isort, docs-lint;test_skill_read_paging.py22,test_skill_mapping_and_lazy_default.py30 and the composition contract 85 passed serially;push_guard.py --require-single-on-baseSAFE on6b033ab03a. flake8 and mypy each report one item, the same line:src/kiro_crew/vector_memory_runtime/lessons.py:1206names_row_stem_tokens_for_scanwithout its module prefix (undefined name). This PR does not touch that file; the line ismain's own at6b033ab03a(#15517), soBackend Lint & Type Checkis expected red onmainand on this head alike untilmaincarries the fix -- cited, not changed here. Evidence for this round is mechanical only: no local review lane ran on it (the host was under its memory hold line); the CI lanes judge the pushed head.mainitself is red at the moment on things this PR does not touch, and the rebased head inherits them:main's latest completed run, 36822696805 ond5bdff64e0(the run on6b033ab03ais pending), failsBackend Lint & Type Checkon thelessons.py:1206line above,Backend Tests (3.12, 5)and(Windows) (5)ontest/test_lesson_turn_injection.py::TestSelection(eightNameErrors on the same name) andBackend Tests (3.12, 6)and(Windows) (6)ontest/test_vector_memory_composition_contract.py::TestOneBindingPerSharedName::test_every_shared_name_is_read_through_its_owner-- all from #15517 (600d4b9515), heal PR #15737 open;Backend Tests (3.12, 4)and(Windows) (4)fail threetest/test_fold_catalogue.pytests (the catalogue and the projection registry disagree about thesubagentsfold) from #15078 (21477628d4), heal PR #15744 open; Coverage Gate and PR Readiness follow those jobs. None is changed here; the branch picks them up on its next rebase once they merge.Round 7 (head
2fd19f5c86onmain@bc80d8d8a2): no new finding and no code change; rebased ontobc80d8d8a2, 86 commits past6b033ab03a. The round-6 reds were the base's own breakage (fold catalogue / lessons.py), healed onmainatd8fa6a527e; this head sits on a base that carries the heal. The replay was clean:maintouched one PR file,docs/system-specs/modules/memory-skills-hooks.md, and it merged without a conflict hunk. Commit count and message unchanged (byte-identical bygit cat-file); the per-file+/-lines of the PR diff are identical on the old base and the new one (9 files). Gates on this head: mypy clean (mypy src/kiro_crew/, 2,026 files, no issues), which confirms the round-6Backend Lint & Type Checkred was the base's, not this PR's; black ratchet and isort clean;test_skill_read_paging.py22,test_skill_mapping_and_lazy_default.py30 and the composition contract 85 passed serially;push_guard.py --require-single-on-baseSAFE onbc80d8d8a2. flake8 reports one item in a file this PR does not touch:src/kiro_crew/autonudge.py:1797F811 (redefinition of unusedprobes),main's own line atbc80d8d8a2(#12781,0141ede260) -- cited, not changed here; the same step runs onmain, so the tip's own run is expected to report it too.main's latest completed run, 36889843703 on5d298cdfc4, is green on every job; the run onbc80d8d8a2(36939193968) is still queued. Evidence for this round is mechanical only: no local review lane ran on it; the CI lanes judge the pushed head.Round 8 (head
8d6e965628onmain@fa37aa54fd): no new finding and no code change; rebased ontofa37aa54fd, 9 commits pastbc80d8d8a2. It picks up #16032 (1001b70611), the fix for thesrc/kiro_crew/autonudge.pyF811 that madeBackend Lint & Type Checkred on Round 7, so that job is expected green here. One conflict, with #15977 (3fb49451a7, each search'sincompleteflag returned with its own result), insrc/kiro_crew/dashboard/handlers/prompts.py: this PR adds the read branch'spageblock and itsreturndirectly above the search call, and #15977 changed that call frommatches = skills.search_skills(toreport = skills.search_skills_report(. Adjacent lines, independent intents, so both are kept: this PR's lines stand, thenmain's call (the file's+/-lines againstmainare exactly this PR's own hunks, as on the previous base). #15977's other changes --src/kiro_crew/skills.py,src/kiro_crew/skill_runtime/search.py,src/kiro_crew/mcp_tools/skills.py, the composition contract and the spec -- merged cleanly beside this PR's lines, and this PR reads none of the attributes #15977 removed (search_incomplete,pending_keys). Commit count and message unchanged (byte-identical bygit cat-file); the per-file+/-lines of the PR diff are identical on the old base and the new one (9 files). Gates on this head:mypy src/kiro_crew/clean (2,026 files); flake8 on CI's paths clean (the Round 7 F811 is gone); isort, black ratchet and docs-lint clean;test_skill_read_paging.py22,test_skill_mapping_and_lazy_default.py30 and the composition contract 85 passed serially, plusmain'stest_mcp_core_coverage.py175 (the file #15977 changed for the MCP tool this PR also edits);push_guard.py --require-single-on-baseSAFE onfa37aa54fd.main's own run onfa37aa54fd(36948439351) is still queued. Evidence for this round is mechanical only: no local review lane ran on it; the CI lanes judge the pushed head. On Round 7's head the lanes read GPT and Opus no findings, First Principles PASS, UX and Security clean, Design CONCERNS with one WATCH item (read mode decided by the presence ofoffset/limit, which an older MCP tool always sent); that item is carried forward unchanged and gets its disposition once ruled.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement