Skip to content

feat(dir): add extractor to import-records workflow - #2015

Merged
csirmazbendeguz merged 1 commit into
mainfrom
feat/import-records-extractor
Aug 14, 2026
Merged

csirmazbendeguz merged 1 commit into
mainfrom
feat/import-records-extractor

Conversation

@csirmazbendeguz

@csirmazbendeguz csirmazbendeguz commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

NB: this will make extractor the default in the import workflow

@github-actions github-actions Bot added the size/S Denotes a PR that changes 50-199 lines label Aug 12, 2026
@csirmazbendeguz
csirmazbendeguz marked this pull request as ready for review August 12, 2026 14:49
@csirmazbendeguz
csirmazbendeguz requested a review from a team as a code owner August 12, 2026 14:49
@csirmazbendeguz
csirmazbendeguz force-pushed the feat/import-records-extractor branch from 3e7ed9e to 20e011b Compare August 12, 2026 14:50
@csirmazbendeguz
csirmazbendeguz force-pushed the feat/import-records-extractor branch from 20e011b to 96eb484 Compare August 12, 2026 14:55
@akijakya

Copy link
Copy Markdown
Member

The caching is worth it for the model weights (~89 MB, never change), but the static key is the problem when a new OASF version ships.

sdk.Provision is documented as idempotent — it "skips the model load and re-embed when the on-disk assets already match the endpoint and taxonomy," implying it contacts the schema server to check. So:

  1. Cache hit with old assets → dirctl init runs → SDK detects new OASF version → re-provisions (re-embeds taxonomy) → ✅ correct output this run.
  2. BUT actions/cache v5 does not save on a cache hit by default. The key oasf-extractor-linux-v1 already exists → updated assets are never written back to cache.
  3. Next run: same stale cache hit → same re-provision from scratch → same no-save. Every run after a schema change pays the full re-embed cost, defeating the cache.

Secondary concern: IsProvisioned only checks for manifest.json existence — it doesn't validate the schema version embedded in assets. So if the SDK's staleness check isn't actually contacting the server, stale taxonomy could silently persist for the lifetime of the cache entry.

Suggested fix: use a run-unique primary key with a prefix-based restore-keys fallback so you always restore the latest warm cache and always save fresh assets:

- name: Cache OASF extractor assets
  uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25
  with:
    path: ~/.agntcy/oasf-sdk/extractor
    key: oasf-extractor-${{ runner.os }}-${{ github.run_id }}
    restore-keys: |
      oasf-extractor-${{ runner.os }}-

Cache miss on the exact key (always), but restore-keys gives a warm start from the previous run's save, and the post-step saves whatever dirctl init left on disk — including any re-provision triggered by a new schema. Each run's entry expires via GitHub's 7-day LRU. Cost: one cache entry per run instead of one forever, but you stay current automatically.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds local OASF extractor enrichment as the default import-records workflow backend.

Changes:

  • Adds selectable extractor/LLM enrichment.
  • Provisions and caches extractor assets for both import jobs.
  • Reports enrichment mode and tests missing extractor assets.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/import-records.yaml Configures extractor-backed imports.
.github/workflows/scripts/import-records-summary.sh Reports the selected enrichment backend.
cli/cmd/import/config_test.go Tests missing extractor asset validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/import-records.yaml Outdated
Comment on lines +408 to +424
- name: Cache OASF extractor assets
if: ${{ env.ENRICHMENT == 'extractor' }}
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: ~/.agntcy/oasf-sdk/extractor
key: oasf-extractor-${{ runner.os }}-v1

- name: Provision OASF extractor
if: ${{ env.ENRICHMENT == 'extractor' }}
run: |
set -euo pipefail
EXTRACTOR_ASSET_DIR="${HOME}/.agntcy/oasf-sdk/extractor"
echo "Provisioning OASF extractor assets to ${EXTRACTOR_ASSET_DIR}"
dirctl init --yes \
--oasf-url https://schema.oasf.outshift.com \
--asset-dir "${EXTRACTOR_ASSET_DIR}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CAn we make an GH action for this and re-use?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good idea

@csirmazbendeguz

csirmazbendeguz commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @akijakya ! I think, let's just not worry about caching then. We don't run this job often anyway.

@csirmazbendeguz
csirmazbendeguz force-pushed the feat/import-records-extractor branch 2 times, most recently from 9f7c197 to 637efcd Compare August 13, 2026 08:57
@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedAug 14, 2026, 11:59 AM

@csirmazbendeguz
csirmazbendeguz force-pushed the feat/import-records-extractor branch from 637efcd to dc92d01 Compare August 14, 2026 10:22
@csirmazbendeguz
csirmazbendeguz force-pushed the feat/import-records-extractor branch from dc92d01 to deb3767 Compare August 14, 2026 11:58
@csirmazbendeguz
csirmazbendeguz merged commit e41e34d into main Aug 14, 2026
37 of 92 checks passed
@csirmazbendeguz
csirmazbendeguz deleted the feat/import-records-extractor branch August 14, 2026 12:34
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.

feat(dirctl): Extractor-based enrichment for 'dirctl import' + adopt in import-records workflow

4 participants