refactor(store,tools): migrate IDs from UUID to bigserial int64
Some checks failed
CI / build-and-test (push) Failing after -31m12s
Some checks failed
CI / build-and-test (push) Failing after -31m12s
All internal entity lookups now use bigserial primary keys (int64) while GUIDs are retained for external/public identification. Updated store functions (TouchProject, UpdateThoughtMetadata, AddThoughtAttachment) to query by id instead of guid, added GetThoughtByID, changed semanticSearch and all tool helpers to use *int64 project IDs, and updated retry/backfill workers to use int64 thought IDs throughout.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||
|
||||
"git.warky.dev/wdevs/amcs/internal/ai"
|
||||
@@ -49,9 +48,9 @@ func (t *SummarizeTool) Handle(ctx context.Context, req *mcp.CallToolRequest, in
|
||||
count := 0
|
||||
|
||||
if query != "" {
|
||||
var projectID *uuid.UUID
|
||||
var projectID *int64
|
||||
if project != nil {
|
||||
projectID = &project.ID
|
||||
projectID = &project.NumericID
|
||||
}
|
||||
results, err := semanticSearch(ctx, t.store, t.embeddings, t.search, query, limit, t.search.DefaultThreshold, projectID, nil)
|
||||
if err != nil {
|
||||
@@ -62,9 +61,9 @@ func (t *SummarizeTool) Handle(ctx context.Context, req *mcp.CallToolRequest, in
|
||||
}
|
||||
count = len(results)
|
||||
} else {
|
||||
var projectID *uuid.UUID
|
||||
var projectID *int64
|
||||
if project != nil {
|
||||
projectID = &project.ID
|
||||
projectID = &project.NumericID
|
||||
}
|
||||
thoughts, err := t.store.RecentThoughts(ctx, projectID, limit, in.Days)
|
||||
if err != nil {
|
||||
@@ -83,7 +82,7 @@ func (t *SummarizeTool) Handle(ctx context.Context, req *mcp.CallToolRequest, in
|
||||
return nil, SummarizeOutput{}, err
|
||||
}
|
||||
if project != nil {
|
||||
_ = t.store.TouchProject(ctx, project.ID)
|
||||
_ = t.store.TouchProject(ctx, project.NumericID)
|
||||
}
|
||||
|
||||
return nil, SummarizeOutput{Summary: summary, Count: count}, nil
|
||||
|
||||
Reference in New Issue
Block a user