docs(6209): snippets, rule embeddings, notes, ledger ageing and references, routes, reporting, handshake, lesson kind, request deadlines, contract-around-change, family models
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 1m0s
CI & Build / integration (push) Successful in 1m14s
CI & Build / Python tests (push) Successful in 1m59s
CI & Build / Build & push image (push) Successful in 15s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 1m0s
CI & Build / integration (push) Successful in 1m14s
CI & Build / Python tests (push) Successful in 1m59s
CI & Build / Build & push image (push) Successful in 15s
Twelve more test files drop issue, milestone, rule, note, lesson and snippet numbers and the dated or one-project figures that recorded how each property was found; the docstrings state the property and why it holds. The contract-around-the-change guard keeps the dict-key example as the failure a signature-watcher misses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
"""services/notes.py — the inline embedding moved here from the routes (#2056).
|
||||
"""services/notes.py — inline embedding lives in the service.
|
||||
|
||||
Why it moved: embedding was triggered at each REST route and nowhere else, so a
|
||||
record created through MCP stayed out of semantic search and auto-inject until
|
||||
the next restart's backfill. Putting it in the service means every caller — REST,
|
||||
MCP, recurrence, snippets — gets it by construction rather than by remembering.
|
||||
Embedding triggered at each REST route and nowhere else would leave a record
|
||||
created through MCP out of semantic search and auto-inject until the next
|
||||
restart's backfill. In the service, every caller — REST, MCP, recurrence,
|
||||
snippets — gets it by construction rather than by remembering.
|
||||
|
||||
These test the helper directly. The point of the change is that there is now ONE
|
||||
place to test.
|
||||
These test the helper directly: there is ONE place to test.
|
||||
"""
|
||||
import pytest
|
||||
|
||||
from scribe.services import notes as notes_svc
|
||||
|
||||
# --- inline embedding (#2056) -----------------------------------------------
|
||||
# --- inline embedding -------------------------------------------------------
|
||||
|
||||
def test_embed_note_uses_the_OWNER_not_the_caller():
|
||||
"""LOAD-BEARING for shared records. An embedding belongs to the record; a
|
||||
@@ -31,14 +30,14 @@ def test_embed_note_uses_the_OWNER_not_the_caller():
|
||||
upsert.assert_called_once()
|
||||
assert upsert.call_args.args[0] == 5
|
||||
assert upsert.call_args.args[1] == 42 # owner, never the caller
|
||||
# Title and body travel separately since #280 — chunking happens inside
|
||||
# Title and body travel separately — chunking happens inside
|
||||
# upsert_note_embedding, the one path every writer shares.
|
||||
assert upsert.call_args.args[2] == "T"
|
||||
assert upsert.call_args.args[3] == "B"
|
||||
|
||||
|
||||
def test_embed_note_hands_even_an_empty_record_to_the_one_path():
|
||||
"""The empty-record decision moved INTO upsert_note_embedding (#280): an
|
||||
"""The empty-record decision lives IN upsert_note_embedding: an
|
||||
emptied record must have its stale vectors CLEARED, not merely skipped —
|
||||
so embed_note schedules the call unconditionally rather than deciding
|
||||
here. The clearing behaviour itself is pinned in test_chunking.py."""
|
||||
@@ -73,7 +72,7 @@ def test_embed_note_swallows_an_indexing_failure():
|
||||
notes_svc.embed_note(note) # must not raise
|
||||
|
||||
|
||||
# --- #3683: a create that names a status is the transition an update is ------
|
||||
# --- a create that names a status is the transition an update is -------------
|
||||
|
||||
_LIFECYCLE = ("started_at", "completed_at", "recurrence_next_spawn_at")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user