Move Skills and skill versions out of store into skills and skillpg - #322
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1 (store layering), PR 8: Skills and skill versions move out of
store.skillsdomain package:Servicefor create, create version, set default, delete Skill and delete versionDecideVersionDeletion→ Apply, inside one locked transactionStorage/Readerports; content and version parsingpersistence/postgres/skillpg: the PostgreSQL adapter. It seals archives with the credential key, and it records write audits in the same transaction viaauditpg.Skills(service) andSkillsReader(adapter) Dependencies fields, strict fakes, and the skills error writer.writeStoreErrorno longer has any Skills or Files branches.cmd/server: wiresskillpgandskills.NewService.store: the Skill CRUD, versions and listing files and their tests. Coverage moved toskills/skillpg.store/write_audit_resources_test.gohad no cases left, so it is deleted too.storeuntil 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_unavailableinstead of 500.Checks on the final head (42aedb6 + 1):
go build ./...andgo vet ./services/core/...across the whole moduleskills,skillpg,environmentconfig,apiandcmd/serverin fullsandbox/providers: the configuration flow teststore:-runonly (Skill reference freezing, version deletion, cursor/path ID, audit and official-client Skills tests)make openapi(no diff) andscripts/check-names.pyNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.