@windyroad/jtbd 0.12.7-preview.775 → 0.12.7-preview.786

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/jtbd",
3
- "version": "0.12.7-preview.775",
3
+ "version": "0.12.7-preview.786",
4
4
  "description": "Jobs-to-be-done enforcement for UI changes",
5
5
  "bin": {
6
6
  "windyroad-jtbd": "./bin/install.mjs"
@@ -44,12 +44,16 @@ JTBD_DIR="${2:-docs/jtbd}"
44
44
  file=""
45
45
  if [ -f "$REF" ]; then
46
46
  file="$REF"
47
- elif printf '%s' "$REF" | grep -qiE 'JTBD-?[0-9]+|^[0-9]+$'; then
48
- # Job ref: JTBD-NNN or a bare numeric. Match the per-persona job file.
49
- num="$(printf '%s' "$REF" | grep -oE '[0-9]+' | head -1)"
50
- [ -n "$num" ] || { echo "is-job-or-persona-unconfirmed: cannot parse job id from '$REF'" >&2; exit 2; }
47
+ elif printf '%s' "$REF" | grep -qiE '^JTBD-|^[0-9]+$|^[A-Za-z]+-[0-9]+$'; then
48
+ # Job ref: JTBD-NNN | JTBD-M-NNN (maintainer alpha-infix scheme, P383) |
49
+ # M-NNN | bare NNN. Strip an optional JTBD- prefix to get the filename stem,
50
+ # PRESERVING any alpha infix (extracting only the numeric run would drop the
51
+ # `M` and mis-glob JTBD-NNN-*.md). Glob both the JTBD-prefixed and bare-stem
52
+ # filename shapes, first match wins.
53
+ stem="$(printf '%s' "$REF" | sed -E 's/^[Jj][Tt][Bb][Dd]-//')"
54
+ [ -n "$stem" ] || { echo "is-job-or-persona-unconfirmed: cannot parse job id from '$REF'" >&2; exit 2; }
51
55
  shopt -s nullglob
52
- for cand in "$JTBD_DIR"/*/JTBD-"$num"-*.md "$JTBD_DIR"/*/"$num"-*.md; do
56
+ for cand in "$JTBD_DIR"/*/JTBD-"$stem"-*.md "$JTBD_DIR"/*/"$stem"-*.md; do
53
57
  file="$cand"; break
54
58
  done
55
59
  shopt -u nullglob
@@ -95,6 +95,37 @@ mk_job() {
95
95
  [[ "$output" == *"JTBD-002-ship-with-confidence.md"* ]]
96
96
  }
97
97
 
98
+ # P383: maintainer JTBD-M-NNN alpha-infix scheme. The old number-only
99
+ # extraction dropped the `M` and globbed JTBD-NNN-*.md (wrong / no match).
100
+ @test "a maintainer JTBD-M-NNN job ref resolves (exit 0, preserves M infix)" {
101
+ mk_job "maintainer" "M-101" "release-plugins" "no"
102
+ run bash "$SCRIPT" "JTBD-M-101" "$DIR/docs/jtbd"
103
+ [ "$status" -eq 0 ]
104
+ [[ "$output" == *"JTBD-M-101-release-plugins.md"* ]]
105
+ }
106
+
107
+ @test "a confirmed maintainer JTBD-M-NNN job is confirmed (exit 1)" {
108
+ mk_job "maintainer" "M-202" "audit-suite" "yes"
109
+ run bash "$SCRIPT" "JTBD-M-202" "$DIR/docs/jtbd"
110
+ [ "$status" -eq 1 ]
111
+ }
112
+
113
+ @test "a bare M-NNN job ref variant resolves" {
114
+ mk_job "maintainer" "M-303" "scaffold-intake" "no"
115
+ run bash "$SCRIPT" "M-303" "$DIR/docs/jtbd"
116
+ [ "$status" -eq 0 ]
117
+ [[ "$output" == *"JTBD-M-303-scaffold-intake.md"* ]]
118
+ }
119
+
120
+ # Boundary lock (architect P383 review): a hyphenated persona NAME must still
121
+ # route to the persona branch, not the job branch — it has no trailing -NNN.
122
+ @test "a hyphenated persona name (smb-owner) routes to the persona branch" {
123
+ mk_persona "smb-owner" "no"
124
+ run bash "$SCRIPT" "smb-owner" "$DIR/docs/jtbd"
125
+ [ "$status" -eq 0 ]
126
+ [[ "$output" == *"smb-owner/persona.md"* ]]
127
+ }
128
+
98
129
  @test "a direct path ref resolves" {
99
130
  mk_persona "plugin-user" "no"
100
131
  run bash "$SCRIPT" "$DIR/docs/jtbd/plugin-user/persona.md"