Skip to content

[test-qa-hourly] test: pin deterministic metric snapshot tie-break - #428

Merged
i-xtsu-sixyou-ken-mei merged 2 commits into
mainfrom
test-qa/ongoing-coverage-20260909
Sep 9, 2026
Merged

[test-qa-hourly] test: pin deterministic metric snapshot tie-break#428
i-xtsu-sixyou-ken-mei merged 2 commits into
mainfrom
test-qa/ongoing-coverage-20260909

Conversation

@i-xtsu-sixyou-ken-mei

Copy link
Copy Markdown
Collaborator

Intent

Continue continuous QA from current main with one small regression-focused test around deterministic waitlist conversion metrics.

Inspection

  • Previous QA PR [test-qa-hourly] test: cover waitlist signup pagination boundary #427 is merged; no open PR matches [test-qa-hourly], label test-qa, or branch prefix test-qa/ongoing-.
  • Current main is ea659d8e6f5e3e72e92289c7dd0814be46623d63 (merge of [test-qa-hourly] test: cover waitlist signup pagination boundary #427).
  • Main CI #2429 (34313809759) completed successfully.
  • No open PRs currently overlap the target path.
  • apps/control-center/src/server/services/waitlist-growth.ts reads collected 24h metric snapshots ordered by captured_at ASC, then id ASC; later rows overwrite earlier entries in the per-post views map.
  • Existing regression coverage pins latest-captured_at behavior and 500-row pagination, but did not directly pin the id tie-break when two snapshots share an identical timestamp.
  • .github/workflows/ci.yml still runs quick gates (format repo contracts), code quality (type-check lint deadcode dup), tests (test analytics), E2E, security, and deploy gates.
  • Coverage remains available through scripts/coverage.sh summary -> turbo run test:coverage + scripts/coverage-summary.ts.

QA change

Strengthen waitlist-growth-metrics-pagination.test.ts with one regression test where two collected 24h snapshots for the same post share the exact same captured_at value. The higher ordered metric id must deterministically win, preserving views24h = 250 and signupRate = 1 / 250.

This is test-only. No implementation, workflow, docs, ignore, coverage threshold, or agent-instruction change is included.

Validation / commands and results

  • GitHub main CI #2429 — PASS.
  • Source review of waitlist-growth.ts — PASS: current query explicitly orders captured_at ASC, then id ASC and overwrites the views map in read order.
  • Existing test review — PASS: latest-timestamp and pagination behavior already covered; exact-timestamp id tie-break was not directly asserted.
  • .github/workflows/ci.yml inspection — PASS: existing gates unchanged.
  • scripts/coverage.sh inspection — PASS: coverage aggregation path remains available.
  • Focused local test / broader test, lint, typecheck, coverage — not executable in this GitHub-connector runtime; PR CI is the executable repository validation gate.
  • Updated-head PR CI — pending after PR creation.

Scope guard

Changed file only:

  • apps/control-center/src/server/services/waitlist-growth-metrics-pagination.test.ts

Auto-merge

Not enabled. Repository setting allow_auto_merge is currently false; never bypass protections or repository policy.

Next QA target

Inspect concurrent mutation during social_post_metrics offset pagination. A delete/insert between pages should not silently turn a partial/stale snapshot into a plausible conversion rate; identify the smallest fail-closed invariant that can be tested without overbuilding the telemetry layer.

Copy link
Copy Markdown
Collaborator Author

QA run update — 2026-09-09

Inspection

  • Reused this open QA PR ([test-qa-hourly], branch test-qa/ongoing-coverage-20260909).
  • Previous head dbbfdce023a7aec390843906e0828747385124a4 CI #2430 (34315477146) — PASS.
  • Branch was already synced with main before this run (behind 0).
  • Reviewed current PR diff and active PRs Clarify reliability priority scores and check counts #429 / fix: keep visual fallbacks on topic and simplify scene trace #430; neither overlaps this QA target.
  • Reviewed apps/control-center/src/server/services/waitlist-growth.ts: metric reads are constrained to collected 24h rows, bounded by captured_at <= now, ordered by captured_at ASC then id ASC, and paged in 500-row windows.
  • Reviewed existing metric pagination/tie-break tests and CI/coverage contract already recorded in this PR.

QA change

Added apps/control-center/src/server/services/waitlist-growth-metric-query-contract.test.ts to pin the query-level snapshot contract itself. The regression asserts that metric attribution cannot silently drift by removing any of these safeguards:

  • social_post_id batch filter,
  • measurement_window = 24h,
  • collection_status = collected,
  • fixed captured_at upper bound,
  • stable captured_at ASC, id ASC ordering,
  • first page range 0..499.

Commit: d400fae4fbc845d1c5c84bba47ba4bc774139ceatest(control-center): pin metric snapshot query contract.

Commands / validation

  • GitHub fetch_commit_workflow_runs for previous head — PASS, CI #2430 completed successfully.
  • GitHub compare main...test-qa/ongoing-coverage-20260909 before change — PASS, ahead 1 / behind 0, test-only diff.
  • Source inspection of waitlist-growth.tsPASS; implementation currently matches the new query assertions.
  • PR diff review after change — PASS; current QA scope is two test files only, no implementation/workflow/docs/ignore/threshold changes.
  • Updated-head GitHub Actions CI #2435 (34319402683) — QUEUED.
  • Local focused/broader test, lint, typecheck, and coverage commands are not executable in this connector-only runtime; repository CI remains the executable validation gate.

Auto-merge

Not enabled. Repository setting allow_auto_merge=false; do not bypass repository policy.

Next QA target

After CI is green, test a minimal fail-closed invariant for concurrent mutation during social_post_metrics offset pagination—specifically a duplicate metric row appearing across adjacent pages due to row displacement.

Copy link
Copy Markdown
Collaborator Author

QA run update — CI-first repair

Inspection

  • Reused this open QA PR ([test-qa-hourly], branch test-qa/ongoing-coverage-20260909).
  • Previous head d400fae4fbc845d1c5c84bba47ba4bc774139cea CI #2435 (34319402683) completed failure.
  • CI job inspection: quick-gates failed; e2e, security, check-dead-env, and code-quality passed. Coverage artifacts were produced.
  • Downloaded quick-gates-verify-1 artifact and inspected result.json: format=failed, repo=passed, contracts=passed.
  • format.log showed exactly one Prettier drift in apps/control-center/src/server/services/waitlist-growth-metric-query-contract.test.ts (toHaveBeenNthCalledWith formatting only).
  • Current main advanced to a38cd9e987e88415cd8d4670f8aed21f8378ab4d via generated snapshot commits. Compare showed only analytics/landing-page snapshot data changes, with no overlap with the QA test files.

Action

  1. Applied canonical Prettier formatting only to the failing assertion; no behavior change.
  2. Safely synchronized the QA branch to current main by replaying the two QA test-file changes on top of a38cd9e... because the branch had diverged only through non-overlapping generated snapshot commits.
  3. Restored:
    • deterministic metric-id tie-break regression in waitlist-growth-metrics-pagination.test.ts
    • metric query-contract regression in waitlist-growth-metric-query-contract.test.ts, already in canonical Prettier form.

Current replay commits:

  • 09e2390bfacb3bbddf8be5a4944a4420098be224 — restore metric tie-break regression after main sync
  • 23632d7a4ccf606d00f353140a0ae60ab9db3067 — restore metric query contract after main sync

Commands / results

  • GitHub CI #2435 job inspection — FAIL isolated to quick-gates.
  • quick-gates-verify-1/result.jsonformat FAIL, repo PASS, contracts PASS.
  • quick-gates-verify-1/logs/format.log — one Prettier-only diff in the new query-contract test.
  • Compare test-qa/ongoing-coverage-20260909...main — branch diverged; main-side files were generated snapshots only, no QA-path overlap.
  • Focused local test / broader test / lint / typecheck / coverage — not executable in this connector runtime; updated-head GitHub CI is the executable repository validation gate.

Scope guard

Still test-only: the PR changes only the two Control Center waitlist-growth test files. No production implementation, workflow, docs, ignores, CI gates, or coverage thresholds changed.

Auto-merge

Not enabled in this run. Will only be considered after updated-head CI is green and repository auto-merge policy permits it.

Next QA target

After CI is green, exercise concurrent mutation around offset pagination: duplicate/disappearing metric rows across adjacent pages should not silently yield a plausible stale conversion rate.

@i-xtsu-sixyou-ken-mei
i-xtsu-sixyou-ken-mei merged commit cf2770f into main Sep 9, 2026
12 checks passed
@i-xtsu-sixyou-ken-mei
i-xtsu-sixyou-ken-mei deleted the test-qa/ongoing-coverage-20260909 branch September 9, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant