Skip to content

perf: avoid eager job chunk hydration during retrieval - #354

Merged
suguanYang merged 1 commit into
mainfrom
perf/wangbinqi/retrieval-hydration-job-id
Aug 30, 2026
Merged

suguanYang merged 1 commit into
mainfrom
perf/wangbinqi/retrieval-hydration-job-id

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • select only JobResult.job_id during final reference hydration
  • avoid implicitly loading the unused JobResult.chunks relationship
  • preserve revision-pinned hydration and public job_id projection

This removes unnecessary ORM work from the final retrieval stage without changing prompts, ranking, or evidence selection.

Validation

  • uv run pytest -q apps/api/tests/contract/test_retrieval_snapshot_consistency_contract.py apps/api/tests/contract/test_retrieval_mapnav_session_contract.py apps/api/tests/contract/test_retrieval_contract.py — 15 passed
  • uv run ruff check packages/shared-python/shared/services/retrieval/hydration/reference.py
  • uv run ruff format --check packages/shared-python/shared/services/retrieval/hydration/reference.py
  • uv run pyright packages/shared-python/shared/services/retrieval/hydration/reference.py
  • Local hydration harness against the production read-only database completed successfully; no production data was modified.

Notes

The map-nav LLM episode remains the dominant end-to-end latency source and is outside this change.

@suguanYang
suguanYang merged commit e1b8c88 into main Aug 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant