← Back to Pull requests

internal: Add label filter and display to arctl get #638

Closed
unknown closed this pull request without merging on Aug 25, 2026 19:43 UTC
View on GitHub
unknown unknown commented on Aug 25, 2026 19:03 UTC
Author

Description

arctl get had no way to filter or display resource labels, even though
content-registry kinds (agents, mcps, skills, prompts, plugins, models)
already carry a queryable labels map on their metadata.

This adds two flags:

  • -l/--labels: filters list output by comma-separated key=value pairs,

  • forwarded through scheme.ListOpts into the existing
    client.ListOpts.Labels query param. It's restricted to content kinds
    (those with ListTags set) and to list mode, mirroring the existing
    --tag/--latest guards. It's rejected under get all for now since
    that command builds a fresh ListOpts per kind and mixes in kinds that
    don't support the filter at all — extending it there is a natural
    follow-up.
  • --show-labels: a kubectl-style flag that appends a trailing LABELS

  • column to table output with each row's sorted key=value pairs (or
    <none>). It reads metadata directly off the v1alpha1.Object
    interface, so it works uniformly across every registered kind without
    touching per-kind RowFunc implementations.

    Change Type

    /kind feature

    Changelog

    ``release-note
    Add
    -l/--labels and --show-labels flags to arctl get for filtering and
    displaying resource labels.
    `

    Additional Notes

    Follow-ups intentionally left out of this PR:

  • arctl get all -l <label> selection support. runGetAll currently builds

  • a fresh
    ListOpts per kind itself rather than threading the caller's
    flags through, and mixes in non-content kinds that don't support the
    filter at all — extending it needs a small refactor of that dispatch path.
  • arctl delete -l <label> (bulk delete by label selector). delete has no

  • list mode today — it requires an explicit
    TYPE NAME or -f FILE — so
    this would be a new list-then-delete flow with its own safety
    considerations (partial-failure handling, possibly a confirmation or
    --dry-run), not a small addition.
  • Revisiting whether --all-tags should be reworked or removed, possibly in

  • the same pass as the
    get all -l refactor above.
  • Label selection intentionally stays simple key=value equality matching,

  • not kubectl's fuller
    --selector expression language (set-based
    in/notin/exists operators). The current v1alpha1 metadata envelope
    doesn't need that expressiveness yet.
  • internal/cli/declarative` could use some general cleanup/TLC independent

  • of this change.

    Diff: 300 lines (+225 / -75) across 3 files Reviewer: lcopi Review duration: 40m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 300 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #638"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.1% (MEDIUM) · Higher = larger blast radius
    40.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.8% · Safe to merge
    15.8%