Repository navigation
Fix the 22 Oct QA backend nits (batch C2) - #195
Merged
Merged
Conversation
Strip Wikipedia chrome and flag truncated URL imports, refund a failed import's quota, keep Playwright off the production Supabase project, refund a demo code when account setup fails, page the admin user list, build share links from the request origin, leave billing internals out of account export, and judge each crossfire debrief turn only on its own words. Co-authored-by: Gáborjáni-Szabó Ádám <Programcode@users.noreply.github.com>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 23 minutes. View limit details
Note 🎁 Summarized by CodeRabbit Free
Comment |
Refunding every failed import let a user fetch any URL without limit by pointing it at a page that fails. Refund only when the import fails before a request leaves for the source.
This was referenced Oct 22, 2026
Programcode
added a commit
that referenced
this pull request
Oct 22, 2026
Programcode
added a commit
that referenced
this pull request
Oct 22, 2026
…197) * Match Wikipedia chrome by whole class token so import-source keeps the article #195 matched chrome names like toc with hyphen boundaries, so the <html> flags vector-toc-available and vector-feature-toc-pinned-* marked the whole page as chrome and every Wikipedia import came back empty. Match exact id/class tokens, never treat <html>/<body> as chrome, and test against a real (gzipped) Wikipedia page. * test(import-source): assert on Wikipedia chrome that actually leaked before #195
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local follow-up to the 22 Oct 2026 QA report. Eight backend nits only. Not merged, and nothing here was deployed or applied to staging or production.
GitHub Actions minutes are out, so this is a local
npm run verifyon558ebfb7, not a CI pass. The run setcommit.gpgsign=falsefor the process because this environment signs every git commit andsrc/test/scripts/backend-status.test.tsthen stalled ingit commit(hook timeout, unrelated to this diff). With that set, verify exited 0:npm test: 61 files, 429 tests passednpm run test:collaboration: 5 files, 30 tests passednpm run test:edge: 405 passednpm run build: prerender and check-site passed (47 HTML files, sitemap and llms.txt, no problems)npm run test:sw: upgrade, offline route, recovery, prefetch, logo, and no API cache entriesnpm run test:e2e:smoke: 43 passed (30.3s), desktop ChromiumThe database gate did not run. This machine has no Docker, so the new pgTAP assertions in
account_deletion_test.sqlanddemo_access_codes_rls_test.sqlare unexecuted.Issues
LB-02
URL import now strips
style/script/navand Wikipedia chrome (edit links, TOC, navboxes, language lists, parser-output styles) before taking text, and prefersmain,article,#mw-content-text, and.mw-parser-output. A hard cut at 50k characters setstruncatedand keeps a truncation note inside the cap. Covered by the Wikipedia fixture andlimitImportedTexttests.QB-10
import-sourcestill reserves theimport_sourceslot up front, then callsrefund_daily_quotaunless the import returns 200 (upstream failure, unsupported type, too-short text, timeout, or exception). A 429 or a rejection before a successful reservation is not refunded. Covered by the 503 refund test and the deadline tests.DB-02
Playwright starts Vite with
VITE_E2E=1. The unpinned production fallback becomeshttp://e2e.invalid, and the browser refuses any request to the production project origin.playwright.config.tsrefuses to start ifVITE_SUPABASE_ENVorSUPABASE_URLalready points at production.E2E_ALLOW_PROD=1is the override. The production canary config does not setVITE_E2E. Plainnpm run devstill defaults to production. No keys were added.SC-05
A reserved demo-code use is refunded when account setup fails after
consume_demo_access_code. The reservation stays before the session handoff. User lookup islookup_auth_user_by_emailinstead of paginglistUsers.DEMO_CODE_PEPPERstill falls back to the service-role key, and the function logs one warning when the dedicated pepper is missing. One code still shares one Auth user; that design is unchanged.SC-06
isAdminand the per-user role lookup usemaybeSingle(). The users action takespage(default 1) andperPage(default 50, max 100) and returnshasMore. The admin users tab loads the next page on demand. The subscribers action still callslistUsers()with no page size; that was not this list.SC-09
shareUrluses an allowedOrigin, then an allowedRefererorigin, then optionalPUBLIC_WEB_APP_ORIGIN, thenhttps://debate.pi-stack.org. A request with no origin still gets the production URL.ST-02
export_account_datadropsstripe_customer_id,customer_id,daily_limit_override,gifted_trial_2026_05,gifted_trial_gratuity_2026_05,pricing_snapshot_id, andraw_usagefrom the export document. Format version stays 1. The rows stay in the database.MD-15
The debrief prompt tells the model to judge each turn from its own words and earlier turns, and not to use a later turn as evidence about an earlier one.
concessionsSecured,controlledQuestions,weakOrRepetitiveQuestions, andevasiveOrIncompleteAnswerscite exactly one turn id in the client schema, the server validator, and the provider JSON schema (maxItems: 1).missedFollowUps,betterFollowUpQuestions, andstrongestExchangemay still cite an exchange.Needs a deploy before it is live
Not done in this PR:
20261022210000_redact_account_export_internals.sqland20261022210100_demo_code_lookup_and_refund.sql(refund and lookup are service-role only; export replace keeps the same signature).import-source,demo-code-login,admin,share, andai(the debrief prompt and validator ship insideai).The account function does not need a new deploy for the export redaction; it already calls
export_account_data. The Playwright guard and admin load-more button ship with the frontend when this merges tomain. Do not merge from here.