@bongos/core 1.24.45 → 1.24.46

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.
Files changed (106) hide show
  1. package/.bongos-core.json +140 -105
  2. package/clients/bongos-client/README.md +1 -1
  3. package/clients/bongos-client/bongos-client.global.js +4 -0
  4. package/clients/bongos-client/index.cjs +4 -0
  5. package/clients/bongos-client/index.d.ts +8 -0
  6. package/clients/bongos-client/index.mjs +4 -0
  7. package/docs/adr/0307-autobongos-a-deterministic-supervisor-and-agentic-workers.md +15 -0
  8. package/docs/api/openapi.json +152 -3
  9. package/docs/api-reference.md +4 -2
  10. package/docs/copy-inventory.md +1102 -1102
  11. package/docs/copy-registry.json +1538 -1538
  12. package/docs/module-api-changelog.md +2 -0
  13. package/docs/onboarding/diagrams/assertions.json +2 -2
  14. package/docs/page-inventory.json +11 -0
  15. package/docs/page-readings.json +724 -724
  16. package/migrations/core_295_runner_logins.sql +50 -0
  17. package/modules/government/session-scopes.json +5 -0
  18. package/modules/hall-ui/public/ai-studio.states.json +2 -0
  19. package/modules/hall-ui/public/atlas.states.json +2 -0
  20. package/modules/hall-ui/public/board-room.states.json +2 -0
  21. package/modules/hall-ui/public/city.states.json +2 -0
  22. package/modules/hall-ui/public/collab.states.json +2 -0
  23. package/modules/hall-ui/public/commands.states.json +2 -0
  24. package/modules/hall-ui/public/copy-desk.states.json +2 -0
  25. package/modules/hall-ui/public/deploy.states.json +2 -0
  26. package/modules/hall-ui/public/goal-map.states.json +2 -0
  27. package/modules/hall-ui/public/goals.css +1 -0
  28. package/modules/hall-ui/public/goals.states.json +2 -0
  29. package/modules/hall-ui/public/government.states.json +2 -0
  30. package/modules/hall-ui/public/idea.states.json +2 -0
  31. package/modules/hall-ui/public/ideas.states.json +2 -0
  32. package/modules/hall-ui/public/index-founding.states.json +2 -0
  33. package/modules/hall-ui/public/index-genesis-decide.states.json +2 -0
  34. package/modules/hall-ui/public/index-genesis-demo.states.json +2 -0
  35. package/modules/hall-ui/public/index-genesis.states.json +2 -0
  36. package/modules/hall-ui/public/index.states.json +5 -0
  37. package/modules/hall-ui/public/market-watch-item.states.json +2 -0
  38. package/modules/hall-ui/public/market-watch-rules.states.json +2 -0
  39. package/modules/hall-ui/public/market-watch.states.json +2 -0
  40. package/modules/hall-ui/public/modules.states.json +2 -0
  41. package/modules/hall-ui/public/money.states.json +2 -0
  42. package/modules/hall-ui/public/my-agents.states.json +2 -0
  43. package/modules/hall-ui/public/notes-panel.css +1 -1
  44. package/modules/hall-ui/public/primer.states.json +2 -0
  45. package/modules/hall-ui/public/profile.states.json +2 -0
  46. package/modules/hall-ui/public/roster.states.json +2 -0
  47. package/modules/hall-ui/public/settings.states.json +2 -0
  48. package/modules/hall-ui/public/street-card.states.json +2 -0
  49. package/modules/hall-ui/public/street.states.json +2 -0
  50. package/modules/hall-ui/public/studio.states.json +2 -0
  51. package/modules/hall-ui/public/style.css +27 -24
  52. package/modules/hall-ui/public/task.states.json +2 -0
  53. package/modules/hall-ui/public/thinking.states.json +2 -0
  54. package/modules/hall-ui/public/tweak-editor.states.json +2 -0
  55. package/modules/hall-ui/public/watch.states.json +2 -0
  56. package/modules/hall-ui/public/welcome-boot.js +6 -2
  57. package/modules/hall-ui/public/work-founding.states.json +2 -0
  58. package/modules/hall-ui/public/work.states.json +3 -1
  59. package/modules/lifecycle/db-claims.js +6 -3
  60. package/modules/lifecycle/routes/claims.js +10 -0
  61. package/modules/lifecycle/routes/tasks.js +1 -1
  62. package/modules/lifecycle/runner-self-guard.js +19 -10
  63. package/modules/platform-identity/platform-identity.js +1 -1
  64. package/modules/platform-identity/tests/platform-identity.mjs +13 -2
  65. package/modules/provisioning/core-upgrade-authz.js +8 -0
  66. package/modules/public-landing/public/account.html +1 -0
  67. package/modules/public-landing/public/community.html +1 -0
  68. package/modules/public-landing/public/connections.html +1 -0
  69. package/modules/public-landing/public/contact.html +1 -0
  70. package/modules/public-landing/public/guild.html +1 -0
  71. package/modules/public-landing/public/index.html +1 -0
  72. package/modules/public-landing/public/invitations.html +1 -0
  73. package/modules/public-landing/public/privacy.html +1 -0
  74. package/modules/public-landing/public/projects.html +1 -0
  75. package/modules/public-landing/public/terms.html +1 -0
  76. package/modules/raise/views/gate.html +1 -0
  77. package/modules/raise/views/nda.html +1 -0
  78. package/modules/raise/views/page.html +1 -0
  79. package/modules/status-ui/public/index.html +1 -0
  80. package/modules/ui-design/kit/README.md +1 -1
  81. package/modules/ui-design/kit/fixtures/versions.json +1 -0
  82. package/modules/ui-design/kit/lib.js +48 -3
  83. package/modules/ui-design/kit/probe.js +1 -0
  84. package/modules/ui-design/kit/render.js +2 -0
  85. package/modules/ui-design/kit/serve.js +1 -0
  86. package/modules/ui-design/module.json +1 -1
  87. package/modules/ui-design/public/tokens.css +125 -0
  88. package/package-lock.json +2 -2
  89. package/package.json +1 -1
  90. package/release-notes.json +14 -0
  91. package/scripts/bongos/fitness.js +1 -1
  92. package/scripts/bongos/run-unit-tests.js +3 -0
  93. package/src/bongos/auth.js +25 -4
  94. package/src/bongos/route-rank-check.js +5 -0
  95. package/src/bongos/routes/auth.js +48 -0
  96. package/src/bongos/runner-login.js +151 -0
  97. package/src/bongos/serve-internal.js +6 -1
  98. package/src/module-api.js +1 -1
  99. package/tests/autobongos_runner_login.mjs +296 -0
  100. package/tests/autobongos_runner_login_db.mjs +105 -0
  101. package/tests/design_tokens_shared.mjs +183 -0
  102. package/tests/government_session_scope.mjs +2 -1
  103. package/tests/hall_reading_world.mjs +5 -1
  104. package/tests/hall_tokens.mjs +22 -3
  105. package/tests/ui_design_kit.mjs +30 -0
  106. package/tests/welcome_boot_browser.mjs +4 -0
