@bongos/core 1.19.702 → 1.19.704

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/.bongos-core.json CHANGED
@@ -2,22 +2,22 @@
2
2
  "artifact": "bongos-core",
3
3
  "manifest_schema": 1,
4
4
  "generator": "scripts/gds/package-core.js",
5
- "core_version": "1.19.702",
6
- "core_contract": "1.19.702",
7
- "source_commit": "3b1a2e8029758a6ee091812baccb9e24fdc4670a",
5
+ "core_version": "1.19.704",
6
+ "core_contract": "1.19.704",
7
+ "source_commit": "86a7901eed7ffd687d8366c14b70b6dbce1a36f8",
8
8
  "source_ref": "HEAD",
9
- "built_at": "2026-09-13T03:33:51.903Z",
9
+ "built_at": "2026-09-13T04:51:44.117Z",
10
10
  "redaction": {
11
11
  "model": "docs-redacted+functional-verbatim",
12
12
  "docs_redacted": 477,
13
13
  "agent_docs_stubbed": 24,
14
- "functional_verbatim": 2130,
14
+ "functional_verbatim": 2132,
15
15
  "rules": 3,
16
16
  "gate_literals": 3,
17
17
  "gate": "passed"
18
18
  },
19
- "file_count": 2631,
20
- "tree_sha256": "7bf1dff3812c90015cc9d2476643856d5c6e9e950d26c6859e219c0eab9796b5",
19
+ "file_count": 2633,
20
+ "tree_sha256": "6a38a87e7ab24df8fa7020189772ed67bc02d6271601eda7a94aeddf84bfc12d",
21
21
  "files": [
22
22
  {
23
23
  "path": ".claude/skills/ask-for-help/SKILL.md",
@@ -2802,7 +2802,7 @@
2802
2802
  {
2803
2803
  "path": "docs/module-api-changelog.md",
2804
2804
  "mode": "0000644",
2805
- "sha256": "7458093aecd8dd3fcc7753356a12e995b25663e9251a295c406e4ecc4cc54c27"
2805
+ "sha256": "339e97fa485b7a1b3090c5964a23d6d30d3863781e549e30af68610fb3eedb91"
2806
2806
  },
2807
2807
  {
2808
2808
  "path": "docs/modules-contract.md",
@@ -3067,7 +3067,7 @@
3067
3067
  {
3068
3068
  "path": "docs/recipes/windows-builders.md",
3069
3069
  "mode": "0000644",
3070
- "sha256": "e5bcc0b4da0755546cb10870052099def2745c890cd8157d36d997e58a0399b3"
3070
+ "sha256": "6760a34d404aa68c61896983c8aa621bd26244e5c98ed056045b3467359c4b53"
3071
3071
  },
3072
3072
  {
3073
3073
  "path": "docs/recipes/work-on-a-task-from-your-dev-box.md",
@@ -3862,7 +3862,7 @@
3862
3862
  {
3863
3863
  "path": "modules/agents/lib/validate.js",
3864
3864
  "mode": "0000644",
3865
- "sha256": "5cff70fc4e280c49d33dfb8f60ddb01181decd1645625b0bb5e7c2eb97335b81"
3865
+ "sha256": "cd3659ad5831c767fe6600fabbe883f33b3429107a0b999092158dfa7c95b4e7"
3866
3866
  },
3867
3867
  {
3868
3868
  "path": "modules/agents/migrations/agents_001_definitions.sql",
@@ -4642,7 +4642,7 @@
4642
4642
  {
4643
4643
  "path": "modules/government/protected-surfaces.json",
4644
4644
  "mode": "0000644",
4645
- "sha256": "6d9a7520b2565b34bf002df016598543101639ccc384d81a622d313ed688acbc"
4645
+ "sha256": "2a6c392d4499498f0e0fb80c80002ba9d82a3f5e66e48cce9802c21c276af2a0"
4646
4646
  },
4647
4647
  {
4648
4648
  "path": "modules/government/ranks.js",
@@ -7782,12 +7782,12 @@
7782
7782
  {
7783
7783
  "path": "package-lock.json",
7784
7784
  "mode": "0000644",
7785
- "sha256": "1aa096840e001b544038432419a0e07577014954f7cb83d8e19c716704e3f36c"
7785
+ "sha256": "8eb4b18a9a0ee8ec64bab2712698fca515ff92277ebeed12adbb7126fe30e3e2"
7786
7786
  },
7787
7787
  {
7788
7788
  "path": "package.json",
7789
7789
  "mode": "0000644",
7790
- "sha256": "cee79b868fecce6053d7d04108233e795a92c3635854bea1bf3003b909953e20"
7790
+ "sha256": "6c55beca8912927a2d103ef0efee212341daa09be17e346d4d298377e3958d19"
7791
7791
  },
7792
7792
  {
7793
7793
  "path": "public-docs/index.html",
@@ -7859,6 +7859,11 @@
7859
7859
  "mode": "0000644",
7860
7860
  "sha256": "9c7ef61b64e41ee5dd6d913883e16dfed6d44bd6eefa4960b8dde566a63b5621"
7861
7861
  },
7862
+ {
7863
+ "path": "scripts/gds/agents-sync.js",
7864
+ "mode": "0000644",
7865
+ "sha256": "7a639c73f8d2f4f523899ab737641174ca7b5ed5409427238d7fc397cdba65ed"
7866
+ },
7862
7867
  {
7863
7868
  "path": "scripts/gds/api.js",
7864
7869
  "mode": "0000644",
@@ -9177,7 +9182,7 @@
9177
9182
  {
9178
9183
  "path": "scripts/migrate.sh",
9179
9184
  "mode": "0000644",
9180
- "sha256": "0768bf9c9d6368ae673e1e5ac161cfe9bae4d113129f11f8b89afeeef1f9dc1b"
9185
+ "sha256": "669ba0cd4e0c5ad2c7809364e4ac17b24bfa3f8542fae5ba7ec05e9bcf77053f"
9181
9186
  },
9182
9187
  {
9183
9188
  "path": "scripts/migrate_cost_ledger.sh",
@@ -9552,7 +9557,7 @@
9552
9557
  {
9553
9558
  "path": "src/module-api.js",
9554
9559
  "mode": "0000644",
9555
- "sha256": "be1bd4054da76be7eb7aa62d3e9ee2805de116d811e25043a49bbd4731ad1643"
9560
+ "sha256": "0954b91956641ff68caa5c9373be6d33d3ac3fdacda102846de75a339326fc86"
9556
9561
  },
9557
9562
  {
9558
9563
  "path": "src/module-loader/catalog.js",
@@ -9664,10 +9669,15 @@
9664
9669
  "mode": "0000644",
9665
9670
  "sha256": "8cc261471a36e3c447df57b46082997b6a50da3c8ff4b214787ae55ab27cb9ef"
9666
9671
  },
9672
+ {
9673
+ "path": "tests/agents_sync.mjs",
9674
+ "mode": "0000644",
9675
+ "sha256": "f7f6d88fd31a2eb1a81678d883706d2716e6a2ae20159599d3dbe7ed4c267f2e"
9676
+ },
9667
9677
  {
9668
9678
  "path": "tests/agents_validate.mjs",
9669
9679
  "mode": "0000644",
9670
- "sha256": "c698b80ab8d64421b5c81e91172e1f219c41924af19721106f1899cd29c2fabc"
9680
+ "sha256": "82c7bcef316f5c0068cb53a43b2ef4a01367ff285939f132f01b0d8633d36353"
9671
9681
  },
9672
9682
  {
9673
9683
  "path": "tests/api_cli_flags.mjs",
@@ -10982,7 +10992,7 @@
10982
10992
  {
10983
10993
  "path": "tests/government_protected_surfaces.mjs",
10984
10994
  "mode": "0000644",
10985
- "sha256": "3517e05c1264fbdbeadc533884942926689952c8995548863ca1cfbfc365428e"
10995
+ "sha256": "d11562d59861a5f5d294c072b3aa15f03703ddbb2102210ff92f7ccbcff5b5f6"
10986
10996
  },
10987
10997
  {
10988
10998
  "path": "tests/government_rank_sync.mjs",
@@ -1863,5 +1863,9 @@ is load-bearing: the script throws rather than guess if it is missing, and
1863
1863
  landed since 1.19.700 with no explicit bump. run 34735311256. (task 1002620)
1864
1864
  1.19.702 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1865
1865
  landed since 1.19.701 with no explicit bump. run 34735775228. (task 1002620)
1866
+ 1.19.703 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1867
+ landed since 1.19.702 with no explicit bump. run 34736566183. (task 1002620)
1868
+ 1.19.704 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1869
+ landed since 1.19.703 with no explicit bump. run 34738864605. (task 1002620)
1866
1870
  ---------------------------------------------------------------------------
1867
1871
  ```
@@ -88,30 +88,57 @@ DB-backed tests with no local Postgres — the count drifts and is not worth rec
88
88
  **`node scripts/gds/run-unit-tests.js`** instead: it is the DB-free gate CI actually runs, so its
89
89
  result means something locally.
90
90
 
91
- **That gate's Windows baseline as of task 1003529 (2026-09-12): 4 suites** — `sound_player`
92
- (task 1003628), `session_caps` (1003827), `skill_preflight` (1003754), `task_recommendations`
93
- (1003759) — **plus the 6 carried by task 1003848**: `cli_surface`, `module_api_lazy`,
94
- `search_index_poller`, `search_isolation`, `tool_scan_engine`, `security/mirror`. Everything else
95
- is green, and a red suite outside those ten is yours.
96
-
97
- `logger` is **not** on that list and needs no work: it was the whole of the old "missing deps in
98
- the worktree" family and task 1003616 fixed it on 2026-09-07see the walk-up section below.
99
-
100
- **Two of the ten are INTERMITTENT, so a green run does not mean fixed.** `session_caps` and
101
- `search_isolation` exit `3221226505` (`0xC0000409`, STATUS_STACK_BUFFER_OVERRUN) the process
102
- dies during teardown *after* its assertions have all passed, so whether the suite counts them as
103
- failures depends on timing. Measured in task 1003529: `session_caps` passed inside a full
104
- `run-unit-tests.js` sweep and failed twice in a row when run on its own, minutes apart, with task
105
- 1003827 still open and nothing on main having touched it. This is the `cliExit` class documented in
91
+ **That gate's Windows baseline, re-measured for task 1003860 on 2026-09-12 in a deps-installed
92
+ `origin/main` worktree (core 1.19.703): 9 suites** — `session_caps` (task 1003827),
93
+ `skill_preflight` (1003754), `task_recommendations` (1003759) — **plus the 6 carried by task
94
+ 1003848**: `cli_surface`, `module_api_lazy`, `search_index_poller`, `search_isolation`,
95
+ `tool_scan_engine`, `security/mirror`. Everything else is green, and a red suite outside those
96
+ nine is yours.
97
+
98
+ **`sound_player` LEFT this list on 2026-09-12**task 1003628 fixed the real bug behind it (the
99
+ sound-prefs case read the builder's own settings instead of a fixture), and it is now green in two
100
+ full sweeps and two standalone runs. It is called out rather than quietly deleted because it was
101
+ listed as expected-red for a matter of hours: the list was written the same day the fix shipped.
102
+ `logger` is likewise **not** on the list and needs no work — it was the whole of the old "missing
103
+ deps in the worktree" family and task 1003616 fixed it on 2026-09-07 (see the walk-up section
104
+ below).
105
+
106
+ **THREE suites are INTERMITTENT on a Windows box, so neither a green run nor a red one settles
107
+ anything on its own.** Two of the three are on the baseline above; the third is NOT, and keeping
108
+ that distinction straight is the whole point of this paragraph — "intermittent" is a property of a
109
+ suite, not a licence to add it to the expected-red list.
110
+
111
+ *Intermittent AND on the list:* `session_caps` and `search_isolation` exit `3221226505`
112
+ (`0xC0000409`, STATUS_STACK_BUFFER_OVERRUN) — the process dies during teardown *after* its
113
+ assertions have all passed, so whether the suite counts them as failures depends on timing. Both
114
+ directions are now on record. Task 1003529: `session_caps` passed inside a full
115
+ `run-unit-tests.js` sweep and failed twice in a row when run on its own, minutes apart. Task
116
+ 1003860, two sweeps minutes apart on one unchanged tree: `session_caps` was RED in the first and
117
+ GREEN in the second, plus green twice standalone — so the same tree answers 9 failures or 8
118
+ depending on nothing you did, and `search_isolation` was red in both. Task 1003827 is still open
119
+ and nothing on main has touched either. This is the `cliExit` class documented in
106
120
  [scripts/gds/CLAUDE.md](../../scripts/gds/CLAUDE.md) — a hard exit while handles are still closing.
107
121
  Do not mark either fixed on the strength of one green sweep, and do not let their noise cover a
108
122
  real regression: diff by name AND re-run the individual suite.
109
123
 
124
+ *Intermittent but NOT on the list:* `<redacted>` (task 1003860). It failed inside one
125
+ full sweep on 2026-09-12 and has not reproduced since — green standalone 7-of-7 then, and green in
126
+ both full sweeps and three more standalone runs when the baseline was re-measured. It binds an
127
+ ephemeral socket (`app.listen(0)`) and calls `server.close()` without awaiting it, so it is the
128
+ same teardown-timing class as the two above. Know the name, so a red here does not send you
129
+ hunting your own diff — but it stays OFF the expected-red list, because it is green on
130
+ `origin/main`. **A suite that reds once and then will not reproduce is not a baseline entry.**
131
+ Promoting a one-off red to a known name buys nothing and gives a genuine regression somewhere to
132
+ hide; `git_merge_regen` below is the case that cost a whole session. Re-run this one alone before
133
+ you touch anything.
134
+
110
135
  Two warnings about that list, both paid for:
111
136
 
112
137
  - **It drifts in BOTH directions.** The measurement before it (2026-08-27, 25 suites) had 7
113
138
  entries already fixed and was missing 6 that had since broken — so more than half of it was
114
- wrong within a fortnight. Re-measure; never inherit a list.
139
+ wrong within a fortnight. And the one after THAT went stale in hours rather than weeks:
140
+ `sound_player` was fixed by task 1003628 the same day it was written down as expected-red
141
+ (task 1003860). Re-measure; never inherit a list.
115
142
  - **Compare NAMES, never counts**, and never bank a local red as "environmental" without a
116
143
  by-name baseline run in a deps-installed `origin/main` worktree. A count that matches can hide
117
144
  one suite fixed and another broken.
@@ -143,6 +143,11 @@ function validateAgentDefinition(obj, opts = {}) {
143
143
  const rawProtected = safeGet(options, 'protectedModules');
144
144
  const allowedModules = Array.isArray(rawAllowed) ? rawAllowed : [];
145
145
  const protectedModules = Array.isArray(rawProtected) ? rawProtected : [];
146
+ // (path) => boolean — "does this repo-relative path reach a protected
147
+ // surface?". Supplied by the caller from the protected-surface registry
148
+ // (task 1002492); see the scope_paths wall below for why it is passed in and
149
+ // why its absence refuses rather than admits.
150
+ const isProtectedPath = safeGet(options, 'isProtectedPath');
146
151
 
147
152
  // --- name ----------------------------------------------------------------
148
153
  const name = safeGet(obj, 'name');
@@ -276,6 +281,57 @@ function validateAgentDefinition(obj, opts = {}) {
276
281
  }
277
282
  }
278
283
 
284
+ // --- scope: THE OTHER HALF OF THE SAME WALL (task 1002492) -----------------
285
+ //
286
+ // Until now the rank wall ran over `scope_modules` only, and `scope_paths` was
287
+ // checked for tree-escape and nothing else. So one wall had two halves that
288
+ // disagreed: `scope_modules: ['government']` was refused below Metic, while
289
+ // `scope_paths: ['modules/government/']` reached the same code and passed at
290
+ // any rank. A definition could scope itself onto the authority surface by
291
+ // spelling it as a path — which is the one thing this check exists to stop.
292
+ //
293
+ // The matcher is PASSED IN rather than required, for the same reason
294
+ // `protectedModules` is: this module may not require core (ADR 0083), and the
295
+ // protected-surface registry must stay readable with no DB and no server so
296
+ // the out-of-band enforcers keep working (ADR 0043). The caller owns both.
297
+ if (scopePaths && scopePaths.length > 0) {
298
+ if (typeof isProtectedPath !== 'function') {
299
+ // FAIL-CLOSED, and deliberately not a default of "nothing is protected":
300
+ // scope_paths has no allowlist counterpart the way scope_modules has
301
+ // `allowedModules`, so an absent matcher would be a silent hole rather
302
+ // than a narrow scope. Declaring paths REQUIRES the caller to supply the
303
+ // means to check them.
304
+ E('scope_paths_uncheckable', 'scope_paths',
305
+ 'scope_paths: declared, but no protected-path matcher was supplied, so they cannot be checked against the protected-surface registry. Refused rather than admitted — a path scope that nothing verified is indistinguishable from one nobody walled.');
306
+ } else {
307
+ const hits = [];
308
+ for (const p of scopePaths) {
309
+ let protectedPath;
310
+ try {
311
+ // ONLY an explicit `false` clears a path. Not `=== true`: that reads
312
+ // every ambiguous answer — undefined from a matcher that forgot a
313
+ // return, a truthy string, null — as "not protected", which is
314
+ // fail-OPEN on the exact question the wall exists to ask. Reading
315
+ // ambiguity as protected is loud and gets fixed; reading it as clean
316
+ // is silent and does not.
317
+ protectedPath = isProtectedPath(p) !== false;
318
+ } catch {
319
+ // A throwing matcher is treated as a HIT for the same reason: the
320
+ // question going unanswered must not read as no.
321
+ protectedPath = true;
322
+ }
323
+ if (protectedPath) hits.push(p);
324
+ }
325
+ if (hits.length > 0) {
326
+ const rankIdx = typeof authorRank === 'string' ? RANK_ORDER.indexOf(authorRank) : -1;
327
+ if (rankIdx < RANK_ORDER.indexOf(SCOPE_RANK_FLOOR)) {
328
+ E('scope_protected_rank', 'scope_paths',
329
+ `scope_paths: ${hits.map((p) => JSON.stringify(p)).join(', ')} ${hits.length === 1 ? 'reaches a protected surface' : 'reach protected surfaces'} and require a ${SCOPE_RANK_FLOOR}+ author; the author's resolved rank is ${JSON.stringify(authorRank ?? null)} (ADR 0016 / ADR 0043). A path scope is walled exactly as a module scope is — spelling the surface as a path is not a way around it.`);
330
+ }
331
+ }
332
+ }
333
+ }
334
+
279
335
  if (errors.length > 0) return { ok: false, errors, value: null };
280
336
 
281
337
  // The normalized row, built fresh — the caller's object is never mutated, and
@@ -55,6 +55,14 @@
55
55
  { "glob": "scripts/gds/install-git-hooks.js", "group": "pipeline", "why": "the hook installer (self-protect)" },
56
56
  { "glob": "scripts/gds/hooks/", "group": "pipeline", "why": "the git hooks themselves (self-protect)" },
57
57
  { "glob": "scripts/gds/cli-lib.js", "group": "pipeline", "why": "session/token + apiCall the gate relies on" },
58
+ { "glob": "scripts/gds/git-merge-regen.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: registerMergeDriver writes 'node scripts/gds/git-merge-regen.js' as a RELATIVE command with cwd at the clone root, so git merge runs the BRANCH's copy, with the live server's DATABASE_URL and BUILDER_SECRET_KEY, before any post-merge step. This and the six generators below are the ENTRYPOINTS in modules/lifecycle/executed-closure.js; tests/government_protected_surfaces.mjs fails the build if that list ever grows past this registry." },
59
+ { "glob": "scripts/gds/gen-repo-map.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: run by the merge resolver as execFile(node, [<clone>/...]) after the merge — the branch's copy, the server's environment." },
60
+ { "glob": "scripts/gds/gen-file-map.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: the same post-merge generator path as gen-repo-map.js." },
61
+ { "glob": "scripts/gds/gen-session-index.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: the same post-merge generator path as gen-repo-map.js." },
62
+ { "glob": "scripts/gds/copy-inventory.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: a generator the resolver runs out of the clone. NOT named by the 2026-08-29 audit, which said 'the gen-* trio' — that trio was already stale against GENERATOR_SCRIPTS, which is why this registry is pinned to the closure's ENTRYPOINTS rather than to the audit's prose." },
63
+ { "glob": "scripts/gds/gen-api-docs.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: a generator the resolver runs out of the clone, and the widest one — it require()s src/bongos/route-rank-check, api-prefix and routes/_helpers." },
64
+ { "glob": "scripts/gds/gen-api-client.js", "group": "pipeline", "why": "task 1003366, audit ref MIT1. EXECUTION ROOT: a generator the resolver runs out of the clone." },
65
+ { "glob": ".gitattributes", "group": "pipeline", "why": "task 1003366, audit ref MIT1. Not code and never require()d, but it NAMES which paths git hands the otb-regen driver — so editing it changes how much of the tree that driver rewrites during a merge. modules/lifecycle/executed-closure.js carries it as TRUSTED_NON_CODE for exactly this reason (ADR 0043)." },
58
66
  { "glob": "scripts/migrate.sh", "group": "pipeline", "why": "applies migrations on deploy" },
59
67
  { "glob": "scripts/deploy/", "group": "pipeline", "why": "the deploy scripts run on the droplet at deploy (ADR 0058)" },
60
68
  { "glob": "modules/lifecycle/merge-lock.js", "group": "pipeline", "why": "BV1.R86: serializes a ship" },
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.702",
3
+ "version": "1.19.704",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.702",
9
+ "version": "1.19.704",
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.702",
3
+ "version": "1.19.704",
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",