[invite] Send the inviter's audit score to the invite email#456
Conversation
Thread the current audit score from the dashboard through to the api-server
so the invite email can show "my agent scored a N/100".
- sendInvites() takes an optional score and forwards it as { to, score }
- /api/audit/invite reads the browser-supplied score and clamps it to 0-100
(rounded; non-numeric dropped) before forwarding upstream
- AuditDashboard -> ComeBackBetterSection -> InviteDialog pass the score
down to the POST; the prop is optional end-to-end so it degrades to
score-free copy when absent
- tests: sendInvites body shape + route score coercion/clamping
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the 10 X + 10 LinkedIn templates with new copy that leads on the score and archetype and ends on the npx CTA plus handle (npx -y failproofai audit, @FailproofAI on X / @FailProof AI on LinkedIn). No URLs in the copy: a bare link would render a preview card and swallow the pasted audit-card image. The clipboard paste hint still appends via pickTemplate, and the deterministic seed-based selection is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump the header wordmark/meta and footer brand/CTA font sizes so the poster corners read clearly at share size, with the bottom bar sized consistently with the header. Applies to both the dashboard render and the downloaded PNG. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR threads an optional audit score from the dashboard into the invite submission flow, normalizes and forwards it through the API layers, rewrites share-template copy to emphasize score/archetype with deterministic CLI CTAs and no URLs, enlarges audit poster label typography for readability, and adds server log filtering to suppress benign Next.js deployment-skew errors during startup. ChangesAudit sharing updates
Server launch log filtering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~28 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
__tests__/scripts/skew-log-filter.test.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. scripts/launch.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. scripts/skew-log-filter.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@__tests__/audit/share-templates.test.ts`:
- Around line 19-23: The assertion in the test for template output uses
toContain to check for the "npx -y failproofai audit" CTA string, but this only
verifies the string exists somewhere in the output, not that it appears at the
end as the test title implies. Replace the toContain assertion with toMatch
using a regex pattern that anchors to the end of the string (using the $
anchor), or use toEndWith if available in your testing framework, to ensure the
CTA truly terminates the template output and prevent regressions where the CTA
might appear mid-body instead of at the end.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 71870348-5971-45a0-9ad5-6d11cc8b2369
📒 Files selected for processing (11)
CHANGELOG.md__tests__/api/audit-invite-route.test.ts__tests__/audit/share-templates.test.ts__tests__/lib/api-server-client.test.tsapp/api/audit/invite/route.tsapp/audit/_components/audit-dashboard.tsxapp/audit/_components/come-back-better-section.tsxapp/audit/_components/invite-dialog.tsxapp/audit/_components/share-templates.tsapp/audit/audit-styles.csslib/auth/api-server-client.ts
Addresses CodeRabbit review on #456: the 'ends on the npx CTA' test used toContain (presence only); switch to an end-anchored regex so a CTA that drifts mid-body is caught. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n the server log A browser tab left open across a dashboard rebuild/upgrade keeps POSTing a stale Server Action ID (IDs are hashed per build). Next handles it gracefully on the client — a 404 with `x-nextjs-action-not-found: 1`, which the client recovers from — but the standalone server still throws + logs a 3-line "Failed to find Server Action <hash>" block to stderr per stale request, which floods the failproofai terminal. The earlier attempt to fix this client-side was the wrong layer (a browser handler can't suppress a server-process log). This filters at the only place failproofai controls that output: the launcher. In `start` mode it now pipes the spawned Next server's stdout/stderr through a stateful per-stream filter that drops exactly the skew block and passes everything else through verbatim (color preserved via FORCE_COLOR). `dev` keeps `stdio: "inherit"` so Next's interactive compile output is untouched. Verified against the real standalone build: 3 stale-action POSTs produced 0 leaked error lines while the banner/startup logs (and color) came through. Unit-tested incl. the case where a genuine error following a skew block is NOT swallowed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
lgtm |
Summary
The invite-a-friend email now shows the inviter's audit score. This is the dashboard half of a two-repo change — it computes the score and sends it to the api-server, which renders it (companion PR below). It also bundles two
/auditpolish items that landed on this branch.Changes (dashboard)
Invite score — the cross-repo feature
sendInvites()takes an optional score and forwards it as{ to, score }.POST /api/audit/invitereads the browser-supplied score and clamps it to 0–100 (rounded; non-numeric dropped) before forwarding upstream.AuditDashboard → ComeBackBetterSection → InviteDialogpass the score into the POST. The prop is optional end-to-end, so it degrades to score-free copy if absent.Also in this PR
@failproofai/@Failproof AI). No URLs in the copy (a bare link would render a preview card and swallow the pasted audit-card image). Deterministic seed selection + the clipboard paste hint are unchanged.Testing
tsc --noEmitandeslintclean.sendInvitesbody-shape tests andPOST /api/audit/invitescore-coercion/clamping tests.Companion PR
platform (api-server) — renders the score: https://github.com/FailproofAI/platform/pull/418
🤖 Generated with Claude Code
Summary by CodeRabbit
npx -y failproofai auditcall to action (no URLs in the copy).