@engramx/idl 0.16.0-rc.21 → 0.16.0-rc.22
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 +533 -193
- package/dist/engram.idl.d.ts +542 -193
- package/dist/engram.idl.js +259 -194
- package/dist/registry.did +187 -70
- package/dist/registry.idl.d.ts +175 -72
- package/dist/registry.idl.js +62 -22
- package/package.json +1 -1
package/dist/registry.did
CHANGED
|
@@ -96,50 +96,60 @@ type Result_4 =
|
|
|
96
96
|
Err: Error;
|
|
97
97
|
Ok: MeterReading;
|
|
98
98
|
};
|
|
99
|
+
type Result_30 =
|
|
100
|
+
variant {
|
|
101
|
+
Err: Error;
|
|
102
|
+
Ok: FleetCycleHealth;
|
|
103
|
+
};
|
|
99
104
|
type Result_3 =
|
|
100
105
|
variant {
|
|
101
106
|
Err: Error;
|
|
102
107
|
Ok: ControlStep;
|
|
103
108
|
};
|
|
109
|
+
type Result_29 =
|
|
110
|
+
variant {
|
|
111
|
+
Err: Error;
|
|
112
|
+
Ok: CertifiedStanding;
|
|
113
|
+
};
|
|
104
114
|
type Result_28 =
|
|
105
115
|
variant {
|
|
106
116
|
Err: Error;
|
|
107
|
-
Ok:
|
|
117
|
+
Ok: ChildSignInOffer;
|
|
108
118
|
};
|
|
109
119
|
type Result_27 =
|
|
110
120
|
variant {
|
|
111
121
|
Err: Error;
|
|
112
|
-
Ok:
|
|
122
|
+
Ok: blob;
|
|
113
123
|
};
|
|
114
124
|
type Result_26 =
|
|
115
125
|
variant {
|
|
116
126
|
Err: Error;
|
|
117
|
-
Ok:
|
|
127
|
+
Ok: PrivateMetrics;
|
|
118
128
|
};
|
|
119
129
|
type Result_25 =
|
|
120
130
|
variant {
|
|
121
131
|
Err: Error;
|
|
122
|
-
Ok:
|
|
132
|
+
Ok: RestartStatus;
|
|
123
133
|
};
|
|
124
134
|
type Result_24 =
|
|
125
135
|
variant {
|
|
126
136
|
Err: Error;
|
|
127
|
-
Ok:
|
|
137
|
+
Ok: OpeningCounts;
|
|
128
138
|
};
|
|
129
139
|
type Result_23 =
|
|
130
140
|
variant {
|
|
131
141
|
Err: Error;
|
|
132
|
-
Ok:
|
|
142
|
+
Ok: OpenedThrough;
|
|
133
143
|
};
|
|
134
144
|
type Result_22 =
|
|
135
145
|
variant {
|
|
136
146
|
Err: Error;
|
|
137
|
-
Ok:
|
|
147
|
+
Ok: ReferralCounts;
|
|
138
148
|
};
|
|
139
149
|
type Result_21 =
|
|
140
150
|
variant {
|
|
141
151
|
Err: Error;
|
|
142
|
-
Ok:
|
|
152
|
+
Ok: RegistryHealth;
|
|
143
153
|
};
|
|
144
154
|
type Result_20 =
|
|
145
155
|
variant {
|
|
@@ -149,7 +159,7 @@ type Result_20 =
|
|
|
149
159
|
type Result_2 =
|
|
150
160
|
variant {
|
|
151
161
|
Err: Error;
|
|
152
|
-
Ok:
|
|
162
|
+
Ok: principal;
|
|
153
163
|
};
|
|
154
164
|
type Result_19 =
|
|
155
165
|
variant {
|
|
@@ -204,7 +214,7 @@ type Result_10 =
|
|
|
204
214
|
type Result_1 =
|
|
205
215
|
variant {
|
|
206
216
|
Err: Error;
|
|
207
|
-
Ok:
|
|
217
|
+
Ok: record {accepted: nat;};
|
|
208
218
|
};
|
|
209
219
|
type Result =
|
|
210
220
|
variant {
|
|
@@ -248,6 +258,29 @@ type ReleaseClass =
|
|
|
248
258
|
Feature;
|
|
249
259
|
Security;
|
|
250
260
|
};
|
|
261
|
+
type RegistryHealth =
|
|
262
|
+
record {
|
|
263
|
+
adminRoles: opt AdminRoles;
|
|
264
|
+
anchors: opt AnchorStats;
|
|
265
|
+
atNs: opt int;
|
|
266
|
+
clock: opt RegistryClockHealth;
|
|
267
|
+
cycleReserve:
|
|
268
|
+
opt record {
|
|
269
|
+
cycleBalance: nat;
|
|
270
|
+
minOperatingReserveCycles: nat;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
type RegistryClockHealth =
|
|
274
|
+
record {
|
|
275
|
+
attemptTotal: opt nat;
|
|
276
|
+
lastAttemptAtNs: opt int;
|
|
277
|
+
lastError: opt text;
|
|
278
|
+
lastErrorAtNs: opt int;
|
|
279
|
+
lastOkAtNs: opt int;
|
|
280
|
+
nextWakeAtNs: opt int;
|
|
281
|
+
okTotal: opt nat;
|
|
282
|
+
overdue: opt nat;
|
|
283
|
+
};
|
|
251
284
|
type ReferralCounts =
|
|
252
285
|
record {
|
|
253
286
|
agentsByTreesSpanned: TreesSpanned;
|
|
@@ -502,6 +535,12 @@ type ControlStep =
|
|
|
502
535
|
EngramMustMove;
|
|
503
536
|
MovedByRegistry;
|
|
504
537
|
};
|
|
538
|
+
type ChildSignInOffer =
|
|
539
|
+
record {
|
|
540
|
+
parentActive: bool;
|
|
541
|
+
parentIsFirstEngram: bool;
|
|
542
|
+
parentOwner: opt principal;
|
|
543
|
+
};
|
|
505
544
|
type ChangelogEntry =
|
|
506
545
|
record {
|
|
507
546
|
atNs: int;
|
|
@@ -606,6 +645,9 @@ service : {
|
|
|
606
645
|
/// CANISTER ID, so an engram's ciphertext and wallet cannot follow it anywhere (engramx
|
|
607
646
|
/// docs/ENCRYPTION-OPERATIONS.md, "Canister-id binding"). Abandoning is starting over, not
|
|
608
647
|
/// migrating, and the caller must be told so before they do it.
|
|
648
|
+
///
|
|
649
|
+
/// ⟨2026-11-02⟩ REFUSED for an engram opened through another: it is never abandoned, so it stays on
|
|
650
|
+
/// this registry's security updates for life; it ends by its parent's cut-off or by running dry.
|
|
609
651
|
abandonMyEngram: () -> (Result);
|
|
610
652
|
addAuditViewer: (viewer: principal) -> (Result);
|
|
611
653
|
/// Add a changelog entry (admin only)
|
|
@@ -642,6 +684,9 @@ service : {
|
|
|
642
684
|
/// ⚠ IT IS REVERSIBLE, which is the fact most worth publishing: the engram's own
|
|
643
685
|
/// `returnToManaged` adds the registry back ALONGSIDE the owner. Sovereignty is a door, not a
|
|
644
686
|
/// cliff.
|
|
687
|
+
///
|
|
688
|
+
/// ⟨2026-11-02, the owner's ruling "choice 4 without hand over"⟩ REFUSED for an engram opened
|
|
689
|
+
/// through another: it stays managed by this registry for life, and its key is never a controller.
|
|
645
690
|
claimSovereignty: () -> (Result);
|
|
646
691
|
/// Assemble the pushed chunks into the engram template and install it as the current one.
|
|
647
692
|
///
|
|
@@ -699,7 +744,7 @@ service : {
|
|
|
699
744
|
/// this one is a noun. That gate now reads the census's L7 citations as a second population for
|
|
700
745
|
/// exactly this blind spot.⟩
|
|
701
746
|
fleetCycleHealth: (offset: nat, limit: nat, thresholdCycles: nat) ->
|
|
702
|
-
(
|
|
747
|
+
(Result_30);
|
|
703
748
|
/// PUBLIC: ⟨0.16.0, L2.4⟩ `fleetSummary` — the ONE public projection of this registry,
|
|
704
749
|
/// replacing `status()` and ABSORBING `publicMetrics()`.
|
|
705
750
|
///
|
|
@@ -803,7 +848,7 @@ service : {
|
|
|
803
848
|
/// is the agent's ROOT principal — the identity an owner sees as `root` on each key in their own
|
|
804
849
|
/// `listAgents`. "The agent itself" is a caller holding that root key. A key for one engram has no
|
|
805
850
|
/// record of its own here; asking about one gets the refusal or, from the key itself, `#NotFound`.
|
|
806
|
-
getAgentStanding: (agent: principal) -> (
|
|
851
|
+
getAgentStanding: (agent: principal) -> (Result_29) query;
|
|
807
852
|
/// Fleet-wide anchoring liveness. Exists because ABSENCE is otherwise uninformative: an engram
|
|
808
853
|
/// that never wrote, one still on a template without the push, and one whose push is broken all
|
|
809
854
|
/// render as an empty getAnchors. Nothing distinguishes the first from the third, so a silently
|
|
@@ -870,6 +915,26 @@ service : {
|
|
|
870
915
|
/// answers: there is no certified absence proof (spec question Q8). A `fingerprint` that is not 32
|
|
871
916
|
/// bytes is never a fingerprint, and answers `null` before the lookup.
|
|
872
917
|
getCertifiedBirth: (fingerprint: blob) -> (opt CertifiedBirth) query;
|
|
918
|
+
/// ⟨2026-11-02, the owner's ruling "1-4 all as you recommended"; the lead's answer L4 with the
|
|
919
|
+
/// Challenge's fix C3.2⟩ WHAT THE KIT OFFERS AS A NEW ENGRAM'S SIGN-IN, read before it opens one
|
|
920
|
+
/// through `parent`. The answer: the parent's owner — ONLY when the parent is a first engram (the
|
|
921
|
+
/// kit offers that principal as the default sign-in only then, after it prints it and the person
|
|
922
|
+
/// running the agent confirms it is theirs; for a parent opened through another the field is
|
|
923
|
+
/// absent, so the read never discloses a key file's principal); whether the parent is a first
|
|
924
|
+
/// engram; and whether it is registered, `#Active` and not abandoned (`isRegisteredActiveEngram`'s
|
|
925
|
+
/// rule).
|
|
926
|
+
///
|
|
927
|
+
/// CALLER: a lasting key with a LIVE engagement with `parent` at this registry, in either store
|
|
928
|
+
/// (`Engagements.hasOpenEither` — the same fact `sysOpenChild`'s admission reads, so exactly the
|
|
929
|
+
/// keys that may be opened an engram through `parent` may read what it offers). It discloses the
|
|
930
|
+
/// parent's owner to the parent's own engaged agent, the party `getParentOf` answers once the child
|
|
931
|
+
/// exists. Anyone else is REFUSED loudly (ADR-0002), in the same words whether or not `parent` is
|
|
932
|
+
/// an engram, so a refusal tells a stranger nothing. A QUERY, so the refusal is not in the denial
|
|
933
|
+
/// log (`denied` says why a query cannot write). `#NotFound` only to an engaged caller, for a
|
|
934
|
+
/// parent this registry holds no owner for.
|
|
935
|
+
/// Called by: the owner kit's opening of an engram through a parent, signed by the agent's lasting
|
|
936
|
+
/// key, before it names the new engram's sign-in.
|
|
937
|
+
getChildSignInOffer: (parent: principal) -> (Result_28) query;
|
|
873
938
|
/// The ATTESTABLE custody-mode fact (agent-native model item 19): "managed" | "sovereign" |
|
|
874
939
|
/// "unknown", derived from the registry's OWN transition records (claimSovereignty /
|
|
875
940
|
/// returnToManaged maintain sovereignEngramIds) — NOT from a canister_status probe, which needs
|
|
@@ -933,7 +998,7 @@ service : {
|
|
|
933
998
|
/// same words whether or not the key opened anything, so the refusal tells a stranger nothing.
|
|
934
999
|
/// `#NotFound` only to a permitted reader, for a key that opened nothing: a true answer, like
|
|
935
1000
|
/// `listMyAgentDisputes`'s empty list.
|
|
936
|
-
getEngramOpenedThrough: (key: principal) -> (
|
|
1001
|
+
getEngramOpenedThrough: (key: principal) -> (Result_23) query;
|
|
937
1002
|
/// The i-th 1 MiB slice of the attested engram wasm (0-indexed). The caller reassembles all
|
|
938
1003
|
/// chunks in order and MUST verify sha256(reassembled) == getEngramWasmHash before installing —
|
|
939
1004
|
/// the hash is the attestation; the bytes are a convenience. Out-of-range index → empty blob.
|
|
@@ -944,7 +1009,7 @@ service : {
|
|
|
944
1009
|
/// its hash. A reassembler that reads `""` as end-of-stream cannot tell a finished download from
|
|
945
1010
|
/// a truncated one, so it would hash a partial wasm and report a mismatch against the official
|
|
946
1011
|
/// list, which reads as "this template is unofficial" rather than "I stopped reading too early".
|
|
947
|
-
getEngramWasmChunk: (index: nat) -> (
|
|
1012
|
+
getEngramWasmChunk: (index: nat) -> (Result_27) query;
|
|
948
1013
|
/// The stored template's release class — FREE and UNGATED, because it is the checkable half of a
|
|
949
1014
|
/// promise made to people who are not our customers. ⟨2026-10-25⟩ The funding rule it checks:
|
|
950
1015
|
/// #Security — the registry pays for the install on every running engram it can reach, any size;
|
|
@@ -986,7 +1051,7 @@ service : {
|
|
|
986
1051
|
/// So L7's "the denial-logging motive for update-for-read is retired by L1" does not hold at this
|
|
987
1052
|
/// site. L1 retired the motive of trapping-to-refuse; it did not give queries the ability to
|
|
988
1053
|
/// write, which is the thing this actually depends on.
|
|
989
|
-
getFleetMetrics: () -> (
|
|
1054
|
+
getFleetMetrics: () -> (Result_26);
|
|
990
1055
|
/// PUBLIC: a genesis note that only privileged callers could read would defeat its purpose —
|
|
991
1056
|
/// the reader who most needs it is the stranger deciding whether to trust this chain.
|
|
992
1057
|
getGenesisNote: () -> (GenesisNote) query;
|
|
@@ -1050,7 +1115,7 @@ service : {
|
|
|
1050
1115
|
/// we lend"⟩ "when the next restart is allowed" now reads "when the registry can next LEND to a
|
|
1051
1116
|
/// restart": `nextRestartAtNs` is only the weekly limit on a loan. A restart on the owner's own
|
|
1052
1117
|
/// compute is allowed now, whatever it says. Field name and shape unchanged.
|
|
1053
|
-
getMyRestartStatus: () -> (
|
|
1118
|
+
getMyRestartStatus: () -> (Result_25) query;
|
|
1054
1119
|
/// ⟨2026-10-02⟩ How many engrams were ever opened, and how — lifetime sizes of state this registry
|
|
1055
1120
|
/// never deletes, plus the two counters of refused openings (`Funnel.OpeningCounts` names each).
|
|
1056
1121
|
/// All O(1); a reader differences them day to day.
|
|
@@ -1059,7 +1124,7 @@ service : {
|
|
|
1059
1124
|
/// grant). Anyone else is REFUSED by name with their class — never a zero, which would read as
|
|
1060
1125
|
/// "nothing was ever opened". A QUERY: counts only, and cheap; its refusal is not in the denial
|
|
1061
1126
|
/// log (`denied` says why a query cannot write).
|
|
1062
|
-
getOpeningCounts: () -> (
|
|
1127
|
+
getOpeningCounts: () -> (Result_24) query;
|
|
1063
1128
|
/// Where an engram was opened from ⟨2026-10-26, the owner's lineage ruling L4: "a child reads its own
|
|
1064
1129
|
/// parent by its canister id"⟩: the engram, the engram it was opened from, and the cut-off's time if
|
|
1065
1130
|
/// there is one. Closes "a handed-on child cannot read its own parent" — `getEngramOpenedThrough` is
|
|
@@ -1074,7 +1139,7 @@ service : {
|
|
|
1074
1139
|
/// `#NotFound` only to a permitted reader: a first engram has no parent (a true answer), and an id
|
|
1075
1140
|
/// this registry never opened is said to be one, not passed off as a first engram (ADR-0002).
|
|
1076
1141
|
/// L8C: `listChildrenOf` is unchanged. L7B: the change-of-owner gate is unchanged.
|
|
1077
|
-
getParentOf: (child: principal) -> (
|
|
1142
|
+
getParentOf: (child: principal) -> (Result_23) query;
|
|
1078
1143
|
/// ⟨2026-10-02⟩ How far agents reach across owners — COUNTS ONLY: agents by how many trees their
|
|
1079
1144
|
/// record spans (1 · 2 · 3–4 · 5+), engrams opened through a parent that are live or cut off, and
|
|
1080
1145
|
/// engrams that paired an agent within seven days of opening. No principal, no row, no per-agent
|
|
@@ -1086,7 +1151,23 @@ service : {
|
|
|
1086
1151
|
/// CALLERS: the admin and the audit viewers (the deployment's metrics reader holds a viewer grant),
|
|
1087
1152
|
/// weekly. Anyone else is REFUSED by name with their class — never zeros. A QUERY: its cost grows
|
|
1088
1153
|
/// with the agents and engrams it walks (one pass over each), so a reader asks weekly, not hourly.
|
|
1089
|
-
getReferralCounts: (exclude: vec principal) -> (
|
|
1154
|
+
getReferralCounts: (exclude: vec principal) -> (Result_22) query;
|
|
1155
|
+
/// ⟨2026-11-02, the owner's rulings "E ok." and "go ahead with your noticing failures changes"⟩ THE
|
|
1156
|
+
/// REGISTRY'S HEALTH IN ONE READ: its cycle reserve, its roster, its anchoring counts — the same
|
|
1157
|
+
/// answers `getCycleReserveStatus`, `getAdminRoles` and `getAnchorStats` give, which stay served
|
|
1158
|
+
/// unchanged for everyone who reads them one at a time — and the stamps of its clock, which wakes only
|
|
1159
|
+
/// at the deadlines it records (with a six-hour net) and so is silent by design: `clock.nextWakeAtNs`
|
|
1160
|
+
/// more than an hour behind `atNs` is a lost clock. `Types.RegistryHealth` says what each field
|
|
1161
|
+
/// means, and why every field is `opt` and always filled.
|
|
1162
|
+
///
|
|
1163
|
+
/// CALLER: the deployment's monitor, once an hour, under the audit-viewer grant its daily count-of-use
|
|
1164
|
+
/// reading already holds (ADR-0020 rule 1). Also the admin.
|
|
1165
|
+
///
|
|
1166
|
+
/// GATED, LIKE THE COUNT-OF-USE READS THAT MONITOR MAKES (`getOpeningCounts`): the admin or an audit
|
|
1167
|
+
/// viewer; anyone else is REFUSED by name — never an empty or zero reading. A QUERY: its refusal is
|
|
1168
|
+
/// not in the denial log (a query cannot write; `denied` says why). One read where there were three
|
|
1169
|
+
/// saves the monitor and this registry two calls an hour each.
|
|
1170
|
+
getRegistryHealth: () -> (Result_21) query;
|
|
1090
1171
|
/// PUBLIC: the biller identity is an operational fact a
|
|
1091
1172
|
/// payer's cashier must verify BEFORE taking money (paying into a cashier the registry does not
|
|
1092
1173
|
/// recognize as biller would collect funds it cannot convert into credit).
|
|
@@ -1150,7 +1231,7 @@ service : {
|
|
|
1150
1231
|
/// on us that only we can read.
|
|
1151
1232
|
getSecurityReleaseCount: () -> (nat) query;
|
|
1152
1233
|
/// ⟨2026-10-01, the owner's ruling of that day (2 A)⟩ Cumulative cycles accepted at the sponsored
|
|
1153
|
-
/// door (`
|
|
1234
|
+
/// door (`sysOpenChild`) and forwarded into engrams opened through another — cycles the calling
|
|
1154
1235
|
/// engrams attached, never the registry's own. Kept apart from the grant counter
|
|
1155
1236
|
/// (`totalCyclesAllocated`) so neither figure is inflated by the other.
|
|
1156
1237
|
///
|
|
@@ -1537,7 +1618,7 @@ service : {
|
|
|
1537
1618
|
opt record {
|
|
1538
1619
|
invite: opt text;
|
|
1539
1620
|
walletProof: opt blob;
|
|
1540
|
-
}) -> (
|
|
1621
|
+
}) -> (Result_2);
|
|
1541
1622
|
removeAuditViewer: (viewer: principal) -> (Result);
|
|
1542
1623
|
/// ⟨0.16.0⟩ `Ok` IS THE ANSWER — the `{ reserved : Bool }` wrapper is gone.
|
|
1543
1624
|
///
|
|
@@ -1610,6 +1691,8 @@ service : {
|
|
|
1610
1691
|
/// used to double as that guard.
|
|
1611
1692
|
restartMyStoppedEngram: () -> (Result_8);
|
|
1612
1693
|
/// Return to managed: user calls AFTER adding registry back as controller
|
|
1694
|
+
///
|
|
1695
|
+
/// ⟨2026-11-02⟩ Refused for an engram opened through another, which is never independent.
|
|
1613
1696
|
returnToManaged: () -> (Result);
|
|
1614
1697
|
/// Set admin. Authority decision lives in the pure Auth module (unit-tested); this func keeps only
|
|
1615
1698
|
/// the async controller check + applies the outcome. When admin is null: REGISTRY_ROOT or a canister
|
|
@@ -1670,6 +1753,9 @@ service : {
|
|
|
1670
1753
|
///
|
|
1671
1754
|
/// `claimSovereignty` sets this to `#ManualOnly` as a side effect, since a registry that is no
|
|
1672
1755
|
/// longer a controller could not honour anything else.
|
|
1756
|
+
///
|
|
1757
|
+
/// ⟨2026-11-02⟩ An engram opened through another is refused `#ManualOnly`: it takes this registry's
|
|
1758
|
+
/// updates automatically for life.
|
|
1673
1759
|
setUpdatePreference: (pref: UpdatePreference) -> (Result);
|
|
1674
1760
|
/// Set the spawn-ceiling dial (admin-only, audit-logged, bounded 1..SPAWN_CEILING_MAX).
|
|
1675
1761
|
/// The effective daily cap stays min(ceiling, reserve-derived) — raising the dial never
|
|
@@ -1795,6 +1881,85 @@ service : {
|
|
|
1795
1881
|
/// a transfer the engram did not finish, and moves control again (that is the way out `stuck`
|
|
1796
1882
|
/// names). The rules are in `src/shared/ControlHandover.mo`.
|
|
1797
1883
|
sysNotifyOwnershipTransfer: (newOwner: principal) -> (Result_3);
|
|
1884
|
+
/// ⟨2026-10-01, the owner's ruling of that day: the October concept's decision 1, "build it now"⟩
|
|
1885
|
+
/// THE SPONSORED DOOR. An engram opens an engram for one of its agents: the caller is the engram
|
|
1886
|
+
/// (the engram it is opened from — `parentOf` in code), `ownerKey` is the agent's LASTING key, which
|
|
1887
|
+
/// owns what is opened, and the cycles the opened engram lives on are the ones the caller ATTACHES.
|
|
1888
|
+
///
|
|
1889
|
+
/// CALLER: a registered engram — `canisterToOwner` membership, checked first, exactly as
|
|
1890
|
+
/// `sysRecordAgentEdge` checks it (ADR-0020: every `sys` method names and checks its caller). The
|
|
1891
|
+
/// engram's own rules (the owner's standing allowance for this agent, its frozen-payments state,
|
|
1892
|
+
/// its balance) are the engram's to check before it calls; this method checks what only the
|
|
1893
|
+
/// registry can know.
|
|
1894
|
+
///
|
|
1895
|
+
/// NOTHING IS ACCEPTED UNTIL EVERY CHECK HAS PASSED (`ChildDoor.admission`, cheapest first), so
|
|
1896
|
+
/// every refusal before the accept returns the attached cycles to the caller by construction —
|
|
1897
|
+
/// the IC returns unaccepted cycles when the call replies. After the accept:
|
|
1898
|
+
/// · the network refuses the canister → what it refunded is deposited back to the caller, and
|
|
1899
|
+
/// the reply says how much came back;
|
|
1900
|
+
/// · the template will not install after one retry → the cycles are INSIDE the new canister and
|
|
1901
|
+
/// no canister can withdraw another's cycles. The one honest exception to "returned on every
|
|
1902
|
+
/// failure": nothing is recorded, and the reply names the canister, its controllers (this
|
|
1903
|
+
/// registry and the key) and what the key can do with it;
|
|
1904
|
+
/// ⟨CORRECTED 2026-11-02, beside the line above — the owner's ruling "choice 4 without hand
|
|
1905
|
+
/// over" (V0)⟩ The controller is THIS REGISTRY ALONE; the key is not one and can install
|
|
1906
|
+
/// nothing. The reply names the canister and says the cycles sit in it unrecorded, for whoever
|
|
1907
|
+
/// runs this deployment to decide on;
|
|
1908
|
+
/// · the key came to own an engram during the awaits → the new canister is named, nothing is
|
|
1909
|
+
/// recorded (the same third guard `spawnEngramFor` carries).
|
|
1910
|
+
///
|
|
1911
|
+
/// WHAT IT DOES NOT DO, deliberately: it never attaches the registry's own cycles (the grant stays
|
|
1912
|
+
/// with first engrams); it never writes a predecessor (a key with any record was refused); it never
|
|
1913
|
+
/// consults the reserve gate (the parent owner's approval is this door's admission — the gate's
|
|
1914
|
+
/// arming note stays on `provisionEngram`); it never tells the calling engram anything but this
|
|
1915
|
+
/// reply. No payment AMOUNT reaches it (ADR-0005): it carries cycles and a key, nothing else.
|
|
1916
|
+
///
|
|
1917
|
+
/// THE RATE LIMIT ⟨2026-10-01, evening — the owner's ruling "1B"; until then this door shared
|
|
1918
|
+
/// first engrams' limiter in full: their 24-hour count, their in-flight count and
|
|
1919
|
+
/// `effectiveDailyCap`⟩. The door shares only the DIAL (`spawnCeiling`) and the WINDOW LENGTH (24
|
|
1920
|
+
/// hours). Its count is its own (`sponsoredCreationTimestampsBuf`, pruned by
|
|
1921
|
+
/// `pruneSponsoredWindow`), its in-flight count is its own (`sponsoredInFlight`), and its cap is
|
|
1922
|
+
/// `spawnCeiling` alone — the reserve-derived term never applies, because the opened engram lives
|
|
1923
|
+
/// on the cycles the caller attached and the registry funds nothing. So an opening never uses up a
|
|
1924
|
+
/// first engram's slot, and is never refused for the registry's own low balance. The per-key
|
|
1925
|
+
/// pending mark (`createEngramPending`) stays shared: it is about ONE key, not a count, and a key
|
|
1926
|
+
/// must not be mid-spawn at both doors at once.
|
|
1927
|
+
///
|
|
1928
|
+
/// THE CUT-OFF AT BIRTH. If the caller ended the key's engagement while the canister was being
|
|
1929
|
+
/// created (the ending is recorded by `sysRecordAgentEdge` between this method's awaits), the
|
|
1930
|
+
/// opened engram is recorded AND cut off in the same step — the cycles are already in it, so the
|
|
1931
|
+
/// key keeps it, but it starts on nobody's record. Without this the ending's cut-off writer would
|
|
1932
|
+
/// have found no `openedThroughParent` row yet, and the engram would never be cut off.
|
|
1933
|
+
/// WHAT WOULD MAKE THIS WRONG: a second path that writes `parentOf`, or an `await` placed between
|
|
1934
|
+
/// the post-await re-check and the record below.
|
|
1935
|
+
///
|
|
1936
|
+
/// ⟨2026-11-02, the owner's rulings "choice 4 without hand over" (V0) and "1-4 all as you
|
|
1937
|
+
/// recommended"⟩ CONTROLLED BY THIS REGISTRY ALONE, AND BORN KNOWING ITS PARENT AND ITS SIGN-IN.
|
|
1938
|
+
/// The canister's controllers are `[this registry]` — the key is not a controller, so it can never
|
|
1939
|
+
/// reinstall, delete or re-control the engram; only this registry installs code on it. Such an
|
|
1940
|
+
/// engram is managed for life: `claimSovereignty`, `returnToManaged`, `abandonMyEngram`, a
|
|
1941
|
+
/// `#ManualOnly` preference and a change of owner (`sysNotifyOwnershipTransfer`) are all refused
|
|
1942
|
+
/// for it, by `parentOf`. `signIn` is the opened engram's second credential, named by the person
|
|
1943
|
+
/// running the agent (`ChildDoor.signInRefusal` refuses the key itself, the anonymous principal and
|
|
1944
|
+
/// a canister); it and the parent travel in the engram's init record, so the engram knows both
|
|
1945
|
+
/// before it answers its first message. `null` = no sign-in: the engram keeps small limits for life.
|
|
1946
|
+
/// An engram built before this argument sends one argument; the missing trailing `opt` decodes as
|
|
1947
|
+
/// `null` (Candid's rule for a missing optional argument), and the engram opens with no sign-in.
|
|
1948
|
+
/// ⟨CORRECTED 2026-11-02, later — the stage-1 review's B1, beside the two lines above, which no
|
|
1949
|
+
/// longer hold⟩ ONE RECORD, A NEW NAME. This door was `sysSpawnChild(ownerKey : Principal)`; giving
|
|
1950
|
+
/// it a second positional argument grew its argument TUPLE, which ADR-0018 rule 0 freezes ("evolution
|
|
1951
|
+
/// happens inside records", ratified R1) and the interface gate reads as ILLEGAL. So the door is
|
|
1952
|
+
/// `sysOpenChild({ ownerKey; signIn })` — later fields are opt fields of this record, never another
|
|
1953
|
+
/// argument — and `sysSpawnChild` is REMOVED (a NOTICE at the gate). An engram built before this
|
|
1954
|
+
/// change still calls `sysSpawnChild`; this registry no longer serves it, so that call is REJECTED
|
|
1955
|
+
/// (IC0536, a reject the engram's `try` catches — ADR-0018 probe 11), the attached cycles come back
|
|
1956
|
+
/// as the call's refund, and nothing is opened. An older engram therefore never opens an engram with
|
|
1957
|
+
/// no sign-in by accident; it opens them again once it runs a template that calls this method.
|
|
1958
|
+
/// (Was: the one-argument call decoded `signIn` as `null` — INFERRED for moc 2.1.0, never witnessed.)
|
|
1959
|
+
sysOpenChild: (req: record {
|
|
1960
|
+
ownerKey: principal;
|
|
1961
|
+
signIn: opt principal;
|
|
1962
|
+
}) -> (Result_2);
|
|
1798
1963
|
/// ⟨2026-09-28, owner decision: build the full agent track-record design for the launch release⟩
|
|
1799
1964
|
/// An engram tells this registry that one of its agents started, or ended and WHY.
|
|
1800
1965
|
///
|
|
@@ -1890,7 +2055,7 @@ service : {
|
|
|
1890
2055
|
/// WHAT WOULD MAKE THIS WRONG: an engram naming an id other than the one it was handed — it can only
|
|
1891
2056
|
/// name one of its OWN advances (the caller must match), so the worst it can do is settle its own
|
|
1892
2057
|
/// other advance early with cycles that are still the registry's.
|
|
1893
|
-
sysRepayUpgradeAdvance: (a: record {advanceId: nat;}) -> (
|
|
2058
|
+
sysRepayUpgradeAdvance: (a: record {advanceId: nat;}) -> (Result_1);
|
|
1894
2059
|
/// ⟨2026-09-29, owner ruling follow-up 8⟩ A SOVEREIGN engram could not change its own controllers
|
|
1895
2060
|
/// after this registry moved its record, and asks for the record back so the transfer does not
|
|
1896
2061
|
/// complete. Gated like `sysNotifyOwnershipTransfer` (the caller must BE the engram), and only for
|
|
@@ -1899,54 +2064,6 @@ service : {
|
|
|
1899
2064
|
/// Refuses, saying why, when the record cannot be put back (`ControlHandover.revertRefusal`); the
|
|
1900
2065
|
/// engram then answers its owner with `ControlHandover.stuck`.
|
|
1901
2066
|
sysRevertOwnershipTransfer: (formerOwner: principal) -> (Result);
|
|
1902
|
-
/// ⟨2026-10-01, the owner's ruling of that day: the October concept's decision 1, "build it now"⟩
|
|
1903
|
-
/// THE SPONSORED DOOR. An engram opens an engram for one of its agents: the caller is the engram
|
|
1904
|
-
/// (the engram it is opened from — `parentOf` in code), `ownerKey` is the agent's LASTING key, which
|
|
1905
|
-
/// owns what is opened, and the cycles the opened engram lives on are the ones the caller ATTACHES.
|
|
1906
|
-
///
|
|
1907
|
-
/// CALLER: a registered engram — `canisterToOwner` membership, checked first, exactly as
|
|
1908
|
-
/// `sysRecordAgentEdge` checks it (ADR-0020: every `sys` method names and checks its caller). The
|
|
1909
|
-
/// engram's own rules (the owner's standing allowance for this agent, its frozen-payments state,
|
|
1910
|
-
/// its balance) are the engram's to check before it calls; this method checks what only the
|
|
1911
|
-
/// registry can know.
|
|
1912
|
-
///
|
|
1913
|
-
/// NOTHING IS ACCEPTED UNTIL EVERY CHECK HAS PASSED (`ChildDoor.admission`, cheapest first), so
|
|
1914
|
-
/// every refusal before the accept returns the attached cycles to the caller by construction —
|
|
1915
|
-
/// the IC returns unaccepted cycles when the call replies. After the accept:
|
|
1916
|
-
/// · the network refuses the canister → what it refunded is deposited back to the caller, and
|
|
1917
|
-
/// the reply says how much came back;
|
|
1918
|
-
/// · the template will not install after one retry → the cycles are INSIDE the new canister and
|
|
1919
|
-
/// no canister can withdraw another's cycles. The one honest exception to "returned on every
|
|
1920
|
-
/// failure": nothing is recorded, and the reply names the canister, its controllers (this
|
|
1921
|
-
/// registry and the key) and what the key can do with it;
|
|
1922
|
-
/// · the key came to own an engram during the awaits → the new canister is named, nothing is
|
|
1923
|
-
/// recorded (the same third guard `spawnEngramFor` carries).
|
|
1924
|
-
///
|
|
1925
|
-
/// WHAT IT DOES NOT DO, deliberately: it never attaches the registry's own cycles (the grant stays
|
|
1926
|
-
/// with first engrams); it never writes a predecessor (a key with any record was refused); it never
|
|
1927
|
-
/// consults the reserve gate (the parent owner's approval is this door's admission — the gate's
|
|
1928
|
-
/// arming note stays on `provisionEngram`); it never tells the calling engram anything but this
|
|
1929
|
-
/// reply. No payment AMOUNT reaches it (ADR-0005): it carries cycles and a key, nothing else.
|
|
1930
|
-
///
|
|
1931
|
-
/// THE RATE LIMIT ⟨2026-10-01, evening — the owner's ruling "1B"; until then this door shared
|
|
1932
|
-
/// first engrams' limiter in full: their 24-hour count, their in-flight count and
|
|
1933
|
-
/// `effectiveDailyCap`⟩. The door shares only the DIAL (`spawnCeiling`) and the WINDOW LENGTH (24
|
|
1934
|
-
/// hours). Its count is its own (`sponsoredCreationTimestampsBuf`, pruned by
|
|
1935
|
-
/// `pruneSponsoredWindow`), its in-flight count is its own (`sponsoredInFlight`), and its cap is
|
|
1936
|
-
/// `spawnCeiling` alone — the reserve-derived term never applies, because the opened engram lives
|
|
1937
|
-
/// on the cycles the caller attached and the registry funds nothing. So an opening never uses up a
|
|
1938
|
-
/// first engram's slot, and is never refused for the registry's own low balance. The per-key
|
|
1939
|
-
/// pending mark (`createEngramPending`) stays shared: it is about ONE key, not a count, and a key
|
|
1940
|
-
/// must not be mid-spawn at both doors at once.
|
|
1941
|
-
///
|
|
1942
|
-
/// THE CUT-OFF AT BIRTH. If the caller ended the key's engagement while the canister was being
|
|
1943
|
-
/// created (the ending is recorded by `sysRecordAgentEdge` between this method's awaits), the
|
|
1944
|
-
/// opened engram is recorded AND cut off in the same step — the cycles are already in it, so the
|
|
1945
|
-
/// key keeps it, but it starts on nobody's record. Without this the ending's cut-off writer would
|
|
1946
|
-
/// have found no `openedThroughParent` row yet, and the engram would never be cut off.
|
|
1947
|
-
/// WHAT WOULD MAKE THIS WRONG: a second path that writes `parentOf`, or an `await` placed between
|
|
1948
|
-
/// the post-await re-check and the record below.
|
|
1949
|
-
sysSpawnChild: (ownerKey: principal) -> (Result_1);
|
|
1950
2067
|
/// Admin: upgrade one engram to the current template. RESPECTS the owner's update preference —
|
|
1951
2068
|
/// an engram set to `#ManualOnly` is not moved by this method, which is what makes the preference
|
|
1952
2069
|
/// meaningful rather than advisory. The owner's own `upgradeMyEngram` is unaffected either way.
|