@skitterbyte/skitterspec-github 1.0.0 → 1.0.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.
package/MIGRATION.md CHANGED
@@ -100,6 +100,25 @@ Nothing in `env.config.json` changes.
100
100
  **If you added a secrets-hook exception for the printed seed commands**, you
101
101
  can remove it now. Nothing shipped prints them any more.
102
102
 
103
+ ## `@skitterbyte/skitterspec-azure-boards` v0 → v1 (first release)
104
+
105
+ Nothing to migrate: this is the distribution's first release. It is a superset
106
+ of `@skitterbyte/skitterspec` — install exactly one of the base or one
107
+ superset. Coming from the base, run `npx @skitterbyte/skitterspec-azure-boards
108
+ update` and run `/spec-azure-setup`
109
+ (or `skitterspec-azure-boards spec-sync init-config --org-url … --project …`).
110
+
111
+ **Coming from `@skitterbyte/skitterspec-linear` or `-jira`** — a repo moving
112
+ trackers: swap the distribution, configure Azure as above, set
113
+ `refs.foreignPatterns` to the old team key (e.g. `"ERQ-\\d+"`), then push each
114
+ backlog and in-progress spec (`/spec-push`, or `spec-sync apply --all
115
+ in-progress` and `--all backlog`) to link it to a new work item. Finished specs
116
+ keep their old stamps (`linear_identifier`, …) as history; nothing rewrites
117
+ them. Old `Refs: ERQ-12` trailers stay in the log, and `spec-sync released`
118
+ counts them as `historical` rather than as missing a ref. New commits carry
119
+ `Refs: AB#n`. Delete the old `linear.config.json` / `jira.config.json` once the
120
+ open specs are linked.
121
+
103
122
  ## `@skitterbyte/skitterspec-github` v0 → v1 (first release)
104
123
 
105
124
  Nothing to migrate: this is the distribution's first release. It is a superset
