@bongos/core 1.19.410 → 1.19.412

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.
@@ -54,6 +54,8 @@ A module's `module.json` declares `"coreVersion": "^1.4.0"` (a semver range). Th
54
54
 
55
55
  **Current `CORE_VERSION`:** `1.8.0`
56
56
 
57
+ > The table below is a hand-maintained summary of the MINOR bumps only, and it lags. The authoritative, complete release ledger — every version, including the CI carrier patches — is [`docs/module-api-changelog.md`](module-api-changelog.md) ([ADR 0203](adr/<redacted>.md) moved it out of `src/module-api.js`); the live value is the `const CORE_VERSION` literal in `src/module-api.js`.
58
+
57
59
  | Bump | What it added |
58
60
  |---|---|
59
61
  | 1.0.0 | Initial doorway: auth gates, pool accessor, config/branding, seams. |
@@ -72,7 +72,7 @@ Three steps. The first two are ordinary claimed work; only the publish (2c) is o
72
72
 
73
73
  ### 2a. Bump `CORE_VERSION` — the step with no automation behind it
74
74
 
75
- `CORE_VERSION` lives in [`src/module-api.js`](../../src/module-api.js) and is bumped **by hand, inside a claimed task**, with a changelog line in the same file. It is never auto-bumped: the version's provenance stays in git history + changelog ([ADR 0137](../adr/<redacted>.md) §2).
75
+ `CORE_VERSION` lives in [`src/module-api.js`](../../src/module-api.js) and is bumped **by hand, inside a claimed task**, with an entry appended to the release ledger [`docs/module-api-changelog.md`](../module-api-changelog.md) in the same commit. (The ledger used to be a comment block inside `module-api.js`; appending to it there on every CI release grew the file past the oversized-file fitness ratchet and broke `unit` on `main` — [ADR 0203](../adr/<redacted>.md).) The version's provenance stays in git history + ledger ([ADR 0137](../adr/<redacted>.md) §2).
76
76
 
77
77
  Semver here is not decoration — it decides **who receives the change automatically** ([ADR 0136](../adr/<redacted>.md)):
78
78
 
@@ -82,7 +82,7 @@ Semver here is not decoration — it decides **who receives the change automatic
82
82
  | **minor** — an added export / additive surface | ❌ **invisible to them** | ✅ |
83
83
  | **major** — never automatic for anyone | ❌ | ❌ |
84
84
 
85
- The practical trap: a **MINOR is silently withheld from every patch-only instance**, which is the default channel. If a fix must reach the fleet, it belongs behind a *patch* bump — so an additive export shipped alongside a needed fix will strand that fix. The changelog convention is to justify the level explicitly ("the doorway surface is byte-identical to X, so despite the volume this is → PATCH").
85
+ The practical trap: a **MINOR is silently withheld from every patch-only instance**, which is the default channel. If a fix must reach the fleet, it belongs behind a *patch* bump — so an additive export shipped alongside a needed fix will strand that fix. The ledger convention is to justify the level explicitly ("the doorway surface is byte-identical to X, so despite the volume this is → PATCH").
86
86
 
87
87
  **A bump is mandatory even for a one-file fix.** `bongos upgrade` refuses an equal version, and npm rejects a duplicate — a natural guard, and the reason "carrier bumps" exist to sweep up commits that landed with no bump behind them.
88
88
 
@@ -99,7 +99,7 @@ node scripts/gds/package-core.js --ref main --self-verify
99
99
 
100
100
  ### 2c. Publish — automatic on merge
101
101
 
