Repository navigation
Address skills by location and unify filesystem and PDO resource resolution - #12
Draft
asterixcapri wants to merge 31 commits into
Draft
asterixcapri wants to merge 31 commits into
asterixcapri wants to merge 31 commits into
Conversation
asterixcapri
marked this pull request as draft
October 7, 2026 06:03
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.
Summary
Select skills by their exact catalog location so skills with the same declared name can coexist across filesystem and database sources. Locations have no trailing slash; callers pass resource paths separately as literal filenames.
Both adapters use
ResourceLocatorto translate locations under a base URI into skill identifiers and relative resource paths. Location segments are URI encoded; spaces and percent signs in resource paths remain literal.findByName()returns all exact, case-sensitive matches without replacing location-basedget().Filesystem storage accepts an absolute directory or a
file://input, requires an existing directory, and resolves its root withrealpath(). Reads resolve each path once and reject resources escaping the selected skill through traversal or symlinks. Invalid skill documents are skipped with diagnostics containingskillLocationandmessage.Add PDO storage over application-owned
(skill_identifier, path, content)rows, a combined runnable demo with SQLite setup, and updated documentation and glossary. Storage reads return PHP strings, including empty and binary content.Evidence
1.x): discovery returns skill identifiers, selection uses declared names, and later same-name skills are shadowed.After: exact catalog locations select their owning storage; same-name skills coexist,
findByName()returns every match, duplicate locations fail, and missing resources never fall back to another source.composer check: 241 tests, 718 assertions; PHPStan reports no errors.Merge Danger
Door: two-way
Code can be reverted; the library performs no schema creation or database migration.
Blast Radius: consumers
The public contract changes relative to
1.x:get()selects by location, storage discovery and reads use locations without trailing slashes,SkillStorageInterface::location()is removed, and tool inputs uselocationinstead ofname. TheSkillconstructor order isname,description,location,storage. Diagnostics identify their source withskillLocation.Filesystem roots must already exist; published locations use the root resolved by
realpath(). Custom adapters and integrations need the migration described in the README. Database collation and exact row identity are the application's schema responsibility.