Skip to content

Cover repository migrations and settings cache invalidation (codex) - #2364

Merged
numnx merged 1 commit into
feature/CODUX-143-qs-coverage-observability-and-ci-reliability-audit-3from
task/feature-codux-143-qs-coverage-observability-and--t03-codex-mr9l84x6
Jul 6, 2026
Merged

Cover repository migrations and settings cache invalidation (codex)#2364
numnx merged 1 commit into
feature/CODUX-143-qs-coverage-observability-and-ci-reliability-audit-3from
task/feature-codux-143-qs-coverage-observability-and--t03-codex-mr9l84x6

Conversation

@numnx

@numnx numnx commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Cover repository migrations and settings cache invalidation

Automated task PR opened by Code UX for T03.

📋 Summary

Sprint: Sprint 143 · QS: Coverage Observability and CI Reliability Audit · Task: T03

Strengthen Code UX coverage observability and CI reliability through enforceable tests, workflow hardening, structured observability guarantees, security validation, and aligned operational documentation without lowering coverage thresholds.

📝 Full Task Prompt
## Objective
Close persistence coverage gaps by enforcing repository migration idempotency, scoped settings defaults, and cache invalidation guarantees.

## Scope
- `src/repositories/db/app-db-migrations.ts`
- `src/repositories/db/app-db-schema.ts`
- `src/repositories/app-db-storage.ts`
- `src/repositories/settings-repository.ts`
- `tests/backend/repositories/db/app-db-schema.test.ts`
- `tests/backend/repositories/app-db-storage.test.ts`
- `tests/backend/repositories/settings-repository.test.ts`
- `docs/development/testing-and-quality.md`
- Current verification gap: schema/index and settings tests exist, but this sprint needs explicit audit coverage for migration replay, legacy rows, and scoped cache invalidation edge cases.
- Desired guarantee: migrations can run repeatedly on existing databases, legacy data is preserved, and effective settings caches invalidate after system, project, and sprint mutations.

## Implementation Requirements
1. Add migration replay tests that initialize a DB, run migrations multiple times, and assert expected columns/indexes/tables still exist without duplicate or destructive changes.
2. Add a legacy-shape test for at least one existing migration path, such as `guardrail_ledger` foreign key rebuild or token accounting backfill, proving data survives migration.
3. Extend settings repository tests to cover partial persisted settings, default fallback preservation, and invalidation after system/project/sprint resets or mutations.
4. Ensure all new tests use in-memory DB or the existing temp-home cleanup helpers and close SQLite handles before removing temp paths.
5. Update `docs/development/testing-and-quality.md` with the focused persistence verification commands and the migration idempotency expectation.

## Constraints
- Do not change schema semantics unless a test exposes a real bug; preserve existing data and indexes.
- Do not lower coverage thresholds or skip repository tests to satisfy coverage.
- Do not use real `~/.code-ux/app.db` in tests.
- Keep assertions behavioral rather than tied to incidental SQL formatting.

## Verification
- `pnpm run test:backend -- tests/backend/repositories/db/app-db-schema.test.ts tests/backend/repositories/app-db-storage.test.ts tests/backend/repositories/settings-repository.test.ts`
- `pnpm run test:backend:coverage`
- `pnpm run lint`
- Success means migration replay is idempotent, legacy rows survive, settings defaults remain backward compatible, and SQLite temp artifacts are cleaned up.

✅ 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 19:02:59 UTC
Finished 2026-07-06 19:10:31 UTC
Duration 7m 32s

📊 Token Usage

Metric Value
Input tokens 206,890
Cached input tokens 1,640,320
Output tokens 10,661
Total tokens 1,857,871
Invocations 1
Tool calls 48
Active time 6m 20s

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

🌿 Branch Info

Base: feature/CODUX-143-qs-coverage-observability-and-ci-reliability-audit-3
Head: task/feature-codux-143-qs-coverage-observability-and--t03-codex-mr9l84x6


🤖 Generated by Code UX

@numnx
numnx merged commit b7918ad into feature/CODUX-143-qs-coverage-observability-and-ci-reliability-audit-3 Jul 6, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-143-qs-coverage-observability-and--t03-codex-mr9l84x6 branch July 6, 2026 19:13
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