Skip to content

refactor(core): one commit step and one embedding step for remember and contradiction (#1514, part 1) - #1526

Merged
ajianaz merged 1 commit into
developfrom
refactor/write-path-1
Oct 22, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/write-path-1

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

What

First part of the single write path (#1514, epic #1523). remember_precomputed_detailed already held the shared tail; it is now split into building the Memory and commit_memory (row, source hash, Created event, edge wiring, cache invalidation, vector, cosine links), which later parts reuse for import and consolidation. The embedding step is one function, embed_for_write (JSON flattened, retried, FTS5-only with a reason on failure), and type validation is one function. remember_with_contradiction uses both.

Why

The contradiction path had drifted from plain remember: it stored an unknown memory type, embedded JSON as raw text, tried the embedding once, and failed the whole write when the embedding failed. It now behaves like remember. On a persistent embedding failure, or with no embedder, the memory is stored FTS5-only and the contradiction check is skipped, with a warning that says so when the caller asked for it. Import and consolidation (the CORE-visible parts) wait for uteke-cloud#242. Refs #1514.

Testing

  • clippy -D warnings, fmt, cargo test --workspace pass; cargo run -p docgen changes nothing
  • 6 new tests in write_path_tests.rs; run against an unmodified develop worktree, 4 of the first 5 fail there (type check, JSON text, retry, FTS5-only degradation) and the side-effect test passes, as intended
  • reviewed locally with the Cora MCP agent reviewer before pushing: no blocking finding; one minor finding of mine (a skipped contradiction check was silent) was fixed and tested before this push

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 03e2998 into develop Oct 22, 2026
15 checks passed
@ajianaz
ajianaz deleted the refactor/write-path-1 branch October 22, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant