@bongos/core 1.19.809 → 1.19.810

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,11 +2,11 @@
2
2
  "artifact": "bongos-core",
3
3
  "manifest_schema": 1,
4
4
  "generator": "scripts/gds/package-core.js",
5
- "core_version": "1.19.809",
6
- "core_contract": "1.19.809",
7
- "source_commit": "8a0d6205ab8651338ec9f196b0d2a76457ecd7de",
5
+ "core_version": "1.19.810",
6
+ "core_contract": "1.19.810",
7
+ "source_commit": "a3d5dcdde5918a6ce46742502351896701a5a312",
8
8
  "source_ref": "HEAD",
9
- "built_at": "2026-09-17T05:51:03.923Z",
9
+ "built_at": "2026-09-17T06:04:48.341Z",
10
10
  "redaction": {
11
11
  "model": "docs-redacted+functional-verbatim",
12
12
  "docs_redacted": 487,
@@ -17,7 +17,7 @@
17
17
  "gate": "passed"
18
18
  },
19
19
  "file_count": 2710,
20
- "tree_sha256": "8ffacf4d6b6f9d1185a0367eef97d3f885c3219caa5f7b483c03e568f6e244cf",
20
+ "tree_sha256": "43e8bede11fa1d3c211405b457b91c73433af719f13cf34869cd9894607688b7",
21
21
  "files": [
22
22
  {
23
23
  "path": ".claude/skills/ask-for-help/SKILL.md",
@@ -2532,7 +2532,7 @@
2532
2532
  {
2533
2533
  "path": "docs/module-api-changelog.md",
2534
2534
  "mode": "0000644",
2535
- "sha256": "0fc3cc0ea86f2325096412d389457b095d7e12b175415e0f9bc41d5cd40946a1"
2535
+ "sha256": "559a5a32d7f2bbdfc6059b033898244d10bba1abc6881cc9d42388d135c1a164"
2536
2536
  },
2537
2537
  {
2538
2538
  "path": "docs/modules-contract.md",
@@ -7727,12 +7727,12 @@
7727
7727
  {
7728
7728
  "path": "package-lock.json",
7729
7729
  "mode": "0000644",
7730
- "sha256": "bce83e06aea9721525e159bbe1446154fcda006c89fdcde14fd6ab46f624366a"
7730
+ "sha256": "85db67c033657807d558c218faa46b3a94719479ca312e38fee928ea8e845d2a"
7731
7731
  },
7732
7732
  {
7733
7733
  "path": "package.json",
7734
7734
  "mode": "0000644",
7735
- "sha256": "714b48f38c2da73d5a2353c66228b8f4aa8cd375f7c712a1421f59bb0cf22e09"
7735
+ "sha256": "1ea12b0f66807661d162a59b47b20a2e166b5d356f88a766240c8a573cf95859"
7736
7736
  },
7737
7737
  {
7738
7738
  "path": "public-docs/index.html",
@@ -8977,7 +8977,7 @@
8977
8977
  {
8978
8978
  "path": "scripts/gds/ship-flow.js",
8979
8979
  "mode": "0000644",
8980
- "sha256": "de8f1f66bf964bfcb8e4fa570f1f873782dfee8d633ff6e599fb894096aecd14"
8980
+ "sha256": "bb39ac6572410567ce0a2881f26b0512df817fd04cec9130792ca24c48e8d02a"
8981
8981
  },
8982
8982
  {
8983
8983
  "path": "scripts/gds/ship-git.js",
@@ -9432,7 +9432,7 @@
9432
9432
  {
9433
9433
  "path": "src/bongos/module-scope-map.js",
9434
9434
  "mode": "0000644",
9435
- "sha256": "f9d3e4e892d11bbe83b0f76c588fc4c76204f6a424257eb0249acf680f85967a"
9435
+ "sha256": "8d7b749edca694b4c9d8a563a4334c7fe3fc7be64c520c3d14c3b63febff132a"
9436
9436
  },
9437
9437
  {
9438
9438
  "path": "src/bongos/module-submissions.js",
@@ -9622,7 +9622,7 @@
9622
9622
  {
9623
9623
  "path": "src/module-api.js",
9624
9624
  "mode": "0000644",
9625
- "sha256": "03b5ce71d6aeab750b5bd2dad14f89d459472a4b42a701b4923bb430cafa384e"
9625
+ "sha256": "a73a30f63258ab08abe959da6d8f31f8428c30c5d49772350beecb72e9131b2f"
9626
9626
  },
9627
9627
  {
9628
9628
  "path": "src/module-loader/catalog.js",
@@ -11942,7 +11942,7 @@
11942
11942
  {
11943
11943
  "path": "tests/module-scope-map.mjs",
11944
11944
  "mode": "0000644",
11945
- "sha256": "d985570340fb9706224c72ed27a2b9a9a84b985f56d2a45fcac564dc463175d4"
11945
+ "sha256": "e277e0579dd6c8fea459cc5a3b4adf04dda12c95e69a415eeea5cfd2de52d760"
11946
11946
  },
11947
11947
  {
11948
11948
  "path": "tests/module_api.mjs",
@@ -2092,5 +2092,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
2092
2092
  landed since 1.19.807 with no explicit bump. run 35185130913. (task 1002620)
2093
2093
  1.19.809 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
2094
2094
  landed since 1.19.808 with no explicit bump. run 35187322516. (task 1002620)
2095
+ 1.19.810 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
2096
+ landed since 1.19.809 with no explicit bump. run 35188253911. (task 1002620)
2095
2097
  ---------------------------------------------------------------------------
2096
2098
  ```
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.809",
3
+ "version": "1.19.810",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.809",
9
+ "version": "1.19.810",
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.809",
3
+ "version": "1.19.810",
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",
@@ -11,8 +11,7 @@
11
11
  const { cliClient, requireSession, arg, detectWorktreeName, cardFlagsFromMe } = require('./cli-lib');
12
12
  const { resolveProse, markShipProgress, smokeGateMessages, proseFlagPresent, regradeNotesRefusal, staleSummaryNotice } = require('./ship-honesty.js');
13
13
  const { classifyEmptyShip } = require('../../modules/lifecycle/ship-preflight');
14
- const { scopeForModule, isModuleKey } = require('../../src/bongos/module-scope-map');
15
- const { matchOne } = require('../../src/bongos/path-match');
14
+ const { isModuleKey, scopeForModule, moduleDriftFiles: computeModuleDrift } = require('../../src/bongos/module-scope-map');
16
15
  const { runShipGate } = require('./sandbox-stage');
17
16
  const { captureSurpriseLearning, promptSurprise } = require('./ship-surprise.js');
18
17
  // task 1003109: the optional `--visual` leg of a ship (goal 1000072).
@@ -270,9 +269,18 @@ async function shipMain() {
270
269
  // ---- Module drift check (BV1.R53, task 1422) ----
271
270
  // If the task carries a module_key, verify the committed diff doesn't stray
272
271
  // into a DIFFERENT module's territory. "You said game, you touched dev-box" is
273
- // the semantic violation this catches. Files outside all module scopes (docs,
274
- // session logs, general scripts) are allowed — they're cross-cutting. Only
275
- // contact with a DIFFERENT module's glob set is refused.
272
+ // the semantic violation this catches. Files no module owns are allowed —
273
+ // they're cross-cutting — as is the territory of a CROSS-CUTTING module, which
274
+ // every craft legitimately writes into. Only contact with a different OWNING
275
+ // module's glob set is flagged.
276
+ //
277
+ // The rule itself lives in module-scope-map.js (moduleDriftFiles) next to the
278
+ // map it reads, so it can be tested without running a ship (task 1003770). It
279
+ // used to be inline here, and read "files outside all module scopes (docs,
280
+ // session logs, general scripts) are allowed" — a premise task 1002989 ended by
281
+ // giving `methodology` the whole docs/ subtree. Since every ship writes a
282
+ // session log, the advisory then fired for 25 of the 26 module keys on that log
283
+ // alone. See CROSS_CUTTING_KEYS for why the glob was not shrunk instead.
276
284
  //
277
285
  // The check is ADVISORY (warns but does not refuse) on the first cut because
278
286
  // the module_key column is new and existing tasks may carry a broader diff scope
@@ -280,24 +288,26 @@ async function shipMain() {
280
288
  // ac.module_key comes from getActiveClaimsForBuilder (t.module_key in the join).
281
289
  const enforceModule = args.includes('--enforce-module');
282
290
  if (ac.module_key && isModuleKey(ac.module_key) && committedFiles.length > 0) {
283
- const declaredScope = scopeForModule(ac.module_key);
284
- const { MODULE_SCOPE_MAP } = require('../../src/bongos/module-scope-map');
285
- const moduleDriftFiles = committedFiles.filter((f) => {
286
- if (declaredScope && matchOne(f, declaredScope.globs)) return false;
287
- for (const [key, entry] of Object.entries(MODULE_SCOPE_MAP)) {
288
- if (key === ac.module_key) continue;
289
- if (matchOne(f, entry.globs)) return true;
290
- }
291
- return false;
292
- });
291
+ const moduleDriftFiles = computeModuleDrift(ac.module_key, committedFiles);
293
292
  if (moduleDriftFiles.length > 0) {
293
+ // Name the module's REAL territory rather than guessing 'modules/<key>/'.
294
+ // That guess is wrong for every module whose code has not been carved out
295
+ // yet (ADR 0083) — kernel lives in src/bongos/, methodology in docs/ — so
296
+ // the advisory used to tell those builders to move their work somewhere
297
+ // their module does not own. scopeForModule is the roster's own answer.
298
+ const declared = scopeForModule(ac.module_key);
299
+ const territory = declared && declared.globs.length
300
+ ? declared.globs.slice(0, 4).join(', ') + (declared.globs.length > 4 ? `, +${declared.globs.length - 4} more` : '')
301
+ : `modules/${ac.module_key}/`;
294
302
  const msg = [
295
303
  `\n⚠ Module drift detected: task is scoped to '${ac.module_key}' but ${moduleDriftFiles.length} file(s) touch a different module:`,
296
304
  ...moduleDriftFiles.map((f) => ` - ${f}`),
297
305
  '',
306
+ ` '${ac.module_key}' owns: ${territory}`,
307
+ '',
298
308
  enforceModule
299
- ? 'Refused (--enforce-module). Confine your changes to modules/' + ac.module_key + '/ or clear the module_key label.'
300
- : 'Advisory — ship proceeds, but consider confining your changes to modules/' + ac.module_key + '/.',
309
+ ? `Refused (--enforce-module). Confine your changes to that territory, or clear the module_key label.`
310
+ : 'Advisory — ship proceeds, but consider confining your changes to that territory.',
301
311
  ].join('\n');
302
312
  console.log(msg);
303
313
  if (enforceModule) process.exit(1);
@@ -37,7 +37,7 @@
37
37
  'use strict';
38
38
 
39
39
  const { PROTECTED_GLOBS } = require('./permission-path-check');
40
- const { touchesOverlap } = require('./path-match');
40
+ const { touchesOverlap, matchOne } = require('./path-match');
41
41
 
42
42
  // key → the path globs that constitute the module's code (exact paths or
43
43
  // trailing-'/' subtree prefixes). See the header for the auto-tighten contract.
@@ -486,6 +486,62 @@ function scopeIncludesProtected(keys) {
486
486
  return (keys || []).some((k) => isProtectedModule(k) === true);
487
487
  }
488
488
 
489
+ // ---- CROSS-CUTTING MODULES (task 1003770) ----
490
+ //
491
+ // A module whose territory EVERY craft legitimately writes into, whatever its own
492
+ // task is scoped to. Distinct from SHARED_GLOBS above: a shared glob is owned by
493
+ // nobody, while a cross-cutting module genuinely owns its paths — `methodology`
494
+ // really is the owner of docs/ — it is just that owning them cannot mean other
495
+ // modules are trespassing when they write there.
496
+ //
497
+ // WHAT THIS IS AND IS NOT FOR. This narrows ONE consumer: the ship-time module-
498
+ // drift advisory (moduleDriftFiles below), whose question is "you said game, did
499
+ // you touch dev-box?" — module-to-module confusion. It does NOT touch the goal
500
+ // scope wall, claim collisions (touchesOverlap), or the protected-path wall.
501
+ // Those keep counting methodology's territory as methodology's.
502
+ //
503
+ // WHY IT WAS NEEDED. Task 1002989 gave `methodology` the whole docs/ subtree.
504
+ // Since every ship writes a session log under docs/session-logs/, that made the
505
+ // advisory fire on 25 of the 26 module keys for the session log ALONE — it warned
506
+ // on essentially every module-keyed ship, which is not a signal, it is weather.
507
+ //
508
+ // WHY NOT SHRINK THE GLOB INSTEAD. The glob format has no wildcards (see the
509
+ // header), so "all of docs/ except session-logs" is inexpressible; enumerating
510
+ // docs/ subtree-by-subtree would rot on the next doc.
511
+ //
512
+ // THE BAR, deliberately high — "every task legitimately writes here as a normal
513
+ // part of shipping". `devsecops` is NOT on this list even though it owns
514
+ // package.json: a task that edits .github/, .husky/ or fitness.js while scoped to
515
+ // another module IS the confusion this advisory exists to surface, and lockfile
516
+ // churn is occasional rather than universal.
517
+ const CROSS_CUTTING_KEYS = Object.freeze(['methodology']);
518
+
519
+ function isCrossCuttingModule(key) {
520
+ return CROSS_CUTTING_KEYS.includes(key);
521
+ }
522
+
523
+ // Pure: of `files`, the ones that stray into a DIFFERENT module's territory for a
524
+ // task scoped to `moduleKey`. Extracted from scripts/gds/ship-flow.js (BV1.R53,
525
+ // task 1422) so the rule is testable without running a ship.
526
+ //
527
+ // A file is drift only if it is (a) outside the declared module's own globs and
528
+ // (b) inside some OTHER module's globs — a path no module owns is cross-cutting
529
+ // and always fine. Cross-cutting modules are skipped in (b): their territory
530
+ // never makes a file someone else's. An unknown moduleKey yields no drift, since
531
+ // there is no declared scope to stray from.
532
+ function moduleDriftFiles(moduleKey, files) {
533
+ const declaredScope = scopeForModule(moduleKey);
534
+ if (!declaredScope) return [];
535
+ return (files || []).filter((file) => {
536
+ if (matchOne(file, declaredScope.globs)) return false;
537
+ for (const [key, entry] of Object.entries(MODULE_SCOPE_MAP)) {
538
+ if (key === moduleKey || isCrossCuttingModule(key)) continue;
539
+ if (matchOne(file, entry.globs)) return true;
540
+ }
541
+ return false;
542
+ });
543
+ }
544
+
489
545
  module.exports = {
490
546
  MODULE_GLOBS,
491
547
  MODULE_SCOPE_MAP,
@@ -498,5 +554,6 @@ module.exports = {
498
554
  isProtectedModule,
499
555
  protectedModules,
500
556
  globsForModules,
557
+ moduleDriftFiles,
501
558
  scopeIncludesProtected,
502
559
  };
package/src/module-api.js CHANGED
@@ -71,7 +71,7 @@ const { responsibilityFor, ROLE_RESPONSIBILITIES } = require('./role-responsibil
71
71
  // there. scripts/gds/bump-version.js still rewrites the literal below; it appends
72
72
  // the entry to that file. Look for a version's history there, not here.
73
73
  // ---------------------------------------------------------------------------
74
- const CORE_VERSION = '1.19.809'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
74
+ const CORE_VERSION = '1.19.810'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
75
75
 
76
76
  // A namespaced logger so a module's log lines are attributable + consistent.
77
77
  // Usage: const log = api.logger('dev-box'); log.info('mounted');
@@ -291,3 +291,99 @@ test('the gap this closed: an honest task declaring its own test is now authoriz
291
291
  const r = gsc.check(['ideas'], ['modules/ideas/inbox.js', 'tests/idea_routing.mjs'], 'thetes');
292
292
  assert.equal(r.ok, true, r.reason);
293
293
  });
294
+
295
+
296
+ // ---- module drift advisory: cross-cutting territory (task 1003770) ----
297
+
298
+ const SESSION_LOG = 'docs/session-logs/2026-09-16-task-1003770-example.md';
299
+
300
+ test('THE BUG: a module-scoped task writing a session log is not drift (task 1003770)', () => {
301
+ // The row's own acceptance criterion. Task 1002989 gave `methodology` the whole
302
+ // docs/ subtree, and every ship writes a session log under it — so the advisory
303
+ // started firing on almost every module-keyed ship.
304
+ for (const key of scope.moduleKeys()) {
305
+ assert.deepEqual(
306
+ scope.moduleDriftFiles(key, [SESSION_LOG]), [],
307
+ `a '${key}' task writing a session log must not read as drift`,
308
+ );
309
+ }
310
+ });
311
+
312
+ test('the regression this replaces: the OLD rule flagged 25 of 26 keys on that one file', () => {
313
+ // Reproduce the pre-fix predicate — identical except that it does not skip
314
+ // cross-cutting modules — and prove it fails where the new one passes. Without
315
+ // this, the test above could pass for the wrong reason (e.g. nobody owning
316
+ // docs/) and go quietly vacuous if the glob moved again.
317
+ const { matchOne } = require(path.join(ROOT, 'src', 'bongos', 'path-match.js'));
318
+ const oldRule = (moduleKey, files) => {
319
+ const declared = scope.scopeForModule(moduleKey);
320
+ return files.filter((file) => {
321
+ if (declared && matchOne(file, declared.globs)) return false;
322
+ return Object.entries(scope.MODULE_SCOPE_MAP)
323
+ .some(([k, e]) => k !== moduleKey && matchOne(file, e.globs));
324
+ });
325
+ };
326
+ const flaggedBefore = scope.moduleKeys().filter((k) => oldRule(k, [SESSION_LOG]).length);
327
+ assert.ok(
328
+ flaggedBefore.length >= 20,
329
+ `expected the old rule to flag most keys on a session log, it flagged ${flaggedBefore.length}`,
330
+ );
331
+ assert.ok(flaggedBefore.includes('lifecycle'), 'sanity: lifecycle was among them');
332
+ });
333
+
334
+ test('a cross-cutting module owns its paths everywhere EXCEPT the drift advisory', () => {
335
+ // The narrowness is the point: this must not become a hole in the scope wall.
336
+ // methodology still genuinely owns docs/ — only moduleDriftFiles looks away.
337
+ // Asserted through behaviour, not through the roster constant: the constant is
338
+ // internal (nothing outside the module reads it), and "docs/ stops counting as
339
+ // someone else's territory" is the property that actually matters.
340
+ assert.deepEqual(scope.moduleDriftFiles('lifecycle', ['docs/architecture.md']), []);
341
+ assert.ok(scope.scopeForModule('methodology').globs.includes('docs/'));
342
+ const owners = Object.entries(scope.MODULE_SCOPE_MAP)
343
+ .filter(([, e]) => e.globs.includes('docs/'))
344
+ .map(([k]) => k);
345
+ assert.deepEqual(owners, ['methodology'], 'docs/ is still owned, not orphaned');
346
+ // And the goal scope wall still places docs/ inside methodology, unchanged.
347
+ assert.equal(gsc.check(['methodology'], ['docs/architecture.md'], 'thetes').ok, true);
348
+ });
349
+
350
+ test('real cross-module contact is still flagged — the signal the advisory exists for', () => {
351
+ // "You said lifecycle, you touched dev-box."
352
+ assert.deepEqual(
353
+ scope.moduleDriftFiles('lifecycle', ['modules/dev-box/app/src/box-controller.js']),
354
+ ['modules/dev-box/app/src/box-controller.js'],
355
+ );
356
+ // Its own territory, and territory no module owns, both stay quiet.
357
+ assert.deepEqual(scope.moduleDriftFiles('lifecycle', ['modules/lifecycle/rot.js']), []);
358
+ assert.deepEqual(scope.moduleDriftFiles('lifecycle', ['some/unowned/path.txt']), []);
359
+ // A mixed diff reports only the straying file.
360
+ assert.deepEqual(
361
+ scope.moduleDriftFiles('lifecycle', ['modules/lifecycle/rot.js', SESSION_LOG, 'modules/discord/discord-bot.js']),
362
+ ['modules/discord/discord-bot.js'],
363
+ );
364
+ });
365
+
366
+ test('devsecops is deliberately NOT cross-cutting (task 1003770)', () => {
367
+ // The bar is "every task legitimately writes here as part of shipping". Editing
368
+ // .github/ or fitness.js while scoped elsewhere IS the confusion being surfaced,
369
+ // so this stays a signal. Widening the cross-cutting roster to devsecops would
370
+ // red these, which is the point: it should take a deliberate edit, not a shrug.
371
+ for (const f of ['.github/workflows/unit.yml', 'scripts/gds/fitness.js', 'package.json']) {
372
+ assert.deepEqual(scope.moduleDriftFiles('lifecycle', [f]), [f], `${f} must still read as drift`);
373
+ }
374
+ // And exactly one module is cross-cutting: every other key's territory still
375
+ // counts against a lifecycle-scoped task. Proven over the whole roster rather
376
+ // than by naming the constant, so adding a second cross-cutting module fails here.
377
+ const quiet = scope.moduleKeys().filter((k) => k !== 'lifecycle'
378
+ && scope.moduleDriftFiles('lifecycle', scope.scopeForModule(k).globs).length === 0);
379
+ assert.deepEqual(quiet, ['methodology']);
380
+ });
381
+
382
+ test('moduleDriftFiles degrades safely on junk input', () => {
383
+ // ship-flow calls this with whatever the claim carries; it must never throw.
384
+ assert.deepEqual(scope.moduleDriftFiles('not-a-module', ['modules/dev-box/app.js']), [],
385
+ 'an unknown key has no declared scope to stray from');
386
+ assert.deepEqual(scope.moduleDriftFiles('lifecycle', []), []);
387
+ assert.deepEqual(scope.moduleDriftFiles('lifecycle', null), []);
388
+ assert.deepEqual(scope.moduleDriftFiles(null, ['modules/dev-box/app.js']), []);
389
+ });