Skip to content

feat(report): credibility scoring pipeline + fix(calendar): radix-nova mirror#36

Closed
abdout wants to merge 5 commits into
mainfrom
feat/report-scoring
Closed

feat(report): credibility scoring pipeline + fix(calendar): radix-nova mirror#36
abdout wants to merge 5 commits into
mainfrom
feat/report-scoring

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented May 19, 2026

Bundles the report-an-issue credibility scoring pipeline with several follow-up fixes, plus the home-page range calendar mirror.

Commits

  • `feat(report)` — credibility scoring pipeline for report-an-issue (#491e13f)
  • `test(report)` — refresh action tests for new pipeline shape (#1a4a67a)
  • `fix(search,errors)` — remove redundant Suspense and lucide imports for Next 16 (#a2fa05c)
  • `fix(report-issue)` — make wrapper a client component to keep `pg` out of client bundle (#8d5a2f6)
  • `fix(calendar)` — mirror shadcn radix-nova for range picker (#bb40135)

Calendar fix (latest)

The home-page range calendar at `/en` wasn't matching the canonical shadcn calendar — cells rendered ~60px wide (vs 28px in shadcn docs), and the `range_middle` band relied on plain `bg-accent` so any sub-pixel gap between the dark endpoint pill and the muted middle showed as a visible seam.

  • Switch `--cell-size` from `--spacing(8)` (32px) → `--spacing(7)` (28px)
  • Add `[--cell-radius:var(--radius-md)]` so day/pill rounding share one variable
  • `range_start/end` use `bg-muted` + `::after` pseudo-element bridges (`after:end-0` / `after:start-0`, `after:w-4`) so the muted band joins the rounded endpoint without a seam in either LTR or RTL
  • `range_middle` button uses `bg-muted text-foreground` (was `bg-accent`)
  • DayButton gets `relative isolate z-10` so the primary endpoint pill paints above the cell-level `::after` bridge
  • `locale` wired through to `formatMonthDropdown` and `CalendarDayButton` per shadcn's RTL upgrade guide
  • All directional rounding uses logical `rounded-s` / `rounded-e` so the pill caps the correct edge in Arabic
  • Drop the per-consumer `classNames={{ month: "w-[calc(...)]" }}` override in `vertical-search.tsx` and `big-search-date-picker.tsx` — the calendar now sizes itself naturally via `min-w-(--cell-size)` on each day button

Test plan

  • `pnpm tsc --noEmit --skipLibCheck` passes clean for the changed files
  • Manual: open `/en` hero, click check-in, pick start + end → range pill renders compact (28px cells) with no visible seam, no row dividers
  • Manual: switch to `/ar` → endpoint pill caps the correct edge in RTL

🤖 Generated with Claude Code

abdout and others added 5 commits May 12, 2026 10:47
Replaces the bare "POST to GitHub" report action with a strict scoring
pipeline that filters nonsense + destructive submissions before they
reach the auto-fix queue, while respecting wisdom-of-the-crowd
corroboration (3 independent reports on the same URL force verified).

Pipeline:
  Zod parse → resolve reporter → hard filters (HF1-HF10) → Turnstile →
  dedup search → Haiku triage → score R+Q+C+A+P → bucket → GitHub issue

Strict thresholds (locked in plan):
  <30   silent-reject       no issue created
  30-54 low-confidence      issue + label, agent skips, 14d auto-close
  55-74 needs-human         issue + label, human review
  ≥75   verified-report     issue + label, agent auto-fixes

Overrides:
  destructive classification → forced needs-human regardless of score
  3 corroborations on same URL → upgrade existing to verified
  AI failure → cap at needs-human (never silent-rejects legit report)
  severityHint=critical + score≥60 → promote to verified

Mkan-specifics:
  - Adapter uses @/lib/auth + existing assertRateLimit + Upstash KV
  - Adds 'report' + 'report-tenant' buckets to existing rateLimiters map
  - HOST and GUEST roles get reputation bases of 14 and 10 respectively
  - Reuses existing Upstash infrastructure (already in mkan's deps)

Anti-abuse measures:
  - 60s client-side cooldown mirrors HF9 (fixes triple-click case)
  - Symmetric success toast denies feedback to spammers
  - Anonymous requires Turnstile, capped at base reputation 4
  - Per-tenant rate limit catches coordinated abuse

Plan: /Users/abdout/.claude/plans/read-report-an-issue-glistening-wave.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The old report-issue tests covered the pre-pipeline bare-fetch action.
The action is now a thin wrapper around runReportPipeline; the old
contract (throwing on missing token, retrying on 422, posting an ack
comment) lives inside the pipeline now and is covered by the canonical
src/lib/report/__tests__ suite.

Action tests now smoke-test the wiring:
  - input forwarding to pipeline
  - bucket-aware return shape (issueNumber surfaces only for verified-report)
  - failure pass-through

Deleted tests/components/common/report-issue.test.tsx — the ReportIssue
component is now an async server component that auth()s before rendering
the client dialog. RTL can't render async server components; component
behavior is covered by Playwright at the integration level.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…Next 16

- Remove root <Suspense> on homepage; loading.tsx already provides the streaming fallback (Turbopack $RS race)
- Inline AlertTriangle SVG + native buttons in error.tsx so the error boundary has no chunked deps
- Iterate vertical search composition (big-search, date-picker, guest-selector, location)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…client bundle

The async server wrapper imported `auth()` → `@/lib/db` → `@prisma/adapter-pg` → `pg`,
and any client component importing `<ReportIssue />` (site-footer, landing footer)
pulled that chain into the browser bundle. Vercel build failed with
"Module not found: Can't resolve 'dns'" from pg/lib/connection-parameters.js.

Resolve the session via useSession() instead so the wrapper is client-safe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The home-page range calendar at /en wasn't matching the canonical
shadcn calendar — cells rendered ~60px wide (vs 28px in shadcn docs),
and the range_middle band relied on plain bg-accent so any sub-pixel
gap between the dark endpoint pill and the muted middle showed as a
visible seam. The "horizontal lines" the user reported were row-level
artefacts from the previous v9-migration attempt that had been left in
the working tree.

Rewrite src/components/ui/calendar.tsx against the upstream radix base
(apps/v4/registry/bases/radix/ui/calendar.tsx):

- [--cell-size:--spacing(7)]  → 28px cells (was 32px)
- [--cell-radius:var(--radius-md)] for shared rounding
- range_start/end use bg-muted + ::after pseudo-element bridges
  (after:end-0 / after:start-0, after:w-4) so the muted band joins
  the rounded endpoint without a seam in either LTR or RTL
- range_middle button: bg-muted text-foreground (was bg-accent)
- DayButton gets `relative isolate z-10` so the primary endpoint
  pill paints above the cell's ::after bridge
- locale wired through to formatMonthDropdown and CalendarDayButton
  per shadcn's RTL upgrade guide
- All directional rounding uses logical rounded-s / rounded-e so
  the pill caps the correct edge in Arabic

Drop the per-consumer `classNames={{ month: "w-[calc(...)]" }}`
override in vertical-search.tsx and big-search-date-picker.tsx — the
calendar now sizes itself naturally via min-w-(--cell-size) on each
day button, matching the shadcn CalendarRange example.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mkan Ready Ready Preview, Comment May 19, 2026 2:47am

@abdout
Copy link
Copy Markdown
Contributor Author

abdout commented May 19, 2026

Superseded by focused calendar-only PR — main moved past this branch when PR #35 merged the report-scoring work, so this branch is now conflicting. Opening a fresh PR with just the calendar fix on top of latest main.

@abdout abdout closed this May 19, 2026
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