fix: improve HN gig lead classification and contacts#383
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3b5efd63-88bc-438d-9b96-6161d23c897f) |
📝 WalkthroughWalkthroughJob lead classification now extracts employment, application, and contact metadata; eligible rejected leads can be refreshed; persistence preserves reviewed states; and the dashboard displays classification provenance with application and email actions. ChangesJob lead review workflow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant HackerNews
participant scrape_job_leads
participant Classifier
participant Database
participant Dashboard
HackerNews->>scrape_job_leads: provide hiring comments
scrape_job_leads->>Classifier: classify text and extract URLs/emails
Classifier-->>scrape_job_leads: return posting type and contact metadata
scrape_job_leads->>Database: upsert or refresh eligible lead
Dashboard->>Database: load lead display payload
Database-->>Dashboard: return classification and action links
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3cd508d9d
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@apps/admin_dashboard/src/main.tsx`:
- Around line 5607-5609: Update the provenance label logic in the
method-labeling function so only method === "keyword" is displayed as “Keyword
fallback”; preserve method === "llm" as “LLM” and label all other values,
including "unknown", as “Unknown”.
In `@packages/shared/src/five08/job_lead_sources.py`:
- Around line 132-137: Gate the b2b-contracting match with
_contract_match_is_employment, just as the generic contract tag is gated, so
service-related mentions do not contribute job classification confidence. Update
the relevant matching logic around the b2b-contracting handling and add a
regression test covering “we provide B2B contracting services” without a hiring
offer.
- Around line 287-363: The URL scoring in _preferred_apply_url incorrectly
allows explicit application context to outweigh a role-specific path. Adjust
score ordering or weighting in the nested score function so candidates with
job/role-specific paths are ranked above root homepage URLs, using context
scoring only as a tie-breaker; preserve proposal matching and existing candidate
extraction behavior.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 847579b4-d1e0-4fd6-aac6-03df7e09e9a3
📒 Files selected for processing (11)
apps/admin_dashboard/src/main.tsxapps/api/src/five08/backend/static/dashboard/.vite/manifest.jsonapps/api/src/five08/backend/static/dashboard/assets/index-DGUtmRQC.jsapps/api/src/five08/backend/static/dashboard/index.htmldocs/discord-gig-dashboard.mdpackages/shared/src/five08/job_lead_sources.pypackages/shared/src/five08/job_leads.pytests/integration/test_dashboard_playwright.pytests/unit/test_job_lead_sources.pytests/unit/test_job_leads.pytests/unit/test_jobs.py
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_33fd8a4c-fa59-42cf-abb0-659ec9ebad81) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_239ca3cc-859b-4641-a83c-642aba994210) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc32e27353
ℹ️ 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".
| r"(?:\w+\s+){0,3}(?:contact|email|reach\s+out(?:\s+to)?)|" | ||
| r"(?:please\s+)?(?:do\s+not|don't)\s+email(?:\s+\w+){0,4}" | ||
| r"(?:\s+(?:to|at))?|" | ||
| r"(?:do\s+not|don't)\s+send\s+(?:\w+\s+){0,4}(?:by|via)\s+email\s+(?:to\s+)?|" |
There was a problem hiding this comment.
Handle send-to email negations
When a post says something like “Please don't send resumes to jobs@acme.example; apply on site”, this negation pattern does not match because the send branch only covers by/via email forms. Since _preferred_contact_email returns a single uncontextualized email when no negative context is detected, the dashboard will still expose a mailto: action for an address the post explicitly says not to use; please include direct send ... to <email> resume/application variants in the negation handling.
Useful? React with 👍 / 👎.
| int(has_job_hint), | ||
| int(has_specific_path), | ||
| int(candidate == proposed_value), | ||
| int(bool(_APPLICATION_CONTEXT_RE.search(prefix))), |
There was a problem hiding this comment.
Prioritize explicit Apply links over URL hints
In posts that include an explicitly labeled generic apply URL plus a later unrelated URL whose host/path contains a broad hint, such as Apply: https://acme.example/ followed by Engineering blog: https://engineering.acme.example/, this tuple ranks the engineering-blog URL higher because has_job_hint is compared before the explicit apply context. That makes the stored/dashboard “Apply website” point at a non-application page even though the source post labeled the real apply link.
Useful? React with 👍 / 👎.
Description
Improve Hacker News “Who is hiring?” lead review so employment type, application links, and direct contacts are clear and trustworthy.
The reported Anori Tech post now resolves to
Full-time, selects the Notion role page, and exposesstefan.akatyschew@anoritech.comseparately.How Has This Been Tested?
./scripts/test.sh— 1,915 passed, 20 skipped; dashboard 13 passed./scripts/lint.sh— Ruff and Biome clean./scripts/pyrefly.sh— 0 errorsbun run build— TypeScript check and production dashboard build passedPre-Landing Review
Documentation
docs/discord-gig-dashboard.md: documented HN lead employment labels, link/contact validation, application-page preference, and safe refresh behavior.Note
Low Risk
Admin-only presentation and typing changes; no auth or API behavior in this diff.
Overview
Job lead review cards now surface employment type and how it was classified in one badge (e.g.
Full-time · LLM) instead of method plus confidence fit. Provenance labels live in sharedjobLeadClassificationMethodLabel, with tests for LLM, keyword fallback, and unknown.The list item drops the redundant raw
posting_typebadge, renames the apply link to Apply website, and adds a mailto action whencontractor_classification.contact_emailis present. TheJobLeadtype includes that field on nested classification data.Bundled dashboard build manifest updates to the new JS asset hash.
Reviewed by Cursor Bugbot for commit cc32e27. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation