allow hyphen in command ref token names - #4356
Open
HuzaifaChaudary wants to merge 1 commit into
Open
Conversation
the token pattern was matching only A-Z 0-9 and underscore so a command name like speckit.agent-context.update can not be written as a token and the token stays in the output as plain text now the character class allows a hyphen also in both places that resolve the token
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.
problem
the command ref token can not hold a command name that has a hyphen in it. the pattern is
the bundled command speckit.agent-context.update has a hyphen in the middle segment so there is no way to write a token for it. the text SPECKIT_COMMAND_AGENT-CONTEXT_UPDATE matches nothing and it stays in the generated file as plain text. the agent then reads a raw token instead of a real command.
fix
allow a literal hyphen in the character class in the two places that resolve the token
src/specify_cli/integrations/base.pyinresolve_command_refssrc/specify_cli/extensions/__init__.pyin the extension skills resolverno decode change is needed. the existing replace call already leaves a hyphen untouched. so
AGENT-CONTEXT_UPDATEbecomesagent-context.updatewith the dot separator andagent-context-updatewith the hyphen separator.this is option 2 from the review on #4204 which is the direction that was asked for there.
tests
i added 4 tests
[A-Z]all 4 fail before the change and pass after it.
full suite after the change is 7139 passed and 9 failed. the same 9 fail on main without my change so they are not from this. they are the python parity template tests.
ruff 0.15.0 check src testspasses which is what the workflow runs.ai disclosure
i used an ai assistant to help me read the code and write the tests. i reviewed the change myself and ran the suite locally.
fixes #4328