Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

chore(release): correct stale comments and dedupe the release script helpers

Jose Ramirezfb1fc0c6b5ea
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ec3dc5018..0bb795b1f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,7 +4,9 @@ Thanks for your interest! evenfire is **open source** under the
[Mozilla Public License 2.0](LICENSE) (MPL-2.0) and requires a signed CLA.
## Dev loop (per service)
+
Each service is a standalone Node/TypeScript package:
+
```bash
cd <service> # e.g. mcp-host, channel-reader, control-api
npm install
@@ -12,23 +14,48 @@ npm run build
npm test
npx tsc --noEmit
```
+
Many services run without Kubernetes via `CLERUM_DEV_MODE=true` (see each
service README and the root README quickstart).
## Tests are required
+
PRs must include tests for new behavior and keep `npm test` + `npx tsc --noEmit`
green for every changed service. PRs without tests may be closed.
+## The pre-commit hook may edit your commit
+
+`core.hooksPath` is `.githooks`, so committing runs `npm run version:staged`
+then `npm run format:staged`. Two behaviours surprise people:
+
+- **Your commit can gain files you did not stage.** Changing source under
+ `external-rest-api/` or `rpc-proxy/` bumps that package's `package.json`
+ patch version, and because `external-rest-api/src/releaseManifest.ts`
+ declares those versions, the manifest is regenerated and staged to match.
+ That is intended: CI rejects a manifest that disagrees with the packages.
+ `desktop-app` is deliberately exempt — its version is the release version,
+ set only by `scripts/release/prepare-release.mjs`.
+- **A commit can be refused while `releaseManifest.ts` has unstaged changes**,
+ even if your commit is unrelated to it. The hook will not regenerate a file
+ you are mid-edit on. Stage or discard that file and commit again.
+
+Every refusal names the file and the fix. If you need to bypass the hook to
+get unstuck, say so in the PR rather than leaving it silent. The two release
+validators run in CI and will catch what the hook would have.
+
## What we accept
+
- Bug fixes and improvements to the platform services and core CRDs.
- New first-class capabilities — please open an issue to discuss first.
## What we do NOT accept as PRs
+
- New third-party MCP servers or WorkflowRecipes. Publish these to the registry
(see docs) — they are not merged into this repo. This keeps the core lean and
maintainable (the same model LangChain and n8n use).
## CLA
+
This project requires a signed Contributor License Agreement. The CLA-assistant
bot will prompt you on your first PR. Contributions may be used in the project's
commercial / managed editions.
diff --git a/scripts/precommit/bump-staged-package-versions.mjs b/scripts/precommit/bump-staged-package-versions.mjs
index d71a67e08..c915e0933 100644
--- a/scripts/precommit/bump-staged-package-versions.mjs
+++ b/scripts/precommit/bump-staged-package-versions.mjs
@@ -11,8 +11,8 @@ const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
const sortedPackageRoots = [...packageRoots].sort((a, b) => b.length - a.length)
// Files that live inside a package root but must never trigger its counter.
-// releaseManifest.ts declares the versions this script would bump. A later
-// task adds scripts/release/prepare-release.mjs as the writer of this file;
+// releaseManifest.ts declares the versions this script would bump.
+// scripts/release/prepare-release.mjs writes that file at release time;
// bumping external-rest-api in reaction to that write would make the
// manifest stale the instant it is produced. validate-release-version-bumps.mjs
// carries the identical exemption in its ignoredFiles.
diff --git a/scripts/release/prepare-release.mjs b/scripts/release/prepare-release.mjs
old mode 100755
new mode 100644
index e6dd6d3cb..3eb85d845
--- a/scripts/release/prepare-release.mjs
+++ b/scripts/release/prepare-release.mjs
@@ -7,15 +7,10 @@
// [--minimum-desktop-version 0.6.0]
import { execFileSync } from 'node:child_process'
import process from 'node:process'
-import { COORDINATES, SEMVER_RE, compareVersions } from './release-coordinates.mjs'
+import { COORDINATES, SEMVER_RE, argValue, compareVersions } from './release-coordinates.mjs'
const ROOT = process.cwd()
-function argValue(name) {
- const i = process.argv.indexOf(name)
- return i >= 0 ? process.argv[i + 1] : ''
-}
-
function die(message) {
console.error(message)
process.exit(1)
diff --git a/scripts/release/release-coordinates.mjs b/scripts/release/release-coordinates.mjs
index b3ad84d37..d0baf787b 100644
--- a/scripts/release/release-coordinates.mjs
+++ b/scripts/release/release-coordinates.mjs
@@ -16,6 +16,13 @@
import fs from 'node:fs'
import path from 'node:path'
+// Shared argv reader. Returns '' when the flag is absent, and undefined when
+// the flag is last with no value after it -- callers must treat both as unset.
+export function argValue(name) {
+ const index = process.argv.indexOf(name)
+ return index >= 0 ? process.argv[index + 1] : ''
+}
+
export const SEMVER_RE = /^\d+\.\d+\.\d+$/
export function compareVersions(a, b) {
diff --git a/scripts/release/update-desktop-release-manifest.mjs b/scripts/release/update-desktop-release-manifest.mjs
index 39ba85e13..366021063 100644
--- a/scripts/release/update-desktop-release-manifest.mjs
+++ b/scripts/release/update-desktop-release-manifest.mjs
@@ -2,7 +2,7 @@
import { execFileSync } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'
-import { SEMVER_RE, compareVersions, parseManifest } from './release-coordinates.mjs'
+import { SEMVER_RE, argValue, compareVersions, parseManifest } from './release-coordinates.mjs'
const ROOT = process.cwd()
const MANIFEST_PATH = 'external-rest-api/src/releaseManifest.ts'
@@ -12,11 +12,6 @@ const PACKAGE_PATHS = {
desktopVersion: 'desktop-app/package.json',
}
-function argValue(name) {
- const index = process.argv.indexOf(name)
- return index >= 0 ? process.argv[index + 1] : ''
-}
-
function readJsonFile(filePath) {
return JSON.parse(fs.readFileSync(path.join(ROOT, filePath), 'utf8'))
}
diff --git a/scripts/release/validate-release-tag.mjs b/scripts/release/validate-release-tag.mjs
old mode 100755
new mode 100644
index 544fff93b..4bee820ed
--- a/scripts/release/validate-release-tag.mjs
+++ b/scripts/release/validate-release-tag.mjs
@@ -12,17 +12,13 @@ import process from 'node:process'
import {
COORDINATES,
SEMVER_RE,
+ argValue,
compareVersions,
readCounterPackage,
} from './release-coordinates.mjs'
const ROOT = process.cwd()
-function argValue(name) {
- const i = process.argv.indexOf(name)
- return i >= 0 ? process.argv[i + 1] : ''
-}
-
const version = (argValue('--version') || '').replace(/^v/, '')
if (!SEMVER_RE.test(version)) {
console.error(
@@ -85,7 +81,14 @@ for (const coordinate of COORDINATES) {
}
if (failures.length > 0) {
- console.error(`release ${version} has ${failures.length} disagreeing coordinate(s):`)
+ // ::error:: so this reads as an annotation once the release-cut job runs it,
+ // matching update-desktop-release-manifest.mjs and validate-release-version-bumps.mjs.
+ // prepare-release.mjs deliberately does NOT do this: it is run by a human at
+ // release time, where an annotation prefix is noise.
+ console.error(
+ `::error::release ${version} has ${failures.length} disagreeing coordinate(s); ` +
+ `run scripts/release/prepare-release.mjs --version ${version} --release-id <id> to write them`
+ )
for (const f of failures) console.error(` ${f}`)
process.exit(1)
}
diff --git a/scripts/tests/test-precommit-release-manifest-ignore.sh b/scripts/tests/test-precommit-release-manifest-ignore.sh
index f21114399..199f952d2 100755
--- a/scripts/tests/test-precommit-release-manifest-ignore.sh
+++ b/scripts/tests/test-precommit-release-manifest-ignore.sh
@@ -3,7 +3,7 @@ set -u
FAIL=0
# The precommit bumper must ignore external-rest-api/src/releaseManifest.ts.
-# A later task adds scripts/release/prepare-release.mjs as that file's writer;
+# scripts/release/prepare-release.mjs is that file's writer;
# if staging it bumps external-rest-api/package.json, the manifest is stale
# the instant it is written and --validate-only fails on every release-prep
# PR, forever.
diff --git a/scripts/tests/test-release-coordinates.sh b/scripts/tests/test-release-coordinates.sh
index c9a546b4a..4b1843f00 100755
--- a/scripts/tests/test-release-coordinates.sh
+++ b/scripts/tests/test-release-coordinates.sh
@@ -4,7 +4,7 @@ FAIL=0
# Tests for the release-cut scripts:
# scripts/release/update-desktop-release-manifest.mjs (floor decoupling)
-# scripts/release/prepare-release.mjs (the one writer, added by a later task)
+# scripts/release/prepare-release.mjs (the one writer)
# scripts/release/validate-release-tag.mjs (the checker)
#
# Each case builds a throwaway git repo containing only the files the script