Skip to content

format: add activation correlation id to invoke/return/revert types#241

Merged
gnidan merged 1 commit into
transform-contextfrom
debugger-activation-field
Jul 3, 2026
Merged

format: add activation correlation id to invoke/return/revert types#241
gnidan merged 1 commit into
transform-contextfrom
debugger-activation-field

Conversation

@gnidan

@gnidan gnidan commented Jul 3, 2026

Copy link
Copy Markdown
Member

Follow-up to #240 (activation-id spec correction). Closes #34.

#240 adds an optional activation string on the invoke, return, and
revert context objects — the opening invoke and the closing
return/revert carry the same value, letting a debugger pair an
activation independent of trace order (disambiguating adjacent inlined
activations and surviving optimizer reordering).

This mirrors that in the TS types: adds activation?: string to
Invoke.Invocation, Return.Info, and Revert.Info. Placed per-object
to track the schema exactly — the schema adds activation on each of
invoke/return/revert, not on the shared context/function identity
schema (so Function.Identity/isIdentity stay untouched).

No guard change: activation is an optional field on an existing object,
not a new context discriminator — the unchanged guards already accept it
(they ignore extra properties). Verified by scratch-merging #240's schema
locally and running the format suite: all guard-vs-example tests pass
with the new activation examples present.

Merge ordering: land after #240 merges so the types track the merged
schema. No file overlap with #240 (this touches only
packages/format/.../context.ts; #240 touches schemas + mdx), so no
conflict either way — this is purely a don't-land-types-ahead-of-schema
courtesy.

Note (reviewer's call): every other optional field on these objects is
validated in its guard (e.g. identifier/data/success do an optional
typeof/pointer check), so strictly for consistency activation could
get a one-line (!("activation" in v) || typeof v.activation === "string")
in isInvocation/Return.isInfo/Revert.isInfo. Left out per architect's
"no guard changes" call; happy to add if you'd prefer the consistency.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-03 21:57 UTC

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.
@gnidan gnidan force-pushed the debugger-activation-field branch from b2080ec to c3248e8 Compare July 3, 2026 21:46
@gnidan gnidan merged commit f31be26 into transform-context Jul 3, 2026
4 checks passed
@gnidan gnidan deleted the debugger-activation-field branch July 3, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant