From c3248e8dc91ae693b83c049113fe6d4686e26a9e Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Fri, 3 Jul 2026 17:20:19 -0400 Subject: [PATCH] format: add activation correlation id to invoke/return/revert types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The activation-id correction (#240 schema) adds an optional `activation` string on the invoke, return, and revert context objects — the opening invoke and the closing return/revert share the same value to pair an activation independent of trace order. Mirror that in the TS types: add `activation?: string` to Invoke.Invocation, Return.Info, and Revert.Info. Placed per-object to track the schema (activation is added on each of invoke/return/revert, not on the shared context/function identity schema). No guard change — activation is an optional field on an existing object, not a new context discriminator. --- packages/format/src/types/program/context.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/format/src/types/program/context.ts b/packages/format/src/types/program/context.ts index 7c4e4ea4c..d221f3437 100644 --- a/packages/format/src/types/program/context.ts +++ b/packages/format/src/types/program/context.ts @@ -169,8 +169,9 @@ export namespace Context { Invoke.isInvocation(value.invoke); export namespace Invoke { - export type Invocation = Function.Identity & - ( + export type Invocation = Function.Identity & { + activation?: string; + } & ( | Invocation.InternalCall | Invocation.ExternalCall | Invocation.ContractCreation @@ -180,7 +181,8 @@ export namespace Context { Function.isIdentity(value) && (Invocation.isInternalCall(value) || Invocation.isExternalCall(value) || - Invocation.isContractCreation(value)); + Invocation.isContractCreation(value)) && + (!("activation" in value) || typeof value.activation === "string"); export namespace Invocation { export interface InternalCall extends Function.Identity { @@ -254,6 +256,7 @@ export namespace Context { export interface Info extends Function.Identity { data?: Function.PointerRef; success?: Function.PointerRef; + activation?: string; } export const isInfo = (value: unknown): value is Info => @@ -261,7 +264,8 @@ export namespace Context { typeof value === "object" && !!value && (!("data" in value) || Function.isPointerRef(value.data)) && - (!("success" in value) || Function.isPointerRef(value.success)); + (!("success" in value) || Function.isPointerRef(value.success)) && + (!("activation" in value) || typeof value.activation === "string"); } export interface Revert { @@ -278,6 +282,7 @@ export namespace Context { export interface Info extends Function.Identity { reason?: Function.PointerRef; panic?: number; + activation?: string; } export const isInfo = (value: unknown): value is Info => @@ -285,7 +290,8 @@ export namespace Context { typeof value === "object" && !!value && (!("reason" in value) || Function.isPointerRef(value.reason)) && - (!("panic" in value) || typeof value.panic === "number"); + (!("panic" in value) || typeof value.panic === "number") && + (!("activation" in value) || typeof value.activation === "string"); } export interface Transform {