Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

fix: preserve jsonld jobs and refine comparison heuristic

Trevin Chow9662054e084a
diff --git a/skills/last30days/scripts/lib/jobs.py b/skills/last30days/scripts/lib/jobs.py
index 2b5c7774..bbe9e465 100644
--- a/skills/last30days/scripts/lib/jobs.py
+++ b/skills/last30days/scripts/lib/jobs.py
@@ -430,16 +430,18 @@ def extract_jsonld_jobs(html: str, base_url: str = "") -> list[dict[str, Any]]:
if not title or title in seen:
continue
seen.add(title)
+ posting_url = str(obj.get("url") or "").strip()
items.append({
"id": f"JL{len(items) + 1}",
"title": title,
- "url": str(obj.get("url") or base_url or "").strip(),
+ "url": posting_url,
"description": _clean_html(str(obj.get("description") or ""))[:2000],
"date": _date_part(obj.get("datePosted")),
"date_confidence": "high" if obj.get("datePosted") else "low",
"provider": "careers-jsonld",
"department": str(obj.get("occupationalCategory") or "").strip(),
"location": _jsonld_location(obj),
+ "source_url": base_url,
"source_domain": domain,
"relevance": 0.6,
"why_relevant": "JobPosting structured data on careers page",
diff --git a/skills/last30days/scripts/lib/normalize.py b/skills/last30days/scripts/lib/normalize.py
index b0b81a15..8a4a21a6 100644
--- a/skills/last30days/scripts/lib/normalize.py
+++ b/skills/last30days/scripts/lib/normalize.py
@@ -279,6 +279,7 @@ def _normalize_jobs(
"location": location,
"offices": item.get("offices") or [],
"board_token": item.get("board_token") or "",
+ "source_url": item.get("source_url") or "",
"source_domain": item.get("source_domain") or _domain_from_url(str(item.get("url") or "")) or "",
},
)
diff --git a/skills/last30days/scripts/lib/pipeline.py b/skills/last30days/scripts/lib/pipeline.py
index f3eb6659..a7ae91d8 100644
--- a/skills/last30days/scripts/lib/pipeline.py
+++ b/skills/last30days/scripts/lib/pipeline.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import re
import sys
import threading
import time
@@ -641,15 +642,36 @@ def _company_topic_likely(topic: str) -> bool:
}
if any(word in generic for word in lower.split()):
return False
- if " vs " in lower or " versus " in lower:
- return True
known_single_word_companies = {
"apple", "uber", "google", "microsoft", "amazon", "meta", "netflix",
- "openai", "anthropic", "qualtrics",
+ "openai", "anthropic", "qualtrics", "stripe", "brex",
}
+ if " vs " in lower or " versus " in lower:
+ parts = re.split(r"\s+(?:vs|versus)\s+", text, maxsplit=1, flags=re.IGNORECASE)
+ if len(parts) != 2:
+ return False
+ return _comparison_side_company_like(parts[0], known_single_word_companies) or _comparison_side_company_like(
+ parts[1], known_single_word_companies
+ )
return bool(text[:1].isupper() or lower in known_single_word_companies)
+def _comparison_side_company_like(side: str, known_companies: set[str]) -> bool:
+ token = re.sub(r"[^\w.+#-]", "", side.strip().split()[0] if side.strip() else "")
+ if not token:
+ return False
+ lower = token.lower()
+ common_tech_terms = {
+ "python", "ruby", "javascript", "typescript", "java", "go", "golang",
+ "rust", "php", "swift", "kotlin", "scala", "clojure", "elixir",
+ "react", "vue", "angular", "svelte", "node", "django", "rails",
+ "postgres", "mysql", "redis", "kubernetes", "docker",
+ }
+ if lower in common_tech_terms:
+ return False
+ return bool(token[:1].isupper() or lower in known_companies)
+
+
def _warnings(
items_by_source: dict[str, list[schema.SourceItem]],
candidates: list[schema.Candidate],
diff --git a/tests/test_jobs_source.py b/tests/test_jobs_source.py
index b8bb6ceb..26492459 100644
--- a/tests/test_jobs_source.py
+++ b/tests/test_jobs_source.py
@@ -147,6 +147,30 @@ class JobsSourceTests(unittest.TestCase):
self.assertEqual(1, len(parsed))
self.assertEqual("GTM Lead", parsed[0]["title"])
+ def test_jsonld_jobs_without_urls_survive_normalize_and_dedupe(self):
+ from lib import dedupe, normalize
+
+ html = (
+ '<script type="application/ld+json">'
+ '{"@graph":['
+ '{"@type":"JobPosting","title":"Founding Designer","datePosted":"2026-06-01"},'
+ '{"@type":"JobPosting","title":"GTM Lead","datePosted":"2026-06-02"},'
+ '{"@type":"JobPosting","title":"Staff Engineer","datePosted":"2026-06-03"}'
+ ']}'
+ '</script>'
+ )
+ parsed = jobs.extract_jsonld_jobs(html, "https://acme.com/careers")
+ self.assertEqual(3, len(parsed))
+ self.assertTrue(all(item["url"] == "" for item in parsed))
+ self.assertTrue(all(item["source_url"] == "https://acme.com/careers" for item in parsed))
+
+ normalized = normalize.normalize_source_items("jobs", parsed, "2026-05-17", "2026-06-16")
+ kept = dedupe.dedupe_items(normalized)
+ self.assertEqual(
+ ["Founding Designer", "GTM Lead", "Staff Engineer"],
+ sorted(item.title for item in kept),
+ )
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/test_pipeline_v3.py b/tests/test_pipeline_v3.py
index 8e99acae..85d9cc03 100644
--- a/tests/test_pipeline_v3.py
+++ b/tests/test_pipeline_v3.py
@@ -142,6 +142,16 @@ class PipelineV3Tests(unittest.TestCase):
self.assertNotIn("jobs", report.items_by_source)
self.assertNotIn("hiring_signals", report.artifacts)
+ def test_bare_language_comparison_topics_do_not_add_jobs(self):
+ for topic in ("python vs ruby", "Python vs Ruby"):
+ with self.subTest(topic=topic):
+ self.assertFalse(pipeline._company_topic_likely(topic))
+
+ def test_company_comparison_topics_add_jobs(self):
+ for topic in ("Stripe vs Brex", "OpenAI versus Anthropic"):
+ with self.subTest(topic=topic):
+ self.assertTrue(pipeline._company_topic_likely(topic))
+
def test_standard_mode_omits_weak_large_company_jobs_signal(self):
with patch("lib.pipeline._retrieve_stream") as mock_retrieve:
def fake_retrieve(**kwargs):