Repository navigation
fix(deploy): make Deploy actually deploy a webapp artifact from the dashboard - #12832
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Default-off flag silently removes the working PublishHub public-web row and hides the button the MCP tool's own routing guidance names. Watch
Suggestions
[DESIGN-REVIEWED] 1e3fc94 |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Reaper refusal contradicts the adjacent Expiry control — "Permanent (no expiry)" beside "an expiring deployment needs auto-cleanup"; the blind reader "cannot reconcile those." Watch
Suggestions
[UX-REVIEWED] 1e3fc94 |
First Principles Review (Fable 5) — ✅ human override accepted@chenmingwei23 overrode this lane for |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNothing blocks; one advisory finding on the new pending-confirm recovery path. FINDING — src/kiro_crew/deploy/handlers.py:2546 — [OPUS-REVIEWED] 419ebd1 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
7c31723 to
0498134
Compare
0498134 to
47d9fb8
Compare
47d9fb8 to
c487eb0
Compare
c487eb0 to
5951866
Compare
5951866 to
08f0ac3
Compare
GPT 5.6 Review —
|
2 similar comments
GPT 5.6 Review —
|
GPT 5.6 Review —
|
08f0ac3 to
6ffad95
Compare
daea034 to
ca765bb
Compare
ca765bb to
419ebd1
Compare
Rebuttal: the
|
419ebd1 to
ef7ef5b
Compare
GPT 5.6 Review —
|
1 similar comment
GPT 5.6 Review —
|
Deploy on a webapp artifact card and on the Artifact Deploy page's "Ready to deploy" row set `window.__mc_chat_launch` and navigated to /chat. Neither deployed anything. The only button in the product that executes a webapp deploy lives on a card that renders nothing when the pending list is empty, so the chat sent the user back to the button they came from. Both buttons now run the two-call confirm flow `useDirectDeploy`: a preview that resolves the app's built static root and scans it, the blocking public-by-link acknowledgment, then the confirmed deploy bound to the previewed digest and identity so a concurrent change is refused rather than published. The chat hand-off survives as a labelled fallback, offered only when the backend reports no built static root to publish. Three refusals get an affordance instead of a red dead end: the reaper precondition offers "Deploy as permanent" and the absolute install command, a stale preview says the app changed, and a scan block shows its findings with an override that credential findings deliberately do not get. The whole surface sits behind the off-by-default Artifact Deploy Feature Preview. With the preview off the card shows the app's draft information and one neutral pointer to Settings, and offers no deploy route by either path. The row reports one state: its status badge follows its own flow rather than the artifact record, whose back-fill lands on a later refetch, and the primary is inert once a deploy is done or while a scan block stands. All new copy is in the eleven shipped catalogs, including the Ready-to-deploy column headers and the hook's error fallbacks, which rendered English regardless of locale. Fixes #12816
ef7ef5b to
1e3fc94
Compare
GPT 5.6 Review —
|
|
/ai-review override first-principles 1e3fc94: Accepted for this release. The pre-existing Artifacts doors route into this same confirm flow, which publishes to a world-readable URL and spends in the operator's own AWS account, so gating the whole surface behind one off-by-default Feature Preview is the coherent shape, and shipping it on by default would be the larger decision. Recorded here rather than by RFC deliberately: the surface-wide on-by-default question is a separate follow-up. |
Human judgment recorded@chenmingwei23 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
1. What is the problem?
A user with a
kind=webappartifact could not deploy it from the dashboard atall. Every button labelled "Deploy" sent them to a chat session, and the chat
sent them back to the button.
Three things had to be wrong at once:
Neither Deploy button deployed. The webapp artifact card and the Artifact
Deploy page's "Ready to deploy" row both set
window.__mc_chat_launchandnavigated to
/chat. A human standing on the confirm surface, alreadycookie-authenticated, was handed to an agent instead of getting a deploy.
The agent could not deploy either. Its only tool is the MCP
deploy_artifact,which is preview-only by design: it writes a pending entry and returns.
The one button that executes a deploy was easy to never see. That is "Pending
confirmations -> Confirm Deploy" on
/deploy, whose card renders nothing when thelist is empty. In the reported session
deploy_artifactwas unavailable three times, so no entry was ever written: noentry -> no card -> click Deploy -> chat -> "click Deploy on the Artifact Deploy
page" -> loop.
Underneath, the deploy endpoint refused a webapp slug outright, so no amount of
frontend work could have deployed one. A webapp artifact's content is an app
summary rather than deployable HTML, and the endpoint had no other way to reach
the app's built files.
Two further defects surfaced while fixing this, both reachable from the same
click. A successful deploy did not flip the artifact it deployed, because the
post-deploy write persisted only
distribution_idwhile the card's "not deployed"hero keys off
deploy_target.public_url. And the deploy TTL defaulted to 72hours, which requires auto-cleanup infrastructure that nothing in the setup guide
installed, so a first confirm reliably failed on a precondition whose remediation
command was the bare string
install-reaper.sh, a command on nobody'sPATH.2. Why this issue matters to the user
Artifact Deploy's whole promise is a public link for something you already built.
For a webapp artifact the product could not deliver that by any route a user could
find. The dashboard's most explicit affordance pointed at a chat, the chat pointed
back at the dashboard, and the agent's own guidance named a sidebar entry and an
App Store install that do not exist, the page is at
/deploy, reached from theArtifacts page, and the deploy layer is part of core.
A user who pushed through to the one working button then met an AWS error naming
two CloudFormation stacks and a parameter, with no way forward offered.
3. How our fix solves it
Working from the symptom back to the cause.
The button now deploys. Both sites run the two-call flow
PublishHubalreadyruns for html and widget artifacts: preview, the blocking public-by-link
acknowledgment, then a confirm bound to the previewed content digest and resolved
identity so a concurrent change is refused rather than silently published. One
hook (
useDirectDeploy) and one dialogs component (DirectDeployFlow), shared bythe page row and the card, so the two surfaces cannot drift apart.
The endpoint can reach a webapp's files. A webapp slug resolves to its built
static root through a new
resolve_webapp_public_dir, and that root travels theexisting
local_dirroute, which owns the staging snapshot, the symlink andsensitive-path refusals, the size guard and the content scan. The root is required
to be
app_dir/public:app_diritself is deliberately not a fallback, becausepublishing it whole would upload the app's sources and build config to a
world-readable CloudFront URL. That rule now lives in one function, which the
local preview channel delegates to as well.
The chat hand-off became the fallback, and says so. It is reached only when the
backend answers
webapp_root_unavailable, the app has no built root to publish -and the button then reads "Deploy via agent".
A deploy flips its own card. The post-deploy write now persists
public_url,profile,regionand the lifecycle block besidedistribution_id. Doneserver-side, so the direct confirm and the pending confirm both inherit it;
previously the agent wrote those fields from chat, which is exactly why a
dashboard-initiated deploy had nobody to write them. Still best-effort: the deploy
has already happened, so a metadata write failure must not undo it.
The auto-cleanup precondition has a way forward. Expiry is chosen per deploy
and defaults to permanent, the only value that needs no infrastructure, so a first
deploy cannot fail this precondition. If someone does choose an expiring window
without it, the refusal offers deploying as permanent, re-running the same
previewed content at zero rather than starting over, or copying the exact install
command, now an absolute path resolved from the live skills directory. Setup step 4
documents the same install, resolved through the same helper, so the guide and the
error cannot print different commands.
The error text has one audience per field. Every refusal a human can reach by
clicking splits into
error, a plain sentence saying what happened and what theycan do, and
details, which keeps the stack, field and directory names behind aDetails toggle.
remediationstays the runnable command;codeis the machinefield the affordances key off, so wording stays free to change without turning the
buttons off. The MCP tool relays all three: sending only the banner sentence would
have taken
ttl_hours=0away from the one caller that needs it to retry.The stale guidance is gone. The skill no longer claims to ship as an
installable app, its "sidebar -> Artifact Deploy" pointers name
/deployreachedfrom the Artifacts page, and both
deploy_artifactreturn strings give the route.4. What tests we did
821 backend tests pass across
test/test_deploy_*.py,test_webapp_preview.py,test_mcp_core.pyandtest_error_code_contract.py; 213 frontend tests across 13files, covering the page, the hook, the card, the
/deployroute and all elevenlocale style gates.
npm run i18n:checkis green on all 19 of its checks, theper-chunk bundle-size gate passes, and flake8, isort, eslint and the CI
tsconfig.app.jsontypecheck are clean.New coverage: the webapp deploy path including an assertion that only the built
public/contents are published and the app's build config is not; everywebapp-root refusal; the reaper 409's machine code and absolute remediation; the
back-fill writing the fields the card reads, and a back-fill failure not failing
the deploy; that each banner sentence carries none of the seven jargon terms while
detailskeeps them; and the reaper affordance end to end, including that"Deploy as permanent" re-confirms at
ttl_hours=0and that this path never handsthe user to a chat.
Existing tests changed, and why. Nine assertions in three frontend files asserted
the chat hand-off, that was the reported behaviour, so they now assert the deploy
request; one setup-command count moved 2 -> 3 for step 4. Six backend assertions
pinned the bare remediation literal or the pre-rename writeback helper. Five more
read the blended error text and now read
details. One config assertion asserts thepayload's key set exactly, so a new field has to be declared on purpose rather
than arriving unnoticed, and
reaperInstallScriptis checked for the propertythat matters: an absolute, runnable path. One fake-store helper passed
Path("")where it meant"", which had beenexercising the containment branch rather than the empty-metadata one it was named
for.
Not verified locally: no real AWS deploy was performed. Every AWS boundary is
stubbed at
engine.run_aws, so CloudFront and S3 behaviour is unchanged anduntested by this PR.
5. Any other suggestions on the work
Disposition: the First Principles review's product-shape item. That lane asks
for a recorded decision on putting the pre-existing deploy ingress (the Artifacts
page button, the card hero, the PublishHub public-web row) behind an
off-by-default Feature Preview, and it names its own clearing conditions: an RFC
covering that gating merged non-draft on the base branch, or a maintainer
override. Neither belongs in this pull request. An RFC is a base-branch document
about the product's default, reviewed on its own terms and not inside a bug fix,
and the override is a repository writer's call rather than the author's. The
gating itself is what makes this change safe to land at all: the flow it adds
publishes to a world-readable URL and spends money in the operator's own AWS
account, so shipping it on by default would be the larger decision, not the
smaller one. The default is stated in the flag's own documentation and shown in
the flag-off frame; if the reviewers or a maintainer want the surface on by
default, that is a one-line change to the flag and it should be made
deliberately, in the change that records the decision.
Disposition: the memory-recall button-row finding. GPT 5.6 blocks on
website/src/pages/chat/MemoryRecallStrip.tsx:34, a file this branch does nottouch and which is byte-identical to the base. The rule it cites grandfathers a
row the diff does not add to. Rebutted in a pull-request comment rather than
fixed here, because changing an untouched chat surface is the kind of rider the
First Principles lane objects to on this same head.
Two lines in this diff are not this change's work, disclosed rather than folded
in silently.
website/scripts/restyle-baseline.jsonloses one entry. The restyle ratchetlanded on the base at 18:29 and #12805 then removed two restyle sites from
MembersPage.tsxat 21:35 without recording the fall. The gate fails on a fallas well as a rise, so it is red for every open pull request until someone records
it, and its own error message names the command. The line belongs to #12805; this
pull request only writes it down, and touches no file that gate measures.
Backend Testsshard 7 is red on the base for the same shape and this pullrequest cannot clear it: the crew-log
exc_infotripwire flagscrew_log/emit.pyandcrew_log/session_tree_projection.py, neither of whichthis branch touches, and CI tests the merge ref so a rebase inherits them. Filed
as #13005, the second trip of the tripwire first reported in #12939.
Localisation. The Ready-to-deploy header row and the four error fallbacks in
useDirectDeployrendered English in every locale. The header labels now live inREADY_COLUMN_KEYand resolve where the header renders, the same shape asFILTER_LABEL_KEYinChatSidebar, and the fallbacks resolve catalog keys.Values reuse the repo's own existing translations wherever the same English string
is already in a catalog. "Artifact Deploy" is a product name, so it joins the
dntarray insrc/i18n/glossary.jsonbeside the thirteen other KiroCrew featurenames already there, which is what
check-untranslated-values.mjsnames as theremedy for a value that is legitimately identical in every locale.
Bundle budget. The catalog chunk
twent 651 B over its 905 KB ceiling. Cutting2,963 source bytes of the new copy moved the built chunk only 194 B, so closing
the rest by prose would cost roughly 7 KB of source text, the whole new surface.
The prose cuts are kept on their own merit and the ceiling is raised by the
minimum whole kilobyte, to 906 KB, leaving 567 B of headroom. The measurement and
the ratio are recorded in the budget file's comment. Reverting only
src/i18n/and rebuilding makes the gate pass, so the growth is catalog strings alone and no
new dependency landed in that chunk.
Two things I deliberately left alone.
The
local_dirandttl_hoursvalidation strings keep their parameter names.They are API-contract errors that no click can reach, the UI composes
ttl_hoursitself and the webapp path resolves its directory server-side, andthey are read by the MCP tool's LLM caller, which needs the parameter name to fix
its own call. Rewriting them would blur the contract for no human benefit.
The page defaults expiry to permanent rather than probing whether the auto-cleanup
stack exists. A probe costs two CloudFormation calls on every page load, and
permanent is the one choice that always works; picking an expiring window without
the stack now lands on an actionable refusal instead of a dead end.
Worth a separate look: why
deploy_artifactreported unavailable three times inthe reported session. That looks like a runtime deferred-tool problem rather than
anything in the deploy layer, and it is out of scope here, but it is what turned
a discoverability problem into a total dead end for that user.
Fixes #12816
Pattern harvest
Rule candidate: semgrep -- an atomic claim followed by a narrow
except.Pattern: a handler that removes a work item from shared state to claim it, then
processes it inside
try/except <SpecificError>. Any other exception escapeswith the claim already consumed, so the item is gone and the caller sees no
error. That is exactly this bug: the pending entry was popped to claim it, the
deploy raised something that was not an
AWSError, and the row vanished with nobanner -- which is why the reported symptom was a button that silently did
nothing rather than a visible failure.
The shape a rule can match: within a function, a
dict.pop/list.remove/queue-claim on module or instance state, followed by a
trywhose handlers donot include
Exceptionand whose body has nofinallyor re-add on the failurepath. The fix is always the same -- put the item back before re-raising or
returning an error.
Two narrower observations from the same change, offered as review prompts rather
than rules, because both need judgment a matcher does not have:
viewport. Caught here only by looking at a screenshot; no jsdom assertion sees
layout. The harness added in this PR now measures the banner's right edge, so
the regression fails a run instead of needing an eye.
it only on the preview lets the server re-resolve a default on confirm, so the
operator previews one account and confirms against another.
Screenshot evidence
Captured with scripted Playwright against the real built SPA, every
/api/**callanswered from fixtures, by the harness this PR adds at
website/scripts/capture-artifact-deploy-direct-confirm.mjs. The frames areattached below rather than committed, which is what
.gitignorepins for reviewevidence.
Every captioned frame carries an assertion in the harness, and the run fails if
the frame does not show the state its caption claims. The numbers below are the
harness's own output on the pushed head.
Capturing these found two defects the test suite did not. The refusal banner
rendered inside the actions cell and ran past the viewport's right edge, cutting
off both the Details text and the buttons; it now spans its own full-width row.
The settings frame was shooting Settings -> Overview, because Feature Previews is
a section of the Developer tab rather than a top-level entry, so the frame did
not contain the toggle its caption named.
Default-off behaviour. With the preview off the feature is hidden rather than
rerouted: no in-page button, no agent hand-off, no profile picker, and no line
inviting a deploy. The card shows the app's draft information and one neutral
pointer to Settings -> Developer -> Feature Previews.
On the harness's own opt-in.
stubDashboardApirunslocalStorage.clear()inside an init script that fires on every navigation, so a preview flag written by
a separate init script or by
page.evaluateis wiped on the nextgoto. It isseeded through that stub's own
localStorageEntriesnow, and the run asserts theflag reads back before shooting anything. This mattered silently rather than
loudly: an absent flag does not empty a frame, it withholds one control and leaves
the rest of the shot looking right, which is how the card's hero frame was
unreachable for several rounds.