Changed: Update vendored types for eve 0.47.3 - #2448
Draft
David Elner (delner) wants to merge 1 commit into
Draft
Conversation
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.
Problem
Consumers on current Eve cannot compile against
braintrustEveHookorbraintrustEveInstrumentationwithout anas nevercast. Four vendored types injs/src/vendor-sdk-types/eve.tshave drifted from Eve's:EveHookDefinition.eventsHookEventMapis a closed map it grows over time (0.52 exposes 33+ events). Our"*"handler was typed against a narrower union, so Eve's event type is no longer assignable.EveInstrumentationDefinition.eventsstep.startedto return a result rather thanvoid.EveInstrumentationModelInput.messagesModelMessage, which we hand-duplicated. The copy drifted fromai@7.EveProviderState.get()The old types fail identically on 0.37.1, the version the e2e scenario already pinned and passed, because nothing in the repo typechecks the vendored types. Runtime was never affected, which is why the drift went unnoticed.
Why this fixes it
The boundary types Eve hands us are now typed loosely and narrowed defensively at the point of use, so they no longer track
ai's shape and cannot silently re-drift. The detailed part types stay as our capture contract rather than as a claim about Eve's types, matching the existingAISDKMessagepattern inai-sdk-common.ts. Bothas nevercasts become unnecessary.Validation
Compiles clean against
0.22.1,0.37.1,0.47.6,0.48.0,0.50.0,0.52.1,0.52.2. Typecheck and the 27 Eve unit tests pass. No runtime behaviour change: the only substantive one, filtering unrecognized messages at capture, mirrors the allowlistisCapturedModelInputalready applies on read back, so a malformed message now drops itself instead of discarding the whole captured input.Known gap, not addressed here
Nothing typechecks the vendored types:
js/has noevedependency and the e2e harness has notscstep, so this contract stays unenforced and can drift again. Closing it needs its own change and is deliberately not faked here with scenario code that merely looks checked.