Repository navigation
Description
Problem
No document settles three points about the pinned SearXNG, and nothing in the repository fails if a later digest bump changes one. (1) Which categories the kept engines answer in. (2) Whether a query that starts with ! gives a redirect or selects an engine that is off. (3) Whether the NetworkPolicy layer holds: a pod without the label cannot reach the service, and the SearXNG pod cannot reach a private ClusterIP, a node address or the metadata address. The researcher could not run the image on 2026-11-07, so none of this was run.
Expected
A live-marked test (it skips where the cluster or a port-forward is missing, as other live tests do) that sends requests to the service for: a plain query with format=json; a query with format=html if json is the only format allowed; a query that starts with ! and names an engine that the ConfigMap leaves off; and a request with a category that no kept engine serves. It checks the reply keys, that the redirect is not followed, and that unresponsive_engines is a list. A second part runs a throwaway pod with the label of searxng and one without it, and checks the connect results to the service, to a private ClusterIP and to the metadata address. The test file names the image digest it was written for.
Acceptance criteria
- The test fails when SearXNG starts with a keyed or suspended-prone engine (brave, braveapi, google, bing, startpage, mojeek, qwant) on, and passes on the pinned digest (run once by hand, cite the output in the PR comment).
- The test fails when
search.formatslacksjsonand passes with it. - The NetworkPolicy part: the pod without the label gets no connection to 8080; the pod with the label of
searxngcannot connect to a private ClusterIP or to the metadata address. - The test runs in the devcontainer and on the GitHub runner, or skips with a reason (owner rule of 2026-10-24: no host changes on runners).
- The PR comment lists the result per request and per target. No private host name or address appears in the file or the comment (use roles such as
<service-ip>).
Existing tool considered
The project's live-test marker and HTTP client; kubectl run for the throwaway pod. No new scanner.
Related
Same method as #3894 (live check of Crawl4AI). Depends on the SearXNG manifest item. Run it again at each digest bump. Related: #3877.
Part of the search provider plan of 2026-11-07 (SearXNG; the Brave Search API was dropped by the owner on 2026-11-07).
Proposed design
Problem statement
Nothing in the repository fails when a later SearXNG digest bump changes three points: the categories that the kept engines answer in, the result of a query that starts with ! and names an engine that the ConfigMap leaves off, and the NetworkPolicy peers of the service. The owner chose a devops k8s command over a live pytest on 2026-11-07. This item builds the devops k8s searxng-check command, shares the throwaway-pod and report code of the Crawl4AI check (#3894), and replaces the hand-made search reply fixture with a reply from the pinned digest.
Acceptance criteria
Requirement: Command shares the Crawl4AI code
The change SHALL add a devops k8s searxng-check command and SHALL reuse the throwaway-pod and report code of devops k8s crawl4ai-check (#3894).
Scenario: Shared helpers called
- WHEN A test patches the shared throwaway-pod and report helpers and runs the command.
- THEN The command calls the patched helpers and its module holds no second definition of them.
Requirement: JSON reply keys
The check SHALL send a plain query with format=json and SHALL assert the keys answers, corrections, infoboxes, query, results, suggestions and unresponsive_engines.
Scenario: A reply key is missing
- WHEN A fake reply leaves out one expected key.
- THEN The check reports a failure that names the missing key.
Requirement: Unresponsive engines list
The check SHALL assert that unresponsive_engines is a list.
Scenario: Unresponsive engines is a string
- WHEN A fake reply gives a string for
unresponsive_engines. - THEN The check reports a failure that names
unresponsive_engines.
Requirement: Bang query redirect
The check SHALL send a query that starts with ! and names an engine that the ConfigMap leaves off, and it MUST NOT follow a redirect.
Scenario: Redirect is not followed
- WHEN The fake service answers the
!query with a 302 status and aLocationheader. - THEN The check records the 302 status and sends no request to the
Locationaddress.
Requirement: Unused category request
The check SHALL send a request with a category that no kept engine serves and SHALL record the reply.
Scenario: Unused category reply
- WHEN The fake service answers the request for the unused category.
- THEN The report holds one line for that category with its status and its result count.
Requirement: Keyed and suspended-prone engines
The check SHALL fail when the SearXNG settings keep brave, braveapi, google, bing, startpage, mojeek or qwant on.
Scenario: A keyed engine is on
- WHEN The settings keep
googleon. - THEN The check reports a failure that names
google.
Requirement: JSON format is required
The check SHALL fail when search.formats lacks json.
Scenario: JSON format is absent
- WHEN The settings give
search.formatswithoutjson. - THEN The check reports a failure that names
search.formats.
Requirement: Kept engine categories
The check SHALL verify that the kept engines answer in general, it and science, and the change SHALL keep DEFAULT_SEARXNG_CATEGORIES equal to the categories that they answer in.
Scenario: A kept engine lacks a category
- WHEN A fake reply shows that no kept engine answers in
science. - THEN The check reports a failure that names
science.
Requirement: Unlabeled pod is blocked
The check SHALL run a throwaway pod without the searxng label and MUST assert that it gets no connection to port 8080.
Scenario: Unlabeled pod connects
- WHEN The unlabeled pod gets a connection to port 8080.
- THEN The check reports a failure for the unlabeled pod and the service target.
Requirement: Labeled pod egress is blocked
The check SHALL run a throwaway pod with the searxng label and MUST assert that it gets no connection to a private ClusterIP or to the metadata address.
Scenario: Labeled pod reaches the metadata address
- WHEN The labeled pod connects to the metadata address.
- THEN The check reports a failure for the labeled pod and the metadata target.
Requirement: Private values are masked
The check SHALL write each private host name and address as a role such as <service-ip>.
Scenario: Address is masked
- WHEN A fake result holds a private address.
- THEN The report shows the role token and not the address.
Requirement: Run or state a reason
The check SHALL run in the devcontainer and on the GitHub runner, or it SHALL exit with a stated reason and MUST NOT change the host.
Scenario: No cluster is reachable
- WHEN The command finds no kube context.
- THEN The command exits with a stated reason and makes no host change.
Requirement: Fixture from the pinned digest
The change SHALL replace tests/fixtures/searxng/search_reply.json with a reply saved from the pinned digest and SHALL name that digest in the test file.
Scenario: Fixture names the digest
- WHEN A test reads the fixture and the pinned digest.
- THEN The fixture holds the seven reply keys and the test file holds the same digest string.
Existing Tool Considered
No alternatives check has run. No open, maintained tool covers a live check of this cluster's SearXNG and its NetworkPolicy. The existing devops k8s crawl4ai-check (#3894) covers the throwaway-pod and report code. It lacks the SearXNG reply keys, the ! redirect rule, the category check and the NetworkPolicy peers. This item adds those targets and writes no second copy.
Key questions
- Should the live check be a live-marked pytest test or a
devops k8scommand?: Adevops k8s searxng-checkcommand in the shape ofdevops k8s crawl4ai-check(test(k8s): live check that Crawl4AI refuses internal URLs #3894). The owner chose the command on 2026-11-07. The test floor forbids a skip on host state. (best practice) [sources: docs/TESTING.md, AGENTS.md, tests/commands/k8s/test_k8s.py]- Rejected: Live-marked pytest test that skips without a cluster.
docs/TESTING.mdforbids a skip on host state, and the owner rejected it. - Chosen:
devops k8scommand that shares the Crawl4AI check code. The owner chose it, and it reuses the throwaway-pod and report code.
- Rejected: Live-marked pytest test that skips without a cluster.
- Which categories must the check verify, and what value must
DEFAULT_SEARXNG_CATEGORIEShold?:general,itandscience. The provider sends these three categories. The change updatesDEFAULT_SEARXNG_CATEGORIESwhen a kept engine does not answer in one. (best practice) [sources: src/devops_cli/config/defaults.py, src/devops_cli/ai/web_search.py, openspec/changes/archive/2026-11-07-3927-searxng-search-provider/design.md]- Rejected: Keep
generalonly. The provider already sends three categories. - Chosen:
general,it,science. The engine files of the kept engines at the pinned commit give these categories.
- Rejected: Keep
- Does this item replace the hand-made reply fixture, and how?: Yes. This item saves a reply from the pinned digest and replaces
tests/fixtures/searxng/search_reply.jsonwith it. The file names the digest. (best practice) [sources: tests/ai/test_web_search_searxng.py, src/devops_cli/ai/web_search.py]- Rejected: Keep the hand-made fixture. The provider PR kept it only because the manifest item was not merged.
- Chosen: Replace it with a saved live reply. The owner gave this item the fixture work on 2026-11-05.
- How does the check treat a query that starts with
!and names an engine that the ConfigMap leaves off?: The check sends the query and does not follow a redirect. It records the status and asserts thatunresponsive_enginesis a list. (best practice) [sources: src/devops_cli/ai/web_search.py, openspec/changes/archive/2026-11-07-3927-searxng-search-provider/design.md]- Rejected: Follow the redirect. A followed redirect hides whether the service selected the engine or refused it.
- Chosen: Record the status and do not follow. The result shows whether the service redirects or selects an off engine.
- Which NetworkPolicy peers does the check test?: A pod without the
searxnglabel must get no connection to port 8080. A pod with the label must reach the service. It must get no connection to a private ClusterIP or the metadata address. (best practice) [sources: tests/commands/k8s/test_k8s_network_policies.py, tests/invariants/test_k8s_searxng.py]- Rejected: Test only the labeled pod. The unlabeled pod proves that the policy selects the right pods.
- Chosen: Test both pods against all targets. This covers ingress and egress in one run.
- Which code must the SearXNG check share, and which item delivers it?: The throwaway-pod and report code of
devops k8s crawl4ai-check, which test(k8s): live check that Crawl4AI refuses internal URLs #3894 delivers. This item starts after test(k8s): live check that Crawl4AI refuses internal URLs #3894 merges. [sources: tests/commands/k8s/test_k8s.py, src/devops_cli/commands/k8s/stack_lifecycle.py] - Which reply keys does the SearXNG search API return?:
answers,corrections,infoboxes,query,results,suggestionsandunresponsive_engines. [sources: openspec/changes/archive/2026-11-07-3924-searxng-manifests/proposal.md, src/devops_cli/ai/web_search.py] - Which engines must the check keep off?:
brave,braveapi,google,bing,startpage,mojeekandqwant. [sources: tests/invariants/test_k8s_searxng.py, k8s/README.md] - How does the check report private host names and addresses?: The check writes each private host name and address as a role such as
<service-ip>. The file and the report hold no private value. (best practice) [sources: AGENTS.md, docs/CONFIGURATION.md]- Rejected: Write the real values. A private address in a public repository is a leak.
- Chosen: Mask each value as a role. The body requires roles and the project's masking rule agrees.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(k8s)scope of the title gives the scope.It verifies NetworkPolicy enforcement and service behaviour, but it depends on the manifest item that is not yet merged.It guards against silent digest bumps that weaken NetworkPolicy or change engine availability.It uses the existing live-test marker and HTTP client, but covers multiple request shapes and two pod-based NetworkPolicy checks.Both concern SearXNG in the cluster, but 3924 delivers the manifests and this candidate delivers a live test that verifies those manifests at runtime.dan-petty commentedon Nov 7, 2026
Answer from project standards, under the owner's instruction of 2026-11-05.
Question: who replaces the hand-made reply fixture of the SearXNG provider (#3927) with a real reply, and who checks its
categoriesvalue?Answer: this item. The provider PR (#3927) keeps a fixture that holds the shape of the SearXNG search API document (
docs/dev/search_api.rstat commit 629368e40), because the manifest item (#3924) is not merged and no live pod exists. The provider sendscategories=general,it,science, read from the engine files of the kept engines at the pinned commit. Add two criteria here: (1) save a reply from the pinned digest and replacetests/fixtures/searxng/search_reply.jsonwith it, citing the digest; (2) check that the kept engines answer in these categories, and changeDEFAULT_SEARXNG_CATEGORIESinsrc/devops_cli/config/defaults.pyif they do not.Rule: AGENTS.md rule 2 (record how the premise was checked, and what was not run) and the "Partial work" rule of the delivery brief (move a criterion whose work is separate).
dan-petty commentedon Nov 7, 2026
Answer from project standards, under the owner's instruction of 2026-11-07.
The owner chose a
devops k8scommand over a live pytest for cluster checks. The test floor fakes the network and the keyring, and it forbids a skip on host state (docs/TESTING.md). A live-marked test that skips where the cluster is missing therefore does not fit.This item should build a command in the same shape as the Crawl4AI check of #3894 (
devops k8s crawl4ai-check):!, the category check, and the NetworkPolicy peers (a pod without the label ofsearxng, a pod with it, a private ClusterIP and the metadata address).A manual check on 2026-11-07 already showed these results:
/searchwithformat=jsonand the 7 expected reply keys.searxng:8080.searxng:8080.The acceptance criteria of the issue body that name a live-marked test stay unchanged here. The command replaces the test when this item is built.
devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 768dbd3 (see proposed design in issue body).
devops-cli-service commentedon Nov 8, 2026
Released in v0.88.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.88.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 06:26 UTC