Skip to content

Add domain schema: instruments, tiles, epochs, and mosaics - #28

Merged
davecoulter merged 3 commits into
mainfrom
feature/domain-models
Jul 22, 2026
Merged

davecoulter merged 3 commits into
mainfrom
feature/domain-models

Conversation

@davecoulter

Copy link
Copy Markdown
Owner

Summary

  • Add 7 domain models (Instrument, Band, Tile, Epoch, Level2Image, Level2Calibration, Level3Mosaic) plus two composite-unique association tables, replacing the Stage 0 placeholder schema with the real astronomical domain model for tile-based mosaicing.
  • Enable and index Q3C for native Postgres cone-search on Tile and Level2Image — the extension is enabled via hand-authored migration SQL, but the functional indexes themselves are declared for real on the models, so alembic check stays clean with no autogenerate exclusions needed.
  • Fix a Docker dev-environment gap discovered during QA: migrations/ was baked into images at build time (not bind-mounted like src/), so a newly-added migration was invisible inside a running container without a full rebuild. Added a dev-only bind mount on api and removed the now-unused migrations//alembic.ini copy from the worker image (it never runs alembic).
  • Update CI to build and run the project's Q3C-enabled Postgres image instead of the stock postgres:16 service, since the new migration requires the extension.
  • Process refinements surfaced during review: assessPrompt now applies fully-deterministic fixes directly (with confirmation) instead of always routing them through Gemini; added standing Q3C-indexing and MOC-placement conventions to the Gemini coworking protocol for future domain-model docs.

CLI Verification

All steps completed prior to PR creation via genTests.

  • Branch confirmed: feature/domain-models
  • Images rebuilt: docker compose build worker_light worker_heavy (Dockerfile changed); api recreated for the new bind mount
  • Containers recreated: docker compose up -d api worker_light worker_heavy
  • Migrations applied: docker compose exec api alembic upgrade head (confirmed at 0007/head)
  • Test suite passed: docker compose exec api uv run pytest --cov=src --cov-fail-under=90 -q — 126 passed, 1 skipped (pre-existing host-only test module, expected inside a container), 98.86% coverage
  • Sphinx build passed (local)
  • docs/diagrams/infrastructure_topology.md — N/A, no infrastructure topology change

Application QA

All steps completed and verified prior to PR creation via genTests.

  • Real reset-db exercised the full migration chain (0001→0007) and reference-data seeding — instruments/bands held exactly the expected NIRCam/MIRI/F150W/F277W rows, confirmed in DBeaver
  • Q3C extension and functional indexes confirmed live in the database — pg_extension/pg_indexes showed q3c installed and both ix_tile_q3c/ix_level2_image_q3c present, confirmed in DBeaver
  • Uniqueness constraint verified against real infrastructure, not just pytest — a duplicate Instrument insert via DBeaver was rejected with a unique-violation error

🤖 Generated with Claude Code

Replaces the Stage 0 placeholder schema with the real astronomical
domain model needed for tile-based mosaicing, and fixes a Docker
dev-environment gap (migrations/ baked into images, not bind-mounted)
discovered while verifying it end-to-end.
@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Test Results

128 tests  +11   128 ✅ +11   8s ⏱️ -1s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 4b06ccc. ± Comparison against base commit 668a61e.

♻️ This comment has been updated with latest results.

@davecoulter
davecoulter merged commit 7cabc26 into main Jul 22, 2026
3 checks passed
@davecoulter
davecoulter deleted the feature/domain-models branch July 22, 2026 05:10
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