Skip to content

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

Merge origin/main into feat/as-of-date

Trevin Chow885fea5ba542
diff --cc skills/last30days/scripts/last30days.py
index 1c8865a8,7bfebefc..a9dfe2c4
--- a/skills/last30days/scripts/last30days.py
+++ b/skills/last30days/scripts/last30days.py
@@@ -86,16 -86,24 +86,30 @@@ def parse_search_flag(raw: str, flag_na
if normalized not in sources:
sources.append(normalized)
if not sources:
- raise SystemExit("--search requires at least one source.")
+ raise SystemExit(f"{flag_name} requires at least one source.")
return sources
+def parse_as_of_date_arg(value: str) -> str:
+ try:
+ parsed = dates.parse_as_of_date(value)
+ except ValueError as exc:
+ raise argparse.ArgumentTypeError(str(exc)) from exc
+ return parsed
+ def resolve_requested_sources(args_search: str | None, config: dict) -> list[str] | None:
+ """Resolve the requested source set: explicit --search wins, then the
+ LAST30DAYS_DEFAULT_SEARCH config key (env var or .env file), then None
+ (per-query default behavior). The config fallback lets users pin a fixed
+ source set that survives upgrades without patching SKILL.md (#442).
+ """
+ if args_search:
+ return parse_search_flag(args_search)
+ default_search = (config.get("LAST30DAYS_DEFAULT_SEARCH") or "").strip()
+ if default_search:
+ return parse_search_flag(default_search, flag_name="LAST30DAYS_DEFAULT_SEARCH")
+ return None
+
+
def slugify(value: str) -> str:
slug = re.sub(r"[^a-z0-9]+", "-", value.lower()).strip("-")
return slug or "last30days"
@@@ -765,9 -829,10 +844,11 @@@ def main() -> int
tiktok_creators=tiktok_creators,
ig_creators=ig_creators,
lookback_days=args.lookback_days,
+ as_of_date=args.as_of_date,
github_user=github_user,
github_repos=github_repos,
+ internal_subrun=comp_enabled,
+ hiring_signals_mode=args.hiring_signals,
)
r.artifacts["resolved"] = {
"entity": topic,
@@@ -895,7 -960,7 +976,8 @@@
github_repos=kwargs["github_repos"],
web_backend=args.web_backend,
lookback_days=args.lookback_days,
+ as_of_date=args.as_of_date,
+ hiring_signals_mode=args.hiring_signals,
internal_subrun=True,
)
report.artifacts["resolved"] = resolved_effective
diff --cc skills/last30days/scripts/lib/pipeline.py
index 4644387c,93d5c3be..7589376d
--- a/skills/last30days/scripts/lib/pipeline.py
+++ b/skills/last30days/scripts/lib/pipeline.py
@@@ -188,9 -206,9 +206,10 @@@ def run
tiktok_creators: list[str] | None = None,
ig_creators: list[str] | None = None,
lookback_days: int = 30,
+ as_of_date: str | None = None,
github_user: str | None = None,
github_repos: list[str] | None = None,
+ hiring_signals_mode: bool = False,
internal_subrun: bool = False,
) -> schema.Report:
settings = DEPTH_SETTINGS[depth]
@@@ -514,18 -564,9 +565,19 @@@ def _normalize_score_dedupe
freshness_mode=freshness_mode,
)
prepared_query = relevance.PreparedQuery(ranking_query)
- normalized = signals.annotate_stream(normalized, prepared_query, freshness_mode)
+ lookback_window_days = (
+ datetime.strptime(to_date, "%Y-%m-%d").date()
+ - datetime.strptime(from_date, "%Y-%m-%d").date()
+ ).days
+ normalized = signals.annotate_stream(
+ normalized,
+ prepared_query,
+ freshness_mode,
+ reference_date=to_date,
+ max_days=lookback_window_days,
+ )
- normalized = signals.prune_low_relevance(normalized)
+ if source != "jobs":
+ normalized = signals.prune_low_relevance(normalized)
normalized = dedupe.dedupe_items(normalized)
for item in normalized:
item.snippet = snippet.extract_best_snippet(item, prepared_query)