Repository navigation
feat(catalog): add POST /v1/extract for OASF taxonomy extraction - #2023
Merged
Merged
Conversation
Signed-off-by: András Jáky <[email protected]>
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds POST /v1/extract, exposing OASF taxonomy extraction through the AI Catalog gateway.
Changes:
- Defines the extraction RPC and HTTP route.
- Maps extractor skills, domains, keywords, scores, and tiers.
- Adds handler tests and generated API bindings.
Reviewed changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
server/controller/ai_finder.go |
Documents extractor injection behavior. |
server/controller/ai_finder_extract.go |
Implements extraction and response mapping. |
server/controller/ai_finder_extract_test.go |
Tests mapping, validation, and failures. |
proto/agntcy/dir/catalog/v1/ai_finder_service.proto |
Defines the extraction API contract. |
api/catalog/v1/ai_finder_service.pb.gw.go |
Adds generated HTTP gateway bindings. |
api/catalog/v1/ai_finder_service.pb.go |
Adds generated protobuf messages. |
api/catalog/v1/ai_finder_service_grpc.pb.go |
Adds generated gRPC bindings. |
Files not reviewed (3)
- api/catalog/v1/ai_finder_service.pb.go: Generated file
- api/catalog/v1/ai_finder_service.pb.gw.go: Generated file
- api/catalog/v1/ai_finder_service_grpc.pb.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: András Jáky <[email protected]>
tkircsi
approved these changes
Aug 14, 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.
Summary
Adds
POST /v1/extractto the AI Catalog gateway: free text in, the OASF skills and domains that text is closest to out, with the scores and tiers that ranked them.Filtering the catalog by tags today assumes you already know the taxonomy. The tag filter bar matches tag names as substrings, so someone describing what they want — "analyzing customer support tickets" — finds nothing, because no tag is literally named that. The OASF extractor already solves this; it just wasn't reachable from the browser.
Against a local node with the in-process extractor:
One commit, no behavior change to any existing surface. The handler reuses the extractor the gateway already resolves (#2002) — no new config, no new dependency, and nothing to turn on beyond what
/v1/searchwill need anyway.This is a passthrough, not a recommender
It returns what the extractor says and stops there. It does not search, does not rank records, and does not check whether any record in this registry actually carries a returned class. Consumers that need the suggestions to be actionable — #1908 is the first — should intersect against
GET /v1/tags.That boundary is what keeps the endpoint cheap to reason about: it has exactly one dependency and one failure mode.
Reviewing the tier numbers
The sample above contains a tier 5 and a tier 9 entry even though the handler asks for
extractor.DefaultTiers(2). This looks like the tier ceiling is not being applied. It is — those entries come from somewhere else.The SDK's
selectCoveredrunsselectByTiers, which honors the ceiling, and thenensureVersionCoverage, which tops the list up until every in-scope taxonomy version has at least one covering entry. Its own comment says the top-up "may push the result past the selected tiers on purpose", so version-exclusive classes stay discoverable. The top-ups keep their true tier number.A local asset dir provisioned from
schema.oasf.outshift.comcovers 0.7.0, 0.8.0, 1.0.0 and 1.1.0, so there is room for a few of them. ReadingScoredClass.Versionsmakes it obvious: when the tier 1–2 skills are all[1.1.0], the tier-5 entry is the one class covering[0.7.0 0.8.0 1.0.0]. Pinning the extractor to a single version makes them disappear entirely.Two things that make the numbers look worse than they are: a tier boundary is a 3% relative score drop (
defaultTierRatio = 0.97), so tier 9 is nine small steps rather than nine categories; and tiers are per-kind, so a skill tier and a domain tier are not comparable.This is left as-is. Returning
tieris what lets a consumer threshold, and dropping the top-ups here would be the endpoint editing the extractor's answer — the one thing it is supposed not to do. Note thatnlsearch.Decomposedoes filterTier <= maxTier, sodirctl searchandPOST /v1/searchnever see these entries while this endpoint does. That asymmetry is deliberate: search has to commit to a candidate set, this endpoint hands the decision to the caller.Deliberate choices
ExtractTaxonomy{Request,Response}, notExtract{Request,Response}as [Feature]: Backend POST /v1/extract — expose OASF extractor output for tag recommendation #2001 sketched.RPC_REQUEST_STANDARD_NAMEis not inbuf.yaml's ignore list for this file, so the shorter name failsbuf lint.idandtierareuint32. protojson serializes 64-bit integer fields as JSON strings; the consumer is a browser, so a 32-bit field keeps them numbers. OASF uids are small enough that nothing is lost.POST /v1/search, which rejects a query it cannot decompose. There, zero results cannot distinguish "nothing matches" from "the query was not understood", and rephrasing fixes only the second. Here the extractor's own output is the answer, so "nothing close enough" is information rather than a dead end.max_len: 1024is not applied at runtime; enforced in code asListAgentsdoes withfilterMaxLen, and checked before trimming so padding cannot smuggle a longer payload past it.503when no extractor is configured, with a message naming the cause, so the UI can hide the feature rather than surface an error. Extractor failures return503too, with the backend detail left in the logs rather than the response.Testing
task lint— 0 issues across Go, Helm and buf;task test— no failuresServeMux, confirmingid/tieremit as numbers,400for whitespace-only text, and503with no extractor wireddirctl daemonon:8889with the in-process extractor backendNot covered: extraction quality. The tests pin the mapping and the error paths, not whether the taxonomy matches are good.
Relationship to #2005
Based on
main, deliberately not stacked on #2005 (POST /v1/search). The handler needs only theextfield that #2002 already wired, and nothing from the search fan-out, so the two can merge in either order.Whichever lands second needs a small manual rebase: both branches append to the same proto service block, both rewrite the
extfield and theWithExtractordoc comment inai_finder.go, and both define afakeExtractorin the same test package.Closes #2001