feat: agent type safety, notification alignment, contract migration, ci setup (#139 #140 #171 #179)#231
Open
dimka90 wants to merge 1 commit into
Open
Conversation
…ct tests, use npm ci (DXmakers#139 DXmakers#140 DXmakers#171 DXmakers#179) ## DXmakers#139 [Agent 17] Remove unsafe type assertions - Added parseValidatedGoal() helper with proper runtime type narrowing - Replaced as number / as string casts in registerUserGoal and updateUserGoal - GoalPayloadInput fields now accessed through validated typed interface ## DXmakers#140 [Agent 18] Align server notification type with frontend - Added ErrorNotification type to frontend (was missing) - Updated ConnectedNotification payload shape to match server - Added ProactiveNotificationPayload interface for notification type - Added sender and projection fields to AgentMessagePayload - Added isErrorNotification, isProactiveNotification, isPongNotification guards - Removed catch-all GenericNotification in favor of strict types ## DXmakers#171 [Contract 24] Migrate tests from register_contract to register - Changed 41 env.register_contract(None, X) calls to env.register(X, ()) - Uses soroban-sdk 22's new register API ## DXmakers#179 [CI DevOps 07] Use npm ci instead of npm install - Updated README setup instructions from npm install to npm ci - CI pipeline already uses npm ci Closes DXmakers#139, Closes DXmakers#140, Closes DXmakers#171, Closes DXmakers#179
|
@dimka90 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Combined PR implementing 4 issues from the additional audit report.
#139 [Agent 17] — Remove unsafe type assertions on private clients
parseValidatedGoal()helper that narrows types via runtimetypeofchecks instead ofas number/as stringcastsregisterUserGoal()andupdateUserGoal()with calls to the typed helperGoalPayloadInput(allunknownfields) is now consumed through a properly typedValidatedGoalDatainterfacesendMessage()andbroadcastMessage()remain public — no need for externalas anyaccess#140 [Agent 18] — Align server notification type with frontend
ErrorNotificationtype (was missing in frontend — server sends{ type: 'error', payload: { message } })ConnectedNotification.payloadshape to match server ({ userId, timestamp })ProactiveNotificationPayloadinterface with fulltype,projection, etc.AgentMessagePayloadto includesender: 'agent'andprojectionfieldsisErrorNotification,isProactiveNotification,isPongNotificationGenericNotification— all incoming messages are now strictly typed#171 [Contract 24] — Migrate tests from
register_contracttoregisterenv.register_contract(None, X)toenv.register(X, ())soroban-sdk 22API#179 [CI DevOps 07] — Use
npm ciinstead ofnpm installnpm ci— no change needed therenpm installtonpm cifor consistencyFiles changed
agent/websocket-server.tsValidatedGoalData,parseValidatedGoal(); removedascastsfrontend/src/types/websocket.tscontracts/src/lib.rsregister_contract→registercallsREADME.mdnpm install→npm ciin setup instructionsCloses #139
Closes #140
Closes #171
Closes #179