Skip to content

Expand Repository Migration Guarantees (codex) - #2385

Merged
numnx merged 1 commit into
feature/CODUX-144-qs-coverage-observability-and-ci-reliability-audit-4from
task/feature-codux-144-qs-coverage-observability-and--t04-codex-mr9nlyom
Jul 6, 2026
Merged

Expand Repository Migration Guarantees (codex)#2385
numnx merged 1 commit into
feature/CODUX-144-qs-coverage-observability-and-ci-reliability-audit-4from
task/feature-codux-144-qs-coverage-observability-and--t04-codex-mr9nlyom

Conversation

@numnx

@numnx numnx commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Expand Repository Migration Guarantees

Automated task PR opened by Code UX for T04.

📋 Summary

Sprint: Sprint 144 · QS: Coverage Observability and CI Reliability Audit · Task: T04

Create a repeatable coverage, observability, security, and CI reliability quicksprint by adding enforceable tests, CI/Playwright hardening, structured logging guarantees, and aligned operational documentation without lowering coverage thresholds.

📝 Full Task Prompt
## Objective
Close the backend persistence verification gap around repository migrations and telemetry schema drift. The desired guarantee is that SQLite schema startup is idempotent, provider invocation records persist required observability fields, and tests never depend on a real user database.

## Scope
- Edit `tests/backend/repositories/db/app-db-schema.test.ts`
- Edit `tests/backend/repositories/sqlite-connection.test.ts`
- Edit `tests/backend/repositories/execution-repository.test.ts` or `tests/backend/repositories/execution/execution-invocations-query-analytics.test.ts`
- Verify source modules under `src/repositories/db/`, `src/repositories/sqlite-connection.ts`, and `src/repositories/execution-repository.ts`
- Relevant tables/symbols: `provider_invocations`, execution invocation usage/telemetry fields, migration application, WAL/in-memory DB behavior

## Implementation Requirements
1. Add a migration idempotency test that initializes the app schema twice against an isolated in-memory or temporary SQLite connection and asserts the second initialization does not duplicate or corrupt schema state.
2. Add a repository test that inserts and reads a provider invocation with status, provider, model/session identifiers, usage counters, failure metadata, and timestamps, then verifies null and zero values round-trip correctly.
3. Add a cleanup/isolation test proving repository tests use `VITEST_IN_MEMORY_DB=true` or an isolated temporary home, not `~/.code-ux/app.db`.
4. Add assertions that migration/schema tests do not require network, Docker, Git, or provider CLI access.
5. If implementation code must change, keep changes limited to schema/repository initialization or typed repository mappers needed to satisfy the tests.

## Constraints
- Do not introduce a new migration framework.
- Do not write to the real runtime database under `~/.code-ux/app.db`.
- Preserve existing table names and backward-compatible nullable fields.
- Do not make repository tests order-dependent.

## Verification
- Run `pnpm run test:backend -- tests/backend/repositories/db/app-db-schema.test.ts tests/backend/repositories/sqlite-connection.test.ts tests/backend/repositories/execution-repository.test.ts tests/backend/repositories/execution/execution-invocations-query-analytics.test.ts`.
- Run `pnpm run test:backend` and confirm repository suites pass without leaking filesystem state.
- Run `pnpm run lint`.

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-06 20:52:44 UTC
Finished 2026-07-06 20:57:05 UTC
Duration 4m 21s

📊 Token Usage

Metric Value
Input tokens 135,862
Cached input tokens 1,885,184
Output tokens 8,885
Total tokens 2,029,931
Invocations 3
Tool calls 50
Active time 18m 7s

Included usage estimate (subscription/local login): $1.89

🌿 Branch Info

Base: feature/CODUX-144-qs-coverage-observability-and-ci-reliability-audit-4
Head: task/feature-codux-144-qs-coverage-observability-and--t04-codex-mr9nlyom


🤖 Generated by Code UX

@numnx
numnx merged commit f8fb31b into feature/CODUX-144-qs-coverage-observability-and-ci-reliability-audit-4 Jul 6, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-144-qs-coverage-observability-and--t04-codex-mr9nlyom branch July 6, 2026 21:00
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