Repository navigation
fix(context): leave oversized steering out instead of aborting member startup - #22622
Conversation
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check one thing before merge: a skipped [DESIGN-REVIEWED] 2efa70d Description read[DESCRIPTION-READ] b94a1814238611ac154ca8d94b2596d69fb4afd38be110d10352bf1f9598da8a 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 Check that the spec sentence "an oversized or non-UTF-8 steering file still raises" is meant to be reversed; #22575 is the only evidence for reversing it. What this change shipsInventory (7 items) — 7 justifiedIntent: one oversized steering file should stop blocking every crew member from starting, and the error should name the file, its size and the cap. FIX.
[FIRST-PRINCIPLES-REVIEWED] 2efa70d Description read[DESCRIPTION-READ] b34989fc72203eadae66ad2843ac635b2931cd25b2b467062b21616110de67ca That sha256 names the PR description this verdict read. 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: |
Security Scope Review -- 🟡 CONCERNSWhich legitimate operations does Verdict basis: the reviewer's own judgement; no confirmed regression. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: CONCERNS TIGHTENING: The patch doesn't tighten anything in the shell deny composite. The only change to refusal behavior is in the essential-context reader's handling of oversized files, and that change mostly loosens it. ADJUDICATED: 12 candidates, 0 confirmed newly-refused. This count comes from my submission, not from a verdict: the classifier runs after this review is captured. Since PLATFORM COVERAGE: I wrote candidates for posix, windows and any. They are the shell operations a user runs after the new note or error: measuring, listing, reading and splitting steering files and
The Python change's only platform-specific code is the existing UNADJUDICATED: The changed guard is the essential-context source reader, which no shell command reaches. Its call paths:
These are the inputs I would have submitted but cannot get a verdict for:
Nothing could classify these, so this review can't report PASS for the reader guard. [SCOPE-REVIEWED] 2efa70d |
7c2fcd1 to
7f25ec8
Compare
|
self-added: yes
|
|
|
7f25ec8 to
e21a5cd
Compare
|
self-added: yes
|
|
e21a5cd to
2efa70d
Compare
|
|
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Review lanes on the head are clean apart from the hold the triage cron named (a sensitive-path change without a reasoning template, or an author-overridden Design lane); the watch holder read the hold and approved it explicitly.
Problem / Motivation
Goal: One steering file over the read cap no longer stops every crew member from starting, and any over-cap error names the file, its size and the cap in bytes.
A global steering file of 265,585 bytes under
~/.kiro/steering/blocks every member that inherits global steering. Startup aborts before any tool runs ("Turn interrupted") withFile exceeds 0 MB safety cap. The cap is 256,000 bytes, so256000 // 1024²prints as 0. The read happens beforeinclusion:is parsed, so anautoormanualfile aborts startup too.Why it matters
Every member chat on the host is dead until the user finds and trims a file the error never names. Nothing in the message says which file, how big, or what the limit is.
Not a goal
inclusion: alwaysfile to the cap. A file over 256,000 bytes cannot fit the 64,000-character essentials envelope whole anyway, and a cut prefix would present partial rules as complete.AGENTS.mdorSOUL.mdover the cap through. They keep refusing.MAX_FILE_BYTEScap and print correctly.What changed (motivation → approach → change)
inclusion)0 MBkiro_launch_documents,projected_resource_documentsAGENTS.md,SOUL.md0 MB, no pathThe symptom came from two gaps.
FileTooLargeErroris not anOSErrororValueError, so_readinmember_essential_context.pylet it escape with no file path. Andsafe_read_file_bytes_nolinkinhook_runtime/safe_reads.pyprinted its cap in whole MB, which rounds a sub-MiB cap to 0.FileTooLargeErrorinhooks.pygains an optionalsize, which the no-link read fills with the size it measured on the open descriptor._readturns the error into_OversizedEssentialSourceError, a kind of the existing unreadable-source error, carrying that size. Steering already leaves an unreadable file out and names it, so an over-cap steering file takes that same path, with its ownessential-context#oversized-skipped:<template>note that gives each file's size and the cap. The project-root guide reader re-raises it, so an over-capAGENTS.mdkeeps failing as documented. The read error now saysFile is 265,585 bytes, over the 256,000-byte safety cap. The module spec indocs/system-specs/modules/memory-skills-hooks.mdstates the new rule.Backwards compatibility
Compatible: the only behavior change turns an abort into a skip for steering; every source that refused before still refuses, with a clearer message, and no code reads the old message text.
FileTooLargeError(...)withoutsizestill works;sizeis thenNone.Removes nothing: no path, key, record or function is removed; an over-cap steering file was never loaded before either.
Tests
test/test_member_essential_context_oversized_steering.py(new):always,auto,manual,fileMatch: the member starts, the body is absent, the note and the warning name the file, its size and the cap, and0 MBnever appears.kiro_launch_documentsandprojected_resource_documents: skip the file, keep the rest.AGENTS.mdover the cap: still refuse, with name, size and cap.safe_read_file_bytes_nolinkmessage: exact bytes text, and the error carries the measuredsize.Red on
origin/main(File exceeds 0 MB safety cap), green with the fix.prove.py --base origin/main: PROVEN. Determinism: 5 serial repeats, reversed node order and-n 2all pass.Manual verification
N/A - unit coverage sufficient: the tests drive the real member message build on a temp home with a real 265,585-byte file, the reported shape.
Related Issues
Closes #22575
Pattern harvest
Rule candidate: review-prompt
Pattern: a size-cap message built with integer division into a larger unit (
cap // (1024 * 1024)) prints 0 for a cap under one unit; print bytes.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)