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 remote-tracking branch 'origin/main' into pr-657-feat-589-reddit-backend-pin

Trevin Chow42eb5f5273a6
diff --cc CHANGELOG.md
index fe982b65,99ad2a64..d8c9ede8
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -7,11 -7,15 +7,20 @@@ and this project adheres to [Semantic V
## [Unreleased]
+### Added
+
+- Scheduled OSV-Scanner vulnerability-drift workflow scans repository lockfiles weekly and uploads SARIF results to GitHub code scanning, catching newly disclosed CVEs in the dependency tree even between PRs ([#571](https://github.com/mvanhorn/last30days-skill/issues/571))
+- `LAST30DAYS_REDDIT_BACKEND=scrapecreators` makes ScrapeCreators the primary Reddit backend with the public path as fallback. Users with a ScrapeCreators key who were getting shallow public data will now get full nested comment trees by setting this flag ([#589](https://github.com/mvanhorn/last30days-skill/issues/589))
+
+ ## [3.8.1] - 2026-06-22
+
+ ### Added
+ - **Restored the v3.0.0 first-run NUX wizard (Claude Code Modal Flow).** Step 0 now restores the original guided, `AskUserQuestion`-driven onboarding that eroded over time: a welcome message, an Auto/Manual/Skip setup modal, a cookie-consent modal, the ScrapeCreators signup offer, a TikTok/Instagram `INCLUDE_SOURCES` opt-in, and a first-topic picker. It is gated to hosts with modals; hosts without (OpenClaw, Codex, Cursor, Gemini CLI) get the equivalent **Non-Modal Prose Flow**. Digg is threaded into the install messaging alongside yt-dlp everywhere it appears, the ScrapeCreators credit count is `10,000 free calls`, and the flow is locked against re-erosion by `tests/test_onboarding_contract.py`. Builds on the consent-driven foundation from #659/#660. Original wizard captured at `docs/reference/old-nux-wizard-v3.0.0.md`.
+ - **Consent-driven first-run onboarding.** Step 0 now drives an in-chat consent flow instead of a silent `setup` run: the model asks before reading browser cookies (decline runs with `FROM_BROWSER=off` — still installs yt-dlp + Digg), surfaces the macOS Full Disk Access fix when a cookie read is permission-denied, and offers the ScrapeCreators GitHub signup on every first run. A successful `setup --github` now **persists `SCRAPECREATORS_API_KEY` automatically** (`setup_wizard.write_api_key`, 0o600) and masks the key in stdout so the secret never lands in the host model's captured output. Follows the first-run gate fix (#659).
+
+ ### Fixed
+ - **First-run setup no longer runs silently.** The prior Step 0 told the model to run `setup` and "follow the wizard's prompts end-to-end", but the wizard has no prompts — so onboarding extracted cookies, installed tools, and wrote `SETUP_COMPLETE` with zero interaction and never offered the ScrapeCreators signup. Reproduced 2026-06-22 (Fredy Montero, fresh macOS).
+
## [3.8.0] - 2026-06-21
### Added
diff --cc skills/last30days/SKILL.md
index 00195139,cb15cd7c..0f354dec
--- a/skills/last30days/SKILL.md
+++ b/skills/last30days/SKILL.md
@@@ -399,6 -584,6 +584,8 @@@ SKILL_DIR="<absolute path of the direct
**Perplexity source:** use it only when the user asks for Perplexity, Deep Research, or paid grounded synthesis, or when `perplexity` is already enabled in `INCLUDE_SOURCES` / `--search`. Direct `PERPLEXITY_API_KEY` supports Sonar synthesis, Search API rows, and async Deep Research. `OPENROUTER_API_KEY` is only a Sonar fallback. Normal runs default to `LAST30DAYS_PERPLEXITY_MODE=sonar`; use `search` for raw ranked web rows, `both` for synthesis plus rows, and `--deep-research` for `sonar-deep-research` with a 600s default wall timeout. A local Deep Research timeout is not a failed API key; inspect the raw artifact's async request id/status and resume by id if needed.
++**Reddit backend pin:** Reddit defaults to the free public backend with ScrapeCreators as a backup when `SCRAPECREATORS_API_KEY` is available. If the user says public Reddit is shallow, bot-gated, or missing nested comments, tell them they can set `LAST30DAYS_REDDIT_BACKEND=scrapecreators` alongside `SCRAPECREATORS_API_KEY` to make ScrapeCreators primary and keep public Reddit as fallback. Do not set this automatically for normal runs.
++
Then display (use "and more" if 5+ sources, otherwise list all with Oxford comma):
diff --cc skills/last30days/scripts/lib/pipeline.py
index 0125bf65,52f18ebd..d1a994ca
--- a/skills/last30days/scripts/lib/pipeline.py
+++ b/skills/last30days/scripts/lib/pipeline.py
@@@ -1159,47 -1201,7 +1201,51 @@@ def _retrieve_stream
# Use raw_topic so expand_reddit_queries() generates diverse variants
# from the original user topic, not the planner's narrowed search_query.
reddit_query = raw_topic or subquery.search_query
- # Public Reddit first (free, gets comments); SC as backup
+ has_sc_key = bool(config.get("SCRAPECREATORS_API_KEY"))
+ sc_first = (
+ has_sc_key
+ and (config.get("LAST30DAYS_REDDIT_BACKEND") or "").lower()
+ == "scrapecreators"
+ )
+ if sc_first:
+ # LAST30DAYS_REDDIT_BACKEND=scrapecreators: SC primary, public fallback
+ try:
+ result = reddit.search_and_enrich(
+ reddit_query, from_date, to_date, depth=depth,
+ token=config.get("SCRAPECREATORS_API_KEY"),
+ subreddits=subreddits,
+ )
+ items = reddit.parse_reddit_response(result)
+ if items:
+ return items, {}
+ sys.stderr.write(
+ "[Reddit] ScrapeCreators primary returned no items, "
+ "using public fallback\n"
+ )
+ except Exception as exc:
+ sys.stderr.write(
+ f"[Reddit] ScrapeCreators primary failed "
+ f"({type(exc).__name__}: {exc}), using public fallback\n"
+ )
+ try:
+ public_results = reddit_public.search_reddit_public(
+ reddit_query, from_date, to_date, depth=depth,
+ subreddits=subreddits,
+ )
+ if public_results:
+ return public_results, {}
++ sys.stderr.write(
++ "[Reddit] Public fallback returned no items after "
++ "ScrapeCreators primary miss\n"
++ )
+ except Exception as exc:
+ sys.stderr.write(
+ f"[Reddit] Public fallback also failed "
+ f"({type(exc).__name__}: {exc})\n"
+ )
+ return [], {}
+
+ # Default: public Reddit first (free, gets comments); SC as backup
try:
public_results = reddit_public.search_reddit_public(
reddit_query, from_date, to_date, depth=depth,
diff --cc tests/test_doc_flag_contract.py
index 00000000,5858475b..e36bc9f1
mode 000000,100644..100644
--- a/tests/test_doc_flag_contract.py
+++ b/tests/test_doc_flag_contract.py
@@@ -1,0 -1,43 +1,51 @@@
+ """Documentation contract for Python CLI and wrapper-only flags."""
+
+ from __future__ import annotations
+
+ from pathlib import Path
+
+ import last30days as cli
+
+ ROOT = Path(__file__).resolve().parents[1]
+ CONFIGURATION = ROOT / "CONFIGURATION.md"
+ SKILL_MD = ROOT / "skills" / "last30days" / "SKILL.md"
+
+
+ def _parser_flags() -> set[str]:
+ parser = cli.build_parser()
+ flags: set[str] = set()
+ for action in parser._actions:
+ flags.update(action.option_strings)
+ return flags
+
+
+ def test_configuration_documents_new_safety_flags():
+ text = CONFIGURATION.read_text(encoding="utf-8")
+ flags = _parser_flags()
+ assert "--no-browser-cookies" in flags
+ assert "--no-browser-cookies" in text
+ assert "--save-dir" in text
+ assert "--output" in text
+
+
++def test_reddit_backend_env_var_is_documented_for_users_and_runtime_skill():
++ config_text = CONFIGURATION.read_text(encoding="utf-8")
++ skill_text = SKILL_MD.read_text(encoding="utf-8")
++
++ assert "LAST30DAYS_REDDIT_BACKEND=scrapecreators" in config_text
++ assert "LAST30DAYS_REDDIT_BACKEND=scrapecreators" in skill_text
++
++
+ def test_save_is_not_documented_as_python_cli_flag():
+ text = CONFIGURATION.read_text(encoding="utf-8")
+ assert "--save-dir <path>" in text
+ assert "--save " not in text
+ assert "`--save`" not in text
+
+
+ def test_agent_is_documented_as_skill_argument_not_python_flag():
+ text = SKILL_MD.read_text(encoding="utf-8")
+ start = text.index("## Agent Mode (--agent flag)")
+ agent_section = text[start:start + 2000]
+ assert "If `--agent` appears in ARGUMENTS" in agent_section
+ assert "Skill tool" in text