Conversation
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Resource lists of any length now pass the declaration check when ≤64 are What this change shipsInventory (3 items) — 3 justifiedIntent: let a private member whose template declares many
Both check sites ( [FIRST-PRINCIPLES-REVIEWED] 5e06d39 |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 5e06d39 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
5e54f89 to
88c017d
Compare
The essentials budget caps the documents a private member loads at 64, but both declaration checks counted every resource, including the skill:// and knowledge:// URIs that _resource_paths skips and never reads. An agent template that declares many skills was refused with "too many resources" or "Essential resource declaration exceeds the document limit" while loading only a handful of documents, or none. Count the file:// declarations, the only ones that can become documents. The cap on resolved documents is unchanged, and 65 file:// declarations are still refused.
cf953e6 to
5e06d39
Compare
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does no leg reported, and this was not the nothing-to-adjudicate short circuit No |
Problem / Motivation
A private (Memory V2) member whose agent template declares many
skill://resources is refused before its first turn withEssential resource declaration exceeds the document limit(orEssential template …: too many resourcesthrough the template essentials path), even though it would load only a handful of documents — or none at all.Why it matters
Mapping skills to an agent through
skill://entries inresourcesis the kiro-cli-native way to attach them, and skill-heavy templates routinely carry 60–80 such entries. Every one of those templates is unusable as a private member: the member page and the first turn both fail, and the message points at a limit the template is nowhere near. V1 members are unaffected, so the defect surfaces exactly when a user first tries private memory with an existing agent.What changed (motivation → approach → change)
file://guide and 70skill://entries is refused as exceeding a 64-document cap.member_essential_context.pycomparelen(resources)— every scheme — against_MAX_DOCUMENTS, while the loop that follows skips every non-file://entry. Onlyfile://declarations can become documents;skill://andknowledge://stay on demand and are never read here (theprojected_resource_documentsdocstring already states this). Skills were charged against a budget they never spend._declared_document_count()— the number offile://declarations — and use it at both check sites (documents_for_memberand_resource_paths). The cap itself, its messages, and the separate cap on resolved documents are unchanged, so 65file://declarations are still refused and a glob that expands past 64 files still stops the turn.Tests
test_document_cap_ignores_on_demand_resource_schemes— onefile://guide plus 70skill://entries loads exactly one document through bothdocuments_for_memberandprojected_resource_documents. Fails onmainwithtoo many resources; passes with the fix.test_document_cap_still_bounds_declared_file_resources— 65file://declarations are still refused by both paths with the existing messages, so the fix does not weaken the limit.The full
test/test_member_essential_context.pyfile passes (97 tests).black,isort,flake8andmypyare clean on both changed files.Manual verification
Declared the same on-disk
SKILL.mdboth asskill://…and asfile://…, plusfile://guide.mdand 100 moreskill://entries, then called_resource_pathsandprojected_resource_documents: exactly two documents come back, both from thefile://lines; theskill://line pointing at the very same file produces nothing, and the 100 skills no longer trip the cap. On unfixedmainthe identical declaration is refused before anything is read.Related Issues
Fixes #11465
Pattern harvest
Rule candidate: review-prompt
Pattern: a cap or budget is computed over an unfiltered collection while the consumer immediately filters that collection (
len(xs) > Nfollowed byfor x in xs: if not pred(x): continue); the cap should countpred(x)items.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license, per CONTRIBUTING.md.