G0~G8 성과·동맹 측정 OS 작업 일괄 고정
8월 7일까지 워킹트리에만 남아 있던 미커밋 작업을 커밋한다. 여러 사본 폴더(worktree·clone)에 흩어져 있던 중간 스냅샷을 정리하기 전에 원본을 git 이력으로 고정하는 것이 목적이다. - contracts/routes/services: measurement, outcome_trajectory, rupture_repair, deliberate_practice, calibration_transfer, supervision_research, multimodal_alliance, continuous_improvement 계열 신규 모듈과 테스트 - infra/db/init: 07~16 마이그레이션(측정 기반~calibration transfer 실행) - apps/web: 세션 리뷰 카드·관리 화면·E2E 스펙 추가 - docs/ops: G0~G8 라이브 통합·배포·롤백 증거 문서와 evidence JSON/PNG - scripts: smoke·ledger·릴리스 에이전트·NAS 프리뷰 운영 스크립트 engine.public 로그 .bak과 apps/web/test-results 산출물은 커밋에서 제외했다.
This commit is contained in:
parent
93dd8f82d7
commit
16e791e044
390 changed files with 243188 additions and 499 deletions
|
|
@ -347,9 +347,64 @@ class SessionMemoryPersistenceTest(unittest.IsolatedAsyncioTestCase):
|
|||
self.assertEqual(args[2], turn.session_id)
|
||||
self.assertEqual(args[3], 7)
|
||||
self.assertIn("[0.1,0.1", str(args[4]))
|
||||
self.assertEqual(args[5], '{"42": 0.7}')
|
||||
self.assertEqual(args[5], {"42": 0.7})
|
||||
self.assertNotIsInstance(args[5], str)
|
||||
self.assertNotIn("김서연", " ".join(str(arg) for arg in args))
|
||||
|
||||
async def test_index_document_binds_sparse_and_meta_as_jsonb_objects(self) -> None:
|
||||
class FakeConn:
|
||||
def __init__(self) -> None:
|
||||
self.fetchrow_count = 0
|
||||
self.executed: list[tuple[str, tuple[object, ...]]] = []
|
||||
|
||||
async def fetchrow(
|
||||
self, query: str, *args: object
|
||||
) -> dict[str, object] | None:
|
||||
self.fetchrow_count += 1
|
||||
if self.fetchrow_count == 1:
|
||||
return None
|
||||
if self.fetchrow_count == 2:
|
||||
return {"doc_id": 42}
|
||||
raise AssertionError(f"unexpected query: {query}")
|
||||
|
||||
async def execute(self, query: str, *args: object) -> str:
|
||||
self.executed.append((query, args))
|
||||
return "INSERT 0 1"
|
||||
|
||||
conn = FakeConn()
|
||||
request = rag.IndexRequest(
|
||||
source_id="jsonb-codec-test",
|
||||
doc_uri="repo/jsonb-codec-test.json",
|
||||
chunks=[
|
||||
{
|
||||
"seq": 0,
|
||||
"chunk_text": "JSONB codec contract",
|
||||
"meta": {"source_kind": "synthetic"},
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
with (
|
||||
patch.object(rag, "_get_embedder", return_value=object()),
|
||||
patch.object(
|
||||
rag,
|
||||
"embed_query",
|
||||
return_value=rag.EmbeddedQuery(
|
||||
dense=[0.1] * rag.EMBED_DIM,
|
||||
sparse={"42": 0.7},
|
||||
),
|
||||
),
|
||||
):
|
||||
result = await rag.index_document(conn, request)
|
||||
|
||||
self.assertEqual(result.chunks_indexed, 1)
|
||||
chunk_query, chunk_args = conn.executed[-1]
|
||||
self.assertIn("INSERT INTO kb.chunk", chunk_query)
|
||||
self.assertEqual(chunk_args[8], {"42": 0.7})
|
||||
self.assertNotIsInstance(chunk_args[8], str)
|
||||
self.assertEqual(chunk_args[12], {"source_kind": "synthetic"})
|
||||
self.assertNotIsInstance(chunk_args[12], str)
|
||||
|
||||
async def test_end_persisted_session_schedules_episodic_embedding_writer(self) -> None:
|
||||
scheduled: list[object] = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue