@skitterbyte/skitterspec-azure-boards 3.2.3 → 3.2.5

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": "@skitterbyte/skitterspec-azure-boards",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
4
4
  "description": "Spec-driven development for Claude Code, with one-way Azure Boards sync — a superset of @skitterbyte/skitterspec: the base filesystem workflow plus /spec-status · /spec-push · /spec-claim and the spec-sync CLI, mirroring specs to Azure DevOps work items with parent/child hierarchy, assignment and a release work item per tag. The repo is canonical; Boards is a generated mirror. Install this OR the base OR one other superset — exactly one.",
5
5
  "keywords": [
6
6
  "claude",
package/src/env/resume.js CHANGED
@@ -98,10 +98,19 @@ function frontmatterField(text, field) {
98
98
  return m ? m[1].trim().replace(/^["']|["']$/g, '') || null : null
99
99
  }
100
100
 
101
- // `#241`, `241` and `"#241"` are one ticket; `ABC-88` only ever matches itself.
101
+ // `#241`, `241` and `"#241"` are one ticket, and so are `AB#241` and either of
102
+ // them: a typed ref without the tracker's prefix is matched on its number. Two
103
+ // different prefixes (`AB#241`, `XY#241`) never match, and `ABC-88` only ever
104
+ // matches itself.
102
105
  function sameRef(a, b) {
103
- const norm = (s) => String(s).trim().replace(/^#/, '').toLowerCase()
104
- return Boolean(a) && Boolean(b) && norm(a) === norm(b)
106
+ if (!a || !b) return false
107
+ const parse = (s) => {
108
+ const m = /^([a-z]*)#(\d+)$/.exec(String(s).trim().toLowerCase())
109
+ return m ? { prefix: m[1], id: m[2] } : { prefix: '', id: String(s).trim().toLowerCase() }
110
+ }
111
+ const x = parse(a)
112
+ const y = parse(b)
113
+ return x.id === y.id && (!x.prefix || !y.prefix || x.prefix === y.prefix)
105
114
  }
106
115
 
107
116
  // Which copy speaks for a spec: its own worktree, then a branch (local before
package/src/provider.js CHANGED
@@ -90,6 +90,67 @@ function registerConfiguredProvider({ cwd, envConfig, idea, resolve = resolvePac
90
90
  return { provider: p.name, registered: 'config' }
91
91
  }
92
92
 
93
+ // The configured provider's own bin, installed beside the base or in the
94
+ // project, or null when it is not installed. `candidates` narrows where to
95
+ // look: an install takes only the published superset, since the workspace
96
+ // source package's assets are uncomposed and its bin refuses to install them.
97
+ function providerBin(p, dir, resolve, candidates = p.candidates) {
98
+ const bin = join('bin', `skitterspec-${p.name}.js`)
99
+ for (const [pkg] of candidates) {
100
+ const root = resolve(pkg, [__dirname, dir])
101
+ if (root && existsSync(join(root, bin))) return join(root, bin)
102
+ }
103
+ return null
104
+ }
105
+
106
+ /**
107
+ * Run `init`, `update`, `enable` or `uninstall` for a project with a provider
108
+ * configured through that provider's own bin. The install set is a
109
+ * distribution's own `assets/`, and the base's lacks the provider's skills,
110
+ * seams and docs — so the base installing it would prune and rewrite them
111
+ * (bug-base-update-clobbers-provider). `update --all` is not forwarded: it
112
+ * runs each project's own distribution itself.
113
+ *
114
+ * `target` is the folder the verb acts on (`--dir`, else its positional,
115
+ * else cwd). Returns the exit status, or `null` when the base installs as it
116
+ * always has: another verb, or no provider configured.
117
+ *
118
+ * WHAT WOULD FOOL THIS: a provider installed where Node's resolution cannot
119
+ * see it from the base or the project reads as not installed — and the verb is
120
+ * refused, naming the package, rather than falling back to the base set. Two
121
+ * provider configs is a project this cannot read, refused the same way.
122
+ */
123
+ const INSTALL_VERBS = ['init', 'update', 'enable', 'uninstall']
124
+
125
+ function forwardInstallCommand({ cwd, argv, target = cwd, resolve = resolvePackage, warn = () => {}, spawn = spawnSync }) {
126
+ const [cmd, ...rest] = argv
127
+ if (!INSTALL_VERBS.includes(cmd)) return null
128
+ if (cmd === 'update' && rest.includes('--all')) return null
129
+ if (rest.includes('--help') || rest.includes('-h')) return null
130
+ const dir = projectDir(target)
131
+ if (!dir) return null
132
+ const configured = PROVIDERS.filter((p) => existsSync(join(dir, p.configFile)))
133
+ if (configured.length === 0) return null
134
+ if (configured.length > 1) {
135
+ warn(
136
+ `skitterspec: more than one ticketing provider is configured here (${configured.map((p) => p.configFile).join(', ')}) — ` +
137
+ `${cmd} refused: keep one, then run it again`,
138
+ )
139
+ return 1
140
+ }
141
+ const p = configured[0]
142
+ const bin = providerBin(p, dir, resolve, p.candidates.slice(0, 1))
143
+ if (bin) {
144
+ const r = spawn(process.execPath, [bin, ...argv], { cwd, stdio: 'inherit' })
145
+ return r.status ?? 1
146
+ }
147
+ warn(
148
+ `skitterspec: ${cmd} refused — ${p.configFile} is here but @skitterbyte/skitterspec-${p.name} is not installed beside this one, ` +
149
+ `and the base set would overwrite its skills. Install it alongside @skitterbyte/skitterspec, at the latest of each.`,
150
+ )
151
+ return 1
152
+ }
153
+
93
154
  /**
94
155
  * Run a verb the base does not ship (`commands`, e.g. `spec-sync`) on the
95
156
  * provider configured in the project at or above `cwd`, through that
@@ -119,13 +180,10 @@ function forwardProviderCommand({
119
180
  const configured = PROVIDERS.filter((p) => existsSync(join(dir, p.configFile)))
120
181
  if (configured.length !== 1) return null
121
182
  const p = configured[0]
122
- const bin = join('bin', `skitterspec-${p.name}.js`)
123
- for (const [pkg] of p.candidates) {
124
- const root = resolve(pkg, [__dirname, dir])
125
- if (root && existsSync(join(root, bin))) {
126
- const r = spawn(process.execPath, [join(root, bin), ...argv], { cwd, stdio: 'inherit' })
127
- return r.status ?? 1
128
- }
183
+ const bin = providerBin(p, dir, resolve)
184
+ if (bin) {
185
+ const r = spawn(process.execPath, [bin, ...argv], { cwd, stdio: 'inherit' })
186
+ return r.status ?? 1
129
187
  }
130
188
  warn(
131
189
  `skitterspec: ${cmd} needs @skitterbyte/skitterspec-${p.name} installed beside this one — ` +
@@ -134,4 +192,4 @@ function forwardProviderCommand({
134
192
  return 1
135
193
  }
136
194
 
137
- module.exports = { registerConfiguredProvider, forwardProviderCommand, PROVIDERS }
195
+ module.exports = { registerConfiguredProvider, forwardProviderCommand, forwardInstallCommand, INSTALL_VERBS, PROVIDERS }
package/src/updateall.js CHANGED
@@ -62,16 +62,16 @@ function inPrimary(dir, git) {
62
62
  }
63
63
 
64
64
  /**
65
- * The distribution that owns a project: what its manifest recorded, else the
66
- * provider whose config is in `specs/.core/`, else the base. Inferred only for
67
- * manifests written before the field existed.
65
+ * The distribution that owns a project: the one provider whose config is in
66
+ * `specs/.core/`, else what its manifest recorded, else the base. The config
67
+ * wins because a bare base `update` used to rewrite the manifest's field to
68
+ * the base (bug-base-update-clobbers-provider), so the field alone can name
69
+ * the wrong set; two configs is unreadable, and the manifest decides.
68
70
  */
69
71
  function distributionOf(dir, manifest, exists) {
70
- if (manifest.distribution) return manifest.distribution
71
- for (const p of PROVIDERS) {
72
- if (exists(path.join(dir, 'specs', '.core', `${p}.config.json`))) return `${BASE}-${p}`
73
- }
74
- return BASE
72
+ const configured = PROVIDERS.filter((p) => exists(path.join(dir, 'specs', '.core', `${p}.config.json`)))
73
+ if (configured.length === 1) return `${BASE}-${configured[0]}`
74
+ return manifest.distribution || BASE
75
75
  }
76
76
 
77
77
  const binOf = (pkg) => pkg.replace(/^@skitterbyte\//, '')