Skip to content

Commit f6fab76

Browse files
Merge branch 'main' into chore/issue-979-migrate-fetch-to-axios
2 parents 7df0d29 + 6017e03 commit f6fab76

File tree

110 files changed

+5500
-1148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5500
-1148
lines changed

.github/workflows/automated-release-calm-server.yml

Lines changed: 513 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/automated-release.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ jobs:
5353
with:
5454
node-version: 22
5555

56-
- run: npm ci
56+
- name: Update to npm 11
57+
run: npm install -g npm@11
58+
59+
- name: Install dependencies
60+
run: npm ci
5761

5862
- name: Check for existing changelog/version PRs
5963
run: |
@@ -183,7 +187,17 @@ jobs:
183187
NEXT_VERSION=$(grep "The next release version is" analysis.txt | sed 's/.*The next release version is \([^[:space:]]\+\).*/\1/')
184188
185189
# Get current version from latest git tag instead of package.json
186-
CURRENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/cli-v//')
190+
CURRENT_VERSION=$(git describe --tags --abbrev=0 --match 'cli-v*' 2>/dev/null | sed 's/cli-v//')
191+
192+
if [ -z "$CURRENT_VERSION" ]; then
193+
echo "⚠️ No cli-v* git tag found; falling back to package.json version."
194+
CURRENT_VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "")
195+
fi
196+
197+
if [ -z "$CURRENT_VERSION" ]; then
198+
echo "⚠️ package.json version unavailable; defaulting current version to 0.0.0."
199+
CURRENT_VERSION="0.0.0"
200+
fi
187201
188202
echo "📋 Extracted versions:"
189203
echo " Current: $CURRENT_VERSION"
@@ -230,8 +244,13 @@ jobs:
230244
with:
231245
node-version: 22
232246

233-
- run: npm ci
234-
- run: npm run build
247+
- name: Update to npm 11
248+
run: npm install -g npm@11
249+
250+
- name: Install dependencies
251+
run: npm ci
252+
253+
- run: npm run build:cli
235254

236255
- name: Create version update PR
237256
run: |
@@ -374,7 +393,11 @@ jobs:
374393
with:
375394
node-version: 22
376395

377-
- run: npm ci
396+
- name: Update to npm 11
397+
run: npm install -g npm@11
398+
399+
- name: Install dependencies
400+
run: npm ci
378401

379402
- name: Create draft release
380403
env:
@@ -422,7 +445,7 @@ jobs:
422445
contains(github.event.pull_request.labels.*.name, 'automated-release')
423446
steps:
424447
- name: Harden Runner
425-
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2
448+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2
426449
with:
427450
egress-policy: audit
428451

@@ -437,6 +460,10 @@ jobs:
437460
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
438461
with:
439462
node-version: 22
463+
registry-url: 'https://registry.npmjs.org'
464+
465+
- name: Update to npm 11
466+
run: npm install -g npm@11
440467

441468
- name: Install dependencies
442469
run: npm ci
@@ -481,6 +508,8 @@ jobs:
481508
--target main
482509
483510
- name: Publish to NPM
511+
env:
512+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_SEMANTIC_RELEASE }}
484513
run: |
485514
cd cli
486515
npm publish --provenance

.github/workflows/semgrep-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
env:
2222
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
2323
container:
24-
image: semgrep/semgrep@sha256:d3d1be3a3770514d16a6a57b9761575d7536d70f45a5220274f4ec7d55c442b9
24+
image: semgrep/semgrep@sha256:e04d2cb132288d90035db8791d64f610cb255b21e727b94db046243b30c01ae9
2525
if: (github.actor != 'dependabot[bot]')
2626
steps:
2727
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Validate Lockfile Platforms
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- 'main'
10+
- 'release*'
11+
paths:
12+
- 'package-lock.json'
13+
push:
14+
branches:
15+
- 'main'
16+
- 'release*'
17+
paths:
18+
- 'package-lock.json'
19+
20+
jobs:
21+
validate-lockfile:
22+
name: Validate Lockfile Platforms
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
31+
with:
32+
node-version: '22'
33+
34+
- name: Validate platform bindings in lockfile
35+
run: node scripts/validate-lockfile-platforms.js

.npmrc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,3 @@
22
# Blocks unsupported versions (e.g. Node 18, 20, 23) but still allows
33
# Node 24+ since engines includes ">=24.10.0" for local development.
44
engine-strict=true
5-
6-
# Ensure npm resolves optional native bindings for all CI platforms,
7-
# not just the current developer machine. Prevents missing-binding
8-
# errors (e.g. @tailwindcss/oxide) when the lockfile is regenerated
9-
# on macOS but consumed on Linux runners.
10-
supportedArchitectures[os][]=current
11-
supportedArchitectures[os][]=linux
12-
supportedArchitectures[cpu][]=current
13-
supportedArchitectures[cpu][]=x64
14-
supportedArchitectures[cpu][]=arm64

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ The `engines` field in `package.json` (`^22.14.0 || >=24.10.0`) also permits Nod
7171
- **`@types/node`** is overridden to `^22.0.0` in root `package.json` to prevent transitive dependencies from pulling in a different major version
7272
- **Renovate** is configured with `allowedVersions: "<23.0.0"` for `@types/node`
7373

74+
### Lockfile Regeneration
75+
76+
**CRITICAL**: npm has a known bug ([npm/cli#4828](https://github.com/npm/cli/issues/4828)) where running `npm install` with an existing `node_modules` directory prunes optional platform-specific dependencies (e.g. `@tailwindcss/oxide`, `@swc/core`, `@esbuild`) for platforms other than the current machine. This causes CI failures on Linux runners when the lockfile was regenerated on macOS.
77+
78+
**Correct method** — always delete both `node_modules` and the lockfile:
79+
80+
```bash
81+
rm -rf node_modules package-lock.json && npm install
82+
```
83+
84+
**Never** regenerate the lockfile without deleting `node_modules` first. The `validate-lockfile` CI workflow checks that all expected platform variants are present in `package-lock.json`.
85+
7486
### Why this matters
7587

7688
Running `npm install` on a different Node major version (e.g. Node 25) causes:

advent-of-calm/website/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

calm-ai/tools/calm-cli-instructions.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Run `calm` with no arguments to see the top-level help:
2121
calm
2222
```
2323

24-
This displays available commands such as `generate`, `validate`, `init-ai`, `server`, `template`, and `docify`.
24+
This displays available commands such as `generate`, `validate`, `init-ai`, `template`, and `docify`.
2525

2626
## Generate Architectures from Patterns
2727

@@ -134,19 +134,6 @@ At present Github Copilot (`copilot`), AWS Kiro (`kiro`), and Claude Code (`clau
134134

135135
This generates custom prompts for the specified <provider> to use CALM-aware tools (nodes, relationships, interfaces, controls, flows, patterns, metadata).
136136

137-
## CLI Server (Experimental)
138-
139-
Expose CLI functionality over HTTP:
140-
141-
```shell
142-
calm server --schema-directory <path>
143-
```
144-
145-
Endpoints (default `http://127.0.0.1:3000`):
146-
147-
- `GET /health` for health checks
148-
- `POST /calm/validate` with a CALM model payload to validate
149-
150137
## Template Command
151138

152139
Generate arbitrary files from CALM models using Handlebars bundles:

0 commit comments

Comments
 (0)