Repository navigation
test(rooms): pin the CORE shape of the rooms field on memory hits (#1713) - #1725
Merged
Merged
Conversation
) The rooms field on memory hits is CORE (contract amendment 4 point 1, uteke-cloud #525). Exact-value tests now pin it on every CORE surface that carries it: POST /recall (plain, fusion, unified, pack, explain), POST /search, POST /room/recall with a query, MCP uteke_recall, uteke_search and uteke_room_recall, and the CLI --json of recall, search and room recall. They check the list shape, the sort by room_id (rooms are linked out of id order and the titles would sort differently), room_name as the title or the id for a missing or blank title, the omitted key for a memory in no room, no rooms on a document item even when the document is linked to a room, and that a hit cut by limit leaks nothing. A test reads the generated docs/core-contract.json so the three routes must stay CORE. Mutation-checked by hand: ordering by joined_at, keeping a blank title, using the id as name, and serializing an empty list on either result type each fail the suite. No code change.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
…ailure connect_hooks wrote the payload to a hook started with no uteke on PATH; the hook exits at once without reading stdin, so the write raced the exit and failed now and then with a broken pipe (seen on #1725 CI). The helper now treats BrokenPipe on that write as what the agent would see too, and still fails on any other error. Exit code and output are asserted as before.
| } | ||
| } | ||
|
|
||
| #[test] |
A search_type all response may hold document items, which have no memory id; assert_hits now checks that such an item carries no rooms and skips it instead of panicking. Raised by the Cora review on #1725.
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
Pins the shape of the
roomsfield on memory hits with exact-value tests on every CORE surface that carries it. This is the OSS work left on #1713. There is no code change: tests and one CHANGELOG note.crates/uteke-server/src/handlers/rooms_contract_tests.rs(HTTP), covering:POST /recallplain (fts5 and fusion), unified (search_type: all),pack,explainPOST /searchPOST /room/recallwith a querydocs/core-contract.jsonand requires these three routes to stay CORErooms_core_mcp_testsinuteke-mcp: the exact(rooms: ...)line onuteke_recall,uteke_searchanduteke_room_recall.crates/uteke-cli/tests/rooms_in_hits.rs: the CLI--jsonofrecall,searchandroom recall <id> <query>.The six rules from the issue, each asserted with exact values:
rooms: [{room_id, room_name}]on the hit.room_id. The fixture links rooms out of id order (beta, alpha, gamma), and the titles would sort differently.room_nameis the title, or the id when the title is missing or blank (" ").[]and notnull, for a memory in no room.limitleaks no rooms. Order and scores are already pinned inuteke_core::recall_exec(feat(recall,search,mcp): return the rooms a memory belongs to with each hit #1706).Why
Owner order 2026-11-10 ("room di core, ya itu perintahku"). Contract amendment 4 point 1 (uteke-cloud #525) makes the field CORE. #1713 asks for a shape test that fails CI if any rule changes. The contract doc already carries the quoted order and its changelog row (
kontrak-core-cloudhistory, 2026-11-10, Amandemen 4 (a)).docs/core-contract.jsonstays an endpoint list, so the field is recorded in the contract doc only, as the issue says.Still open outside this repo: the Cloud implementation plan or dated decision on uteke-cloud #525.
Testing
cargo test --workspace: all green. New: 5 server tests, 1 MCP test, 1 CLI test.cargo clippy --workspace --all-targets -- -D warnings: clean.ORDER BY rm.memory_id, rm.joined_at: 3 failedCOALESCE(r.title, r.id), so a blank title is kept: 3 failedr.idasroom_name: 3 failedroomsonSearchResult: 2 failedskip_serializing_ifonUnifiedSearchResult.rooms: 2 failed