@@ -85,7 +85,7 @@ function findEngine(projectDir) {
85
85
  if (process.env.SKITTERSPEC_BIN) return process.env.SKITTERSPEC_BIN
86
86
  let at = projectDir
87
87
  for (let i = 0; i < 6 && at; i++) {
88
- for (const name of ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github']) {
88
+ for (const name of ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github', 'skitterspec-azure-boards']) {
89
89
  const candidate = path.join(at, 'node_modules', '.bin', name)
90
90
  if (fs.existsSync(candidate)) return candidate
91
91
  }
@@ -82,7 +82,7 @@ function findEngine(projectDir) {
82
82
  if (process.env.SKITTERSPEC_BIN) return process.env.SKITTERSPEC_BIN
83
83
  let at = projectDir
84
84
  for (let i = 0; i < 6 && at; i++) {
85
- for (const name of ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github']) {
85
+ for (const name of ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github', 'skitterspec-azure-boards']) {
86
86
  const candidate = path.join(at, 'node_modules', '.bin', name)
87
87
  if (fs.existsSync(candidate)) return candidate
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skitterbyte/skitterspec-github",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Spec-driven development for Claude Code, with one-way GitHub 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 GitHub Issues, sub-issues and a Projects v2 board, with GitHub Releases. The repo is canonical; GitHub is a generated mirror. Install this OR the base OR one other superset — exactly one.",
5
5
  "keywords": [
6
6
  "claude",
package/src/cli.js CHANGED
@@ -165,7 +165,13 @@ const { planHotfixLand, planHotfixFinish } = require('./env/hotfix.js')
165
165
  const { runHotfixLand, describeStep: describeHotfixStep } = require('./env/hotfixland.js')
166
166
  const { planDev } = require('./env/dev.js')
167
167
  const { startProcess, stopProcess, waitHealthy, readPid, isAlive } = require('./env/supervise.js')
168
- const { renderRoutes, portsInUse, portsInUseOn, waitListening } = require('./env/proxy.js')
168
+ const {
169
+ renderRoutes,
170
+ portsHeld,
171
+ portsAnswering,
172
+ portsInUseOn,
173
+ waitListening,
174
+ } = require('./env/proxy.js')
169
175
  const {
170
176
  mintToken,
171
177
  servableSpecs,
@@ -185,7 +191,7 @@ const pkg = require('../package.json')
185
191
  // supersets the hand-off names both where both ship the command, and the one
186
192
  // that does where only one does.
187
193
  const PROVIDER_COMMANDS = {
188
- 'spec-sync': '@skitterbyte/skitterspec-linear, @skitterbyte/skitterspec-jira or @skitterbyte/skitterspec-github',
194
+ 'spec-sync': '@skitterbyte/skitterspec-linear, @skitterbyte/skitterspec-jira, @skitterbyte/skitterspec-github or @skitterbyte/skitterspec-azure-boards',
189
195
  'spec-sanitise': '@skitterbyte/skitterspec-linear',
190
196
  }
191
197
 
@@ -4988,7 +4994,7 @@ async function specEnvConnect(dir, config, specArg) {
4988
4994
  // Stop any proxy we already run (a previous connect), freeing the canonical
4989
4995
  // ports, then refuse if the primary checkout still holds one of them.
4990
4996
  await stopProcess(proxyProc, { rootDir: dir })
4991
- const busy = await portsInUse(routes.map((r) => r.frontPort), config.proxy.host)
4997
+ const busy = await portsHeld(routes.map((r) => r.frontPort), config.proxy.host)
4992
4998
  if (busy.length) {
4993
4999
  process.stdout.write(
4994
5000
  `spec-connect: canonical port(s) ${busy.join(', ')} are in use (your main dev server?).\n` +
@@ -5199,7 +5205,7 @@ async function specEnvLiveTake(dir, config, specArg, flags = {}) {
5199
5205
  const canonicalPorts = config.dev.map((d) => d.frontPort).filter((p) => typeof p === 'number')
5200
5206
  let serverUp = null
5201
5207
  if (canonicalPorts.length) {
5202
- const up = await portsInUse(canonicalPorts, config.proxy.host)
5208
+ const up = await portsAnswering(canonicalPorts, config.proxy.host)
5203
5209
  serverUp = up.length === canonicalPorts.length
5204
5210
  }
5205
5211
 
package/src/env/proxy.js CHANGED
@@ -167,12 +167,45 @@ async function portsInUseOn(port, hosts, probe = portsInUse) {
167
167
  return [...new Set(busy)]
168
168
  }
169
169
 
170
+ /**
171
+ * Which of `ports` accept a connection on `host` — "is a dev server running?".
172
+ *
173
+ * CONNECTS, never binds. A bind probe on 127.0.0.1 SUCCEEDS on macOS beside a
174
+ * server listening on every address (Vite `host: true`, Fastify `0.0.0.0`),
175
+ * because BSD lets the two coexist, so it read a running phone-on-wifi dev
176
+ * server as absent. Linux refuses the second bind, which is why CI never saw
177
+ * it. A server that answers is running on any OS. What could still fool it: a
178
+ * server bound only to a non-loopback address, which `host` does not reach.
179
+ */
180
+ async function portsAnswering(ports, host = '127.0.0.1') {
181
+ const results = await Promise.all(ports.map((p) => checkListening(p, host)))
182
+ return ports.filter((_, i) => results[i])
183
+ }
184
+
185
+ /**
186
+ * Which of `ports` are taken for a new listener on `host` — "may the proxy
187
+ * have these?". Busy when the bind fails OR something already answers.
188
+ *
189
+ * The bind alone is not enough on macOS: beside a wildcard listener it
190
+ * succeeds, and the proxy would then own `localhost` while LAN clients still
191
+ * reach the old server — two apps behind one port number. The connect catches
192
+ * that. SEQUENTIAL, bind first: the bind probe's own listener is closed before
193
+ * the connect runs, so the connect can never find the probe itself.
194
+ */
195
+ async function portsHeld(ports, host = '127.0.0.1') {
196
+ const bound = await portsInUse(ports, host)
197
+ const answering = await portsAnswering(ports, host)
198
+ return ports.filter((p) => bound.includes(p) || answering.includes(p))
199
+ }
200
+
170
201
  module.exports = {
171
202
  renderRoutes,
172
203
  createRouteServer,
173
204
  startProxy,
174
205
  portsInUse,
175
206
  portsInUseOn,
207
+ portsAnswering,
208
+ portsHeld,
176
209
  waitListening,
177
210
  }
178
211
 
package/src/init.js CHANGED
@@ -125,7 +125,7 @@ function detectPackageManager(dir) {
125
125
 
126
126
  // The bin names a distribution may expose. A provider superset ships its own
127
127
  // name alongside `skitterspec`, and either proves the engine is reachable.
128
- const ENGINE_BINS = ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github']
128
+ const ENGINE_BINS = ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github', 'skitterspec-azure-boards']
129
129
 
130
130
  function binNames() {
131
131
  return process.platform === 'win32'
@@ -914,8 +914,8 @@ function resync(dir, { force = false, claudeMd = true, diff = false } = {}) {
914
914
  // never delete spec content or active config (defense-in-depth — the manifest
915
915
  // never lists these, but a tampered/foreign entry must still be refused).
916
916
  const PROTECTED_SPEC_BUCKETS = ['backlog', 'in-progress', 'complete', 'cancelled']
917
- const PROTECTED_CONFIG = ['env.config.json', 'linear.config.json', 'jira.config.json', 'github.config.json']
918
- const PROTECTED_DIRS = ['linear-base', 'linear-backups', 'jira-base', 'jira-backups', 'github-base', 'github-backups']
917
+ const PROTECTED_CONFIG = ['env.config.json', 'linear.config.json', 'jira.config.json', 'github.config.json', 'azure-boards.config.json']
918
+ const PROTECTED_DIRS = ['linear-base', 'linear-backups', 'jira-base', 'jira-backups', 'github-base', 'github-backups', 'azure-base', 'azure-backups']
919
919
 
920
920
  function assertSafeToDelete(relPath, managedSet) {
921
921
  const norm = relPath.split(path.sep).join('/')
@@ -746,14 +746,28 @@ function makeApiAdapter({
746
746
  * Set the board's Deployed option on every issue the release carries. The
747
747
  * option is resolved before the first write, so an unknown name refuses
748
748
  * with nothing changed.
749
+ *
750
+ * A commit's `Refs:` names the spec issue, never a phase, so the phases are
751
+ * reached through their parent — and only the CLOSED ones. An open phase of
752
+ * a spec landed mid-way (/spec-to-main) has not shipped, and marking it so
753
+ * would be a false Deployed on the board.
749
754
  */
750
755
  async releaseStage(release, optionName, tickets) {
751
756
  await optionFor(deployedField, optionName)
757
+ const seen = new Set()
752
758
  let set = 0
753
- for (const t of tickets) {
754
- const r = await adapter.setFieldOption(t.ref, deployedField, optionName)
759
+ const stage = async (ref) => {
760
+ if (seen.has(ref)) return
761
+ seen.add(ref)
762
+ const r = await adapter.setFieldOption(ref, deployedField, optionName)
755
763
  if (r && r.changed !== false) set++
756
764
  }
765
+ for (const t of tickets) {
766
+ await stage(t.ref)
767
+ for (const sub of await adapter.listSubIssues(t.ref)) {
768
+ if (!sub.open) await stage(sub.identifier)
769
+ }
770
+ }
757
771
  return { set }
758
772
  },
759
773