Skip to content

feat(cli): provision the OASF extractor assets in dirctl init - #1756

Merged
akijakya merged 5 commits into
mainfrom
feat/dirctl-init
Jul 6, 2026
Merged

akijakya merged 5 commits into
mainfrom
feat/dirctl-init

Conversation

@akijakya

@akijakya akijakya commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Adds the OASF taxonomy extractor provisioning step of dirctl init (the first step of the onboarding wizard, #1705).

dirctl init now guides a one-time local setup of the extractor: it downloads and caches the all-MiniLM-L6-v2 model + the OASF taxonomy to ~/.agntcy/oasf-sdk/extractor (in-process, pure-Go — no LLM/Python/API), records the chosen OASF URL / asset dir in the dirctl config so dirctl import enrichment and future free-text search can load the assets in-process, and verifies an extraction round-trip. Re-running is idempotent; --remove tears it down.

What's in it

  • cli/internal/extractor — reusable engine (Provision / SmokeCheck / Teardown / IsProvisioned, config defaults + validation) that the feat(cli): dirctl init — add the "Directory MCP server & skills" step to the onboarding wizard #1705 wizard and future import/search consumers share.
  • client/config — machine-wide extractor: section + load/save/clear helpers.
  • cli/cmd/init — the dirctl init command with --oasf-url / --asset-dir / --yes / --remove, a minimal confirm + URL prompt, and a non-TTY fallback.
  • Wizard UX — welcome + step explanation, a spinner with phase text, and raw provisioning logs hidden unless a step fails.

Bumps the oasf-sdk pin to the version shipping pkg/extractor (pulls in the pure-Go cybertron/spago transformer). Offline unit tests cover every filesystem/config/prompt seam; the real model round-trip is a build-tag-gated integration test.

Closes #1743

@akijakya akijakya self-assigned this Jul 6, 2026
@akijakya
akijakya requested a review from a team as a code owner July 6, 2026 08:16
@github-actions github-actions Bot added the size/L Denotes a PR that changes 1000-1999 lines label Jul 6, 2026
@akijakya
akijakya force-pushed the feat/dirctl-init branch from 18aeb7e to 7af9807 Compare July 6, 2026 08:16

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 the OASF taxonomy extractor provisioning flow to dirctl init, including a reusable provisioning engine, persisted machine-wide config, progress UX, and tests to cover the non-network seams. This aligns with the onboarding wizard scope in #1705/#1743 by making extractor asset setup a first-run step and persisting the chosen asset location + OASF endpoint for later consumers.

Changes:

  • Introduces cli/internal/extractor to provision/smoke-check/teardown extractor assets with dirctl defaults and validation.
  • Extends client/config with a machine-wide extractor: section plus load/save/clear helpers and tests.
  • Implements dirctl init (extractor step) with prompts, --yes/--remove, spinner-based progress, and unit tests; bumps oasf-sdk pin and related deps.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/go.sum Updates dependency checksums for test module after SDK/dependency bump.
tests/go.mod Adds/updates indirect dependencies required by the new SDK pin in tests.
client/config/config.go Adds persisted machine-wide extractor section + helpers (load/save/clear).
client/config/config_test.go Adds tests for extractor config round-trip and context preservation.
cli/internal/extractor/provision.go Wraps oasf-sdk extractor provisioning and smoke-check with dirctl defaults/errors.
cli/internal/extractor/provision_integration_test.go Build-tag-gated integration test for real provisioning + smoke check.
cli/internal/extractor/config.go Defines extractor defaults (OASF URL, asset dir) and validation.
cli/internal/extractor/config_test.go Unit tests for default resolution and URL validation.
cli/internal/extractor/assets.go Adds provisioned-state detection and teardown safety guards.
cli/internal/extractor/assets_test.go Unit tests for provisioned detection and teardown behavior.
cli/go.sum Updates CLI module dependency checksums after adding init/extractor deps.
cli/go.mod Bumps oasf-sdk pin and adds direct deps for init spinner/term/logging.
cli/cmd/root.go Registers the new dirctl init command and skips client setup for it.
cli/cmd/init/run.go Implements init provision/remove flows, config persistence, and prompts.
cli/cmd/init/run_test.go Unit tests for prompt handling and provision/remove behavior with saved config.
cli/cmd/init/progress.go Adds spinner UI and captures noisy logs during provisioning.
cli/cmd/init/progress_test.go Tests phase detection and log-capture wrapper behavior.
cli/cmd/init/options.go Adds flags for dirctl init (--oasf-url, --asset-dir, --yes, --remove).
cli/cmd/init/init.go Defines the dirctl init cobra command and confirm prompt helper.
cli/cmd/init/init_test.go Unit test coverage for confirm prompt behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/cmd/init/progress.go Resolved
Comment thread cli/cmd/init/run.go Resolved
Comment thread client/config/config.go Resolved
Comment thread cli/internal/extractor/assets.go Resolved
Comment thread cli/internal/extractor/assets.go Resolved
@codecov

codecov Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@akijakya
akijakya force-pushed the feat/dirctl-init branch from 065cb57 to fc29bef Compare July 6, 2026 09:36
@github-actions

github-actions Bot commented Jul 6, 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✅ passedJul 6, 2026, 2:46 PM

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

Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.

Comment thread cli/cmd/init/run.go Resolved
Comment thread cli/internal/extractor/config.go Resolved
Comment thread cli/cmd/init/progress.go Resolved
Comment thread cli/cmd/init/run.go Resolved
@akijakya
akijakya force-pushed the feat/dirctl-init branch from e430b4e to dbc8a92 Compare July 6, 2026 13:55
@akijakya
akijakya enabled auto-merge (squash) July 6, 2026 14:16
@akijakya
akijakya force-pushed the feat/dirctl-init branch from dbc8a92 to ae02d7f Compare July 6, 2026 14:46
@akijakya
akijakya merged commit afe662d into main Jul 6, 2026
34 checks passed
@akijakya
akijakya deleted the feat/dirctl-init branch July 6, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 1000-1999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): provision the OASF extractor assets in dirctl init

3 participants