Repository navigation
feat(apps): pin mochi for adoption - #39043
Conversation
Mochi now lives in its own repository under KiroCrewCaptain, ported from the current wheel copy with green CI on ubuntu, macOS and Windows. The row is the output of scripts/adoption_pin.py compute and is added to adoption-pins.json and the _SHIPPED_PINS table, so a host whose record is builtin-owned moves onto the app's own tree at its next restart and keeps data/, the grants and enabled. minAppSdkLevel is 7, the level of the desktopCapabilities the manifest keeps from the wheel copy. The adopted copy declares no desktop block: every desktop shell, the 0.13.0 release candidates included, keeps drawing the pet from the wheel's window pages over the adopted routes, so no shell draws two pets or loses a shortcut. The wheel app.json version moves to the pinned 0.1.1 (D12), and the owning specs record the adoption.
|
Catalog row: kirodotdev/KiroCrewApps#92 switches mochi to |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This adds one pin row the same way the existing pins do. It removes nothing from the code, and the visible change while Mochi is off is listed under compatibility as accepted. Notes
[DESIGN-REVIEWED] 70320fb Description read[DESCRIPTION-READ] 080bddef38f3cad0fa6b848bcd5105a2c82127ec5eda4b0aeffa9dad37ea87de 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 This adds the pin row that AGENTS.md requires for moving built-ins out of core (#26967), through the existing adoption mechanism. The version bump is what D12 requires, and the description states the one change a user can see. What this change shipsInventory (5 items) — 5 justifiedIntent: let hosts running the wheel copy of Mochi switch at restart to the app's own repository, so Mochi can leave core (an ADDITION, required by the documented no-built-in-apps migration).
[FIRST-PRINCIPLES-REVIEWED] 70320fb Description read[DESCRIPTION-READ] e6f88294fc871a6be41f1556f359a9522085998b2f8a257563ff130d82fe168a 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: |
Code change approver recommendation: A person should decideWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. Adds data only: a Mochi adoption pin row in adoption-pins.json and the matching test table entry, with the same shape as the 19 existing rows, plus the wheel copy's version bump to 0.1.1 that D12 requires (no test or code expects 0.1.0 for Mochi). Specs are updated in the same commit. The existing adoption machinery handles the state that matters: the per-session identity launch for built-in MCP servers is limited to records the built-in still owns, so core won't override the adopted copy's server launch; E10 accepts the tree's python launcher; the desktop shell reads only name and enabled, and with no desktop block hostOwnsAppWindows returns false, so every shell keeps exactly one pet and its shortcuts. CI and the review lanes are all green. The commit and the two SHA-256 values can't be checked offline, but the adoption gate re-checks the digests when it stages and applies the pin, so bad values would leave hosts on the wheel copy rather than corrupt anything. Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed head 70320fb. Recomputing the pin with the adoption pin tool at the pinned app commit gives the committed row byte for byte. Level 6 is refused and 7 is accepted, and the wheel copy's version now equals the pinned 0.1.1 (D12). The pinned manifest declares exactly the wheel copy's permissions, events, agents, skills and mochi MCP server name, with no cron, credential masks or desktop block, so E9 holds. Its backend route table matches the wheel's route for route. Every shipped shell from 0.12.x through the 0.13.0 candidates, the release branch and main reads only the record's name and enabled flag, or ignores a record with no desktop block, so each one keeps drawing a single built-in pet, panel and shortcuts. The adoption, Mochi and permission parity tests pass on this head, and I found no code error.
Problem / Motivation
Goal: A host that has Mochi as a built-in moves onto the app's own repository at its next restart, keeping its pet, its watch list, its plan, its pins, its memories, its settings, its grants and whether it was enabled, while every desktop app keeps showing exactly one pet with its shortcuts.
Mochi now lives in its own repository (
KiroCrewCaptain/kirocrew-app-mochi), ported from the current wheel copy, with green CI on ubuntu, macOS and Windows. It is the last built-in of #26967 without an adoption pin row, so no host adopts it and every Mochi fix keeps having to land twice.Why it matters
Until a pin row exists, Mochi cannot leave core: every host keeps running the wheel copy, and the removal of the built-ins in #26967 cannot finish.
Not a goal
scripts/adoption_pin.py, or the app's declared permissions.desktopblock; see below).src/kiro_crew/apps/builtins/mochi/,website/src/apps/mochi/,website/electron/mochi/); only itsapp.jsonversion moves.What changed (motivation → approach → change)
Mochi gets an adoption pin row, so at its next restart a host whose Mochi is the built-in switches to the app's own repository at the pinned commit, keeping
data/(the watch list, the plan, the pinned files, the stats, the settings with their colour maps, the imported packs), the approved grants (the three desktop capabilities included) andenabled. The row is the output ofscripts/adoption_pin.py compute, copied intoadoption-pins.jsonand the_SHIPPED_PINStable:minAppSdkLevel5db17b967894permissions.desktopCapabilities, kept from the wheel copy)computerefuses--min-sdk-level 6for this tree ("App Kit seam level 7, which the pinned tree uses (app.json permissions.desktopCapabilities)") and accepts 7, so 7 is the lowest level it takes. The tree declares nodesktop.windows, which the compute scan does not read, so nothing in the window grammar (app-kit-platform § 35, "Levelling") raises it. The wheel built-inapp.jsonversion moves to 0.1.1, since a first-adoption pin must equal it (D12); no wheel test pins the version. The repository declares the samepermissions, agents, skills andmochiMCP server name as the wheel copy (the server started from the tree,python3 backend/mcp_launch.py, the E10 shape), nocredentialMasks, no cron jobs and nodesktopblock, so E9 holds nothing back. The owning specs, app-kit-platform § 35 and mochi.md, record the adoption.App repo: KiroCrewCaptain/kirocrew-app-mochi@5db17b9
Wheel-copy base: mochi@5ec3b8167727fa2193a2de56c40ee20449469687
The repository was ported from
main5ec3b81677(its #1); no change has touched the wheel copy since, up to this PR's base. Its #2 makes the MCP launcher name the installed record's data home when the MCP host starts it without the gateway's environment (the built-in's launch pinnedKIROCREW_HOME; found by the smoke below), and #3 released 0.1.1 as5db17b967894.Why the adopted copy declares no
desktopblockA pin row ships in the wheel, so it reaches hosts in the next release, but a gateway installed separately, run as a service or reached over a tunnel follows its own updates, so a newer gateway can meet any desktop app a user still has. I loaded each desktop app's real
website/electron/mochi/index.jsreconcile and, where it has one, its realapp-window-host.js, in Node with Electron stubbed, against a loopback stand-in that answers/api/appswith the rows a gateway sends (the built-in record captured from a real gateway, and the adopted record with and without adesktopblock of the windows the app would declare), on the Linux and macOS code paths:desktop(this pin), ondesktop, ondisplays/gutter, so the same; a block without them: two petsrelease/0.13.0tipenabled)main(with #37454)With the app off, no desktop app draws anything in any column. A pin of a copy that declares
desktopis therefore not safe until a released shell carries #37454 and Mochi's reservation is handed over with{ app: true }; the copy pinned here declares none, and every shell draws exactly what it draws for the built-in record, from the window pages the wheel still ships at/app-windows/mochi/, over the adopted routes, which are the wheel copy's table. The middle column was re-run against the real/api/appsrows of the smoke gateway below (adopted on, adopted off) with the same result. What the later release needs is in the repository's PORTING.md and in § 35.Backwards compatibility
Compatible: one row is added and one version moves up. A host whose record is builtin-owned adopts at the next restart and keeps
data/, the grants andenabled; a host that cannot adopt (an SDK level below 7, a pending config review, a file besideapp.jsonthe tree does not ship) keeps the wheel copy unchanged. Every desktop app shows one pet with its shortcuts, as the table above shows.One difference a user can see, the one every adopted former built-in has: while Mochi is off,
/mochishows the dashboard's "Enable this app from Apps to use it" card for a disabled installed app instead of Mochi's own "Mochi is sleeping" landing (the dashboard mounts an installed app's page only while it is on).Removes nothing: the wheel copy, its window pages at
/app-windows/mochi/, its shell code, its/mochiroute and every existing pin row stay.Tests
test/test_builtin_adoption_pins.py::test_the_shipped_pin_file_validates_and_pins_exactly_the_shipped_tabletakes the new row and fails with the pin file ofmain;test_every_shipped_pin_matches_its_wheel_built_in_versionholds the version bump.Proof: PROVEN test/test_builtin_adoption_pins.py::test_the_shipped_pin_file_validates_and_pins_exactly_the_shipped_table (head 70320fb)
Determinism: no test logic changes, only the pinned data table. With this commit on
main1b6093307544(rebased since onto37911daad0, which brings nothing underapps/, the window host or Mochi's shell code), run serially with an isolated--basetemp: everytest/file and wheel-copy test that namesmochi,adoption_pinoradoption-pins(90 files:test_builtin_adoption_*.py,test_adopted_wheel_copy_check.py,test_adopted_apps_core_imports.py,test_app_agent_tools_adopted.py,test_mochi_*.pyandintegration/test_builtin_adoption_boot.pyamong them),test_legacy_state_moves.py,test_builtin_permission_parity.pyandtest_flake_pattern_ratchet.py: 4553 passed, 14 skipped. Black, isort, flake8, mypy, subprocess-encoding, comment-history, brand-name, line-cap and harness-parity gates andscripts/docs-lint.shpass..github/scripts/adopted_wheel_copy_check.pypasses on this body.website/electron:node --test test/app-window-*.test.js mochi/test/*.test.js test/mochi-session-token.test.js test/shell-shortcut-reservations.test.js: 432 pass, 0 fail.Manual verification
scripts/adoption_pin.py computeat5db17b967894with--min-sdk-level 7prints the committed row byte for byte, and with--min-sdk-level 6refuses it.scripts/adoption_pin.py verifyover the network: all twenty rowsok, this one included. The pinned commit is the head of the repository'smain, with every check run green on ubuntu, macOS and Windows.Upgrade smoke on isolated loopback gateways (throwaway
HOMEandKIROCREW_HOME, the mochi row asKIROCREW_HARNESS_ADOPTION_PINS, a real GitHub fetch, Kiro Crew's fake ACP backend). Each home was first booted onmain1b6093307544with the built-in, then this branch booted three times (STAGE, APPLY, no-op), once with Mochi enabled at the upgrade and once with it disabled:pin_filetoolstaged); the record stays the built-inorigin: registry, ledgeradopted, version 0.1.1,enabledkeptenabled: falsekept; routes 404 while off)desktopCapabilitiesGrantequal; no app crons before or after; nodesktopblock on the row; legacy nav/mochiwith theCatglyphdata/: every file kept; disabled at the upgrade: byte-equal to the seed/stats,/pet-state,/plan,/activity,/soul,/bg-usageanswer/mochi, the five window pages/app-windows/mochi/{pet,panel,settings,avatar,snip}.htmland the adopted page bundle loadmochi:*events reach a dashboard socket asapp_eventformochi(what the built-in windows read)mochi--mochi,mochi--mochi-bgand the default agent mountmochi:mochifrom the adopted tree's launcher; that launch, run with no gateway environment as an MCP host may, serves the eight tools andget_watchlistanswers the seeded itemsinstalled.jsonand the ledger byte-equal, nothing re-stageddata/(the owner loop's shutdown flush rewritesstats.json, and the gateway rewrites its dependency lock); after a restart no built-in comes backgitat this commit, the KiroCrewApps PR below, served in place of the catalog fetch): trust bound to the listed repository, install at the pinned commit (201), enable;data/equal to before the uninstall bar the reach policy the enable re-derives; the watch list is back; a restart shows one recordNo ERROR or traceback in any gateway's stderr. Not exercised headless: a real Electron desktop app drawing the pet over the adopted record (the shell's unit tests and the matrix above cover its decisions with Electron stubbed), and a real model behind Mochi's agents (the fake ACP backend runs no planner or watch check, so no plan was written).
Real-machine verification
Machine: author's Linux workstation, Amazon Linux 2023 x86_64, 32 vCPU / 123 GiB (no EC2 instance; the upgrade smoke above is the command)
Before (main 1b60933): seed a built-in Mochi (enabled) on a throwaway home, then boot the tree twice with the mochi rows of its own
adoption-pins.jsonas the pin table ->shipped mochi rows on this tree: 0,boot 1: origin=builtin ledger=None,boot 2: origin=builtin ledger=NoneAfter (head 70320fb): the same command on the head ->
shipped mochi rows on this tree: 1, the seed boot stages the pinned commit over a real GitHub fetch,boot 1: origin=registry ledger=adopted,boot 2: origin=registry ledger=adopted; the upgrade smoke above, every check PASSCleanup: own computer; every throwaway home, worktree and scratch directory deleted
Screenshots / video
N/A: the diff changes no
website/file and no rendered surface; the page a user sees after adoption is the pinned repository's, whose README carries the captured screenshots.Related Issues
Part of #26967
Catalog row: the kirodotdev/KiroCrewApps PR linked in a comment below switches mochi to
gitat the same commit. It is not auto-merged: it lands right after this PR.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.