@@ -82,6 +82,21 @@ const contractTier = declarations(bodyAt(src.indexOf('{', bareRoots[0].index)));
82
82
  const darkExplicit = declarations(blockAfter('html[data-theme="dark"] {'));
83
83
  const darkMedia = declarations(blockAfter('html:not([data-theme]) {'));
84
84
 
85
+ // THE SHARED TOKEN SHEET (task 1005081). style.css @imports
86
+ // modules/ui-design/public/tokens.css first, so its scales (--ds-*) sit UNDER the
87
+ // hall's own declarations, and the hall's scale names (--radius, --sp-*, --z-*,
88
+ // --shadow-pop, --line, --label-size) are aliases onto it. Its :root and its dark
89
+ // switch rule are read here so the resolver sees what the browser sees.
90
+ const SHARED_SRC = fs.readFileSync(path.join(ROOT, 'modules', 'ui-design', 'public', 'tokens.css'), 'utf8');
91
+ const sharedBlock = (marker) => {
92
+ const at = SHARED_SRC.indexOf(marker);
93
+ assert.notEqual(at, -1, `tokens.css no longer contains ${marker} — update this test`);
94
+ const open = SHARED_SRC.indexOf('{', at);
95
+ return declarations(SHARED_SRC.slice(open + 1, SHARED_SRC.indexOf('}', open)));
96
+ };
97
+ const sharedRoot = sharedBlock(':root {');
98
+ const sharedDark = sharedBlock('html[data-theme="dark"]');
99
+
85
100
  // THE CASCADE THAT ACTUALLY SHIPS. injectBrandingInto splices the pack's theme
