Spec: mops deployed command#560
Merged
Merged
Conversation
Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
…ig, partial tracking) Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
… (most + did) Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
…able [deployed].dir + warning) Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
…ops generate candid` for interface files The two file types have distinct lifecycles and consumers — coupling them under one command was muddying the model: - `.most` is a post-deploy snapshot consumed by `mops check-stable`; its reference must advance exactly when a deploy succeeds. `mops deployed` is now a focused post-deploy hook the user (or icp-cli `sync`) calls to promote the just-built `.most` into a committed reference path, plus `mops deployed init` for first-time baseline + check-stable wiring. No `--check`, no `status`, no `.did` handling. - `.did` is a build-input contract: `mops build` subtype-checks against it and embeds it into the wasm; `@icp-sdk/bindgen` reads the same file for frontend bindings. Refresh is interface-change-driven, not deploy-driven. New `mops generate candid <canister>` (noun-namespace, extensible to future generators) (re)generates the curated `.did` from source via `moc --idl`, optionally setting `[canisters.<name>].candid` on first use. Default destination is next to `main`. Drift detection flagged as a follow-up extension of `mops check`. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Cursor AI review👍 APPROVE — looks safe to merge
VerdictDecision: APPROVE Generated for commit 990dce5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal spec for a new
mops deployedcommand group that produces the committed deployed snapshot (.most+.did) for a Motoko canister.Why
mops buildemits<name>.wasm,<name>.did,<name>.mostfrom one compilation. The wasm is deployed; the other two must be committed as the deployed snapshot:.most— consumed bymops check-stableto guard upgrades against state loss; must match what's on-chain..did— a committed record of the deployed interface for icp tooling (@icp-sdk/bindgen,icp canister call) and the repo. Not consumed by mops — placed at the icp-cli team's request.Today this is copied by hand after deploy; forgetting it means the snapshot drifts from on-chain reality. This enables the in-progress icp-cli Motoko recipe to snapshot both files in its post-install
syncphase, reusing the exact artifacts that produced the deployed wasm.Key decisions
update, notsync—syncis taken (deps reconciliation) and clashes withicp's sync phase; the action is advancing a snapshot forward.mops buildoutput so the snapshot can't decouple from the deployed wasm.[deployed].dir, defaultdeployed/,--diroverride) is the only thing that determines output paths. Both.mostand.didgo to<dir>/<name>.*.check-stable.path—mops deployednever reads it.initpoints[check-stable].pathat<dir>/<name>.mostso the fileupdatewrites is the filecheck-stablereads. If a user points it elsewhere,update/initwarn (no hard coupling)..didis a pure output artifact — mops doesn't consume it; no Candid compat check (check-candiddeferred).--no-didopts out.candidfield is ignored — it's a curated ahead-of-code interface that the build embeds; the snapshot is a generated lags-code record (see spec appendix).initconfiguresmops.toml— writes the empty-actor.mostbaseline and setscheck-stable.pathto coincide; no.didbaseline needed. Flags the whole-file TOML rewrite caveat.mops build/mops check(no arg = all; named = strict).updatedoesn't requirecheck-stableconfigured. Multi-canistericpdeploys work becauseicpexpands the recipe per canister.Design proposal only — no implementation. Open questions: directory config surface (global vs per-canister), per-environment snapshots, future
check-candid, optional deployed manifest.