Skip to content

test(260617-v4e): golden e2e integration oracle for the ingest→stats pipeline#28

Merged
Afgan0r merged 10 commits into
masterfrom
quick/260617-v4e-golden-e2e-oracle
Jun 18, 2026
Merged

test(260617-v4e): golden e2e integration oracle for the ingest→stats pipeline#28
Afgan0r merged 10 commits into
masterfrom
quick/260617-v4e-golden-e2e-oracle

Conversation

@Afgan0r

@Afgan0r Afgan0r commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

A master-only behavioral regression oracle for the server-2 ingest→stats pipeline, built BEFORE the Phase 2 Track C refactor (Oxfmt / Oxlint / tsc→tsdown — behavior-preserving). It pins computed values and pipeline behavior that the frozen-contract/oasdiff gate (API shape only) and the unit suite (mocked boundaries) cannot catch.

How

  • Drives the real production path through the same factories as server.ts: promote staging → durable parse_jobs + RabbitMQ publish → real-broker parse.completed → real S3 artifact load → recalc → GET /stats/*.
  • Real PG + RabbitMQ + MinIO/S3 (docker-compose), real migrations, truncate … cascade isolation, unique S3 keys + ephemeral queue per run. No mocked boundary.
  • Fixtures: real ParserArtifact corpus committed as a gzip archive, unpacked at test start; floor from the parser-2 golden corpus, scalable to hundreds via a gated SSH capture script (src/test/golden/scripts/) the human runs once against the VPS.
  • Assertions: normalized characterization snapshots of the full surface (parser_results+evidence, events, player/squad/commander stats, bounty, terminal parse_jobs, staging status/evidence, /stats/*) + hand-computed bounty anchors (4.00 / 9.00 / 0).
  • Invariants pinned: durable-job-before-publish, dedup vs source_identity_changed_bytes conflict, re-delivery idempotency, synthetic parse.failed, role-gate (401/403/2xx).

Gate placement

  • New test:golden script + a master-push-only CI job. Not in verify / test / test:coverage → zero coverage obligation; verify stays green at 100% and the suite skips cleanly when Docker or the archive are absent.

Validation

  • pnpm verify green end-to-end; test:coverage 100%.
  • pnpm test:golden LIVE green: 4 files / 26 tests, 9 snapshots, real broker round-trips.
  • Code-review (1 high + mediums) applied; verifier 8/8 must-haves.

Decision pack, research, review, and verification: .planning/quick/260617-v4e-golden-e2e-integration-oracle-for-ingest/.

🤖 Generated with Claude Code

Afgan0r and others added 10 commits June 17, 2026 22:28
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…alizer, skip guards, test:golden

- add test:golden script targeting src/test/golden (no verify-chained script globs it)
- loader.ts: unpack committed archive + archivePresent()/dockerReachable() skip guards, production ParserArtifact type
- normalize.ts: uuid->token map, timestamp + source_file redaction, row sort
- README + skeleton pipeline test that skips cleanly without infra
- build-floor-archive.sh: parser-2 CLI over its golden OCAP corpus → real artifacts (success/partial only)
- commit artifacts.tar.gz floor (9 real parser-2 artifacts) so the oracle is never empty
- pipeline.golden.test.ts: promote → durable job → real broker publish → completed consumer → recalc → GET /stats/* snapshot, through the same factories server.ts wires
- harness.ts: TRUNCATE_ALL, bounded pollUntil (hard timeout), queue purge, raw parse.completed publisher, full-surface normalizer
- assert durable-job-before-publish invariant + published parse.requested contract
- ignore machine-generated golden snapshots in prettier
…cases

- three anchors over the aggregate-combat artifact: player-only (4.00), player+squad (9.00), excluded teamkill (0)
- seed a previous rotation with player_stats/squad_stats supplying effectiveness; force replays.game_type='sg' so the bounty scope is non-empty
- assert persisted bounty_points with toEqual hand-computed values (semantics, not snapshot)
…-delivery, role-gate

- six pinned invariants: durable-job-before-publish, re-promote dedup (duplicate_replay_id), source-bytes conflict (source_identity_changed_bytes), re-delivery idempotency, parse.failed terminal-once, admin role-gate (401/403/2xx)
- conflict + parse.failed via synthetic non-broker paths (never round-trip a throwing artifact)
- role-gate exercises the shared requireRole pre-handler via buildApp + in-memory auth stores
… corpus

- capture-artifacts.sh: env-driven (no host/key/cred/IP literals), mc/aws fallback, Happ VPN ip-rule bypass reminder, logs captured-vs-skipped, folds in the parser-2 floor, fails loudly on missing env / zero objects
- README already documents the one-line human run command + floor/master-only-CI note
- add max-lines to invariants disable header (post-format line count)
- add master-only golden-oracle job to cd.yml (push to master/main only, brings up compose services, runs test:golden, 30m timeout) — not a PR check, not in verify
- exclude src/test/golden from test and test:coverage so the suite runs ONLY via test:golden (zero coverage obligation; verify stays green at 100%)
- README CI-wiring section documents the wired job
…ation + shared skip-guard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Afgan0r Afgan0r merged commit b1a3c9a into master Jun 18, 2026
4 checks passed
@Afgan0r Afgan0r deleted the quick/260617-v4e-golden-e2e-oracle branch June 18, 2026 01:37
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