Skip to content

Enforce Coverage Configuration Invariants (codex) - #2376

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--t01-codex-mr9nlwcn
Jul 6, 2026
Merged

Enforce Coverage Configuration Invariants (codex)#2376
numnx merged 1 commit into
feature/CODUX-144-qs-coverage-observability-and-ci-reliability-audit-4from
task/feature-codux-144-qs-coverage-observability-and--t01-codex-mr9nlwcn

Conversation

@numnx

@numnx numnx commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Enforce Coverage Configuration Invariants

Automated task PR opened by Code UX for T01.

📋 Summary

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

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 current verification gap where coverage policy can drift in `vitest.config.ts` without a focused failure. The desired guarantee is that global thresholds, `coverage.include`, exclusions, deterministic env defaults, and the `src/server/activity-cache-service.ts` 80% line gate remain enforceable and are never lowered silently.

## Scope
- Edit `tests/backend/scripts/quality-guardrails.test.ts` or create `tests/backend/ci/vitest-coverage-policy.test.ts`
- Verify `vitest.config.ts`
- Verify `package.json` scripts: `test:backend:coverage`, `test:coverage`, and `ci`
- Relevant symbols/settings: `process.env.VITEST_IN_MEMORY_DB`, `process.env.TZ`, `coverage.thresholds`, `coverage.include`, `src/server/activity-cache-service.ts`

## Implementation Requirements
1. Add a focused backend Vitest test that reads `vitest.config.ts` and asserts `VITEST_IN_MEMORY_DB=true`, `TZ=UTC`, `LANG=C.UTF-8`, and `LC_ALL=C.UTF-8` are set before the config export.
2. Assert `coverage.include` contains `src/**/*.ts`, dashboard files are not included in backend coverage, and the global thresholds are at least the current values: lines 77.4, functions 71.5, branches 66.1, statements 76.0.
3. Assert the file-specific threshold for `src/server/activity-cache-service.ts` exists and keeps `lines` at least 80.
4. Assert `package.json` keeps `test:backend:coverage` using `vitest run tests/backend --coverage` and `ci` includes `pnpm run test:backend:coverage` without replacing it with a non-coverage command.
5. Keep the test implementation robust against formatting changes by parsing or narrowly matching stable config fragments instead of depending on exact whitespace.

## Constraints
- Do not lower any coverage threshold.
- Do not expand coverage to dashboard files unless the repository intentionally changes coverage architecture.
- Do not make assertions that depend on generated coverage output existing locally.
- Keep this task limited to coverage policy tests and any small helper needed by those tests.

## Verification
- Run `pnpm run test:backend -- tests/backend/ci/vitest-coverage-policy.test.ts` or the exact focused file created for this policy.
- Run `pnpm run test:backend:coverage` and confirm coverage thresholds still pass, including the `src/server/activity-cache-service.ts` 80% line threshold.
- Run `pnpm run lint` and confirm TypeScript passes with zero new errors.

✅ 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:09:40 UTC
Finished 2026-07-06 20:13:02 UTC
Duration 3m 22s

📊 Token Usage

Metric Value
Input tokens 62,064
Cached input tokens 596,992
Output tokens 5,242
Total tokens 664,298
Invocations 1
Tool calls 28
Active time 2m 54s

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

🌿 Branch Info

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


🤖 Generated by Code UX

@numnx
numnx merged commit 649712b 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--t01-codex-mr9nlwcn branch July 6, 2026 20:16
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