From d579760e68d331ab8a3ac318dcac138e5a6814be Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Fri, 10 Jul 2026 00:47:22 +1000 Subject: [PATCH] punk::mix::commandset::project 0.2.1: -layout prefix-match validation fix project::new documented -choices on -layout with -choiceprefix defaulting to true (prefix matching promised), but the manual dict merge parser accepted arbitrary values with no validation or normalization. Added tcl::prefix::match against the documented layout choices so the parser now validates and normalizes -layout values, matching the PUNKARGS documentation. Assisted-by: harness=opencode; primary-model=openrouter/z-ai/glm-5.2; api-location=openrouter.ai --- src/modules/punk/mix/commandset/project-999999.0a1.0.tm | 3 +++ src/modules/punk/mix/commandset/project-buildversion.txt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/punk/mix/commandset/project-999999.0a1.0.tm b/src/modules/punk/mix/commandset/project-999999.0a1.0.tm index d95780b8..81a97f11 100644 --- a/src/modules/punk/mix/commandset/project-999999.0a1.0.tm +++ b/src/modules/punk/mix/commandset/project-999999.0a1.0.tm @@ -168,6 +168,9 @@ namespace eval punk::mix::commandset::project { } set opts [dict merge $defaults $args] # -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + #validate -layout against documented choices with prefix matching (punk::args -choiceprefix defaults to true) + dict set opts -layout [tcl::prefix::match -message "project.new -layout" $::punk::mix::commandset::project::argdoc::LAYOUTNAMES [dict get $opts -layout]] + # -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- set opt_type [dict get $opts -type] if {$opt_type ni [punk::mix::cli::lib::module_types]} { error "deck new error - unknown type '$opt_type' known types: [punk::mix::cli::lib::module_types]" diff --git a/src/modules/punk/mix/commandset/project-buildversion.txt b/src/modules/punk/mix/commandset/project-buildversion.txt index 60d278d3..33a8ca4d 100644 --- a/src/modules/punk/mix/commandset/project-buildversion.txt +++ b/src/modules/punk/mix/commandset/project-buildversion.txt @@ -1,5 +1,6 @@ -0.2.0 +0.2.1 #First line must be a semantic version number #all other lines are ignored. +#0.2.1 - fix: -layout now validated and normalized via tcl::prefix::match against documented layout choices, matching the PUNKARGS -choiceprefix default (true); previously the manual parser accepted arbitrary values with no validation #0.2.0 - updated punkcheck::install call sites to use -exclude-paths / -exclude-paths-core (replaced -antiglob-paths + -exclude-dirsegments) — call-site API change warrants minor bump #0.2.0 - updated call sites to use hyphenated flag names (-punkcheck-folder, -exclude-paths-core)