skill resolution (ts): resolve send_message.skill server-side (#338 parity) - #357
Merged
Conversation
…side, Rust #338 parity Second language in the fan-out after .NET (#352). The TS server had the field on the wire and ignored it, exactly as its own changelog admitted. - skills.ts: isValidSkillName / stripFrontmatter / skillSection / resolveSection - SkillResolver seam via serve({ skillResolver }); DirSkillResolver over SMOOTH_SKILLS_DIR with explicit-wins-then-env, mirroring Rust's install_skill_resolver_from_env - Fail-CLOSED, and resolved BEFORE the 202 ack so a client never gets "accepted" for a turn that will never run - Body appended LAST to the system prompt; the persisted user message stays exactly what the user typed Name validation makes traversal unrepresentable rather than filtered. Changeset names BOTH the TS package and the lockstep anchor, per #346 — the omission of the anchor is what stranded the .NET work in #348/#352. Tests: five Rust skills.rs tests ported under their Rust names + over-the-socket fail-closed / placement / blank-as-absent. 254 green (245 baseline + 9). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iM1Q8JC1H83H2FXQVQNs9
🦋 Changeset detectedLatest commit: 10647b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Second language in the pearl th-ebe27d fan-out, after .NET (#352).
Problem
The TS server carried
send_message.skillon the wire and dropped it. Its own 1.39.0 changelog says so: "Rust is the reference implementation; the TS / Python / Go / .NET servers ignore the field for now."skillresolutionSolution
skills.ts—isValidSkillName,stripFrontmatter,skillSection,resolveSection; theSkillResolverhost seam viaserve({ skillResolver });DirSkillResolveroverSMOOTH_SKILLS_DIRwith explicit-wins-then-env, mirroringinstall_skill_resolver_from_env.Two behaviors worth calling out:
SKILL_NOT_FOUNDand the turn never runs. Doing it before the ack means a client never sees "accepted" for a turn that was never going to happen — matching where Rust parses it.Name validation makes traversal unrepresentable rather than filtered, so
../../etc/passwdcan never reach ajoin().Verification
All five Rust
skills.rstests ported under their Rust names, plus over-the-socket coverage: fail-closed (assertingchat.calls.length === 0, i.e. the model is never reached), system-prompt-not-user-message placement (including that frontmatter never reaches the model), and blank-as-absent with a resolver installed — so it proves blank means absent rather than merely unreachable.I checked the baseline on clean
mainin the same worktree (245/0) before trusting any of this — worth it, because an early version of this branch broke 55 tests and I would otherwise have blamed the harness.Note on the changeset
Names both
@smooai/smooth-operator-serverand the lockstep anchor@smooai/smooth-operator, per #346. Omitting the anchor is precisely what stranded the .NET work in #348/#352 unpublished for two days. The guard added in #356 enforces this for stamped trees;typescript/isn't one, so this is convention rather than enforcement — but shipping the TS server out of lockstep with the rest is not something to start doing.🤖 Generated with Claude Code
https://claude.ai/code/session_012iM1Q8JC1H83H2FXQVQNs9