From 3b4a1f16af4357c2e7997c453c5585e76d3ed8e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:28:18 +0000 Subject: [PATCH 1/2] Update workflow-preset to v1.3.5 --- presets/catalog.json | 2 +- .../.venv-specify-smoke/bin/Activate.ps1 | 247 ++++++++++ .../.venv-specify-smoke/bin/activate | 63 +++ .../.venv-specify-smoke/bin/activate.csh | 26 ++ .../.venv-specify-smoke/bin/activate.fish | 69 +++ .../.venv-specify-smoke/bin/markdown-it | 6 + .../.venv-specify-smoke/bin/pip | 8 + .../.venv-specify-smoke/bin/pip3 | 8 + .../.venv-specify-smoke/bin/pip3.11 | 8 + .../.venv-specify-smoke/bin/pygmentize | 6 + .../.venv-specify-smoke/bin/pyjson5 | 6 + .../.venv-specify-smoke/bin/python | 1 + .../.venv-specify-smoke/bin/python3 | 1 + .../.venv-specify-smoke/bin/python3.11 | 1 + .../.venv-specify-smoke/bin/specify | 6 + .../.venv-specify-smoke/bin/typer | 6 + .../workflow-preset/.venv-specify-smoke/lib64 | 1 + .../.venv-specify-smoke/pyvenv.cfg | 5 + presets/workflow-preset/README.md | 5 +- .../commands/speckit.clarify.md | 21 + .../docs/extension-governance.md | 4 + presets/workflow-preset/preset.yml | 423 ++++++++---------- .../tests/test_preset_contract.py | 138 ++---- .../validators/speckit_implement_contract.py | 35 +- tests/test_presets.py | 2 +- 25 files changed, 724 insertions(+), 374 deletions(-) create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/activate create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/activate.csh create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/activate.fish create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/markdown-it create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pip create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pip3 create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pygmentize create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 create mode 120000 presets/workflow-preset/.venv-specify-smoke/bin/python create mode 120000 presets/workflow-preset/.venv-specify-smoke/bin/python3 create mode 120000 presets/workflow-preset/.venv-specify-smoke/bin/python3.11 create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/specify create mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/typer create mode 120000 presets/workflow-preset/.venv-specify-smoke/lib64 create mode 100644 presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg diff --git a/presets/catalog.json b/presets/catalog.json index d9e6938143..5b0b24585b 100644 --- a/presets/catalog.json +++ b/presets/catalog.json @@ -29,7 +29,7 @@ "workflow-preset": { "name": "Workflow Preset", "id": "workflow-preset", - "version": "1.3.4", + "version": "1.3.5", "description": "Behavior-first specification, design artifacts, and agent-native handoff orchestration", "author": "bigsmartben", "repository": "https://github.com/bigsmartben/spec-kit-workflow-preset", diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 b/presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 new file mode 100755 index 0000000000..eeea3583fa --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 @@ -0,0 +1,247 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove VIRTUAL_ENV_PROMPT altogether. + if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { + Remove-Item -Path env:VIRTUAL_ENV_PROMPT + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } + $env:VIRTUAL_ENV_PROMPT = $Prompt +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/activate b/presets/workflow-preset/.venv-specify-smoke/bin/activate new file mode 100755 index 0000000000..a82b9f5d32 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/activate @@ -0,0 +1,63 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # Call hash to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + hash -r 2> /dev/null + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV=/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/"bin":$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1='(.venv-specify-smoke) '"${PS1:-}" + export PS1 + VIRTUAL_ENV_PROMPT='(.venv-specify-smoke) ' + export VIRTUAL_ENV_PROMPT +fi + +# Call hash to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +hash -r 2> /dev/null diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/activate.csh b/presets/workflow-preset/.venv-specify-smoke/bin/activate.csh new file mode 100755 index 0000000000..8afc5dd8eb --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/activate.csh @@ -0,0 +1,26 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV /home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/"bin":$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = '(.venv-specify-smoke) '"$prompt" + setenv VIRTUAL_ENV_PROMPT '(.venv-specify-smoke) ' +endif + +alias pydoc python -m pydoc + +rehash diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/activate.fish b/presets/workflow-preset/.venv-specify-smoke/bin/activate.fish new file mode 100755 index 0000000000..21713d4b88 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source /bin/activate.fish" *from fish* +# (https://fishshell.com/); you cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + set -e _OLD_FISH_PROMPT_OVERRIDE + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV /home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/"bin $PATH + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) '(.venv-specify-smoke) ' (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" + set -gx VIRTUAL_ENV_PROMPT '(.venv-specify-smoke) ' +end diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/markdown-it b/presets/workflow-preset/.venv-specify-smoke/bin/markdown-it new file mode 100755 index 0000000000..edf3a0e87b --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/markdown-it @@ -0,0 +1,6 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +import sys +from markdown_it.cli.parse import main +if __name__ == '__main__': + sys.argv[0] = sys.argv[0].removesuffix('.exe') + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pip b/presets/workflow-preset/.venv-specify-smoke/bin/pip new file mode 100755 index 0000000000..cb76523f9c --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/pip @@ -0,0 +1,8 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pip3 b/presets/workflow-preset/.venv-specify-smoke/bin/pip3 new file mode 100755 index 0000000000..cb76523f9c --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/pip3 @@ -0,0 +1,8 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 b/presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 new file mode 100755 index 0000000000..cb76523f9c --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 @@ -0,0 +1,8 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pygmentize b/presets/workflow-preset/.venv-specify-smoke/bin/pygmentize new file mode 100755 index 0000000000..930e813301 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/pygmentize @@ -0,0 +1,6 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +import sys +from pygments.cmdline import main +if __name__ == '__main__': + sys.argv[0] = sys.argv[0].removesuffix('.exe') + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 b/presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 new file mode 100755 index 0000000000..290604fa94 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 @@ -0,0 +1,6 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +import sys +from json5.tool import main +if __name__ == '__main__': + sys.argv[0] = sys.argv[0].removesuffix('.exe') + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/python b/presets/workflow-preset/.venv-specify-smoke/bin/python new file mode 120000 index 0000000000..b8a0adbbb9 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/python @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/python3 b/presets/workflow-preset/.venv-specify-smoke/bin/python3 new file mode 120000 index 0000000000..bf3a48c7d8 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/python3 @@ -0,0 +1 @@ +/opt/hostedtoolcache/Python/3.11.15/x64/bin/python3 \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/python3.11 b/presets/workflow-preset/.venv-specify-smoke/bin/python3.11 new file mode 120000 index 0000000000..b8a0adbbb9 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/python3.11 @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/specify b/presets/workflow-preset/.venv-specify-smoke/bin/specify new file mode 100755 index 0000000000..01c91baff1 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/specify @@ -0,0 +1,6 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +import sys +from specify_cli import main +if __name__ == '__main__': + sys.argv[0] = sys.argv[0].removesuffix('.exe') + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/typer b/presets/workflow-preset/.venv-specify-smoke/bin/typer new file mode 100755 index 0000000000..d38149be5d --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/bin/typer @@ -0,0 +1,6 @@ +#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 +import sys +from typer.cli import main +if __name__ == '__main__': + sys.argv[0] = sys.argv[0].removesuffix('.exe') + sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/lib64 b/presets/workflow-preset/.venv-specify-smoke/lib64 new file mode 120000 index 0000000000..7951405f85 --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/lib64 @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg b/presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg new file mode 100644 index 0000000000..20a8e73e9d --- /dev/null +++ b/presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg @@ -0,0 +1,5 @@ +home = /opt/hostedtoolcache/Python/3.11.15/x64/bin +include-system-site-packages = false +version = 3.11.15 +executable = /opt/hostedtoolcache/Python/3.11.15/x64/bin/python3.11 +command = /opt/hostedtoolcache/Python/3.11.15/x64/bin/python3 -m venv /home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke diff --git a/presets/workflow-preset/README.md b/presets/workflow-preset/README.md index e4226b4ed5..83d8a701e4 100644 --- a/presets/workflow-preset/README.md +++ b/presets/workflow-preset/README.md @@ -33,6 +33,7 @@ Requirement capabilities: - Wraps `/speckit.specify` so it produces or updates `spec.md` only. - Wraps `/speckit.clarify` so it resolves requirement ambiguity in `spec.md` only. +- When a Figma Evidence Packet has already been written into `spec.md`, `/speckit.clarify` clarifies Figma-derived gaps already written in `spec.md` and does not call Figma. - Wraps `/speckit.checklist` to add `checklists/behavior-testability.md` as a BDD readiness gate and NFR readiness gate. - Checks user stories, acceptance criteria, Given/When/Then readiness, roles, permissions, states, data, validation, boundary, exception, state-conflict behavior, and non-functional requirements directly from `spec.md`. - Requires NFR dimensions to be marked Required, Not Applicable, or Unknown in product language before planning. @@ -123,7 +124,7 @@ Context-load controls: Release install: ```bash -specify preset add workflow-preset --from https://github.com/bigsmartben/spec-kit-workflow-preset/releases/download/v1.3.4/spec-kit-workflow-preset-v1.3.4.zip +specify preset add workflow-preset --from https://github.com/bigsmartben/spec-kit-workflow-preset/releases/download/v1.3.5/spec-kit-workflow-preset-v1.3.5.zip ``` Local development install: @@ -348,7 +349,7 @@ Release install smoke validation is intentionally owned by GitHub Actions, not b After tagging a release, validate archive installation: ```bash -specify preset add workflow-preset --from https://github.com/bigsmartben/spec-kit-workflow-preset/releases/download/v1.3.4/spec-kit-workflow-preset-v1.3.4.zip +specify preset add workflow-preset --from https://github.com/bigsmartben/spec-kit-workflow-preset/releases/download/v1.3.5/spec-kit-workflow-preset-v1.3.5.zip ``` ## Source Rationale diff --git a/presets/workflow-preset/commands/speckit.clarify.md b/presets/workflow-preset/commands/speckit.clarify.md index 4cdae34f65..9505245c51 100644 --- a/presets/workflow-preset/commands/speckit.clarify.md +++ b/presets/workflow-preset/commands/speckit.clarify.md @@ -9,6 +9,27 @@ Use `spec.md` as the clarification source. Ask and record clarification only for Do not read or update behavior draft artifacts. Do not use behavior drafts as clarification inputs, and do not open a separate behavior-question channel. Product requirements stay in `spec.md`; update `spec.md` only after user-provided answers make the requirement clear. +## Figma-Derived Clarification Strategy + +When `spec.md` was created from a Figma Evidence Packet, prioritize clarification questions for Figma-derived gaps already written in `spec.md`. Scan `spec.md` first for `Missing / Needs clarification`, `[NEEDS CLARIFICATION]`, `Inferred from structure`, and gaps about Figma-unprovided states, responsive behavior, business rules, permissions, and error handling. + +Do not call Figma MCP. Do not re-extract design facts, re-parse Figma links, or turn clarification into a Figma extraction step. `/speckit.specify` owns writing Figma evidence into `spec.md`; `/speckit.clarify` only selects high-impact questions from existing `spec.md` gaps and records confirmed answers. + +Ask at most 5 high-impact questions whose answers materially affect requirements, implementation planning, or validation readiness. Prefer questions in this order: + +1. Required frames, states, and breakpoints for acceptance. +2. visual fidelity scope: pixel-perfect, design-system faithful, or functional equivalent. +3. missing UI states such as loading, empty, error, disabled, hover, and focus. +4. responsive behavior, scrolling, safe areas, and long-copy handling. +5. component mapping from Figma components to existing code components. +6. data semantics for mock copy, API-backed copy, and interface-driven values. +7. Prototype-uncovered navigation, dialogs, recovery paths, and failure handling. +8. acceptance evidence, visual-difference tolerance, and exception approval flow. + +After the user answers, write confirmed answers back into `spec.md` in the relevant Requirements, User Scenarios, Acceptance Criteria, Assumptions, Open Questions, or visual/responsive/state sections. Do not create a separate Figma clarification document. + +Do not generate visual restoration checklists. Clarification fills requirement gaps in `spec.md`; `/speckit.checklist` remains responsible for checking requirement text quality and readiness. + {CORE_TEMPLATE} ## Clarification Reporting diff --git a/presets/workflow-preset/docs/extension-governance.md b/presets/workflow-preset/docs/extension-governance.md index ce018dd3c5..817479c9aa 100644 --- a/presets/workflow-preset/docs/extension-governance.md +++ b/presets/workflow-preset/docs/extension-governance.md @@ -44,6 +44,10 @@ Stage ownership: - `/speckit.analyze`: vertical consistency checks across requirements, behavior drafts, contracts, and tasks only. - `/speckit.implement`: implementation handoff execution only. +When a Figma Evidence Packet has already been written into `spec.md`, +`/speckit.clarify` may clarify those requirement gaps from `spec.md`, but +external design extraction is not a clarification responsibility. + ## Structured Artifact Rules Machine-readable JSON artifacts are contracts, not prose examples. Stable diff --git a/presets/workflow-preset/preset.yml b/presets/workflow-preset/preset.yml index 560692a088..386e763f67 100644 --- a/presets/workflow-preset/preset.yml +++ b/presets/workflow-preset/preset.yml @@ -1,232 +1,201 @@ -schema_version: "1.0" - +schema_version: '1.0' preset: - id: "workflow-preset" - name: "Workflow Preset" - version: "1.3.4" - description: "Behavior-first specification, design artifacts, and agent-native handoff orchestration" - author: "bigsmartben" - repository: "https://github.com/bigsmartben/spec-kit-workflow-preset" - license: "MIT" - + id: workflow-preset + name: Workflow Preset + version: 1.3.5 + description: Behavior-first specification, design artifacts, and agent-native handoff + orchestration + author: bigsmartben + repository: https://github.com/bigsmartben/spec-kit-workflow-preset + license: MIT requires: - speckit_version: ">=0.8.10.dev0" - + speckit_version: '>=0.8.10.dev0' provides: templates: - - type: "template" - name: "plan-template" - file: "templates/plan-template.md" - description: "Add design artifact navigation to the plan template" - replaces: "plan-template" - strategy: "wrap" - - - type: "template" - name: "constitution-template" - file: "templates/constitution-template.md" - description: "Add change scope granularity governance to the constitution template" - replaces: "constitution-template" - strategy: "wrap" - - - type: "command" - name: "speckit.specify" - file: "commands/speckit.specify.md" - description: "Wrap core specification with spec-only requirement ownership" - replaces: "speckit.specify" - strategy: "wrap" - - - type: "command" - name: "speckit.clarify" - file: "commands/speckit.clarify.md" - description: "Wrap core clarification with spec-only ambiguity resolution" - replaces: "speckit.clarify" - strategy: "wrap" - - - type: "command" - name: "speckit.checklist" - file: "commands/speckit.checklist.md" - description: "Wrap core checklist generation with BDD and NFR readiness gate" - replaces: "speckit.checklist" - strategy: "wrap" - - - type: "command" - name: "speckit.constitution" - file: "commands/speckit.constitution.md" - description: "Wrap core constitution updates with change scope granularity governance" - replaces: "speckit.constitution" - strategy: "wrap" - - - type: "command" - name: "speckit.analyze" - file: "commands/speckit.analyze.md" - description: "Wrap core analysis with behavior-first vertical consistency checks" - replaces: "speckit.analyze" - strategy: "wrap" - - - type: "command" - name: "speckit.plan" - file: "commands/speckit.plan.md" - description: "Wrap core planning with Phase 0 behavior projection and optional design artifacts" - replaces: "speckit.plan" - strategy: "wrap" - - - type: "command" - name: "speckit.tasks" - file: "commands/speckit.tasks.md" - description: "Wrap task generation with optional design artifact awareness" - replaces: "speckit.tasks" - strategy: "wrap" - - - type: "command" - name: "speckit.implement" - file: "commands/speckit.implement.md" - description: "Run agent-native handoff orchestration or execute one worker handoff" - replaces: "speckit.implement" - strategy: "replace" - - - type: "template" - name: "behavior-bdd-draft-template" - file: "templates/behavior/bdd-draft.feature" - description: "Template for Phase 0 BDD drafts" - replaces: "behavior-bdd-draft-template" - strategy: "replace" - - - type: "template" - name: "behavior-scenarios-draft-template" - file: "templates/behavior/behavior-scenarios-draft.json" - description: "Template for structured behavior scenario drafts" - replaces: "behavior-scenarios-draft-template" - strategy: "replace" - - - type: "template" - name: "behavior-uif-intent-template" - file: "templates/behavior/uif-intent.json" - description: "Template for Phase 0 UIF intent" - replaces: "behavior-uif-intent-template" - strategy: "replace" - - - type: "template" - name: "behavior-data-fixtures-intent-template" - file: "templates/behavior/data-fixtures-intent.json" - description: "Template for Phase 0 data fixture intent" - replaces: "behavior-data-fixtures-intent-template" - strategy: "replace" - - - type: "template" - name: "behavior-testability-checklist-template" - file: "templates/behavior/behavior-testability-checklist.md" - description: "Template for BDD and NFR readiness gate output" - replaces: "behavior-testability-checklist-template" - strategy: "replace" - - - type: "template" - name: "behavior-bdd-contract-template" - file: "templates/behavior/bdd-contract.feature" - description: "Template for formal BDD contracts" - replaces: "behavior-bdd-contract-template" - strategy: "replace" - - - type: "template" - name: "behavior-uif-expected-template" - file: "templates/behavior/uif-expected.json" - description: "Template for Expected UIF contracts" - replaces: "behavior-uif-expected-template" - strategy: "replace" - - - type: "template" - name: "behavior-scenario-instances-template" - file: "templates/behavior/scenario-instances.json" - description: "Template for formal behavior scenario instances" - replaces: "behavior-scenario-instances-template" - strategy: "replace" - - - type: "template" - name: "behavior-data-fixtures-template" - file: "templates/behavior/data-fixtures.json" - description: "Template for formal behavior data fixtures" - replaces: "behavior-data-fixtures-template" - strategy: "replace" - - - type: "template" - name: "behavior-assertions-template" - file: "templates/behavior/assertions.json" - description: "Template for formal behavior assertions" - replaces: "behavior-assertions-template" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-scenarios-draft-v1-schema" - file: "schemas/speckit.behavior.scenarios.draft.v1.schema.json" - description: "Schema for structured behavior scenario drafts" - replaces: "speckit-behavior-scenarios-draft-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-uif-intent-v1-schema" - file: "schemas/speckit.behavior.uif.intent.v1.schema.json" - description: "Schema for Phase 0 UIF intent" - replaces: "speckit-behavior-uif-intent-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-data-fixtures-intent-v1-schema" - file: "schemas/speckit.behavior.data-fixtures.intent.v1.schema.json" - description: "Schema for data fixture intent" - replaces: "speckit-behavior-data-fixtures-intent-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-uif-expected-v1-schema" - file: "schemas/speckit.behavior.uif.expected.v1.schema.json" - description: "Schema for Expected UIF contracts" - replaces: "speckit-behavior-uif-expected-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-scenario-instances-v1-schema" - file: "schemas/speckit.behavior.scenario-instances.v1.schema.json" - description: "Schema for formal behavior scenario instances" - replaces: "speckit-behavior-scenario-instances-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-data-fixtures-v1-schema" - file: "schemas/speckit.behavior.data-fixtures.v1.schema.json" - description: "Schema for formal behavior data fixtures" - replaces: "speckit-behavior-data-fixtures-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-behavior-assertions-v1-schema" - file: "schemas/speckit.behavior.assertions.v1.schema.json" - description: "Schema for formal behavior assertions" - replaces: "speckit-behavior-assertions-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-implement-manifest-v1-schema" - file: "schemas/speckit.implement.manifest.v1.schema.json" - description: "Decouple the handoff manifest JSON contract" - replaces: "speckit-implement-manifest-v1-schema" - strategy: "replace" - - - type: "template" - name: "speckit-implement-handoff-v2-schema" - file: "schemas/speckit.implement.handoff.v2.schema.json" - description: "Decouple the handoff JSON contract" - replaces: "speckit-implement-handoff-v2-schema" - strategy: "replace" - - - type: "template" - name: "speckit-implement-receipt-v1-schema" - file: "schemas/speckit.implement.receipt.v1.schema.json" - description: "Decouple the receipt JSON contract" - replaces: "speckit-implement-receipt-v1-schema" - strategy: "replace" - + - type: template + name: plan-template + file: templates/plan-template.md + description: Add design artifact navigation to the plan template + replaces: plan-template + strategy: wrap + - type: template + name: constitution-template + file: templates/constitution-template.md + description: Add change scope granularity governance to the constitution template + replaces: constitution-template + strategy: wrap + - type: command + name: speckit.specify + file: commands/speckit.specify.md + description: Wrap core specification with spec-only requirement ownership + replaces: speckit.specify + strategy: wrap + - type: command + name: speckit.clarify + file: commands/speckit.clarify.md + description: Wrap core clarification with spec-only ambiguity resolution + replaces: speckit.clarify + strategy: wrap + - type: command + name: speckit.checklist + file: commands/speckit.checklist.md + description: Wrap core checklist generation with BDD and NFR readiness gate + replaces: speckit.checklist + strategy: wrap + - type: command + name: speckit.constitution + file: commands/speckit.constitution.md + description: Wrap core constitution updates with change scope granularity governance + replaces: speckit.constitution + strategy: wrap + - type: command + name: speckit.analyze + file: commands/speckit.analyze.md + description: Wrap core analysis with behavior-first vertical consistency checks + replaces: speckit.analyze + strategy: wrap + - type: command + name: speckit.plan + file: commands/speckit.plan.md + description: Wrap core planning with Phase 0 behavior projection and optional + design artifacts + replaces: speckit.plan + strategy: wrap + - type: command + name: speckit.tasks + file: commands/speckit.tasks.md + description: Wrap task generation with optional design artifact awareness + replaces: speckit.tasks + strategy: wrap + - type: command + name: speckit.implement + file: commands/speckit.implement.md + description: Run agent-native handoff orchestration or execute one worker handoff + replaces: speckit.implement + strategy: replace + - type: template + name: behavior-bdd-draft-template + file: templates/behavior/bdd-draft.feature + description: Template for Phase 0 BDD drafts + replaces: behavior-bdd-draft-template + strategy: replace + - type: template + name: behavior-scenarios-draft-template + file: templates/behavior/behavior-scenarios-draft.json + description: Template for structured behavior scenario drafts + replaces: behavior-scenarios-draft-template + strategy: replace + - type: template + name: behavior-uif-intent-template + file: templates/behavior/uif-intent.json + description: Template for Phase 0 UIF intent + replaces: behavior-uif-intent-template + strategy: replace + - type: template + name: behavior-data-fixtures-intent-template + file: templates/behavior/data-fixtures-intent.json + description: Template for Phase 0 data fixture intent + replaces: behavior-data-fixtures-intent-template + strategy: replace + - type: template + name: behavior-testability-checklist-template + file: templates/behavior/behavior-testability-checklist.md + description: Template for BDD and NFR readiness gate output + replaces: behavior-testability-checklist-template + strategy: replace + - type: template + name: behavior-bdd-contract-template + file: templates/behavior/bdd-contract.feature + description: Template for formal BDD contracts + replaces: behavior-bdd-contract-template + strategy: replace + - type: template + name: behavior-uif-expected-template + file: templates/behavior/uif-expected.json + description: Template for Expected UIF contracts + replaces: behavior-uif-expected-template + strategy: replace + - type: template + name: behavior-scenario-instances-template + file: templates/behavior/scenario-instances.json + description: Template for formal behavior scenario instances + replaces: behavior-scenario-instances-template + strategy: replace + - type: template + name: behavior-data-fixtures-template + file: templates/behavior/data-fixtures.json + description: Template for formal behavior data fixtures + replaces: behavior-data-fixtures-template + strategy: replace + - type: template + name: behavior-assertions-template + file: templates/behavior/assertions.json + description: Template for formal behavior assertions + replaces: behavior-assertions-template + strategy: replace + - type: template + name: speckit-behavior-scenarios-draft-v1-schema + file: schemas/speckit.behavior.scenarios.draft.v1.schema.json + description: Schema for structured behavior scenario drafts + replaces: speckit-behavior-scenarios-draft-v1-schema + strategy: replace + - type: template + name: speckit-behavior-uif-intent-v1-schema + file: schemas/speckit.behavior.uif.intent.v1.schema.json + description: Schema for Phase 0 UIF intent + replaces: speckit-behavior-uif-intent-v1-schema + strategy: replace + - type: template + name: speckit-behavior-data-fixtures-intent-v1-schema + file: schemas/speckit.behavior.data-fixtures.intent.v1.schema.json + description: Schema for data fixture intent + replaces: speckit-behavior-data-fixtures-intent-v1-schema + strategy: replace + - type: template + name: speckit-behavior-uif-expected-v1-schema + file: schemas/speckit.behavior.uif.expected.v1.schema.json + description: Schema for Expected UIF contracts + replaces: speckit-behavior-uif-expected-v1-schema + strategy: replace + - type: template + name: speckit-behavior-scenario-instances-v1-schema + file: schemas/speckit.behavior.scenario-instances.v1.schema.json + description: Schema for formal behavior scenario instances + replaces: speckit-behavior-scenario-instances-v1-schema + strategy: replace + - type: template + name: speckit-behavior-data-fixtures-v1-schema + file: schemas/speckit.behavior.data-fixtures.v1.schema.json + description: Schema for formal behavior data fixtures + replaces: speckit-behavior-data-fixtures-v1-schema + strategy: replace + - type: template + name: speckit-behavior-assertions-v1-schema + file: schemas/speckit.behavior.assertions.v1.schema.json + description: Schema for formal behavior assertions + replaces: speckit-behavior-assertions-v1-schema + strategy: replace + - type: template + name: speckit-implement-manifest-v1-schema + file: schemas/speckit.implement.manifest.v1.schema.json + description: Decouple the handoff manifest JSON contract + replaces: speckit-implement-manifest-v1-schema + strategy: replace + - type: template + name: speckit-implement-handoff-v2-schema + file: schemas/speckit.implement.handoff.v2.schema.json + description: Decouple the handoff JSON contract + replaces: speckit-implement-handoff-v2-schema + strategy: replace + - type: template + name: speckit-implement-receipt-v1-schema + file: schemas/speckit.implement.receipt.v1.schema.json + description: Decouple the receipt JSON contract + replaces: speckit-implement-receipt-v1-schema + strategy: replace tags: - - "behavior" - - "bdd" - - "planning" - - "implementation" - - "handoff" +- behavior +- bdd +- planning +- implementation +- handoff diff --git a/presets/workflow-preset/tests/test_preset_contract.py b/presets/workflow-preset/tests/test_preset_contract.py index 15b7748850..4309b355e9 100644 --- a/presets/workflow-preset/tests/test_preset_contract.py +++ b/presets/workflow-preset/tests/test_preset_contract.py @@ -511,7 +511,7 @@ def test_preset_manifest_contract(self) -> None: template = entries[template_name] self.assertEqual("template", template["type"]) self.assertEqual( - str(template_path.relative_to(REPO_ROOT)), + template_path.relative_to(REPO_ROOT).as_posix(), template["file"], ) self.assertEqual(template_name, template["replaces"]) @@ -521,7 +521,7 @@ def test_preset_manifest_contract(self) -> None: schema_name = f"{contract_type}-schema".replace(".", "-").replace("_", "-") schema = entries[schema_name] self.assertEqual("template", schema["type"]) - self.assertEqual(str(schema_path.relative_to(REPO_ROOT)), schema["file"]) + self.assertEqual(schema_path.relative_to(REPO_ROOT).as_posix(), schema["file"]) self.assertEqual(schema_name, schema["replaces"]) self.assertEqual("replace", schema["strategy"]) @@ -689,12 +689,32 @@ def test_behavior_first_command_wrapper_contracts(self) -> None: self.assertIn("Product requirements stay in `spec.md`", clarify) self.assertIn("non-functional requirement assumptions", clarify) self.assertIn("only after user-provided answers", clarify) + self.assertIn("Figma Evidence Packet", clarify) + self.assertIn("Missing / Needs clarification", clarify) + self.assertIn("[NEEDS CLARIFICATION]", clarify) + self.assertIn("Inferred from structure", clarify) + self.assertIn("Do not call Figma MCP", clarify) + self.assertIn("Do not re-extract design facts", clarify) + self.assertIn("Ask at most 5 high-impact questions", clarify) + self.assertIn("visual fidelity scope", clarify) + self.assertIn("missing UI states", clarify) + self.assertIn("responsive behavior", clarify) + self.assertIn("component mapping", clarify) + self.assertIn("data semantics", clarify) + self.assertIn("acceptance evidence", clarify) + self.assertIn("write confirmed answers back into `spec.md`", clarify) + self.assertIn("Do not generate visual restoration checklists", clarify) for forbidden in ( "behavior/bdd.draft.feature", "behavior/behavior-scenarios.draft.json", "behavior/uif.intent.json", "behavior/data-fixtures.intent.json", "behavior/open-questions.json", + "use_figma", + "get_design_context", + "fetch Figma URL", + "read Figma URL", + "update checklists/behavior-testability.md", ): self.assertNotIn(forbidden, clarify) @@ -1867,58 +1887,6 @@ def test_validate_receipt_contract_rejects_unreviewed_diff_path_for_data_side_ef RECEIPT_PATH, ) - def test_validate_receipt_contract_requires_runtime_data_writes_found_for_code_review_task( - self, - ) -> None: - handoff = minimal_handoff(task_ids=["T099"], task_type="code_review") - handoff["allowed_read_paths"] = [TASKS_PATH, SERVICE_PATH] - - with self.assertRaisesRegex(ValueError, "runtime_data_writes_found"): - validate_receipt_contract( - handoff, - minimal_receipt( - task_ids=["T099"], - task_type="code_review", - review_conclusion={ - "status": "approved", - "summary": "Review complete.", - "checked_sources": [SERVICE_PATH], - "findings": [], - }, - data_side_effect_review={ - "reviewed_diff_paths": [SERVICE_PATH], - "mutation_findings": [], - }, - ), - RECEIPT_PATH, - ) - - def test_validate_receipt_contract_requires_mutation_findings_for_code_review_task( - self, - ) -> None: - handoff = minimal_handoff(task_ids=["T099"], task_type="code_review") - handoff["allowed_read_paths"] = [TASKS_PATH, SERVICE_PATH] - - with self.assertRaisesRegex(ValueError, "mutation_findings"): - validate_receipt_contract( - handoff, - minimal_receipt( - task_ids=["T099"], - task_type="code_review", - review_conclusion={ - "status": "approved", - "summary": "Review complete.", - "checked_sources": [SERVICE_PATH], - "findings": [], - }, - data_side_effect_review={ - "reviewed_diff_paths": [SERVICE_PATH], - "runtime_data_writes_found": False, - }, - ), - RECEIPT_PATH, - ) - def test_validate_receipt_contract_rejects_approved_with_unresolved_high_data_side_effect( self, ) -> None: @@ -1958,57 +1926,6 @@ def test_validate_receipt_contract_rejects_approved_with_unresolved_high_data_si RECEIPT_PATH, ) - def test_validate_receipt_contract_requires_data_side_effect_finding_fields( - self, - ) -> None: - handoff = minimal_handoff(task_ids=["T099"], task_type="code_review") - handoff["allowed_read_paths"] = [TASKS_PATH, SERVICE_PATH] - required_fields = [ - "id", - "severity", - "category", - "summary", - "operation", - "tables_or_entities", - "fields", - "resolution", - ] - finding = { - "id": "DSE-001", - "severity": "low", - "category": "field_level_update", - "summary": "Order status update affects fulfillment flow.", - "operation": "update", - "tables_or_entities": ["orders"], - "fields": ["status"], - "resolution": "accepted", - } - - for missing_field in required_fields: - invalid_finding = dict(finding) - invalid_finding.pop(missing_field) - with self.subTest(missing_field=missing_field): - with self.assertRaisesRegex(ValueError, missing_field): - validate_receipt_contract( - handoff, - minimal_receipt( - task_ids=["T099"], - task_type="code_review", - review_conclusion={ - "status": "approved", - "summary": "Review complete.", - "checked_sources": [SERVICE_PATH], - "findings": [], - }, - data_side_effect_review={ - "reviewed_diff_paths": [SERVICE_PATH], - "runtime_data_writes_found": True, - "mutation_findings": [invalid_finding], - }, - ), - RECEIPT_PATH, - ) - def test_validate_receipt_contract_rejects_checked_source_outside_allowed_reads( self, ) -> None: @@ -2384,6 +2301,9 @@ def test_readme_contract(self) -> None: self.assertIn("The preset has four goals:", readme) self.assertIn("BDD readiness gate", readme) self.assertIn("NFR readiness", readme) + self.assertIn("Figma Evidence Packet", readme) + self.assertIn("clarifies Figma-derived gaps already written in `spec.md`", readme) + self.assertIn("does not call Figma", readme) self.assertIn("explicit non-functional requirement declarations", readme) self.assertIn("Required, Not Applicable, or Unknown", readme) self.assertIn("missing or unverifiable NFR assumptions", readme) @@ -2520,6 +2440,8 @@ def test_extension_governance_document_contract(self) -> None: "BDD and UIF artifacts need independent templates", "`/speckit.constitution`: constitution governance and project principles only", "`/speckit.checklist`: checklist artifacts and BDD/NFR readiness gates only", + "Figma Evidence Packet", + "external design extraction is not a clarification responsibility", "NFR readiness belongs in `spec.md` product requirements", "`/speckit.plan`: Phase 0 behavior projection, planning artifacts, and formal contracts", "Handoff extensions must update schema, validator, command, and cross-agent documentation together", @@ -2552,8 +2474,7 @@ def _workflow_on(self, workflow: dict) -> dict: def test_github_actions_contract_workflow(self) -> None: workflow_path = REPO_ROOT / ".github" / "workflows" / "ci.yml" - if not workflow_path.exists(): - self.skipTest("GitHub Actions workflow is not bundled in spec-kit checkout") + self.assertTrue(workflow_path.exists()) workflow = yaml.safe_load(workflow_path.read_text(encoding="utf-8")) self.assertEqual("Preset Contract", workflow["name"]) @@ -2575,8 +2496,7 @@ def test_github_actions_contract_workflow(self) -> None: def test_github_actions_artifact_release_and_integration_pr_workflow(self) -> None: workflow_path = REPO_ROOT / ".github" / "workflows" / "preset-artifact.yml" - if not workflow_path.exists(): - self.skipTest("GitHub Actions workflow is not bundled in spec-kit checkout") + self.assertTrue(workflow_path.exists()) workflow = yaml.safe_load(workflow_path.read_text(encoding="utf-8")) self.assertEqual("Preset Artifact", workflow["name"]) diff --git a/presets/workflow-preset/validators/speckit_implement_contract.py b/presets/workflow-preset/validators/speckit_implement_contract.py index 8ab19874cd..d23986a919 100644 --- a/presets/workflow-preset/validators/speckit_implement_contract.py +++ b/presets/workflow-preset/validators/speckit_implement_contract.py @@ -185,26 +185,6 @@ def _unresolved_high_or_critical(finding: dict[str, Any]) -> bool: ) -def _validate_data_side_effect_finding(finding: Any, *, index: int) -> None: - if not isinstance(finding, dict): - raise ValueError( - f"data_side_effect_review mutation_findings[{index}] must be an object" - ) - - context = f"data_side_effect_review mutation_findings[{index}]" - for key in ("id", "severity", "category", "summary", "operation", "resolution"): - if not isinstance(finding.get(key), str) or not finding.get(key): - raise ValueError(f"{context} must include {key}") - - for key in ("tables_or_entities", "fields"): - values = finding.get(key) - if ( - not isinstance(values, list) - or any(not isinstance(value, str) or not value for value in values) - ): - raise ValueError(f"{context} must include {key}") - - def validate_behavior_draft_contract( scenarios_draft: dict[str, Any], data_fixtures_intent: dict[str, Any], @@ -584,18 +564,6 @@ def validate_receipt_contract( f"allowed_read_paths or context_digest_path: {path}" ) - runtime_data_writes_found = data_side_effect_review.get( - "runtime_data_writes_found" - ) - if not isinstance(runtime_data_writes_found, bool): - raise ValueError( - "data_side_effect_review must include runtime_data_writes_found" - ) - - mutation_findings = data_side_effect_review.get("mutation_findings") - if not isinstance(mutation_findings, list): - raise ValueError("data_side_effect_review must include mutation_findings") - validation_commands = list(handoff.get("validation_commands", [])) if validation_commands and not _receipt_mentions_any_command( receipt, @@ -622,8 +590,7 @@ def validate_receipt_contract( "critical/high findings" ) - for index, finding in enumerate(mutation_findings): - _validate_data_side_effect_finding(finding, index=index) + for finding in data_side_effect_review.get("mutation_findings", []): if review_status == "approved" and _unresolved_high_or_critical(finding): raise ValueError( "approved code review receipt must not include unresolved " diff --git a/tests/test_presets.py b/tests/test_presets.py index d947324383..1ba20be8e7 100644 --- a/tests/test_presets.py +++ b/tests/test_presets.py @@ -3490,7 +3490,7 @@ def test_workflow_preset_catalog_matches_manifest(self): template_count = sum(1 for item in provided if item["type"] == "template") assert entry["bundled"] is True - assert entry["version"] == "1.3.4" + assert entry["version"] == "1.3.5" assert entry["version"] == manifest["preset"]["version"] assert entry["repository"] == manifest["preset"]["repository"] assert entry["requires"]["speckit_version"] == manifest["requires"]["speckit_version"] From a1a002a65bdc4afe4c1bbb310ab47643cce59520 Mon Sep 17 00:00:00 2001 From: bigsmartben <30429295+bigsmartben@users.noreply.github.com> Date: Tue, 16 Jun 2026 20:00:05 +0800 Subject: [PATCH 2/2] Fix workflow preset release feedback --- .github/workflows/community-smoke.yml | 4 +- .gitignore | 1 + .../.venv-specify-smoke/bin/Activate.ps1 | 247 ------------------ .../.venv-specify-smoke/bin/activate | 63 ----- .../.venv-specify-smoke/bin/activate.csh | 26 -- .../.venv-specify-smoke/bin/activate.fish | 69 ----- .../.venv-specify-smoke/bin/markdown-it | 6 - .../.venv-specify-smoke/bin/pip | 8 - .../.venv-specify-smoke/bin/pip3 | 8 - .../.venv-specify-smoke/bin/pip3.11 | 8 - .../.venv-specify-smoke/bin/pygmentize | 6 - .../.venv-specify-smoke/bin/pyjson5 | 6 - .../.venv-specify-smoke/bin/python | 1 - .../.venv-specify-smoke/bin/python3 | 1 - .../.venv-specify-smoke/bin/python3.11 | 1 - .../.venv-specify-smoke/bin/specify | 6 - .../.venv-specify-smoke/bin/typer | 6 - .../workflow-preset/.venv-specify-smoke/lib64 | 1 - .../.venv-specify-smoke/pyvenv.cfg | 5 - .../tests/test_preset_contract.py | 98 ++++++- .../validators/speckit_implement_contract.py | 35 ++- tests/integrations/test_cli.py | 4 +- tests/test_presets.py | 4 +- 23 files changed, 136 insertions(+), 478 deletions(-) delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/activate delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/activate.csh delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/activate.fish delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/markdown-it delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pip delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pip3 delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pygmentize delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 delete mode 120000 presets/workflow-preset/.venv-specify-smoke/bin/python delete mode 120000 presets/workflow-preset/.venv-specify-smoke/bin/python3 delete mode 120000 presets/workflow-preset/.venv-specify-smoke/bin/python3.11 delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/specify delete mode 100755 presets/workflow-preset/.venv-specify-smoke/bin/typer delete mode 120000 presets/workflow-preset/.venv-specify-smoke/lib64 delete mode 100644 presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg diff --git a/.github/workflows/community-smoke.yml b/.github/workflows/community-smoke.yml index 188fd6b63e..a11853fc1b 100644 --- a/.github/workflows/community-smoke.yml +++ b/.github/workflows/community-smoke.yml @@ -59,8 +59,8 @@ jobs: registry = json.loads(Path(".specify/presets/.registry").read_text(encoding="utf-8")) manifest_version = manifest["preset"]["version"] registry_version = registry["presets"]["workflow-preset"]["version"] - assert manifest_version == "1.3.4", manifest_version - assert registry_version == "1.3.4", registry_version + assert manifest_version == "1.3.5", manifest_version + assert registry_version == "1.3.5", registry_version assert registry_version == manifest_version PY test -f .specify/presets/workflow-preset/templates/behavior/behavior-scenarios-draft.json diff --git a/.gitignore b/.gitignore index 1688c8299e..a3c3a5d87c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ venv/ ENV/ env/ .venv +.venv*/ # IDE .vscode/ diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 b/presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 deleted file mode 100755 index eeea3583fa..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/Activate.ps1 +++ /dev/null @@ -1,247 +0,0 @@ -<# -.Synopsis -Activate a Python virtual environment for the current PowerShell session. - -.Description -Pushes the python executable for a virtual environment to the front of the -$Env:PATH environment variable and sets the prompt to signify that you are -in a Python virtual environment. Makes use of the command line switches as -well as the `pyvenv.cfg` file values present in the virtual environment. - -.Parameter VenvDir -Path to the directory that contains the virtual environment to activate. The -default value for this is the parent of the directory that the Activate.ps1 -script is located within. - -.Parameter Prompt -The prompt prefix to display when this virtual environment is activated. By -default, this prompt is the name of the virtual environment folder (VenvDir) -surrounded by parentheses and followed by a single space (ie. '(.venv) '). - -.Example -Activate.ps1 -Activates the Python virtual environment that contains the Activate.ps1 script. - -.Example -Activate.ps1 -Verbose -Activates the Python virtual environment that contains the Activate.ps1 script, -and shows extra information about the activation as it executes. - -.Example -Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv -Activates the Python virtual environment located in the specified location. - -.Example -Activate.ps1 -Prompt "MyPython" -Activates the Python virtual environment that contains the Activate.ps1 script, -and prefixes the current prompt with the specified string (surrounded in -parentheses) while the virtual environment is active. - -.Notes -On Windows, it may be required to enable this Activate.ps1 script by setting the -execution policy for the user. You can do this by issuing the following PowerShell -command: - -PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - -For more information on Execution Policies: -https://go.microsoft.com/fwlink/?LinkID=135170 - -#> -Param( - [Parameter(Mandatory = $false)] - [String] - $VenvDir, - [Parameter(Mandatory = $false)] - [String] - $Prompt -) - -<# Function declarations --------------------------------------------------- #> - -<# -.Synopsis -Remove all shell session elements added by the Activate script, including the -addition of the virtual environment's Python executable from the beginning of -the PATH variable. - -.Parameter NonDestructive -If present, do not remove this function from the global namespace for the -session. - -#> -function global:deactivate ([switch]$NonDestructive) { - # Revert to original values - - # The prior prompt: - if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { - Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt - Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT - } - - # The prior PYTHONHOME: - if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { - Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME - Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME - } - - # The prior PATH: - if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { - Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH - Remove-Item -Path Env:_OLD_VIRTUAL_PATH - } - - # Just remove the VIRTUAL_ENV altogether: - if (Test-Path -Path Env:VIRTUAL_ENV) { - Remove-Item -Path env:VIRTUAL_ENV - } - - # Just remove VIRTUAL_ENV_PROMPT altogether. - if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { - Remove-Item -Path env:VIRTUAL_ENV_PROMPT - } - - # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: - if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { - Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force - } - - # Leave deactivate function in the global namespace if requested: - if (-not $NonDestructive) { - Remove-Item -Path function:deactivate - } -} - -<# -.Description -Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the -given folder, and returns them in a map. - -For each line in the pyvenv.cfg file, if that line can be parsed into exactly -two strings separated by `=` (with any amount of whitespace surrounding the =) -then it is considered a `key = value` line. The left hand string is the key, -the right hand is the value. - -If the value starts with a `'` or a `"` then the first and last character is -stripped from the value before being captured. - -.Parameter ConfigDir -Path to the directory that contains the `pyvenv.cfg` file. -#> -function Get-PyVenvConfig( - [String] - $ConfigDir -) { - Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" - - # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). - $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue - - # An empty map will be returned if no config file is found. - $pyvenvConfig = @{ } - - if ($pyvenvConfigPath) { - - Write-Verbose "File exists, parse `key = value` lines" - $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath - - $pyvenvConfigContent | ForEach-Object { - $keyval = $PSItem -split "\s*=\s*", 2 - if ($keyval[0] -and $keyval[1]) { - $val = $keyval[1] - - # Remove extraneous quotations around a string value. - if ("'""".Contains($val.Substring(0, 1))) { - $val = $val.Substring(1, $val.Length - 2) - } - - $pyvenvConfig[$keyval[0]] = $val - Write-Verbose "Adding Key: '$($keyval[0])'='$val'" - } - } - } - return $pyvenvConfig -} - - -<# Begin Activate script --------------------------------------------------- #> - -# Determine the containing directory of this script -$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition -$VenvExecDir = Get-Item -Path $VenvExecPath - -Write-Verbose "Activation script is located in path: '$VenvExecPath'" -Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" -Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" - -# Set values required in priority: CmdLine, ConfigFile, Default -# First, get the location of the virtual environment, it might not be -# VenvExecDir if specified on the command line. -if ($VenvDir) { - Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" -} -else { - Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." - $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") - Write-Verbose "VenvDir=$VenvDir" -} - -# Next, read the `pyvenv.cfg` file to determine any required value such -# as `prompt`. -$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir - -# Next, set the prompt from the command line, or the config file, or -# just use the name of the virtual environment folder. -if ($Prompt) { - Write-Verbose "Prompt specified as argument, using '$Prompt'" -} -else { - Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" - if ($pyvenvCfg -and $pyvenvCfg['prompt']) { - Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" - $Prompt = $pyvenvCfg['prompt']; - } - else { - Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" - Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" - $Prompt = Split-Path -Path $venvDir -Leaf - } -} - -Write-Verbose "Prompt = '$Prompt'" -Write-Verbose "VenvDir='$VenvDir'" - -# Deactivate any currently active virtual environment, but leave the -# deactivate function in place. -deactivate -nondestructive - -# Now set the environment variable VIRTUAL_ENV, used by many tools to determine -# that there is an activated venv. -$env:VIRTUAL_ENV = $VenvDir - -if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { - - Write-Verbose "Setting prompt to '$Prompt'" - - # Set the prompt to include the env name - # Make sure _OLD_VIRTUAL_PROMPT is global - function global:_OLD_VIRTUAL_PROMPT { "" } - Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT - New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt - - function global:prompt { - Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " - _OLD_VIRTUAL_PROMPT - } - $env:VIRTUAL_ENV_PROMPT = $Prompt -} - -# Clear PYTHONHOME -if (Test-Path -Path Env:PYTHONHOME) { - Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME - Remove-Item -Path Env:PYTHONHOME -} - -# Add the venv to the PATH -Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH -$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/activate b/presets/workflow-preset/.venv-specify-smoke/bin/activate deleted file mode 100755 index a82b9f5d32..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/activate +++ /dev/null @@ -1,63 +0,0 @@ -# This file must be used with "source bin/activate" *from bash* -# you cannot run it directly - -deactivate () { - # reset old environment variables - if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then - PATH="${_OLD_VIRTUAL_PATH:-}" - export PATH - unset _OLD_VIRTUAL_PATH - fi - if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then - PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" - export PYTHONHOME - unset _OLD_VIRTUAL_PYTHONHOME - fi - - # Call hash to forget past commands. Without forgetting - # past commands the $PATH changes we made may not be respected - hash -r 2> /dev/null - - if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then - PS1="${_OLD_VIRTUAL_PS1:-}" - export PS1 - unset _OLD_VIRTUAL_PS1 - fi - - unset VIRTUAL_ENV - unset VIRTUAL_ENV_PROMPT - if [ ! "${1:-}" = "nondestructive" ] ; then - # Self destruct! - unset -f deactivate - fi -} - -# unset irrelevant variables -deactivate nondestructive - -VIRTUAL_ENV=/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke -export VIRTUAL_ENV - -_OLD_VIRTUAL_PATH="$PATH" -PATH="$VIRTUAL_ENV/"bin":$PATH" -export PATH - -# unset PYTHONHOME if set -# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) -# could use `if (set -u; : $PYTHONHOME) ;` in bash -if [ -n "${PYTHONHOME:-}" ] ; then - _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" - unset PYTHONHOME -fi - -if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then - _OLD_VIRTUAL_PS1="${PS1:-}" - PS1='(.venv-specify-smoke) '"${PS1:-}" - export PS1 - VIRTUAL_ENV_PROMPT='(.venv-specify-smoke) ' - export VIRTUAL_ENV_PROMPT -fi - -# Call hash to forget past commands. Without forgetting -# past commands the $PATH changes we made may not be respected -hash -r 2> /dev/null diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/activate.csh b/presets/workflow-preset/.venv-specify-smoke/bin/activate.csh deleted file mode 100755 index 8afc5dd8eb..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/activate.csh +++ /dev/null @@ -1,26 +0,0 @@ -# This file must be used with "source bin/activate.csh" *from csh*. -# You cannot run it directly. -# Created by Davide Di Blasi . -# Ported to Python 3.3 venv by Andrew Svetlov - -alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' - -# Unset irrelevant variables. -deactivate nondestructive - -setenv VIRTUAL_ENV /home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke - -set _OLD_VIRTUAL_PATH="$PATH" -setenv PATH "$VIRTUAL_ENV/"bin":$PATH" - - -set _OLD_VIRTUAL_PROMPT="$prompt" - -if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then - set prompt = '(.venv-specify-smoke) '"$prompt" - setenv VIRTUAL_ENV_PROMPT '(.venv-specify-smoke) ' -endif - -alias pydoc python -m pydoc - -rehash diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/activate.fish b/presets/workflow-preset/.venv-specify-smoke/bin/activate.fish deleted file mode 100755 index 21713d4b88..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/activate.fish +++ /dev/null @@ -1,69 +0,0 @@ -# This file must be used with "source /bin/activate.fish" *from fish* -# (https://fishshell.com/); you cannot run it directly. - -function deactivate -d "Exit virtual environment and return to normal shell environment" - # reset old environment variables - if test -n "$_OLD_VIRTUAL_PATH" - set -gx PATH $_OLD_VIRTUAL_PATH - set -e _OLD_VIRTUAL_PATH - end - if test -n "$_OLD_VIRTUAL_PYTHONHOME" - set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME - set -e _OLD_VIRTUAL_PYTHONHOME - end - - if test -n "$_OLD_FISH_PROMPT_OVERRIDE" - set -e _OLD_FISH_PROMPT_OVERRIDE - # prevents error when using nested fish instances (Issue #93858) - if functions -q _old_fish_prompt - functions -e fish_prompt - functions -c _old_fish_prompt fish_prompt - functions -e _old_fish_prompt - end - end - - set -e VIRTUAL_ENV - set -e VIRTUAL_ENV_PROMPT - if test "$argv[1]" != "nondestructive" - # Self-destruct! - functions -e deactivate - end -end - -# Unset irrelevant variables. -deactivate nondestructive - -set -gx VIRTUAL_ENV /home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke - -set -gx _OLD_VIRTUAL_PATH $PATH -set -gx PATH "$VIRTUAL_ENV/"bin $PATH - -# Unset PYTHONHOME if set. -if set -q PYTHONHOME - set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME - set -e PYTHONHOME -end - -if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" - # fish uses a function instead of an env var to generate the prompt. - - # Save the current fish_prompt function as the function _old_fish_prompt. - functions -c fish_prompt _old_fish_prompt - - # With the original prompt function renamed, we can override with our own. - function fish_prompt - # Save the return status of the last command. - set -l old_status $status - - # Output the venv prompt; color taken from the blue of the Python logo. - printf "%s%s%s" (set_color 4B8BBE) '(.venv-specify-smoke) ' (set_color normal) - - # Restore the return status of the previous command. - echo "exit $old_status" | . - # Output the original/"old" prompt. - _old_fish_prompt - end - - set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" - set -gx VIRTUAL_ENV_PROMPT '(.venv-specify-smoke) ' -end diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/markdown-it b/presets/workflow-preset/.venv-specify-smoke/bin/markdown-it deleted file mode 100755 index edf3a0e87b..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/markdown-it +++ /dev/null @@ -1,6 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -import sys -from markdown_it.cli.parse import main -if __name__ == '__main__': - sys.argv[0] = sys.argv[0].removesuffix('.exe') - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pip b/presets/workflow-preset/.venv-specify-smoke/bin/pip deleted file mode 100755 index cb76523f9c..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/pip +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -# -*- coding: utf-8 -*- -import re -import sys -from pip._internal.cli.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pip3 b/presets/workflow-preset/.venv-specify-smoke/bin/pip3 deleted file mode 100755 index cb76523f9c..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/pip3 +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -# -*- coding: utf-8 -*- -import re -import sys -from pip._internal.cli.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 b/presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 deleted file mode 100755 index cb76523f9c..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/pip3.11 +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -# -*- coding: utf-8 -*- -import re -import sys -from pip._internal.cli.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pygmentize b/presets/workflow-preset/.venv-specify-smoke/bin/pygmentize deleted file mode 100755 index 930e813301..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/pygmentize +++ /dev/null @@ -1,6 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -import sys -from pygments.cmdline import main -if __name__ == '__main__': - sys.argv[0] = sys.argv[0].removesuffix('.exe') - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 b/presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 deleted file mode 100755 index 290604fa94..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/pyjson5 +++ /dev/null @@ -1,6 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -import sys -from json5.tool import main -if __name__ == '__main__': - sys.argv[0] = sys.argv[0].removesuffix('.exe') - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/python b/presets/workflow-preset/.venv-specify-smoke/bin/python deleted file mode 120000 index b8a0adbbb9..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/python +++ /dev/null @@ -1 +0,0 @@ -python3 \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/python3 b/presets/workflow-preset/.venv-specify-smoke/bin/python3 deleted file mode 120000 index bf3a48c7d8..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/python3 +++ /dev/null @@ -1 +0,0 @@ -/opt/hostedtoolcache/Python/3.11.15/x64/bin/python3 \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/python3.11 b/presets/workflow-preset/.venv-specify-smoke/bin/python3.11 deleted file mode 120000 index b8a0adbbb9..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/python3.11 +++ /dev/null @@ -1 +0,0 @@ -python3 \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/specify b/presets/workflow-preset/.venv-specify-smoke/bin/specify deleted file mode 100755 index 01c91baff1..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/specify +++ /dev/null @@ -1,6 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -import sys -from specify_cli import main -if __name__ == '__main__': - sys.argv[0] = sys.argv[0].removesuffix('.exe') - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/bin/typer b/presets/workflow-preset/.venv-specify-smoke/bin/typer deleted file mode 100755 index d38149be5d..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/bin/typer +++ /dev/null @@ -1,6 +0,0 @@ -#!/home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke/bin/python3 -import sys -from typer.cli import main -if __name__ == '__main__': - sys.argv[0] = sys.argv[0].removesuffix('.exe') - sys.exit(main()) diff --git a/presets/workflow-preset/.venv-specify-smoke/lib64 b/presets/workflow-preset/.venv-specify-smoke/lib64 deleted file mode 120000 index 7951405f85..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/lib64 +++ /dev/null @@ -1 +0,0 @@ -lib \ No newline at end of file diff --git a/presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg b/presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg deleted file mode 100644 index 20a8e73e9d..0000000000 --- a/presets/workflow-preset/.venv-specify-smoke/pyvenv.cfg +++ /dev/null @@ -1,5 +0,0 @@ -home = /opt/hostedtoolcache/Python/3.11.15/x64/bin -include-system-site-packages = false -version = 3.11.15 -executable = /opt/hostedtoolcache/Python/3.11.15/x64/bin/python3.11 -command = /opt/hostedtoolcache/Python/3.11.15/x64/bin/python3 -m venv /home/runner/work/spec-kit-workflow-preset/spec-kit-workflow-preset/.venv-specify-smoke diff --git a/presets/workflow-preset/tests/test_preset_contract.py b/presets/workflow-preset/tests/test_preset_contract.py index 4309b355e9..98d57e8019 100644 --- a/presets/workflow-preset/tests/test_preset_contract.py +++ b/presets/workflow-preset/tests/test_preset_contract.py @@ -401,7 +401,7 @@ def test_preset_manifest_contract(self) -> None: self.assertEqual("1.0", data["schema_version"]) self.assertEqual("workflow-preset", data["preset"]["id"]) self.assertEqual("Workflow Preset", data["preset"]["name"]) - self.assertEqual("1.3.4", data["preset"]["version"]) + self.assertEqual("1.3.5", data["preset"]["version"]) self.assertEqual( "Behavior-first specification, design artifacts, and agent-native handoff orchestration", data["preset"]["description"], @@ -1123,6 +1123,7 @@ def test_contract_schemas_are_decoupled_json_files(self) -> None: self.assertIn("checked_sources", review_conclusion["required"]) data_side_effect_review = receipt["properties"]["data_side_effect_review"] self.assertIn("reviewed_diff_paths", data_side_effect_review["required"]) + self.assertIn("runtime_data_writes_found", data_side_effect_review["required"]) self.assertIn("mutation_findings", data_side_effect_review["required"]) def test_manifest_schema_declares_runtime_neutral_execution_mode(self) -> None: @@ -1887,6 +1888,95 @@ def test_validate_receipt_contract_rejects_unreviewed_diff_path_for_data_side_ef RECEIPT_PATH, ) + def test_validate_receipt_contract_requires_runtime_data_writes_found_for_code_review_task( + self, + ) -> None: + handoff = minimal_handoff(task_ids=["T099"], task_type="code_review") + handoff["allowed_read_paths"] = [TASKS_PATH, SERVICE_PATH] + + with self.assertRaisesRegex(ValueError, "runtime_data_writes_found"): + validate_receipt_contract( + handoff, + minimal_receipt( + task_ids=["T099"], + task_type="code_review", + review_conclusion={ + "status": "approved", + "summary": "Review complete.", + "checked_sources": [SERVICE_PATH], + "findings": [], + }, + data_side_effect_review={ + "reviewed_diff_paths": [SERVICE_PATH], + "mutation_findings": [], + }, + ), + RECEIPT_PATH, + ) + + def test_validate_receipt_contract_requires_mutation_findings_for_code_review_task( + self, + ) -> None: + handoff = minimal_handoff(task_ids=["T099"], task_type="code_review") + handoff["allowed_read_paths"] = [TASKS_PATH, SERVICE_PATH] + + with self.assertRaisesRegex(ValueError, "mutation_findings"): + validate_receipt_contract( + handoff, + minimal_receipt( + task_ids=["T099"], + task_type="code_review", + review_conclusion={ + "status": "approved", + "summary": "Review complete.", + "checked_sources": [SERVICE_PATH], + "findings": [], + }, + data_side_effect_review={ + "reviewed_diff_paths": [SERVICE_PATH], + "runtime_data_writes_found": False, + }, + ), + RECEIPT_PATH, + ) + + def test_validate_receipt_contract_rejects_malformed_data_side_effect_finding( + self, + ) -> None: + handoff = minimal_handoff(task_ids=["T099"], task_type="code_review") + handoff["allowed_read_paths"] = [TASKS_PATH, SERVICE_PATH] + + with self.assertRaisesRegex(ValueError, "mutation_findings\\[0\\] must include id"): + validate_receipt_contract( + handoff, + minimal_receipt( + task_ids=["T099"], + task_type="code_review", + review_conclusion={ + "status": "approved", + "summary": "Review complete.", + "checked_sources": [SERVICE_PATH], + "findings": [], + }, + data_side_effect_review={ + "reviewed_diff_paths": [SERVICE_PATH], + "runtime_data_writes_found": True, + "mutation_findings": [ + { + "severity": "low", + "category": "field_level_update", + "summary": "Missing id should fail validation.", + "operation": "update", + "tables_or_entities": ["orders"], + "fields": ["status"], + "resolution": "accepted", + } + ], + }, + ), + RECEIPT_PATH, + ) + def test_validate_receipt_contract_rejects_approved_with_unresolved_high_data_side_effect( self, ) -> None: @@ -2474,7 +2564,8 @@ def _workflow_on(self, workflow: dict) -> dict: def test_github_actions_contract_workflow(self) -> None: workflow_path = REPO_ROOT / ".github" / "workflows" / "ci.yml" - self.assertTrue(workflow_path.exists()) + if not workflow_path.exists(): + self.skipTest("GitHub Actions workflow is not bundled in spec-kit checkout") workflow = yaml.safe_load(workflow_path.read_text(encoding="utf-8")) self.assertEqual("Preset Contract", workflow["name"]) @@ -2496,7 +2587,8 @@ def test_github_actions_contract_workflow(self) -> None: def test_github_actions_artifact_release_and_integration_pr_workflow(self) -> None: workflow_path = REPO_ROOT / ".github" / "workflows" / "preset-artifact.yml" - self.assertTrue(workflow_path.exists()) + if not workflow_path.exists(): + self.skipTest("GitHub Actions workflow is not bundled in spec-kit checkout") workflow = yaml.safe_load(workflow_path.read_text(encoding="utf-8")) self.assertEqual("Preset Artifact", workflow["name"]) diff --git a/presets/workflow-preset/validators/speckit_implement_contract.py b/presets/workflow-preset/validators/speckit_implement_contract.py index d23986a919..8ab19874cd 100644 --- a/presets/workflow-preset/validators/speckit_implement_contract.py +++ b/presets/workflow-preset/validators/speckit_implement_contract.py @@ -185,6 +185,26 @@ def _unresolved_high_or_critical(finding: dict[str, Any]) -> bool: ) +def _validate_data_side_effect_finding(finding: Any, *, index: int) -> None: + if not isinstance(finding, dict): + raise ValueError( + f"data_side_effect_review mutation_findings[{index}] must be an object" + ) + + context = f"data_side_effect_review mutation_findings[{index}]" + for key in ("id", "severity", "category", "summary", "operation", "resolution"): + if not isinstance(finding.get(key), str) or not finding.get(key): + raise ValueError(f"{context} must include {key}") + + for key in ("tables_or_entities", "fields"): + values = finding.get(key) + if ( + not isinstance(values, list) + or any(not isinstance(value, str) or not value for value in values) + ): + raise ValueError(f"{context} must include {key}") + + def validate_behavior_draft_contract( scenarios_draft: dict[str, Any], data_fixtures_intent: dict[str, Any], @@ -564,6 +584,18 @@ def validate_receipt_contract( f"allowed_read_paths or context_digest_path: {path}" ) + runtime_data_writes_found = data_side_effect_review.get( + "runtime_data_writes_found" + ) + if not isinstance(runtime_data_writes_found, bool): + raise ValueError( + "data_side_effect_review must include runtime_data_writes_found" + ) + + mutation_findings = data_side_effect_review.get("mutation_findings") + if not isinstance(mutation_findings, list): + raise ValueError("data_side_effect_review must include mutation_findings") + validation_commands = list(handoff.get("validation_commands", [])) if validation_commands and not _receipt_mentions_any_command( receipt, @@ -590,7 +622,8 @@ def validate_receipt_contract( "critical/high findings" ) - for finding in data_side_effect_review.get("mutation_findings", []): + for index, finding in enumerate(mutation_findings): + _validate_data_side_effect_finding(finding, index=index) if review_status == "approved" and _unresolved_high_or_critical(finding): raise ValueError( "approved code review receipt must not include unresolved " diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py index 9257cd4022..cc9392c542 100644 --- a/tests/integrations/test_cli.py +++ b/tests/integrations/test_cli.py @@ -992,8 +992,8 @@ def test_workflow_preset_registers_commands_and_composes_wrappers(self, tmp_path preset_registry = json.loads((project / ".specify" / "presets" / ".registry").read_text()) workflow_entry = preset_registry["presets"]["workflow-preset"] installed_manifest = yaml.safe_load((preset_dir / "preset.yml").read_text(encoding="utf-8")) - assert installed_manifest["preset"]["version"] == "1.3.4" - assert workflow_entry["version"] == "1.3.4" + assert installed_manifest["preset"]["version"] == "1.3.5" + assert workflow_entry["version"] == "1.3.5" assert workflow_entry["version"] == installed_manifest["preset"]["version"] expected_preset_commands = { "speckit.specify", diff --git a/tests/test_presets.py b/tests/test_presets.py index 1ba20be8e7..3898f992af 100644 --- a/tests/test_presets.py +++ b/tests/test_presets.py @@ -3558,8 +3558,8 @@ def test_community_smoke_checks_wheel_assets_and_extension_dev_reinstall(self): assert ( 'registry = json.loads(Path(".specify/presets/.registry").read_text(encoding="utf-8"))' ) in verify_run - assert 'manifest_version == "1.3.4"' in verify_run - assert 'registry_version == "1.3.4"' in verify_run + assert 'manifest_version == "1.3.5"' in verify_run + assert 'registry_version == "1.3.5"' in verify_run assert "registry_version == manifest_version" in verify_run assert ( 'for extension_id in arch preview repository-governance; do'