test: add migration and schema integrity tests#12
Merged
Conversation
4 tests verifying database schema: - All expected tables exist (users, cues, executions, etc.) - Alembic migration head is valid - Cues table has required columns - Executions table has outcome tracking fields Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
argus-qa-ai
approved these changes
Apr 4, 2026
6 tasks
mikemolinet
added a commit
that referenced
this pull request
May 11, 2026
…parity port of cueapi/cueapi#623) (#77) Re-port of closed [PR #46](#46) which was on a stale base ~8900 deletions behind main. Fresh against current main HEAD. Closes §13 / Phase 12.1.7 — messages-side complement to the cue-fire send_at shipped in PR #618 (which still needs its own re-port). ## What lands - **alembic/versions/030_message_send_at.py** (renumbered from private's 047) Adds `messages.send_at TIMESTAMPTZ NULL` + partial index `ix_messages_send_at` (WHERE send_at IS NOT NULL) built CONCURRENTLY so the index creation doesn't take an ACCESS EXCLUSIVE lock on the messages table during deploy. Existing rows default to NULL = "send now". - **app/models/message.py** — adds `send_at` Column. - **app/schemas/message.py** — `send_at: Optional[datetime]` on MessageCreate + MessageResponse. - **app/routers/messages.py** — passes `send_at=body.send_at` into `create_message`. - **app/services/inbox_service.py** — gates inbox query AND queued→delivered transition UPDATE with `send_at IS NULL OR send_at <= now()`. Scheduled messages are invisible until their time; the atomic poll-fetch transition skips them too. - **app/services/message_service.py** — `create_message` plumbs `send_at` into both `Message.send_at` and `DispatchOutbox.scheduled_at`. Past timestamps are forgiving fallback (treated as send-now). `to_response_dict` surfaces the persisted value. - **tests/test_message_send_at.py** — 7 new tests verbatim from private cueapi covering all 7 semantic paths (omitted, future-invisible, outbox-scheduled, past-fallback, becomes-visible- after-pass, sender-view-shows-it, invalid-timestamp). - **parity-manifest.json** — new entry for migration 030 under `message-send-at-port (private #623)`. ## Wire format `send_at` flows in the BODY of `POST /v1/messages` (server contract: `MessageCreate.send_at`). Same shape as cue-fire `send_at` (PR #618). NULL = send now (default). Future timestamp = inbox-gate + DispatchOutbox.scheduled_at. Past timestamp = forgiving send-now. ## Tests 7/7 new tests pass locally. Full local suite: 836 passed + 18 xfailed (pre-existing) + 3 skipped. Zero regressions. ## Sibling ports - cli, mcp, python, action sides shipped via session 2 (2026-05-10): cueapi-cli #48, cueapi-mcp #33, cueapi-python (private), cueapi-action #12. This is the cueapi-core (OSS server) side that was still missing. ## Re-port note Re-port of closed PR #46. That branch was ~8900 deletions behind main; fresh port against current main HEAD (after PR #74 + #75 merged earlier in this session).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
4 new tests verifying database schema integrity:
All pass locally (4/4, 0.53s).
🤖 Generated with Claude Code