Skip to content

Move Skills and skill versions out of store into skills and skillpg - #322

Merged
SaladDay merged 1 commit into
mainfrom
refactor/skills-domain
Sep 30, 2026
Merged

SaladDay merged 1 commit into
mainfrom
refactor/skills-domain

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1 (store layering), PR 8: Skills and skill versions move out of store.

  • skills domain package:
    • Skill/Version vocabulary and upload rules
    • A Service for create, create version, set default, delete Skill and delete version
    • Version deletion runs as Load → pure DecideVersionDeletion → Apply, inside one locked transaction
    • Storage/Reader ports; content and version parsing
  • persistence/postgres/skillpg: the PostgreSQL adapter. It seals archives with the credential key, and it records write audits in the same transaction via auditpg.
  • api: Skills (service) and SkillsReader (adapter) Dependencies fields, strict fakes, and the skills error writer. writeStoreError no longer has any Skills or Files branches.
  • cmd/server: wires skillpg and skills.NewService.
  • Deleted from store: the Skill CRUD, versions and listing files and their tests. Coverage moved to skills/skillpg. store/write_audit_resources_test.go had no cases left, so it is deleted too.
  • Stays in store until the Session PRs: freezing Skill references into a Session snapshot.

Behaviour change: Skill upload and content reads without a credential key now return 503 credential_storage_unavailable instead of 500.

Checks on the final head (42aedb6 + 1):

  • go build ./... and go vet ./services/core/... across the whole module
  • skills, skillpg, environmentconfig, api and cmd/server in full
  • sandbox/providers: the configuration flow test
  • store: -run only (Skill reference freezing, version deletion, cursor/path ID, audit and official-client Skills tests)
  • make openapi (no diff) and scripts/check-names.py

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@SaladDay
SaladDay merged commit 15f7bda into main Sep 30, 2026
1 check passed
@SaladDay
SaladDay deleted the refactor/skills-domain branch September 30, 2026 17:37
The skills package owns the Skill vocabulary, identifiers, version
selection, the version-deletion decision, content checks and the use
cases; skillpg stores Skills and their sealed versions in PostgreSQL and
records their write audit through auditpg. The /v1 and /core/v1 project
Skill routes call skills.Service for use cases and skills.Reader for
plain reads, and errors_skills.go maps the domain errors to the existing
responses. environmentconfig checks Skill version selectors with
skills.ValidateSelector.

store keeps Session creation's frozen Skill snapshot, which now uses the
skills selection, binding and content rules. Store Skill operations,
their cursor errors and their tests are deleted or moved to the domain
and adapter packages.

Without a credential key, Skill uploads and content reads fail with
credentialcrypto.ErrUnavailable and answer 503.
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