Skip to content

[Feature]: Default the OASF extractor to two score tiers platform-wide #2003

Closed

Description

@akijakya

Problem Statement

The OASF extractor groups its matches into score tiers — tier 1 is the closest group of matches, tier 2 the next closest, and so on. The SDK returns one tier by default, and dir inherits that everywhere the extractor is used: import enrichment, dirctl search, routing search, and (soon) the extractor-backed endpoints.

One tier is too narrow in practice. A query like "cloud computing" returns nothing against a node that holds four records tagged with cloud-related skills, because the single closest group misses classes that are obviously relevant to the phrase. The taxonomy is hierarchical and densely populated, so the gap between the closest group and the next is often not meaningful.

Proposed Solution

Introduce a platform-wide default of two tiers, applied consistently by every backend and consumer:

// DefaultTiers is the number of score tiers the extractor returns per kind when
// a caller does not set ExtractOptions.Tiers.
const DefaultTiers = 2
  • ExtractOptions.Tiers unset (0) resolves to DefaultTiers in both the local and remote backends, so the two stay in lockstep
  • nlsearch.Decompose applies the same ceiling when filtering signals, so it cannot disagree with what the backend returned
  • Callers can still narrow (Tiers: 1) or widen per call

An implementation already exists on the feat/api-post-search branch (commit eaf84c6a) and can be lifted directly.

Why this is its own issue

It is a small diff with cross-cutting behavioral reach — it changes what dirctl import writes into records, what dirctl search and routing search match, and what the extractor-backed endpoints return. It deserves its own review and its own revert point rather than riding along inside an endpoint PR.

It also unblocks #2001, whose description already assumes extractor.DefaultTiers exists.

Decided

One default everywhere: tier 2. Import enrichment, dirctl search, routing search, and the extractor-backed endpoints all use DefaultTiers = 2. A single platform-wide constant was chosen over splitting import from search, so behaviour stays predictable and there is one number to reason about.

Noted for later, not blocking: enrichment persists the classes it assigns into records, so correcting them means re-importing, whereas a loose search match costs nothing. If tier 2 turns out to be noisy for enrichment specifically, revisit splitting the two rather than lowering it everywhere.

Still open (non-blocking):

  • Constant or configurable? A const is the simplest thing that works. Server config would be the place if operators should tune recall per deployment.
  • Is 2 the right number? Chosen from one observed failure (tier 1 returning nothing for a plainly relevant query), not from measurement. The spot-check below is the first real evidence either way.

Acceptance criteria

  • extractor.DefaultTiers applied consistently by the local and remote backends and by nlsearch.Decompose
  • Callers can override per call in both directions
  • Unit tests covering the default, an explicit narrowing override, and backend/decompose agreement
  • Spot-check on a seeded node that previously-empty descriptive queries return sensible matches, and that tier-2 results are not obviously noisy

Activity

  1. added
    kind/feature
    on Aug 10, 2026
  2. self-assigned this
    on Aug 11, 2026
  3. removed
    good first issue
    on Aug 11, 2026
  4. added a commit that references this issue on Aug 11, 2026
    ef6ada5
  5. moved this from Backlog to Pending review in Discoveryon Aug 11, 2026
  6. moved this from Pending review to Done in Discoveryon Aug 11, 2026
  7. added a commit that references this issue on Aug 11, 2026
    71fe81b
  8. added this to the DIR v1.7 milestone on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/dir/serverkind/feature

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions