Repository navigation
fix(artifacts): let artifact_save carry kind=dashboard to the store gate - #19414
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The kind becomes saveable before anything reads a saved package. On main, its only consumer refuses that crewmate's field writes. Not justified as shipped
What this change shipsInventory (6 items) — 4 justifiedIntent: let an agent save a dynamic dashboard's layout package through
[FIRST-PRINCIPLES-REVIEWED] 65685da Description read[DESCRIPTION-READ] a62e86e808e009ad0cf1995f0c498b6bda8d70248316f41c1e2c345a94a9d723 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Saving a package now pauses that crewmate's dashboard writes until the unmerged Watch
Suggestions
[DESIGN-REVIEWED] 65685da Description read[DESCRIPTION-READ] 2ac0bd66cb606b061dfdce699a3598f0bdf1e55d845d978c0ebf1bbc12f24da8 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 |
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: |
28ce0f8 to
7cec58c
Compare
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: |
7cec58c to
666e11a
Compare
|
Round 2 dispositions, head Opus 5.5, Design Review, saving a package pauses that crewmate's agentic writes: accepted and now named in the description. Verified in code, and the refusal says it about itself: Two changes rather than a code gate. The PR description now carries the mechanism end to end, the blast radius (one crewmate, the one the binding names), what it does not do (no data loss; the crew-log values stay and the page keeps drawing them; the refusal is recorded with its own code and a remedy sentence) and what lifts it (the display half, in #19060 / #19335, not on main). And the Not fixed in code on purpose: preventing the state in First Principles, two more kind lists in So the agent tool genuinely is the only creating path, which is what the description claims. Widening the CLI would add a second person-facing way to hand-write this kind and contradict the constraint the issue sets. The generalisation is accepted and already in Pattern harvest as a review-prompt candidate: a value added to the authoritative allowlist but not to the narrower lists a caller is validated against, so the capability exists and no caller reaches it. Deriving all five lists from one source is the right subtraction and a bigger change than this fix, touching the CLI's person-facing surface and GPT 6.1 produced no verdict for the previous head. Not a finding; the new head re-runs it. |
666e11a to
e9727a4
Compare
|
Round 3 dispositions, head Design Review, Read the RFC's Decision 1 and then the gate it protects. The decision gives approval to apply and says a save stages. This path cannot stage past that gate, and the reason is not prose, it is the actor:
So the chain in the finding stops at its third link. #19335 does not inherit packages that skipped stage, preview and approve, because it refuses to serve any package with no user-actor version, and a package saved here has none. It is a draft that renders nothing. On First Principles item 3, the description restates the package rules the PR argues belong only to the store: the second copy is removed, the sentence stays. The distinction the PR's argument rests on is between a GATE and a DESCRIPTION. A gate accepts or refuses; a second gate can disagree with the first and that is the drift the argument is about. A description refuses nothing. It is also the only place an agent learns the shape, which the previous round proved by listing four of the five keys and earning a refusal no agent could act on. What was a real second copy is the key list written again inside the test. That is fixed: the test now reads the keys off First Principles item 4, the pause warning in the tool description goes stale when the display lands: it is written as a condition, not a date. The sentence says writes are refused "while the page still draws from its template instance", which is a true statement about either state and stops applying on its own when the display reads packages. Cutting it entirely is the other lane's finding in reverse: Design asks that the pause be disclosed, and the agent that triggers it is the agent reading this text. First Principles item 5 and Design's second Watch item, the sequencing: this is the one thing in the diff I cannot settle. Both lanes name the same remedy and both put it with a person: land after the display half, or accept that writes pause for a crewmate with a bound package in the meantime. The PR description carries the mechanism, the blast radius, the absence of data loss and what lifts it, so the decision can be made on the facts. It is recorded as open and left to the maintainer rather than argued away here. |
e7d73eb to
34bb3ef
Compare
|
Round 4 dispositions, head First Principles item 2, The two tool enums stay hand-written and that is deliberate, for a reason the counting treats as the same thing. They are not a copy of the store's set: they are a JSON Schema the model reads, each entry carrying a model-facing description, and they are deliberately NARROWER than what the store accepts, because Design Review, the write pause has no stated undo: it has one, it is the artifact store's own delete, and it is now pinned. Design Review, nothing stops an agent binding a different crewmate's page: correct, and now stated in the description rather than left to be inferred. First Principles item 4 and Design's remaining Watch item, the sequencing: still the one open thing, and still a person's. Both lanes name the same two ways to clear it, and the facts needed to choose are now all in the description: the mechanism, the blast radius, the absence of data loss, who the binding can reach, the in-product undo, and what lifts the pause for good. Not argued away here. Local verification on this head: |
34bb3ef to
ace90c5
Compare
|
Round 5 dispositions, head Design Review, the First Principles, the serve-path comment I quoted is nowhere in The part of that item that is on THIS base is the actor, and that is what the test pins. A save through the tool records Both lanes' remaining item is one question about merge order, and the one suggestion offered for it cannot be taken here. Each lane suggests shipping the pattern derivation and the What is left is a choice between merge orders: land now, or land with the display half. The description states it as one open decision, with everything needed to decide it -- mechanism, blast radius, who a binding can reach, no data loss, the in-product undo, and what lifts the pause for every crewmate at once. It is for whoever owns the dashboard line, and it is not argued away here. Verification on this head: |
|
Description trimmed to fit the review capture, head unchanged at Design Review's second item reported "Backwards compatibility not checked -- the description is cut off". That was true and it was my fault: It is now 10,326 bytes, arranged so the capture ends after Backwards compatibility rather than inside What changed. Everything a lane reads is unchanged in substance: the three frozen goal sections are byte-identical, and the cuts are repetition, not claims. The Tests section leads with its counts so the measured numbers land inside the cap even though the per-test list does not; the tests themselves are in the diff. The full-body gates ( No code changed and no push was made for this, so the lane verdicts above still name this head and no sha-bound marker is invalidated. The lanes were deliberately not re-run: the two at CONCERNS are advisory and their remaining item is the merge-order question, which a longer description does not answer, and re-running the two that are clean would risk a publish failure on a green board for no verdict change. The next push, if there is one, reads the current text. Board on this head, from a paginated read of all 108 check rows: 94 success, 14 skipped, no failures and nothing pending. |
The artifact store has allowed kind="dashboard" since the kind existed: "dashboard" is in ALLOWED_KINDS and ArtifactStore.create/.update route every such write through artifact_store.dashboard_package, the single gate on that content. Two lists in FRONT of the store omitted the name, so every agent call was refused "kind: invalid format" before the store saw the bytes, and no product path could create the artifact a v3 dashboard is. Add the kind to the artifact_save and artifact_list tool enums and to _ARTIFACT_KIND_RE. No validation is added at the tool layer: the package rules stay in the store's one gate, so there is no second vocabulary to drift from it. kind="dashboard" stays out of USER_SELECTABLE_KINDS, so no person can hand-flip a prose document onto it. Tests pin the three lists against each other, that every kind the tool advertises reaches the store, and that a non-package body saved through the real handler is still refused with the rule it broke. Fixes #19401
ace90c5 to
65685da
Compare
|
This PR lets artifact_save and artifact_list accept kind="dashboard". The root fix is good: _ARTIFACT_KIND_RE is now built from ALLOWED_KINDS (sorted and re.escape'd) instead of a hand copy, and a test pins that every advertised enum entry reaches the store. I checked that package content is still gated only in ArtifactStore.create/update through dashboard_package, that the tool has no source_path so a linked package cannot be requested, and that a tool save records by="agent", so it can never pass as a person's approval. The open problem is a side effect, not a code defect: on main the only runtime reader of a bound package is api_dashboard_write (agent_panel.py:1890), which refuses every agentic field write to that crewmate with package_display_pending. bound_to is not tied to the saving session, so after this merges any agent can pause any crewmate's dashboard writes, and the pause lasts until someone deletes the artifact or feat/19060-page-host lands. The author asks the maintainer to decide this, and so do the Design and First Principles lanes. Question for the dashboard owner: merge now and accept that pause (who it can reach, with delete as the undo), or hold this until the page-host display half is on main? If you pick merge now, I suggest the artifact_save reply for kind="dashboard" name the bound crewmate and say "delete this artifact to resume". — crew-pr-reviewer (deep re-check) |
bolichen97
left a comment
There was a problem hiding this comment.
Maintainer approval after a full diff read on head 65685da894: diff matches the description, no regression to existing behaviour found, CI and readiness green.
Problem / Motivation
Goal: an agent can save a dynamic dashboard's layout package with the normal
artifact_savetool, instead of being refused the one artifact kind a v3 dashboard is made of.artifact_savewithkind="dashboard"is refusedError: kind: invalid format. The agent never gets to the store, and the message does not say what is wrong, because nothing is wrong with the request. Reproduced onc4c51aac:The store has allowed the kind since the kind existed.
"dashboard"is inALLOWED_KINDS(src/kiro_crew/artifact_store/rules.py:52), andArtifactStore.create/.updateroute every such write throughartifact_store.dashboard_package. Three lists decide whether an agent reaches that, and two of them omitted the name:dashboardbeforeALLOWED_KINDS, the store's ownartifact_save/artifact_listtool enums (src/kiro_crew/mcp_tools/artifacts.py:91,:251)_ARTIFACT_KIND_RE, what the tool schema validates against (src/kiro_crew/validation.py:2381)Why it matters
A dashboard package has to be composed by an agent, so the agent tool is the only path that can create one. With it closed, the kind is reachable only by a caller already inside the process, and the artifact the library badges, versions and reverts cannot be brought into being by the product. Found by an exploratory click-through QA run, row 34.
Not a goal
dashboardtoUSER_SELECTABLE_KINDS. The browser type control is where a person writes a kind onto an existing document, and a prose document flipped to this kind stores content no reader can parse.imagematches the kind pattern and is deliberately absent from the tool enum, because that kind needs asource_paththe MCP save path never sends.What changed (motivation -> approach -> change)
Two lists in front of the store omit a name the store has always carried, and they are different kinds of thing.
_ARTIFACT_KIND_REwas a hand-written second spelling ofALLOWED_KINDS. The copy is the defect, so it is now BUILT from that set, oversorted(...)andre.escaped;validation.pyalready imported fromartifact_store.rules.The
artifact_save/artifact_listenums are a JSON Schema the model reads, deliberately NARROWER than the store's set (imageneeds asource_paththe MCP save path never sends), and derivation is wrong for a subset:"dashboard"is added by hand, with a test pinning that every offered kind reaches the store.Validation attaches nowhere new. It is at
ArtifactStore.create/.update, the single gateartifact_store/dashboard_package.pyis written around; both runcanonical_package_contenton everykind="dashboard"write (artifacts.py:675,:1357). Spelling package rules at the tool layer would make a second vocabulary able to drift from the gate that holds, silently. So the tool layer only stops pre-refusing a name, and its description gives the agent the content's shape.Not opened. The serve path refuses a non-
DASHBOARD_KINDartifact and a LINKED one whose bytes passed no write gate. Neither weakens, and the second is unreachable:artifact_savehas nosource_pathfield, and the store refuses that pairing atcreate, a kind switch andrelocatealike, each already pinned here.A write is also not an approval. Every version cut appends a lifecycle event carrying the ACTOR, taken from how the request authenticated, so a tool save records
by="agent"-- measured,{"type": "created", "by": "agent", "version": 1}. Version 1 is just what creating any artifact answers; there is no version 0. The RFC's "a save cuts no version" governs writing a page into an existing package,dashboard_save's step, and onfeat/19060-page-hostapplied_package_versioncounts onlyby == "user"versions and serves nothing without one.Opened, and it is this PR's own consequence. A third refusal, on the agentic write route, is accepted because "the population this refuses is empty until the display can draw it" (
dashboard/handlers/agent_panel.py). This PR is that gate. An agent saves a package bound tocrewmate:X,read_package_model("X")answersfrom_package=True, and every field write to X is refusedpackage_display_pending-- X's page still draws from its template instance, and checking a write against a different Model would let a value land the page cannot draw.The window, in plain terms. Between this merging and the display half landing: an agent calls
artifact_savewith a valid package namingcrewmate:X, and the save succeeds. Nothing new appears for anyone, because X's page is still drawn from its template instance. Then the next agentic field write to X comes back refused, ending "Nothing is wrong with the package or the value: wait for the display to read the package, and write it then". That refusal is recorded under its own code in the mistake book, so the agent is not left retrying a call that will keep failing. Every earlier value is still in the crew log and still on the page. Deleting the package artifact ends it: the binding goes unclaimed,resolve_bound_sluganswersNoneas it does for a crewmate that never had one, and writes resume.So the window costs a paused write with a stated remedy, for one crewmate, undoable with a delete. The refusal's comment in
agent_panel.pyis rewritten in this diff to say that and to namefeat/19060-page-hostas what lifts it, rather than leave a reader the premise that the population it refuses is empty.Two things it does NOT bound.
bound_tois whatever the caller writes and nothing here ties it to the saving session, so an agent can pause a crewmate it is not working for; that route keys on a package being bound at all, not on who bound it. Pre-existing behaviour this PR makes reachable; tying a binding to its writer changes the binding rules, not a kind list. Nor can the tool layer prevent the pause without being taught about display state.Why this lands before the display half rather than waiting for it. Nothing is lost and nothing is corrupted: a refused write is an error carrying a remedy, not a bad value in the store, and the refusal happens before the value is ever checked against a Model. And the window is reachable only by an agent that deliberately composes a package, which no shipped skill asks for -- zero hits for a dashboard package across
skills/-- so it is on no documented product path.The alternative the review lanes offer -- hold
"dashboard"out of the save enum and ship the rest -- is the one option unavailable here:artifact_saveaccepting a valid package is this issue's Done-when, so taking it would report the fault fixed while fixing nothing.Backwards compatibility
Compatible: one allowlist widens, two enums gain a value, and the derived pattern accepts the same nine names, so every call that works today is spelled and validated the same way.
Removes nothing: no field, kind, key or function is rejected, renamed or removed, and no stored record is read or written differently; packages written by other routes parse and render as before. One behaviour becomes reachable that no caller can reach today: the write pause above, with its mechanism and undo.
Tests
All in
test/test_artifact_dashboard_package.py, which owns this kind's contract: 100 passed, nine of them failing on basec4c51aacwith this test file alone, seven with the issue's literalkind: invalid format. With the suites that read the kind lists, 1244 passed; withtest_agent_panel_routes.py,test_dynamic_dashboard.pyandtest_mochi_hooks.py, since the diff touches the refusal's comment, 387.The fix:
test_the_three_lists_agree_on_the_kind(the issue's "three lists" pin),test_the_tool_schema_takes_a_package,test_the_list_filter_takes_the_kind_too, andtest_a_package_saved_through_the_tool_lands_as_a_package, which drives the real handler with a real store behind the POST seam and asserts the kind is forwarded, not re-typed tojsonby inference.The gate still holds:
test_a_body_that_is_not_a_package_is_refused_with_its_reasonandtest_a_package_carrying_values_is_refused_with_its_reasontake that same real path, earnis not valid JSONandvalues stay in the crew log, and leave no record behind.Nothing else moved:
test_every_kind_the_tool_advertises_reaches_the_store(drift pin, green either way so the fault cannot return as a different kind),test_a_save_is_a_write_and_never_a_persons_yes,test_deleting_the_package_leaves_the_binding_unclaimed_again(the undo, as a round trip),test_the_enum_tells_the_agent_every_key_the_package_needs(keys read offcanonical_package_content's own output, so no second copy drifts),test_the_tool_cannot_ask_for_a_linked_package,test_an_agent_tool_kind_is_not_a_hand_pickable_one.Manual verification
N/A - unit coverage sufficient. The failing path was a schema refusal, and the test that now passes drives the same handler an agent calls with the real store behind it, so no integration seam is left uncovered.
Related Issues
Fixes #19401
Pattern harvest
Rule candidate: review-prompt
Pattern: a value is added to the authoritative allowlist but not to a hand-written copy of it that a caller is validated against, so the capability exists and no caller reaches it. The copy is the defect, not the missing name.
Partly applied here: the copy is replaced by derivation. What stays a reviewer prompt is the case where derivation is wrong -- a list deliberately NARROWER than the authoritative set, like a tool enum offering a subset or a CLI's
choicesfor what a person may type, which needs a test pinning the subset relation instead. One of each shape is in this diff.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement