Skip to content

test(e2e): cover the remote extractor in Kind - #2118

Merged
ramizpolic merged 2 commits into
agntcy:mainfrom
conorbronsdon:conorbronsdon/issue-2091-remote-extractor-e2e
Sep 8, 2026
Merged

ramizpolic merged 2 commits into
agntcy:mainfrom
conorbronsdon:conorbronsdon/issue-2091-remote-extractor-e2e

Conversation

@conorbronsdon

Copy link
Copy Markdown
Member

Adds a Kind job to the e2e matrix and exercises the deployed HTTP gateway's /v1/extract and /v1/search endpoints without restoring or provisioning extractor assets on the runner. The tests publish a local fixture, check relevant extracted taxonomy, and require natural-language search to return that fixture's exact CID.

The job installs the pinned Kind/Kubectl tools and locked Helm dependencies. Extraction has a bounded startup wait; a persistently wrong remote address or unregistered extractor service fails the test. The Kind naming fixture uses its fully qualified Service hostname so the existing naming tests can run in the newly enabled job.

Closes #2091.

Validation:

  • Full local suite against Kind, with a fresh non-root runner and no host SDK assets: 220 passed, 0 failed, 4 existing skips.
  • Wrong remote address: extraction test fails with HTTP 503 after its bounded retry window.
  • Empty OASF_SDK_EXTRACTOR_OASF_URL: pod passes readiness, but the test fails; apiserver logs confirm unknown service agntcy.oasfsdk.extractor.v1.ExtractorService. Restoring configuration returns both new tests to green.
  • Go test compilation, pinned golangci-lint 2.13.2, and git diff --check pass.

Local deployment validation reused server images from #2117's successful CI build (its changes are UI-only). This PR's CI builds its own revision.

Implemented with Codex assistance and independent model review.

@github-actions github-actions Bot added the size/S Denotes a PR that changes 50-199 lines label Sep 8, 2026
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@conorbronsdon
conorbronsdon marked this pull request as ready for review September 8, 2026 04:39
@conorbronsdon
conorbronsdon requested a review from a team as a code owner September 8, 2026 04:39

@ramizpolic ramizpolic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @conorbronsdon!

@ramizpolic
ramizpolic merged commit ef065fc into agntcy:main Sep 8, 2026
33 checks passed
akijakya added a commit that referenced this pull request Sep 8, 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
  - returned classes checked against the node's own OASF schema endpoint
    by pushing a record built from them, tried across the four taxonomy
    versions the extractor draws from
  - 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
    force the in-process backend for the CLI. `dirctl init` inherits the
    machine-wide saved remote address whenever the flag is 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/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 added a commit that referenced this pull request Sep 8, 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
  - returned classes checked against the node's own OASF schema endpoint
    by pushing a record built from them, tried across the four taxonomy
    versions the extractor draws from
  - 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
    force the in-process backend for the CLI. `dirctl init` inherits the
    machine-wide saved remote address whenever the flag is 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/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 added a commit that referenced this pull request Sep 8, 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
  - returned classes checked against the node's own OASF schema endpoint
    by pushing a record built from them, tried across the four taxonomy
    versions the extractor draws from
  - 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
    force the in-process backend for the CLI. `dirctl init` inherits the
    machine-wide saved remote address whenever the flag is 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/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 added a commit that referenced this pull request Sep 8, 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 added a commit that referenced this pull request 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 added a commit that referenced this pull request 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 50-199 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Kind e2e coverage for the remote OASF extractor backend

2 participants