Skip to content

Commit e480c20

Browse files
Fix staticcheck findings
1 parent 4df5e3e commit e480c20

2 files changed

Lines changed: 2 additions & 33 deletions

File tree

api/grpc/handlers.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,32 +84,6 @@ func validateSensitivity(name, value string, required bool) error {
8484
return nil
8585
}
8686

87-
func validateOutcomeStatus(name, value string, required bool) error {
88-
if value == "" {
89-
if required {
90-
return status.Errorf(codes.InvalidArgument, "%s is required", name)
91-
}
92-
return nil
93-
}
94-
if !schema.IsValidOutcomeStatus(schema.OutcomeStatus(value)) {
95-
return status.Errorf(codes.InvalidArgument, "%s must be one of: success, failure, partial", name)
96-
}
97-
return nil
98-
}
99-
100-
func validateTaskState(name, value string, required bool) error {
101-
if value == "" {
102-
if required {
103-
return status.Errorf(codes.InvalidArgument, "%s is required", name)
104-
}
105-
return nil
106-
}
107-
if !schema.IsValidTaskState(schema.TaskState(value)) {
108-
return status.Errorf(codes.InvalidArgument, "%s must be one of: planning, executing, blocked, waiting, done", name)
109-
}
110-
return nil
111-
}
112-
11387
func validateMemoryType(name, value string) error {
11488
if !schema.IsValidMemoryType(schema.MemoryType(value)) {
11589
return status.Errorf(codes.InvalidArgument, "%s must be one of: episodic, working, semantic, competence, plan_graph, entity", name)

pkg/ingestion/capture.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ func (s *Service) CaptureMemory(ctx context.Context, req CaptureMemoryRequest) (
178178
return nil, err
179179
} else if semanticRecord != nil {
180180
createdRecords = append(createdRecords, semanticRecord)
181-
candidates = append(candidates, semanticRecord)
182181
edges = append(edges, semanticEdges...)
183182
for _, edge := range semanticEdges {
184183
if edge.SourceID != sourceRecord.ID {
@@ -302,12 +301,8 @@ func buildFallbackInterpretation(req CaptureMemoryRequest) *schema.Interpretatio
302301
TopicalLabels: uniqueStrings(req.Tags),
303302
ExtractionConfidence: 0.25,
304303
}
305-
for _, mention := range inferMentionsFromContent(req.Content) {
306-
interpretation.Mentions = append(interpretation.Mentions, mention)
307-
}
308-
for _, ref := range inferReferenceCandidates(req.Content, req.Context) {
309-
interpretation.ReferenceCandidates = append(interpretation.ReferenceCandidates, ref)
310-
}
304+
interpretation.Mentions = append(interpretation.Mentions, inferMentionsFromContent(req.Content)...)
305+
interpretation.ReferenceCandidates = append(interpretation.ReferenceCandidates, inferReferenceCandidates(req.Content, req.Context)...)
311306
if interpretation.ProposedType == "" {
312307
interpretation.ProposedType = inferProposedType(req.SourceKind)
313308
}

0 commit comments

Comments
 (0)