@engramx/idl 0.16.1 → 0.17.0-rc.1

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/market.did CHANGED
@@ -607,17 +607,17 @@ service : {
607
607
  /// does with its memory head, and the biller with its treasury head.
608
608
  ///
609
609
  /// The argument for anchoring the treasury's ledger head in the registry applies to escrow with full
610
- /// force: a self-attested commerce ledger sitting
611
- /// beside witnessed ones is the asymmetry an auditor finds first. Every chain in this system is
612
- /// witnessed by a party that does not control it, or the phrase means nothing.
610
+ /// force: a self-attested commerce ledger sitting beside witnessed ones is the asymmetry an auditor
611
+ /// finds first. Every chain in this system is witnessed by a party that does not control it, or the
612
+ /// phrase means nothing.
613
613
  ///
614
614
  /// Best-effort and isolated: a registry that is slow or down must never take the market with it.
615
615
  /// The FAILURE IS RECORDED rather than swallowed — an anchor push that silently stopped would
616
616
  /// leave the chain looking witnessed while it was not, which is worse than a visibly missing one.
617
617
  ///
618
- /// ⟨RENAMED 2026-10-02 from `sysAnchorNow`, with `setRegistryId` and for the same reason: its
619
- /// caller is the market's admin, a person, so it does not belong to the canister-to-canister
620
- /// tier the `sys` prefix names.⟩
618
+ /// Not `sys`-prefixed (it was `sysAnchorNow` until 2026-10-02), for the same reason as
619
+ /// `setRegistryId`: its caller is the market's admin, a person, so it does not belong to the
620
+ /// canister-to-canister tier the `sys` prefix names.
621
621
  anchorNow: () -> (Result);
622
622
  /// A seller takes on a pending job. The CALLER must be the seller of the service the job was
623
623
  /// created against — claiming is not open, and there is no assignment step: whoever registered
@@ -631,35 +631,32 @@ service : {
631
631
  /// · the job is not pending ⟶ properly `#Conflict`
632
632
  /// · **you are not the seller** ⟶ properly `#Refused`
633
633
  ///
634
- /// **Read the MESSAGE, not the arm, on this method only.** That is the opposite of what the 0.16.0
635
- /// result rule (one Result shape, refusals as values) asks
636
- /// everywhere else, and it is stated here rather than left to be discovered: a caller branching
637
- /// on the arm will retry a call that can never succeed for it. Recovering the distinction needs
638
- /// the LIBRARY to carry arms — matching its prose here would reintroduce exactly the
639
- /// message-branching that rule abolished, and would break silently on an ic402 bump. ⟨Three costed
640
- /// options were recorded for it, 2026-08-21. This is the market's whole ic402
641
- /// seam, not one method: 6 call sites collapse a module error into `#Conflict`.⟩
642
- /// ⟨2026-10-02 — counted again, and ruled.⟩ ELEVEN sites on this market collapse an ic402 text
643
- /// into `#Conflict`, not 6: `setServiceEnabled`, `claimJob`, `submitJobResult`, `confirmJob`,
644
- /// `disputeJob`, `resolveDispute`, `reconcileSession`, `forceResolveSession`, `recoverEscrow`,
645
- /// `reconcileJob`, `resolveJob` — each now carries its own audited caveat. Four can carry a
646
- /// refusal of the caller's standing — `claimJob`, `confirmJob`, `disputeJob` and `submitJobResult`;
647
- /// `setServiceEnabled`, the fourth noted on 2026-08-21, is now gated by this canister before the
648
- /// library is called; the other six are state behind this canister's own gate. Read-the-message
649
- /// is RATIFIED as the 0.16.0 contract (the owner's ruling of 2026-10-02, as the review before the
650
- /// cut recommended); giving the library one arm per kind of refusal is post-cut dependency work,
651
- /// not a change made mid-cut.
652
- /// ⟨2026-10-07, beside the count above⟩ Twelve: the admin's `retrySellerPayment` (the owner's
653
- /// decision of that day) passes the library's settle refusal through as `#Conflict` too — state
654
- /// behind this canister's own gate, like the other six.
634
+ /// **Read the MESSAGE, not the arm, on this method.** That is the opposite of what the interface's
635
+ /// result rule (one Result shape, refusals as values) asks everywhere else, and it is stated here
636
+ /// rather than left to be discovered: a caller branching on the arm will retry a call that can
637
+ /// never succeed for it. Recovering the distinction needs the LIBRARY to carry arms — matching its
638
+ /// prose here would reintroduce exactly the message-branching that rule abolished, and would break
639
+ /// silently on an ic402 bump.
640
+ ///
641
+ /// This is the market's whole ic402 seam, not one method. Twelve sites on this market collapse an
642
+ /// ic402 text into `#Conflict`, and each carries its own caveat. Four can carry a refusal of the
643
+ /// caller's standing — `claimJob`, `confirmJob`, `disputeJob` and `submitJobResult`.
644
+ /// `setServiceEnabled` is gated by this canister before the library is called, so it no longer
645
+ /// can. Seven are state refusals behind this canister's own gate — `resolveDispute`,
646
+ /// `reconcileSession`, `forceResolveSession`, `recoverEscrow`, `reconcileJob`, `resolveJob` and the
647
+ /// admin's `retrySellerPayment`. Read-the-message is this interface version's contract; giving the
648
+ /// library one arm per kind of refusal is dependency work, not a change this method can make.
655
649
  ///
656
650
  /// It also refuses while TRADE IS FROZEN, and that one is a true `#Conflict` — the refusal says
657
651
  /// so explicitly ("Not a permission problem and not a missing job"), and `isTradeFrozen()` is the
658
652
  /// ungated read that confirms it.
659
653
  claimJob: (jobId: text) -> (Result);
660
- /// ⟨0.16.0⟩ `confirmJob` ABSORBS `confirmJobEvm`. One buyer action, two ways to prove you
654
+ /// `confirmJob` absorbed `confirmJobEvm` in 0.16.0. One buyer action, two ways to prove you
661
655
  /// are the buyer.
662
656
  ///
657
+ /// Terminal money settlement — the seller gets paid. Honours the freeze exactly like every
658
+ /// other settle path; a settlement that ignored the freeze would make the freeze a suggestion.
659
+ ///
663
660
  /// The pair existed because authorization arrives differently on the two rails, not because the
664
661
  /// ACT differs: both release escrow to the seller. An ICP-rail buyer proves identity by calling
665
662
  /// as their principal; an EVM-rail buyer has no principal here at all, so they prove it with a
@@ -678,7 +675,7 @@ service : {
678
675
  /// `#Conflict`) and **`Not the buyer`** (properly `#Refused`) all arrive as `#Conflict`. On THIS
679
676
  /// method read the MESSAGE rather than the arm — it is terminal money settlement, so a caller
680
677
  /// who reads `#Conflict` as "retry later" will retry a release that can never happen for them.
681
- /// Same seam as `claimJob`; three costed fixes were recorded ⟨2026-08-21⟩.
678
+ /// Same seam as `claimJob`.
682
679
  confirmJob: (jobId: text, evmProof: opt vec nat8) -> (Result);
683
680
  /// Create a content endpoint — a shelf in the storefront. Born DISABLED.
684
681
  ///
@@ -688,8 +685,8 @@ service : {
688
685
  suggestedPriceE6: nat) -> (Result_19);
689
686
  /// Submit a paid service request. Returns a job id, or the price.
690
687
  ///
691
- /// ⟨0.16.0⟩ TWO GATES FROM THE ENGRAM DO NOT TRAVEL, and both for the same reason: they were the
692
- /// engram protecting ITS OWNER'S money, which is custody, and custody stayed.
688
+ /// TWO GATES THE ENGRAM HAD BEFORE 0.16.0 DO NOT TRAVEL HERE, and both for the same reason: they
689
+ /// were the engram protecting ITS OWNER'S money, which is custody, and custody stayed.
693
690
  ///
694
691
  /// · `requireAgentOrOwner` — the engram only let its own agents spend its funds. Here the
695
692
  /// caller is a BUYER paying with their own signature; gating that to a roster would mean a
@@ -712,7 +709,7 @@ service : {
712
709
  /// Delete an endpoint. Terminal — the record stays as #Deleted so purchase history keeps
713
710
  /// resolving, and the id is never reused.
714
711
  deleteEndpoint: (endpointId: text) -> (Result);
715
- /// ⟨0.16.0⟩ `disputeJob` ABSORBS `disputeJobEvm`, exactly as confirmJob does, and for the
712
+ /// `disputeJob` absorbed `disputeJobEvm` in 0.16.0, exactly as confirmJob did, and for the
716
713
  /// same reason: one act, two proofs of buyership.
717
714
  ///
718
715
  /// NOT FREEZE-GATED, and that asymmetry with confirmJob is deliberate. Recording a dispute moves
@@ -723,7 +720,6 @@ service : {
723
720
  /// ⚠ `#Conflict` HERE ALSO COVERS "NOT THE BUYER" — same ic402 seam as `confirmJob` and
724
721
  /// `claimJob`: `Job not found`, `Job not in submitted status` and **`Not the buyer`** all arrive
725
722
  /// as `#Conflict` because the library hands back strings. Read the MESSAGE, not the arm.
726
- /// ⟨2026-08-21; three fixes were recorded, with why none is a one-liner.⟩
727
723
  ///
728
724
  /// ⚠ AND NOTE WHERE THE DISPUTE GOES: `resolveDispute` is answered by the SERVICE'S OWN SELLER
729
725
  /// — the party being disputed. This market has no admin arbitration and no appeal, deliberately
@@ -748,18 +744,16 @@ service : {
748
744
  /// NOT freeze-gated, and the asymmetry is the point: a freeze halts SETTLEMENT, and this settles
749
745
  /// nothing. An admin must be able to repair a record during the halt that made the record wrong.
750
746
  ///
751
- /// ⟨2026-10-02, the payment library's refusal channel — audited at this site⟩ `#Conflict` here
752
- /// carries ic402's text, and ic402 answers with one text channel for every refusal. AUDITED:
753
- /// this method's own gate (`requireAdmin`) decides authorization before the library is called, and every
754
- /// text the library returns here is a STATE refusal (session missing, or not stuck in #closing) — including "not found", which
755
- /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
756
- /// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
757
- /// dependency work.
758
- ///
759
- /// ⟨2026-11-05, ic402 2.20.0⟩ NOT FOR AN ICP SESSION LEFT `#closing` BY AN UNKNOWN SETTLE (a close that
760
- /// answered "outcome unknown"): `reconcileSession` resolves that one from the escrow balance. Forcing it
761
- /// would mark it closed whether or not the settle landed, stranding the recipient's share if it did
762
- /// not. This method stays for a close that trapped after an await.
747
+ /// NOT FOR AN ICP SESSION LEFT `#closing` BY AN UNKNOWN SETTLE (a close that answered "outcome
748
+ /// unknown"): `reconcileSession` resolves that one from the escrow balance. Forcing it would mark it
749
+ /// closed whether or not the settle landed, stranding the recipient's share if it did not. This
750
+ /// method is for a close that trapped after an await.
751
+ ///
752
+ /// `#Conflict` here carries ic402's text, and ic402 answers with one text channel for every
753
+ /// refusal. This method's own gate (`requireAdmin`) decides authorization before the library is
754
+ /// called, so every text the library returns here is a STATE refusal (session missing, or not stuck
755
+ /// in #closing) — including "not found", which arrives as `#Conflict` rather than `#NotFound`. Read
756
+ /// the MESSAGE for which; the seam is described at `claimJob`.
763
757
  forceResolveSession: (sessionId: text) -> (Result);
764
758
  /// PUBLIC: accountability requires knowing who holds power. This is the shape every canister
765
759
  /// in the system serves, so one reader covers all of them.
@@ -782,22 +776,20 @@ service : {
782
776
  /// The `approvalId` parameter is gone, as it is on openSession: an approval is the BUYER's own
783
777
  /// custody policy, checked on their engram before they call here.
784
778
  ///
785
- /// ⟨update-for-read⟩ UPDATE, NOT QUERY: the paid path awaits `gate.settle(sig, ?amount)`, an inter-canister
786
- /// settlement. A query cannot await it, and splitting the free and paid halves into two methods
787
- /// would put the price and the content behind different names for one buyer act.
779
+ /// UPDATE, NOT QUERY: the paid path awaits `gate.settleFrom(msg.caller, sig, ?amount)`, an
780
+ /// inter-canister settlement. A query cannot await it, and splitting the free and paid halves into
781
+ /// two methods would put the price and the content behind different names for one buyer act.
788
782
  ///
789
- /// ⟨2026-09-30, ic402 2.17.0⟩ It now awaits `gate.settleFrom(msg.caller, sig, ?amount)`. On the
790
- /// ICP rail a signature's `sender` is only a claim — the payer's ICRC-2 allowance is the whole
791
- /// authentication — so `settle` would spend the allowance of whoever the signature named and
792
- /// deliver the content to the caller. `settleFrom` refuses unless the caller IS the named sender,
793
- /// before the nonce lock or any ledger call, and the refusal reaches the buyer as #Refused with
794
- /// ic402's text naming both principals. Pay as the principal that approved the allowance.
783
+ /// `settleFrom`, not the bare `settle` (ic402 2.17.0 and later): on the ICP rail a signature's
784
+ /// `sender` is only a claim — the payer's ICRC-2 allowance is the whole authentication — so `settle`
785
+ /// would spend the allowance of whoever the signature named and deliver the content to the caller.
786
+ /// `settleFrom` refuses unless the caller IS the named sender, before the nonce lock or any ledger
787
+ /// call, and the refusal reaches the buyer as #Refused with ic402's text naming both principals. Pay
788
+ /// as the principal that approved the allowance.
795
789
  getContent: (contentId: text, paymentSig: opt PaymentSignature) ->
796
790
  (Result_17);
797
- /// ⟨0.16.0⟩ THE `getChunk` FIX, and it is the sharpest single case in the August 2026 audit of every
798
- /// wire method.
799
- ///
800
- /// The engram's version was:
791
+ /// Why the reply is a `Wire.Result` and not an option. Before 0.16.0 the engram served this as
792
+ /// `getChunk`, and that version was:
801
793
  ///
802
794
  /// switch (gate.verifyGrant(msg.caller, grant)) {
803
795
  /// case (#ok) { contentStore.getChunk(grant.contentRef.id, index) };
@@ -816,23 +808,23 @@ service : {
816
808
  /// request and a support ticket generated by a type.
817
809
  ///
818
810
  /// The honesty gates could not see it. `gate.verifyGrant` is a PAYMENT gate, and the gate-call
819
- /// list they scan holds authorization helpers only — so a refusal fabricated behind a payment
820
- /// check was out of scope by construction rather than by ruling. The 0.16.0 honesty rule adds
821
- /// payment gates to that list; this method is why.
811
+ /// list they scanned held authorization helpers only — so a refusal fabricated behind a payment
812
+ /// check was out of scope by construction. Since 0.16.0 that list includes payment gates; this
813
+ /// method is why.
822
814
  getContentChunk: (grant: AccessGrant, index: nat) -> (Result_15) query;
823
815
  /// PUBLIC: what this canister's chains continue, or that they continue nothing. A fresh chain
824
816
  /// beside a published predecessor head is auditable; a fresh chain with no statement is
825
817
  /// indistinguishable from a wipe.
826
818
  getGenesisNote: () -> (GenesisNote) query;
827
- /// ⟨0.16.0, refusals are values, never traps⟩
828
- /// The engram TRAPPED here. Trapping was the right fix at the time — it stopped the
829
- /// refusal masquerading as a not-found — but it hands the caller no structured reason and cannot
830
- /// be told from a genuine fault. Under the 0.16.0 result rule the refusal is a value.
819
+ /// A refusal here is a value, never a trap. The engram, which served jobs before 0.16.0, TRAPPED
820
+ /// here. Trapping was the right fix at the time — it stopped the refusal masquerading as a
821
+ /// not-found — but it hands the caller no structured reason and cannot be told from a genuine
822
+ /// fault.
831
823
  ///
832
824
  /// The comment the engram carried is worth keeping because it names what went wrong: `null`
833
- /// collapsed "unknown jobId" and "not authorized", and the product rendered the wrong conclusion
834
- /// from it — the marketplace UI printed "Job not found (or not yet visible)" at a caller who was
835
- /// merely unauthorized. Job existence is not the secret: `getJobCounts()` is ungated.
825
+ /// collapsed "unknown jobId" and "not authorized", and a client rendered the wrong conclusion from
826
+ /// it — "Job not found (or not yet visible)", printed at a caller who was merely unauthorized. Job
827
+ /// existence is not the secret: `getJobCounts()` is ungated.
836
828
  getJob: (jobId: text) -> (Result_16) query;
837
829
  /// PUBLIC: aggregate counts that identify nobody — and already public on the engram, which is
838
830
  /// what made `listJobs`' existence-leak justification false.
@@ -847,11 +839,9 @@ service : {
847
839
  /// Three outcomes, three answers now. And `Payer` (above) removes the root cause rather than
848
840
  /// only labelling it.
849
841
  getJobResult: (jobId: text) -> (Result_15) query;
850
- /// Terminal money settlement — the seller gets paid. Honours the freeze exactly like every
851
- /// other settle path; a settlement that ignored the freeze would make the freeze a suggestion.
852
842
  /// PUBLIC: a job's state, and nothing else about it.
853
843
  ///
854
- /// ⟨0.16.0⟩ THE UNGATED TWIN OF `getJob`, AND IT MUST STAY UNGATED. `getJob` is allowed to refuse
844
+ /// THE UNGATED TWIN OF `getJob`, AND IT MUST STAY UNGATED. `getJob` is allowed to refuse
855
845
  /// precisely because this exists: an EVM-rail buyer has NO PRINCIPAL on this canister, so a
856
846
  /// principal-gated read can never authorize them, and without a public status read they would
857
847
  /// have no way to see the state of a job they paid for. `getJob`'s refusal names this method for
@@ -859,8 +849,9 @@ service : {
859
849
  ///
860
850
  /// Job existence is not the secret being kept — the payload is. Status and nothing more.
861
851
  ///
862
- /// The engram returned `?EngramJobStatus`, conflating "no such job" with a null-ish answer. Here
863
- /// a missing job is `#NotFound`, which is a fact rather than an absence a caller has to interpret.
852
+ /// The engram, which served jobs before 0.16.0, returned `?EngramJobStatus`, conflating "no such
853
+ /// job" with a null-ish answer. Here a missing job is `#NotFound`, which is a fact rather than an
854
+ /// absence a caller has to interpret.
864
855
  getJobStatus: (jobId: text) -> (Result_14) query;
865
856
  /// PUBLIC: the market's spend limits, with the caller rosters REDACTED.
866
857
  ///
@@ -876,7 +867,7 @@ service : {
876
867
  getPaymentPolicy: () -> (SpendingPolicy) query;
877
868
  /// A seller's own revenue on this market.
878
869
  ///
879
- /// ⟨0.16.0⟩ SELLER-SCOPED. The engram's version was owner-only and TRAPPED at everyone else,
870
+ /// SELLER-SCOPED. The engram's version (before 0.16.0) was owner-only and TRAPPED at everyone else,
880
871
  /// which was coherent when the owner was the only seller. Here every caller has a different
881
872
  /// answer, and no caller is entitled to another's: the numbers cover the caller's own listings
882
873
  /// and nothing is aggregated across sellers.
@@ -893,39 +884,32 @@ service : {
893
884
  /// PUBLIC: what a buyer can learn about a seller, and the whole of it.
894
885
  ///
895
886
  /// The ENGRAM ID is the point of this read. This market runs no reputation system and issues no
896
- /// badges, so the honest trust signal is not a verdict we invent — it is a pointer to the record
897
- /// the seller already keeps. A buyer who wants to know whether this seller is a verified human,
898
- /// what their audit chain says, or how long they have existed asks THAT engram directly, and gets
899
- /// an answer this market cannot shade.
887
+ /// badges, so the honest trust signal is not a verdict the market invents — it is a pointer to the
888
+ /// record the seller already keeps. A buyer who wants to know whether this seller is a verified
889
+ /// human, what their audit chain says, or how long they have existed asks THAT engram directly, and
890
+ /// gets an answer this market cannot shade.
900
891
  ///
901
892
  /// `verified` is about ownership at a moment in time and nothing else. It is not an endorsement,
902
893
  /// and the field name is the strongest claim it makes.
903
894
  ///
904
- /// ⟨2026-11-04, the owner's sale-payout ruling⟩ It also says where this seller's sales land
905
- /// (`evmPayout`, `evmPayoutError`) and how many are still in flight (`parkedPayouts`,
895
+ /// It also says where this seller's sales land (`evmPayout`, `evmPayoutError`; a sale is paid into
896
+ /// the selling engram's own wallet) and how many are still in flight (`parkedPayouts`,
906
897
  /// `parkedSaleNotices`) — counts, never amounts (`Types.SellerStatus`).
907
898
  getSellerStatus: (seller: principal) -> (Result_12) query;
908
899
  /// PUBLIC: aggregate session counts. Identifies nobody, and the same reasoning as getJobCounts —
909
900
  /// which is also what made `listJobs`' old "no existence leak" defence false.
910
901
  getSessionCounts: () -> (SessionCounts) query;
911
902
  http_request: (request: HttpRequest) -> (HttpResponse) query;
912
- /// ⟨2026-09-30, ic402 2.17.0⟩ THE TWO PAID ROUTES HERE STAY ON `gate.settle`, AND THAT IS WHY NO
913
- /// FLOW MAY LEAVE A STANDING ALLOWANCE TO THIS MARKET. An HTTP request arrives with no caller to
914
- /// check (the gateway calls anonymously), so `settleFrom` cannot apply and ic402 says to keep
915
- /// `settle` on HTTP paths. Such a settle is authenticated only by the payer's ICRC-2 allowance:
916
- /// anyone who names a principal holding an unspent allowance to this canister can spend it here.
917
- /// The defence is on the paying side — approve exactly the price plus one ledger fee, expiring
918
- /// within minutes, immediately before paying (the SDK's `MarketClient` does). WHAT WOULD MAKE
919
- /// THIS WRONG: an HTTP route that could authenticate its payer, or a flow of ours that approves
920
- /// more than one payment's worth or without an expiry.
921
- ///
922
- /// ⟨CORRECTED 2026-09-30 — the owner's web-route answer⟩ The paragraph above is history. No web route
923
- /// settles an ICP-rail payment any more, so none spends an allowance and none can be used against
924
- /// a standing one. The one `gate.settle` left is on /service/, reached only with an EVM (`eip155:`)
925
- /// payment carrying the buyer's own EIP-3009 authorization — a signature that names the payment and
926
- /// travels privately in the request. An ICP-rail (ckUSDC) payment offered there is refused before
927
- /// any settle and pointed at the Candid `createJob`; /content/ sells nothing over the web
928
- /// (`contentNotSoldOverHttp`). ckUSDC is taken only by the Candid calls, which check their caller.
903
+ /// NO WEB ROUTE SETTLES AN ICP-RAIL PAYMENT, so none spends an ICRC-2 allowance and none can be used
904
+ /// against a standing one. An HTTP request arrives with no caller to check (the gateway calls
905
+ /// anonymously), so ic402's caller-checked `settleFrom` cannot apply, and a bare `settle` on the ICP
906
+ /// rail is authenticated only by the payer's allowance: anyone who names a principal holding an
907
+ /// unspent allowance to this canister could spend it. So the one `gate.settle` left is on /service/,
908
+ /// reached only with an EVM (`eip155:`) payment carrying the buyer's own EIP-3009 authorization — a
909
+ /// signature that names the payment and travels privately in the request. An ICP-rail (ckUSDC)
910
+ /// payment offered there is refused before any settle and pointed at the Candid `createJob`;
911
+ /// /content/ sells nothing over the web (`contentNotSoldOverHttp`). ckUSDC is taken only by the
912
+ /// Candid calls, which check their caller.
929
913
  /// WHAT WOULD MAKE THIS WRONG: a web route that settles a payment whose network is not `eip155:`.
930
914
  http_request_update: (request: HttpRequest) -> (HttpResponse);
931
915
  /// PUBLIC: a wallet calls this BEFORE its user has any standing here — that is the whole point of
@@ -984,12 +968,10 @@ service : {
984
968
  /// `total` is the head counter, not the row count: this is a bounded ring, so a page that
985
969
  /// reported only what it returned would make a trimmed log look complete.
986
970
  ///
987
- /// ⟨2026-10-15, the owner's ruling of 2026-10-14 on the chained record⟩ The reply is the shared
988
- /// `Wire.RecordPage`, so
989
- /// one checker reads every chain. A viewer sees every entry, so `sealed` is always empty here;
990
- /// `ringFloor` says where the ring starts and `hashFirstFrom` where this record switched to the
991
- /// hash-first rule. The gate is unchanged (hash-only rows for strangers were ruled for the
992
- /// engram's record).
971
+ /// The reply is the shared `Wire.RecordPage`, so one checker reads every chain. A viewer sees
972
+ /// every entry, so `sealed` is always empty here; `ringFloor` says where the ring starts and
973
+ /// `hashFirstFrom` where this record switched to the hash-first rule. The gate is unchanged:
974
+ /// hash-only rows for strangers are the engram's record's rule, not this one's.
993
975
  listAuditEntries: (start: nat, limit: nat) -> (Result_11) query;
994
976
  /// Admin AND the enrolled viewers themselves — the roster rule of who may read what. A viewer who cannot see the
995
977
  /// roster cannot tell whether their own enrolment survived a rotation.
@@ -1003,7 +985,7 @@ service : {
1003
985
  listDenialEntries: (start: nat, limit: nat) -> (Result_9) query;
1004
986
  /// Purchase history for one endpoint: its creator sees every row, a buyer sees their own.
1005
987
  ///
1006
- /// ⟨0.16.0⟩ Two defects close here at once, and they are the same defect wearing two hats.
988
+ /// Two defects were closed here at once in 0.16.0, and they are the same defect wearing two hats.
1007
989
  ///
1008
990
  /// The engram matched a buyer with `buyer == Principal.toText(msg.caller)` — string equality
1009
991
  /// against a field that holds a principal on one rail and a `0x` address on the other. So an
@@ -1020,7 +1002,8 @@ service : {
1020
1002
  /// none look different, which is the honest answer, without publishing what was withdrawn.
1021
1003
  listEndpoints: (statusFilter: opt EndpointStatus, start: nat, limit:
1022
1004
  nat) -> (Page_3) query;
1023
- /// ⟨0.16.0⟩ THE `listJobs` FIX — the second of the two fabricated empties the 0.16.0 honesty rule names.
1005
+ /// Why a refusal is `#Refused` here and not an empty list — the second of two fabricated empties
1006
+ /// fixed in 0.16.0.
1024
1007
  ///
1025
1008
  /// The engram's version ended its authorization check with `if (not (isOwner or
1026
1009
  /// isServiceOperator)) { return [] }`, and its own `.did` comment declared the behaviour on the
@@ -1037,15 +1020,16 @@ service : {
1037
1020
  /// scan for a known set of authorization helpers; this method's check is two LOCAL BOOLEANS
1038
1021
  /// (`isOwner`, `isServiceOperator`), so the analyzer matched nothing and reported no finding. Its
1039
1022
  /// siblings `getJob` and `getJobResult` had already been converted to traps for exactly this
1040
- /// defect; this one survived because it was written differently, not because it was ruled safe.
1023
+ /// defect; this one survived because it was written differently, not because anyone had judged it
1024
+ /// safe.
1041
1025
  ///
1042
1026
  /// Now: `#Refused` when the caller may not ask, `#NotFound` when the service does not exist —
1043
1027
  /// two facts that were one empty list.
1044
1028
  listJobs: (serviceId: text, statusFilter: opt JobStatus, start: nat, limit:
1045
1029
  nat) -> (Result_7) query;
1046
- /// ⟨2026-11-04, the owner's sale-payout ruling⟩ The parked payouts to the caller's engram — a content sale
1047
- /// whose push the ledger has not confirmed, each settled by `retrySalePayout` — so an unresolved
1048
- /// payout is discoverable rather than something a seller must already know the id of.
1030
+ /// The parked payouts to the caller's engram — a content sale whose push the ledger has not
1031
+ /// confirmed, each settled by `retrySalePayout` — so an unresolved payout is discoverable rather
1032
+ /// than something a seller must already know the id of.
1049
1033
  ///
1050
1034
  /// Behind the seller's CURRENT registration (`requireSellerRead`, the query twin of `requireSeller`),
1051
1035
  /// and scoped to that registration's engram by `Payments.parkedFor` — not an inline filter, for the
@@ -1054,18 +1038,18 @@ service : {
1054
1038
  /// have a parked payout. PAGED, not a bounded exemption: a run of ledger outages across a run of
1055
1039
  /// sales accumulates rows with nothing to stop it.
1056
1040
  listMyParkedPayouts: (start: nat, limit: nat) -> (Result_6) query;
1057
- /// ⟨0.16.0⟩ `listAllServices` FOLDS in as `includeDisabled`.
1041
+ /// `listAllServices` was folded in as `includeDisabled` in 0.16.0.
1058
1042
  ///
1059
- /// The engram had two methods because the visibility rule differed: everyone saw enabled
1060
- /// services; the owner and active sellers also saw disabled drafts. On a shared market that
1061
- /// rule becomes per-seller — you see every enabled service, plus YOUR OWN disabled drafts — which
1062
- /// is one query with a flag rather than two methods with divergent gates.
1043
+ /// The engram, which served these before then, had two methods because the visibility rule
1044
+ /// differed: everyone saw enabled services; the owner and active sellers also saw disabled drafts.
1045
+ /// On a shared market that rule becomes per-seller — you see every enabled service, plus YOUR OWN
1046
+ /// disabled drafts — which is one query with a flag rather than two methods with divergent gates.
1063
1047
  ///
1064
1048
  /// `withheld` counts other sellers' drafts that the flag asked for and the caller may not see. A
1065
1049
  /// seller can tell "no drafts" from "not yours to see" without learning whose they are.
1066
1050
  listServices: (includeDisabled: bool, start: nat, limit: nat) ->
1067
1051
  (Page) query;
1068
- /// ⟨0.16.0⟩ THE APPROVAL PARAMETER IS GONE, and its absence is the split working.
1052
+ /// THE APPROVAL PARAMETER IS GONE (since 0.16.0), and its absence is the split working.
1069
1053
  ///
1070
1054
  /// The engram's openSession took an `approvalId` and could answer `#approvalPending` — because
1071
1055
  /// there, opening a session was THE ENGRAM SPENDING ITS OWNER'S MONEY, so the owner's approval
@@ -1081,56 +1065,48 @@ service : {
1081
1065
  /// the market got simpler because the responsibility went where it belonged, not because anything
1082
1066
  /// was dropped.
1083
1067
  ///
1084
- /// ⚠ ⟨2026-09-02 — OWNER-RULED: MARKET SESSIONS ARE NOT REQUIRED FOR NOW. The interfaces stay;
1085
- /// this note is what makes them honest.⟩ THE SESSION LIFECYCLE HERE IS INERT: a session can be
1086
- /// opened, and it can be closed or refunded, but it can never be SPENT. `gate.consumeVoucher` has
1087
- /// **zero call sites in this canister** — the only two in the estate are on the ENGRAM, which
1088
- /// runs its own separate paid-memory rail with its own gateway, `sess-N` counter and escrow
1068
+ /// ⚠ MARKET SESSIONS ARE NOT IN USE (decided 2026-09-02: not required for now). The interfaces
1069
+ /// stay, and this note is what makes them honest. THE SESSION LIFECYCLE HERE IS INERT: a session
1070
+ /// can be opened, and it can be closed or refunded, but it can never be SPENT. `gate.consumeVoucher`
1071
+ /// has **zero call sites in this canister** — the only two in this repository are on the ENGRAM,
1072
+ /// which runs its own separate paid-memory rail with its own gateway, `sess-N` counter and escrow
1089
1073
  /// subaccount. So a market session is deposit-in and full-refund-out, and a buyer who opens one
1090
1074
  /// gets their money back minus two ckUSDC ledger fees, having bought nothing.
1091
1075
  ///
1092
1076
  /// WHY THE METHODS ARE KEPT RATHER THAN DELETED: they are a complete, reviewable lifecycle
1093
1077
  /// (open / end / forceClose / forceResolve / recoverEscrow / getSessionCounts) against a real
1094
- /// escrow, and the ruling is "not required for now", not "never". Deleting them would mean
1095
- /// re-deriving the seam when session billing is wanted, and the market is WITHHELD at 0.16.0 —
1096
- /// in neither environment — so nothing here is reachable by a customer today regardless.
1078
+ /// escrow, and the decision is "not required for now", not "never". Deleting them would mean
1079
+ /// re-deriving the seam when session billing is wanted, and the market is withheld from 0.16.0's
1080
+ /// deployments, so nothing here is reachable by a buyer today regardless.
1097
1081
  ///
1098
1082
  /// WHAT WOULD MAKE THIS SAFE TO ENABLE: a voucher-spend path — something on this canister that
1099
- /// calls `gate.consumeVoucher` and delivers what the voucher paid for. Until that exists, the
1100
- /// two `#Session` billing refusals say session billing is UNAVAILABLE rather than pointing
1101
- /// buyers at `openSession`, which is what they used to do.
1102
- ///
1103
- /// ⟨2026-09-30, ic402 2.17.0⟩ That future spend path calls `gate.consumeVoucherFrom(msg.caller, …)`,
1104
- /// not the bare `consumeVoucher`: the signed fallback is off on this canister, so the bare call
1105
- /// refuses every voucher, and only the session key calling as itself may spend a session.
1083
+ /// calls `gate.consumeVoucherFrom(msg.caller, …)` and delivers what the voucher paid for. Not the
1084
+ /// bare `consumeVoucher`: the signed fallback is off on this canister (ic402 2.17.0 and later), so
1085
+ /// the bare call refuses every voucher, and only the session key calling as itself may spend a
1086
+ /// session. Until that path exists, the two `#Session` billing refusals say session billing is
1087
+ /// UNAVAILABLE rather than pointing buyers at `openSession`, which is what they used to do.
1106
1088
  openSession: (config: SessionConfig, sig: PaymentSignature) -> (Result_5);
1107
- /// RENAMED from `requestSession` in the 0.16.0 interface pass: it is a pure dry run — a quote for a session
1108
- /// the caller has not opened and is not committed to. `request` read as an action with an effect.
1109
- ///
1110
- /// PUBLIC: a price list nobody can read is not a price list, and this is the market's. ⟨The
1111
- /// sentence was already here as "Ungated:"; only the marker the disclosure gate greps for was missing,
1112
- /// which is why this method read as undefended when it was not.⟩
1113
- /// ⟨CORRECTED 2026-08-24 — this said "UPDATE, NOT QUERY" under the update-for-read marker and cited a
1114
- /// market ruling that a later market ruling had already closed.⟩ QUERY, per the ruled quote
1115
- /// convention: FAST READS. Both `quotePayment` and `previewOpenSession` become queries, and the
1116
- /// update-for-read rule's open-ruling exception retires with them — so the argument written here
1117
- /// for keeping it an update was arguing the losing side of a decision already made, and was added
1118
- /// the same day by not reading forward to the ruling. `gate.offerSession` is pure — it validates
1119
- /// the intent and returns it — so nothing forced the update in the first place.
1120
- ///
1121
- /// ONE-REPLICA CAVEAT, stated here because the ruling requires it at both sites: a query is one
1122
- /// replica's word and is NOT a settleable challenge. Nothing quoted here can be redeemed. The
1123
- /// commitment happens in `openSession`, which IS a certified update call, and a buyer who needs
1124
- /// the price attested rather than quoted takes it from that reply.
1125
- ///
1126
- /// ⟨2026-10-02⟩ Answers the house `Types.SessionIntent` — ic402's intent with `expiry` spelled
1127
- /// `expiryNs`. `openSession` hands ic402 its own record, from `sessionIntent()` below.
1089
+ /// RENAMED from `requestSession` in 0.16.0: it is a pure dry run — a quote for a session the
1090
+ /// caller has not opened and is not committed to. `request` read as an action with an effect.
1091
+ ///
1092
+ /// PUBLIC: a price list nobody can read is not a price list, and this is the market's.
1093
+ ///
1094
+ /// QUERY, like `quotePayment`: quotes are fast reads. `gate.offerSession` is pure — it validates
1095
+ /// the intent and returns it — so nothing forces an update.
1096
+ ///
1097
+ /// ONE-REPLICA CAVEAT, stated at both quote methods: a query is one replica's word and is NOT a
1098
+ /// settleable challenge. Nothing quoted here can be redeemed. The commitment happens in
1099
+ /// `openSession`, which IS a certified update call, and a buyer who needs the price attested rather
1100
+ /// than quoted takes it from that reply.
1101
+ ///
1102
+ /// Answers the market's own `Types.SessionIntent` — ic402's intent with `expiry` spelled
1103
+ /// `expiryNs`. `openSession` hands ic402 the library's own record.
1128
1104
  previewOpenSession: () -> (SessionIntent) query;
1129
1105
  /// PUBLIC: what it costs to pay this market a given amount, on every rail it settles.
1130
1106
  ///
1131
- /// ⟨0.16.0⟩ Reshaped from `getPaymentRequirements(amount) : [PaymentRequirement]`. A bare array
1107
+ /// Reshaped in 0.16.0 from `getPaymentRequirements(amount) : [PaymentRequirement]`. A bare array
1132
1108
  /// was a `get*` returning a list, which reads like a collection to page through; this is a QUOTE,
1133
- /// a single answer to a single question, and it now says so in its name and its type.
1109
+ /// a single answer to a single question, and it says so in its name and its type.
1134
1110
  ///
1135
1111
  /// The quote ECHOES the amount it priced. A caller comparing this to a later 402 challenge is
1136
1112
  /// then comparing two stated numbers instead of assuming the one they sent came back unchanged.
@@ -1139,32 +1115,25 @@ service : {
1139
1115
  /// is not a question this canister can answer — better a legible refusal than a trap in the
1140
1116
  /// caller's own callback.
1141
1117
  ///
1142
- /// ⟨CORRECTED 2026-10-02 — the nonce is GONE from the quote; the two paragraphs below are kept as
1143
- /// the record of why.⟩ Each requirement is now a `QuotedRequirement`: ic402's requirement without
1144
- /// its `nonce` (and with `expiry` spelled `expiryNs`). The paragraphs below describe the throwaway
1145
- /// that was published until this date; the review before the 0.16.0 cut recommended dropping it
1146
- /// over ratifying it, and it was dropped. "Do not pay against it" is now enforced by there being
1147
- /// nothing to pay against.
1148
- ///
1149
- /// ⚠ THE NONCE IN EACH REQUIREMENT IS A THROWAWAY — DO NOT PAY AGAINST IT. `requireAll` mints a
1150
- /// server nonce with a HashMap put, and this is a QUERY, so the write is discarded on return.
1151
- /// The nonce is published and does not exist. Signing a payment against it settles as
1152
- /// `#expired("Server nonce expired, already used, or bound to a different network/token")`,
1153
- /// which is wrong on every clause and points a caller back here for another dead one.
1154
- ///
1155
- /// That is by design, not an oversight now excused: a quote is a PRICE LIST, not a settleable
1156
- /// challenge. The HTTP surface of this same canister already draws the line in the same place —
1157
- /// `/discovery/resources` is a catalog with a throwaway nonce, while `/content` and `/service`
1158
- /// return `httpUpgrade()` so the challenge is minted in an UPDATE and persists. This is the
1159
- /// Candid twin of `/discovery/resources`, and it was the only one of the pair not saying so.
1160
- /// ⟨CORRECTED 2026-09-30⟩ Only `/service` upgrades now; `/content` sells nothing over the web and
1161
- /// answers 410 from the query. And unlike this quote, the web catalog lists EVM requirements only.
1118
+ /// A QUOTE IS A PRICE LIST, NOT A SETTLEABLE CHALLENGE, so it carries no nonce. Each requirement is
1119
+ /// a `QuotedRequirement`: ic402's requirement without its `nonce` (and with `expiry` spelled
1120
+ /// `expiryNs`). The nonce was removed (2026-10-02) because a quote's nonce could never be real:
1121
+ /// `requireAll` mints a server nonce with a HashMap put, and this is a QUERY, so the write is
1122
+ /// discarded on return. The published nonce did not exist, and signing a payment against it settled
1123
+ /// as `#expired("Server nonce expired, already used, or bound to a different network/token")`, which
1124
+ /// was wrong on every clause and pointed a caller back here for another dead one. "Do not pay
1125
+ /// against it" is now enforced by there being nothing to pay against.
1126
+ ///
1127
+ /// The web catalog of this same canister, `/discovery/resources`, draws the line in the same place:
1128
+ /// it is a catalog (its nonce is a throwaway, for the same reason), and it lists services only, with
1129
+ /// EVM requirements only. Of the web routes only `/service` mints a payable challenge, in an UPDATE;
1130
+ /// `/content` sells nothing over the web and answers 410 from the query.
1162
1131
  ///
1163
1132
  /// TO GET A PAYABLE CHALLENGE, call the resource: `getContent(contentId, null)` or
1164
1133
  /// `createJob(serviceId, params, null)`. Both are updates, so the nonce they mint survives.
1165
- /// This matters most on the ckUSDC rail, which is where customer payments settle: ICP has no
1166
- /// on-chain nonce, so `settle` ALWAYS requires the server one. A conformant EVM x402 client
1167
- /// sends no server nonce at all and is unaffected.
1134
+ /// This matters most on the ckUSDC rail, which is where buyers pay: ICP has no on-chain nonce, so
1135
+ /// `settle` ALWAYS requires the server one. A conformant EVM x402 client sends no server nonce at
1136
+ /// all and is unaffected.
1168
1137
  quotePayment: (amountE6: nat) -> (Result_4) query;
1169
1138
  /// Admin recovery: re-drive a job stuck mid-settlement — a broadcast EVM transfer whose outcome
1170
1139
  /// this canister never learned. Reads the chain and finishes what the settle started.
@@ -1172,13 +1141,11 @@ service : {
1172
1141
  /// Unstick, not decide: it does not choose an outcome, it discovers one. When it cannot, it says
1173
1142
  /// so and points at resolveJob, which is where a human decision belongs.
1174
1143
  ///
1175
- /// ⟨2026-10-02, the payment library's refusal channel — audited at this site⟩ `#Conflict` here
1176
- /// carries ic402's text, and ic402 answers with one text channel for every refusal. AUDITED:
1177
- /// this method's own gate (`requireAdmin`) decides authorization before the library is called, and every
1178
- /// text the library returns here is a STATE refusal (job missing, no parked tx, no confirm hook wired, the chain's answer) — including "not found", which
1179
- /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
1180
- /// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
1181
- /// dependency work.
1144
+ /// `#Conflict` here carries ic402's text, and ic402 answers with one text channel for every
1145
+ /// refusal. This method's own gate (`requireAdmin`) decides authorization before the library is
1146
+ /// called, so every text the library returns here is a STATE refusal (job missing, no parked tx, no
1147
+ /// confirm hook wired, the chain's answer) — including "not found", which arrives as `#Conflict`
1148
+ /// rather than `#NotFound`. Read the MESSAGE for which; the seam is described at `claimJob`.
1182
1149
  reconcileJob: (jobId: text) -> (Result_2);
1183
1150
  /// Admin recovery for a session whose settlement was interrupted mid-flight. Same line as
1184
1151
  /// forceCloseSession: it completes what was already decided, it does not decide anything.
@@ -1187,25 +1154,24 @@ service : {
1187
1154
  /// moving outward. Force-close only returns a buyer's own deposit, which a freeze must not trap
1188
1155
  /// (the same reasoning that leaves disputeJob un-gated).
1189
1156
  ///
1190
- /// ⟨2026-10-02, the payment library's refusal channel — audited at this site⟩ `#Conflict` here
1191
- /// carries ic402's text, and ic402 answers with one text channel for every refusal. AUDITED:
1192
- /// this method's own gate (`requireAdmin`) decides authorization before the library is called, and every
1193
- /// text the library returns here is a STATE refusal (session missing, not parked in #closing, no parked tx, no EVM deposit or sender configured, the chain's answer) — including "not found", which
1194
- /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
1195
- /// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
1196
- /// dependency work.
1197
- ///
1198
- /// ⟨2026-11-05, ic402 2.20.0 — beside the list of refusals above⟩ It now also resolves an ICP session
1199
- /// left `#closing` by a close whose settle the ledger rejected after it may have run (that close
1200
- /// answers "outcome unknown"). It moves no money itself: it reads the session's escrow balance, and
1201
- /// the full deposit still there means the settle did not land, so the session reopens for a close to
1202
- /// settle it once; less than the deposit means it did, so the session ends `#closed` with the
1203
- /// remainder recoverable by its payer (`recoverEscrow`). Refused while a close of that session is
1204
- /// still running ("call again once it returns"), and a failed balance or fee query leaves the session
1205
- /// `#closing` to be reconciled again. THIS, NOT `forceResolveSession`, IS THE WAY OUT for such a
1206
- /// session: forcing one whose settle never landed strands the recipient's share.
1157
+ /// It also resolves an ICP session left `#closing` by a close whose settle the ledger rejected
1158
+ /// after it may have run (that close answers "outcome unknown"). It moves no money itself: it reads
1159
+ /// the session's escrow balance, and the full deposit still there means the settle did not land, so
1160
+ /// the session reopens for a close to settle it once; less than the deposit means it did, so the
1161
+ /// session ends `#closed` with the remainder recoverable by its payer (`recoverEscrow`). Refused
1162
+ /// while a close of that session is still running ("call again once it returns"), and a failed
1163
+ /// balance or fee query leaves the session `#closing` to be reconciled again. THIS, NOT
1164
+ /// `forceResolveSession`, IS THE WAY OUT for such a session: forcing one whose settle never landed
1165
+ /// strands the recipient's share.
1166
+ ///
1167
+ /// `#Conflict` here carries ic402's text, and ic402 answers with one text channel for every
1168
+ /// refusal. This method's own gate (`requireAdmin`) decides authorization before the library is
1169
+ /// called, so every text the library returns here is a STATE refusal (session missing, not parked
1170
+ /// in #closing, no parked tx, no EVM deposit or sender configured, the chain's answer) — including "not found", which
1171
+ /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which; the seam is
1172
+ /// described at `claimJob`.
1207
1173
  reconcileSession: (sessionId: text) -> (Result_2);
1208
- /// Admin recovery: return unconsumed escrow from a stuck or terminal session's own subaccount.
1174
+ /// Admin recovery: return unconsumed escrow from a closed session's own subaccount.
1209
1175
  /// THE ONE RECOVERY METHOD THAT MOVES REAL MONEY.
1210
1176
  ///
1211
1177
  /// It is on the right side of "an admin may unstick, and may not decide" for one structural
@@ -1223,34 +1189,27 @@ service : {
1223
1189
  /// Idempotent through the ledger: the first refund drains the subaccount, so a second call fails
1224
1190
  /// with insufficient funds rather than paying twice.
1225
1191
  ///
1226
- /// ⟨2026-10-02, the payment library's refusal channel — audited at this site⟩ `#Conflict` here
1227
- /// carries ic402's text, and ic402 answers with one text channel for every refusal. AUDITED:
1228
- /// this method's own gate (`requireAdmin`; the library's own only-the-payer check cannot fire, because the payer is read from the session and passed through) decides authorization before the library is called, and every
1229
- /// text the library returns here is a STATE refusal (an open session, nothing left to recover, the ledger's refusal) — including "not found", which
1230
- /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
1231
- /// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
1232
- /// dependency work.
1233
- ///
1234
- /// ⟨2026-10-05, ic402 2.17.3 — beside the first line and the list above⟩ Escrow comes back only
1235
- /// from a session that reads `closed`. A session that reads `closing` or `expired` is refused, with
1236
- /// nothing moved — a fourth state refusal — so a "stuck" session here means one that
1237
- /// `forceResolveSession` has closed first; recover it within 24 hours of that force.
1238
- /// ⟨2026-10-05, later — ic402 2.17.4, beside the line above⟩ Or one whose refund the ledger
1239
- /// refused or rejected: that close already ends the session `closed`, with the remainder still in
1240
- /// its escrow, so it needs no force. Recover it within 24 hours of that close, asking at most the
1241
- /// escrow's ledger balance less one fee.
1242
- ///
1243
- /// ⟨2026-10-07, the owner's decision of that day⟩ WHAT IT ANSWERS: what came back. `amount` is what
1244
- /// was transferred to the session's payer, in the token named (the amount asked, capped at the
1245
- /// session's unconsumed deposit; the transfer's fee comes out of the escrow on top), and
1246
- /// `blockIndex` is that ledger's block of the transfer. Until this date it answered a bare `nat`
1247
- /// that was the block index alone, which read as the amount. If the session's record is removed
1248
- /// before the amount can be read back — a session closed in the same moment as the recovery and
1249
- /// cleaned up during its transfer — it answers `#Other` naming the block, never a guessed amount.
1250
- ///
1251
- /// ⟨2026-11-19, ic402 2.23.0, beside the paragraph above⟩ `amount` is now the library's own figure for what
1252
- /// it paid, from its receipt (since ic402 2.22.0 it is also capped at what the session's close recorded as
1253
- /// still owed, less one fee). The `#Other` answer for a record removed during the transfer no longer occurs.
1192
+ /// Escrow comes back only from a session that reads `closed`: one that `forceResolveSession` has
1193
+ /// closed (recover it within 24 hours of that force), or one whose refund the ledger refused or
1194
+ /// rejected — that close already ends the session `closed` with the remainder still in its escrow,
1195
+ /// so it needs no force (recover it within 24 hours of that close, asking at most the escrow's
1196
+ /// ledger balance less one fee). A session that reads `closing` or `expired` is refused, with
1197
+ /// nothing moved.
1198
+ ///
1199
+ /// `#Conflict` here carries ic402's text, and ic402 answers with one text channel for every
1200
+ /// refusal. This method's own gate (`requireAdmin`; the library's own only-the-payer check cannot
1201
+ /// fire, because the payer is read from the session and passed through) decides authorization
1202
+ /// before the library is called, so every text the library returns here is a STATE refusal (a
1203
+ /// session that is not `closed`, nothing left to recover, the ledger's refusal) — including "not
1204
+ /// found", which arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which; the
1205
+ /// seam is described at `claimJob`.
1206
+ ///
1207
+ /// WHAT IT ANSWERS: what came back. `amount` is what was transferred to the session's payer, in the
1208
+ /// token named — the library's own figure for what it paid, from its receipt: the amount asked,
1209
+ /// capped at the session's unconsumed deposit and at what the session's close recorded as still
1210
+ /// owed, less one fee; the transfer's fee comes out of the escrow on top. `blockIndex` is that
1211
+ /// ledger's block of the transfer. (A bare block index, which an earlier version answered, read as
1212
+ /// the amount.)
1254
1213
  recoverEscrow: (sessionId: text, amount: TokenAmount) -> (Result_3);
1255
1214
  /// Register as a seller by naming the engram you own.
1256
1215
  ///
@@ -1263,17 +1222,17 @@ service : {
1263
1222
  /// the timestamp. The byte count SURVIVES re-registration — otherwise the quota would reset every
1264
1223
  /// thirty days, which is a quota in name only.
1265
1224
  ///
1266
- /// ⟨2026-11-04, the owner's ruling: a sale is paid into the selling engram's own wallet⟩
1267
- /// ON THIS MARKET'S BOOKS THE SELLER IS THE ENGRAM; the caller is the hand that lists for it. Every
1268
- /// identity this market hands the payment library — a service's operator, the claimant, the
1269
- /// submitter, the EVM payout key — is `engramId`, so the library pays the engram's own account on
1270
- /// the ckUSDC rail with no money code of ours, and content sales are pushed there by `payEngram`.
1271
- /// Three steps more than before, in order: the one-engram check (`oneEngramConflict`) before the
1272
- /// first await; after the registry, the engram is asked for its own EVM address
1273
- /// (`askEngramPayAddress`) and that address is registered with the library under the engram; the
1274
- /// one-engram check again, and the binding written from the LIVE map (the byte count may have moved
1275
- /// across the awaits). Last, this engram's parked sale notices are delivered (at most 16): a
1276
- /// seller's own message, and the engram just answered.
1225
+ /// A sale is paid into the selling engram's own wallet (since 2026-11-04), so ON THIS MARKET'S
1226
+ /// BOOKS THE SELLER IS THE ENGRAM; the caller is the hand that lists for it. Every identity this
1227
+ /// market hands the payment library — a service's operator, the claimant, the submitter, the EVM
1228
+ /// payout key — is `engramId`, so the library pays the engram's own account on the ckUSDC rail with
1229
+ /// no money code in this market, and content sales are pushed there by `payEngram`. Beyond the
1230
+ /// registry check, in order: the one-engram check (`oneEngramConflict`) before the first await;
1231
+ /// after the registry, the engram is asked for its own EVM address (`askEngramPayAddress`) and that
1232
+ /// address is registered with the library under the engram; the one-engram check again, and the
1233
+ /// binding written from the LIVE map (the byte count may have moved across the awaits). Last, this
1234
+ /// engram's parked sale notices are delivered (at most 16): a seller's own message, and the engram
1235
+ /// just answered.
1277
1236
  registerSeller: (engramId: principal) -> (Result);
1278
1237
  /// Register a paid service. Born DISABLED, like an endpoint and for the same reason: a listing
1279
1238
  /// that went live at creation would be sellable before its seller had checked it.
@@ -1301,7 +1260,8 @@ service : {
1301
1260
  /// policy, which then stops following later global changes. That is why the two never travel
1302
1261
  /// apart: without this one, every override is permanent in effect.
1303
1262
  removeCallerPolicy: (caller: principal) -> (Result);
1304
- /// ⟨0.16.0⟩ RULED 2026-08-17: THE SELLER RESOLVES. Not the market admin.
1263
+ /// THE SELLER RESOLVES, not the market admin (decided 2026-08-17, when the market moved out of
1264
+ /// the engram for 0.16.0).
1305
1265
  ///
1306
1266
  /// The engram's `requireOwner` was coherent there because the engram's owner IS the seller — a
1307
1267
  /// dispute was between that owner and their buyer. Transcribing it here would have made the
@@ -1309,7 +1269,8 @@ service : {
1309
1269
  /// money: a business and probably a legal position, inherited by accident from a canister where
1310
1270
  /// "owner" meant something else.
1311
1271
  ///
1312
- /// The ruling keeps the power where it already was rather than quietly relocating it to us.
1272
+ /// So the power stays where it already was rather than being quietly relocated to whoever runs
1273
+ /// the market.
1313
1274
  ///
1314
1275
  /// ⚠ THE ASYMMETRY IS REAL AND IS STATED, HERE AND ON THE WIRE. The accused judges. A seller can
1315
1276
  /// refuse a refund to a buyer who has already paid, and nothing on this canister overrides that:
@@ -1322,13 +1283,12 @@ service : {
1322
1283
  /// timeout arrives, this method is where the change lands and this comment is the argument it has
1323
1284
  /// to answer.
1324
1285
  ///
1325
- /// ⟨2026-10-02, the payment library's refusal channel — audited at this site⟩ `#Conflict` here
1326
- /// carries ic402's text, and ic402 answers with one text channel for every refusal. AUDITED:
1327
- /// this method's own gate (the service's seller, checked above the library call) decides authorization before the library is called, and every
1328
- /// text the library returns here is a STATE refusal (job missing, not in a resolvable state, a refund parked or failed) — including "not found", which
1329
- /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
1330
- /// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
1331
- /// dependency work.
1286
+ /// `#Conflict` here carries ic402's text, and ic402 answers with one text channel for every
1287
+ /// refusal. This method's own gate (the service's seller, checked above the library call) decides
1288
+ /// authorization before the library is called, so every text the library returns here is a STATE
1289
+ /// refusal (job missing, not in a resolvable state, a refund parked or failed) — including "not
1290
+ /// found", which arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which; the
1291
+ /// seam is described at `claimJob`.
1332
1292
  resolveDispute: (jobId: text, refundBuyer: bool) -> (Result);
1333
1293
  /// Admin LAST RESORT: force a job to a terminal status when reconcileJob cannot determine one —
1334
1294
  /// a reverted or dead transaction that the chain will never resolve either way.
@@ -1341,25 +1301,23 @@ service : {
1341
1301
  /// move it sideways. Every use is a chained audit row naming the admin and the status they chose.
1342
1302
  ///
1343
1303
  /// `#other` fails closed. It is a placeholder for a job state this canister cannot name, and
1344
- /// forcing a job into a state we cannot name is not a recovery.
1345
- ///
1346
- /// ⟨2026-10-02, the payment library's refusal channel — audited at this site⟩ `#Conflict` here
1347
- /// carries ic402's text, and ic402 answers with one text channel for every refusal. AUDITED:
1348
- /// this method's own gate (`requireAdmin`) decides authorization before the library is called, and every
1349
- /// text the library returns here is a STATE refusal (job missing, not stuck in #Settling, a target that is not terminal) — including "not found", which
1350
- /// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
1351
- /// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
1352
- /// dependency work.
1304
+ /// forcing a job into a state nobody can name is not a recovery.
1305
+ ///
1306
+ /// `#Conflict` here carries ic402's text, and ic402 answers with one text channel for every
1307
+ /// refusal. This method's own gate (`requireAdmin`) decides authorization before the library is
1308
+ /// called, so every text the library returns here is a STATE refusal (job missing, not stuck in
1309
+ /// #Settling, a target that is not terminal) — including "not found", which arrives as `#Conflict`
1310
+ /// rather than `#NotFound`. Read the MESSAGE for which; the seam is described at `claimJob`.
1353
1311
  resolveJob: (jobId: text, terminal: JobStatus) -> (Result);
1354
- /// ⟨2026-11-04, the owner's sale-payout ruling⟩ Deliver one engram's parked sale notices to its record —
1355
- /// at most 16 a call, oldest first — and answer how many landed. CALLABLE BY ANYONE, anonymous
1356
- /// included: the engram dedups on the receipt id and accepts only this market, so nothing can be
1357
- /// misdirected or written twice; the same accepted residual as `retrySalePayout`. `#NotFound` when
1358
- /// nothing is parked for that engram (every sale it made here reached its record, or none was made).
1312
+ /// Deliver one engram's parked sale notices to its record — at most 16 a call, oldest first — and
1313
+ /// answer how many landed. CALLABLE BY ANYONE, anonymous included: the engram dedups on the receipt
1314
+ /// id and accepts only this market, so nothing can be misdirected or written twice; the same
1315
+ /// accepted residual as `retrySalePayout`. `#NotFound` when nothing is parked for that engram
1316
+ /// (every sale it made here reached its record, or none was made).
1359
1317
  retrySaleNotices: (engramId: principal) -> (Result_1);
1360
- /// ⟨2026-11-04, the owner's sale-payout ruling⟩ Settle a parked sale payout by asking the ledger what
1361
- /// happened, rather than assuming — the retired withdrawal recovery's saga, kept whole for the payout
1362
- /// that replaced the withdrawal.
1318
+ /// Settle a parked sale payout by asking the ledger what happened, rather than assuming. A sale is
1319
+ /// paid into the selling engram's own wallet (since 2026-11-04); this is the recovery the seller
1320
+ /// withdrawal it replaced used, kept whole.
1363
1321
  ///
1364
1322
  /// Re-sends the IDENTICAL transfer: same engram, amount, fee, memo and `created_at_time`. Within
1365
1323
  /// ICRC-1's 24-hour window there are exactly two conclusive outcomes: `#Duplicate` — the first push
@@ -1378,13 +1336,13 @@ service : {
1378
1336
  /// NOTHING ELSE. It never refunds the buyer, and it refuses every job that does not read
1379
1337
  /// `#Verified`, with nothing moved.
1380
1338
  ///
1381
- /// ⟨2026-10-07, the owner's decision of that day⟩ A job whose work passed verification and whose
1382
- /// payment to the seller then failed rests in `#Verified`, and only `resolveDispute` moves it — the
1383
- /// service's SELLER's, by the ruling of 2026-08-17, which stands unchanged. A seller who never acts
1384
- /// left it there, with no way for anyone else to move it. This is the admin's way: unstick, not
1385
- /// decide. The job's outcome was decided by its verification; the payment goes where that sent it,
1386
- /// and the admin names neither a recipient nor an amount. Refunding the buyer, and anything about a
1387
- /// job not yet verified (`#Submitted`, `#Disputed`), stay the seller's.
1339
+ /// A job whose work passed verification and whose payment to the seller then failed rests in
1340
+ /// `#Verified`, and otherwise only `resolveDispute` moves it — which is the service's SELLER's to
1341
+ /// call (see `resolveDispute`). A seller who never acts would leave it there, with no way for anyone
1342
+ /// else to move it. This is the admin's way: unstick, not decide. The job's outcome was decided by
1343
+ /// its verification; the payment goes where that sent it, and the admin names neither a recipient
1344
+ /// nor an amount. Refunding the buyer, and anything about a job not yet verified (`#Submitted`,
1345
+ /// `#Disputed`), stay the seller's.
1388
1346
  ///
1389
1347
  /// It runs the library's own settle, the one a buyer's confirmation runs: the job reads `#Settling`
1390
1348
  /// while it pays (so two retries cannot both pay), ends `#Settled`, and a payment the ledger refuses
@@ -1407,14 +1365,13 @@ service : {
1407
1365
  setAdmin: (newAdmin: principal) -> (Result);
1408
1366
  /// Override the policy for ONE payer — the market's per-buyer risk control.
1409
1367
  setCallerPolicy: (caller: principal, policy: SpendingPolicy) -> (Result);
1410
- /// ⟨0.16.0, one boolean idiom⟩ `enableEndpoint` and `disableEndpoint` FOLD into one setter.
1368
+ /// `enableEndpoint` and `disableEndpoint` were folded into this one setter in 0.16.0.
1411
1369
  ///
1412
1370
  /// They were byte-identical apart from the status they wrote and the word in their name, which is
1413
- /// the definition of a boolean expressed as two methods. The 0.16.0 naming rules allow one idiom for
1414
- /// a boolean feature (a set…Enabled setter plus a readable flag), and the fold also removes a real
1415
- /// hazard: two methods meant two authorization checks
1416
- /// to keep in step, and a divergence between them would have been invisible to a reader looking at
1417
- /// either one alone.
1371
+ /// the definition of a boolean expressed as two methods. The interface's naming rules allow one
1372
+ /// idiom for a boolean feature (a set…Enabled setter plus a readable flag), and the fold also
1373
+ /// removes a real hazard: two methods meant two authorization checks to keep in step, and a
1374
+ /// divergence between them would have been invisible to a reader looking at either one alone.
1418
1375
  ///
1419
1376
  /// `#Deleted` stays a refusal in both directions and stays `#Conflict`, not `#Invalid`: the
1420
1377
  /// request is well-formed and permitted, the endpoint is simply in a terminal state — and calling
@@ -1432,18 +1389,15 @@ service : {
1432
1389
  /// distinguishable from a tightening after the fact. A policy raise is the quiet half of most
1433
1390
  /// money incidents, and "policy changed" alone cannot tell an investigator which way.
1434
1391
  setPaymentPolicy: (policy: SpendingPolicy) -> (Result);
1435
- /// Whom this canister anchors to. Set by the admin at deploy; `sys` because it is protocol
1436
- /// configuration, not a product surface.
1437
- ///
1438
- /// ⟨RENAMED 2026-10-02 from `sysSetRegistryId` — the sys-tier retier ruled 2026-08-24, executed
1439
- /// under the owner's 2026-10-02 ruling to carry out the interface decisions reviewed before the
1440
- /// 0.16.0 cut as recommended.⟩ The sentence above is why it was sys-named, and the retier is why it
1441
- /// no longer is: the `sys` prefix names the canister-to-canister tier, whose callers are other
1442
- /// canisters, and this method's only caller is a PERSON — the market's admin, at deploy. Keeping it
1443
- /// there made "a `sys` method has no human caller" false, and so uncheckable. A plain admin setter
1444
- /// (`setAdmin`'s sibling) is what it always was.
1392
+ /// Whom this canister anchors to. Set by the admin at deploy.
1393
+ ///
1394
+ /// Not `sys`-prefixed (it was `sysSetRegistryId` until 2026-10-02): the `sys` prefix names the
1395
+ /// canister-to-canister tier, whose callers are other canisters, and this method's only caller is
1396
+ /// a PERSON — the market's admin, at deploy. Keeping it there made "a `sys` method has no human
1397
+ /// caller" false, and so uncheckable. It is a plain admin setter, `setAdmin`'s sibling.
1445
1398
  setRegistryId: (id: principal) -> (Result);
1446
- /// ⟨0.16.0, one boolean idiom⟩ enableService + disableService FOLD, same as the endpoint pair.
1399
+ /// `enableService` and `disableService` were folded into this one setter in 0.16.0, as the
1400
+ /// endpoint pair was.
1447
1401
  ///
1448
1402
  /// Deliberately NOT admin-overridable, unlike endpoints. Disabling a seller's service is a
1449
1403
  /// commercial act against that seller, and an admin who needs to remove a listing should do it
@@ -1451,19 +1405,14 @@ service : {
1451
1405
  /// seller did it. Endpoints allow the admin override because a deleted endpoint is already
1452
1406
  /// terminal and visible; a disabled service looks like the seller's own choice.
1453
1407
  ///
1454
- /// ⚠ `#Conflict` HERE ALSO COVERS "NOT THE SELLER" — the same ic402 seam as `claimJob`,
1455
- /// `confirmJob` and `disputeJob`. `enableService`/`disableService` return `Service not found`
1456
- /// (properly `#NotFound`) and **`Not the seller`** (properly `#Refused`) as plain strings, so
1457
- /// the arm is gone before this method sees it. Read the MESSAGE, not the arm.
1458
- /// ⟨2026-08-21; three costed fixes were recorded, with why none is a
1459
- /// one-liner.⟩
1460
- /// ⟨CORRECTED 2026-10-02, audited at this site — the paragraph above no longer holds here.⟩
1461
- /// `requireServiceSeller` now runs BEFORE the library: a missing service is refused `#NotFound`
1462
- /// and another seller `#Refused`, by this canister, with its own sentences. The library is then
1463
- /// called with the caller already proven to be the seller, so its "Not the seller" and "Service
1464
- /// not found" texts cannot reach the `#Conflict` arm below except across a race with a deletion.
1465
- /// The seam is closed on this method by the gate, not by the library; the others keep their
1466
- /// caveats.
1408
+ /// The payment library's refusals do not reach the caller as `#Conflict` here. Its
1409
+ /// `enableService`/`disableService` return `Service not found` and `Not the seller` as plain
1410
+ /// strings, which would lose the arm, so `requireServiceSeller` runs BEFORE the library: a missing
1411
+ /// service is refused `#NotFound` and another seller `#Refused`, by this canister, with its own
1412
+ /// sentences. The library is then called with the caller already proven to be the seller, so its
1413
+ /// texts cannot reach the `#Conflict` arm below except across a race with a deletion. The seam is
1414
+ /// closed on this method by the gate, not by the library; the other library call sites (`claimJob`
1415
+ /// and its neighbours) keep their own caveats.
1467
1416
  setServiceEnabled: (id: text, enabled: bool) -> (Result);
1468
1417
  /// A seller submits a finished job's result.
1469
1418
  ///
@@ -1478,12 +1427,11 @@ service : {
1478
1427
  /// the four modes.
1479
1428
  ///
1480
1429
  /// ⚠ `#Conflict` HERE ALSO COVERS "NOT THE ASSIGNED OPERATOR" — a refusal of the caller's
1481
- /// STANDING, not of the job's state. ⟨2026-10-02, audited at this site⟩ ic402's `submitResult`
1482
- /// checks the caller against the job's operator itself and answers with one text channel, so
1483
- /// "Not the assigned operator" and "Job not assigned" arrive here exactly as "Cannot submit result
1484
- /// in status: …" does. A caller that branches on the arm retries a submission that can never be
1485
- /// theirs. Read the MESSAGE, not the arm. This is the 0.16.0 contract as ratified on 2026-10-02;
1486
- /// giving the library one arm per kind of refusal is post-cut dependency work.
1430
+ /// STANDING, not of the job's state. ic402's `submitResult` checks the caller against the job's
1431
+ /// operator itself and answers with one text channel, so "Not the assigned operator" and "Job not
1432
+ /// assigned" arrive here exactly as "Cannot submit result in status: …" does. A caller that
1433
+ /// branches on the arm retries a submission that can never be theirs. Read the MESSAGE, not the
1434
+ /// arm (the seam is described at `claimJob`).
1487
1435
  submitJobResult: (jobId: text, result: blob, proof: opt blob, actualCost:
1488
1436
  opt nat) -> (Result);
1489
1437
  /// Upload a whole file in one call.