@skitterbyte/skitterspec-linear 18.1.0 → 18.1.1

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.
@@ -292,8 +292,11 @@ through to a documented conservative default; see the field notes below.
292
292
  // one. Empty (the default) = the built-in tagger.
293
293
  //
294
294
  // `bump` is the built-in tagger's strategy: "patch" (v33.16.4 -> v33.16.5) or
295
- // "hotfix-suffix" (v33.16.4 -> v33.16.4-hotfix.1, then -hotfix.2, ...; a base
296
- // that is already a hotfix tag continues its line). Any other value is refused
295
+ // "hotfix-suffix" (v33.16.4 -> v33.16.4-hotfix.1, then -hotfix.2, ...). Under
296
+ // either, a base that is already a hotfix tag continues its line
297
+ // (v36.2.3-hotfix.4 -> v36.2.3-hotfix.5), so "patch" never takes a number the
298
+ // mainline owns. When the patch tag already exists, the refusal names the
299
+ // free hotfix tag that "hotfix-suffix" would cut. Any other value is refused
297
300
  // when `hotfix land` runs. Tags order X.Y.Z-rc.N < X.Y.Z < X.Y.Z-hotfix.N <
298
301
  // X.Y.(Z+1), the same as skittership.
299
302
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skitterbyte/skitterspec-linear",
3
- "version": "18.1.0",
3
+ "version": "18.1.1",
4
4
  "description": "Spec-driven development for Claude Code, with one-way Linear sync — a superset of @skitterbyte/skitterspec: the base filesystem workflow plus /spec-status · /spec-push and the spec-sync CLI. The repo is canonical; Linear is a generated mirror. Install this OR the base, not both.",
5
5
  "keywords": [
6
6
  "claude",
package/src/env/hotfix.js CHANGED
@@ -114,12 +114,38 @@ const BUMPS = ['patch', 'hotfix-suffix']
114
114
  // The tag `hotfix.bump` asks for. An unknown strategy throws rather than
115
115
  // falling back to `patch`: a typo there would otherwise cut the wrong release
116
116
  // line and say nothing.
117
+ //
118
+ // Under `patch`, a base that is ITSELF a `-hotfix.N` tag continues that line.
119
+ // Bumping its patch takes X.Y.(Z+1), a number the mainline owns: refused when
120
+ // the mainline already cut it, and minted silently when it had not. Only a
121
+ // parsed hotfix suffix routes here; an rc or any other suffix keeps the patch
122
+ // bump, so a base we cannot read as a hotfix line is never treated as one.
117
123
  function nextTag(baseTag, existingTags, bump = 'patch') {
118
- if (bump === 'patch') return bumpPatch(baseTag)
124
+ if (bump === 'patch') {
125
+ const base = parseTag(baseTag)
126
+ if (base && base.hotfix !== null) return nextHotfixTag(baseTag, existingTags)
127
+ return bumpPatch(baseTag)
128
+ }
119
129
  if (bump === 'hotfix-suffix') return nextHotfixTag(baseTag, existingTags)
120
130
  throw new Error(`unknown hotfix.bump "${bump}" — use one of: ${BUMPS.join(', ')}`)
121
131
  }
122
132
 
133
+ // What a collision refusal offers: the free tag on the same base's hotfix
134
+ // line, which is never taken by a mainline release. Never a deletion and never
135
+ // another base — the first destroys a released tag, the second forks from a
136
+ // version prod is not running. Empty where the suffix line cannot be derived
137
+ // (an rc base) or is already the strategy, so the refusal just names the tag.
138
+ function freeTagHint(baseTag, existingTags, bump) {
139
+ if (bump !== 'patch') return ''
140
+ let free
141
+ try {
142
+ free = nextHotfixTag(baseTag, existingTags)
143
+ } catch {
144
+ return ''
145
+ }
146
+ return ` — set hotfix.bump "hotfix-suffix" in env.config.json to cut ${free} instead`
147
+ }
148
+
123
149
  // A filesystem/branch-safe slug derived from a tag (`v30.2.1` → `v30-2-1`).
124
150
  function tagSlug(tag) {
125
151
  return String(tag)
@@ -206,7 +232,7 @@ function planHotfixLand(spec, config, ctx) {
206
232
  } else {
207
233
  prodTag = nextTag(baseRef, c.existingTags, bump)
208
234
  if (taken.has(prodTag)) {
209
- return block(`tag ${prodTag} already exists — bump the base version or delete the stale tag`)
235
+ return block(`tag ${prodTag} already exists${freeTagHint(baseRef, c.existingTags, bump)}`)
210
236
  }
211
237
  taken.add(prodTag)
212
238
  commands.push(`git -C ${spec.worktreePath} tag ${prodTag}`)
@@ -248,7 +274,7 @@ function planHotfixLand(spec, config, ctx) {
248
274
  // hotfix numbers rather than colliding on the same one.
249
275
  const tag = nextTag(t, [...taken], bump)
250
276
  if (taken.has(tag)) {
251
- return block(`tag ${tag} (for target ${t}) already exists — resolve it before landing`)
277
+ return block(`tag ${tag} (for target ${t}) already exists${freeTagHint(t, [...taken], bump)}`)
252
278
  }
253
279
  taken.add(tag)
254
280
  const slug = `${spec.slug}-onto-${tagSlug(t)}`