Skip to content

Commit 7d6e33c

Browse files
Grivnclaude
andcommitted
Apply gofmt -s across codebase for Go Report Card A+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a548354 commit 7d6e33c

File tree

13 files changed

+59
-57
lines changed

13 files changed

+59
-57
lines changed

cmd/embed.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ Modes:
4141
return fmt.Errorf("embedding stats: %w", err)
4242
}
4343
output := map[string]interface{}{
44-
"total_insights": total,
45-
"embedded": embedded,
46-
"coverage": fmt.Sprintf("%.0f%%", float64(embedded)/float64(max(total, 1))*100),
47-
"ollama_available": ec.Available(),
48-
"model": ec.Model(),
44+
"total_insights": total,
45+
"embedded": embedded,
46+
"coverage": fmt.Sprintf("%.0f%%", float64(embedded)/float64(max(total, 1))*100),
47+
"ollama_available": ec.Available(),
48+
"model": ec.Model(),
4949
}
5050
return enc.Encode(output)
5151
}

cmd/gc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Keep mode:
5353
"content": ins.Content,
5454
"new_access": ins.AccessCount + 3,
5555
"effective_importance": ei,
56-
"immune": store.IsImmune(ins.Importance, ins.AccessCount+3),
56+
"immune": store.IsImmune(ins.Importance, ins.AccessCount+3),
5757
}
5858
enc := json.NewEncoder(os.Stdout)
5959
enc.SetIndent("", " ")

cmd/remember.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"strings"
88
"time"
99

10+
"github.com/google/uuid"
1011
"github.com/mnemon-dev/mnemon/internal/embed"
1112
"github.com/mnemon-dev/mnemon/internal/graph"
1213
"github.com/mnemon-dev/mnemon/internal/model"
1314
"github.com/mnemon-dev/mnemon/internal/search"
1415
"github.com/mnemon-dev/mnemon/internal/store"
15-
"github.com/google/uuid"
1616
"github.com/spf13/cobra"
1717
)
1818

@@ -178,7 +178,7 @@ var rememberCmd = &cobra.Command{
178178
"content": content,
179179
"action": "skipped",
180180
"diff_suggestion": string(diffSuggestion),
181-
"replaced_id": replacedID,
181+
"replaced_id": replacedID,
182182
}
183183
enc := json.NewEncoder(os.Stdout)
184184
enc.SetIndent("", " ")

