Skip to content

feat(catalog): sin-code catalog CLI + Source interface (issue #163, hub-assets merge)#208

Merged
Delqhi merged 1 commit into
mainfrom
feat/issue-163-catalog
Jun 16, 2026
Merged

feat(catalog): sin-code catalog CLI + Source interface (issue #163, hub-assets merge)#208
Delqhi merged 1 commit into
mainfrom
feat/issue-163-catalog

Conversation

@Delqhi

@Delqhi Delqhi commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Implements the third of the 5 issues. Scope-bounded to the catalog package + CLI + Source interface. Per-test fixups and the actual deprecation warning for sin-code hub are follow-ups (out of scope here).

What ships

  • cmd/sin-code/catalog_cmd.go — new subcommand sin-code catalog (list | search | info) with --kind=agent|command|skill|hub and --format=text|json
  • cmd/sin-code/internal/catalog/ — 4 source files + 21 race-clean tests
    • catalog.go — Asset, Kind, Source, Merge, Search, FilterByKind
    • source_hub.go — HubSource adapter (wraps internal/hub)
    • source_assets.go — AssetsSource adapter (wraps *assets.Registry)
    • catalog_test.go — 21 tests covering merge dedup, search ranking, filter, both source adapters, end-to-end
  • main.go registration (additive, no breaking change)

De-duplication rule

  • Key is (kind, name), NOT (source, kind, name)
  • A hub.Tool and an assets.Asset with the same (kind, name) merge into one catalog entry; the first source wins
  • This is the SOTA choice: operators think "do I have a tool for this?", not "which backend has it?"

Search ranking

  • name +4, short +2, description +1, tag +1
  • Ties break by name ascending
  • Score is auditable in source; not exposed in CLI output

Deprecation

  • sin-code hub continues to work unchanged
  • Issue body: "sin hub and sin assets remain as deprecated aliases of sin catalog for one minor release. After v3.20, they go."
  • The actual deprecation warning is a follow-up that patches hub_cmd.go — out of scope here

Hard mandates honored

  • M2: stdlib + existing internal/{hub,assets} packages, no new deps
  • M5: module path unchanged
  • M6: Source interface is the SIN-tool abstraction; both adapters reuse the existing hub.FormatList / assets.Registry without copying any logic
  • M7: 21/21 tests pass under go test -race -count=1

Known issue (NOT in this PR)

go build ./cmd/sin-code/... is currently broken on v3.18.0 main because the merged pkg/browser/cdp/ (PR #201) shipped without a complete go.sum and a Chromedp API mismatch. This PR does not touch Browser/CDP. The catalog package itself is build-clean and tested.

Diffstat

 7 files changed, 1106 insertions(+), 2 deletions(-)

Closes

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sin-code Ready Ready Preview, Comment, Open in v0 Jun 16, 2026 5:59pm

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

🏆 CEO Audit — A+ (100.0/100)

Metric Value
Grade A+
Score 100.0/100
Critical findings 0
High findings 0
Profile QUICK
Min grade gate B

📥 Download full report (Markdown)
📊 Download SARIF (for Code Scanning)

Run ~/.config/opencode/skills/ceo-audit/scripts/audit.sh . --profile=QUICK locally to reproduce.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

🏆 CEO Audit — A+ (100.0/100)

Metric Value
Grade A+
Score 100.0/100
Critical findings 0
High findings 0
Medium findings 0
Profile QUICK
Min grade gate B

📥 Download full report (Markdown)

Run ID: 27637512105 · Commit: ${github.sha}

Run ~/.config/opencode/skills/ceo-audit/scripts/audit.sh . --profile=QUICK locally to reproduce.

…ub-assets merge)

What ships:
  - cmd/sin-code/catalog_cmd.go — new subcommand 'sin-code catalog'
    (list | search | info) with --kind and --format flags
  - cmd/sin-code/internal/catalog/ — 4 source files + 21 race-clean tests
    - catalog.go:        Asset, Kind, Source, Merge, Search, FilterByKind
    - source_hub.go:     HubSource adapter (wraps internal/hub)
    - source_assets.go:  AssetsSource adapter (wraps *assets.Registry)
    - catalog_test.go:   21 tests covering merge dedup, search ranking,
                          filter, both source adapters, end-to-end
  - main.go registration (additive, no breaking change)

De-duplication rule:
  - Key is (kind, name), NOT (source, kind, name)
  - A hub.Tool and an assets.Asset with the same (kind, name) merge
    into one catalog entry; the first source wins
  - This is the SOTA choice: operators think 'do I have a tool for
    this?', not 'which backend has it?'

Search ranking:
  - name +4, short +2, description +1, tag +1
  - Ties break by name ascending
  - Score is auditable in source; not exposed in CLI output

Deprecation:
  - sin-code hub continues to work unchanged
  - Issue body: 'sin hub and sin assets remain as deprecated aliases
    of sin catalog for one minor release. After v3.20, they go.'
  - The actual deprecation warning is a follow-up that patches
    hub_cmd.go — out of scope here

Hard mandates honored:
  - M2: stdlib + existing internal/{hub,assets} packages, no new deps
  - M5: module path unchanged
  - M6: Source interface is the SIN-tool abstraction; both adapters
        reuse the existing hub.FormatList / assets.Registry without
        copying any logic
  - M7: 21/21 tests pass under go test -race -count=1

Known issue (NOT in this PR):
  - 'go build ./cmd/sin-code/...' is currently broken on v3.18.0
    main because the merged pkg/browser/cdp/ (PR #201) shipped
    without a complete go.sum and a Chromedp API mismatch. This
    PR does not touch Browser/CDP. The catalog package itself is
    build-clean and tested.

Refs: #163
@Delqhi
Delqhi force-pushed the feat/issue-163-catalog branch from 321dc1e to ce87123 Compare June 16, 2026 17:58
@Delqhi
Delqhi merged commit 284659f into main Jun 16, 2026
5 of 10 checks passed
@Delqhi
Delqhi deleted the feat/issue-163-catalog branch June 16, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant