Repository navigation
refactor(core): typed remember request shared by HTTP, MCP and CLI (#1343) - #1425
Merged
Merged
Conversation
…1343) Extract /remember, uteke_remember and the CLI-via-server body into uteke-core's remember_request module (RememberInput, RememberPolicy, RememberRequest), following the recall slice. No wire behaviour change. Refs #1343 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
…ember-1343 # Conflicts: # crates/uteke-server/src/types.rs
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Second slice of #1343 (after
recall, #1423): a typedrememberrequest inuteke-core(remember_request.rs:RememberInput,RememberPolicy,RememberRequest,metadata_from_cli_flags) shared by:POST /remember(RememberRequest::to_input/decodeinuteke-server/src/types.rs; the handler no longer validates or builds metadata inline),uteke_remember(decode_remember_args),RememberInput::to_http_body).Extraction only. Room remember is untouched.
docs/core-contract.jsonanddocs/api-reference.mdare byte-identical aftercargo run -p docgen.Why
Each surface parsed, defaulted and validated its own remember arguments. Where they disagree today, the disagreement is now an explicit
RememberPolicyvalue instead of scattered code. No disagreement is resolved here.Surface disagreements (owner decisions, all preserved as they are)
typeomitted: HTTP leaves it to auto-inference; MCP storesfactwith no inference; CLI omits it when empty (server then infers).type: HTTP 400 at decode (bare message); MCP gets the core error asFailed: Validation error: ....Validation error: ...); MCP defers to the core write (blank content, over-long content and bad tags surface asFailed: ...).author_type, thentype; MCP has noauthor_type.typemirrored into metadata as"type": HTTP yes; MCP no; CLI no.valid_from/valid_until/entity/categoryand themetadataobject (object wins); MCP never sends metadata; CLI folds entity/category/--meta k:vintometadata(pairs without:are silently dropped).valid_from,valid_until,detect_contradiction,entity,category,metadata,source,source_type,author_type. Not accepted by MCP.room/author: MCP-only (routes to the room write). The CLI sends them to/remember, which rejects them as unknown keys (deny_unknown_fields, HTTP v2 write payloads silently ignore wrong keys (e.g.nsinstead ofnamespace) #1251) -> 400. Same for the CLI's--timestamp. Existing bug, encoded as-is; please decide whether the CLI should stop sending them or HTTP should accept them."default".Testing
remember_request.rs(policy behaviour, error text and order, metadata merge, CLI body encoding),decode_remember_argstests inuteke-mcp, andremember_request_cross_surface_testsinuteke-server(same logical request through the HTTP and MCP decoders gives equal typed fields where they agree; every disagreement above is pinned).cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace,cargo test -p uteke-core --no-default-features --features "onnx,vecq" --liball pass; docgen leavesdocs/clean.uteke-servebuilt fromorigin/developand from this branch, each on a freshUTEKE_HOMEwith an OpenAI-compatible fake embedder (768 dims), 58/remembercases (minimal, tags, namespace, all 9 types, bad/empty/mixed-case type, empty/blank/200k content, 500 tags, long/empty/non-string tags, metadata object/string/null/override, entity/category, valid_from/until, source, author_type valid/invalid, detect_contradiction incl. bad type, unknown keysns/room/author/timestamp, missing/null/non-string content, null/empty namespace, unicode, bad JSON, empty body, array body, text/plain content type) plus a readback of stored memories (POST /list, default andworknamespaces, ids/timestamps stripped). Status codes and normalised bodies: 58 cases, 0 differences.uteke_rememberend to end against a store (only its decoder is tested; the write call is unchanged) and CLI via server against a live server (body encoding is unit-tested and decoded by the HTTP side).Refs #1343
🤖 Generated with Claude Code