diff --git a/openspec/specs/frontend-data-stores/spec.md b/openspec/specs/frontend-data-stores/spec.md index bdaa33c..7fd89d4 100644 --- a/openspec/specs/frontend-data-stores/spec.md +++ b/openspec/specs/frontend-data-stores/spec.md @@ -21,10 +21,12 @@ Per ADR-022, template-derived apps own no database of their own — the Vue SPA talks to OpenRegister's object API directly through a thin Pinia store layer. This capability defines that store layer: -- A **generic object store** (`src/store/modules/object.js`) that is configured - once with the OpenRegister API base URLs, then accepts the registration of - named object types (each mapping a logical type name to a register + schema), - and fetches collections of those objects on demand. +- A **generic object store** obtained from `createObjectStore` in + `@conduction/nextcloud-vue` and instantiated in `src/store/store.js`. The app + does NOT define one of its own: per ADR-071 Decision 2 the library's factory + is the only generic OpenRegister object store, and per ADR-026 an app-local + copy drifts from the lib's action surface until a manifest-rendered page calls + an action that no longer exists. - An **app-settings store** (`src/store/modules/settings.js`) that reads and writes the app's own settings through the backend `GET`/`POST /api/settings` endpoints defined by the settings-management capability — it is the frontend @@ -32,72 +34,82 @@ This capability defines that store layer: - A **boot-time initializer** (`src/store/store.js`) that wires the object store to OpenRegister's URLs and primes the settings store before the SPA renders. -All store actions MUST degrade gracefully: a failed network request MUST be -logged client-side and resolve to a safe empty/`null` value so that a single -failing fetch never breaks the SPA mount (mirrors ADR-005's "log server-side, -return safe fallback" rule on the client). +All store actions MUST degrade gracefully: a failed network request MUST NOT +throw out of the action, so a single failing fetch never breaks the SPA mount +(mirrors ADR-005's "log server-side, return safe fallback" rule on the client). + +**Degrading is not the same as going quiet.** An action that resolves to +`null`/`[]` on failure MUST also record the failure where a caller can see it — +logged client-side AND exposed in store state. The earlier wording required only +the safe value, and `null` was simultaneously the legitimate "nothing yet" +value, so a settings endpoint returning 500 was indistinguishable from a fresh +install for as long as anyone cared to look. ## Requirements -### REQ-STORE-001: Configure the object store with OpenRegister URLs +### REQ-STORE-001: The object store comes from the library, not from the app -The object store MUST expose a `configure({ baseUrl, schemaBaseUrl })` action -that records the OpenRegister object-API and schema-API base URLs. No object -fetch may be attempted before the store has been configured. +The app MUST obtain its generic OpenRegister object store from +`createObjectStore` in `@conduction/nextcloud-vue`, instantiated once in +`src/store/store.js` with the app's register and schema slugs. The app MUST NOT +define its own generic object store. -#### Scenario: Store is configured at boot +Per ADR-071 Decision 2 the library's factory is the only generic object store in +the fleet; per ADR-026 an app-local copy drifts from the lib's action surface, +and the observed failure mode is a manifest-rendered page calling an action the +local store never had (`fetchObject is not a function`, decidesk#162). -- GIVEN a freshly created object store with empty `baseUrl` -- WHEN `configure({ baseUrl, schemaBaseUrl })` is called with the OpenRegister object/schema API URLs -- THEN the store MUST persist `baseUrl` and `schemaBaseUrl` in its state -- AND subsequent `fetchObjects` calls MUST build their request URL from the stored `baseUrl` +#### Scenario: The store is created from the library factory -### REQ-STORE-002: Register named object types +- GIVEN an app scaffolded from this template +- WHEN `src/store/store.js` is loaded +- THEN it MUST call `createObjectStore` imported from `@conduction/nextcloud-vue` +- AND it MUST pass the app's `register` and `schema` slugs +- AND the module MUST export the resulting store as `useObjectStore` -The object store MUST expose a `registerObjectType(type, schema, register)` -action that maps a logical type name to its OpenRegister `schema` + `register` -identifiers and initialises an empty result bucket for that type. Fetching an -unregistered type MUST be a no-op that warns rather than throwing. +#### Scenario: No app-local generic object store exists -#### Scenario: A type is registered +- GIVEN the app's `src/store/` tree +- WHEN it is searched for a Pinia store defining generic OpenRegister CRUD +- THEN no module other than `store.js` MAY define one +- AND in particular `src/store/modules/object.js` MUST NOT exist -- GIVEN a configured object store -- WHEN `registerObjectType('item', '', '')` is called -- THEN the store MUST record `{ schema, register }` under `objectTypes.item` -- AND it MUST initialise `objects.item` to an empty array if it was unset +### REQ-STORE-002: Object types are registered through the library's surface -#### Scenario: Fetching an unregistered type +Registering a logical type name against a register + schema, fetching +collections, pagination, single-flight de-duplication and error surfacing are +all the library store's responsibility. The app MUST use that surface rather +than re-implementing any part of it. -- GIVEN a configured store with no `item` type registered -- WHEN `fetchObjects('item')` is called -- THEN the store MUST emit a client-side warning naming the unregistered type -- AND it MUST return an empty array without performing a network request +This requirement deliberately does not restate the library's action names. The +previous version of this spec pinned `configure()`, `registerObjectType()` and +`fetchObjects()` — an API the app's own dead module had and the library store +does not — so the spec described a module nothing imported while the code used a +different one. -### REQ-STORE-003: Fetch a collection of objects +#### Scenario: The app needs a collection -The object store MUST expose an async `fetchObjects(type, params)` action that -issues a `GET` to the configured `baseUrl` with the registered `register` and -`schema` as query parameters (plus any caller-supplied `params`), carrying the -Nextcloud request token. On success it MUST store and return the result -collection; on any failure it MUST log client-side and return an empty array, -and it MUST clear the per-type loading flag in all cases. +- GIVEN a store created by `createObjectStore` +- WHEN the app needs a collection of objects +- THEN it MUST call the library store's own collection action +- AND it MUST NOT construct the OpenRegister request URL itself -#### Scenario: Successful fetch +### REQ-STORE-003: App code does not hand-set the request token -- GIVEN a registered, configured `item` type -- WHEN `fetchObjects('item', { limit: 10 })` resolves with HTTP 200 -- THEN the request URL MUST carry `register`, `schema`, and `limit=10` query parameters -- AND the request MUST send the `requesttoken` header -- AND the store MUST set `objects.item` to `data.results` (or `data` when no `results` envelope) and return it -- AND `loading.item` MUST be cleared to `false` +Any HTTP the app performs outside the object store MUST go through `cnFetch` or +`cnFetchJson` from `@conduction/nextcloud-vue`. A raw `fetch()` carrying a +hand-set `requesttoken` header is forbidden (ADR-071 Decision 1): the library +owns the one blessed CSRF idiom, URL prefixing and error normalisation, so a +Nextcloud-version or CSP change is one fix rather than one per app. -#### Scenario: Network failure +#### Scenario: The settings store reads the backend -- GIVEN a registered type -- WHEN the fetch rejects or returns a non-OK status -- THEN the store MUST log the error client-side -- AND it MUST return an empty array -- AND `loading.item` MUST still be cleared to `false` +- GIVEN the settings store issues `GET /api/settings` +- WHEN the request is constructed +- THEN it MUST be issued through `cnFetchJson` +- AND the app MUST NOT import `getRequestToken` to build the header itself +- AND the URL MUST be resolved with `generateUrl` so an instance served from a + webroot subdirectory is addressed correctly ### REQ-STORE-004: Read and write app settings from the SPA @@ -105,10 +117,12 @@ The settings store MUST expose an async `fetchSettings()` action that `GET`s `/api/settings` and a `saveSettings(payload)` action that `POST`s a partial settings payload to the same endpoint, both carrying the request token. These are the client counterparts of the settings-management capability's REQ-CFG-001 -and REQ-CFG-002. `fetchSettings()` MUST additionally derive the +and REQ-CFG-002. Both actions MUST be issued through `cnFetchJson` +(REQ-STORE-003). `fetchSettings()` MUST additionally derive the `hasOpenRegisters` and `isAdmin` flags from the response so the UI can degrade -gracefully (ADR-005 / REQ-CFG-004). Both actions MUST log and return `null` on -failure rather than throwing. +gracefully (ADR-005 / REQ-CFG-004). Both actions MUST return `null` on failure +rather than throwing, and MUST record the failure in the store's `error` state +so that "the request failed" is distinguishable from "there is nothing yet". #### Scenario: Settings load @@ -131,18 +145,31 @@ failure rather than throwing. - WHEN the action handles the failure - THEN it MUST log the error client-side - AND it MUST return `null` +- AND it MUST set `error` to the failure - AND `loading` MUST be reset to `false` +#### Scenario: A failure is distinguishable from an empty result + +- GIVEN `fetchSettings()` has returned `null` +- WHEN a caller needs to know whether the backend failed or simply had nothing +- THEN `error` MUST be non-null if and only if the request failed +- AND `error` MUST be cleared at the start of the next request + ### REQ-STORE-005: Initialise the stores before the SPA renders The system MUST expose an async `initializeStores()` boot helper that -configures the object store to point at OpenRegister's object/schema API URLs -and primes the settings store with a first `fetchSettings()` call, returning -both store handles to the caller. +instantiates the object store and primes the settings store with a first +`fetchSettings()` call, returning both store handles to the caller. + +The library store is configured by the `register`/`schema` passed to +`createObjectStore` at module load, so there is no separate `configure()` step. +The previous wording required one, describing the app-local store this template +no longer ships. #### Scenario: Boot sequence - WHEN `initializeStores()` is awaited during SPA bootstrap -- THEN it MUST call `objectStore.configure()` with the OpenRegister `/api/objects` and `/api/schemas` URLs +- THEN it MUST instantiate the object store created by `createObjectStore` - AND it MUST await `settingsStore.fetchSettings()` so the first render has settings available - AND it MUST return `{ settingsStore, objectStore }` +- AND it MUST NOT fail the boot when `fetchSettings()` resolves to `null` diff --git a/package-lock.json b/package-lock.json index 0c1d0f2..458c266 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@babel/core": "^7.29.0", "@babel/preset-env": "^7.29.5", - "@conduction/nextcloud-vue": "^2.3.0", + "@conduction/nextcloud-vue": "^2.16.0", "@nextcloud/auth": "^2.5.0", "@nextcloud/axios": "~2.5.2", "@nextcloud/capabilities": "^1.2.1", @@ -1692,9 +1692,9 @@ } }, "node_modules/@conduction/nextcloud-vue": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/@conduction/nextcloud-vue/-/nextcloud-vue-2.15.0.tgz", - "integrity": "sha512-/CSsaMcprVMYEemvGGorEQgvDRefMi/EFLTpK35A1BqgBu/fP/nMN1V+5r+fPaylEc1LeSdCShKPYwU79rd1eQ==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@conduction/nextcloud-vue/-/nextcloud-vue-2.17.0.tgz", + "integrity": "sha512-8uvkThCwsuQv8yTuzxLPNcBXF4AFxRCwBTWR02qNkuXT680E/AFiaud3sz1pNGWgSYkUvbiG1l/gZ063SPSGnQ==", "license": "EUPL-1.2", "dependencies": { "@ckpack/vue-color": "^1.6.0", diff --git a/package.json b/package.json index 5c340e1..a87de9e 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,9 @@ "check:manifest-v2": "node tests/manifest-v2.spec.js", "check:register": "node tests/validate-register.js", "check:registry": "node tests/registry.spec.js", + "check:settings-store": "node tests/settings-store.spec.js", "check:json-strict": "node tests/validate-json-strict.js", - "check:specs": "npm run check:json-strict && npm run check:manifest-v2 && npm run check:register && npm run check:registry", + "check:specs": "npm run check:json-strict && npm run check:manifest-v2 && npm run check:register && npm run check:registry && npm run check:settings-store", "prepare": "git config core.hooksPath .githooks || true" }, "browserslist": [ @@ -31,7 +32,7 @@ "dependencies": { "@babel/core": "^7.29.0", "@babel/preset-env": "^7.29.5", - "@conduction/nextcloud-vue": "^2.3.0", + "@conduction/nextcloud-vue": "^2.16.0", "@nextcloud/auth": "^2.5.0", "@nextcloud/axios": "~2.5.2", "@nextcloud/capabilities": "^1.2.1", diff --git a/src/store/modules/object.js b/src/store/modules/object.js deleted file mode 100644 index 3242de1..0000000 --- a/src/store/modules/object.js +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: EUPL-1.2 -import { getRequestToken } from '@nextcloud/auth' -import { defineStore } from 'pinia' -import logger from '../../logger.js' - -/** - * Generic OpenRegister object store. - * Configure it with baseUrl and schemaBaseUrl, then register object types. - */ -export const useObjectStore = defineStore('object', { - state: () => ({ - baseUrl: '', - schemaBaseUrl: '', - objectTypes: {}, - objects: {}, - loading: {}, - }), - - actions: { - configure({ baseUrl, schemaBaseUrl }) { - this.baseUrl = baseUrl - this.schemaBaseUrl = schemaBaseUrl - }, - - registerObjectType(type, schema, register) { - this.objectTypes[type] = { schema, register } - if (!this.objects[type]) { - this.objects[type] = [] - } - }, - - async fetchObjects(type, params = {}) { - if (!this.objectTypes[type]) { - logger.warn(`Object type "${type}" is not registered`) - return [] - } - - this.loading[type] = true - const { schema, register } = this.objectTypes[type] - - try { - const url = new URL(this.baseUrl, window.location.origin) - url.searchParams.set('register', register) - url.searchParams.set('schema', schema) - Object.entries(params).forEach(([k, v]) => - url.searchParams.set(k, v), - ) - - const response = await fetch(url.toString(), { - headers: { requesttoken: getRequestToken() }, - }) - if (response.ok) { - const data = await response.json() - this.objects[type] = data.results || data - return this.objects[type] - } - } catch (error) { - logger.error(`Failed to fetch ${type} objects`, { error }) - } finally { - this.loading[type] = false - } - return [] - }, - }, -}) diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 5401c58..acc1a00 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -1,51 +1,89 @@ // SPDX-License-Identifier: EUPL-1.2 -import { getRequestToken } from '@nextcloud/auth' +import { cnFetchJson } from '@conduction/nextcloud-vue' import { generateUrl } from '@nextcloud/router' import { defineStore } from 'pinia' import logger from '../../logger.js' +/** + * The app's settings endpoint, resolved through Nextcloud's router. + * + * `generateUrl` rather than a bare path because it is the only thing that + * knows the instance's webroot — an install under `https://host/nextcloud` + * needs that prefix, and `cnFetch`'s own `prefixUrl` deliberately only adds + * `/index.php`. Handing it an already-generated URL is a no-op there, so this + * keeps the correct URL AND the library's blessed headers. + */ +const SETTINGS_URL = () => generateUrl('/apps/apptemplate/api/settings') + +/** + * The app's own settings, read from and written to `/api/settings`. + * + * Transport is `cnFetchJson` from @conduction/nextcloud-vue, not a raw + * `fetch()` with a hand-set `requesttoken`. Per ADR-071 Decision 1 the library + * owns the one blessed CSRF idiom, URL prefixing and error normalisation — + * hand-setting the token is how three different idioms ended up across the + * fleet, and how a CSP or Nextcloud-version change becomes 20 separate fixes + * instead of one. + */ export const useSettingsStore = defineStore('settings', { state: () => ({ settings: {}, loading: false, hasOpenRegisters: false, isAdmin: false, + /** + * The last failure, or null when the last request succeeded. + * + * This exists because the previous implementation returned `null` on + * failure and `null` was also a legitimate "nothing yet" value, so a + * broken settings endpoint was indistinguishable from a fresh install. + * Callers that only need the happy path can keep ignoring the return + * value; a caller that needs to tell the two apart reads `error`. + * + * @type {Error|null} + */ + error: null, }), getters: { getSettings: (state) => state.settings, getIsAdmin: (state) => state.isAdmin, + /** + * True when the last request failed. + * + * @param {object} state The store state. + * @return {boolean} Whether the last request failed. + */ + hasError: (state) => state.error !== null, }, actions: { /** * Read the app's settings from the backend `GET /api/settings`. * + * Resolves to `null` on failure rather than throwing, so a settings + * endpoint that is down cannot prevent the SPA from mounting. The + * failure is still observable — it is logged AND recorded in `error`. + * * @spec openspec/specs/frontend-data-stores/spec.md#REQ-STORE-004 * @return {Promise} The settings object, or null on failure. */ async fetchSettings() { this.loading = true + this.error = null try { - const response = await fetch( - generateUrl('/apps/apptemplate/api/settings'), - { - headers: { requesttoken: getRequestToken() }, - }, - ) - if (response.ok) { - const data = await response.json() - this.settings = data - this.hasOpenRegisters = !!data?.openregisters - this.isAdmin = !!data?.isAdmin - return data - } + const data = await cnFetchJson(SETTINGS_URL()) + this.settings = data + this.hasOpenRegisters = !!data?.openregisters + this.isAdmin = !!data?.isAdmin + return data } catch (error) { logger.error('Failed to fetch settings', { error }) + this.error = error + return null } finally { this.loading = false } - return null }, /** @@ -57,29 +95,22 @@ export const useSettingsStore = defineStore('settings', { */ async saveSettings(settings) { this.loading = true + this.error = null try { - const response = await fetch( - generateUrl('/apps/apptemplate/api/settings'), - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - requesttoken: getRequestToken(), - }, - body: JSON.stringify(settings), - }, - ) - if (response.ok) { - const data = await response.json() - this.settings = data - return data - } + const data = await cnFetchJson(SETTINGS_URL(), { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(settings), + }) + this.settings = data + return data } catch (error) { logger.error('Failed to save settings', { error }) + this.error = error + return null } finally { this.loading = false } - return null }, }, }) diff --git a/tests/settings-store.spec.js b/tests/settings-store.spec.js new file mode 100644 index 0000000..6051732 --- /dev/null +++ b/tests/settings-store.spec.js @@ -0,0 +1,241 @@ +#!/usr/bin/env node +// SPDX-License-Identifier: EUPL-1.2 +// Copyright (C) 2026 Conduction B.V. +// +// settings-store.spec.js — the settings store's failure behaviour. +// +// Usage: +// node tests/settings-store.spec.js +// +// Exit codes: +// 0 — every arm passed +// 1 — one or more arms failed +// +// WHY THIS EXISTS +// --------------- +// The store previously returned `null` on failure and recorded nothing. `null` +// was ALSO the legitimate "nothing yet" value, so a settings endpoint answering +// 500 was indistinguishable from a fresh install — for as long as anyone cared +// to look. The spec made it worse than an oversight by REQUIRING it: "a failed +// network request MUST be logged client-side and resolve to a safe empty/null +// value", with nothing said about surfacing it. +// +// The fix keeps the safe return (a broken endpoint must not stop the SPA +// mounting) and adds an observable `error`. The arms below pin BOTH halves, +// because either one alone is the bug: +// +// * resolving to null without recording -> the original silent failure +// * recording but throwing out of the action -> a broken endpoint blocks boot +// +// Arm 4 is the one that would have caught the original defect: it asserts that +// success and failure are DISTINGUISHABLE, not merely that failure returns +// null. A test asserting only `=== null` passes against the broken version. +// +// The store is exercised through a hand-rolled Pinia-shaped harness rather than +// by importing pinia: this file runs under bare `node`, like the other specs in +// this directory (registry.spec.js, manifest-v2.spec.js), and the behaviour +// under test is the actions' own control flow, not Pinia's reactivity. + +'use strict' + +let failures = 0 +const ok = (m) => console.log(` ok — ${m}`) +function bad(m) { + console.log(` FAIL — ${m}`) + failures += 1 +} + +// --------------------------------------------------------------------------- +// A minimal stand-in for the store: the same state shape and the same action +// bodies, with cnFetchJson injected. Keeping the bodies here rather than +// importing the real module is a deliberate trade-off and its limit is stated +// plainly: this pins the CONTRACT (what happens on success vs failure), not the +// module wiring. The wiring is covered by the build and by the e2e app-shell +// spec, which boots the real store. +// --------------------------------------------------------------------------- +function makeStore(fetchJson) { + const store = { + settings: {}, + loading: false, + hasOpenRegisters: false, + isAdmin: false, + error: null, + + get hasError() { + return store.error !== null + }, + + async fetchSettings() { + store.loading = true + store.error = null + try { + const data = await fetchJson('/apps/apptemplate/api/settings') + store.settings = data + store.hasOpenRegisters = !!data?.openregisters + store.isAdmin = !!data?.isAdmin + return data + } catch (error) { + store.error = error + return null + } finally { + store.loading = false + } + }, + + async saveSettings(payload) { + store.loading = true + store.error = null + try { + const data = await fetchJson('/apps/apptemplate/api/settings', { + method: 'POST', + body: JSON.stringify(payload), + }) + store.settings = data + return data + } catch (error) { + store.error = error + return null + } finally { + store.loading = false + } + }, + } + return store +} + +const resolving = (value) => async () => value +function rejecting(err) { + return async () => { + throw err + } +} + +async function main() { + // ---- arm 1: a successful read populates state and clears error --------- + { + const store = makeStore( + resolving({ openregisters: true, isAdmin: true, foo: 'bar' }), + ) + const out = await store.fetchSettings() + if ( + out?.foo === 'bar' + && store.hasOpenRegisters === true + && store.isAdmin === true + && store.error === null + && store.loading === false + ) { + ok( + 'a successful read populates settings, derives the flags, and clears error', + ) + } else { + bad( + `successful read left state wrong: ${JSON.stringify({ out, e: store.error, l: store.loading })}`, + ) + } + } + + // ---- arm 2: a failed read RESOLVES (does not throw) -------------------- + { + const store = makeStore(rejecting(new Error('boom'))) + let threw = false + let out + try { + out = await store.fetchSettings() + } catch { + threw = true + } + if (!threw && out === null && store.loading === false) { + ok( + 'a failed read resolves to null rather than throwing, and clears loading', + ) + } else { + bad(`failed read threw (${threw}) or returned ${JSON.stringify(out)}`) + } + } + + // ---- arm 3: a failed read RECORDS the failure -------------------------- + { + const store = makeStore(rejecting(new Error('boom'))) + await store.fetchSettings() + if (store.error instanceof Error && store.hasError === true) { + ok('a failed read records the error in state') + } else { + bad(`failed read did not record an error: ${String(store.error)}`) + } + } + + // ---- arm 4: failure is DISTINGUISHABLE from an empty result ------------ + // The arm that would have caught the original defect. Both calls return a + // falsy-ish result; only `error` tells them apart. + { + const empty = makeStore(resolving(null)) + await empty.fetchSettings() + const broken = makeStore(rejecting(new Error('500'))) + await broken.fetchSettings() + if (empty.error === null && broken.error !== null) { + ok( + '"the backend had nothing" and "the backend failed" are distinguishable', + ) + } else { + bad( + `indistinguishable: empty.error=${String(empty.error)} broken.error=${String(broken.error)}`, + ) + } + } + + // ---- arm 5: error is cleared at the START of the next request ---------- + { + let mode = 'fail' + const store = makeStore(async () => { + if (mode === 'fail') throw new Error('boom') + return { ok: true } + }) + await store.fetchSettings() + if (store.error === null) { + bad('precondition: error should be set after a failure') + } + mode = 'succeed' + await store.fetchSettings() + if (store.error === null) { + ok('a subsequent successful request clears the previous error') + } else { + bad('a stale error survived a successful request') + } + } + + // ---- arm 6: saveSettings behaves the same way -------------------------- + { + const store = makeStore(rejecting(new Error('nope'))) + let threw = false + let out + try { + out = await store.saveSettings({ register: 'x' }) + } catch { + threw = true + } + if ( + !threw + && out === null + && store.error !== null + && store.loading === false + ) { + ok( + 'a failed save resolves to null, records the error, and clears loading', + ) + } else { + bad( + `failed save behaved wrongly: threw=${threw} out=${JSON.stringify(out)} err=${String(store.error)}`, + ) + } + } + + console.log('') + if (failures === 0) { + console.log('settings-store.spec: all arms passed') + process.exit(0) + } + console.log(`settings-store.spec: ${failures} arm(s) failed`) + process.exit(1) +} + +main()