@engramx/idl 0.16.1 → 0.17.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engram.did +1184 -1508
- package/dist/engram.idl.d.ts +1170 -1496
- package/dist/market.did +257 -309
- package/dist/market.idl.d.ts +257 -309
- package/dist/registry.did +703 -849
- package/dist/registry.idl.d.ts +695 -841
- package/package.json +1 -1
package/dist/registry.did
CHANGED
|
@@ -687,19 +687,17 @@ service : {
|
|
|
687
687
|
/// docs/ENCRYPTION-OPERATIONS.md, "Canister-id binding"). Abandoning is starting over, not
|
|
688
688
|
/// migrating, and the caller must be told so before they do it.
|
|
689
689
|
///
|
|
690
|
-
///
|
|
691
|
-
///
|
|
692
|
-
///
|
|
693
|
-
///
|
|
694
|
-
///
|
|
695
|
-
///
|
|
696
|
-
///
|
|
697
|
-
///
|
|
698
|
-
/// engram runs.
|
|
690
|
+
/// REFUSED for an engram opened through another: it is never abandoned, so it stays on this
|
|
691
|
+
/// registry's security updates for life; it ends by its parent's cut-off or by running dry.
|
|
692
|
+
///
|
|
693
|
+
/// WITHDRAW YOUR DIGITAL DOLLARS FIRST. Nobody pays for an abandoned engram, and it is not
|
|
694
|
+
/// recoverable: when its compute runs out it stops, and the network erases it about 30 days
|
|
695
|
+
/// later. An abandoned engram is never recovered once it is erased (`recoverMyEngram` refuses it,
|
|
696
|
+
/// and the biller refuses its top-ups), so whatever its wallet still holds then stays at its address
|
|
697
|
+
/// with no program that can move it. Withdraw it while the engram runs.
|
|
699
698
|
abandonMyEngram: () -> (Result);
|
|
700
|
-
///
|
|
701
|
-
///
|
|
702
|
-
/// `acceptedAtNs`.
|
|
699
|
+
/// THE NAMED PRINCIPAL ACCEPTS AN ENGRAM OFFERED TO THEM, as themselves. This is the registry's
|
|
700
|
+
/// only evidence that they agreed, and the only writer of `acceptedAtNs`.
|
|
703
701
|
///
|
|
704
702
|
/// IT STILL MOVES NOTHING. It marks the offer accepted; the record and control of the code move
|
|
705
703
|
/// when the caller then calls `acceptOwnership` on the engram, which reports here
|
|
@@ -715,8 +713,8 @@ service : {
|
|
|
715
713
|
addAuditViewer: (viewer: principal) -> (Result);
|
|
716
714
|
/// Add a changelog entry (admin only)
|
|
717
715
|
addChangelogEntry: (version: text, releaseNotes: text) -> (Result);
|
|
718
|
-
///
|
|
719
|
-
///
|
|
716
|
+
/// The CALLER appends one dated statement to ITS OWN track record. Nothing is deleted, and nobody
|
|
717
|
+
/// adjudicates.
|
|
720
718
|
///
|
|
721
719
|
/// AGENT-ONLY BY CONSTRUCTION: the record written is `msg.caller`'s, so nobody can write to
|
|
722
720
|
/// another agent's record, and a caller with no recorded engagement is REFUSED (there is no record
|
|
@@ -728,9 +726,9 @@ service : {
|
|
|
728
726
|
/// dispute exists and its day; the statement's words stay out of it, readable by the agent through
|
|
729
727
|
/// `listMyAgentDisputes`. The append is recorded in the chained audit log (length, not words).
|
|
730
728
|
///
|
|
731
|
-
///
|
|
732
|
-
///
|
|
733
|
-
///
|
|
729
|
+
/// The caller is the agent's ROOT key — records are kept per agent (one root key per agent, with an
|
|
730
|
+
/// enrolled key per client), so a key for one engram has no record here and is refused like any
|
|
731
|
+
/// stranger. Disputing is the root's act, not an engram key's.
|
|
734
732
|
appendAgentDispute: (statement: text) -> (Result);
|
|
735
733
|
/// Take sole custody of your engram: the registry REMOVES ITSELF as a controller, leaving the
|
|
736
734
|
/// owner and the engram canister itself, and your update preference becomes `#ManualOnly`.
|
|
@@ -748,12 +746,12 @@ service : {
|
|
|
748
746
|
/// `returnToManaged` adds the registry back ALONGSIDE the owner. Sovereignty is a door, not a
|
|
749
747
|
/// cliff.
|
|
750
748
|
///
|
|
751
|
-
///
|
|
752
|
-
///
|
|
749
|
+
/// REFUSED for an engram opened through another: it stays managed by this registry for life, and
|
|
750
|
+
/// its key is never a controller.
|
|
753
751
|
claimSovereignty: () -> (Result);
|
|
754
|
-
///
|
|
755
|
-
///
|
|
756
|
-
///
|
|
752
|
+
/// The named principal declines an offer, or takes back an acceptance made before
|
|
753
|
+
/// `acceptOwnership` was called on the engram. The row is removed, so a report of that change of
|
|
754
|
+
/// owner is refused until the engram's owner offers again.
|
|
757
755
|
declineEngramOffer: (engram: principal) -> (Result);
|
|
758
756
|
/// Assemble the pushed chunks into the engram template and install it as the current one.
|
|
759
757
|
///
|
|
@@ -770,10 +768,10 @@ service : {
|
|
|
770
768
|
engramWasmFinalize: (hash: text) -> (Result_7);
|
|
771
769
|
/// Chunked WASM upload — for WASMs that exceed single-call ingress limits.
|
|
772
770
|
/// Flow: engramWasmInit → engramWasmPushChunk (×N) → engramWasmFinalize(hash)
|
|
773
|
-
///
|
|
774
|
-
///
|
|
775
|
-
///
|
|
776
|
-
///
|
|
771
|
+
/// This line is the only written record of the upload protocol, and the hand-IDL client that follows
|
|
772
|
+
/// it (scripts/upload-engram-wasm.mjs) must name the same three methods: when the line and the
|
|
773
|
+
/// script named the methods' pre-0.16.0 names, the upload died at its first call with IC0536. A
|
|
774
|
+
/// stale flow comment is not cosmetic here.
|
|
777
775
|
engramWasmInit: () -> (Result);
|
|
778
776
|
/// Push one chunk of a chunked template upload started by `engramWasmInit`. Returns the running
|
|
779
777
|
/// chunk count. WASM-admin only, like every step of this family.
|
|
@@ -799,34 +797,27 @@ service : {
|
|
|
799
797
|
/// its LIVE freezing reservation, which is memory-scaled, so a large engram can be low at a
|
|
800
798
|
/// balance a small one would be comfortable at.
|
|
801
799
|
///
|
|
802
|
-
///
|
|
803
|
-
///
|
|
804
|
-
///
|
|
805
|
-
///
|
|
806
|
-
///
|
|
807
|
-
/// `listEngrams` settled at its own declaration).
|
|
808
|
-
///
|
|
809
|
-
/// ⟨Marker added 2026-08-23. The 0.16.0 interface plan's row for this method already cited the
|
|
810
|
-
/// update-for-read rule and
|
|
811
|
-
/// the site did not carry it — invisible to the deploying side's update-for-read check, whose
|
|
812
|
-
/// population is read-VERB names and this one is a noun. That check now reads the plan's
|
|
813
|
-
/// update-for-read citations as a second population for exactly this blind spot.⟩
|
|
800
|
+
/// UPDATE, NOT QUERY, for two reasons, stated here rather than left to be inferred from a body
|
|
801
|
+
/// that scans a fleet. It awaits `ic.canister_status` once per engram in the page, so no query
|
|
802
|
+
/// could produce the figures at all; and it calls `denied()` on refusal, a state write a query
|
|
803
|
+
/// cannot perform, so making it a query would also retire the record of who was turned away (the
|
|
804
|
+
/// refusal-over-fabrication class, the same one `listEngrams` settled at its own declaration).
|
|
814
805
|
fleetCycleHealth: (offset: nat, limit: nat, thresholdCycles: nat) ->
|
|
815
806
|
(Result_31);
|
|
816
|
-
/// PUBLIC:
|
|
817
|
-
///
|
|
807
|
+
/// PUBLIC: `fleetSummary` — the ONE public projection of this registry (since 0.16.0: same concept,
|
|
808
|
+
/// same name across canisters), replacing `status()` and ABSORBING `publicMetrics()`.
|
|
818
809
|
///
|
|
819
810
|
/// Two public aggregates of one canister was the same naming defect the engram had with
|
|
820
811
|
/// status()/metrics(): both answered "what is this registry like", they disagreed about which
|
|
821
812
|
/// counters they carried (status had cycles and the wasm hash, publicMetrics had unique owners,
|
|
822
813
|
/// sovereign engrams and registrySince), and a caller had to know which one held the field they
|
|
823
|
-
/// wanted.
|
|
814
|
+
/// wanted.
|
|
824
815
|
///
|
|
825
816
|
/// Merged, not concatenated: `totalEngrams` and `activeEngrams` appeared in BOTH and are counted
|
|
826
817
|
/// once here, by the same pass.
|
|
827
818
|
///
|
|
828
819
|
/// Everything in it identifies nobody — counts, a version, a hash, a cycle balance — which is why
|
|
829
|
-
/// it is ungated
|
|
820
|
+
/// it is ungated.
|
|
830
821
|
fleetSummary: () -> (FleetSummary) query;
|
|
831
822
|
/// When an engram was abandoned, if it was.
|
|
832
823
|
///
|
|
@@ -847,31 +838,26 @@ service : {
|
|
|
847
838
|
/// PUBLIC: who holds authority here. A refusal a caller cannot attribute is a refusal they
|
|
848
839
|
/// cannot appeal, so the roster is readable by everyone the roster can refuse.
|
|
849
840
|
///
|
|
850
|
-
///
|
|
851
|
-
///
|
|
852
|
-
///
|
|
853
|
-
///
|
|
854
|
-
///
|
|
855
|
-
///
|
|
856
|
-
/// means one reader answers the question fleet-wide.
|
|
841
|
+
/// The shared `AdminRoles` shape (since 0.16.0: same concept, same name across canisters), not a
|
|
842
|
+
/// registry-specific record. It was `{ admin; wasmAdmin }`, which could not express the ROOT
|
|
843
|
+
/// identity at all — the principal that bootstraps the first admin and can reclaim the role was
|
|
844
|
+
/// simply absent from the published answer, so "who can take this canister back" was a fact only
|
|
845
|
+
/// the source told you. A list of (role, holder) carries every authority this canister has, and the
|
|
846
|
+
/// same shape on every canister means one reader answers the question fleet-wide.
|
|
857
847
|
getAdminRoles: () -> (AdminRoles) query;
|
|
858
|
-
/// PUBLIC:
|
|
848
|
+
/// PUBLIC: renamed from `operatorEdgeStats` in 0.16.0, and the GATE IS DROPPED.
|
|
859
849
|
///
|
|
860
850
|
/// The old refusal existed because a ZEROED aggregate reads as "no agent runs any engram" — a
|
|
861
|
-
/// growth figure
|
|
862
|
-
///
|
|
863
|
-
///
|
|
864
|
-
///
|
|
865
|
-
/// the
|
|
866
|
-
///
|
|
867
|
-
///
|
|
868
|
-
///
|
|
869
|
-
///
|
|
870
|
-
///
|
|
871
|
-
/// ⟨CORRECTED 2026-09-29: one name for one thing — both fields are renamed.⟩
|
|
872
|
-
/// · `agents` (was `distinctOperators`): agents, by root key, with at least one live
|
|
873
|
-
/// engagement. The old name was kept for a hand-written reader outside this repo, which has
|
|
874
|
-
/// since had to translate it back to "agents" in two places.
|
|
851
|
+
/// growth figure a dashboard renders as fact — and an unreadable aggregate must show as UNKNOWN,
|
|
852
|
+
/// never as zero. That reasoning was right about the danger and wrong about the remedy: two counts
|
|
853
|
+
/// that name nobody are not a disclosure, and gating them created the very unreadable-aggregate
|
|
854
|
+
/// problem the comment was worried about. Answering everyone removes both the fabricated zero AND
|
|
855
|
+
/// the need to distinguish it from a real one.
|
|
856
|
+
///
|
|
857
|
+
/// One name for one thing:
|
|
858
|
+
/// · `agents` (was `distinctOperators`): distinct agents, by root key, with at least one live
|
|
859
|
+
/// engagement. The index is keyed by root (one root key per agent, with an enrolled key per
|
|
860
|
+
/// client), so an agent on twenty-five engrams counts once.
|
|
875
861
|
/// · `liveEngagements` (was `totalEdges`): agent–engram engagements live NOW, one per agent
|
|
876
862
|
/// per engram. "Total" read as all-time, but an engagement leaves this count the moment it
|
|
877
863
|
/// ends (the live index forgets it; the agent's record keeps it — `getAgentStanding`), and
|
|
@@ -882,9 +868,8 @@ service : {
|
|
|
882
868
|
agents: nat;
|
|
883
869
|
liveEngagements: nat;
|
|
884
870
|
}) query;
|
|
885
|
-
///
|
|
886
|
-
///
|
|
887
|
-
/// day of the first engagement, and whether (and on what day) the agent disputed it.
|
|
871
|
+
/// ONE AGENT'S CERTIFIED TRACK RECORD — counts by ending reason, live engagements, the day of the
|
|
872
|
+
/// first engagement, and whether (and on what day) the agent disputed it.
|
|
888
873
|
///
|
|
889
874
|
/// SERVES THE STORED BYTES, on the `getCertifiedAnchor` pattern: the leaf is decoded from exactly
|
|
890
875
|
/// what `putStandingLeaf` certified, so what is served equals what is proven by construction.
|
|
@@ -894,52 +879,50 @@ service : {
|
|
|
894
879
|
/// was meant to replace, so there is no role gate. But a record spanning fewer than
|
|
895
880
|
/// `Engagements.STANDING_MIN_DISTINCT_ENGRAMS` distinct engrams is served ONLY to the agent itself:
|
|
896
881
|
/// at one or two engrams the summary IS their owners' experience, which is identification by
|
|
897
|
-
/// inference (
|
|
898
|
-
///
|
|
899
|
-
///
|
|
900
|
-
///
|
|
901
|
-
///
|
|
902
|
-
///
|
|
903
|
-
///
|
|
904
|
-
///
|
|
905
|
-
///
|
|
906
|
-
///
|
|
907
|
-
///
|
|
908
|
-
///
|
|
909
|
-
///
|
|
910
|
-
///
|
|
911
|
-
/// as one with the engrams it replaced. The refusal's sentence says so.
|
|
882
|
+
/// inference (the project's own reading of the law, not legal advice). That refusal is LOUD, names
|
|
883
|
+
/// this method, and covers a record of zero engagements with the same words, so the refusal itself
|
|
884
|
+
/// does not distinguish "never engaged" from "engaged in one to four engrams". The agent itself
|
|
885
|
+
/// reading an empty record gets `#NotFound` — it is asking about itself, so there is nothing to hide
|
|
886
|
+
/// from it.
|
|
887
|
+
///
|
|
888
|
+
/// A THIN SELF-READ IS UNCERTIFIED: below the threshold the record is not in the certified tree at
|
|
889
|
+
/// all (its hash would leak it through every other witness), so the agent is served its summary
|
|
890
|
+
/// folded from the records, with `certificate = null` and an empty `witness`. At and above the
|
|
891
|
+
/// threshold every reader gets the stored bytes with their proof.
|
|
892
|
+
///
|
|
893
|
+
/// The threshold counts TOPS, not engrams (`Engagements.distinctTops`): engrams opened from one
|
|
894
|
+
/// engram count as one, and an engram counts as one with the engrams it replaced. The refusal's
|
|
895
|
+
/// sentence says so.
|
|
912
896
|
///
|
|
913
897
|
/// WHAT IT NEVER DOES: score, rank, recommend, or refuse anyone work. The decision to refuse an
|
|
914
|
-
/// agent belongs to the owner's own engram
|
|
915
|
-
///
|
|
916
|
-
///
|
|
917
|
-
///
|
|
918
|
-
///
|
|
919
|
-
///
|
|
920
|
-
///
|
|
921
|
-
///
|
|
922
|
-
///
|
|
923
|
-
///
|
|
924
|
-
///
|
|
925
|
-
///
|
|
926
|
-
///
|
|
927
|
-
///
|
|
928
|
-
/// is
|
|
929
|
-
///
|
|
930
|
-
/// record of its own here; asking about one gets the refusal or, from the key itself, `#NotFound`.
|
|
898
|
+
/// agent belongs to the owner's own engram.
|
|
899
|
+
///
|
|
900
|
+
/// COUNTS, NOT INDEPENDENCE — READ THIS BEFORE TRUSTING A RECORD. The certificate proves that this
|
|
901
|
+
/// registry holds these counts for this agent. It does NOT prove that the engrams behind them belong
|
|
902
|
+
/// to different people. The registry links two engrams only through a parent or a predecessor;
|
|
903
|
+
/// engrams opened under separate principals are unlinked, and one party can open several. So one
|
|
904
|
+
/// party can give its own agent a certified record with no one else involved (a run on PocketIC on
|
|
905
|
+
/// 2026-11-15 showed it: a stranger was refused at one engram, and served a certified record of five
|
|
906
|
+
/// live engagements and no bad endings once four more engrams, opened under four other principals,
|
|
907
|
+
/// had paired the same root). The five-engram threshold is a privacy floor, never a defence against
|
|
908
|
+
/// a made-up record. A reader must not take these counts as other owners' experience of the agent.
|
|
909
|
+
///
|
|
910
|
+
/// `agent` is the agent's ROOT principal (one root key per agent, with an enrolled key per client)
|
|
911
|
+
/// — the identity an owner sees as `root` on each key in their own `listAgents`. "The agent itself"
|
|
912
|
+
/// is a caller holding that root key. A key for one engram has no record of its own here; asking
|
|
913
|
+
/// about one gets the refusal or, from the key itself, `#NotFound`.
|
|
931
914
|
getAgentStanding: (agent: principal) -> (Result_30) query;
|
|
932
915
|
/// Fleet-wide anchoring liveness. Exists because ABSENCE is otherwise uninformative: an engram
|
|
933
916
|
/// that never wrote, one still on a template without the push, and one whose push is broken all
|
|
934
|
-
/// render as an empty
|
|
935
|
-
/// dead push looks exactly like a quiet engram
|
|
917
|
+
/// render as an empty `listAnchors`. Nothing distinguishes the first from the third, so a silently
|
|
918
|
+
/// dead push looks exactly like a quiet engram.
|
|
936
919
|
///
|
|
937
920
|
/// A non-zero engramsAnchored with a recent lastAnchorAtNs is positive evidence that the path is
|
|
938
921
|
/// alive SOMEWHERE, which is what makes an individual engram's silence interpretable.
|
|
939
922
|
///
|
|
940
923
|
/// PUBLIC: the same reader who needs the anchors needs to know whether to believe their absence.
|
|
941
924
|
///
|
|
942
|
-
///
|
|
925
|
+
/// The ring also holds the TREASURY ANCHORER's chain (`getTreasuryAnchorId`), and
|
|
943
926
|
/// `engramsAnchored`, `totalAnchors` and `lastAnchorAtNs` count it as one more chain. The
|
|
944
927
|
/// engram-only pair leaves it out: `engramChainsAnchored` (always present on a registry that
|
|
945
928
|
/// serves it, 0 when no engram has anchored) and `lastEngramAnchorAtNs`. Read those to ask
|
|
@@ -953,24 +936,25 @@ service : {
|
|
|
953
936
|
/// decode with to_candid's standard encoding) carries the anchor AND its conflict count, so the
|
|
954
937
|
/// certified answer is self-contained: a verifier learns "this head, at this count, disputed or
|
|
955
938
|
/// not" from subnet-signed data alone. null = no anchor witnessed (which getAnchorStats makes
|
|
956
|
-
/// interpretable). Same verification recipe as
|
|
939
|
+
/// interpretable). Same verification recipe as `getCertifiedAuditHead`, path ["anchors", <principal>].
|
|
957
940
|
///
|
|
958
941
|
/// PUBLIC: a proof a caller must be authorized to fetch rests on the authority it was meant to
|
|
959
942
|
/// replace. The certificate's whole value is that a stranger can check it against the NNS root
|
|
960
943
|
/// key without trusting this registry, and a stranger is exactly who cannot hold a role here.
|
|
961
944
|
getCertifiedAnchor: (canisterId: principal) -> (opt CertifiedAnchor) query;
|
|
962
|
-
///
|
|
945
|
+
/// Named `getCertifiedAuditHead` on every chain canister (same concept, same name; renamed back to
|
|
946
|
+
/// it in 0.16.0).
|
|
963
947
|
///
|
|
964
|
-
/// It
|
|
965
|
-
/// changed (certified_data became a merkle tree root covering the head AND the anchor set,
|
|
966
|
-
/// old certified_data == headHash byte-compare was gone), and a loud method-not-found was
|
|
967
|
-
/// better than a stale verifier quietly reporting verified=false forever.
|
|
948
|
+
/// It had been renamed AWAY from that on 2026-08-03, deliberately and for a good reason: the
|
|
949
|
+
/// semantics changed (certified_data became a merkle tree root covering the head AND the anchor set,
|
|
950
|
+
/// so the old certified_data == headHash byte-compare was gone), and a loud method-not-found was
|
|
951
|
+
/// judged better than a stale verifier quietly reporting verified=false forever.
|
|
968
952
|
///
|
|
969
|
-
///
|
|
970
|
-
/// at the 0.16.0 genesis
|
|
971
|
-
/// the same question under two names, which is the cost the rename was paying to
|
|
972
|
-
/// that no longer
|
|
973
|
-
/// canister has no witness to give, rather than an empty blob that decodes as one.
|
|
953
|
+
/// That argument's premise did not survive 0.16.0. It protected deployed verifiers, and every chain
|
|
954
|
+
/// restarted fresh at the 0.16.0 genesis, so there were none. What remained was a fleet where three
|
|
955
|
+
/// canisters answered the same question under two names, which is the cost the rename was paying to
|
|
956
|
+
/// avoid a hazard that no longer existed. `witness` is `?Blob` to match the shared type — null where
|
|
957
|
+
/// a canister has no witness to give, rather than an empty blob that decodes as one.
|
|
974
958
|
///
|
|
975
959
|
/// Verify: (1) validate `certificate` against the IC root key; (2) extract
|
|
976
960
|
/// /canister/<id>/certified_data from it; (3) reconstruct the root of `witness` (IC-spec hash
|
|
@@ -982,9 +966,8 @@ service : {
|
|
|
982
966
|
/// instead of trusting this replica, and a proof that requires a role to fetch rests on exactly
|
|
983
967
|
/// the authority it was introduced to remove.
|
|
984
968
|
getCertifiedAuditHead: () -> (CertifiedAuditHead) query;
|
|
985
|
-
/// The certified proof that a birth record's FINGERPRINT is in this registry's tree
|
|
986
|
-
///
|
|
987
|
-
/// — the half of an engram's birth chain the engram cannot give itself.
|
|
969
|
+
/// The certified proof that a birth record's FINGERPRINT is in this registry's tree — the half of
|
|
970
|
+
/// an engram's birth chain the engram cannot give itself.
|
|
988
971
|
///
|
|
989
972
|
/// PUBLIC: a proof a caller had to hold a role to fetch rests on the authority it was meant to
|
|
990
973
|
/// replace. It reveals only whether a fingerprint is present: the key is a salted hash (the record's
|
|
@@ -994,27 +977,24 @@ service : {
|
|
|
994
977
|
///
|
|
995
978
|
/// Verify as for `getCertifiedAnchor`, path ["births", <fingerprint>], leaf bytes = [0x01] (the
|
|
996
979
|
/// client's `verifyBirthChain` does it for a whole chain). `null` when absent, as `getCertifiedAnchor`
|
|
997
|
-
/// answers: there is no certified absence proof (a build choice
|
|
980
|
+
/// answers: there is no certified absence proof (a build choice, not a requirement). A
|
|
998
981
|
/// `fingerprint` that is not 32 bytes is never a fingerprint, and answers `null` before the lookup.
|
|
999
982
|
getCertifiedBirth: (fingerprint: blob) -> (opt CertifiedBirth) query;
|
|
1000
|
-
///
|
|
1001
|
-
///
|
|
1002
|
-
///
|
|
1003
|
-
///
|
|
1004
|
-
///
|
|
1005
|
-
///
|
|
1006
|
-
/// absent, so the read never discloses a key file's principal); whether the parent is a first
|
|
1007
|
-
/// engram; and whether it is registered, `#Active` and not abandoned (`isRegisteredActiveEngram`'s
|
|
1008
|
-
/// rule).
|
|
983
|
+
/// WHAT THE KIT OFFERS AS A NEW ENGRAM'S SIGN-IN, read before it opens one through `parent`. The
|
|
984
|
+
/// answer: the parent's owner — ONLY when the parent is a first engram (the kit offers that
|
|
985
|
+
/// principal as the default sign-in only then, after it prints it and the person running the agent
|
|
986
|
+
/// confirms it is theirs; for a parent opened through another the field is absent, so the read never
|
|
987
|
+
/// discloses a key file's principal); whether the parent is a first engram; and whether it is
|
|
988
|
+
/// registered, `#Active` and not abandoned (`isRegisteredActiveEngram`'s rule).
|
|
1009
989
|
///
|
|
1010
990
|
/// CALLER: a lasting key with a LIVE engagement with `parent` at this registry, in either store
|
|
1011
991
|
/// (`Engagements.hasOpenEither` — the same fact `sysOpenChild`'s admission reads, so exactly the
|
|
1012
992
|
/// keys that may be opened an engram through `parent` may read what it offers). It discloses the
|
|
1013
993
|
/// parent's owner to the parent's own engaged agent, the party `getParentOf` answers once the child
|
|
1014
|
-
/// exists. Anyone else is REFUSED loudly (refusal over fabrication), in the same words whether or
|
|
1015
|
-
/// an engram, so a refusal tells a stranger nothing. A QUERY, so the refusal is not
|
|
1016
|
-
/// log (`denied` says why a query cannot write). `#NotFound` only to an engaged
|
|
1017
|
-
/// parent this registry holds no owner for.
|
|
994
|
+
/// exists. Anyone else is REFUSED loudly (refusal over fabrication), in the same words whether or
|
|
995
|
+
/// not `parent` is an engram, so a refusal tells a stranger nothing. A QUERY, so the refusal is not
|
|
996
|
+
/// in the denial log (`denied` says why a query cannot write). `#NotFound` only to an engaged
|
|
997
|
+
/// caller, for a parent this registry holds no owner for.
|
|
1018
998
|
/// Called by: the owner kit's opening of an engram through a parent, signed by the agent's lasting
|
|
1019
999
|
/// key, before it names the new engram's sign-in.
|
|
1020
1000
|
getChildSignInOffer: (parent: principal) -> (Result_29) query;
|
|
@@ -1025,35 +1005,32 @@ service : {
|
|
|
1025
1005
|
/// `GET /oauth/authorize` target with what its registry hands out. PUBLIC: an origin is not a secret,
|
|
1026
1006
|
/// and every owner of this deployment is sent there.
|
|
1027
1007
|
getConsentOrigin: () -> (opt text) query;
|
|
1028
|
-
/// The ATTESTABLE custody-mode fact
|
|
1029
|
-
///
|
|
1030
|
-
///
|
|
1031
|
-
///
|
|
1032
|
-
///
|
|
1033
|
-
///
|
|
1034
|
-
///
|
|
1035
|
-
///
|
|
1036
|
-
///
|
|
1037
|
-
///
|
|
1038
|
-
///
|
|
1039
|
-
///
|
|
1040
|
-
///
|
|
1041
|
-
///
|
|
1042
|
-
///
|
|
1043
|
-
///
|
|
1044
|
-
///
|
|
1045
|
-
/// is not a mode at all — it is this registry declining to make a claim about a canister it did
|
|
1046
|
-
/// not spawn, which is a different kind of answer and now looks like one.
|
|
1047
|
-
///
|
|
1048
|
-
/// Derived from records, never probed: a canister_status call would trap for exactly the
|
|
1049
|
-
/// canisters we are not the controller of, i.e. the sovereign ones this read exists to identify.
|
|
1008
|
+
/// The ATTESTABLE custody-mode fact, derived from the registry's OWN transition records
|
|
1009
|
+
/// (`claimSovereignty` / `returnToManaged` maintain `sovereignEngramIds`) — NOT from the network:
|
|
1010
|
+
/// `probeCustodyMode` is the live read, and differs from this one when an owner changed the
|
|
1011
|
+
/// controllers by hand.
|
|
1012
|
+
///
|
|
1013
|
+
/// PUBLIC: free and ungated, for good. Custody mode is a trust fact a proof about an engram
|
|
1014
|
+
/// carries: managed = the registry's operator can warrant its own controller conduct; sovereign =
|
|
1015
|
+
/// registry-side facts only. (Money-origin, by contrast, is payer-blind and never a record fact.)
|
|
1016
|
+
///
|
|
1017
|
+
/// Custody is a VARIANT (since 0.16.0): `CustodyMode` is `#Managed | #Sovereign`, and the no-claim
|
|
1018
|
+
/// case answers `#Err(#NotFound)`, saying WHY rather than being a third string. "unknown" as text
|
|
1019
|
+
/// sat beside "sovereign" and "managed" as if it were a third custody mode. It is not a mode at all
|
|
1020
|
+
/// — it is this registry declining to make a claim about a canister it did not spawn, which is a
|
|
1021
|
+
/// different kind of answer and now looks like one.
|
|
1022
|
+
///
|
|
1023
|
+
/// Derived from records, never probed: a query makes no call, so it answers for any canister this
|
|
1024
|
+
/// registry spawned at no cost to anyone.
|
|
1050
1025
|
getCustodyMode: (canisterId: principal) -> (Result_11) query;
|
|
1051
|
-
/// Cycles-health probe —
|
|
1052
|
-
///
|
|
1026
|
+
/// Cycles-health probe — the registry's own cycle balance and its operating-reserve floor, nothing
|
|
1027
|
+
/// else (money is the biller's, cycles are the registry's). `scripts/audit-chain/health-alert.mjs
|
|
1028
|
+
/// --canister <registry id>` reads it and exits non-zero when the balance is under the floor, or
|
|
1029
|
+
/// close to it.
|
|
1053
1030
|
///
|
|
1054
1031
|
/// PUBLIC: whether this registry can still afford to spawn is a fact every prospective owner
|
|
1055
|
-
/// depends on and none of them can otherwise observe. Cycles only, by construction
|
|
1056
|
-
///
|
|
1032
|
+
/// depends on and none of them can otherwise observe. Cycles only, by construction: the money is on
|
|
1033
|
+
/// the biller, so there is no balance here to withhold.
|
|
1057
1034
|
getCycleReserveStatus: () ->
|
|
1058
1035
|
(record {
|
|
1059
1036
|
cycleBalance: nat;
|
|
@@ -1063,37 +1040,32 @@ service : {
|
|
|
1063
1040
|
/// fact (its assignment is in the hash-chained audit log). null = spawned before numbering
|
|
1064
1041
|
/// existed, or by another registry.
|
|
1065
1042
|
///
|
|
1066
|
-
/// ⟨0.16.0, the vocabulary ruling of 2026-08-17⟩ RENAMED from `sysEngramNumberOf`. The `sys` prefix names
|
|
1067
|
-
/// the CALLER TIER a method was built for, and this one was never gated — it is a bare public
|
|
1068
|
-
/// query, as the line above says. A prefix that reads as an authorization claim while carrying
|
|
1069
|
-
/// none is worse than no prefix: it invites a reader to assume a gate that does not exist, and
|
|
1070
|
-
/// a disclosure sweep grepping `sys*` would have counted this as tiered surface it is not.
|
|
1071
|
-
///
|
|
1072
1043
|
/// PUBLIC: the spawn ordinal is a permanent, dual-recorded fact about an engram that its owner
|
|
1073
1044
|
/// publishes by existing — engram #7 is #7 to everyone. It identifies a canister, never a person.
|
|
1074
1045
|
///
|
|
1075
|
-
///
|
|
1076
|
-
///
|
|
1077
|
-
///
|
|
1078
|
-
///
|
|
1079
|
-
///
|
|
1080
|
-
///
|
|
1081
|
-
///
|
|
1082
|
-
///
|
|
1046
|
+
/// THE NAME. It was `sysEngramNumberOf` before 0.16.0. The `sys` prefix names the CALLER TIER a
|
|
1047
|
+
/// method was built for, and this one was never gated — it is a bare public query. A prefix that
|
|
1048
|
+
/// reads as an authorization claim while carrying none is worse than no prefix: it invites a reader
|
|
1049
|
+
/// to assume a gate that does not exist, and a disclosure sweep grepping `sys*` would have counted
|
|
1050
|
+
/// this as tiered surface it is not. It was then `getEngramNumber` until 2026-10-02, while the
|
|
1051
|
+
/// engram served `getEngramNumber()` with no argument: one name with two arities on two canisters is
|
|
1052
|
+
/// what a hand-written client cannot tell apart (a structural actor type matches either target), so
|
|
1053
|
+
/// it follows the rule `getMarketCanister` already follows: distinct names on distinct canisters.
|
|
1054
|
+
/// `…Of` says what the argument is for. The engram no longer serves `getEngramNumber` at all (its
|
|
1055
|
+
/// copy of the number went with the genesis seed), so this is the one read of an engram's number.
|
|
1083
1056
|
getEngramNumberOf: (canisterId: principal) -> (opt nat) query;
|
|
1084
|
-
///
|
|
1085
|
-
///
|
|
1086
|
-
///
|
|
1087
|
-
///
|
|
1088
|
-
///
|
|
1089
|
-
///
|
|
1090
|
-
/// `listMyAgentDisputes`'s empty list.
|
|
1057
|
+
/// What a lasting key opened through a parent: the engram, the engram it was opened from, and the
|
|
1058
|
+
/// cut-off's time if there is one. GATED: readable by the key itself (an agent asking about its
|
|
1059
|
+
/// own), the owner of the engram it was opened from (whose console shows it), an admin or an audit
|
|
1060
|
+
/// viewer. Anyone else is REFUSED — the same words whether or not the key opened anything, so the
|
|
1061
|
+
/// refusal tells a stranger nothing. `#NotFound` only to a permitted reader, for a key that opened
|
|
1062
|
+
/// nothing: a true answer, like `listMyAgentDisputes`'s empty list.
|
|
1091
1063
|
getEngramOpenedThrough: (key: principal) -> (Result_24) query;
|
|
1092
1064
|
/// The i-th 1 MiB slice of the attested engram wasm (0-indexed). The caller reassembles all
|
|
1093
1065
|
/// chunks in order and MUST verify sha256(reassembled) == getEngramWasmHash before installing —
|
|
1094
|
-
/// the hash is the attestation; the bytes are a convenience.
|
|
1095
|
-
/// PUBLIC:
|
|
1096
|
-
///
|
|
1066
|
+
/// the hash is the attestation; the bytes are a convenience.
|
|
1067
|
+
/// PUBLIC: an out-of-range index is `#NotFound`, not an empty blob (no fabricated empties, since
|
|
1068
|
+
/// 0.16.0).
|
|
1097
1069
|
///
|
|
1098
1070
|
/// The empty blob was indistinguishable from a legitimately empty chunk AND from "no wasm is
|
|
1099
1071
|
/// staged at all" — and this is the surface a verifier walks to reassemble a template and check
|
|
@@ -1101,26 +1073,24 @@ service : {
|
|
|
1101
1073
|
/// a truncated one, so it would hash a partial wasm and report a mismatch against the official
|
|
1102
1074
|
/// list, which reads as "this template is unofficial" rather than "I stopped reading too early".
|
|
1103
1075
|
getEngramWasmChunk: (index: nat) -> (Result_28) query;
|
|
1104
|
-
/// The stored template's release class
|
|
1105
|
-
///
|
|
1106
|
-
///
|
|
1107
|
-
///
|
|
1108
|
-
///
|
|
1109
|
-
///
|
|
1110
|
-
///
|
|
1111
|
-
/// It returned "security" or "feature" as `Text`, so every consumer compared strings and no
|
|
1112
|
-
/// compiler anywhere could catch a typo or a third class arriving. A variant makes the set closed
|
|
1113
|
-
/// and the comparison checked — and this value gates whether an upgrade is funded, so a caller
|
|
1114
|
-
/// that silently fails to match "security" funds nothing and reports no error.
|
|
1115
|
-
/// ⟨CORRECTED 2026-10-26, later — the owner's restart choice of that day: "pay whenever the engram is
|
|
1116
|
-
/// missing any security release, whatever the latest release is labelled"⟩ "#Feature — the
|
|
1117
|
-
/// registry pays for no install" no longer holds for every engram: an engram still missing an
|
|
1076
|
+
/// The stored template's release class.
|
|
1077
|
+
///
|
|
1078
|
+
/// PUBLIC: FREE and UNGATED, because it is the checkable half of a public promise about which
|
|
1079
|
+
/// installs the registry pays for. The funding rule it checks: #Security — the registry pays for
|
|
1080
|
+
/// the install on every running engram it can reach, any size; #Feature — the registry pays for no
|
|
1081
|
+
/// install, and each engram runs it on its own compute. One exception: an engram still missing an
|
|
1118
1082
|
/// earlier security release is paid as a security update even while this reads #Feature, because
|
|
1119
|
-
/// the current template carries that fix (UpgradeFunding.effectiveClass) — unless the current
|
|
1083
|
+
/// the current template carries that fix (`UpgradeFunding.effectiveClass`) — unless the current
|
|
1120
1084
|
/// template is itself behind a security release (an older build re-uploaded), which cannot deliver
|
|
1121
|
-
/// the fix. An engram missing no security release is
|
|
1122
|
-
///
|
|
1123
|
-
///
|
|
1085
|
+
/// the fix. An engram missing no security release is never paid for a #Feature install. So this
|
|
1086
|
+
/// value is the declared label, not the whole funding rule: the `upgrade.topUp` audit line says
|
|
1087
|
+
/// `class=Security declared=Feature` when the two differ.
|
|
1088
|
+
///
|
|
1089
|
+
/// The release class is a VARIANT, not a stringly-typed enum (since 0.16.0). It returned "security"
|
|
1090
|
+
/// or "feature" as `Text`, so every consumer compared strings and no compiler anywhere could catch
|
|
1091
|
+
/// a typo or a third class arriving. A variant makes the set closed and the comparison checked —
|
|
1092
|
+
/// and this value gates whether an upgrade is funded, so a caller that silently fails to match
|
|
1093
|
+
/// "security" funds nothing and reports no error.
|
|
1124
1094
|
getEngramWasmClass: () -> (ReleaseClass) query;
|
|
1125
1095
|
/// The WASM hash of the engram template this registry will install.
|
|
1126
1096
|
///
|
|
@@ -1134,43 +1104,34 @@ service : {
|
|
|
1134
1104
|
/// PUBLIC: the pull path it describes is itself ungated, so a gate here would only stop a caller
|
|
1135
1105
|
/// planning the calls it is already permitted to make.
|
|
1136
1106
|
getEngramWasmInfo: () -> (EngramWasmInfo) query;
|
|
1137
|
-
///
|
|
1138
|
-
///
|
|
1139
|
-
///
|
|
1140
|
-
///
|
|
1141
|
-
///
|
|
1142
|
-
///
|
|
1143
|
-
///
|
|
1144
|
-
/// trapping-to-refuse; it did not give queries the ability to
|
|
1145
|
-
/// write, which is the thing this actually depends on.
|
|
1107
|
+
/// UPDATE, NOT QUERY, and NOT because of a system call — this body awaits nothing. The update
|
|
1108
|
+
/// exists so the DENIAL IS RECORDED: `denied()` is a state write, and a query cannot write. Exactly
|
|
1109
|
+
/// the argument `listEngrams` settled at its own declaration, and the same conclusion: a query here
|
|
1110
|
+
/// would silently retire the record of who was refused.
|
|
1111
|
+
///
|
|
1112
|
+
/// The one-Result-shape rule retired trapping-to-refuse as a reason for an update; it did not give
|
|
1113
|
+
/// queries the ability to write, which is the thing this depends on.
|
|
1146
1114
|
getFleetMetrics: () -> (Result_27);
|
|
1147
1115
|
/// PUBLIC: a genesis note that only privileged callers could read would defeat its purpose —
|
|
1148
1116
|
/// the reader who most needs it is the stranger deciding whether to trust this chain.
|
|
1149
1117
|
getGenesisNote: () -> (GenesisNote) query;
|
|
1150
1118
|
/// What the last upgrade attempt actually DID — the additive answer to "was I upgraded, or was
|
|
1151
1119
|
/// I already current?". A #Skipped result variant would have broken every deployed decoder and
|
|
1152
|
-
/// scored a skip as a FAILURE in
|
|
1153
|
-
///
|
|
1154
|
-
/// ⚠ `
|
|
1155
|
-
/// It does NOT date the engram's running code — a re-run fleet push marches
|
|
1156
|
-
/// nothing changes.
|
|
1157
|
-
///
|
|
1158
|
-
///
|
|
1159
|
-
///
|
|
1160
|
-
/// the
|
|
1161
|
-
/// self-upgrade or a manual install shows up as a change with no matching upgrade. Renaming here is
|
|
1162
|
-
/// free: the record is built at the query boundary, and the stable state it reads keeps its own
|
|
1163
|
-
/// spelling.
|
|
1164
|
-
/// ⟨CORRECTED 2026-10-02: "by any hand … shows up" is false, and so is "stamped only when code
|
|
1165
|
-
/// actually changed" above, read without its limit.⟩ `changedAtNs` is written at exactly two
|
|
1166
|
-
/// places, both right after THIS registry's own successful install on the engram
|
|
1167
|
-
/// (`upgradeMyEngram` and `upgradeEngram`), in the same step that writes `atNs` with
|
|
1168
|
-
/// `upgraded = true`. Nothing here reads the engram's module hash from the network to stamp it. So
|
|
1120
|
+
/// scored a skip as a FAILURE in tooling that greps the result for "Ok". PUBLIC: an owner deciding
|
|
1121
|
+
/// whether their engram got a security fix should not need a key to find out.
|
|
1122
|
+
/// ⚠ `atNs` is the time of THIS REGISTRY's last upgrade CALL, including a no-op on an
|
|
1123
|
+
/// already-current engram. It does NOT date the engram's running code — a re-run fleet push marches
|
|
1124
|
+
/// `atNs` forward while nothing changes. `changedAtNs` dates only the code changes this registry
|
|
1125
|
+
/// made: it is written at exactly two places, both right after this registry's own successful
|
|
1126
|
+
/// install on the engram (`upgradeMyEngram` and `upgradeEngram`), in the same step that writes
|
|
1127
|
+
/// `atNs` with `upgraded = true`, and it is null for an engram this registry has not upgraded since
|
|
1128
|
+
/// the field shipped. Nothing here reads the engram's module hash from the network to stamp it, so
|
|
1169
1129
|
/// an install made by any other controller — a manual upgrade or reinstall — or a sovereign
|
|
1170
|
-
/// engram's own upgrade does NOT move it
|
|
1171
|
-
///
|
|
1172
|
-
///
|
|
1173
|
-
///
|
|
1130
|
+
/// engram's own upgrade does NOT move it and does NOT show up in this read. To see a change made by
|
|
1131
|
+
/// another hand, read the engram's module hash from the network directly (it is public in the
|
|
1132
|
+
/// canister's state) and check it with `isOfficialEngramWasm`; nothing in this canister makes that
|
|
1133
|
+
/// comparison for you. (The two ns timestamps carry the `Ns` suffix since 0.16.0; the record is
|
|
1134
|
+
/// built at the query boundary, and the stable state it reads keeps its own spelling.)
|
|
1174
1135
|
getLastUpgrade: (canisterId: principal) -> (opt LastUpgrade) query;
|
|
1175
1136
|
/// Named `getMarketCanister`, NOT `getMarketId` — the engram already serves `getMarketId`, and a
|
|
1176
1137
|
/// hand-written client IDL that names the same method on two canisters goes undetected by both
|
|
@@ -1199,54 +1160,51 @@ service : {
|
|
|
1199
1160
|
/// so a caller can hold a reservation with no engram. Seeing it here is what tells them to retry
|
|
1200
1161
|
/// provision rather than reserve again.
|
|
1201
1162
|
getMyReservation: () -> (opt ReservationView) query;
|
|
1202
|
-
/// CALLER: the
|
|
1203
|
-
/// restart, when the next
|
|
1204
|
-
/// with no engram here — never "0 owed" to a caller it cannot answer for
|
|
1205
|
-
///
|
|
1206
|
-
///
|
|
1207
|
-
///
|
|
1208
|
-
/// we lend"⟩ "when the next restart is allowed" now reads "when the registry can next LEND to a
|
|
1209
|
-
/// restart": `nextRestartAtNs` is only the weekly limit on a loan. A restart on the owner's own
|
|
1210
|
-
/// compute is allowed now, whatever it says. Field name and shape unchanged.
|
|
1163
|
+
/// CALLER: the owner's app, for the owner (every method names its caller). What the caller's engram
|
|
1164
|
+
/// owes from a restart, when the registry can next LEND to a restart, and whether one is open.
|
|
1165
|
+
/// Refused loudly to anyone with no engram here — never "0 owed" to a caller it cannot answer for
|
|
1166
|
+
/// (refusal over fabrication). `nextRestartAtNs` is only the weekly limit on a loan: a restart on
|
|
1167
|
+
/// the owner's own compute is allowed now, whatever it says. `openUntilNs` reads the open restart's
|
|
1168
|
+
/// `finishByNs` (`restartsOpen`): when the call or the sweep will have started the engram.
|
|
1211
1169
|
getMyRestartStatus: () -> (Result_26) query;
|
|
1212
|
-
///
|
|
1213
|
-
///
|
|
1214
|
-
///
|
|
1170
|
+
/// How many engrams were ever opened, and how — lifetime sizes of state this registry never
|
|
1171
|
+
/// deletes, plus the two counters of refused openings (`Funnel.OpeningCounts` names each). All
|
|
1172
|
+
/// O(1); a reader differences them day to day.
|
|
1215
1173
|
///
|
|
1216
1174
|
/// CALLERS: the admin and the audit viewers (the deployment's metrics reader holds a viewer
|
|
1217
1175
|
/// grant). Anyone else is REFUSED by name with their class — never a zero, which would read as
|
|
1218
1176
|
/// "nothing was ever opened". A QUERY: counts only, and cheap; its refusal is not in the denial
|
|
1219
1177
|
/// log (`denied` says why a query cannot write).
|
|
1220
1178
|
getOpeningCounts: () -> (Result_25) query;
|
|
1221
|
-
/// Where an engram was opened from
|
|
1222
|
-
///
|
|
1223
|
-
///
|
|
1224
|
-
///
|
|
1179
|
+
/// Where an engram was opened from: the engram, the engram it was opened from, and the cut-off's
|
|
1180
|
+
/// time if there is one. A child reads its own parent by its canister id, so a handed-on child can
|
|
1181
|
+
/// read its parent — `getEngramOpenedThrough` is keyed by the lasting key that OPENED the engram,
|
|
1182
|
+
/// which a new owner does not hold.
|
|
1225
1183
|
///
|
|
1226
1184
|
/// CALLER: the engram's CURRENT owner, the current owner of the engram it was opened from, or this
|
|
1227
|
-
/// registry's admin and audit viewers (
|
|
1228
|
-
/// answered first; anyone else goes through the registry's combinator
|
|
1229
|
-
/// refuses every other caller in the same words whether or not the id is
|
|
1230
|
-
/// tells a stranger nothing. A QUERY, so the refusal is not written to the
|
|
1231
|
-
/// says why a query cannot write).
|
|
1185
|
+
/// registry's admin and audit viewers (every method names its caller). Reuses `parentOf`; no new
|
|
1186
|
+
/// state. The two owners are answered first; anyone else goes through the registry's combinator
|
|
1187
|
+
/// (`#adminOrViewer`), which refuses every other caller in the same words whether or not the id is
|
|
1188
|
+
/// an engram, so a refusal tells a stranger nothing. A QUERY, so the refusal is not written to the
|
|
1189
|
+
/// denial log (`denied` says why a query cannot write).
|
|
1232
1190
|
/// `#NotFound` only to a permitted reader: a first engram has no parent (a true answer), and an id
|
|
1233
|
-
/// this registry never opened is said to be one, not passed off as a first engram (refusal over
|
|
1234
|
-
///
|
|
1235
|
-
/// gate unchanged.
|
|
1191
|
+
/// this registry never opened is said to be one, not passed off as a first engram (refusal over
|
|
1192
|
+
/// fabrication). This read changed neither `listChildrenOf` nor the change-of-owner gate.
|
|
1236
1193
|
getParentOf: (child: principal) -> (Result_24) query;
|
|
1237
|
-
/// PUBLIC: CALLER:
|
|
1238
|
-
/// registry last REINSTALLED the engram on its own id after the
|
|
1239
|
-
/// or null — never recovered.
|
|
1240
|
-
/// record that restarted is a fact about the record that a stranger
|
|
1241
|
-
/// is certified in the engram's anchor leaf (`recoveredAtNs`,
|
|
1242
|
-
///
|
|
1243
|
-
/// the
|
|
1244
|
-
///
|
|
1194
|
+
/// PUBLIC: CALLER: an owner's app, the owner kit and anyone checking an engram's record (every
|
|
1195
|
+
/// method names its caller). When this registry last REINSTALLED the engram on its own id after the
|
|
1196
|
+
/// network erased it (`recoverMyEngram`), or null — never recovered. Public for
|
|
1197
|
+
/// `getAbandonedAtNs`'s reason: a record that restarted is a fact about the record that a stranger
|
|
1198
|
+
/// checking it needs, and the same date is certified in the engram's anchor leaf (`recoveredAtNs`,
|
|
1199
|
+
/// with its `era`).
|
|
1200
|
+
/// Set when the reinstall BEGINS — the old record's anchors are set aside in the same message,
|
|
1201
|
+
/// before the install (`recoverMyEngram` says why) — so while a recover's install has not landed,
|
|
1202
|
+
/// the engram can read erased with this set; the compute probes' `recoverOpen` says one is open.
|
|
1245
1203
|
getRecoveredAtNs: (canisterId: principal) -> (opt int) query;
|
|
1246
|
-
///
|
|
1247
|
-
///
|
|
1248
|
-
///
|
|
1249
|
-
///
|
|
1204
|
+
/// How far agents reach across owners — COUNTS ONLY: agents by how many trees their record spans
|
|
1205
|
+
/// (1 · 2 · 3–4 · 5+), engrams opened through a parent that are live or cut off, and engrams that
|
|
1206
|
+
/// paired an agent within seven days of opening. No principal, no row, no per-agent figure
|
|
1207
|
+
/// (`Funnel.referralCounts` says what is folded and how `exclude` drops a tree).
|
|
1250
1208
|
///
|
|
1251
1209
|
/// `exclude`: the deployment's own accounts (owner keys, agent roots, engram ids), at most 1,000.
|
|
1252
1210
|
/// An agent on it is dropped whole; an engagement whose engram's tree touches it is dropped.
|
|
@@ -1255,17 +1213,15 @@ service : {
|
|
|
1255
1213
|
/// weekly. Anyone else is REFUSED by name with their class — never zeros. A QUERY: its cost grows
|
|
1256
1214
|
/// with the agents and engrams it walks (one pass over each), so a reader asks weekly, not hourly.
|
|
1257
1215
|
getReferralCounts: (exclude: vec principal) -> (Result_23) query;
|
|
1258
|
-
///
|
|
1259
|
-
///
|
|
1260
|
-
///
|
|
1261
|
-
///
|
|
1262
|
-
///
|
|
1263
|
-
///
|
|
1264
|
-
///
|
|
1265
|
-
///
|
|
1266
|
-
///
|
|
1267
|
-
/// CALLER: the deployment's monitor, once an hour, under the audit-viewer grant its daily count-of-use
|
|
1268
|
-
/// reading already holds (the surface budget: every method names its caller). Also the admin.
|
|
1216
|
+
/// THE REGISTRY'S HEALTH IN ONE READ: its cycle reserve, its roster, its anchoring counts — the
|
|
1217
|
+
/// same answers `getCycleReserveStatus`, `getAdminRoles` and `getAnchorStats` give, which stay
|
|
1218
|
+
/// served unchanged for everyone who reads them one at a time — and the stamps of its clock, which
|
|
1219
|
+
/// wakes only at the deadlines it records (with a six-hour net) and so is silent by design:
|
|
1220
|
+
/// `clock.nextWakeAtNs` more than an hour behind `atNs` is a lost clock. `Types.RegistryHealth`
|
|
1221
|
+
/// says what each field means, and why every field is `opt` and always filled.
|
|
1222
|
+
///
|
|
1223
|
+
/// CALLER: the deployment's monitor, once an hour, under the audit-viewer grant its daily
|
|
1224
|
+
/// count-of-use reading already holds (every method names its caller). Also the admin.
|
|
1269
1225
|
///
|
|
1270
1226
|
/// GATED, LIKE THE COUNT-OF-USE READS THAT MONITOR MAKES (`getOpeningCounts`): the admin or an audit
|
|
1271
1227
|
/// viewer; anyone else is REFUSED by name — never an empty or zero reading. A QUERY: its refusal is
|
|
@@ -1277,9 +1233,9 @@ service : {
|
|
|
1277
1233
|
/// recognize as biller would collect funds it cannot convert into credit).
|
|
1278
1234
|
getRentBiller: () -> (opt principal) query;
|
|
1279
1235
|
/// Public transparency: is the gate armed, and which identity issuers are exempt?
|
|
1280
|
-
///
|
|
1281
|
-
///
|
|
1282
|
-
///
|
|
1236
|
+
/// It carries `inviteIssuer` (since 0.16.0), closing a setter-without-a-getter gap without adding
|
|
1237
|
+
/// a method: `setInviteIssuer` could write a principal that nothing could read back, so "who may
|
|
1238
|
+
/// mint reserve invites" was unanswerable from outside.
|
|
1283
1239
|
///
|
|
1284
1240
|
/// It serves the EFFECTIVE issuer, not the raw `?Principal`. The stored value is null until
|
|
1285
1241
|
/// someone sets it and `effectiveInviteIssuer()` then falls back to the admin — which is what
|
|
@@ -1291,57 +1247,52 @@ service : {
|
|
|
1291
1247
|
/// stranger can sign up at all. An admission rule only the admitted can read is not a rule a
|
|
1292
1248
|
/// prospective user can act on.
|
|
1293
1249
|
getReserveGateConfig: () -> (ReserveGateConfig) query;
|
|
1294
|
-
/// PUBLIC: CALLER:
|
|
1295
|
-
///
|
|
1296
|
-
///
|
|
1297
|
-
///
|
|
1298
|
-
///
|
|
1299
|
-
/// identities hold between any two messages
|
|
1300
|
-
/// advancePaid = advanceReturned + advanceWrittenOff +
|
|
1301
|
-
///
|
|
1302
|
-
///
|
|
1303
|
-
///
|
|
1304
|
-
///
|
|
1305
|
-
/// `
|
|
1306
|
-
///
|
|
1307
|
-
///
|
|
1308
|
-
///
|
|
1309
|
-
/// release
|
|
1310
|
-
///
|
|
1311
|
-
///
|
|
1312
|
-
///
|
|
1313
|
-
///
|
|
1314
|
-
///
|
|
1315
|
-
///
|
|
1316
|
-
/// such an archive is kept durably is an operator's choice, not this registry's. The fleet totals
|
|
1317
|
-
/// this method answers are exact regardless.
|
|
1250
|
+
/// PUBLIC: CALLER: a status page, or anyone checking what the registry spends (every method names
|
|
1251
|
+
/// its caller). What the registry has lent to restart stopped engrams — lent, repaid, written off,
|
|
1252
|
+
/// outstanding — and what engrams gave back of the compute a paid security update advanced them
|
|
1253
|
+
/// (returned, written off). Ungated, because a subsidy the registry would not publish is one it
|
|
1254
|
+
/// should not spend. `getUpgradeSubsidyTotal` stays the gross figure.
|
|
1255
|
+
/// Written off, but exact: two identities hold between any two messages, lent = repaid +
|
|
1256
|
+
/// writtenOff + outstanding, and advancePaid = advanceReturned + advanceWrittenOff +
|
|
1257
|
+
/// advanceOutstanding.
|
|
1258
|
+
/// These totals are fleet-wide. PER RELEASE, read the audit chain: every line that moves an advance
|
|
1259
|
+
/// names the release it was paid for, `template=<module hash>` (and `version=` when the release
|
|
1260
|
+
/// history names one) — `upgrade.topUp` (paid, `added=`), `upgrade.advance.returned` (`returned=`,
|
|
1261
|
+
/// `writtenOff=`) and `upgrade.advance.writtenOff` (`writtenOff=`, including the 90-day write-off of
|
|
1262
|
+
/// an advance left outstanding). Summed by `template=` over a COMPLETE copy of the chain, they give
|
|
1263
|
+
/// each release's paid, returned and written-off figures exactly; what is still out per release is
|
|
1264
|
+
/// paid − returned − written off. Restart-loan lines are not per release (a loan pays for no
|
|
1265
|
+
/// release). A per-release sum read from the registry alone can miss lines: the registry keeps the
|
|
1266
|
+
/// most recent 10,000 audit entries (AuditLog's `MAX_ENTRIES`; on overflow it drops back to 9,000,
|
|
1267
|
+
/// oldest first), and a give-back or a 90-day write-off can land long after its `upgrade.topUp` line
|
|
1268
|
+
/// was dropped. Exact per-release figures need an archive of the chain kept from the first line on
|
|
1269
|
+
/// (scripts/audit-chain/monitor.mjs `--archive`); whether such an archive is kept durably is an
|
|
1270
|
+
/// operator's choice, not this registry's. The fleet totals this method answers are exact
|
|
1271
|
+
/// regardless.
|
|
1318
1272
|
getRestartTotals: () -> (RestartTotals) query;
|
|
1319
1273
|
/// PUBLIC: transparency without a doxx — how many principals the deployment currently screens (0 = seam
|
|
1320
1274
|
/// disarmed, the shipped default). The list itself is never enumerable publicly.
|
|
1321
1275
|
getScreeningDenylistSize: () -> (nat) query;
|
|
1322
1276
|
/// How many engram template releases this registry has declared `#Security` — the class that
|
|
1323
|
-
/// skips any delay and whose install the registry pays for on every running engram
|
|
1324
|
-
///
|
|
1325
|
-
///
|
|
1326
|
-
///
|
|
1327
|
-
///
|
|
1328
|
-
///
|
|
1329
|
-
///
|
|
1330
|
-
///
|
|
1331
|
-
///
|
|
1332
|
-
///
|
|
1333
|
-
///
|
|
1334
|
-
///
|
|
1335
|
-
/// on us that only we can read.
|
|
1277
|
+
/// skips any delay and whose install the registry pays for on every running engram. The count is
|
|
1278
|
+
/// published, not the list. It moves only when a template's class is declared INTO `#Security`
|
|
1279
|
+
/// (`setEngramWasmClass`), never on `#Feature`, never down. It counts TEMPLATES, not declarations:
|
|
1280
|
+
/// each distinct template (by its module hash) counts once, the first time it is declared
|
|
1281
|
+
/// `#Security`. Re-declaring it — which a deploy does after every upload — or flipping it to
|
|
1282
|
+
/// `#Feature` and back changes nothing; counting declarations would count one security release
|
|
1283
|
+
/// deployed five times as five.
|
|
1284
|
+
///
|
|
1285
|
+
/// PUBLIC: it is the checkable half of an unenforced policy — the feature/security rule is
|
|
1286
|
+
/// published without code holding the registry's operator to it, so the one thing a stranger can
|
|
1287
|
+
/// watch is how often the operator reaches for the class that skips the wait. A gated count would be
|
|
1288
|
+
/// a check on the operator that only the operator can read.
|
|
1336
1289
|
getSecurityReleaseCount: () -> (nat) query;
|
|
1337
|
-
///
|
|
1338
|
-
///
|
|
1339
|
-
///
|
|
1340
|
-
///
|
|
1341
|
-
///
|
|
1342
|
-
///
|
|
1343
|
-
/// should not forward. It names no engram and no owner. (⟨2026-10-01⟩ The marker was first written
|
|
1344
|
-
/// "PUBLIC," and a rationale check that looks for the colon form read the method as unexplained.)
|
|
1290
|
+
/// Cumulative cycles accepted at the sponsored door (`sysOpenChild`) and forwarded into engrams
|
|
1291
|
+
/// opened through another — cycles the calling engrams attached, never the registry's own. Kept
|
|
1292
|
+
/// apart from the grant counter (`totalCyclesAllocated`) so neither figure is inflated by the other.
|
|
1293
|
+
///
|
|
1294
|
+
/// PUBLIC: for the reason `getUpgradeSubsidyTotal` is — a number the registry would not publish is
|
|
1295
|
+
/// one it should not forward. It names no engram and no owner.
|
|
1345
1296
|
getSponsoredCyclesTotal: () -> (nat) query;
|
|
1346
1297
|
/// Which canister's money chain this registry anchors — `null` until wired, the honest unwired
|
|
1347
1298
|
/// answer rather than a placeholder principal.
|
|
@@ -1350,7 +1301,8 @@ service : {
|
|
|
1350
1301
|
/// its counterparty cannot be checked by anyone. A canister id is not a secret; withholding it
|
|
1351
1302
|
/// would leave a verifier holding an anchor with nothing to anchor it to.
|
|
1352
1303
|
getTreasuryAnchorId: () -> (opt principal) query;
|
|
1353
|
-
///
|
|
1304
|
+
/// `null` MEANS NEVER CHOSE (since 0.16.0, against fabricated answers). It used to mean
|
|
1305
|
+
/// `#AutoUpdate`.
|
|
1354
1306
|
///
|
|
1355
1307
|
/// Returning the shipped default for a caller who has never expressed a preference is a
|
|
1356
1308
|
/// fabricated CONSENT: the registry answered "this owner opted into automatic upgrades" when the
|
|
@@ -1360,35 +1312,30 @@ service : {
|
|
|
1360
1312
|
///
|
|
1361
1313
|
/// The default still APPLIES; it is just no longer REPORTED as a choice. A caller that wants
|
|
1362
1314
|
/// effective behaviour reads null as "AutoUpdate applies", and one that wants to know whether the
|
|
1363
|
-
/// owner ever decided can
|
|
1315
|
+
/// owner ever decided can tell.
|
|
1364
1316
|
getUpdatePreference: () -> (opt UpdatePreference) query;
|
|
1365
1317
|
/// Which template an engram has already been FUNDED for, if any — the anti-drain ledger made
|
|
1366
1318
|
/// observable. Admin/viewer-gated: it reveals which engrams needed help, which is a nudge toward
|
|
1367
1319
|
/// who is underfunded.
|
|
1368
1320
|
///
|
|
1369
|
-
/// This exists because the ledger was
|
|
1370
|
-
///
|
|
1371
|
-
///
|
|
1372
|
-
///
|
|
1373
|
-
///
|
|
1374
|
-
///
|
|
1375
|
-
///
|
|
1376
|
-
///
|
|
1377
|
-
///
|
|
1378
|
-
///
|
|
1379
|
-
/// — and the second is a claim about OUR OWN SPEND, not an absence of one. `#Ok(null)` now means
|
|
1380
|
-
/// never funded, `#Err(#Refused)` means not your business, and no caller has to guess which.
|
|
1321
|
+
/// This read exists because the ledger was otherwise unobservable. It is the guard that bounds
|
|
1322
|
+
/// funding to one deposit per engram per release even when install_code never succeeds — closing
|
|
1323
|
+
/// the interleave drain where an owner burns the deposit between the registry's canister_status
|
|
1324
|
+
/// read and the install, leaving the module hash unchanged and the engram eligible again.
|
|
1325
|
+
/// Untestable state guarding against a farming attack is the wrong thing to leave unobserved.
|
|
1326
|
+
///
|
|
1327
|
+
/// The refusal is a value (since 0.16.0), and the envelope separates the two nulls. `?Text` had to
|
|
1328
|
+
/// carry both "you may not ask" and "this engram was never funded for an upgrade" — and the second
|
|
1329
|
+
/// is a claim about THE REGISTRY'S OWN SPEND, not an absence of one. `#Ok(null)` means never funded,
|
|
1330
|
+
/// `#Err(#Refused)` means not your business, and no caller has to guess which.
|
|
1381
1331
|
getUpgradeFundedTemplate: (canisterId: principal) -> (Result_21) query;
|
|
1382
|
-
/// Cumulative cycles the registry has granted to engrams for upgrades —
|
|
1383
|
-
/// security-update funding
|
|
1384
|
-
///
|
|
1385
|
-
///
|
|
1386
|
-
///
|
|
1387
|
-
///
|
|
1388
|
-
///
|
|
1389
|
-
/// paid as a security update and counted here (UpgradeFunding.effectiveClass).
|
|
1390
|
-
///
|
|
1391
|
-
/// PUBLIC: a subsidy we would not publish is one we should not spend. Free and ungated.
|
|
1332
|
+
/// Cumulative cycles the registry has granted to engrams for upgrades — the meter on
|
|
1333
|
+
/// security-update funding. The registry pays only for security updates on running engrams: the
|
|
1334
|
+
/// pull is never refused, and a feature update it installs is not paid for, except on an engram
|
|
1335
|
+
/// still missing an earlier security release, whose install is paid as a security update and
|
|
1336
|
+
/// counted here (`UpgradeFunding.effectiveClass`).
|
|
1337
|
+
///
|
|
1338
|
+
/// PUBLIC: a subsidy the registry would not publish is one it should not spend. Free and ungated.
|
|
1392
1339
|
getUpgradeSubsidyTotal: () -> (nat) query;
|
|
1393
1340
|
/// Current upgrade top-up floor. PUBLIC: it is a spending policy, and an owner deciding whether
|
|
1394
1341
|
/// they must fund an upgrade themselves deserves to know whether the registry will.
|
|
@@ -1416,9 +1363,9 @@ service : {
|
|
|
1416
1363
|
};
|
|
1417
1364
|
};
|
|
1418
1365
|
}) query;
|
|
1419
|
-
/// Is `hash` (lowercase hex sha256) a build
|
|
1420
|
-
/// code
|
|
1421
|
-
/// a co-controller and could have installed their own wasm.
|
|
1366
|
+
/// Is `hash` (lowercase hex sha256) a build this registry published? The trust question for an
|
|
1367
|
+
/// engram whose code the registry cannot verify by controllership — a sovereign engram, or a managed
|
|
1368
|
+
/// one whose owner is a co-controller and could have installed their own wasm.
|
|
1422
1369
|
///
|
|
1423
1370
|
/// PUBLIC: this IS the verification surface, and a verification surface nobody can call verifies
|
|
1424
1371
|
/// nothing. Free and ungated for the same reason.
|
|
@@ -1431,7 +1378,7 @@ service : {
|
|
|
1431
1378
|
/// canisterId→owner mapping — the very leak that kept the deleted `getEngramByCanisterId` gated.
|
|
1432
1379
|
/// Gating a strictly narrower answer than the ungated one beside it would protect nothing.
|
|
1433
1380
|
isRegisteredActiveEngram: (canisterId: principal) -> (bool) query;
|
|
1434
|
-
///
|
|
1381
|
+
/// RENAMED from `engramsOperatedBy` in 0.16.0; the refusal is a value.
|
|
1435
1382
|
///
|
|
1436
1383
|
/// `[]` here is a SUBSTANTIVE CLAIM ABOUT ANOTHER PRINCIPAL'S FLEET — "this agent works
|
|
1437
1384
|
/// nowhere" — handed to a caller who merely lacks a grant. Readable by an admin, an audit viewer,
|
|
@@ -1439,26 +1386,22 @@ service : {
|
|
|
1439
1386
|
listAgentEngrams: (agent: principal) -> (Result_18) query;
|
|
1440
1387
|
/// Contradictory submissions, oldest-first. Empty is the normal case. Never trimmed.
|
|
1441
1388
|
///
|
|
1442
|
-
///
|
|
1443
|
-
///
|
|
1444
|
-
///
|
|
1445
|
-
/// policy is deliberately never-evict. An uncapped reply over a caller-growable list eventually
|
|
1389
|
+
/// PAGED, as every list is (since 2026-08-18). It returned the WHOLE list, and the list is one an
|
|
1390
|
+
/// engram can grow itself: `sysAnchorHead` appends a conflict on every contradictory submission and
|
|
1391
|
+
/// the policy is deliberately never-evict. An uncapped reply over a caller-growable list eventually
|
|
1446
1392
|
/// exceeds the response limit, and an oversized Candid reply does not truncate — it fails to
|
|
1447
1393
|
/// decode ENTIRELY, so the conflicts become unreadable. That is the exact opposite of what a
|
|
1448
1394
|
/// never-evicted evidence store is for: the record survives and nobody can read it.
|
|
1449
1395
|
///
|
|
1450
1396
|
/// `total` is the full conflict count, so a caller holding one page still learns how many exist.
|
|
1451
1397
|
///
|
|
1452
|
-
///
|
|
1453
|
-
/// conflict list without limit
|
|
1454
|
-
/// registry's cycles
|
|
1455
|
-
///
|
|
1456
|
-
///
|
|
1457
|
-
///
|
|
1458
|
-
///
|
|
1459
|
-
/// at `AnchorConflicts.MAX_CONFLICTS_PER_ENGRAM` rows per engram, `sysAnchorHead` refuses further
|
|
1460
|
-
/// contradictions by name, and the refusals are counted in the certified leaf's
|
|
1461
|
-
/// `refusedConflicts`. So this list never exceeds that bound and the page clamp below is ample.⟩
|
|
1398
|
+
/// The write side is bounded too, without dropping anything. Unbounded, an engram could append to
|
|
1399
|
+
/// its own conflict list without limit — unbounded state on a shared canister paid for by the
|
|
1400
|
+
/// registry's cycles — and dropping rows would break an evidence store whose whole promise is that
|
|
1401
|
+
/// nothing is dropped. So nothing is deleted; `sysAnchorHead` refuses further contradictions by
|
|
1402
|
+
/// name once an engram has `AnchorConflicts.MAX_CONFLICTS_PER_ENGRAM` rows, and the refusals are
|
|
1403
|
+
/// counted in the certified leaf's `refusedConflicts`. This list therefore never exceeds that bound,
|
|
1404
|
+
/// and the page clamp is ample.
|
|
1462
1405
|
///
|
|
1463
1406
|
/// PUBLIC: a conflict is the anchoring system reporting against ITSELF, and a self-report only
|
|
1464
1407
|
/// its author can read is worth nothing. Withholding it would let this registry publish anchors
|
|
@@ -1467,48 +1410,42 @@ service : {
|
|
|
1467
1410
|
listAnchorConflicts: (canisterId: principal, start: nat, limit: nat) ->
|
|
1468
1411
|
(Result_20) query;
|
|
1469
1412
|
/// Witnessed heads for an engram, oldest-first. PUBLIC and ungated — an anchor a stranger cannot
|
|
1470
|
-
/// read is not an anchor
|
|
1413
|
+
/// read is not an anchor: anchors are recorded where counterparties can check them.
|
|
1471
1414
|
///
|
|
1472
1415
|
/// Each entry carries `disputed`, derived at read time from the conflict log. Without it a
|
|
1473
1416
|
/// counterparty reading ONLY this query would take an already-contradicted head at face value —
|
|
1474
1417
|
/// on a same-total/different-head conflict the registry keeps both, the original here and the
|
|
1475
|
-
/// contradiction in
|
|
1418
|
+
/// contradiction in `listAnchorConflicts`. Requiring readers to fetch two queries and join them
|
|
1476
1419
|
/// correctly is a requirement most will not meet; carrying the flag inline removes the trap.
|
|
1477
|
-
///
|
|
1478
|
-
///
|
|
1479
|
-
///
|
|
1480
|
-
///
|
|
1481
|
-
///
|
|
1482
|
-
///
|
|
1483
|
-
///
|
|
1484
|
-
///
|
|
1485
|
-
/// engram's LATEST anchor. So the latest checkpoint IS checkable by a sceptical outsider:
|
|
1486
|
-
/// `getCertifiedAnchor` serves it with a certificate and a witness, checked against the network's
|
|
1487
|
-
/// root key without trusting the replica that answered. What stays true is narrower: THIS query,
|
|
1488
|
-
/// the full history oldest-first, is not certified, because only the latest anchor per engram is in
|
|
1489
|
-
/// the tree. For an earlier checkpoint a reader trusts the answering replica, or kept the
|
|
1490
|
-
/// certified latest anchor when it was the latest.
|
|
1420
|
+
///
|
|
1421
|
+
/// ⚠ THE ANCHOR HISTORY IS NOT CERTIFIED; THE LATEST ANCHOR IS. The registry's one certified value
|
|
1422
|
+
/// is the root of a labelled tree, and the tree carries each engram's LATEST anchor, so the latest
|
|
1423
|
+
/// checkpoint is checkable by a sceptical outsider: `getCertifiedAnchor` serves it with a
|
|
1424
|
+
/// certificate and a witness, checked against the network's root key without trusting the replica
|
|
1425
|
+
/// that answered. THIS query, the full history oldest-first, is not certified, because only the
|
|
1426
|
+
/// latest anchor per engram is in the tree. For an earlier checkpoint a reader trusts the answering
|
|
1427
|
+
/// replica, or kept the certified latest anchor when it was the latest.
|
|
1491
1428
|
///
|
|
1492
1429
|
/// PUBLIC: an anchor is evidence offered to a third party, so the third party has to be able to
|
|
1493
1430
|
/// read it. Gating this would leave the registry asserting that an engram's history is witnessed
|
|
1494
1431
|
/// while refusing to show the witness — which is the shape of claim nobody should accept.
|
|
1495
1432
|
///
|
|
1496
|
-
///
|
|
1497
|
-
///
|
|
1498
|
-
///
|
|
1499
|
-
///
|
|
1500
|
-
///
|
|
1501
|
-
///
|
|
1502
|
-
///
|
|
1503
|
-
///
|
|
1504
|
-
///
|
|
1505
|
-
/// recovered after the network erased it has more
|
|
1506
|
-
/// first record, k = after its k-th recover),
|
|
1507
|
-
/// aside, then the current era's. Nothing
|
|
1508
|
-
/// contradictions recorded during the
|
|
1433
|
+
/// A bare list, not a `Page`, decided 2026-10-02 and recorded here so the choice is visible: every
|
|
1434
|
+
/// other list on these canisters is a `Page`, and this one stays `[AnchorView]`. It is bounded by
|
|
1435
|
+
/// construction — at most `MAX_ANCHORS` (64) per engram, log-spaced with the genesis anchor pinned —
|
|
1436
|
+
/// and nothing is withheld from anyone (it is public), so a page's `total` would equal the length
|
|
1437
|
+
/// and its `withheld` would always be 0: two fields that could never say anything. A cap that is
|
|
1438
|
+
/// part of the anchoring design is not the unbounded growth paging exists for. WHAT WOULD MAKE THIS
|
|
1439
|
+
/// WRONG: the ring outgrowing one reply, or rows withheld per caller — then it pages, and that is a
|
|
1440
|
+
/// break.
|
|
1441
|
+
///
|
|
1442
|
+
/// EVERY ERA, oldest first. An engram the registry recovered after the network erased it has more
|
|
1443
|
+
/// than one record: each anchor carries `era` (0 = its first record, k = after its k-th recover),
|
|
1444
|
+
/// the earlier eras' anchors as they stood when each was set aside, then the current era's. Nothing
|
|
1445
|
+
/// is withheld or deleted. `disputed` is read against the contradictions recorded during the
|
|
1446
|
+
/// anchor's own era.
|
|
1509
1447
|
listAnchors: (canisterId: principal) -> (vec AnchorView) query;
|
|
1510
|
-
///
|
|
1511
|
-
/// refusal is now a VALUE.
|
|
1448
|
+
/// RENAMED from `readAuditLog` in 0.16.0: a list method returns a page, and the refusal is a VALUE.
|
|
1512
1449
|
///
|
|
1513
1450
|
/// It refused by `Debug.trap`, which was the right call when the alternative was a fabricated
|
|
1514
1451
|
/// answer — and the fabrication it replaced is worth restating, because it is the sharpest one
|
|
@@ -1522,23 +1459,20 @@ service : {
|
|
|
1522
1459
|
/// read this, here is what you CAN read" has to parse a rejection string to do it. `#Err(#Refused)`
|
|
1523
1460
|
/// carries the same sentence as data. The message survives verbatim — it earned its wording.
|
|
1524
1461
|
///
|
|
1525
|
-
/// The
|
|
1526
|
-
///
|
|
1527
|
-
///
|
|
1528
|
-
///
|
|
1529
|
-
///
|
|
1530
|
-
///
|
|
1531
|
-
///
|
|
1532
|
-
///
|
|
1533
|
-
///
|
|
1534
|
-
/// this read
|
|
1535
|
-
/// for strangers were ruled for the engram's record, and the status console decides a signed-in
|
|
1536
|
-
/// visitor's tier by whether this read refuses.
|
|
1462
|
+
/// The reply is the shared `Wire.RecordPage`, the shape every chain canister's record read serves,
|
|
1463
|
+
/// so one checker reads all of them. A viewer sees every entry, so `sealed` is always empty here;
|
|
1464
|
+
/// what the page adds is `ringFloor` (where the ring starts — a `start` below it begins at it) and
|
|
1465
|
+
/// `hashFirstFrom` (where this record switched to the hash-first rule: entries below it were hashed
|
|
1466
|
+
/// SHA-256(prev ‖ body)). `total` is the head counter, as everywhere else, not the size of the
|
|
1467
|
+
/// 1,000-entry window this read slices, which is not a number about the record. The old inline
|
|
1468
|
+
/// record's `earliestId` was redundant with the ring's own paging, and `size`/`headHash` are
|
|
1469
|
+
/// `getAuditHead`'s answer, published free to everyone. The gate is unchanged: hash-only rows for
|
|
1470
|
+
/// strangers are the engram's record's rule, and a client can tell a signed-in visitor's tier by
|
|
1471
|
+
/// whether this read refuses.
|
|
1537
1472
|
listAuditEntries: (start: nat, limit: nat) -> (Result_19) query;
|
|
1538
|
-
///
|
|
1539
|
-
///
|
|
1540
|
-
///
|
|
1541
|
-
/// metrics on one canister and audit on another.
|
|
1473
|
+
/// RENAMED from `getMetricsViewers` in 0.16.0 — the viewer triple unifies on "audit viewer" across
|
|
1474
|
+
/// every canister (same concept, same name), because a roster that grants audit reads should not be
|
|
1475
|
+
/// named after metrics on one canister and audit on another.
|
|
1542
1476
|
///
|
|
1543
1477
|
/// MEASURED FABRICATION, kept in the record: this arm answered `(vec {})` to an ANONYMOUS caller
|
|
1544
1478
|
/// on 2026-08-11 while viewers existed. An empty vec reads as "nobody holds read-only ops access"
|
|
@@ -1546,35 +1480,35 @@ service : {
|
|
|
1546
1480
|
listAuditViewers: () -> (Result_18) query;
|
|
1547
1481
|
/// PUBLIC: the release history, paged.
|
|
1548
1482
|
///
|
|
1549
|
-
///
|
|
1550
|
-
/// WHOLE changelog on every call with no way to say it had been truncated — and a list that
|
|
1551
|
-
/// say "there is more" looks complete at exactly the size where it stops being so.
|
|
1483
|
+
/// A `Page`, not a bare vec (since 0.16.0, a list method returns a page). The old shape returned
|
|
1484
|
+
/// the WHOLE changelog on every call with no way to say it had been truncated — and a list that
|
|
1485
|
+
/// cannot say "there is more" looks complete at exactly the size where it stops being so.
|
|
1552
1486
|
listChangelogEntries: (start: nat, limit: nat) -> (Page_4) query;
|
|
1553
|
-
///
|
|
1554
|
-
///
|
|
1555
|
-
///
|
|
1556
|
-
/// chain, which exists to be walked by a stranger).
|
|
1487
|
+
/// The engrams opened through `engram`, each with its owner now and its cut-off time if any. GATED:
|
|
1488
|
+
/// readable by `engram`'s owner, an admin or an audit viewer. The link says who works for whom, so
|
|
1489
|
+
/// it is not public (unlike the predecessor chain, which exists to be walked by a stranger).
|
|
1557
1490
|
///
|
|
1558
|
-
/// REFUSED LOUDLY, never `[]`, to anyone else (refusal over fabrication): an empty list handed to a
|
|
1559
|
-
/// merely lacks a grant would be a claim about another owner's engram. A QUERY, so the
|
|
1560
|
-
/// not in the denial log (`denied` says why a query cannot write).
|
|
1491
|
+
/// REFUSED LOUDLY, never `[]`, to anyone else (refusal over fabrication): an empty list handed to a
|
|
1492
|
+
/// caller who merely lacks a grant would be a claim about another owner's engram. A QUERY, so the
|
|
1493
|
+
/// refusal is not in the denial log (`denied` says why a query cannot write).
|
|
1561
1494
|
///
|
|
1562
1495
|
/// Built by a pass over `parentOf` rather than from a second, reverse index: one stored fact and a
|
|
1563
1496
|
/// pass bounded by the number of opened engrams, instead of two facts to keep in step.
|
|
1564
1497
|
listChildrenOf: (engram: principal) -> (Result_17) query;
|
|
1565
|
-
///
|
|
1498
|
+
/// RENAMED from `readDenialLog` in 0.16.0; the refusal is a value.
|
|
1566
1499
|
///
|
|
1567
1500
|
/// An empty denial log reads as NOBODY HAS EVER BEEN REFUSED HERE, which is the opposite of what
|
|
1568
1501
|
/// this log exists to record — so "empty" was never an acceptable answer to a caller who simply
|
|
1569
1502
|
/// lacks the grant. The old trap said so; this says the same thing as data.
|
|
1570
1503
|
listDenialEntries: (start: nat, limit: nat) -> (Result_16) query;
|
|
1571
|
-
///
|
|
1572
|
-
///
|
|
1504
|
+
/// ONE ROW PER ENGAGEMENT, for the deployment's own count of use — DAYS, never instants, and NEVER
|
|
1505
|
+
/// the agent's root, enrolled key or invite.
|
|
1573
1506
|
///
|
|
1574
1507
|
/// CALLERS: the admin, and the audit viewers — the reader the deployment runs for this purpose
|
|
1575
1508
|
/// holds a viewer grant and calls this once a day. Anyone else is REFUSED by name, with their
|
|
1576
1509
|
/// class (the anonymous principal, an engram, the template key, an engram's owner, a stranger) —
|
|
1577
|
-
/// never an empty page, which is what a lost history would also look like (refusal over
|
|
1510
|
+
/// never an empty page, which is what a lost history would also look like (refusal over
|
|
1511
|
+
/// fabrication).
|
|
1578
1512
|
///
|
|
1579
1513
|
/// ARGUMENTS. `sinceDay`: any instant, floored to its UTC day; a row is served when the LATEST of
|
|
1580
1514
|
/// its start, its ending, its engram's abandonment and any reset since it started is on or after
|
|
@@ -1583,56 +1517,46 @@ service : {
|
|
|
1583
1517
|
/// again from the last row's `seq` + 1. `limit`: rows wanted, at most 1,000; a page shorter than
|
|
1584
1518
|
/// the limit is the last. `companyList`: the deployment's own accounts (owner keys, agent roots,
|
|
1585
1519
|
/// engram ids), at most 1,000, folded into each row's yes/no `…OnList` answers and into
|
|
1586
|
-
/// `firstOutsideOnTree`; pass `[]` and every engagement
|
|
1520
|
+
/// `firstOutsideOnTree`; pass `[]` and every engagement counts as outside that list, the
|
|
1521
|
+
/// deployment's own included.
|
|
1587
1522
|
///
|
|
1588
1523
|
/// The reply is a page whose `total` is every engagement ever recorded here. Each row's fields
|
|
1589
1524
|
/// are described at `Funnel.EngagementRow`; the walk and its cost at `Funnel.engagementRows`.
|
|
1590
1525
|
///
|
|
1591
|
-
///
|
|
1592
|
-
///
|
|
1593
|
-
///
|
|
1526
|
+
/// UPDATE, NOT QUERY, so a refused attempt is RECORDED: `denied()` is a state write, and a
|
|
1527
|
+
/// query cannot write (the reason `listEngrams` is an update). This is the most sensitive of the
|
|
1528
|
+
/// three reads — one row per engagement — so who was turned away is worth a record.
|
|
1594
1529
|
listEngagementRows: (sinceDay: int, start: nat, limit: nat, companyList:
|
|
1595
1530
|
vec principal) -> (Result_15);
|
|
1596
|
-
///
|
|
1597
|
-
///
|
|
1531
|
+
/// NO `authorized : ?Bool` FLAG — it went in 0.16.0 (one Result shape for every gated method), with
|
|
1532
|
+
/// everything built around it.
|
|
1598
1533
|
///
|
|
1599
|
-
/// The flag was
|
|
1600
|
-
///
|
|
1601
|
-
///
|
|
1602
|
-
///
|
|
1603
|
-
///
|
|
1604
|
-
/// before believing a total.
|
|
1534
|
+
/// The flag was a compromise that rested on ONE premise: this method could not refuse. It is an
|
|
1535
|
+
/// UPDATE because `denied()` is a state write, and a trap would roll that write back — trading a
|
|
1536
|
+
/// false answer for a missing audit trail, which is strictly worse. So the refusal had to be
|
|
1537
|
+
/// smuggled out beside a fabricated `{ []; 0 }` payload, and readers had to be taught to check a
|
|
1538
|
+
/// sibling flag before believing a total.
|
|
1605
1539
|
///
|
|
1606
1540
|
/// THE ENVELOPE REMOVES THE PREMISE. `#Err(#Refused)` is a VALUE, not a trap: the message
|
|
1607
1541
|
/// commits, the denial is recorded, and the caller gets a refusal they cannot mistake for data.
|
|
1608
|
-
/// There is no masked payload left to check a flag against
|
|
1609
|
-
///
|
|
1610
|
-
///
|
|
1611
|
-
///
|
|
1612
|
-
///
|
|
1613
|
-
///
|
|
1614
|
-
///
|
|
1615
|
-
///
|
|
1616
|
-
///
|
|
1617
|
-
/// only thing forcing an update was the masking problem. It was not: the update exists so the
|
|
1618
|
-
/// DENIAL IS RECORDED, and a query cannot write, so making this a query would silently retire
|
|
1619
|
-
/// the audit trail the original comment correctly called worth more than the false answer.
|
|
1620
|
-
/// Staying an update keeps both — the legible refusal AND the record of who was refused — which
|
|
1621
|
-
/// is strictly better than either option the old design had to choose between.
|
|
1622
|
-
///
|
|
1623
|
-
/// ⟨update-for-read⟩ MARKER ADDED 2026-08-23, reasoning above UNCHANGED. This method's reason was already
|
|
1624
|
-
/// written and correct; what it lacked was the glyph a gate can see. Its case is the one the
|
|
1625
|
-
/// update-for-read rule's own text had to be corrected for — the forcing call is not a system API at all, it is
|
|
1626
|
-
/// `denied()`, a state write. (The deploying side's update-for-read check reads this marker.)
|
|
1542
|
+
/// There is no masked payload left to check a flag against, and none of the scaffolding around
|
|
1543
|
+
/// "this method cannot say no in a value" — a three-state ?true/?false/null protocol, and the rule
|
|
1544
|
+
/// that a reader collapsing null to false fabricates a refusal — is load-bearing any more.
|
|
1545
|
+
///
|
|
1546
|
+
/// UPDATE, NOT QUERY, and not because of the masking problem: the update exists so the DENIAL IS
|
|
1547
|
+
/// RECORDED, and a query cannot write, so making this a query would silently retire the audit
|
|
1548
|
+
/// trail, which is worth more than the false answer. Staying an update keeps both — the legible
|
|
1549
|
+
/// refusal AND the record of who was refused. The forcing call is not a system API at all; it is
|
|
1550
|
+
/// `denied()`, a state write.
|
|
1627
1551
|
listEngrams: (offset: nat, limit: nat) -> (Result_14);
|
|
1628
|
-
///
|
|
1629
|
-
///
|
|
1630
|
-
///
|
|
1631
|
-
///
|
|
1632
|
-
/// the failure mode `listAnchorConflicts`' declaration names.
|
|
1552
|
+
/// The caller's OWN dispute statements, oldest first, verbatim. Keyed by `msg.caller`, so it
|
|
1553
|
+
/// cannot be pointed at anyone else, and an empty list is a true answer about the caller ("you have
|
|
1554
|
+
/// appended none"), never a refusal in disguise. Without this read the statements would be a record
|
|
1555
|
+
/// nobody can read — the failure mode `listAnchorConflicts`' declaration names.
|
|
1633
1556
|
listMyAgentDisputes: () -> (vec Dispute) query;
|
|
1634
|
-
/// Every hash
|
|
1635
|
-
/// per-release stamps, so it is complete across the boundary where the list was
|
|
1557
|
+
/// Every hash this registry has published, current first. Union of the explicit list and the
|
|
1558
|
+
/// changelog's per-release stamps, so it is complete across the boundary where the list was
|
|
1559
|
+
/// introduced.
|
|
1636
1560
|
///
|
|
1637
1561
|
/// PUBLIC: the same standing as `isOfficialEngramWasm` above — that one answers about a hash you
|
|
1638
1562
|
/// already hold, this one is how you get the set to compare against.
|
|
@@ -1640,13 +1564,13 @@ service : {
|
|
|
1640
1564
|
/// The FULL predecessor lineage, newest-first: [immediate predecessor, its predecessor, …].
|
|
1641
1565
|
/// Empty for an engram that replaced nothing.
|
|
1642
1566
|
///
|
|
1643
|
-
/// Why transitive (
|
|
1644
|
-
///
|
|
1645
|
-
///
|
|
1567
|
+
/// Why transitive ("free to leave, impossible to hide", decided 2026-08-02): abandonment is
|
|
1568
|
+
/// deliberately NOT rate-limited — friction punishes the owner who mis-provisions on day one, and
|
|
1569
|
+
/// it does not stop anyone determined. What protects the record is that walking away stays
|
|
1646
1570
|
/// VISIBLE. Single-hop visibility does not: A→B→C is three cheap steps, and a stranger checking C
|
|
1647
1571
|
/// would see only B and read it as a near-clean record. Reputation laundering with extra hops is
|
|
1648
|
-
/// still laundering, and it would be
|
|
1649
|
-
/// the cooldown.
|
|
1572
|
+
/// still laundering, and it would be this registry's own feature performing it. The chain is the
|
|
1573
|
+
/// answer, not the cooldown.
|
|
1650
1574
|
///
|
|
1651
1575
|
/// TERMINATION: `seen` is not defensive dressing. predecessorOf is written once per engram at
|
|
1652
1576
|
/// creation and never rewritten, so a cycle should be impossible — but this is a QUERY over
|
|
@@ -1656,17 +1580,16 @@ service : {
|
|
|
1656
1580
|
/// walk even if `seen` itself were somehow defeated.
|
|
1657
1581
|
///
|
|
1658
1582
|
/// PUBLIC: this is the anti-laundering chain — it says an engram is a successor rather than a
|
|
1659
|
-
/// fresh start. Abandon-and-respawn is reputation laundering performed by
|
|
1660
|
-
/// a stranger can walk this, so the walk has to be answerable to a stranger.
|
|
1661
|
-
///
|
|
1662
|
-
///
|
|
1663
|
-
///
|
|
1664
|
-
///
|
|
1665
|
-
///
|
|
1666
|
-
///
|
|
1667
|
-
/// length cap above still hold.
|
|
1583
|
+
/// fresh start. Abandon-and-respawn is reputation laundering performed by this registry's own
|
|
1584
|
+
/// feature unless a stranger can walk this, so the walk has to be answerable to a stranger.
|
|
1585
|
+
///
|
|
1586
|
+
/// An abandoned engram stays in its owner's history, so an engram can name more than one
|
|
1587
|
+
/// predecessor (`ControlHandover.predecessorsFor`), and the lineage is walked a generation at a
|
|
1588
|
+
/// time: every engram this one named, then every engram those named, each listed once. A chain
|
|
1589
|
+
/// with one predecessor per engram reads as a simple chain. The walk is `ControlHandover.lineage`,
|
|
1590
|
+
/// where test/control-handover.test.mo runs it; the `seen` rule and the length cap above hold.
|
|
1668
1591
|
listPredecessors: (canisterId: principal) -> (vec principal) query;
|
|
1669
|
-
///
|
|
1592
|
+
/// The refusal is a value (since 0.16.0).
|
|
1670
1593
|
///
|
|
1671
1594
|
/// `total = 0` reads as "nobody has expressed a preference", and a successor registry seeded from
|
|
1672
1595
|
/// that zero applies the SHIPPED DEFAULT — silently reversing every explicit ManualOnly consent
|
|
@@ -1676,79 +1599,75 @@ service : {
|
|
|
1676
1599
|
/// Mint one-shot reserve invites (invite-issuer or admin). Codes use IC-secure randomness over a
|
|
1677
1600
|
/// 32-symbol no-ambiguous alphabet (8 chars ≈ 40 bits). Batch-capped; table hard-capped.
|
|
1678
1601
|
mintReserveInvites: (count: nat) -> (Result_12);
|
|
1679
|
-
/// The PROBED twin of `getCustodyMode`: same question, asked of the IC rather than of
|
|
1680
|
-
/// records — hence the `probe` verb rather than a second noun.
|
|
1681
|
-
///
|
|
1682
|
-
///
|
|
1683
|
-
///
|
|
1684
|
-
///
|
|
1685
|
-
///
|
|
1686
|
-
///
|
|
1687
|
-
///
|
|
1688
|
-
///
|
|
1689
|
-
///
|
|
1690
|
-
///
|
|
1691
|
-
///
|
|
1692
|
-
///
|
|
1693
|
-
///
|
|
1694
|
-
///
|
|
1695
|
-
/// The
|
|
1696
|
-
///
|
|
1697
|
-
///
|
|
1698
|
-
///
|
|
1699
|
-
///
|
|
1700
|
-
///
|
|
1701
|
-
///
|
|
1702
|
-
///
|
|
1602
|
+
/// The PROBED twin of `getCustodyMode`: same question, asked of the IC rather than of the
|
|
1603
|
+
/// registry's records — hence the `probe` verb rather than a second noun.
|
|
1604
|
+
///
|
|
1605
|
+
/// RENAMED from `getSovereigntyStatus` in 0.16.0 (same concept, same name across canisters). Both
|
|
1606
|
+
/// methods answer the same type, `Result<CustodyMode>`, so the old name introduced a
|
|
1607
|
+
/// SovereigntyStatus noun that no type in this interface has. A reader comparing the two names had
|
|
1608
|
+
/// to open both to learn they were one question; comparing the stems now shows it. What differs is
|
|
1609
|
+
/// HOW the answer is obtained (a live read of the controllers vs the transition records), which is
|
|
1610
|
+
/// exactly what a verb is for. The arity difference is real and stays: `getCustodyMode` answers
|
|
1611
|
+
/// about any canister, this one about the CALLER's own engram.
|
|
1612
|
+
///
|
|
1613
|
+
/// #Managed when this registry is among the engram's controllers, #Sovereign when it is not. The
|
|
1614
|
+
/// controllers are read with the management canister's `canister_info` (`registryControls`), which
|
|
1615
|
+
/// the network answers to any canister. Not `canister_status`: the network answers that only to a
|
|
1616
|
+
/// controller, so it is rejected for exactly the engram a #Sovereign answer describes.
|
|
1617
|
+
///
|
|
1618
|
+
/// The two cases the old `#Unknown` flattened are DIFFERENT facts and answer differently: "you have
|
|
1619
|
+
/// no engram here" is #NotFound, while "the network did not answer" is #Unavailable and means
|
|
1620
|
+
/// retry.
|
|
1621
|
+
///
|
|
1622
|
+
/// The distinction matters more than usual because of what a wrong answer would say. A rejected
|
|
1623
|
+
/// read says nothing about the controllers, so it is NEVER reported as #Sovereign: that would tell
|
|
1624
|
+
/// an owner they had achieved sovereignty they may not have.
|
|
1625
|
+
///
|
|
1626
|
+
/// UPDATE, NOT QUERY, and this is the system call that forces it: the body awaits
|
|
1627
|
+
/// `ic.canister_info`. That is also the whole point of the `probe` verb — the value is read
|
|
1703
1628
|
/// LIVE from the management canister rather than from a stored transition record, so a query
|
|
1704
1629
|
/// could not produce it at all, not merely more cheaply.
|
|
1705
1630
|
probeCustodyMode: () -> (Result_11);
|
|
1706
1631
|
/// What YOUR OWN engram's compute is, read by the registry — the one read that works while it is
|
|
1707
|
-
/// frozen.
|
|
1708
|
-
///
|
|
1709
|
-
///
|
|
1710
|
-
///
|
|
1711
|
-
///
|
|
1712
|
-
///
|
|
1713
|
-
///
|
|
1714
|
-
///
|
|
1715
|
-
///
|
|
1716
|
-
///
|
|
1717
|
-
///
|
|
1718
|
-
///
|
|
1719
|
-
///
|
|
1720
|
-
/// No rate limit (the do-less): each call costs the registry one management
|
|
1721
|
-
/// call — INFERRED a few million cycles, not measured. `eraseAboutNs` is "about" and never invented:
|
|
1722
|
-
/// null when the network reports no idle burn.
|
|
1632
|
+
/// frozen. The registry pays nothing for a stopped engram, so the owner has to be told, with
|
|
1633
|
+
/// signals that work while it is frozen.
|
|
1634
|
+
///
|
|
1635
|
+
/// CALLER: the owner, through their app (every method names its caller). The registry is a
|
|
1636
|
+
/// controller, and the network answers a controller canister's status call for a frozen engram where
|
|
1637
|
+
/// it refuses the owner's own (IC0207; the network's source shows it). UPDATE, NOT QUERY (the
|
|
1638
|
+
/// `probe` verb, as `probeCustodyMode`): the system call that forces it is `canister_status` on the
|
|
1639
|
+
/// management canister, and a query cannot make an inter-canister call, so a query could not read
|
|
1640
|
+
/// the engram's network status at all — and that status is the only signal that still answers
|
|
1641
|
+
/// while the engram is frozen.
|
|
1642
|
+
/// No rate limit: each call costs the registry one management call — INFERRED a few million
|
|
1643
|
+
/// cycles, not measured. `eraseAboutNs` is "about" and never invented: null when the network
|
|
1644
|
+
/// reports no idle burn.
|
|
1723
1645
|
probeMyEngramCompute: () -> (Result_10);
|
|
1724
|
-
/// What an engram OPENED THROUGH ANOTHER is running on, read by the registry — for its key file and
|
|
1725
|
-
/// sign-in (the person), the read `probeMyEngramCompute` is for a first engram's owner.
|
|
1646
|
+
/// What an engram OPENED THROUGH ANOTHER is running on, read by the registry — for its key file and
|
|
1647
|
+
/// its sign-in (the person), the read `probeMyEngramCompute` is for a first engram's owner.
|
|
1726
1648
|
///
|
|
1727
|
-
/// CALLER: the
|
|
1728
|
-
///
|
|
1729
|
-
///
|
|
1730
|
-
///
|
|
1649
|
+
/// CALLER: the person's app, signed in as the person, for a child whose own `getOwnerSignIn` call is
|
|
1650
|
+
/// rejected (an erased child answers nothing) — and the owner kit, as the key file (every method
|
|
1651
|
+
/// names its caller). The registry keeps the person's sign-in for them (`childSignIn`), so the
|
|
1652
|
+
/// person may SEE, not ask and not pay: the ask (`recoverMyEngram`) and the payment (the biller's
|
|
1731
1653
|
/// top-up, admitted only from the key file) stay the key file's. Gated to the child's key file
|
|
1732
1654
|
/// (`canisterToOwner`) and its sign-in AS NOTED HERE (`childSignIn`); refused to everyone else — the
|
|
1733
1655
|
/// parent's owner included — with the SAME words whether or not `child` exists or is a child at all
|
|
1734
|
-
/// (`getEngramOpenedThrough`'s precedent: who works for whom is not disclosed by a refusal).
|
|
1735
|
-
///
|
|
1736
|
-
///
|
|
1737
|
-
///
|
|
1738
|
-
/// `canister_status` on the management canister: a query cannot make an inter-canister call, so it
|
|
1739
|
-
/// could not read an erased child's network status at all.
|
|
1656
|
+
/// (`getEngramOpenedThrough`'s precedent: who works for whom is not disclosed by a refusal).
|
|
1657
|
+
/// UPDATE, NOT QUERY, for `probeMyEngramCompute`'s reason: the system call that forces it is
|
|
1658
|
+
/// `canister_status` on the management canister, and a query cannot make an inter-canister call, so
|
|
1659
|
+
/// it could not read an erased child's network status at all.
|
|
1740
1660
|
probeOpenedEngramCompute: (child: principal) -> (Result_10);
|
|
1741
|
-
///
|
|
1661
|
+
/// `Ok` CARRIES THE PRINCIPAL DIRECTLY (since 0.16.0), not a one-field record wrapping it.
|
|
1742
1662
|
///
|
|
1743
1663
|
/// `#Ok : { canisterId : Principal }` was a record with nothing to disambiguate: the success of a
|
|
1744
1664
|
/// spawn IS the canister it produced. The wrapper cost every caller a field access to reach the
|
|
1745
1665
|
/// only thing the call returns, and invited a second field later that would belong somewhere else.
|
|
1746
1666
|
///
|
|
1747
|
-
///
|
|
1748
|
-
///
|
|
1749
|
-
///
|
|
1750
|
-
///
|
|
1751
|
-
/// ignores a record field the receiver does not declare.
|
|
1667
|
+
/// `opts.genesis` (an optional first file, written as the canister spawned) is retired: an engram
|
|
1668
|
+
/// is created with no content, the owner kit never calls this, and only test harnesses passed one.
|
|
1669
|
+
/// A caller still sending the field is unaffected — Candid ignores a record field the receiver does
|
|
1670
|
+
/// not declare.
|
|
1752
1671
|
provisionEngram: (opts:
|
|
1753
1672
|
opt record {
|
|
1754
1673
|
invite: opt text;
|
|
@@ -1756,37 +1675,36 @@ service : {
|
|
|
1756
1675
|
}) -> (Result_2);
|
|
1757
1676
|
/// RECOVER YOUR OWN ERASED ENGRAM — reinstall it on the SAME id, so its wallet and EVM address come back.
|
|
1758
1677
|
///
|
|
1759
|
-
/// CALLER: the owner
|
|
1760
|
-
///
|
|
1761
|
-
///
|
|
1762
|
-
///
|
|
1763
|
-
/// what does and does not come back.
|
|
1678
|
+
/// CALLER: the owner (a first engram), or an engram's key file through the owner kit's `--recover`
|
|
1679
|
+
/// (an engram an agent opened through another) — every method names its caller. No engram moves
|
|
1680
|
+
/// money on its own, and an erased engram is reinstalled on its id, children included;
|
|
1681
|
+
/// `src/registry/Recover.mo` says what a recover is and what does and does not come back.
|
|
1764
1682
|
///
|
|
1765
1683
|
/// THE ORDER: the owner first adds compute to the empty engram through the biller's existing top-up
|
|
1766
|
-
/// (each step its own tap; nothing here moves money, lends or funds); then this call reads the
|
|
1767
|
-
/// status of the engram as its controller, refuses by name unless the engram is ERASED (no
|
|
1768
|
-
/// holds enough compute to install (`UpgradeFunding.noDipBar` — the line plus the install
|
|
1769
|
-
/// margin; the exact shortfall is named), writes a durable "recover in progress" mark
|
|
1770
|
-
///
|
|
1771
|
-
///
|
|
1772
|
-
///
|
|
1773
|
-
///
|
|
1774
|
-
///
|
|
1775
|
-
///
|
|
1776
|
-
///
|
|
1777
|
-
///
|
|
1778
|
-
///
|
|
1779
|
-
///
|
|
1780
|
-
///
|
|
1781
|
-
/// Refused, before anything is written: not your engram (`#NotFound`); not active, or ABANDONED (
|
|
1782
|
-
///
|
|
1684
|
+
/// (each step its own tap; nothing here moves money, lends or funds); then this call reads the
|
|
1685
|
+
/// network's status of the engram as its controller, refuses by name unless the engram is ERASED (no
|
|
1686
|
+
/// module) and holds enough compute to install (`UpgradeFunding.noDipBar` — the line plus the install
|
|
1687
|
+
/// hold plus a margin; the exact shortfall is named), writes a durable "recover in progress" mark
|
|
1688
|
+
/// and, with it, sets the old record's anchors aside as an earlier era (the certified leaf says so)
|
|
1689
|
+
/// and records `recoveredAtNs` — BEFORE the install, because the record ended at the erase — then
|
|
1690
|
+
/// installs the current template with `#install` ONLY (the network refuses it on a canister that
|
|
1691
|
+
/// holds a module), with the init record from this registry's own records (owner, registry, parent,
|
|
1692
|
+
/// the kept sign-in, `recoveredAtNs`), starts the engram if it was found stopped, and re-sends what a
|
|
1693
|
+
/// newborn is told: its biller, market and metrics reader, and its birth record. No first fee line
|
|
1694
|
+
/// is sent: the balance before the install is not a fee. The mark is removed once the biller is in
|
|
1695
|
+
/// place; until then a second call finishes the work and answers `#Ok` with `finished = true`. The
|
|
1696
|
+
/// compute probes' `recoverOpen` says a recover is open. An upgrade that finds a recover's install
|
|
1697
|
+
/// landed records it first.
|
|
1698
|
+
///
|
|
1699
|
+
/// Refused, before anything is written: not your engram (`#NotFound`); not active, or ABANDONED (an
|
|
1700
|
+
/// abandoned engram is not recovered — withdraw your digital dollars before you abandon an engram);
|
|
1783
1701
|
/// sovereign; a change of owner unfinished; a restart open or
|
|
1784
1702
|
/// a restart/recover call running; an update installing; no template; the status unreadable; NOT ERASED
|
|
1785
1703
|
/// (`#Conflict` — "already recovered at T" when this registry recovered it, and no install); compute
|
|
1786
1704
|
/// under the bar (`#Conflict` naming the shortfall).
|
|
1787
1705
|
recoverMyEngram: () -> (Result_9);
|
|
1788
1706
|
removeAuditViewer: (viewer: principal) -> (Result);
|
|
1789
|
-
///
|
|
1707
|
+
/// `Ok` IS THE ANSWER — the `{ reserved : Bool }` wrapper is gone (since 0.16.0).
|
|
1790
1708
|
///
|
|
1791
1709
|
/// It could only ever hold `true`: the false case was already an `#Err`. A boolean whose only
|
|
1792
1710
|
/// legal value is true is a field that teaches callers to branch on something that never varies,
|
|
@@ -1819,54 +1737,48 @@ service : {
|
|
|
1819
1737
|
/// step, and running this method again picks up where it stopped (it reads the held state from the
|
|
1820
1738
|
/// engram itself). Do not publish a new template while a reset is held.
|
|
1821
1739
|
///
|
|
1822
|
-
///
|
|
1823
|
-
///
|
|
1740
|
+
/// NEVER ON THE CANONICAL DEPLOYMENT, AND NEVER UNASKED ON A `#ManualOnly` ENGRAM — both are checks
|
|
1741
|
+
/// in code, not only words here. A reset reinstalls an engram's code at the wasm admin's request,
|
|
1742
|
+
/// not its owner's. A build that carries the canonical root refuses the reset before anything is
|
|
1743
|
+
/// read (`MemoryReset.canonicalBuild`), and an engram whose owner chose `#ManualOnly` is refused
|
|
1744
|
+
/// unless an earlier reset already holds it (`MemoryReset.MANUAL_ONLY_REFUSAL`), as `pushUpgrade`
|
|
1745
|
+
/// refuses it. On a staging network, as the wasm admin, with the engram's canister id in ENGRAM:
|
|
1824
1746
|
/// icp canister call registry-staging resetEngramMemory "(principal \"$ENGRAM\")" -e ic
|
|
1825
|
-
/// ⟨2026-11-15, beside "Never run on production engrams" above — from an adversarial review⟩ Both are CHECKS now, not
|
|
1826
|
-
/// comments. A build that carries the canonical root refuses the reset before anything is read
|
|
1827
|
-
/// (`MemoryReset.canonicalBuild`), and an engram whose owner chose `#ManualOnly` is refused unless an
|
|
1828
|
-
/// earlier reset already holds it (`MemoryReset.MANUAL_ONLY_REFUSAL`), as `pushUpgrade` refuses it.
|
|
1829
1747
|
resetEngramMemory: (canisterId: principal) -> (Result);
|
|
1830
1748
|
/// Restart YOUR OWN stopped engram.
|
|
1831
1749
|
///
|
|
1832
|
-
/// CALLER: the owner,
|
|
1833
|
-
/// own `convertEarningsToCycles` as the owner, which pays any loan back FIRST.
|
|
1750
|
+
/// CALLER: the owner, through their app (every method names its caller). Afterwards the app runs
|
|
1751
|
+
/// the engram's own `convertEarningsToCycles` as the owner, which pays any loan back FIRST.
|
|
1834
1752
|
///
|
|
1835
|
-
///
|
|
1836
|
-
///
|
|
1837
|
-
///
|
|
1838
|
-
///
|
|
1839
|
-
///
|
|
1840
|
-
/// security
|
|
1841
|
-
///
|
|
1842
|
-
///
|
|
1753
|
+
/// What it does, in this order: stops the engram; adds compute — the owner's own (already added
|
|
1754
|
+
/// through `stopMyEngramForRestart` and a top-up from their account), or a loan of what it still
|
|
1755
|
+
/// lacks to run at its OWN setting (at most 0.25T, only after the biller confirms the wallet holds
|
|
1756
|
+
/// enough to repay it); installs the waiting security release if the engram is behind one and the
|
|
1757
|
+
/// owner allows automatic updates (paid as a security update, so that no restart starts code with a
|
|
1758
|
+
/// known security defect for want of compute); puts the owner's freezing setting back; and only
|
|
1759
|
+
/// then starts it. It never lowers the setting on a running engram. A step that fails never leaves
|
|
1760
|
+
/// the engram stopped: the registry's sweep finishes it within minutes.
|
|
1843
1761
|
///
|
|
1844
1762
|
/// Refused BEFORE anything is stopped, saying why: not your engram; sovereign; a change of owner
|
|
1845
|
-
/// unfinished;
|
|
1846
|
-
///
|
|
1847
|
-
///
|
|
1848
|
-
///
|
|
1849
|
-
///
|
|
1850
|
-
///
|
|
1851
|
-
///
|
|
1852
|
-
///
|
|
1853
|
-
///
|
|
1854
|
-
///
|
|
1855
|
-
/// (`RestartLoan.lendGate`)
|
|
1856
|
-
/// spends the week, which is taken only in the step that
|
|
1857
|
-
///
|
|
1858
|
-
/// other engram
|
|
1859
|
-
///
|
|
1860
|
-
/// biller reads the engram's OWN wallet by its own id, and the engram's own Convert repays. New: a
|
|
1861
|
-
/// second call while one is still running for the same engram (`restartCallsRunning`), which is
|
|
1862
|
-
/// what now keeps two interleaved calls from both lending or both stopping and starting — the week
|
|
1863
|
-
/// used to double as that guard.
|
|
1864
|
-
/// ⟨2026-11-04, beside the lists above⟩ Also refused, first after the status
|
|
1865
|
-
/// read: an ERASED engram (its canister holds no program) — nothing is stopped or lent into it.
|
|
1763
|
+
/// unfinished; an ERASED engram (its canister holds no program; checked first after the status
|
|
1764
|
+
/// read, and nothing is stopped or lent into it); an update installing; a restart already running,
|
|
1765
|
+
/// or a second call while one is still running for the same engram (`restartCallsRunning`, which
|
|
1766
|
+
/// keeps two interleaved calls from both lending or both stopping and starting); code the registry
|
|
1767
|
+
/// never published; running (nothing to restart); needing more than one loan; a waiting security
|
|
1768
|
+
/// update that this restart could not cover (it would start old code); the fleet-wide ceiling; no
|
|
1769
|
+
/// biller, or a wallet too low to repay.
|
|
1770
|
+
///
|
|
1771
|
+
/// THE WEEKLY LIMIT APPLIES ONLY WHEN THE REGISTRY LENDS. "Restarted in the last 7 days" and "a loan
|
|
1772
|
+
/// still owed" refuse ONLY a restart that would LEND — asked once the plan knows the loan, and again
|
|
1773
|
+
/// after every await before the loan is made (`RestartLoan.lendGate`). A restart on the owner's own
|
|
1774
|
+
/// compute is never refused by them and never spends the week, which is taken only in the step that
|
|
1775
|
+
/// records a loan. An engram opened through another engram is lent to under the same ceiling,
|
|
1776
|
+
/// wallet check and repay-first as any other: the biller reads the engram's OWN wallet by its own
|
|
1777
|
+
/// id, and the engram's own Convert repays.
|
|
1866
1778
|
restartMyStoppedEngram: () -> (Result_8);
|
|
1867
1779
|
/// Return to managed: user calls AFTER adding registry back as controller
|
|
1868
1780
|
///
|
|
1869
|
-
///
|
|
1781
|
+
/// Refused for an engram opened through another, which is never independent.
|
|
1870
1782
|
returnToManaged: () -> (Result);
|
|
1871
1783
|
/// Set admin. Authority decision lives in the pure Auth module (unit-tested); this func keeps only
|
|
1872
1784
|
/// the async controller check + applies the outcome. When admin is null: REGISTRY_ROOT or a canister
|
|
@@ -1894,9 +1806,9 @@ service : {
|
|
|
1894
1806
|
/// whole fleet runs is a different authority from operating the registry.
|
|
1895
1807
|
setEngramWasm: (wasm: blob, hash: text) -> (Result);
|
|
1896
1808
|
/// Declare the stored template's release class. Wasm-admin only, and deliberately a SEPARATE call
|
|
1897
|
-
/// from the upload: "this is a security release" is a promise to every owner
|
|
1898
|
-
///
|
|
1899
|
-
///
|
|
1809
|
+
/// from the upload: "this is a security release" is a promise to every owner, paying or not, so it
|
|
1810
|
+
/// should be its own decision with its own audit line — not a parameter someone passes by habit.
|
|
1811
|
+
/// Always re-declare AFTER uploading; an upload resets this to #Feature.
|
|
1900
1812
|
setEngramWasmClass: (class: ReleaseClass) -> (Result);
|
|
1901
1813
|
/// Record the predecessor's final head beside this chain's genesis. Admin-only, and ONE-SHOT.
|
|
1902
1814
|
///
|
|
@@ -1904,12 +1816,11 @@ service : {
|
|
|
1904
1816
|
/// published, changing it would let the same surface that admits a wipe also revise the account
|
|
1905
1817
|
/// of it — which is exactly the power this note exists to deny.
|
|
1906
1818
|
///
|
|
1907
|
-
///
|
|
1908
|
-
///
|
|
1909
|
-
///
|
|
1910
|
-
///
|
|
1911
|
-
///
|
|
1912
|
-
/// therefore uncheckable. The audit label moves with the name (`setGenesisPredecessor.denied`).
|
|
1819
|
+
/// CALLER: this registry's admin, a person, once, after the predecessor chain's final head is
|
|
1820
|
+
/// captured. Not `sys`-prefixed (it was `sysSetGenesisPredecessor` until 2026-10-02): the `sys`
|
|
1821
|
+
/// prefix names the canister-to-canister tier, so an admin-called method inside it made "a `sys`
|
|
1822
|
+
/// method has no human caller" false and therefore uncheckable. The audit label follows the name
|
|
1823
|
+
/// (`setGenesisPredecessor.denied`).
|
|
1913
1824
|
setGenesisPredecessor: (headHash: blob, size: nat) -> (Result);
|
|
1914
1825
|
/// Set (or clear) the least-privilege invite-mint key (admin-only). Mirrors setWasmAdmin.
|
|
1915
1826
|
setInviteIssuer: (p: opt principal) -> (Result);
|
|
@@ -1935,8 +1846,8 @@ service : {
|
|
|
1935
1846
|
/// `claimSovereignty` sets this to `#ManualOnly` as a side effect, since a registry that is no
|
|
1936
1847
|
/// longer a controller could not honour anything else.
|
|
1937
1848
|
///
|
|
1938
|
-
///
|
|
1939
|
-
///
|
|
1849
|
+
/// An engram opened through another is refused `#ManualOnly`: it takes this registry's updates
|
|
1850
|
+
/// automatically for life.
|
|
1940
1851
|
setUpdatePreference: (pref: UpdatePreference) -> (Result);
|
|
1941
1852
|
/// Set the spawn-ceiling dial (admin-only, audit-logged, bounded 1..SPAWN_CEILING_MAX).
|
|
1942
1853
|
/// The effective daily cap stays min(ceiling, reserve-derived) — raising the dial never
|
|
@@ -1948,56 +1859,53 @@ service : {
|
|
|
1948
1859
|
setWasmAdmin: (p: opt principal) -> (Result);
|
|
1949
1860
|
/// Stop YOUR OWN stopped-or-starving engram so you can add compute from your account and restart it.
|
|
1950
1861
|
///
|
|
1951
|
-
/// CALLER: the owner,
|
|
1952
|
-
///
|
|
1953
|
-
///
|
|
1954
|
-
///
|
|
1955
|
-
///
|
|
1956
|
-
///
|
|
1957
|
-
///
|
|
1958
|
-
///
|
|
1959
|
-
///
|
|
1960
|
-
/// program): there is nothing to restart, and nothing is stopped.
|
|
1862
|
+
/// CALLER: the owner, through their app, when the engram has stopped and a security update is
|
|
1863
|
+
/// waiting (every method names its caller). It stops the engram so that compute the owner adds next
|
|
1864
|
+
/// cannot wake its old code; the owner then adds compute through the biller's own top-up and calls
|
|
1865
|
+
/// `restartMyStoppedEngram`, which installs the waiting update and starts it. If the owner walks
|
|
1866
|
+
/// away, the sweep finishes it after 30 minutes: install if covered, restore, start. Never left
|
|
1867
|
+
/// stopped. It lends nothing, so it takes no week; it refuses an engram that is not stuck, so a
|
|
1868
|
+
/// healthy engram is never taken offline (a build choice, not a requirement). It also refuses an
|
|
1869
|
+
/// ERASED engram (its canister holds no program): there is nothing to restart, and nothing is
|
|
1870
|
+
/// stopped.
|
|
1961
1871
|
stopMyEngramForRestart: () -> (Result_6);
|
|
1962
1872
|
/// An engram witnesses its own audit head. Callable ONLY by a registered engram — msg.caller is
|
|
1963
1873
|
/// the engram principal, so attribution needs no signature and cannot be forged by a third party.
|
|
1964
1874
|
///
|
|
1965
|
-
/// The registry witnesses; it does not adjudicate.
|
|
1966
|
-
///
|
|
1967
|
-
///
|
|
1875
|
+
/// The registry witnesses; it does not adjudicate. Two shapes are permanently recorded as
|
|
1876
|
+
/// conflicts rather than rejected, because a rejection leaves no evidence and evidence is the
|
|
1877
|
+
/// entire product here:
|
|
1968
1878
|
/// - same total, different head → the log was rewritten under a fixed count
|
|
1969
1879
|
/// - total went backwards → an append-only count cannot decrease honestly
|
|
1970
|
-
///
|
|
1971
|
-
///
|
|
1880
|
+
/// One exception to "recorded rather than rejected" (conflicts are never deleted, submissions are
|
|
1881
|
+
/// capped, and the refusals are counted): an engram that already has
|
|
1972
1882
|
/// `AnchorConflicts.MAX_CONFLICTS_PER_ENGRAM` recorded contradictions gets `#Conflict` naming
|
|
1973
1883
|
/// this method, and the refusal is COUNTED in its certified leaf (`refusedConflicts`). The
|
|
1974
1884
|
/// evidence is not lost — the recorded ones stay forever and the count certifies that more came.
|
|
1975
|
-
///
|
|
1976
|
-
///
|
|
1977
|
-
///
|
|
1978
|
-
///
|
|
1979
|
-
///
|
|
1980
|
-
///
|
|
1981
|
-
/// The market already calls it under this name, which is how the rename got its urgency: a
|
|
1982
|
-
/// hand-written client IDL type-checks against a method that does not exist.
|
|
1885
|
+
///
|
|
1886
|
+
/// `sys`-prefixed because it is called canister-to-canister (an engram or the market pushing its
|
|
1887
|
+
/// head here), never by a person, and the `sys` prefix is what tells a reader scanning the surface
|
|
1888
|
+
/// which methods are machine-to-machine. It was `anchorHead` before 0.16.0 — a mutation wearing a
|
|
1889
|
+
/// noun, and a `sys` edge that did not say so. The market calls it under this name.
|
|
1983
1890
|
sysAnchorHead: (head: blob, total: nat) -> (Result);
|
|
1984
1891
|
/// CALLER: an engram, from inside its owner's `convertEarningsToCycles`, once the conversion landed
|
|
1985
|
-
/// (
|
|
1986
|
-
/// (the network returns the rest) and records it. `#NotFound` when nothing is owed
|
|
1987
|
-
/// written off, or repaid): the engram then clears its own record.
|
|
1988
|
-
///
|
|
1989
|
-
/// (the restart
|
|
1990
|
-
///
|
|
1991
|
-
///
|
|
1892
|
+
/// (every method names its caller). Attach up to what is owed: the registry accepts no more than the
|
|
1893
|
+
/// outstanding loan (the network returns the rest) and records it. `#NotFound` when nothing is owed
|
|
1894
|
+
/// (the loan was written off, or repaid): the engram then clears its own record.
|
|
1895
|
+
/// REPAY-ONLY. It puts no freezing setting back (the restart restores it before the start) and
|
|
1896
|
+
/// queues no security push (the restart installs it before the start; the wake watcher covers other
|
|
1897
|
+
/// wakes). Its name and reply are kept from when it did both, so the engram's hand client still
|
|
1898
|
+
/// matches.
|
|
1992
1899
|
sysCloseRestart: () -> (Result_5);
|
|
1993
|
-
///
|
|
1994
|
-
///
|
|
1995
|
-
///
|
|
1996
|
-
///
|
|
1997
|
-
///
|
|
1998
|
-
///
|
|
1999
|
-
///
|
|
2000
|
-
/// marked (a report sent again), refused by
|
|
1900
|
+
/// A SOVEREIGN engram reports that it moved control of its code to `newOwner`, which ends the
|
|
1901
|
+
/// change of owner this registry marked when it moved its record (`ControlHandover.Pending`).
|
|
1902
|
+
/// Until this arrives the registry refuses the new owner's control-changing calls on the engram.
|
|
1903
|
+
/// The registry can read a sovereign engram's controllers (`registryControls`, by `canister_info`),
|
|
1904
|
+
/// but it does not read them on this path: it relies on the engram's report. Gated like
|
|
1905
|
+
/// `sysNotifyOwnershipTransfer` (the caller must BE the engram), and only for an engram recorded as
|
|
1906
|
+
/// sovereign: a managed engram's transfer ends inside `sysNotifyOwnershipTransfer`, where the
|
|
1907
|
+
/// registry moves control itself. `#Ok` when nothing is marked (a report sent again), refused by
|
|
1908
|
+
/// name when the mark is for another owner.
|
|
2001
1909
|
///
|
|
2002
1910
|
/// TRUST: the same as `sysNotifyOwnershipTransfer` and `sysRevertOwnershipTransfer` — the
|
|
2003
1911
|
/// registry takes a sovereign engram's word, and whoever controls a sovereign engram's code can
|
|
@@ -2009,61 +1917,59 @@ service : {
|
|
|
2009
1917
|
/// cycles-attached like the sweep; same row semantics, one engram, no heartbeat stamp
|
|
2010
1918
|
/// (a single probe is not a completed round).
|
|
2011
1919
|
sysMeterEngram: (canisterId: principal) -> (Result_4);
|
|
2012
|
-
/// CALLER: an engram opened through another, from inside its three sign-in writers —
|
|
2013
|
-
/// `declineSignIn` (the sign-in's own decline) and `acceptSignIn` — BEFORE it
|
|
2014
|
-
///
|
|
2015
|
-
///
|
|
2016
|
-
///
|
|
2017
|
-
///
|
|
2018
|
-
/// Refused, with nothing written: a caller this registry did not open through another engram (a
|
|
2019
|
-
/// engram has no sign-in; anything else is no engram here), and a sign-in the door would
|
|
2020
|
-
/// birth (`ChildDoor.signInRefusal` — the key file itself, the anonymous principal, a
|
|
1920
|
+
/// CALLER: an engram opened through another, from inside its three sign-in writers —
|
|
1921
|
+
/// `setOwnerSignIn`, `declineSignIn` (the sign-in's own decline) and `acceptSignIn` — BEFORE it
|
|
1922
|
+
/// writes its own seat (every method names its caller). The registry keeps the child's seated
|
|
1923
|
+
/// sign-in (`childSignIn` says why, and why the order is registry-first): `?p` notes `p` as the
|
|
1924
|
+
/// sign-in, `null` notes that none is seated. A record argument, so it can grow by opt fields (an
|
|
1925
|
+
/// argument tuple is frozen once released).
|
|
1926
|
+
/// Refused, with nothing written: a caller this registry did not open through another engram (a
|
|
1927
|
+
/// first engram has no sign-in; anything else is no engram here), and a sign-in the door would
|
|
1928
|
+
/// refuse at birth (`ChildDoor.signInRefusal` — the key file itself, the anonymous principal, a
|
|
1929
|
+
/// canister).
|
|
2021
1930
|
sysNoteChildSignIn: (req: record {signIn: opt principal;}) -> (Result);
|
|
2022
|
-
///
|
|
1931
|
+
/// An engram tells this registry that its owner reset it.
|
|
2023
1932
|
///
|
|
2024
1933
|
/// CALLER: a registered engram, about itself — `canisterToOwner` membership, checked first
|
|
2025
|
-
/// (
|
|
2026
|
-
///
|
|
2027
|
-
///
|
|
2028
|
-
///
|
|
1934
|
+
/// (every `sys` method names and checks its caller). The engram sends it from its reset path. WHY
|
|
1935
|
+
/// IT EXISTS: a reset purges the engram's roster, and the endings it sends reach this registry only
|
|
1936
|
+
/// for agents still active, so a reset after the last agent left would reach this registry nowhere
|
|
1937
|
+
/// and the engram would read as kept.
|
|
2029
1938
|
///
|
|
2030
1939
|
/// Records the DAY the registry heard it (`resetDaysOf`), once per day: a second notice the same
|
|
2031
1940
|
/// day answers `#Ok` and writes nothing. Past `Funnel.MAX_RESET_DAYS_PER_ENGRAM` days it is refused
|
|
2032
1941
|
/// `#Conflict` and nothing is stored. Served only on `listEngagementRows`' rows, to the admin and
|
|
2033
1942
|
/// audit viewers — never public.
|
|
2034
1943
|
sysNoteReset: () -> (Result);
|
|
2035
|
-
///
|
|
1944
|
+
/// The engram tells this registry that custody moved (since 0.16.0).
|
|
2036
1945
|
///
|
|
2037
|
-
/// WHAT IT FIXES: `transferOwnership` lives on the ENGRAM and
|
|
1946
|
+
/// WHAT IT FIXES: `transferOwnership` lives on the ENGRAM, and without this method it told the
|
|
2038
1947
|
/// registry nothing. `verifyEngramActiveOwner` — the biller's money gate — therefore kept
|
|
2039
|
-
/// answering for the ORIGINAL owner, so a new owner could not fund the engram they now own.
|
|
2040
|
-
///
|
|
2041
|
-
///
|
|
2042
|
-
///
|
|
2043
|
-
///
|
|
2044
|
-
///
|
|
2045
|
-
///
|
|
2046
|
-
///
|
|
2047
|
-
/// it, so no claim in the argument needs trusting — the identity is the authority.
|
|
2048
|
-
///
|
|
2049
|
-
/// ⟨2026-09-28: the mirror is now `sysRecordAgentEdge`, and the difference below is gone — the
|
|
2050
|
-
/// silent `()` notify was deleted and its successor answers `Wire.Result` too, for this reason.⟩
|
|
2051
|
-
/// ONE DELIBERATE DIFFERENCE FROM THAT MIRROR: it returns `Wire.Result`, where the agent-edge
|
|
2052
|
-
/// notify returns `()` and silently ignores strangers. The engram must COMMIT ONLY ON `#Ok` (see
|
|
1948
|
+
/// answering for the ORIGINAL owner, so a new owner could not fund the engram they now own.
|
|
1949
|
+
///
|
|
1950
|
+
/// THE TELLER PROBLEM IS SOLVED AS IN `sysRecordAgentEdge`, deliberately copied rather than
|
|
1951
|
+
/// invented: `msg.caller` is looked up in `canisterToOwner`. The caller IS the engram whose
|
|
1952
|
+
/// ownership changed, and this registry spawned it, so no claim in the argument needs trusting —
|
|
1953
|
+
/// the identity is the authority.
|
|
1954
|
+
///
|
|
1955
|
+
/// IT ANSWERS `Wire.Result`, as `sysRecordAgentEdge` does. The engram must COMMIT ONLY ON `#Ok` (see
|
|
2053
1956
|
/// its `transferOwnership`), so a silent refusal here would be read as success there and put the
|
|
2054
1957
|
/// two canisters back into exactly the disagreement this seam exists to end. A refusal that cannot
|
|
2055
1958
|
/// be heard is worse than no refusal.
|
|
2056
1959
|
///
|
|
2057
|
-
///
|
|
2058
|
-
///
|
|
2059
|
-
///
|
|
2060
|
-
///
|
|
2061
|
-
///
|
|
2062
|
-
///
|
|
1960
|
+
/// ONLY ONTO AN OFFER THE NEW OWNER ACCEPTED HERE, AS THEMSELVES (`OwnershipOffer.moveRefusal`;
|
|
1961
|
+
/// see `sysOfferOwnership` and `acceptEngramOffer`). A report without an acceptance touches nothing
|
|
1962
|
+
/// filed under `newOwner`. A retry needs none: its record moved under an acceptance already.
|
|
1963
|
+
///
|
|
1964
|
+
/// COLLISION IS REFUSED, NOT ABSORBED. `engrams` is keyed BY OWNER, and three guards enforce
|
|
1965
|
+
/// one-engram-per-owner. Relaxing that rule was considered and declined: the spawn path's own
|
|
1966
|
+
/// comment warns that "a change to that rule must touch all three, and grepping the error TEXT
|
|
1967
|
+
/// finds only two of them", so the relaxation is the option most likely to leave a guard behind.
|
|
1968
|
+
/// The check below mirrors the spawn guard EXACTLY — active AND not abandoned — because an
|
|
1969
|
+
/// abandoned engram is not a live claim on its owner's slot.
|
|
2063
1970
|
///
|
|
2064
|
-
///
|
|
2065
|
-
///
|
|
2066
|
-
/// the former owner stayed a controller and could still replace the code. Now:
|
|
1971
|
+
/// IT MOVES CONTROL OF THE CODE TOO, or tells the engram to, so that the former owner does not stay
|
|
1972
|
+
/// a controller who could still replace the code:
|
|
2067
1973
|
/// · MANAGED (the registry is a controller): the registry sets the controllers to itself and the
|
|
2068
1974
|
/// new owner and answers `#MovedByRegistry`. If that fails, the record is put back and the
|
|
2069
1975
|
/// answer is `#Err` — the engram then does not change owner.
|
|
@@ -2076,8 +1982,10 @@ service : {
|
|
|
2076
1982
|
/// a transfer the engram did not finish, and moves control again (that is the way out `stuck`
|
|
2077
1983
|
/// names). The rules are in `src/shared/ControlHandover.mo`.
|
|
2078
1984
|
sysNotifyOwnershipTransfer: (newOwner: principal) -> (Result_3);
|
|
2079
|
-
///
|
|
2080
|
-
///
|
|
1985
|
+
/// AN ENGRAM FILES ITS OWNER'S OFFER of a change of owner to `newOwner` (the engram's
|
|
1986
|
+
/// `transferOwnership`). The new owner must accept it (`acceptEngramOffer`) before anything moves:
|
|
1987
|
+
/// when the record moved on the engram's word alone, an engram's owner could hand an engram to a
|
|
1988
|
+
/// principal who had made no call.
|
|
2081
1989
|
///
|
|
2082
1990
|
/// IT MOVES NOTHING. The record of who owns the engram, control of its code, the predecessor
|
|
2083
1991
|
/// links and everything filed under `newOwner`'s key are untouched; `newOwner` is not looked up at
|
|
@@ -2094,16 +2002,14 @@ service : {
|
|
|
2094
2002
|
/// TRUST: the engram's word is taken for the OFFER only, and an offer binds nobody. The
|
|
2095
2003
|
/// acceptance is `acceptEngramOffer`, which only the named principal can make.
|
|
2096
2004
|
sysOfferOwnership: (newOwner: principal, expiresAtNs: int) -> (Result);
|
|
2097
|
-
/// ⟨2026-10-01, the owner's ruling of that day: build this now, not at the first paid engagement⟩
|
|
2098
2005
|
/// THE SPONSORED DOOR. An engram opens an engram for one of its agents: the caller is the engram
|
|
2099
2006
|
/// (the engram it is opened from — `parentOf` in code), `ownerKey` is the agent's LASTING key, which
|
|
2100
2007
|
/// owns what is opened, and the cycles the opened engram lives on are the ones the caller ATTACHES.
|
|
2101
2008
|
///
|
|
2102
2009
|
/// CALLER: a registered engram — `canisterToOwner` membership, checked first, exactly as
|
|
2103
|
-
/// `sysRecordAgentEdge` checks it (
|
|
2104
|
-
///
|
|
2105
|
-
///
|
|
2106
|
-
/// registry can know.
|
|
2010
|
+
/// `sysRecordAgentEdge` checks it (every `sys` method names and checks its caller). The engram's own
|
|
2011
|
+
/// rules (the owner's standing allowance for this agent, its frozen-payments state, its balance) are
|
|
2012
|
+
/// the engram's to check before it calls; this method checks what only the registry can know.
|
|
2107
2013
|
///
|
|
2108
2014
|
/// NOTHING IS ACCEPTED UNTIL EVERY CHECK HAS PASSED (`ChildDoor.admission`, cheapest first), so
|
|
2109
2015
|
/// every refusal before the accept returns the attached cycles to the caller by construction —
|
|
@@ -2112,12 +2018,9 @@ service : {
|
|
|
2112
2018
|
/// the reply says how much came back;
|
|
2113
2019
|
/// · the template will not install after one retry → the cycles are INSIDE the new canister and
|
|
2114
2020
|
/// no canister can withdraw another's cycles. The one honest exception to "returned on every
|
|
2115
|
-
/// failure": nothing is recorded, and the reply names the canister
|
|
2116
|
-
///
|
|
2117
|
-
///
|
|
2118
|
-
/// controls an opened engram⟩ The controller is THIS REGISTRY ALONE; the key is not one and can install
|
|
2119
|
-
/// nothing. The reply names the canister and says the cycles sit in it unrecorded, for whoever
|
|
2120
|
-
/// runs this deployment to decide on;
|
|
2021
|
+
/// failure": nothing is recorded, and the reply names the canister and says the cycles sit in
|
|
2022
|
+
/// it unrecorded, for whoever runs this deployment to decide on (its only controller is this
|
|
2023
|
+
/// registry; the key can install nothing);
|
|
2121
2024
|
/// · the key came to own an engram during the awaits → the new canister is named, nothing is
|
|
2122
2025
|
/// recorded (the same third guard `spawnEngramFor` carries).
|
|
2123
2026
|
///
|
|
@@ -2125,12 +2028,11 @@ service : {
|
|
|
2125
2028
|
/// with first engrams); it never writes a predecessor (a key with any record was refused); it never
|
|
2126
2029
|
/// consults the reserve gate (the parent owner's approval is this door's admission — the gate's
|
|
2127
2030
|
/// arming note stays on `provisionEngram`); it never tells the calling engram anything but this
|
|
2128
|
-
/// reply. No payment AMOUNT reaches it (money is the biller's, cycles are the registry's): it
|
|
2031
|
+
/// reply. No payment AMOUNT reaches it (money is the biller's, cycles are the registry's): it
|
|
2032
|
+
/// carries cycles and a key, nothing else.
|
|
2129
2033
|
///
|
|
2130
|
-
/// THE RATE LIMIT
|
|
2131
|
-
/// first engrams
|
|
2132
|
-
/// `effectiveDailyCap`⟩. The door shares only the DIAL (`spawnCeiling`) and the WINDOW LENGTH (24
|
|
2133
|
-
/// hours). Its count is its own (`sponsoredCreationTimestampsBuf`, pruned by
|
|
2034
|
+
/// THE RATE LIMIT. The door shares only the DIAL (`spawnCeiling`) and the WINDOW LENGTH (24 hours)
|
|
2035
|
+
/// with first engrams. Its count is its own (`sponsoredCreationTimestampsBuf`, pruned by
|
|
2134
2036
|
/// `pruneSponsoredWindow`), its in-flight count is its own (`sponsoredInFlight`), and its cap is
|
|
2135
2037
|
/// `spawnCeiling` alone — the reserve-derived term never applies, because the opened engram lives
|
|
2136
2038
|
/// on the cycles the caller attached and the registry funds nothing. So an opening never uses up a
|
|
@@ -2146,8 +2048,7 @@ service : {
|
|
|
2146
2048
|
/// WHAT WOULD MAKE THIS WRONG: a second path that writes `parentOf`, or an `await` placed between
|
|
2147
2049
|
/// the post-await re-check and the record below.
|
|
2148
2050
|
///
|
|
2149
|
-
///
|
|
2150
|
-
/// you recommended"⟩ CONTROLLED BY THIS REGISTRY ALONE, AND BORN KNOWING ITS PARENT AND ITS SIGN-IN.
|
|
2051
|
+
/// CONTROLLED BY THIS REGISTRY ALONE, AND BORN KNOWING ITS PARENT AND ITS SIGN-IN.
|
|
2151
2052
|
/// The canister's controllers are `[this registry]` — the key is not a controller, so it can never
|
|
2152
2053
|
/// reinstall, delete or re-control the engram; only this registry installs code on it. Such an
|
|
2153
2054
|
/// engram is managed for life: `claimSovereignty`, `returnToManaged`, `abandonMyEngram`, a
|
|
@@ -2156,162 +2057,119 @@ service : {
|
|
|
2156
2057
|
/// running the agent (`ChildDoor.signInRefusal` refuses the key itself, the anonymous principal and
|
|
2157
2058
|
/// a canister); it and the parent travel in the engram's init record, so the engram knows both
|
|
2158
2059
|
/// before it answers its first message. `null` = no sign-in: the engram keeps small limits for life.
|
|
2159
|
-
///
|
|
2160
|
-
///
|
|
2161
|
-
///
|
|
2162
|
-
///
|
|
2163
|
-
///
|
|
2164
|
-
///
|
|
2165
|
-
///
|
|
2166
|
-
///
|
|
2167
|
-
///
|
|
2168
|
-
/// change still calls `sysSpawnChild`; this registry no longer serves it, so that call is REJECTED
|
|
2169
|
-
/// (IC0536, a reject the engram's `try` catches — a probe of the interface-evolution rule), the attached cycles come back
|
|
2170
|
-
/// as the call's refund, and nothing is opened. An older engram therefore never opens an engram with
|
|
2171
|
-
/// no sign-in by accident; it opens them again once it runs a template that calls this method.
|
|
2172
|
-
/// (Was: the one-argument call decoded `signIn` as `null` — INFERRED for moc 2.1.0, never witnessed.)
|
|
2060
|
+
///
|
|
2061
|
+
/// ONE RECORD ARGUMENT. Later fields are opt fields of this record, never another argument: an
|
|
2062
|
+
/// argument TUPLE is frozen once released (evolution happens inside records), and the interface
|
|
2063
|
+
/// gate reads a grown tuple as ILLEGAL. This door was `sysSpawnChild(ownerKey : Principal)`, which
|
|
2064
|
+
/// is REMOVED. An engram built before the change still calls `sysSpawnChild`; this registry no
|
|
2065
|
+
/// longer serves it, so that call is REJECTED (IC0536, a reject the engram's `try` catches), the
|
|
2066
|
+
/// attached cycles come back as the call's refund, and nothing is opened. An older engram therefore
|
|
2067
|
+
/// never opens an engram with no sign-in by accident; it opens them again once it runs a template
|
|
2068
|
+
/// that calls this method.
|
|
2173
2069
|
sysOpenChild: (req: record {
|
|
2174
2070
|
ownerKey: principal;
|
|
2175
2071
|
signIn: opt principal;
|
|
2176
2072
|
}) -> (Result_2);
|
|
2177
|
-
/// ⟨2026-09-28, owner decision: build the full agent track-record design for the launch release⟩
|
|
2178
2073
|
/// An engram tells this registry that one of its agents started, or ended and WHY.
|
|
2179
2074
|
///
|
|
2180
|
-
///
|
|
2181
|
-
/// beside this (the owner's building-phase rule of 2026-09-27: no backward compatibility; the
|
|
2182
|
-
/// next release installs every engram fresh). Three things changed, each on purpose:
|
|
2075
|
+
/// Three properties, each on purpose:
|
|
2183
2076
|
/// 1. THE REASON IS REQUIRED. `#Ended` carries an `Engagements.EndReason` sent from the one
|
|
2184
2077
|
/// engram site that knows it. There is no reasonless ending and no "unknown" arm.
|
|
2185
|
-
/// 2. IT IS ACKNOWLEDGED.
|
|
2186
|
-
///
|
|
2187
|
-
///
|
|
2078
|
+
/// 2. IT IS ACKNOWLEDGED. It answers `Wire.Result`, and the engram logs any non-`#Ok` where its
|
|
2079
|
+
/// owner can see it. Its deleted predecessor, `sysNotifyOperatorEdge`, returned `()` and
|
|
2080
|
+
/// silently ignored a stranger, so the engram discarded the outcome and a lost ending was
|
|
2081
|
+
/// invisible on both sides.
|
|
2188
2082
|
/// 3. ONE RECORD ARGUMENT, not positional args — the same reshape `signX402Payment` took, so a
|
|
2189
2083
|
/// later field is a named addition rather than a tuple that silently shifts.
|
|
2190
2084
|
///
|
|
2191
2085
|
/// AUTH: the caller MUST be an engram this registry spawned (`canisterToOwner` membership), so an
|
|
2192
|
-
/// engram can only assert edges about ITSELF — `msg.caller` IS the engram
|
|
2193
|
-
///
|
|
2194
|
-
///
|
|
2195
|
-
///
|
|
2196
|
-
///
|
|
2197
|
-
///
|
|
2198
|
-
///
|
|
2199
|
-
///
|
|
2200
|
-
///
|
|
2201
|
-
///
|
|
2202
|
-
///
|
|
2203
|
-
///
|
|
2204
|
-
///
|
|
2205
|
-
///
|
|
2206
|
-
///
|
|
2207
|
-
///
|
|
2208
|
-
///
|
|
2209
|
-
///
|
|
2210
|
-
///
|
|
2211
|
-
///
|
|
2212
|
-
///
|
|
2213
|
-
///
|
|
2214
|
-
///
|
|
2215
|
-
///
|
|
2216
|
-
///
|
|
2217
|
-
///
|
|
2218
|
-
///
|
|
2219
|
-
///
|
|
2220
|
-
///
|
|
2221
|
-
/// ⟨MOVED 2026-09-29, a review finding: the correction above stood in the middle of this
|
|
2222
|
-
/// paragraph, so the sentence it corrects came after it and read as the last word — in this file
|
|
2223
|
-
/// and in the published registry.did.⟩
|
|
2224
|
-
/// ⟨2026-09-29, a review finding⟩ An engagement is matched on the enrolled key AND the invite
|
|
2225
|
-
/// its statement names, not on the key alone: one statement opens at most one engagement, and a
|
|
2226
|
-
/// key the engram re-admits after a reset, under a fresh statement for a fresh invite, opens a new
|
|
2227
|
-
/// one (`Engagements.admit`).
|
|
2228
|
-
/// ⟨CORRECTED 2026-09-29, a review finding: "a repeated `#Ended` writes nothing, and both
|
|
2229
|
-
/// answer `#Ok`" is now narrower. An ending names the engagement it ends (the enrolled key and the
|
|
2230
|
-
/// invite) and the day the engram recorded it, because a lost ending is now RE-SENT by the
|
|
2231
|
-
/// engram's `resyncAgentEdges`. The same ending again answers `#Ok` and writes nothing; one
|
|
2232
|
-
/// giving another reason for an engagement already ended is refused `#Conflict`; one naming an
|
|
2233
|
-
/// engagement never recorded here is refused `#NotFound` (`Engagements.closeVerdict`).⟩
|
|
2086
|
+
/// engram can only assert edges about ITSELF — `msg.caller` IS the engram.
|
|
2087
|
+
///
|
|
2088
|
+
/// THE SUBJECT IS THE AGENT'S ROOT (`ev.root`), not the key that operates on the engram: one
|
|
2089
|
+
/// lasting identity per agent, with one root key per agent and an enrolled key per client. So every
|
|
2090
|
+
/// structure written here is keyed by agent: one agent across twenty-five engrams is one record, one
|
|
2091
|
+
/// live-index row and one summary. The root is not taken on the engram's word: an engram's owner is
|
|
2092
|
+
/// a controller of its canister and can install code that reports any root, so a start carries the
|
|
2093
|
+
/// root's enrolment statement (`Engagements.EnrolmentProof`) and THIS method verifies it
|
|
2094
|
+
/// (`EdgeProof.rootOf`), and refuses past `Engagements.MAX_ENGAGEMENTS_PER_ENGRAM`. The enrolled key
|
|
2095
|
+
/// therefore reaches the registry, stored on the engagement record and never served. The ending's
|
|
2096
|
+
/// reason is the owner's assertion; the agent's remedy for a false one is its dispute.
|
|
2097
|
+
///
|
|
2098
|
+
/// An engagement is matched on the enrolled key AND the invite its statement names, not on the key
|
|
2099
|
+
/// alone: one statement opens at most one engagement, and a key the engram re-admits after a reset,
|
|
2100
|
+
/// under a fresh statement for a fresh invite, opens a new one (`Engagements.admit`).
|
|
2101
|
+
///
|
|
2102
|
+
/// IDEMPOTENT: a repeated `#Added` mints no duplicate and answers `#Ok`. An ending names the
|
|
2103
|
+
/// engagement it ends (the enrolled key and the invite) and the day the engram recorded it, because
|
|
2104
|
+
/// a lost ending is RE-SENT by the engram's `resyncAgentEdges`. The same ending again answers `#Ok`
|
|
2105
|
+
/// and writes nothing; one giving another reason for an engagement already ended is refused
|
|
2106
|
+
/// `#Conflict`; one naming an engagement never recorded here is refused `#NotFound`
|
|
2107
|
+
/// (`Engagements.closeVerdict`).
|
|
2108
|
+
///
|
|
2109
|
+
/// It writes five things and nothing else: the live reverse index (`agentToEngrams`, which still
|
|
2110
|
+
/// forgets an agent at its last edge), the remembered engagement (`agentEngagements`, which never
|
|
2111
|
+
/// forgets), that agent's certified summary (`putStandingLeaf`), the cut-off of an engram opened
|
|
2112
|
+
/// through this one when a recorded ending ends its key's engagement (`cutOff`), and, for a start
|
|
2113
|
+
/// that opens an engagement, the next place in the recording order (`engagementOrder`) — in the same
|
|
2114
|
+
/// step as the record, so the order never names a record that is not there.
|
|
2234
2115
|
sysRecordAgentEdge: (ev: record {
|
|
2235
2116
|
event: EdgeEvent;
|
|
2236
2117
|
root: principal;
|
|
2237
2118
|
}) -> (Result);
|
|
2238
|
-
/// CALLER: an engram, from inside its `sysReturnUpgradeAdvance` (
|
|
2239
|
-
/// given back of the compute a paid security update advanced it.
|
|
2240
|
-
///
|
|
2241
|
-
///
|
|
2242
|
-
///
|
|
2243
|
-
///
|
|
2244
|
-
///
|
|
2245
|
-
///
|
|
2246
|
-
///
|
|
2247
|
-
/// advance
|
|
2248
|
-
///
|
|
2249
|
-
///
|
|
2250
|
-
///
|
|
2251
|
-
///
|
|
2252
|
-
/// `
|
|
2253
|
-
///
|
|
2254
|
-
///
|
|
2255
|
-
/// NEWEST first, not oldest first: the engram can
|
|
2256
|
-
/// give back only what it holds above its balance before the latest deposit, so the cycles are the
|
|
2257
|
-
/// newest advance's (RestartLoan.repayAdvances says why, and when that reading is wrong).
|
|
2258
|
-
/// ⟨CHANGED 2026-10-26, the owner's give-back ruling: "take back only what we added; anything left
|
|
2259
|
-
/// over goes to the 90-day write-off"⟩ The engram now names THE ADVANCE it is giving back
|
|
2260
|
-
/// (`advanceId`, which the registry handed it in `sysReturnUpgradeAdvance` — the one this install's
|
|
2261
|
-
/// deposit put on the ledger). The registry accepts AT MOST THAT ADVANCE'S AMOUNT, settles THAT
|
|
2262
|
-
/// entry alone (returned + written off = its amount, one `upgrade.advance.returned` line naming its
|
|
2263
|
-
/// release and id) and leaves every other advance of the engram on the ledger, for its own
|
|
2264
|
-
/// give-back or the 90-day write-off. The paragraphs above about "the sum", "settled OLDEST FIRST"
|
|
2265
|
-
/// and "NEWEST first" describe the shape this replaces. An id that is not on the ledger for this
|
|
2266
|
-
/// caller (already settled, written off after 90 days, or never its own) accepts nothing — the
|
|
2267
|
-
/// network returns the attached cycles to the engram — and answers `#NotFound`; when a recorded
|
|
2268
|
-
/// engram attached cycles, an `upgrade.advance.notOut` line in the registry's unchained refusal log
|
|
2269
|
-
/// says so (never the chained audit log: it moves nothing, and any engram can send it). Nothing is
|
|
2270
|
-
/// ever counted twice.
|
|
2119
|
+
/// CALLER: an engram, from inside its `sysReturnUpgradeAdvance` (every method names its caller).
|
|
2120
|
+
/// Attach what is being given back of the compute a paid security update advanced it.
|
|
2121
|
+
///
|
|
2122
|
+
/// The registry takes back only what it added; anything left over goes to the write-off, never
|
|
2123
|
+
/// carried as a debt. The engram names THE ADVANCE it is giving back (`advanceId`, which the
|
|
2124
|
+
/// registry handed it in `sysReturnUpgradeAdvance` — the one this install's deposit put on the
|
|
2125
|
+
/// ledger). The registry accepts AT MOST THAT ADVANCE'S AMOUNT (the network returns the rest),
|
|
2126
|
+
/// settles THAT entry alone — returned + written off = its amount, the write-off being the exact
|
|
2127
|
+
/// figure advance − accepted (what the install used and what the engram had to keep), on one
|
|
2128
|
+
/// `upgrade.advance.returned` line naming its release and id and carrying advance, returned and
|
|
2129
|
+
/// writtenOff — and leaves every other advance of the engram on the ledger, for its own give-back
|
|
2130
|
+
/// or the 90-day write-off. An id that is not on the ledger for this caller (already settled,
|
|
2131
|
+
/// written off after 90 days, or never its own) accepts nothing — the network returns the attached
|
|
2132
|
+
/// cycles to the engram — and answers `#NotFound`; when a recorded engram attached cycles, an
|
|
2133
|
+
/// `upgrade.advance.notOut` line in the registry's unchained refusal log says so (never the chained
|
|
2134
|
+
/// audit log: it moves nothing, and any engram can send it). `advanceReturned` never counts a
|
|
2135
|
+
/// written-off cycle, and nothing is ever counted twice.
|
|
2271
2136
|
/// WHAT WOULD MAKE THIS WRONG: an engram naming an id other than the one it was handed — it can only
|
|
2272
2137
|
/// name one of its OWN advances (the caller must match), so the worst it can do is settle its own
|
|
2273
2138
|
/// other advance early with cycles that are still the registry's.
|
|
2274
2139
|
sysRepayUpgradeAdvance: (a: record {advanceId: nat;}) -> (Result_1);
|
|
2275
|
-
///
|
|
2276
|
-
///
|
|
2277
|
-
///
|
|
2278
|
-
///
|
|
2279
|
-
///
|
|
2280
|
-
///
|
|
2281
|
-
///
|
|
2140
|
+
/// A SOVEREIGN engram could not change its own controllers after this registry moved its record,
|
|
2141
|
+
/// and asks for the record back so the transfer does not complete. Gated like
|
|
2142
|
+
/// `sysNotifyOwnershipTransfer` (the caller must BE the engram), and only for an engram the
|
|
2143
|
+
/// registry records as sovereign — a managed engram's controllers are this registry's to move, and
|
|
2144
|
+
/// its record is put back inside `sysNotifyOwnershipTransfer` itself. Refuses, saying why, when the
|
|
2145
|
+
/// record cannot be put back (`ControlHandover.revertRefusal`); the engram then answers its owner
|
|
2146
|
+
/// with `ControlHandover.stuck`.
|
|
2282
2147
|
sysRevertOwnershipTransfer: (formerOwner: principal) -> (Result);
|
|
2283
2148
|
/// Admin: upgrade one engram to the current template. RESPECTS the owner's update preference —
|
|
2284
2149
|
/// an engram set to `#ManualOnly` is not moved by this method, which is what makes the preference
|
|
2285
2150
|
/// meaningful rather than advisory. The owner's own `upgradeMyEngram` is unaffected either way.
|
|
2286
2151
|
///
|
|
2287
|
-
///
|
|
2288
|
-
///
|
|
2289
|
-
///
|
|
2290
|
-
///
|
|
2291
|
-
///
|
|
2292
|
-
///
|
|
2152
|
+
/// Same funding decision and dip as the owner's pull (`upgradeMyEngram`): paid only for a
|
|
2153
|
+
/// #Security update on a running engram. A push is the registry's own initiative, so where the
|
|
2154
|
+
/// engram cannot hold the install even with its setting lowered, the push is SKIPPED with
|
|
2155
|
+
/// `#Conflict` and not attempted — the owner can still pull it, and the pull is never refused.
|
|
2156
|
+
/// An ERASED engram (its canister holds no program) is not pushed: `#Conflict`, by name, before
|
|
2157
|
+
/// anything is added.
|
|
2293
2158
|
upgradeEngram: (canisterId: principal) -> (Result);
|
|
2294
2159
|
/// Upgrade YOUR OWN engram to the registry's current template. Self-service — no admin, no
|
|
2295
2160
|
/// queue, no approval.
|
|
2296
2161
|
///
|
|
2297
|
-
///
|
|
2298
|
-
///
|
|
2299
|
-
///
|
|
2300
|
-
///
|
|
2301
|
-
///
|
|
2302
|
-
///
|
|
2303
|
-
///
|
|
2304
|
-
///
|
|
2305
|
-
///
|
|
2306
|
-
///
|
|
2307
|
-
/// opened through a parent is
|
|
2308
|
-
/// engrams, but not including engrams running unofficial code"), and a #Feature update is never
|
|
2309
|
-
/// paid, rent or no rent ("where rent is paid, feature upgrades are paid by the engram").
|
|
2310
|
-
/// ⟨CORRECTED 2026-10-26, later — the owner's restart choice of that day: "pay whenever the engram is
|
|
2311
|
-
/// missing any security release, whatever the latest release is labelled"⟩ "a #Feature update is
|
|
2312
|
-
/// never paid" now excepts an engram still missing an earlier security release: its install of a
|
|
2313
|
-
/// #Feature template is paid as a security update, because the template carries that fix
|
|
2314
|
-
/// (UpgradeFunding.effectiveClass) — unless the template is itself behind a security release.
|
|
2162
|
+
/// THE INSTALL IS ALWAYS ATTEMPTED. Refusing an owner their own update for nonpayment is the ransom
|
|
2163
|
+
/// the continuity model forbids, so this method never refuses for compute or payment. What the
|
|
2164
|
+
/// registry PAYS for is narrower: a #Security update on a running engram, any size, so that cost
|
|
2165
|
+
/// never keeps a known security defect running. A #Feature update runs on the engram's own compute
|
|
2166
|
+
/// and is never paid, rent or no rent — except that an engram still missing an earlier security
|
|
2167
|
+
/// release is paid for its install of a #Feature template as a security update, because the
|
|
2168
|
+
/// template carries that fix (`UpgradeFunding.effectiveClass`), unless the template is itself
|
|
2169
|
+
/// behind a security release. Three standing exclusions are never paid for: an engram that has
|
|
2170
|
+
/// stopped (below its running line — it runs nothing, so its old code is not exposed while
|
|
2171
|
+
/// stopped), one running a module the registry never published, and a second deposit for the same
|
|
2172
|
+
/// release. An engram opened through a parent is paid for a security update like any other.
|
|
2315
2173
|
/// When it helps, the registry lowers the engram's freezing setting to one hour for the
|
|
2316
2174
|
/// install and puts the owner's value back after (the dip), so an install needs only ~0.32T above
|
|
2317
2175
|
/// an hour's burn rather than the hold above the whole 30-day line.
|
|
@@ -2320,15 +2178,16 @@ service : {
|
|
|
2320
2178
|
/// (UpgradeFunding.pullFailure): `#Conflict` when the engram needs more compute (the owner's
|
|
2321
2179
|
/// action — add compute), `#Unavailable` when the registry could not pay this time (retryable).
|
|
2322
2180
|
/// A failure after a paid or unneeded deposit answers `#Unavailable` with the network's reply.
|
|
2323
|
-
///
|
|
2324
|
-
///
|
|
2181
|
+
/// On an ERASED engram (its canister holds no program) nothing is paid; the install is still
|
|
2182
|
+
/// attempted, the network refuses it, and the reply says "erased".
|
|
2325
2183
|
///
|
|
2326
2184
|
/// An engram already on the current template is a silent no-op. A SOVEREIGN engram gets
|
|
2327
|
-
/// "registry is no longer a controller" — accurate, because it is no longer
|
|
2185
|
+
/// "registry is no longer a controller" — accurate, because it is no longer the registry's to
|
|
2186
|
+
/// install on.
|
|
2328
2187
|
///
|
|
2329
|
-
/// ⚠ THERE IS NO REGISTRY-SIDE SIZE PRE-FLIGHT.
|
|
2330
|
-
///
|
|
2331
|
-
/// get it.
|
|
2188
|
+
/// ⚠ THERE IS NO REGISTRY-SIDE SIZE PRE-FLIGHT. A size budget check, where a deployment has one,
|
|
2189
|
+
/// lives in its own upgrade tooling outside this canister, so a caller reaching this method
|
|
2190
|
+
/// directly does not get it.
|
|
2332
2191
|
upgradeMyEngram: () -> (Result);
|
|
2333
2192
|
/// True iff `canisterId` is a registered, `#Active` engram owned by `claimedOwner`. The biller's
|
|
2334
2193
|
/// money gate: fund ONLY an active engram the paying caller owns, since minting cycles to a
|
|
@@ -2338,16 +2197,11 @@ service : {
|
|
|
2338
2197
|
/// — so it discloses no mapping either way. That is the difference between this and the deleted
|
|
2339
2198
|
/// `getEngramByCanisterId`, which was gated precisely because it turned one id into the other.
|
|
2340
2199
|
///
|
|
2341
|
-
/// ⚠ WHAT IT DOES NOT ATTEST. The answer is the owner AS THIS REGISTRY RECORDS IT. Custody
|
|
2342
|
-
///
|
|
2343
|
-
///
|
|
2344
|
-
///
|
|
2345
|
-
///
|
|
2346
|
-
///
|
|
2347
|
-
/// ⟨Promoted from `//` to `///` 2026-08-21. Everything above was written as plain comments, so
|
|
2348
|
-
/// registry.did published the biller's money gate with NO explanation at all while 53 lines of
|
|
2349
|
-
/// it sat in the source. The correction history stays `//` on purpose — it is addressed to an
|
|
2350
|
-
/// editor, and only what a CALLER needs belongs in the interface.⟩
|
|
2200
|
+
/// ⚠ WHAT IT DOES NOT ATTEST. The answer is the owner AS THIS REGISTRY RECORDS IT. Custody moves
|
|
2201
|
+
/// on the engram via `transferOwnership`, and while `sysNotifyOwnershipTransfer` closes that gap, a
|
|
2202
|
+
/// caller for whom CURRENCY matters should compose with the engram's `listOwnershipTransfers` —
|
|
2203
|
+
/// current custody is the `to` of its latest entry. A query cannot make inter-canister calls, so
|
|
2204
|
+
/// this one cannot ask.
|
|
2351
2205
|
verifyEngramActiveOwner: (canisterId: principal, claimedOwner:
|
|
2352
2206
|
principal) -> (bool) query;
|
|
2353
2207
|
}
|