Skip to content

test: regression coverage for connected image/table hydration - #331

Open
Frankie-Xu wants to merge 1 commit into
Ontos-AI:mainfrom
Frankie-Xu:test/Frankie-Xu/connected-image-regression
Open

test: regression coverage for connected image/table hydration#331
Frankie-Xu wants to merge 1 commit into
Ontos-AI:mainfrom
Frankie-Xu:test/Frankie-Xu/connected-image-regression

Conversation

@Frankie-Xu

Copy link
Copy Markdown

Summary

The silent drop of connect_to image targets was fixed on main by #221 (cb807d18). These tests lock:

  • text → image is inlined as [Image: {asset_url|file_path}] plus description
  • text → table still composes summary/keywords/caption (HTML not leaked)
  • connected targets are excluded from the standalone result list
  • public source projection keeps page_nums on page rows and related asset fields (file_path, source_chunk_path, inlined image URL) on the parent

Verification

Red/green check (temporarily restored the old if target_type != 'table': continue gate in _connected_media_parts, then reverted with git checkout):

  • red: 4 failed, 1 passed — all image assertions failed; table composition still passed
  • green (restored): 5 passed in packages/shared-python/shared/tests/test_connected_image_hydration.py

Commands:

make lint                                          # All checks passed
make typecheck                                     # 0 errors, 0 warnings
uv run pytest packages/shared-python/shared/tests/test_connected_image_hydration.py -q
                                                   # 5 passed
uv run pytest packages/shared-python/shared/tests -q
                                                   # 62 passed
uv run pytest apps/worker/tests/contract -q        # 303 passed

Not tested: live documents, LLM, storage, or Postgres hydration of missing connect_to targets (db=None in these unit tests).

Deployment Notes

  • No new or changed environment variables.
  • No database migrations, queue, storage, or release-order requirements.
  • Backwards compatible (tests only). Rollback is revert of the test file.

Checklist

  • Tests were added or updated when behavior changed
  • Public docs, examples, or OpenAPI contracts were updated when needed (N/A — test-only)
  • Database migrations are idempotent and safe to deploy (N/A)
  • Logs, errors, and validation paths avoid leaking secrets or user data
  • The pull request description explains any breaking or user-visible change (none)

Made with Cursor

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