Compare commits
No commits in common. "8a98faf2e943dccbe8a6c1774299681ecb0d86df" and "cb44ab17556a32b453fb4575f7411f8a58bb84b9" have entirely different histories.
8a98faf2e9
...
cb44ab1755
@ -78,7 +78,3 @@ Session size:
|
||||
- **Summary:** Files edited (1):
|
||||
- /home/cal/work/esb-monorepo/docs/prd/company-name-registry.md
|
||||
Errors
|
||||
|
||||
## 12:09 - Fix: Rust sync excluded IL/MiL teams due to active_only=true
|
||||
- **Type:** fix
|
||||
- **Tags:** sba-scout, rust, sync, bug-fix, api, teams
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
---
|
||||
id: 5c11485a-c808-41b6-8576-a8a388b5be1e
|
||||
type: fix
|
||||
title: "Fix: Rust sync excluded IL/MiL teams due to active_only=true"
|
||||
tags: [sba-scout, rust, sync, bug-fix, api, teams]
|
||||
importance: 0.7
|
||||
confidence: 0.8
|
||||
created: "2026-02-28T18:09:23.796074+00:00"
|
||||
updated: "2026-02-28T18:09:23.796074+00:00"
|
||||
---
|
||||
|
||||
# Fix: Rust sync excluded IL/MiL teams due to active_only=true
|
||||
|
||||
## Problem
|
||||
|
||||
The Rust `sync_teams()` function in `api/sync.rs` was calling:
|
||||
|
||||
```rust
|
||||
client.get_teams(Some(season), None, true, false)
|
||||
```
|
||||
|
||||
The `active_only=true` parameter caused the API to exclude IL (e.g. WVIL id=549) and MiL (e.g. WVMiL id=550) teams from the response. The Python sync did not pass `active_only` (defaults to `false`), so it correctly synced all teams.
|
||||
|
||||
## Root Cause
|
||||
|
||||
Mismatch between Rust and Python API call defaults for the `active_only` parameter.
|
||||
|
||||
## Fix
|
||||
|
||||
Changed `active_only` from `true` to `false` in `api/sync.rs`.
|
||||
|
||||
## Notes
|
||||
|
||||
- The `get_all_teams()` DB query in `queries.rs` already filters IL/MiL from the Gameday opponent selector using `WHERE abbrev NOT LIKE '%IL' AND abbrev NOT LIKE '%MiL'`, so syncing them does not pollute the UI.
|
||||
- Committed as part of `3e73644`.
|
||||
@ -1,30 +1,29 @@
|
||||
---
|
||||
id: 8d365483-701f-49fe-a55e-4d524ae2eff3
|
||||
type: problem
|
||||
title: "cognitive-memory client.py at 3348 lines needs modular refactor"
|
||||
title: "cognitive-memory client.py at 3260 lines needs modular refactor"
|
||||
tags: [cognitive-memory, refactoring, architecture, tech-debt]
|
||||
importance: 0.7
|
||||
confidence: 0.9
|
||||
confidence: 0.8
|
||||
created: "2026-02-19T20:57:01.898902+00:00"
|
||||
updated: "2026-02-28T00:00:00+00:00"
|
||||
updated: "2026-02-19T20:57:01.898902+00:00"
|
||||
---
|
||||
|
||||
client.py has grown to 3348 lines with 66 methods (was 3260/47 on 2026-02-19). Breakdown by concern with accurate line counts:
|
||||
client.py has grown to 3260 lines with 47 methods in a single CognitiveMemoryClient class. Breakdown by concern:
|
||||
|
||||
- **common.py** (~548 lines): Constants, imports, YAML/frontmatter parsing, slugify, decay calc, embedding helpers, cosine similarity, edge filename/frontmatter helpers
|
||||
- **client.py** (~1008 lines): CognitiveMemoryClient class — __init__, internal helpers (_ensure_dirs, _load/_save index/state, _resolve paths, _git_commit, _update_index_entry), store, recall, get, search, update, delete, related, stats, recent, episode, reindex, pin
|
||||
- **edges.py** (~274 lines): relate, edge_get, edge_search, edge_update, edge_delete + edge index helpers (_update_edge_index, _remove_edge_index, _scan_for_edge, _resolve_edge_path)
|
||||
- **embeddings.py** (~208 lines): _get_embedding_provider, _embed_texts_with_fallback, embed, semantic_recall
|
||||
- **analysis.py** (~839 lines): decay, core (CORE.md gen), tags_list/related/suggest, reflect, merge, reflection_summary — biggest chunk
|
||||
- **cli.py** (~471 lines): argparse parser + dispatch + main()
|
||||
|
||||
Approach: mixin classes. Each module defines a Mixin class; CognitiveMemoryClient inherits from all mixins. This preserves `self` access and keeps the public API identical.
|
||||
- Constants + module helpers: ~548 lines → common.py
|
||||
- Core CRUD (store/get/delete/search/recall): ~435 lines → stays in client.py
|
||||
- Edges (relate/edge_get/edge_search/edge_update/edge_delete): ~352 lines → edges.py
|
||||
- Embeddings (embed/semantic_recall/provider fallback): ~209 lines → embeddings.py
|
||||
- Decay/Core/Reflect (decay scoring, CORE.md gen, reflection): ~1097 lines → analysis.py (biggest chunk)
|
||||
- CLI parser + dispatch: ~463 lines → cli.py or __main__.py
|
||||
- Index/state/git plumbing: ~115 lines → internal helpers
|
||||
|
||||
Refactor considerations:
|
||||
- MCP server imports `from client import CognitiveMemoryClient` — needs re-export or updated import
|
||||
- CLI wrapper at `/home/cal/.local/bin/claude-memory` uses `exec uv run python client.py` — cli.py must be runnable
|
||||
- Systemd services (daily/weekly timers) depend on the wrapper — must test after
|
||||
- mcp_server.py also imports `_load_memory_config, MEMORY_DIR` from client — move to common.py
|
||||
- 4 module-level helper functions are used across concerns — belong in common.py
|
||||
- MCP server imports `from client import CognitiveMemoryClient` — needs updating
|
||||
- CLI wrapper `claude-memory` uses `exec uv run python client.py` — needs package structure
|
||||
- Systemd services depend on the wrapper — must test after
|
||||
- Could use mixin classes or composition to split the monolithic class
|
||||
- Similar to the Major Domo CLI modular refactor (that went well)
|
||||
|
||||
Priority: active. Line count growing, 66 methods in one class makes navigation painful.
|
||||
Priority: near-future. Nothing is broken but finding anything requires line-number hunting.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user