Skip to content

MBTI-PDF-RESULT-SNAPSHOT-SMOKE-QUALITY-GATE: add rendered MBTI result-page PDF smoke gate#1505

Merged
fermatmind merged 3 commits into
mainfrom
codex/mbti-pdf-result-snapshot-smoke-quality-gate
Jul 1, 2026
Merged

MBTI-PDF-RESULT-SNAPSHOT-SMOKE-QUALITY-GATE: add rendered MBTI result-page PDF smoke gate#1505
fermatmind merged 3 commits into
mainfrom
codex/mbti-pdf-result-snapshot-smoke-quality-gate

Conversation

@fermatmind

Copy link
Copy Markdown
Owner

What changed

  • Added ops:mbti-result-page-pdf-smoke and scripts/ops/check-mbti-result-page-pdf-smoke.mjs.
  • Added a focused contract test for the MBTI result-page PDF smoke gate.
  • Registered PR-D in the fap-web PR train and reconciled the merged PR-C dependency state.

Why

PR-A established the v3 route/surface contract, PR-B injected real content, and PR-C removed runtime shell pollutants. PR-D adds a rendered PDF quality gate so an operator-provided unlocked MBTI result-page PDF can be audited for v3/Gotenberg/no-mPDF headers, PDF shape, core section text, and known pollutant strings.

Smoke behavior

  • Default run is dry-run only and does not call production.
  • Live execution requires explicit --execute plus operator-provided attempt_id and result access token via args or MBTI_RESULT_PAGE_PDF_SMOKE_* env.
  • Output is redacted: raw attempt ids, tokens, private URLs, raw payloads, and raw PDF bytes are not logged or written to disk.
  • PDF text extraction uses pdftotext from stdin when available.

Validation

  • pnpm ops:mbti-result-page-pdf-smoke -- --json -> pass, dry-run redacted output
  • pnpm exec vitest run tests/contracts/mbti-result-page-pdf-smoke-quality-gate.contract.test.ts tests/contracts/result-private-leak-regressions.contract.test.ts tests/contracts/result-gotenberg-print-route.contract.test.ts -> pass, 3 files / 18 tests
  • pnpm test:contract -> pass, 604 files / 3565 tests
  • pnpm typecheck -> pass
  • NEXT_PUBLIC_API_URL=https://api.fermatmind.com pnpm build -> pass
  • ruby -e \"require 'yaml'; YAML.load_file('docs/codex/pr-train.yaml'); puts 'yaml ok'\" -> pass
  • python3 -m json.tool docs/codex/pr-train-state.json >/dev/null -> pass
  • git diff --check -> pass

Intentionally deferred

  • No fap-api changes.
  • No deployment, server env change, restart, reload, cache clear, DB/CMS/search/queue mutation.
  • No default CI production PDF download; live smoke is manual/ops-triggered unless secrets are added later.
  • No A4 pagination or visual polish; that remains PR-E.

Repository rule impact

This is frontend product-code/ops smoke tooling plus contract coverage for a private PDF result snapshot. It does not change CMS/content authority, public SEO enumeration, backend-owned content, or sitemap authority.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c21e06237

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"lib/api/v0_3.ts",
"public/sitemap.xml",
]) {
expect(isMbtiResultPagePdfSmokeQualityGateAllowedFile(file)).toBe(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make the scope test branch-independent

On any post-merge/main run, or any local checkout whose branch is not exactly codex/mbti-pdf-result-snapshot-smoke-quality-gate, isMbtiResultPagePdfSmokeQualityGateAllowedFile returns true by design, so this new assertion expects false and fails the contract suite after the PR leaves its feature branch. I confirmed the added test fails in that context with expected true to be false; set the branch context explicitly or check the allowlist directly instead of calling the branch-gated helper here.

Useful? React with 👍 / 👎.

printHelp();
process.exit(0);
} else {
throw new Error(`Unknown argument: ${arg}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Redact unknown CLI arguments before logging

If an operator uses the common --access-token=<token> form, or otherwise mistypes a flag that contains the token/attempt id, this branch throws Unknown argument: ${arg} and main().catch logs it verbatim, writing the raw secret to terminal or CI logs despite the smoke script's redaction guarantee. Either support --flag=value for the sensitive flags or avoid echoing unknown argument values in errors.

Useful? React with 👍 / 👎.

@fermatmind fermatmind merged commit 25dfba7 into main Jul 1, 2026
6 checks passed
@fermatmind fermatmind deleted the codex/mbti-pdf-result-snapshot-smoke-quality-gate branch July 1, 2026 03:41
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