Vendor @intx/types, @intx/storage-isogit, and @intx/inference at Interchange head - #411
Merged
TheGreatAxios merged 4 commits intoAug 8, 2026
Conversation
…head Both packages are the dependency floor the reactor's approval-suspend primitive needs (PendingOperation lives in @intx/types, its persistence hook in @intx/storage-isogit), and neither carries local patches, so they sync as verbatim copies of the upstream source tree. Resolving them as workspace packages instead of npm installs also collapses a duplicate arktype install that previously desynced instanceof checks between the root's arktype and the nested copy every published @intx/* package carried.
The approval-suspend primitive (upstream 06d39dc6) changes PendingOperation and BeforeToolDecision shapes that @intx/inference, @intx/types, and @intx/storage-isogit all share, so @intx/inference cannot stay on the old published type shapes once @intx/types moves to head — the two must sync together. Reapplied all 9 locally patched files against the new source (correlatingIds leak fix, ephemeralTurns, checkpoint-after-tool-cycle, single-checkpoint-per-decide guard, turns-revision checkpoint skip, SSE line cap, stream-terminal detection, abort-reason propagation, and the commitment-boundary streaming redesign in the retry wrapper) and dropped two patches upstream has since absorbed on its own (deliver()'s unhandled- rejection guard, and the reactor-level inference.retry emission, both now implemented natively — see vendor/intx-inference/PATCHES.md for the full per-file ledger and what changed).
…hapes
@intx/types renamed the block-signature event from
inference.thinking.signature to inference.block.signature and generalized
signatures to every signable block kind, not just thinking blocks. Updated
the Responses adapters' signature emission and the perf span classifier's
event set, plus test fixtures asserting the old event name.
ProviderAdapter also gained a required parseJSONResponse for non-streaming
JSON bodies. The three Responses adapters here always request stream: true,
so a JSON body reaching them means the response kind was misdetected or the
provider ignored the streaming request; parseJSONResponse for these throws
a protocol-mismatch error rather than pretending to support a mode never
requested.
ContentBlock gained a safety_rating variant (structured content-filter
signals from Gemini's promptFeedback); the context-size estimator now
counts its blockReason text like the other block kinds.
The OpenAI chat-completions adapter (vendored, unpatched) now wraps text
content as a { type: "text", text } part instead of a bare string when a
turn mixes text and image blocks, matching the API's own content-parts
contract; updated the adapter test's expectation to match.
Adds docs/VENDORING.md as the authoritative record of what's vendored, from which upstream commit, and how to re-sync — the pattern established by the original @intx/inference vendoring stops scaling once three packages share one sync cadence. Points AGENTS.md's Interchange table at it. Also corrects the vendoring plan's claim that no vendoring stage depends on another: this sync found that @intx/types and @intx/inference are typed against each other via one upstream commit and cannot land as separately shippable PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vendors
@intx/types,@intx/storage-isogit, and@intx/inferenceas source at Interchange upstream head (cd7c5a37747dc39713d1efd24296ea861e6ac82a), replacing the published npm0.2.2installs for the first two and re-syncing the already-vendored third.Why all three together
The staged plan treated
@intx/types/@intx/storage-isogit(stage 2) and@intx/inference(stage 3) as separately landable. They are not. The reactor's approval-suspend primitive (upstream06d39dc6) changesPendingOperationand theBeforeToolDecisionreturn contract across all three packages in one upstream commit —@intx/inference's exported signatures reference types that only exist in the newer@intx/types. Vendoring either side alone does not typecheck by construction, so splitting them across two PRs would require an intermediate broken-build state.This disproves the plan's §5 claim that "no stage depends on a later one being merged first for main to stay shippable" for this pair.
docs/plans/interchange-vendoring-plan.mdis corrected in this PR rather than left to mislead the next reader.Local patches
@intx/typesand@intx/storage-isogitare verbatim copies — zero local modifications, so a diff against any later upstream checkout shows 100% upstream-authored lines.@intx/inferencecarries local patches.vendor/intx-inference/PATCHES.mdis new and records, per file, what each patch fixes and why it is not yet upstream. All 9 previously-carried files were reapplied against the new source; every patch site now carries a one-lineLocally patched — see vendor/intx-inference/PATCHES.md#<anchor>marker, sogrep -rn "Locally patched" vendor/intx-inference/srcenumerates every intentional divergence.Two patches were dropped as genuinely superseded, verified by reading the new upstream source rather than assuming:
deliver()'s unhandled-rejection guard — upstream now wraps the whole correlation dispatch in try/catch and routes failures throughcloseMessageRun, which is stricter than what we carried.inference.retryemission — retry moved entirely intoharness.ts'srunInferencewrapper, which emits the event itself; keeping ours would double-emit.The security- and leak-sensitive patches are all still carried: the
correlatingIdsunbounded-Setleak on every successful correlated resume, the 16 MiB SSE line cap (OOM vector), and the OpenAI Responses stream-terminal detection (hang).Consequent migrations in our own source
These are real semantic migrations, not casts to satisfy the type checker:
inference.thinking.signature→inference.block.signature; upstream generalized signatures from thinking blocks to every signable block kind. Updated the Responses adapters' emission and the perf span classifier.ProviderAdaptergained a requiredparseJSONResponse. The three Responses adapters always requeststream: true, so a JSON body reaching them means the response kind was misdetected — they throwProtocolMismatchErrorrather than pretend to support a mode never requested.ContentBlockgained asafety_ratingvariant (GeminipromptFeedbackcontent-filter signals); the context-size estimator now counts itsblockReasontext like every other block kind.{ type: "text", text }part instead of a bare string when a turn mixes text and images, matching the API's own content-parts contract; the adapter test's expectation was updated to match.Side effect: arktype duplication resolved
Every published
@intx/*package previously carried its own nestedarktypeinstall, distinct from the root's — so aninstanceofcheck against a type built by one instance silently returnedfalseagainst the other. Resolving these packages as workspace members removes the nested installs;bun.locknow shows a singlearktyperesolution across the tree. Closes CL-5665.Verification
bun run typecheckcleanbun run buildclean/Users/thegreataxios/abklabs/interchangewas read-only throughout — confirmed clean working tree,HEADunchanged, zero commits ahead of originReviewed by greybeard (approach) and critique (execution). Critique verified the reapplied
tryCorrelatetry/finally closes the leak on every exit path, the commitment-boundary retry redesign is coherent, both dropped patches are legitimately superseded, and thesrc/migrations are honest fixes rather than stubs.Docs
docs/VENDORING.mdis new: what's vendored, from which commit, patched vs. verbatim, and the re-sync procedure — including the caveat that a vendoredpackage.json's"version": "0.2.2"is a carried-over convention and does not describe the checked-out source.AGENTS.md's Interchange section points at it.Not in scope:
@intx/authz,@intx/agent,@intx/tools-posix,@intx/logremain on published releases.