86
101
  // <style> at the END of <head> — after style.css's <link> — as a plain :root.
87
102
  // Equal specificity, later in document order, so for the tokens the pack emits
@@ -112,8 +127,8 @@ const NIGHT_TINT = process.env.UI_DESIGN_TINT === '1'
112
127
  : {};
113
128
 
114
129
  const RAW = {
115
- light: { ...contractTier, ...PACK },
116
- dark: { ...contractTier, ...PACK, ...darkExplicit, ...NIGHT_TINT },
130
+ light: { ...sharedRoot, ...contractTier, ...PACK },
131
+ dark: { ...sharedRoot, ...contractTier, ...PACK, ...sharedDark, ...darkExplicit, ...NIGHT_TINT },
117
132
  };
118
133
 
119
134
  // ── color resolution ─────────────────────────────────────────────────────────
@@ -319,7 +334,10 @@ test('--line is a width, not a colour', () => {
319
334
  // DESIGN.md warns about this exact name: --line is a 1px WIDTH here and a
320
335
  // hairline COLOUR in the hub's sheet. Page sheets that treated it as a colour
321
336
  // were repointed at --rule / --rule-soft in task 1003303.
322
- assert.match(contractTier['--line'], /^\d+px$/, '--line must resolve to a length');
337
+ // an alias onto the shared sheet since task 1005081 — follow it one step
338
+ const alias = /^var\((--[\w-]+)\)$/.exec(contractTier['--line']);
339
+ const line = alias ? sharedRoot[alias[1]] : contractTier['--line'];
340
+ assert.match(String(line), /^\d+px$/, '--line must resolve to a length');
323
341
  const sheets = fs.readdirSync(HALL).filter((f) => f.endsWith('.css'));
324
342
  const misuse = sheets.filter((f) => /var\(--line\s*,/.test(fs.readFileSync(path.join(HALL, f), 'utf8')));
325
343
  assert.deepEqual(misuse, [], 'a colour fallback on --line means the sheet thinks it is a colour');
@@ -346,6 +364,7 @@ test('every token a hall stylesheet references is defined', () => {
346
364
  const sheets = fs.readdirSync(HALL).filter((f) => f.endsWith('.css'));
347
365
  const defined = new Set([
348
366
  ...Object.keys(contractTier), ...Object.keys(darkExplicit), ...Object.keys(PACK),
367
+ ...Object.keys(sharedRoot), // the shared token sheet the hall @imports (task 1005081)
349
368
  ]);
350
369
  // A sheet may define its own private tokens (atlas.css's --ab-* family), and
351
370
  // a page script may set one inline on the element (roadmap.js writes
@@ -125,6 +125,36 @@ test('the page argument survives Git Bash path conversion of a bare slash', () =
125
125
  assert.equal(lib.pageName('/'), 'index'); assert.equal(lib.pageName('/builders/ranks'), 'ranks'); assert.equal(lib.pageName('/projects?view=mine'), 'projects');
126
126
  });
127
127
 
128
+ test('a page at the surface root reads index.states.json (task 1005080)', () => {
129
+ const hall = path.join(ROOT, 'modules', 'hall-ui', 'public');
130
+ assert.equal(lib.sidecarPath(hall, '/builders/', 'states'), path.join(hall, 'index.states.json'), 'the hall Home has no last segment of its own');
131
+ assert.equal(lib.sidecarPath(hall, '/builders/work', 'states'), path.join(hall, 'work.states.json'), 'a named page keeps its own file');
132
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-root-'));
133
+ assert.equal(lib.sidecarPath(tmp, '/builders/', 'states'), path.join(tmp, 'builders.states.json'), 'no index file: the old name stands, so the miss is reported by name');
134
+ });
135
+
136
+ test('storage: a states or probes file may seed browser storage, and a bad shape is refused (task 1005080)', () => {
137
+ const ok = { page: '/x', storage: { session: { a: '1' }, local: { b: 'x' } }, states: { s: { storage: { session: { c: '2' } } } } };
138
+ assert.deepEqual(lib.validateStatesFile(ok).errors, []);
139
+ assert.ok(lib.validateStatesFile({ page: '/x', storage: { cookie: {} }, states: { s: {} } }).errors.some((e) => /storage\.cookie/.test(e)), 'only session and local');
140
+ assert.ok(lib.validateStatesFile({ page: '/x', storage: { session: { a: 1 } }, states: { s: {} } }).errors.some((e) => /storage\.session/.test(e)), 'values are strings');
141
+ assert.ok(lib.validateStatesFile({ page: '/x', states: { s: { storage: [] } } }).errors.some((e) => /states\.s\.storage/.test(e)), 'a state may carry its own');
142
+ assert.ok(lib.validateProbesFile({ page: '/x', storage: 'yes', probes: [{ name: 'p', expect: { visible: ['a'] } }] }).errors.some((e) => /^storage/.test(e)), 'a probes file too');
143
+ assert.deepEqual(lib.mergeStorage({ session: { a: '1', b: '1' } }, undefined, { session: { b: '2' }, local: { c: '3' } }), { session: { a: '1', b: '2' }, local: { c: '3' } }, 'a state layers over the file');
144
+ });
145
+
146
+ test('every hall sidecar renders the page a returning builder sees, not the first-visit mode picker (task 1005080)', () => {
147
+ const hall = path.join(ROOT, 'modules', 'hall-ui', 'public');
148
+ const files = fs.readdirSync(hall).filter((n) => /\.(states|probes)\.json$/.test(n));
149
+ assert.ok(files.length > 30);
150
+ for (const n of files) {
151
+ const json = JSON.parse(fs.readFileSync(path.join(hall, n), 'utf8'));
152
+ assert.equal(json.storage && json.storage.session && json.storage.session['hall-craft-asked'], '1', `${n}: seeds the picker as already asked`);
153
+ }
154
+ // the key is craft-mode.js's own; a rename there must break this pin, not silently bring the picker back
155
+ assert.match(fs.readFileSync(path.join(hall, 'craft-mode.js'), 'utf8'), /var ASKED_KEY = 'hall-craft-asked';/);
156
+ });
157
+
128
158
  // ── the mock checker: platform rules vs the instance's taste ──────────────────
129
159
  const GOOD_MOCK = `<!doctype html><html><head><style>
130
160
  body{--pad:8px;color:var(--ink);background:var(--bg)}
@@ -89,6 +89,8 @@ test('first visit of the day: the welcome, not the craft picker; Skip brings the
89
89
  await signIn(page);
90
90
  assert.deepEqual(await state(page), { welcome: true, picker: false, craft: null, asked: '1' },
91
91
  'the welcome shows, the picker is marked asked and does not stack on it');
92
+ assert.equal(await page.evaluate(() => document.querySelector('.wb__banner').tagName), 'DIV',
93
+ 'over a signed-in hall the shell keeps the one <header>; the banner is a plain block (task 1005080)');
92
94
  // The painting loads and its motion is laid over it.
93
95
  await page.waitForFunction(() => { const i = document.querySelector('#welcome-boot .wb__img'); return i && i.complete && i.naturalWidth === 1024; });
94
96
  assert.equal(await page.isVisible('[data-wb-skip]'), true);
@@ -135,9 +137,11 @@ test('a visitor who is not signed in gets the Welcome on Home with a sign-in but
135
137
  roles: !!document.querySelector('[data-wb-roles]'),
136
138
  keys: Object.keys(localStorage).filter((k) => k.startsWith('hall-welcome-day') || k === 'hall-welcome-signin'),
137
139
  picker: !!document.getElementById('craft-picker'),
140
+ banner: document.querySelector('.wb__banner').tagName,
138
141
  }));
139
142
  assert.match(s.hi, /^Welcome to /);
140
143
  assert.deepEqual([s.signin, s.roles, s.keys, s.picker], [true, false, [], false]);
144
+ assert.equal(s.banner, 'HEADER', 'for a visitor the welcome is the page, so its banner is the one <header> (task 1005080)');
141
145
  await ctx.close();
142
146
  });
143
147