feat: event-sourced strategy lifecycle audit (recommendation → execution → snapshot)#886
Merged
edehvictor merged 1 commit intoJun 30, 2026
Conversation
- Extend StrategyLifecycleEventType with OracleDecisionRecorded, FallbackRouteSelected, StrategyExecutionFailed, and updated StrategySnapshotted with snapshotVersion + changeReason - Add correlationId, actor, and sourceDataHash fields to all events so every event in a recommendation-through-execution chain is stably linked by a single ID rather than timestamps alone - Upgrade StrategyLifecycleAuditService with: - Static helpers: generateEventId, generateCorrelationId, hashPayload - getByCorrelationId: replays a full chain across strategies - getCorrelationSummary: returns path + isComplete for a chain - Add GET /api/strategies/:strategyId/lifecycle endpoint supporting optional correlationId query param for scoped history replay - Add 42 tests covering complete execution, blocked oracle, fallback route, failed execution, and replayed history query scenarios Closes edehvictor#34
|
@Nanle-code is attempting to deploy a commit to the Edeh Victor's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #34
Implements a full event-sourced audit trail that links every stage of a strategy's lifecycle — from recommendation through oracle evaluation, queue entry, execution or failure, and snapshot — using a stable
correlationIdrather than timestamps alone.types/strategyLifecycleEvents.tsid,correlationId,actor, andsourceDataHashto all eventsOracleDecisionRecorded,FallbackRouteSelected,StrategyExecutionFailedStrategySnapshottedEventnow carriessnapshotVersionandchangeReasonservices/strategyLifecycleAuditService.tsgenerateEventId,generateCorrelationId,hashPayload(SHA-256)getByCorrelationId— replays all events in a chain across any strategygetCorrelationSummary— returns the event path andisCompleteflag for a given chainroutes/strategies.tsGET /api/strategies/:strategyId/lifecycle?correlationId=param scopes the response to a single recommendation-through-execution chainTests (42 passing)
strategyLifecycleAudit.test.ts— service unit testsstrategyLifecycleRoute.test.ts— HTTP endpoint testsScenarios covered per acceptance criteria:
correlationIdValidation