Skip to content

fix(cli): import extractor schema version scope - #1870

Merged
akijakya merged 2 commits into
mainfrom
fix/import-extractor-schema-version-scope
Jul 27, 2026
Merged

akijakya merged 2 commits into
mainfrom
fix/import-extractor-schema-version-scope

Conversation

@akijakya

@akijakya akijakya commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the extractor-enricher import path after the OASF 1.1.0 release and moves the import stack onto 1.1.0.

The 16_extractor_enricher e2e test began failing once OASF 1.1.0 was published: the import reported success (exit 0) but wrote no CIDs, so the test failed reading imported.cids.

Root cause

The extractor enricher classified records via sdk.Latest(), which follows the newest provisioned OASF taxonomy. Once 1.1.0 was provisioned, it assigned 1.1.0-only classes (e.g. skill 60701). But records were stamped schema_version: 1.0.0 (the transformer default). The server validates each record against the schema of its own schema_version ({schema_url}/api/{version}/validate/...), so the 1.1.0 classes were rejected against the 1.0.0 schema as id_unknown → 0 records imported. Because dirctl import still exits 0 when nothing imports, --output-cids silently wrote no file.

Changes

1. Scope the extractor to the record's declared schema version (fix(import))

  • extractor_adapter.go: replace sdk.Latest() with sdk.Versions(a.schemaVersion) so the extractor only assigns classes that exist in the version the record is stamped (and validated) with.
  • config.go: pass the effective schema version (o.SchemaVersion, or transformer.DefaultSchemaVersion when unset) into the adapter. o.SchemaVersion is reset at the top of loadConfig because it is not flag-backed and the e2e suite runs dirctl in-process, reusing the command's package-level options — without the reset a prior invocation's value leaks into later runs.

This keeps the extractor's taxonomy version and the record's schema_version aligned by construction, for any declared version, and won't drift again on the next OASF release.

2. Bump dir-importer to OASF 1.1.0 (chore(deps))

  • Pins dir-importer to agntcy/dir-importer#71, which sets DefaultSchemaVersion and the LLM enricher prompts to 1.1.0. Records now default to 1.1.0, consistent with the extractor scoping and the reference import.config.yaml.
  • Updates the 10_export static-enricher fixture to 1.1.0 taxonomy classes (software_engineering/code_quality/code_review, technology/artificial_intelligence/ai_agents), since the new default schema would otherwise reject its old 1.0.0 classes.

Note

dir-importer has no 1.1.0 release tag yet, so this pins the merged main commit via a pseudo-version. Swap it for the tagged release once published.

@akijakya akijakya self-assigned this Jul 22, 2026
@akijakya
akijakya requested a review from a team as a code owner July 22, 2026 11:47
@github-actions github-actions Bot added the size/XS Denotes a PR that changes 0-49 lines label Jul 22, 2026
@akijakya
akijakya force-pushed the fix/import-extractor-schema-version-scope branch from 63aec2d to a138f0e Compare July 23, 2026 09:23
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@akijakya
akijakya enabled auto-merge (squash) July 23, 2026 13:39
@akijakya
akijakya merged commit 04f673b into main Jul 27, 2026
32 checks passed
@akijakya
akijakya deleted the fix/import-extractor-schema-version-scope branch July 27, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-49 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants