MBTI-PDF-RESULT-SNAPSHOT-SMOKE-QUALITY-GATE: add rendered MBTI result-page PDF smoke gate#1505
Conversation
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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}`); |
There was a problem hiding this comment.
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 👍 / 👎.
What changed
ops:mbti-result-page-pdf-smokeandscripts/ops/check-mbti-result-page-pdf-smoke.mjs.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
--executeplus operator-providedattempt_idand result access token via args orMBTI_RESULT_PAGE_PDF_SMOKE_*env.pdftotextfrom stdin when available.Validation
pnpm ops:mbti-result-page-pdf-smoke -- --json-> pass, dry-run redacted outputpnpm 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 testspnpm test:contract-> pass, 604 files / 3565 testspnpm typecheck-> passNEXT_PUBLIC_API_URL=https://api.fermatmind.com pnpm build-> passruby -e \"require 'yaml'; YAML.load_file('docs/codex/pr-train.yaml'); puts 'yaml ok'\"-> passpython3 -m json.tool docs/codex/pr-train-state.json >/dev/null-> passgit diff --check-> passIntentionally deferred
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.