Repository navigation
feat(pic): complete the canister settings and status, check the live spec - #309
Merged
Merged
Conversation
…spec The spec drift check read ic.did from dfinity/portal, which is archived, so it compared two frozen files. It now reads the live spec from dfinity/developer-docs, pinned to the version PicJS now matches. Canister settings gain minimumIncomingCanisterCallCycles and statusVisibility. canisterStatus returns every field of the spec, which PocketIC now returns: all settings, readyForMigration, version and memoryMetrics. One conversion of the settings to Candid replaces the field-by-field copies in createCanister, setupCanister and updateCanisterSettings.
3 tasks
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Aligns PocketIC’s canister settings and status handling with the live IC management-canister specification.
Changes:
- Updates spec drift checks and pinned revision.
- Adds minimum-cycle and visibility settings.
- Exposes complete status and memory metrics.
- Expands coverage for settings, status, and visibility behavior.
| File | Summary |
|---|---|
scripts/check-spec-drift.sh |
Uses the live IC specification source. |
packages/pic/tests/src/pocket-ic.spec.ts |
Tests settings, status, and visibility behavior. |
packages/pic/src/util/candid.ts |
Centralizes settings and visibility conversion. |
packages/pic/src/pocket-ic.ts |
Supports new settings and complete status decoding. |
packages/pic/src/pocket-ic-types.ts |
Exposes updated settings and status types. |
packages/pic/src/management-canister.ts |
Updates management-canister Candid definitions. |
.github/workflows/check-spec-drift.yml |
Updates the pinned specification revision. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Extracts the canister_status settings into DefiniteCanisterSettings.
lwshang
approved these changes
Sep 29, 2026
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.
Closes #298
Spec source
scripts/check-spec-drift.shreadic.didfromdfinity/portal, which is archived, so it could no longer report drift. It now reads the live spec,public/references/ic.didindfinity/developer-docs, pinned to707596d(2026-09-17). Checked: the new pin reports no drift, and the previousic.didrevision reports the newer additions.Canister settings and status
New settings
minimumIncomingCanisterCallCyclesandstatusVisibility, forcreateCanister,setupCanisterandupdateCanisterSettings.canisterStatusreturns every field of the spec'scanister_status:logMemoryLimit,snapshotVisibilityandstatusVisibility, which could be set but not read back;readyForMigration,versionandmemoryMetrics.The JSDoc said PocketIC didn't return some of these; decoding a live v16 response against the spec shows it returns all of them.
The settings were copied field by field in three methods, which is how some went missing from the status. One
canisterSettingsToIDLnow converts them, and one pair of helpers handles all three visibility settings.The status settings are a named
DefiniteCanisterSettingsinterface instead of an inline object. It has the same shape, so it's not breaking. Every field of the exported types inpocket-ic-types.tsnow has JSDoc, including the olderCanisterQueryStats,HttpsConfig,EnvironmentVariableand log filters.Not included
The spec version also adds the
patchHTTP method,pricing_versionand flexible HTTP outcalls. Those are outcall APIs and belong to #302. The pin comment notes it.Verified
pnpm test:pic(89 tests):statusVisibilitycontrols who can read it (rejected with "is not allowed to read the canister status" until it's public).pnpm format:check, and the Motoko examples locally. The Rust examples are left to CI.🤖 Generated with Claude Code