Skip to content

fix(artifacts): let artifact_save carry kind=dashboard to the store gate - #19414

Merged
bolichen97 merged 1 commit into
mainfrom
fix/19401-artifact-save-dashboard-kind
Oct 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/19401-artifact-save-dashboard-kind

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: an agent can save a dynamic dashboard's layout package with the normal artifact_save tool, instead of being refused the one artifact kind a v3 dashboard is made of.

artifact_save with kind="dashboard" is refused Error: 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 on c4c51aac:

>>> validate_tool_args({"name": "d", "content": "{}", "kind": "dashboard"}, ARTIFACT_SAVE_SCHEMA)
ValidationError: kind: invalid format
>>> validate_tool_args({"kind": "dashboard"}, ARTIFACT_LIST_SCHEMA)
ValidationError: kind: invalid format

The store has allowed the kind since the kind existed. "dashboard" is in ALLOWED_KINDS (src/kiro_crew/artifact_store/rules.py:52), and ArtifactStore.create / .update route every such write through artifact_store.dashboard_package. Three lists decide whether an agent reaches that, and two of them omitted the name:

List Had dashboard before
ALLOWED_KINDS, the store's own yes
artifact_save / artifact_list tool enums (src/kiro_crew/mcp_tools/artifacts.py:91, :251) no
_ARTIFACT_KIND_RE, what the tool schema validates against (src/kiro_crew/validation.py:2381) no

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

  • Not adding dashboard to USER_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.
  • Not touching apply or version semantics. What counts as an applied version is being decided in feat(dashboard): host an agent-written dashboard page and let it subscribe (#19060) #19335.
  • Not changing how a dashboard package renders anywhere. The artifact detail page showing a package through the prose renderer is a separate fault with its own issue.
  • Not reconciling the other disagreement between these lists. image matches the kind pattern and is deliberately absent from the tool enum, because that kind needs a source_path the 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_RE was a hand-written second spelling of ALLOWED_KINDS. The copy is the defect, so it is now BUILT from that set, over sorted(...) and re.escaped; validation.py already imported from artifact_store.rules.

The artifact_save / artifact_list enums are a JSON Schema the model reads, deliberately NARROWER than the store's set (image needs a source_path the 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 gate artifact_store/dashboard_package.py is written around; both run canonical_package_content on every kind="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_KIND artifact and a LINKED one whose bytes passed no write gate. Neither weakens, and the second is unreachable: artifact_save has no source_path field, and the store refuses that pairing at create, a kind switch and relocate alike, 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 on feat/19060-page-host applied_package_version counts only by == "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 to crewmate:X, read_package_model("X") answers from_package=True, and every field write to X is refused package_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_save with a valid package naming crewmate: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_slug answers None as 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.py is rewritten in this diff to say that and to name feat/19060-page-host as what lifts it, rather than leave a reader the premise that the population it refuses is empty.

Two things it does NOT bound. bound_to is 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_save accepting 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 base c4c51aac with this test file alone, seven with the issue's literal kind: invalid format. With the suites that read the kind lists, 1244 passed; with test_agent_panel_routes.py, test_dynamic_dashboard.py and test_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, and test_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 to json by inference.

The gate still holds: test_a_body_that_is_not_a_package_is_refused_with_its_reason and test_a_package_carrying_values_is_refused_with_its_reason take that same real path, earn is not valid JSON and values 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 off canonical_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 choices for what a person may type, which needs a test pinning the subset relation instead. One of each shape is in this diff.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

@chenmingwei23
chenmingwei23 requested review from a team and KiroCrewCaptain as code owners October 12, 2026 12:09
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 65685da894e191b653d0623ead3535a0d3c153be touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 65685da894e191b653d0623ead3535a0d3c153be — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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

  • Item 2 — premise risk: the description says "the artifact the library badges, versions and reverts cannot be brought into being". I grepped read_package_model|resolve_bound_slug outside the store and found 1 runtime consumer, agent_panel.py:1839, and it raises display_pending_refusal. So on this base, the only thing a saved package changes is item 4.
    Subtraction: keep "dashboard" out of the artifact_save enum, and drop its description text, until feat/19060-page-host lands. Items 1 and 3 stand without it.
    Clears when: a main-branch reader renders a bound package, or the linked issue's Done-when is shown to require a save ahead of the display.
  • Item 4 — undeclared in Goal: an agent save now pauses one crewmate's dashboard writes. This is a direct consequence of item 2 and clears with it.

What this change ships

Inventory (6 items) — 4 justified

Intent: let an agent save a dynamic dashboard's layout package through artifact_save. This is a FIX.

  1. The schema's kind pattern is now built from the store's own kind list, so it no longer refuses dashboard — justified
  2. artifact_save offers kind="dashboard" and its description explains the package's shape — premise risk: nothing on main reads the package yet
  3. artifact_list can filter by dashboard — justified
  4. A crewmate with a saved package gets its agentic field writes refused — undeclared in Goal, a consequence of item 2
  5. The refusal's comment now describes a real population and names what lifts it — justified
  6. Tests: the tool reaches the store gate, and the advertised enum can't drift from the store — justified

[FIRST-PRINCIPLES-REVIEWED] 65685da

Description read

[DESCRIPTION-READ] a62e86e808e009ad0cf1995f0c498b6bda8d70248316f41c1e2c345a94a9d723

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of 65685da894e191b653d0623ead3535a0d3c153be — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Saving a package now pauses that crewmate's dashboard writes until the unmerged feat/19060-page-host lands. bound_to isn't tied to the session that saves it, so any agent can pause any crewmate.

Watch

  • The pause has no time limit and isn't tied to who caused it. An agent calls artifact_save with a package that names crewmate:X. api_dashboard_write then refuses every agentic field write to X with package_display_pending. The description says this outright: "an agent can pause a crewmate it is not working for". The only way to end it is to delete the artifact, and nothing tells the person running X that this is what they need to do. Nothing breaks permanently, but how long the pause lasts depends on when another branch merges.
    Clears when: the PR links an issue or milestone that ties the pause to page-host's merge, or the save says in its reply that crewmate X's dashboard writes are now paused.

Suggestions

  • Have the artifact_save reply for kind="dashboard" name the crewmate that was bound and say "delete this artifact to resume". Then the agent that caused the pause also holds the way to undo it.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 65685da894e191b653d0623ead3535a0d3c153be — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 65685da

Verdict parsed from the review's SHA-scoped output markers for commit 65685da894e191b653d0623ead3535a0d3c153be.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 65685da894e191b653d0623ead3535a0d3c153be: <one-sentence reason>

@chenmingwei23
chenmingwei23 force-pushed the fix/19401-artifact-save-dashboard-kind branch from 28ce0f8 to 7cec58c Compare October 12, 2026 12:15
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 65685da894e191b653d0623ead3535a0d3c153be and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 65685da

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 65685da894e191b653d0623ead3535a0d3c153be: <one-sentence reason>

@chenmingwei23
chenmingwei23 force-pushed the fix/19401-artifact-save-dashboard-kind branch from 7cec58c to 666e11a Compare October 12, 2026 12:24
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Round 2 dispositions, head 666e11a870f48ffad59d5609a015d5039660145a.

Opus 5.5, mcp_tools/artifacts.py description omits the top-level kind key: fixed. Real, and in my own diff. validate_package requires exactly five top-level keys (src/kiro_crew/artifact_store/dashboard_package.py:644) and the description named four, so an agent composing from that text alone earns a refusal it cannot act on. The description now names all five plus the values rule, and test_the_enum_tells_the_agent_every_key_the_package_needs pins every one of them against the validator's list so the next key cannot go missing quietly.

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: agent_panel.py:1877 raises display_pending_refusal whenever read_package_model answers from_package=True, and its comment states it costs nothing only because "a package exists only once an agent composes one through the gate on this stack, so the population this refuses is empty until the display can draw it". This PR is that gate.

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 kind enum description now tells the agent the consequence before it saves, since composing a package is a deliberate act and the agent that triggers this is the one that chose it.

Not fixed in code on purpose: preventing the state in artifact_save means teaching the tool layer about display state, which is the second vocabulary this PR's own argument rejects, and lifting the refusal is the display change's call. Whether this lands before or after the display half is a sequencing decision for the maintainer, not something the diff can decide.

First Principles, two more kind lists in cli.py still refuse dashboard: correct about the lists, and they are not copies. src/kiro_crew/cli.py:2992 and :3019 do read choices=["widget", "html", "markdown", "svg", "json", "text", "image"], and both also omit webapp, which has been a store kind with its own MCP enum entry and its own metadata validator for far longer than dashboard has existed. If those lists were copies of ALLOWED_KINDS, webapp would be in them. They are a narrower, person-facing vocabulary for what someone may type on a terminal, which is the same line USER_SELECTABLE_KINDS draws in the browser, and the issue is explicit that this kind stays off that side: a package is composed by an agent and a hand-written one stores content no reader can parse.

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 webapp's absence from it, both outside this issue's bar.

GPT 6.1 produced no verdict for the previous head. Not a finding; the new head re-runs it.

@chenmingwei23
chenmingwei23 force-pushed the fix/19401-artifact-save-dashboard-kind branch from 666e11a to e9727a4 Compare October 12, 2026 12:39
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Round 3 dispositions, head e9727a47dc17fd5649cd0df81a3d5b020831abb4.

Design Review, artifact_save becomes a second ungated save path and contradicts the RFC's "a save cuts no version": the premise does not reach this path, and the display half already closes it.

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:

  • Every version this store cuts appends a lifecycle event carrying by=<actor>, and the actor is derived from how the request authenticated (actor = "agent" if is_mcp else "user"), so it is not a value a caller spells. A tool save records by="agent". Measured on a fresh store: {"type": "created", "by": "agent", "version": 1}.
  • The serve path keys approval on by == "user" alone (applied_package_version) and answers "nothing to serve" when there is none. Its own docstring names this exact case: "an agent writing over MCP cuts a version on every save with no person involved, so 'this package has versions' says nothing about whether anyone approved one."

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 assert stored[0].version == 1: that is what creating ANY artifact answers, since the store has no version 0 and a kind has no say in it. It is not an approval and the assertion now says so, with test_a_save_is_a_write_and_never_a_persons_yes pinning the half that matters: no event the tool path writes carries the user actor. What a version MEANS stays the display half's question; nothing in this diff answers it.

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 canonical_package_content's own output, so the validator is the only place the list is written and a key added there is checked in the description without anyone editing a test.

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.

@chenmingwei23
chenmingwei23 force-pushed the fix/19401-artifact-save-dashboard-kind branch 2 times, most recently from e7d73eb to 34bb3ef Compare October 12, 2026 13:15
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Round 4 dispositions, head 34bb3efd1a11ea0837b2e2eaf02acfb160505d48.

First Principles item 2, _ARTIFACT_KIND_RE is a hand-copied second spelling of ALLOWED_KINDS: fixed at the root, the copy is gone. The pattern is now built from ALLOWED_KINDS, so validation.py no longer spells the kinds and the next kind added to the store cannot go missing here. validation.py already imported from artifact_store.rules, so no new dependency appears. Behaviour-identical, measured rather than asserted: the derived pattern is ^(dashboard|html|image|json|markdown|svg|text|webapp|widget)$, the same nine names the written-out alternation accepted. Built over sorted(...) so frozenset iteration order cannot change it, and each name re.escaped because the alternation is built now rather than written.

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 image needs a source_path the MCP save path never sends. Derivation is the wrong tool for a subset; the right one is a test pinning the subset relation, which test_every_kind_the_tool_advertises_reaches_the_store is. So the diff now holds one of each shape, and Pattern harvest says which is which.

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. test_deleting_the_package_leaves_the_binding_unclaimed_again runs the round trip: save through the tool, the binding resolves to the new slug, delete the artifact, resolve_bound_slug answers None again. None is the same answer a crewmate that never had a package gets, which is what makes the write route fall back to the template instance exactly as before the save. No migration and no manual repair. The description now carries that step.

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. bound_to is whatever the caller writes and nothing on this path ties it to the saving session, so an agent can pause a crewmate it is not working for. The write route's refusal keys on a package being bound AT ALL, not on who bound it; serving is binding-checked in the display half, but that check is not this one. This is pre-existing behaviour of the write route that this PR makes reachable, and tying a binding to its writer changes the binding rules rather than a kind list, so it belongs with the module that owns them. It is named in the description under what this does not bound, and it is on the record for the sequencing decision because it widens who the pause can reach.

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: test/test_artifact_dashboard_package.py 100 passed, nine of them failing on base c4c51aac with this test file alone. With the neighbouring suites that read these lists, 1244 passed. isort, black and flake8 clean on every file in the diff.

@chenmingwei23
chenmingwei23 force-pushed the fix/19401-artifact-save-dashboard-kind branch from 34bb3ef to ace90c5 Compare October 12, 2026 13:33
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Round 5 dispositions, head ace90c5a4906635949095291e12fdf5a60d3877d.

Design Review, the agent_panel.py comment becomes false and is left as it is: fixed, which is the half of that finding the diff can act on. The sentence saying "the population this refuses is empty until the display can draw it" is replaced with one that describes the population this PR makes real: any agent can bind a package to a crewmate, so every agentic field write to that crewmate arrives at this refusal. It then gives the next reader the three bounds rather than making them derive them: the crew-log values stay and the page goes on drawing them from its template instance, so nothing a person is looking at changes; the refusal carries its own remedy sentence and its own code, so an agent is told what to do; and deleting the package artifact leaves the binding unclaimed, which puts the member back on the template-instance fall-through. origin/feat/19060-page-host carries that comment block byte-identical and changes nothing in it, so this rewrite does not conflict with the display PR.

First Principles, the serve-path comment I quoted is nowhere in src/: correct, and my citation did not say where it lives. It is on origin/feat/19060-page-host, in applied_package_version in src/kiro_crew/dashboard/handlers/member_dashboard.py, and not on main. The description now says so before quoting it, and says why it is cited at all: to show the display half is built expecting agent-written drafts and gates them on apply, not to claim main does anything with a package.

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 by="agent" -- measured on a fresh store, {"type": "created", "by": "agent", "version": 1} -- because the actor comes from how the request authenticated, not from anything a caller spells. On assert stored[0].version == 1: version 1 is what creating any artifact answers, since this store has no version 0 and the kind has no say in it. The RFC's "a save cuts no version" governs saving a page into an existing package, which is dashboard_save's step; it cannot mean an artifact is created at a version the store cannot produce.

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 artifact_list filter while holding "dashboard" out of the artifact_save enum. That is the only option this PR must refuse: artifact_save accepting a valid package is the issue's own Done-when, so a PR linked to #19401 that leaves the save enum alone fixes nothing while reporting the fault fixed. The derivation would survive, which is what makes the suggestion tempting, but it is the smaller half of the issue and it is already in this diff either way.

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: test/test_artifact_dashboard_package.py 100 passed, nine failing on base c4c51aac with this test file alone. Because the diff now touches the refusal's comment, test_agent_panel_routes.py, test_dynamic_dashboard.py and test_mochi_hooks.py were re-run with it: 387 passed. With the neighbouring suites that read the kind lists, 1244 passed. isort, black, flake8 and the comment-history gate clean on all four files.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Description trimmed to fit the review capture, head unchanged at ace90c5a4906635949095291e12fdf5a60d3877d.

Design Review's second item reported "Backwards compatibility not checked -- the description is cut off". That was true and it was my fault: .github/scripts/pr-description-capture.sh caps what a review reads at 8000 bytes and marks the rest truncated, and the description had grown to 17,927. Every lane for several rounds was judging roughly the first half and could not see Backwards compatibility, Tests or Pattern harvest at all, which explains more than that one item.

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 (pr-description-check.sh, take_away_check.py) read PR_BODY rather than the capped capture, so they were never affected and both pass.

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. mergeStateStatus is BLOCKED on REVIEW_REQUIRED alone, which is the human approval.

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
@chenmingwei23
chenmingwei23 force-pushed the fix/19401-artifact-save-dashboard-kind branch from ace90c5 to 65685da Compare October 12, 2026 14:36
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

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 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer approval after a full diff read on head 65685da894: diff matches the description, no regression to existing behaviour found, CI and readiness green.

@bolichen97
bolichen97 merged commit e99c406 into main Oct 12, 2026
102 checks passed
@bolichen97
bolichen97 deleted the fix/19401-artifact-save-dashboard-kind branch October 12, 2026 22:30
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

artifact_save refuses kind=dashboard: the tool enum and the kind regex omit it

4 participants