Skip to content

fix: improve HN gig lead classification and contacts#383

Merged
michaelmwu merged 4 commits into
mainfrom
michaelmwu/improve-gig-link-classifier
Jul 10, 2026
Merged

fix: improve HN gig lead classification and contacts#383
michaelmwu merged 4 commits into
mainfrom
michaelmwu/improve-gig-link-classifier

Conversation

@michaelmwu

@michaelmwu michaelmwu commented Jul 10, 2026

Copy link
Copy Markdown
Member

Description

Improve Hacker News “Who is hiring?” lead review so employment type, application links, and direct contacts are clear and trustworthy.

  • Distinguish full-time-only roles from part-time/contract and mixed arrangements in both LLM and keyword-fallback classifications.
  • Reject business/customer contract mentions while preserving common contract-job phrasing, negation, and B2B contracting cases.
  • Let the classifier propose application URLs and contact emails, then accept only candidates found verbatim in the source post.
  • Prefer role-specific application pages over company homepages and show application/email actions separately.
  • Refresh pending or rejected false-positive rows on later scrapes without mutating approved or posted leads.
  • Document the HN lead review behavior.

The reported Anori Tech post now resolves to Full-time, selects the Notion role page, and exposes stefan.akatyschew@anoritech.com separately.

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 errors
  • bun run build — TypeScript check and production dashboard build passed
  • Playwright coverage verifies the employment label plus distinct application and email links

Pre-Landing Review

  • Independent Codex review: clean
  • Security, API-contract, testing, maintainability, performance, design, and red-team specialist passes completed
  • Final focused adversarial re-review: clean
  • Scope drift: clean

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 shared jobLeadClassificationMethodLabel, with tests for LLM, keyword fallback, and unknown.

The list item drops the redundant raw posting_type badge, renames the apply link to Apply website, and adds a mailto action when contractor_classification.contact_email is present. The JobLead type 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

    • Job leads now display employment type and classification source.
    • Added “Apply website” links and email contact links when available.
    • Improved extraction of application URLs and contact emails from job posts.
    • Non-contractor leads can now appear in the review queue.
  • Bug Fixes

    • Existing pending or rejected leads are refreshed without overwriting review decisions.
    • Application links now prioritize the most relevant role-specific URL.
  • Documentation

    • Added guidance for reviewing Hacker News job leads, metadata, links, and refresh behavior.

@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Job 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.

Changes

Job lead review workflow

Layer / File(s) Summary
Classification and contact extraction
packages/shared/src/five08/job_lead_sources.py, tests/unit/test_job_lead_sources.py
Heuristic and LLM classification now select validated application URLs and contact emails, handle employment-term negation, and expose classification provenance.
Scrape reconciliation and persistence
packages/shared/src/five08/job_lead_sources.py, packages/shared/src/five08/job_leads.py, tests/unit/test_job_lead_sources.py, tests/unit/test_job_leads.py, tests/unit/test_jobs.py
Scraping includes non-contractor leads, refreshes pending or rejected records, restricts conflict updates by status, and formats review summaries from classification metadata.
Dashboard presentation and built assets
apps/admin_dashboard/src/*, tests/integration/test_dashboard_playwright.py, apps/api/src/five08/backend/static/dashboard/*, docs/discord-gig-dashboard.md
The dashboard shows posting type and classification method, adds conditional application and email links, and references the rebuilt frontend bundle.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: improving Hacker News gig lead classification and contact handling.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch michaelmwu/improve-gig-link-classifier

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/shared/src/five08/job_lead_sources.py
Comment thread packages/shared/src/five08/job_lead_sources.py
Comment thread packages/shared/src/five08/job_leads.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 406f177 and e3cd508.

📒 Files selected for processing (11)
  • apps/admin_dashboard/src/main.tsx
  • apps/api/src/five08/backend/static/dashboard/.vite/manifest.json
  • apps/api/src/five08/backend/static/dashboard/assets/index-DGUtmRQC.js
  • apps/api/src/five08/backend/static/dashboard/index.html
  • docs/discord-gig-dashboard.md
  • packages/shared/src/five08/job_lead_sources.py
  • packages/shared/src/five08/job_leads.py
  • tests/integration/test_dashboard_playwright.py
  • tests/unit/test_job_lead_sources.py
  • tests/unit/test_job_leads.py
  • tests/unit/test_jobs.py

Comment thread apps/admin_dashboard/src/main.tsx
Comment thread packages/shared/src/five08/job_lead_sources.py
Comment thread packages/shared/src/five08/job_lead_sources.py
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@michaelmwu
michaelmwu added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit c57cd79 Jul 10, 2026
13 checks passed
@michaelmwu
michaelmwu deleted the michaelmwu/improve-gig-link-classifier branch July 10, 2026 20:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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+)?|"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +332 to +335
int(has_job_hint),
int(has_specific_path),
int(candidate == proposed_value),
int(bool(_APPLICATION_CONTEXT_RE.search(prefix))),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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