Skip to content

feat(web): add web search through your own SearXNG - #2

Merged
arthware-dev merged 5 commits into
mainfrom
feat/web
Oct 29, 2026
Merged

arthware-dev merged 5 commits into
mainfrom
feat/web

Conversation

@arthware-dev

Copy link
Copy Markdown
Contributor

Summary

  • web is a new extension. ./stack web search <query> asks the family's own SearXNG. ./stack web ask <question> answers from the search results with the stack's AI model, with sources. Both do their work in famstack's bot runner. It moves here from famstack in chore(web): move the web stacklet to the famstack-extensions catalog famstack#368 (move the web stacklet to the famstack-extensions catalog).
  • CI runs the tests of every extension through famstack's extension lane, script/test extension. docs/testing.md explains how to write these tests, and lists the pitfalls.
  • Extensions use ports 42100 to 42199, as famstack's ADR-007 records. script/check-manifests.py refuses a port outside that range, and two extensions on one port.

CI fails until famstack-dev/famstack#367 (let an extension's command do its work in the bot runner) and #368 merge into feature/0.5.0-beta.1. CI tests against that branch, and it still ships web and has no extension lane yet. Re-run CI after both merge.

Merge: rebase, after the two famstack PRs. Each commit stands alone.

The tests ran under famstack's test environment with plain pytest, so
each extension put famstack's `lib/` on `sys.path` and built a stack
instance of its own. famstack now has a lane for them,
`script/test extension <folder>`: its pytest configuration, its unit
lane's rules, the extension's modules as `stacklets.<id>`, and an
instance with the extension installed and up.

`script/cibuild` runs each extension's tests through that lane. Hue's
tests pass there unchanged.
The web extension runs SearXNG, a metasearch engine, in one container,
so the public search engines see the Mac and not a family member's
account.

- `./stack web search "<query>"` lists the results with their links.
- `./stack web ask "<question>"` answers from the top results with the
  stack's AI model, and lists the sources, also when the model cannot
  be reached.
- `--json` gives an agent the answer alone; `--count` and `--sources`
  limit the results.

Both commands do their work in core's bot runner, which reaches SearXNG
by its address on the stack network (`SEARCH_URL`). The search page is
on port 42100. The tests drive both commands as `./stack` runs them,
against a made-up SearXNG answer and a stand-in model; `tests/live/`
checks a running SearXNG and skips without one.

It was the web stacklet of famstack's 0.5 integration branch, which
never shipped in a release.
`docs/testing.md` says what the extension lane is, what a test drives
and checks, how a command runs in a test, how to stand in for a
service and for the model, how to test a module and the containers,
what the fixtures give, and the pitfalls with what to do about each.

The README and AGENTS.md point at it, and the rule for tests says how
they run now.
famstack's own stacklets use the 42xxx ports, so an extension in that
range could take a port a family's stack already uses. famstack keeps
42100 to 42199 for extensions (ADR-007).

`script/check-manifests.py` reads an extension's `port`, its `[ports]`
and the host port of each binding in its `docker-compose.yml`, and
refuses one outside that range, and two extensions on one port. Web
uses 42100; hue publishes none.
famstack's extension lane runs the tests in parallel, one worker for
each core. The testing guide says so, and that `-n 0` runs them in one
process, for example to debug a test.
@arthware-dev
arthware-dev merged commit bb85c4c into main Oct 29, 2026
1 of 2 checks passed
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