Repository navigation
test(e2e): cover POST /v1/search parity and POST /v1/extract - #2120
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
akijakya
force-pushed
the
test/post-apis-e2e
branch
from
September 8, 2026 10:08
46e238c to
df3144b
Compare
akijakya
force-pushed
the
test/post-apis-e2e
branch
2 times, most recently
from
September 8, 2026 10:44
60e1ad5 to
24c87bf
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Local setup can inherit mismatched extractor settings, and taxonomy validation covers only top-ranked classes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds end-to-end coverage for extractor-backed gateway search and extraction across local, remote, and unavailable backends.
Changes:
- Tests ranking, pagination, CLI parity, taxonomy extraction, and validation.
- Adds extractor readiness and environment-mode configuration.
- Verifies graceful 503 behavior without an extractor.
File summaries
| File | Description |
|---|---|
tests/modules/Taskfile.setup-dir-node.yml |
Adds configurable extractor initialization. |
tests/e2e/local/testenv/local/test-config.yaml |
Declares local extractor mode. |
tests/e2e/local/testenv/local/Taskfile.testenv.yml |
Forces local extractor initialization. |
tests/e2e/local/testenv/kind/test-config.yaml |
Declares remote extractor mode. |
tests/e2e/local/local_suite_test.go |
Adds suite-level extractor readiness polling. |
tests/e2e/local/config/config.go |
Replaces the remote flag with extractor mode. |
tests/e2e/local/ai_finder_http_test.go |
Adds shared gateway HTTP helpers and models. |
tests/e2e/local/20_ai_finder_extract_test.go |
Tests extraction results and validation. |
tests/e2e/local/19_remote_extractor_test.go |
Migrates remote tests to extractor mode. |
tests/e2e/local/18_ai_finder_search_test.go |
Tests search ranking, pagination, and CLI parity. |
tests/e2e/local/15_nl_search_test.go |
Documents an existing skipped-test conflict. |
tests/e2e/local/13_ai_finder_test.go |
Reuses shared HTTP helpers. |
tests/e2e/daemon/testenv/default/test-config.yaml |
Enables no-extractor gateway coverage. |
tests/e2e/daemon/testenv/default/Taskfile.testenv.yml |
Skips unnecessary extractor provisioning. |
tests/e2e/daemon/testenv/default/dir-daemon-config.yaml |
Configures a gateway without extractor assets. |
tests/e2e/daemon/config/config.go |
Adds gateway and no-extractor settings. |
tests/e2e/daemon/02_no_extractor_test.go |
Tests degraded gateway behavior. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
akijakya
force-pushed
the
test/post-apis-e2e
branch
from
September 8, 2026 12:46
24c87bf to
b576d87
Compare
ramizpolic
approved these changes
Sep 9, 2026
Adds end-to-end coverage for the two extractor-backed gateway endpoints
against a real node. The handler unit tests drive a fake extractor, so
they cannot catch a gateway that resolved no backend, dialed the wrong
address, or ranks differently from `dirctl search`.
POST /v1/search (18_ai_finder_search_test.go):
- relevance-ranked entries for a free-text query, entries identified by
catalog URN, and a record matching no signal left out
- ranking by number of signals matched, asserted with two seeds that
share a description and differ only in carrying the extracted skill,
so the keyword surface is held equal
- stable ranking across repeated identical requests
- disjoint pages that reconstruct a prefix of the unpaged order, and no
continuation token on the last page
- parity with `dirctl search`, compared over the seeded records only:
the gateway restricts candidates to catalog-projectable records and
the CLI does not, so the shared ordering is the assertable contract
- empty and over-long queries rejected with 400
POST /v1/extract (20_ai_finder_extract_test.go):
- scored skills and domains with hierarchical names, OASF uids, and
descending score
- every returned class checked against the node's own OASF schema
endpoint by pushing a record carrying it, tried across the four
taxonomy versions the extractor draws from. One class per record: a
single response holds classes no one version accepts together, since
OASF renamed whole trees between 1.0.0 and 1.1.0, and for this phrase
the skills and the domains each straddle that boundary
- empty and over-long text rejected with 400
Both spec files run wherever the environment declares an extractor, so
the local backend is covered by local:local and the remote backend by the
Kind job #2118 added. The parity spec skips outside local mode, where the
CLI and the gateway load the same assets; under Kind the OASF-SDK Service
is ClusterIP-only and the CLI cannot reach the gateway's backend.
For the case with no extractor at all, daemon/default now enables the
gateway with its extractor asset dir pointed at a path that does not
exist. 02_no_extractor_test.go asserts both endpoints answer 503, that
GET /v1/agents still serves — so a 503 means the extractor is missing
rather than the gateway being down — and that an empty query is still a
400, pinning argument validation ahead of the extractor check.
Rebased onto #2118, which landed overlapping Kind coverage:
- collapses its remote_extractor_enabled boolean into extractor_mode
and updates the single call site in 19_remote_extractor_test.go. Two
fields for one fact let an environment set only one and have the
specs disagree about skipping, and the mode also has to tell "local"
apart from "no extractor", which a boolean cannot
- numbers the extract specs 20_ so #2118 keeps the 19_ slot
- the suite-level readiness gate added here also covers Kind, so its
specs no longer wait on a cold extractor pod one spec at a time
Also:
- setup-dir-node gains DIRCTL_INIT_ARGS, and local:local uses it to pin
the CLI to the extractor the daemon resolves. `dirctl init` fills
every extractor flag left unset from the machine-wide saved config —
asset dir, OASF URL and remote address alike — so on a machine
carrying custom saved values the CLI would load a different extractor
than the daemon uses, and both the readiness gate and the parity spec
depend on the two agreeing
- daemon/default skips extractor provisioning, dropping an 89 MB
download from three cross-platform runners that never used it
Signed-off-by: András Jáky <[email protected]>
akijakya
force-pushed
the
test/post-apis-e2e
branch
from
September 9, 2026 09:35
b576d87 to
fbfa81c
Compare
akijakya
enabled auto-merge (squash)
September 9, 2026 09:35
ramizpolic
approved these changes
Sep 9, 2026
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.
Adds end-to-end coverage for the two extractor-backed gateway endpoints against a real node. The handler unit tests drive a fake extractor, so they cannot catch a gateway that resolved no backend, dialed the wrong address, or ranks differently from
dirctl search.POST /v1/search—18_ai_finder_search_test.godirctl search, compared over the seeded records only. The two do not see the same record universe —recordSearcherrestricts candidates toKnownCatalogModuleNames()while the CLI'sclientSearcherdoes not — so the CLI legitimately returns extra non-projectable CIDs. Scoring is per-CID, so the relative order of the shared records is preserved, and that shared ordering is the assertable contract.POST /v1/extract—20_ai_finder_extract_test.goid_unknown/name_unknown), so this is a real assertion rather than a shape check. Class names are version-scoped —software_engineering/code_quality/code_reviewvalidates only under 1.1.0, itsnatural_language_processing/…predecessor only under 1.0.0 — andExtractTaxonomyRequestcarries no version, so the probe tries each of the four taxonomy versions the extractor draws from and requires one to accept. Only the top skill and domain are probed together: a single extraction mixes versions at lower ranks, but the best match in each list comes from the same taxonomy.Where each backend is covered
local:locallocal:kinddaemon:defaultBoth spec files run wherever the environment declares an extractor, so they exercise the local backend under
local:localand the remote one under the Kind job. The parity spec skips outside local mode: under Kind the OASF-SDK Service is ClusterIP-only and the CLI cannot reach the gateway's backend, so the two rankings are not comparable.An earlier revision of this PR added a third environment that reached a remote extractor through a plain
oasf-sdkcontainer, with no cluster. It was dropped: it duplicated the remote coverage the Kind job already provides, and the two backends were measured returning byte-identical scores, tiers and ids for the same query, so re-asserting the contract against a container added little.For the no-extractor case,
daemon/defaultnow enables the gateway with its extractor asset dir pointed at a path that does not exist.02_no_extractor_test.goasserts both endpoints answer 503 with the "no OASF extractor is configured" message, thatGET /v1/agentsstill serves — so a 503 means the extractor is missing rather than the gateway being down — and that an empty query is still a 400, pinning argument validation ahead of the extractor check.Rebase onto #2118
That PR landed overlapping Kind coverage while this was in review, and the resolution is not purely textual:
remote_extractor_enabledboolean intoextractor_mode, updating the single call site in19_remote_extractor_test.go. Two fields for one fact let an environment set only one and have the specs disagree about skipping, and the mode also has to tell "local" apart from "no extractor", which a boolean cannot.20_so test(e2e): cover the remote extractor in Kind #2118 keeps the19_slot.Also
setup-dir-nodegainsDIRCTL_INIT_ARGS, andlocal:localuses it to force the in-process backend for the CLI.dirctl initinherits the machine-wide saved remote address whenever the flag is left unset, which would otherwise leave the CLI dialing an OASF-SDK server while the daemon uses local assets — and the parity spec compares the two.daemon/defaultskips extractor provisioning, dropping an 89 MB download from three cross-platform runners that never used it.Two deviations from the issue
SearchAgentsnow rejects an empty extraction withInvalidArgument, perTestSearchAgents_EmptyExtractionIsRejected. The invalid-input specs assert the real contract. Driving that branch through a real extractor is not possible either — every non-empty text yields keyword signals — so it stays covered by the unit test.Verification
e2e:test:local:locale2e:test:daemon:defaulte2e:test:daemon:externaltask testtask linte2e:test:local:kindwas not run locally — it needs locally built images and the Kind toolchain. Its two new callers are the spec files here, which pass against the sameoasf-sdk:v1.3.0image underlocal:localand against a container during development of the dropped environment; CI runs the job on this PR.Noted, not fixed
15_nl_search_test.gogates on~/.agntcy/oasf-sdk/manifest.json, which is missing theextractorsubdirectoryextractor.DefaultAssetDirprovisions into, so that spec has always skipped — including in CI. Correcting the path makes it run and pushtestdata/directory-record.json, which then contends with14_skill_record_test.go: both use the record nameorg.agntcy/directory, that testdata carries a staleapplication/agentskill+mdartifact media type where the daemon now emitsapplication/agent-skills+md, and spec 14 resolves the name with--limit 1. Ginkgo randomises top-level containers, so the collision is order-dependent. Fixing it properly needs the testdata corrected and spec 14 taught to pick the record it means, so it is left alone here with a comment rather than half-done. The CLI free-text path is meanwhile covered by the parity spec.Closes #1909