internal/graph/causal.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func CreateCausalEdges(db *store.DB, insight *model.Insight) int {
6666
// → new has keyword → new is effect → prev is cause → prev→new
6767
// e.g. prev="chose X because of Y", new="Y has low latency"
6868
// → prev has keyword → prev is effect → new is cause → new→prev
69-
sourceID := prev.ID // default: new has signal → new is effect, prev is cause
69+
sourceID := prev.ID // default: new has signal → new is effect, prev is cause
7070
targetID := insight.ID
7171
if !newHasSignal && prevHasSignal {
7272
// Only prev has signal → prev is effect, new is cause
@@ -77,10 +77,10 @@ func CreateCausalEdges(db *store.DB, insight *model.Insight) int {
7777
subType := suggestSubType(insight.Content + " " + prev.Content)
7878

7979
err = db.InsertEdge(&model.Edge{
80-
SourceID: sourceID,
81-
TargetID: targetID,
82-
EdgeType: model.EdgeCausal,
83-
Weight: overlap,
80+
SourceID: sourceID,
81+
TargetID: targetID,
82+
EdgeType: model.EdgeCausal,
83+
Weight: overlap,
8484
Metadata: map[string]string{
8585
"overlap": formatFloat(overlap),
8686
"sub_type": subType,
@@ -129,7 +129,7 @@ type CausalCandidate struct {
129129
ID string `json:"id"`
130130
Content string `json:"content"`
131131
Category string `json:"category"`
132-
Hop int `json:"hop"` // graph distance (1 or 2)
132+
Hop int `json:"hop"` // graph distance (1 or 2)
133133
ViaEdge string `json:"via_edge"` // edge type that connected
134134
CausalSignal string `json:"causal_signal"` // keyword if found, else ""
135135
SuggestedSubType string `json:"suggested_sub_type"` // heuristic suggestion

internal/graph/entity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ var acronymStopwords = map[string]bool{
7474
"OR": true, "AN": true, "IF": true, "IS": true, "IT": true,
7575
"OF": true, "AS": true, "DO": true, "NO": true, "SO": true,
7676
"UP": true, "WE": true, "HE": true, "MY": true, "BE": true,
77-
"GO": true, // "Go" (capitalized) is in techDictionary, but "GO" all-caps is ambiguous
77+
"GO": true, // "Go" (capitalized) is in techDictionary, but "GO" all-caps is ambiguous
7878
"THE": true, "AND": true, "FOR": true, "ARE": true, "BUT": true,
7979
"NOT": true, "YOU": true, "ALL": true, "CAN": true, "HER": true,
8080
"WAS": true, "ONE": true, "OUR": true, "OUT": true, "HAS": true,

internal/graph/semantic.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ func findCandidatesByTokenOverlap(db *store.DB, insight *model.Insight) []Semant
233233
result := make([]SemanticCandidate, len(candidates))
234234
for i, c := range candidates {
235235
result[i] = SemanticCandidate{
236-
ID: c.insight.ID,
237-
Content: c.insight.Content,
238-
Category: string(c.insight.Category),
236+
ID: c.insight.ID,
237+
Content: c.insight.Content,
238+
Category: string(c.insight.Category),
239239
Similarity: c.similarity,
240240
}
241241
}

internal/model/node.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ var ValidCategories = map[Category]bool{
2828

2929
// Insight represents a memory node in the knowledge graph.
3030
type Insight struct {
31-
ID string `json:"id"`
32-
Content string `json:"content"`
33-
Category Category `json:"category"`
34-
Importance int `json:"importance"`
35-
Tags []string `json:"tags"`
36-
Entities []string `json:"entities"`
37-
Source string `json:"source"`
38-
AccessCount int `json:"access_count"`
39-
CreatedAt time.Time `json:"created_at"`
40-
UpdatedAt time.Time `json:"updated_at"`
31+
ID string `json:"id"`
32+
Content string `json:"content"`
33+
Category Category `json:"category"`
34+
Importance int `json:"importance"`
35+
Tags []string `json:"tags"`
36+
Entities []string `json:"entities"`
37+
Source string `json:"source"`
38+
AccessCount int `json:"access_count"`
39+
CreatedAt time.Time `json:"created_at"`
40+
UpdatedAt time.Time `json:"updated_at"`
4141
DeletedAt *time.Time `json:"deleted_at,omitempty"`
4242
}
4343

internal/search/diff.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ const (
2020

2121
// DiffMatch represents one existing insight compared against the new content.
2222
type DiffMatch struct {
23-
ID string `json:"id"`
24-
Content string `json:"content"`
25-
TokenSimilarity float64 `json:"token_similarity"`
26-
CosineSimilarity float64 `json:"cosine_similarity,omitempty"`
27-
Similarity float64 `json:"similarity"`
28-
Suggestion DiffSuggestion `json:"suggestion"`
23+
ID string `json:"id"`
24+
Content string `json:"content"`
25+
TokenSimilarity float64 `json:"token_similarity"`
26+
CosineSimilarity float64 `json:"cosine_similarity,omitempty"`
27+
Similarity float64 `json:"similarity"`
28+
Suggestion DiffSuggestion `json:"suggestion"`
2929
}
3030

3131
// DiffResult is the output of a diff check.
@@ -36,8 +36,8 @@ type DiffResult struct {
3636

3737
// DiffOptions controls diff behavior.
3838
type DiffOptions struct {
39-
Limit int // max candidates to compare (default 5)
40-
NewEmbedding []float64 // pre-computed embedding for new content (optional)
39+
Limit int // max candidates to compare (default 5)
40+
NewEmbedding []float64 // pre-computed embedding for new content (optional)
4141
ExistingEmbed []EmbeddedItem // pre-loaded embeddings (optional, avoids DB call)
4242
}
4343

internal/search/integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ func TestVectorSearch_Basic(t *testing.T) {
186186

187187
// Store embeddings
188188
query := []float64{1.0, 0.0, 0.0}
189-
db.UpdateEmbedding("vs-1", embed.SerializeVector([]float64{0.9, 0.1, 0.0})) // similar
190-
db.UpdateEmbedding("vs-2", embed.SerializeVector([]float64{0.0, 0.0, 1.0})) // different
189+
db.UpdateEmbedding("vs-1", embed.SerializeVector([]float64{0.9, 0.1, 0.0})) // similar
190+
db.UpdateEmbedding("vs-2", embed.SerializeVector([]float64{0.0, 0.0, 1.0})) // different
191191
db.UpdateEmbedding("vs-3", embed.SerializeVector([]float64{0.85, 0.15, 0.0})) // similar
192192

193193
hits := vectorSearch(db, query, 10)

internal/search/recall.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ func causalTopologicalSort(db *store.DB, results []RecallResult) []RecallResult
418418
}
419419

420420
// Build DAG from causal edges: source → target means source causes target
421-
adj := make(map[string][]string) // source → targets
422-
inDegree := make(map[string]int) // target → incoming edge count
421+
adj := make(map[string][]string) // source → targets
422+
inDegree := make(map[string]int) // target → incoming edge count
423423

424424
for _, r := range results {
425425
inDegree[r.Insight.ID] = 0

0 commit comments

Comments
 (0)