Skip to content

feat(pic): complete the canister settings and status, check the live spec - #309

Merged
marc0olo merged 2 commits into
mainfrom
feat/live-ic-spec
Sep 29, 2026
Merged

marc0olo merged 2 commits into
mainfrom
feat/live-ic-spec

Conversation

@marc0olo

@marc0olo marc0olo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #298

Spec source

scripts/check-spec-drift.sh read ic.did from dfinity/portal, which is archived, so it could no longer report drift. It now reads the live spec, public/references/ic.did in dfinity/developer-docs, pinned to 707596d (2026-09-17). Checked: the new pin reports no drift, and the previous ic.did revision reports the newer additions.

Canister settings and status

  • New settings minimumIncomingCanisterCallCycles and statusVisibility, for createCanister, setupCanister and updateCanisterSettings.

  • canisterStatus returns every field of the spec's canister_status:

    • all settings, including logMemoryLimit, snapshotVisibility and statusVisibility, which could be set but not read back;
    • readyForMigration, version and memoryMetrics.

    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 canisterSettingsToIDL now converts them, and one pair of helpers handles all three visibility settings.

  • The status settings are a named DefiniteCanisterSettings interface instead of an inline object. It has the same shape, so it's not breaking. Every field of the exported types in pocket-ic-types.ts now has JSDoc, including the older CanisterQueryStats, HttpsConfig, EnvironmentVariable and log filters.

Not included

The spec version also adds the patch HTTP method, pricing_version and flexible HTTP outcalls. Those are outcall APIs and belong to #302. The pin comment notes it.

Verified

  • pnpm test:pic (89 tests):
    • the settings test now reads back every setting it sets;
    • new tests check the complete status and that statusVisibility controls 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

…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.
Copilot AI lite review requested due to automatic review settings September 28, 2026 11:07
@marc0olo
marc0olo requested a review from a team as a code owner September 28, 2026 11:07

Copilot AI 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.

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.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The implementation consistently matches the described specification updates and includes focused integration coverage.

Review effort: Balanced
Findings: None

@marc0olo
marc0olo added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 4f5082f Sep 29, 2026
18 checks passed
@marc0olo
marc0olo deleted the feat/live-ic-spec branch September 29, 2026 08:48
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.

Check the management canister spec against its live source

3 participants