102
- **Every merge to `main` publishes** ([ADR 0161](../adr/<redacted>.md), superseding ADR 0137's manual gate): once the required `unit` check succeeds on a main push, the `publish` workflow auto-bumps a **patch** if nobody bumped (via `scripts/gds/bump-version.js`, changelog line included), builds through the fail-closed no-leak gate with `--self-verify`, publishes, and tags `core-v<version>`. A **minor/major is still a human in-task bump** — CI never makes that call, because it decides what patch-channel subscribers receive unattended.
102
+ **Every merge to `main` publishes** ([ADR 0161](../adr/<redacted>.md), superseding ADR 0137's manual gate): once the required `unit` check succeeds on a main push, the `publish` workflow auto-bumps a **patch** if nobody bumped (via `scripts/gds/bump-version.js`, which writes the literal AND appends the ledger entry to [`docs/module-api-changelog.md`](../module-api-changelog.md) — ADR 0203; the carrier commit stages both), builds through the fail-closed no-leak gate with `--self-verify`, publishes, and tags `core-v<version>`. A **minor/major is still a human in-task bump** — CI never makes that call, because it decides what patch-channel subscribers receive unattended.
103
103
 
104
104
  The lane is armed by the owner via the `PUBLISH_ON_MERGE=1` repo variable + two secrets (`NPM_TOKEN`, `RELEASE_PUSH_TOKEN`); while disarmed it no-ops loudly. Manual fallback, same command CI runs:
105
105
 
@@ -55,7 +55,7 @@ npm publish ./clients/bongos-client # real (publishConfig makes it
55
55
 
56
56
  The steps below remain as the **manual fallback** (lane disarmed, npm outage, or a deliberate out-of-band release):
57
57
 
58
- 1. **Bump `CORE_VERSION`** in [`src/module-api.js`](../../src/module-api.js) (semver; a **patch** for a fix, **minor** for additive surface — a **major** is a deliberate, human-only event) and add a one-line changelog entry in the same file. This bump is a normal claimed task, not a release-tool side effect — the version's provenance stays in the git history + changelog.
58
+ 1. **Bump `CORE_VERSION`** in [`src/module-api.js`](../../src/module-api.js) (semver; a **patch** for a fix, **minor** for additive surface — a **major** is a deliberate, human-only event) and append an entry to the release ledger [`docs/module-api-changelog.md`](../module-api-changelog.md) in the same commit ([ADR 0203](../adr/<redacted>.md) moved that ledger out of `module-api.js`). This bump is a normal claimed task, not a release-tool side effect — the version's provenance stays in the git history + ledger.
59
59
  2. **Publish** (owner, from a clean checkout of the released commit):
60
60
  ```sh
61
61
  node scripts/gds/package-core.js --publish # DRY-RUN: runs the fail-closed no-leak gate, previews @bongos/core@<version>
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.410",
3
+ "version": "1.19.412",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.410",
9
+ "version": "1.19.412",
10
10
  "license": "AGPL-3.0-or-later",
11
11
  "dependencies": {
12
12
  "express": "^4.21.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.410",
3
+ "version": "1.19.412",
4
4
  "description": "Cloud Bongos — the AI-first build platform core (GDS + platform surfaces + module system), installed as a versioned dependency (ADR 0108).",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "main": "src/platform-server.js",
@@ -4,10 +4,19 @@
4
4
  //
5
5
  // WHY THIS EXISTS. ADR 0161 makes every merge to main publishable: when a merge
6
6
  // lands without a human version bump, CI bumps a PATCH itself so the release
7
- // has a unique version. The bump edits src/module-api.js in the two places the
8
- // repo's version discipline lives — the `const CORE_VERSION` literal and the
9
- // changelog comment block above it — because a bare literal change with no
10
- // changelog line is exactly the drift the discipline exists to prevent.
7
+ // has a unique version. The bump writes the two places the repo's version
8
+ // discipline lives — the `const CORE_VERSION` literal in src/module-api.js and
9
+ // the release ledger in docs/module-api-changelog.md — because a bare literal
10
+ // change with no changelog line is exactly the drift the discipline prevents.
11
+ //
12
+ // WHERE THE LEDGER LIVES (ADR 0203). It used to be a comment block directly
13
+ // above the literal, in src/module-api.js. Appending two lines there on EVERY
14
+ // release grew that file past the 1500-line oversized-file fitness ratchet, and
15
+ // because this lane pushes straight to main it broke the very `unit` gate it
16
+ // rides behind — for main and for every open PR at once. The ledger is now a
17
+ // markdown file, which `git ls-files '*.js'` never counts, so it can grow
18
+ // forever. The INSERTION CONTRACT is unchanged: entries stay oldest-first and
19
+ // each new one goes immediately above the divider that closes the ledger.
11
20
  //
12
21
  // POLICY (deliberately narrow): this script only ever bumps PATCH. A MINOR or
13
22
  // MAJOR is a statement about the doorway surface that only a human (or a far
@@ -19,7 +28,7 @@
19
28
  //
20
29
  // Usage:
21
30
  // node scripts/gds/bump-version.js # dry-run: print the plan
22
- // node scripts/gds/bump-version.js --apply # rewrite src/module-api.js
31
+ // node scripts/gds/bump-version.js --apply # rewrite both files
23
32
  // node scripts/gds/bump-version.js --apply --note "run 123456" # extra provenance
24
33
  // stdout (both modes): one JSON line { from, to, applied } for CI to capture.
25
34
 
@@ -29,35 +38,45 @@ const fs = require('node:fs');
29
38
  const path = require('node:path');
30
39
 
31
40
  const TARGET = path.join(__dirname, '..', '..', 'src', 'module-api.js');
41
+ // The release ledger (ADR 0203) — markdown, so the .js line ratchet never counts it.
42
+ const CHANGELOG = path.join(__dirname, '..', '..', 'docs', 'module-api-changelog.md');
32
43
  const CONST_RE = /^const CORE_VERSION = '(\d+)\.(\d+)\.(\d+)';.*$/m;
33
- // The changelog block's closing divider sits immediately above the const line.
34
- const DIVIDER = '// ---------------------------------------------------------------------------';
44
+ // The ledger's closing divider — the last line inside its fenced block, and the
45
+ // insertion anchor each new entry goes immediately above. Same 75-dash rule the
46
+ // comment block used, minus the `// ` that made it a JS comment.
47
+ const DIVIDER = '---------------------------------------------------------------------------';
35
48
 
36
- // Pure transform: (source text, optional note) -> { from, to, text }.
49
+ // Pure transform: (module-api source, { note, changelog }) -> { from, to, text,
50
+ // changelogText }. Pass the ledger's current text as `changelog` to get the
51
+ // entry appended too; omit it to bump the literal alone (the unit tests do).
37
52
  // Throws with a precise message on any shape it does not recognize — a silent
38
53
  // mis-edit of the version literal is the worst possible failure mode here.
39
- function bumpPatch(src, { note = '' } = {}) {
54
+ function bumpPatch(src, { note = '', changelog = null } = {}) {
40
55
  const m = src.match(CONST_RE);
41
56
  if (!m) throw new Error(`bump-version: could not find the CORE_VERSION literal in ${TARGET} (expected: const CORE_VERSION = 'x.y.z';)`);
42
57
  const [major, minor, patch] = [Number(m[1]), Number(m[2]), Number(m[3])];
43
58
  const from = `${major}.${minor}.${patch}`;
44
59
  const to = `${major}.${minor}.${patch + 1}`;
45
60
 
46
- // 1. The changelog entry — inserted just above the divider that closes the
47
- // changelog block, matching the existing two-line entry style.
48
- const constLineStart = src.search(CONST_RE);
49
- const dividerStart = src.lastIndexOf(DIVIDER, constLineStart);
50
- if (dividerStart === -1) throw new Error('bump-version: could not find the changelog closing divider above CORE_VERSION');
51
- const noteSuffix = note ? ` ${note}.` : '';
52
- const entry =
53
- `// ${to} — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges\n` +
54
- `// landed since ${from} with no explicit bump.${noteSuffix} (task 1002620)\n`;
61
+ // 1. The literal — same line shape deploy-divergence greps for.
62
+ const newConstLine = `const CORE_VERSION = '${to}'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md`;
63
+ const text = src.replace(CONST_RE, newConstLine);
55
64
 
56
- // 2. The literal — same line shape deploy-divergence greps for.
57
- const newConstLine = `const CORE_VERSION = '${to}'; // CI auto-patch carrier (ADR 0161); see changelog above`;
65
+ // 2. The ledger entry — inserted just above the divider that closes the
66
+ // ledger, keeping the historic two-line entry style byte-for-byte (the
67
+ // old `// ` / `// ` comment prefixes minus the `// ` marker).
68
+ let changelogText = null;
69
+ if (changelog !== null) {
70
+ const dividerStart = changelog.lastIndexOf(DIVIDER);
71
+ if (dividerStart === -1) throw new Error(`bump-version: could not find the changelog closing divider in ${CHANGELOG} — the ledger's insertion anchor is gone (ADR 0203)`);
72
+ const noteSuffix = note ? ` ${note}.` : '';
73
+ const entry =
74
+ ` ${to} — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges\n` +
75
+ ` landed since ${from} with no explicit bump.${noteSuffix} (task 1002620)\n`;
76
+ changelogText = changelog.slice(0, dividerStart) + entry + changelog.slice(dividerStart);
77
+ }
58
78
 
59
- const text = src.slice(0, dividerStart) + entry + src.slice(dividerStart).replace(CONST_RE, newConstLine);
60
- return { from, to, text };
79
+ return { from, to, text, changelogText };
61
80
  }
62
81
 
63
82
  function main() {
@@ -65,10 +84,19 @@ function main() {
65
84
  const noteIdx = process.argv.indexOf('--note');
66
85
  const note = noteIdx !== -1 ? (process.argv[noteIdx + 1] || '') : '';
67
86
 
87
+ // Read and transform BOTH files before writing EITHER: a half-applied bump
88
+ // (literal moved, ledger silent) is precisely the drift this script exists
89
+ // to prevent, and it would be committed and pushed to main before anyone saw it.
68
90
  const src = fs.readFileSync(TARGET, 'utf8');
69
- const { from, to, text } = bumpPatch(src, { note });
70
- if (apply) fs.writeFileSync(TARGET, text);
71
- else console.error(`bump-version: would bump ${from} → ${to} (dry-run; pass --apply to write)`);
91
+ const changelog = fs.readFileSync(CHANGELOG, 'utf8');
92
+ const { from, to, text, changelogText } = bumpPatch(src, { note, changelog });
93
+ if (changelogText === null) throw new Error('bump-version: the ledger was not rewritten — refusing to write a versionless release');
94
+ if (apply) {
95
+ fs.writeFileSync(TARGET, text);
96
+ fs.writeFileSync(CHANGELOG, changelogText);
97
+ } else {
98
+ console.error(`bump-version: would bump ${from} → ${to} in ${TARGET} + ${CHANGELOG} (dry-run; pass --apply to write)`);
99
+ }
72
100
  console.log(JSON.stringify({ from, to, applied: apply }));
73
101
  }
74
102
 
@@ -246,7 +246,7 @@ function report(r, { quiet = false } = {}) {
246
246
  ? ` (${u.countWithMerges} counting merges)` : '';
247
247
  say(` ⚠ UNRELEASED — ${u.count} work commit${u.count === 1 ? '' : 's'}${merges} on ${r.mainRef} since the last CORE_VERSION bump.`);
248
248
  say(' No instance can take these at ANY pin: no published version contains them.');
249
- say(` Fix: bump CORE_VERSION in src/module-api.js (+ a changelog line) and land it.`);
249
+ say(` Fix: bump CORE_VERSION in src/module-api.js (+ an entry in docs/module-api-changelog.md) and land it.`);
250
250
  }
251
251
  if (r.behind) {
252
252
  say(` ⚠ UNDEPLOYED — live is ${r.live.coreVersion}, main declares ${r.onMain}.`);
@@ -104,6 +104,12 @@ const PUBLISH_ALLOWLIST = [
104
104
  'docs/api/openapi.json', // the generated OpenAPI 3.1 spec served at /docs/openapi.json
105
105
  'docs/api-reference.md', // the markdown API reference
106
106
  'docs/modules-contract.md',
107
+ // The doorway's release ledger (ADR 0203). It USED TO ship inside
108
+ // src/module-api.js as a comment block, so an instance that installs
109
+ // @bongos/core has always received it; omitting it here would silently drop
110
+ // the history from the package at the next release. A module author checking
111
+ // what a `coreVersion` floor actually buys them reads exactly this file.
112
+ 'docs/module-api-changelog.md',
107
113
  'docs/branding-contract.md',
108
114
  'docs/branding-fill-prompt.md',
109
115
  // RUNTIME DATA that happens to live under docs/, not documentation (ADR 0178).
@@ -52,7 +52,12 @@ const MODULE_GLOBS = {
52
52
  'src/bongos/repo-info.js', 'src/bongos/api-path-404.js', 'src/bongos/serve-internal.js',
53
53
  'src/bongos/module-scope-map.js', 'src/bongos/hierarchy-config.js',
54
54
  'src/instance-config.js', 'src/branding.js', 'src/modules.js',
55
- 'src/module-api.js', 'src/module-loader/',
55
+ // The doorway and its release ledger travel together: since ADR 0203 the
56
+ // CORE_VERSION changelog is a separate markdown file, so a kernel-scoped
57
+ // goal authoring a version bump touches BOTH. Enumerated like copy-desk's
58
+ // docs/ artifacts below — without it, scopeSubset() denies the ledger as
59
+ // out_of_scope and a hand-cut MINOR/MAJOR cannot be authored at all.
60
+ 'src/module-api.js', 'docs/module-api-changelog.md', 'src/module-loader/',
56
61
  // security-the-PROPERTY: the threat-model (/security/adr) + Archon-only
57
62
  // exploit-detail engagement-doc store (/security/docs). Stays kernel when the
58
63
  // red-team FEATURE carved to modules/security/ (BV1.R79 / 02-module-map §5).