smriti/backend/tests/integration
Himanshu Dongre 7eabdc820e Add multi-branch space state endpoint
GET /api/v4/chat/spaces/{id}/state is the richer sibling of /head. It
returns main HEAD plus up to 5 active non-main branches plus a
lightweight divergence signal when any active branch disagrees with
main on decisions. Hard caps (5 branches, 2 divergent pairs, 3
decisions per side per pair) keep the aggregate response digestible.

Divergence detection reuses lineage._diff_lists so matching stays
consistent with smriti compare — decisions differing only in case or
punctuation normalize equal and do not trigger a false divergence
signal.

The query helper uses a Python-side per-branch dedupe rather than
Postgres DISTINCT ON so integration tests can run on sqlite without
dialect-specific workarounds. The non-main commit space for any real
project is small, so the cost is negligible.

No schema changes. No migrations. No behavior change for existing
callers of /head.
2026-04-12 01:58:03 +05:30
..
__init__.py Initial public release 2026-03-22 13:48:50 +05:30
conftest.py Initial public release 2026-03-22 13:48:50 +05:30
test_api_v2_git.py Initial public release 2026-03-22 13:48:50 +05:30
test_api_v4_chat.py Record project_root and author_agent on checkpoints 2026-04-11 18:08:13 +05:30
test_api_v5_lineage.py Add fork, compare, restore CLI commands and fix compare correctness 2026-04-11 17:50:03 +05:30
test_checkpoint_extract.py Extract checkpoint fields from freeform markdown via LLM 2026-04-11 19:15:03 +05:30
test_delete_endpoints.py Add delete endpoints for spaces, checkpoints, and sessions 2026-04-11 17:25:36 +05:30
test_multi_branch_state.py Add multi-branch space state endpoint 2026-04-12 01:58:03 +05:30