Repository navigation
feat(dashboard): raise the hand-written page and package caps - #20685
chenmingwei23 wants to merge 1 commit into
Conversation
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsFINDING -- src/kiro_crew/artifact_store/dashboard_package.py:76 -- “still leaves that room” overlooks JSON escaping: a validated 3 MiB page containing quoted JavaScript and newlines exceeds the package cap and is refused on save -> Fix: clarify that escaping also consumes the 128 KiB allowance, so meeting the raw-page cap does not guarantee saveability. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The description says the frame cap is 3 MiB + 128 KiB to leave headroom for template-directory pages, but the code sets it to exactly 3 MiB and says no headroom is needed. Watch
[DESIGN-REVIEWED] ace97da Description read[DESCRIPTION-READ] 5c25f7aed8e25d357e2b842ac9b0dfec51b9f5e44977ee2bc59f8b22a4cdafc8 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) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The description says the frame cap is 3 MiB + 128 KiB with headroom for template pages, but the diff sets it to exactly 3 MiB. Not justified as shipped
What this change shipsInventory (7 items) — 5 justifiedIntent: let a hand-written dashboard page that inlines a client-side library be saved and drawn. This is an ADDITION (a limit raise).
[FIRST-PRINCIPLES-REVIEWED] ace97da Description read[DESCRIPTION-READ] 1c8b724c58030e1bd45a67529d52d000787121bb968943fc2414ba89b8b02a02 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsFINDING — dashboard_package.py:79: a page under the view cap can still be refused as too large once JSON escaping is counted. Advisory, does not block. FINDING — src/kiro_crew/artifact_store/dashboard_package.py:79 — [OPUS-REVIEWED] ace97da Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
A dashboard package refused an agent-written view.html over 128 KiB and the whole package over 256 KiB, and the frame refused a raw page over 1,000,000 bytes. A hand-written page that inlines a client-side library (a 3D renderer, a charting bundle) with its own scene code is MB-scale by design, so such a page could never be saved, previewed or drawn. Raise MAX_VIEW_HTML_BYTES to 3 MiB, derive MAX_PACKAGE_BYTES as the page cap plus the 128 KiB the rest of the package has always had, and raise dashboard_frame.MAX_PAGE_BYTES (which validate_page measures the raw page against) above the page cap with headroom, so a page that saves is always one the frame composes. Every other bound (model field count, per-field label, theme, package-structure) and the fail-closed refusals are kept; the page cap is now a plain resource bound rather than a baked-values heuristic, which size was a weak signal for. The artifact content cap (25 MiB) and request body caps already fit 3 MiB. Boundary tests cover a page at the cap saving, one byte over refused, the package cap leaving room for a cap-size page, and a cap-size page composed by the frame.
6e7b8d7 to
ace97da
Compare
|
Addressed in You were right on both points. Changes in this revision:
The package cap stays at page cap |
|
You're right — the inconsistency was in the description, not the code. The diff ships Fixed the description so it states one number:
The package cap stays |
|
Superseded by #20790, which Fixes #20634. It raises the same three caps (page, package and frame) and adds what a page of that size needs:
Closing this one so the issue has a single PR. The branch is left as it is. |
Closes #20634.
Problem / Motivation
Goal: Let a hand-written dashboard page that inlines a client-side library be saved, previewed, applied and drawn, by raising the page, package and frame byte caps to a size such a page actually needs.
A dashboard package refuses an agent-written
view.htmlpage over 128 KiB(
MAX_VIEW_HTML_BYTES), caps the whole package at 256 KiB(
MAX_PACKAGE_BYTES), and the frame refuses a raw page over 1,000,000 bytes(
dashboard_frame.MAX_PAGE_BYTES). A page that inlines a client-side library —a 3D renderer, a charting bundle — together with its own scene or layout code is
several hundred KB to a few MB of markup with no data baked into it, and such a
page is a common thing to build. Today it can never be saved as a package, and a
page loaded from a template folder cannot be used once it passes the frame's
limit.
Why it matters
Pages like this are a normal thing to build and are entirely layout — no data is
baked in — so the cap turns a legitimate page away. The 128 KiB / 1,000,000-byte
limits make inlining a real client-side library impossible, which blocks a whole
class of dashboards (3D scenes, rich charts) from existing at all.
Not a goal
theme caps, view-block count and package-structure checks are untouched.
is still refused with the existing error, now naming the new number.
What changed (motivation → approach → change)
The three caps on the save-and-draw path were set where a layout-only page fits
and a runaway generation does not — but at a size (128 KiB) chosen as a
baked-values heuristic, which the issue shows is a weak signal and which puts a
legitimate inlined-library page out of reach. The approach is to raise the three
caps together so a page that saves is always a page the frame draws, and to say
plainly that the page cap is now a RESOURCE bound, not a baked-values check:
MAX_VIEW_HTML_BYTES: 128 KiB → 3 MiB (3 * 1024 * 1024).MAX_PACKAGE_BYTES: 256 KiB → page cap + 128 KiB (3,276,800) — the pagecap plus the room the rest of the package (model, view wrapper, theme, and the
~12% the indented stored form adds) has always had, so a page saved at the
page cap never pushes the package over on its own.
dashboard_frame.MAX_PAGE_BYTES: 1,000,000 → 3 MiB (3 * 1024 * 1024),equal to the page cap.
validate_pagemeasures the RAW page (the inline body,before
composewraps it in the head, stale band, data island and bootstrap),the same string the store caps at
MAX_VIEW_HTML_BYTES. The frame ceilingEQUALS the page cap, so a page the store will save is exactly a page the frame
will compose; nothing measures the composed document, so no headroom above the
page is needed.
docs/.../artifacts.mdupdated tothe new numbers and the resource-bound framing. Data still belongs in the crew
log and reaches the page through the fold / bus / controller path; what keeps
the DATA island small is the per-field model caps, not the page size.
The size cap is now a resource bound, not a baked-values check — this is the
explicit framing the issue asks for.
Other limits on the path (checked)
The issue asks to check every other limit a page crosses and raise it or say why
it already fits:
artifacts.MAX_CONTENT_BYTESis 25 MiB; a 3 MiBpackage is well under it. Already fits, unchanged.
artifacts handler, whose
_MAX_BODY_BYTESisMAX_CONTENT_BYTES + 8 MiB.Already fits, unchanged.
member_dashboard) — reads the staged packagethrough the store with no byte cap below the package cap, so the raised
MAX_PACKAGE_BYTESgoverns it. No separate limit to raise.compose()is never size-checked as a whole;only the raw page is, via
MAX_PAGE_BYTES, which is raised to equal the pagecap. A page the store accepts is therefore always one the frame will compose.
Covered.
instance.MAX_INSTANCE_HTML_BYTESis definedas
dashboard_frame.MAX_PAGE_BYTES, so it tracks the raise with no codechange. Auto-tracked.
website/src/libsizes or copies the framedocument; the browser wrapper applies the frame's CSP, not a length limit.
Nothing to raise.
validation.pyhtml, 64 KiB) — bounds a fieldalways refused one layer up (
AUTHORED_PAGE_REFUSAL): an authored page cannotbe previewed or adopted, so this gates no real page and stays small. Left
as-is; its stale "matches the store ceiling" comment corrected.
Backwards compatibility
Compatible: this only RAISES caps. Every page and package that saves today still
saves; the fail-closed refusals remain and now name a larger number. No field is
added, renamed or removed, no validator is tightened, and no default behaviour
changes.
Reproduction
On
origin/main, aview.htmlof 131,116 bytes (just over 128 KiB) is refused:With this change: a page at exactly 3,145,728 bytes saves, one byte over is
refused naming the new limit, the package cap leaves room for a cap-size page,
and a cap-size page is accepted by the frame (its cap equals the page cap).
Tests
test/test_dashboard_package_html_view.py: page exactly at the cap saves; onebyte over refused with the limit named; package cap leaves room for a cap-size
page; a cap-size page is accepted by the frame.
test/test_dashboard_frame.py: the frame cap's value and that it equalsthe save-side page cap.
test/test_artifact_dashboard_package.py: the stored-form (indented) cap testrescaled to the new cap — compact submit at the cap, indented stored form over.
CI runs the cross-surface backend set.