Repository navigation
feat(research): SearXNG-first search with result routing + Hacker News and Stack Exchange readers - #404
Merged
Conversation
…s and Stack Exchange readers - web_search: up to 5 phrasings per call (round-robin merged, deduplicated), recency 'week', topic-aware 'already read' flags, and every result names its reader (reddit_thread / hn_thread / se_question / web_fetch) - web_fetch: with a topic, Reddit/HN/SE URLs are read by their site tool, and ordinary pages are logged in notes/<topic>/sources.md and not re-read - site plugins gain a 'direct' transport for public JSON APIs (no browser): pacing + 429/5xx backoff, host allowlist, https only - Hacker News plugin (Algolia API): hn_search, hn_thread (whole tree in one request) - Stack Exchange plugin (API v2.3): se_search (any site), se_question (question + answers, accepted first, code kept); honours the API backoff, reports low quota, optional TSFORGE_STACKEXCHANGE_KEY - a 'Finding and reading sources' playbook for research sessions - docs: integrations/research-sources, web-tools, flags, where-to-change
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tsforge | b029dd0 | Commit Preview URL Branch Preview URL |
Sep 27 2026, 09:56 AM |
…ersistent settings file - jsdom is created with a silent VirtualConsole everywhere (quietDocument): its 'Could not parse CSS stylesheet' went to console.error over the TUI, scrolled the alternate screen and left duplicated header/status rows - while the interactive UI is up, stray console.error/warn from any library is diverted to the debug trace instead of the terminal - ~/.tsforge/config.json (and a project's tsforge.config.json) 'settings' block with readable names (browser, webTools, searxngUrl, stackExchangeKey, maxTurns, …) plus an 'env' passthrough for TSFORGE_* — applied at startup; real env wins, project beats user - /config saves web tools, Chrome and the new 'Web search backend' (SearXNG URL) there, so toggles survive restarts
Sandboxed runs (the e2e PTY tests set TSFORGE_HOME) wrote /config toggles into the real ~/.tsforge/config.json. Every other tsforge path already honours TSFORGE_HOME; the settings file and TUI keybindings now share the same lookup.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes every hop of a research run cheap: search → source → search → source.
Spec:
docs/superpowers/specs/2026-09-27-research-search-hn-se-design.md. Infra: SearXNG is exposed LAN-only atsearx.lanvia Programmer-Network/argocd-app-of-apps#133, plus a Pi-hole record.Search (
web_search)queries: up to 5 phrasings per call, merged round-robin and deduplicated.recency: weekadded.topic: results already logged innotes/<topic>/sources.mdare markedalready read.→ reddit_thread post:"…",→ hn_thread item:"…",→ se_question question:"…" site:"…", or→ web_fetch.TSFORGE_SEARXNG_URL=http://searx.langives Google results (through the instance's Google CSE engine) as JSON.web_fetchtopic, a Reddit / HN / SE URL is read by its site tool (the whole discussion, structured). Other pages are logged asweb:<sha1-12>of the normalised URL and refused on re-read unlessforce.topic, it behaves as before, plus a tip naming the better tool.Site plugins: new
directtransportdirectFetchJsonchecks the host allowlist, requires https, paces requests, and backs off on 429/5xx.ISitePluginContext.sessionis now optional, andstateKeykeys per-session state.route(url)per plugin, androuteUrlin the registry.Hacker News (
hn_search,hn_thread)Uses Algolia's official API.
hn_threadreads the entire comment tree in one request, rendered as nested markdown with dead or deleted leaves dropped. Reads are chunked, cached, logged, and refused on re-read unlessforce.Stack Exchange (
se_search,se_question)stackoverflow,superuser,askubuntu, or<name>.stackexchange.com.se_questionreturns the question plus answers, accepted first then by votes, with code blocks kept and entities decoded.backoff, reports low quota, and accepts an optionalTSFORGE_STACKEXCHANGE_KEY(300 → 10k requests/day).Guidance
A short "Finding and reading sources" playbook for research sessions, plus per-plugin notes. Web-only sessions get the HN/SE guidance too.
Tests
site-plugins-hn-se.test.tsandresearch-search.test.ts, with fixtures shaped from the live API responses.searx.lanreturned Google results with reader hintshn_search→hn_threadread a 156-comment treese_search→web_fetchhanded off tose_questionsources.mdbun run ci:localpasses: 6219 tests, 0 failures. The docs build passes.Docs: a new
integrations/research-sources.mdx, plus updates toweb-tools.mdx, the flags reference (TSFORGE_STACKEXCHANGE_KEY), and where-to-change (plugin transports).Also in this PR
The TUI was broken by library output. jsdom reported page CSS problems ("Could not parse CSS stylesheet") with
console.errorstraight onto the terminal. That scrolled the alternate screen, and the fixed rows (header, status, Tasks panel) were redrawn one line off, leaving stacked duplicates.quietDocumentwith a silentVirtualConsole(web_fetchextraction and bothpage-renderdocuments). A test reproduces the default jsdom printing the error and proves the quiet path prints nothing.console.error/console.warnfrom any library go to the debug trace (TSFORGE_TRACE). The UI itself never uses them.Persistent settings, instead of passing a dozen env vars at every launch.
~/.tsforge/config.json(and a project'stsforge.config.json) gets asettingsblock with readable names:browser,webTools,searxngUrl,stackExchangeKey,maxTurns,browserPort,searchBackend,compactAt,browserAllowPrivate.envblock passes throughTSFORGE_*only;PATHand other names are ignored./confignow saves Web tools, Chrome browser and a new Web search backend (SearXNG URL) field to~/.tsforge/config.json, keeping the rest of the file (keybindings).Tests:
quiet-console.test.tsanduser-settings.test.ts. Break-to-prove covers the quiet jsdom, real-env-wins,TSFORGE_*-only passthrough, project-over-user, keeping keybindings, and saving the browser toggle.ci:localpasses: 6228 tests, 0 failures. The flags reference has a new "Settings file" section, and the Chrome / research-sources / web-tools pages point to it.