Files
poimen-memory/crates/mem-cli
rock 53761b50d5
CI / CI (pull_request) Failing after 21m39s
refactor: ingest_worker CRAP/DRY/SOLID fixes (code review PR #55)
- Fix DRY: Remove process_ingest() wrapper, single public fn
- Fix CRAP: Extract save_entity_with_logging() and save_edge_with_logging() helpers
  - Reduce cyclomatic complexity from 12+ to 4
  - Enable isolated testing of save operations
- Fix OCP: Replace magic status strings with enum JobStatus
  - Type-safe alternatives (processing|done|done_with_errors)
  - Catches typos at compile-time
- Fix SRP: Remove error accumulation Vecs, use real-time logging
  - Errors logged immediately at point of failure
  - Worker now owns: job status tracking + persistence only
  - Makes worker testable without database mocks
- Add IngestLogContext struct for consistent structured logging
  - Ensures field names consistent across all logs
  - Enables log schema validation + observability aggregation

ISP violation (JobStatusStore trait) deferred to next PR (non-blocking).
Test improvements (resource cleanup, assertions) deferred (minor).

Verification: cargo check -p mem-cli ✓
2026-09-15 13:27:47 +09:00
..