@bongos/core 1.21.182 → 1.22.2

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 (247) hide show
  1. package/.bongos-core.json +273 -248
  2. package/docs/copy-inventory.md +165 -165
  3. package/docs/copy-registry.json +184 -184
  4. package/docs/module-api-changelog.md +12 -0
  5. package/docs/page-inventory.json +35 -26
  6. package/docs/page-readings.json +389 -388
  7. package/modules/agents/lib/answer-hold.js +1 -1
  8. package/modules/agents/lib/fire-budget.js +1 -1
  9. package/modules/autonomy/cadence.js +3 -3
  10. package/modules/autonomy/config-idle.js +1 -1
  11. package/modules/autonomy/fence.js +1 -1
  12. package/modules/autonomy/gauge.js +2 -2
  13. package/modules/autonomy/governor-docket.js +0 -1
  14. package/modules/autonomy/server-schedule.js +1 -1
  15. package/modules/builder-settings/builder-needs.js +1 -3
  16. package/modules/builder-settings/event-sound-prefs.js +0 -1
  17. package/modules/builder-settings/law-locks.js +0 -1
  18. package/modules/builder-settings/model-alloc-prefs.js +0 -5
  19. package/modules/builder-settings/profile-nudge-prefs.js +0 -1
  20. package/modules/builder-settings/render-prefs.js +0 -1
  21. package/modules/builder-settings/skill-prefs.js +0 -2
  22. package/modules/builder-settings/sound-prefs.js +0 -3
  23. package/modules/builder-settings/wandering-prefs.js +0 -2
  24. package/modules/copy-desk/artist-stats.js +1 -1
  25. package/modules/copy-desk/flags.js +1 -1
  26. package/modules/copy-desk/guarded-lines.js +1 -1
  27. package/modules/copy-desk/page-status.js +0 -5
  28. package/modules/copy-desk/proposals.js +0 -2
  29. package/modules/copy-desk/registry.js +1 -1
  30. package/modules/copy-desk/stuck-tweaks.js +1 -1
  31. package/modules/economy/credits-by-craft.js +0 -2
  32. package/modules/economy/streak.js +0 -3
  33. package/modules/government/asks-db.js +1 -1
  34. package/modules/government/asks.js +0 -1
  35. package/modules/government/decision-board.js +0 -1
  36. package/modules/government/docket.js +0 -6
  37. package/modules/government/leads.js +0 -1
  38. package/modules/government/positions.js +1 -1
  39. package/modules/government/recommendations.js +0 -3
  40. package/modules/government/routing.js +1 -1
  41. package/modules/government/treasury-db.js +1 -1
  42. package/modules/government/treasury.js +2 -2
  43. package/modules/grading/grade-engine.js +0 -1
  44. package/modules/hall-ui/public/approval-queue.js +3 -3
  45. package/modules/hall-ui/public/atlas.html +2 -1
  46. package/modules/hall-ui/public/atlas.js +1 -1
  47. package/modules/hall-ui/public/blockers.html +3 -4
  48. package/modules/hall-ui/public/board-room.html +2 -2
  49. package/modules/hall-ui/public/brand-holes.js +3 -3
  50. package/modules/hall-ui/public/city.html +2 -1
  51. package/modules/hall-ui/public/collab.html +2 -2
  52. package/modules/hall-ui/public/commands.html +2 -2
  53. package/modules/hall-ui/public/commands.js +1 -2
  54. package/modules/hall-ui/public/copy-desk.html +2 -2
  55. package/modules/hall-ui/public/core-move-notice.js +1 -5
  56. package/modules/hall-ui/public/craft-mode.js +1 -5
  57. package/modules/hall-ui/public/criterion-uat-ui.js +3 -3
  58. package/modules/hall-ui/public/deploy.html +2 -2
  59. package/modules/hall-ui/public/diagrams.html +2 -1
  60. package/modules/hall-ui/public/dom-utils.js +15 -6
  61. package/modules/hall-ui/public/drachmae.html +2 -1
  62. package/modules/hall-ui/public/fleet-costs.js +3 -2
  63. package/modules/hall-ui/public/fleet.html +2 -2
  64. package/modules/hall-ui/public/founding-mark.js +1 -6
  65. package/modules/hall-ui/public/gate.html +2 -2
  66. package/modules/hall-ui/public/goal-map.html +2 -1
  67. package/modules/hall-ui/public/goals.html +2 -2
  68. package/modules/hall-ui/public/government.html +2 -2
  69. package/modules/hall-ui/public/hall-ask.js +3 -3
  70. package/modules/hall-ui/public/hall-kit.js +3 -5
  71. package/modules/hall-ui/public/hall-visual.js +3 -5
  72. package/modules/hall-ui/public/idea.html +2 -2
  73. package/modules/hall-ui/public/ideas.html +2 -2
  74. package/modules/hall-ui/public/index.html +2 -2
  75. package/modules/hall-ui/public/lightbulb.js +1 -5
  76. package/modules/hall-ui/public/md-reader.js +1 -8
  77. package/modules/hall-ui/public/modules.html +2 -2
  78. package/modules/hall-ui/public/my-agents.html +2 -2
  79. package/modules/hall-ui/public/my-agents.js +3 -1
  80. package/modules/hall-ui/public/page-notes.js +1 -5
  81. package/modules/hall-ui/public/paintbrush.js +1 -5
  82. package/modules/hall-ui/public/palette.js +1 -5
  83. package/modules/hall-ui/public/primer.html +2 -1
  84. package/modules/hall-ui/public/primer.js +1 -1
  85. package/modules/hall-ui/public/profile-crafts.js +3 -5
  86. package/modules/hall-ui/public/profile.html +2 -3
  87. package/modules/hall-ui/public/project-settings.html +2 -2
  88. package/modules/hall-ui/public/ranks.html +2 -3
  89. package/modules/hall-ui/public/roadmap.html +2 -2
  90. package/modules/hall-ui/public/roster.html +3 -4
  91. package/modules/hall-ui/public/sessions.html +2 -3
  92. package/modules/hall-ui/public/settings.html +2 -3
  93. package/modules/hall-ui/public/shell.js +1 -5
  94. package/modules/hall-ui/public/sky-data.js +1 -1
  95. package/modules/hall-ui/public/street.html +2 -1
  96. package/modules/hall-ui/public/studio.html +2 -2
  97. package/modules/hall-ui/public/task-detail.js +1 -6
  98. package/modules/hall-ui/public/task-lib.js +3 -8
  99. package/modules/hall-ui/public/task.html +2 -3
  100. package/modules/hall-ui/public/thinking.html +2 -1
  101. package/modules/hall-ui/public/tweak-editor.html +2 -2
  102. package/modules/hall-ui/public/vote-control.js +1 -1
  103. package/modules/hall-ui/public/watch.html +2 -3
  104. package/modules/hall-ui/public/welcome-boot.js +3 -5
  105. package/modules/hall-ui/public/work.html +2 -3
  106. package/modules/ideas/completeness.js +1 -1
  107. package/modules/ideas/descent.js +0 -1
  108. package/modules/ideas/governor-docket.js +0 -2
  109. package/modules/ideas/idea-state.js +0 -1
  110. package/modules/ideas/ideator-stats.js +1 -1
  111. package/modules/ideas/votes.js +1 -1
  112. package/modules/lifecycle/autopickup-files.js +0 -3
  113. package/modules/lifecycle/conflict-resolve.js +0 -1
  114. package/modules/lifecycle/criterion-uat-db.js +0 -4
  115. package/modules/lifecycle/dead-deps.js +2 -2
  116. package/modules/lifecycle/est-advisory.js +1 -1
  117. package/modules/lifecycle/goal-category.js +0 -3
  118. package/modules/lifecycle/goal-spec-task.js +1 -1
  119. package/modules/lifecycle/governor-docket.js +0 -1
  120. package/modules/lifecycle/kickoff-seed.js +1 -1
  121. package/modules/lifecycle/mingle.js +3 -3
  122. package/modules/lifecycle/page-tweak-claim.js +1 -1
  123. package/modules/lifecycle/rebase-gate.js +1 -1
  124. package/modules/lifecycle/removal-derivation.js +0 -1
  125. package/modules/lifecycle/routes/abandon-handler.js +1 -1
  126. package/modules/lifecycle/routes/version-route-authz.js +0 -1
  127. package/modules/lifecycle/ship-card.js +2 -5
  128. package/modules/lifecycle/ship-preflight.js +0 -1
  129. package/modules/lifecycle/sky.js +1 -1
  130. package/modules/lifecycle/task-classifier.js +0 -1
  131. package/modules/lifecycle/task-visuals.js +0 -2
  132. package/modules/lifecycle/version-close.js +0 -1
  133. package/modules/memory/memory.js +0 -1
  134. package/modules/memory/search-chunker.js +1 -1
  135. package/modules/memory/search.js +0 -3
  136. package/modules/npm-release/preview/divert.js +1 -1
  137. package/modules/npm-release/preview/proxy.js +2 -3
  138. package/modules/npm-release/preview/runtime.js +1 -1
  139. package/modules/npm-release/public/task-widget.js +1 -1
  140. package/modules/onboarding/founding-builders.js +1 -1
  141. package/modules/onboarding/founding-mode.js +1 -1
  142. package/modules/onboarding/howto-guide.js +1 -1
  143. package/modules/onboarding/howto-state.js +1 -1
  144. package/modules/onboarding/onboarding-state.js +0 -4
  145. package/modules/onboarding/onboarding.js +0 -6
  146. package/modules/page-notes/notes.js +0 -1
  147. package/modules/platform-identity/community-leaderboard.js +0 -1
  148. package/modules/platform-identity/hub-keys.js +0 -2
  149. package/modules/platform-identity/instance-feedback.js +0 -1
  150. package/modules/platform-identity/read-rate-limit.js +1 -1
  151. package/modules/platform-identity/routes/sso.js +1 -3
  152. package/modules/platform-identity/visibility-pull.js +0 -9
  153. package/modules/provisioning/app-status.js +1 -1
  154. package/modules/provisioning/catalog-bridge.js +0 -1
  155. package/modules/provisioning/core-upgrade.js +1 -1
  156. package/modules/provisioning/credential-preflight.js +1 -1
  157. package/modules/provisioning/demo.js +2 -2
  158. package/modules/provisioning/look.js +1 -1
  159. package/modules/provisioning/routes/callback-page.js +3 -7
  160. package/modules/public-landing/public/projects.html +3 -5
  161. package/modules/raise/raise.js +2 -2
  162. package/modules/render-deploy/deploys.js +1 -1
  163. package/modules/security/artifact-scan/aggregate.js +0 -4
  164. package/modules/security/artifact-scan/detectors/capabilities.js +1 -1
  165. package/modules/security/artifact-scan/detectors/config-obfuscation.js +1 -1
  166. package/modules/security/artifact-scan/detectors/credentials.js +1 -1
  167. package/modules/security/artifact-scan/detectors/dependencies.js +1 -1
  168. package/modules/security/artifact-scan/detectors/injection.js +1 -1
  169. package/modules/security/artifact-scan/detectors/network.js +1 -1
  170. package/modules/security/artifact-scan/detectors/npm-lifecycle.js +1 -1
  171. package/modules/security/artifact-scan/detectors/permissions.js +1 -1
  172. package/modules/security/artifact-scan/detectors/shared.js +0 -3
  173. package/modules/security/artifact-scan/floor.js +0 -3
  174. package/modules/security/artifact-scan/mirror.js +1 -1
  175. package/modules/security/artifact-scan/quarantine.js +0 -1
  176. package/modules/security/artifact-scan/rebuild-spec.js +0 -2
  177. package/modules/security/artifact-scan/report.js +1 -1
  178. package/modules/security/artifact-scan/sanitize.js +0 -2
  179. package/modules/security/secret-scrub.js +0 -4
  180. package/modules/security/security.js +0 -2
  181. package/modules/sessions/accessibility.js +0 -2
  182. package/modules/sessions/bfg.js +0 -4
  183. package/modules/sessions/upload-health.js +0 -3
  184. package/modules/specialities/db.js +1 -1
  185. package/modules/specialities/specialities.js +1 -1
  186. package/modules/ui-design/kit/lib.js +2 -2
  187. package/package-lock.json +2 -2
  188. package/package.json +1 -1
  189. package/release-notes.json +26 -12
  190. package/scripts/bongos/escape-helper-guard.js +147 -0
  191. package/scripts/bongos/fitness.js +3 -2
  192. package/scripts/bongos/key-card.js +1 -4
  193. package/scripts/bongos/review-sheet.js +1 -3
  194. package/scripts/bongos/start.js +1 -1
  195. package/scripts/bongos/status.js +1 -1
  196. package/scripts/gds/escape-helper-guard.js +6 -0
  197. package/scripts/status-mirror-sync.js +2 -3
  198. package/src/bongos/module-scope-map.js +1 -0
  199. package/src/bongos/platform-visibility-gate.js +2 -3
  200. package/src/bongos/prelaunch-gate.js +2 -3
  201. package/src/bongos/routes/auth.js +1 -5
  202. package/src/bongos/serve-internal.js +2 -6
  203. package/src/html-escape.js +26 -0
  204. package/src/module-api.js +9 -1
  205. package/tests/blockers_kit_pager.mjs +2 -2
  206. package/tests/blockers_page_ui.mjs +2 -2
  207. package/tests/core_move_notice.mjs +3 -1
  208. package/tests/core_update_banner.mjs +2 -0
  209. package/tests/core_upgrade_owner_door.mjs +2 -0
  210. package/tests/craft_mode.mjs +2 -0
  211. package/tests/craft_mode_nav.mjs +3 -0
  212. package/tests/craft_review_mode.mjs +3 -2
  213. package/tests/criterion_ref_status.mjs +7 -2
  214. package/tests/curve_kind_overlay.mjs +2 -1
  215. package/tests/founding_mode.mjs +10 -2
  216. package/tests/github_install_nudge.mjs +4 -1
  217. package/tests/goal_map_page.mjs +2 -2
  218. package/tests/hall_approval_queue.mjs +2 -2
  219. package/tests/hall_city.mjs +1 -1
  220. package/tests/hall_fullscreen.mjs +2 -0
  221. package/tests/hall_gov_real_site.mjs +2 -0
  222. package/tests/hall_kit_charts.mjs +2 -1
  223. package/tests/hall_my_agents.mjs +3 -2
  224. package/tests/hall_nav.mjs +2 -0
  225. package/tests/hall_palette.mjs +2 -2
  226. package/tests/hall_reading_world.mjs +3 -1
  227. package/tests/hall_reference_world.mjs +2 -1
  228. package/tests/hall_signout.mjs +2 -0
  229. package/tests/hall_street.mjs +1 -1
  230. package/tests/hall_studio_world.mjs +3 -1
  231. package/tests/hall_tweak_editor.mjs +2 -1
  232. package/tests/helpers.mjs +17 -2
  233. package/tests/html_escape.mjs +149 -0
  234. package/tests/lightbulb.mjs +2 -0
  235. package/tests/module_api.mjs +1 -0
  236. package/tests/module_store_howto.mjs +2 -1
  237. package/tests/modules_external_export_contract.mjs +48 -0
  238. package/tests/nav_permission_atoms.mjs +1 -1
  239. package/tests/npm_release_where.mjs +2 -1
  240. package/tests/page_notes_panel.mjs +4 -3
  241. package/tests/paintbrush.mjs +2 -1
  242. package/tests/profile_connections_ui.mjs +2 -1
  243. package/tests/profile_role_headline.mjs +2 -2
  244. package/tests/profile_role_tabs.mjs +2 -2
  245. package/tests/projects_hub_repo_private.mjs +4 -0
  246. package/tests/terms_acceptance.mjs +1 -0
  247. package/tests/welcome_boot_browser.mjs +1 -1
@@ -75,12 +75,7 @@
75
75
  // dom-utils.js already publishes escapeHtml on window.OTB (this file uses
76
76
  // OTB.toast the same way) — a local copy would be its 9th byte-identical twin.
77
77
  // The fallback keeps the file's self-contained contract if OTB hasn't loaded.
78
- function esc(s) {
79
- if (window.OTB && window.OTB.escapeHtml) return window.OTB.escapeHtml(s);
80
- return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
81
- return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c];
82
- });
83
- }
78
+ function esc(s) { return window.OTB.escapeHtml(s); }
84
79
 
85
80
  async function fetchRef(kind, id) {
86
81
  if (kind === 'blocker') {
@@ -23,14 +23,9 @@
23
23
  (() => {
24
24
  'use strict';
25
25
 
26
- // Local HTML-escape — deliberately NOT window.OTB.escapeHtml, so this file
27
- // keeps hall-kit's dependency-free property (same reasoning, same duplication
28
- // of ~4 lines being cheaper than a load-order constraint).
29
- function esc(s) {
30
- return String(s ?? '').replace(/[&<>"']/g, (c) => ({
31
- '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;',
32
- }[c]));
33
- }
26
+ // The shared escaper: window.OTB in the page; under Node (this file is also require()d as a
27
+ // CommonJS lib — see its module.exports and its tests) dom-utils.js's own export (task 1004876).
28
+ function esc(s) { return (typeof window !== 'undefined' ? window.OTB : require('./dom-utils.js')).escapeHtml(s); }
34
29
 
35
30
  // Sort key for a "P3"-style priority string. Unparseable/absent sorts last.
36
31
  function priorityRank(p) {
@@ -55,13 +55,12 @@
55
55
 
56
56
  <!-- The app shell (sidebar + top bar + footer). Dependency-free; runs at parse
57
57
  time so the chrome exists before the deferred page scripts execute. -->
58
+ <script src="/builders/dom-utils.js?v=2026-10-25-escape"></script>
58
59
  <script src="/builders/shell-trail.js?v=2026-10-08-city-tab"></script>
59
60
  <script src="/builders/craft-mode.js?v=2026-10-09-living3"></script>
60
- <script src="/builders/shell.js?v=2026-10-25-autobongos"></script>
61
+ <script src="/builders/shell.js?v=2026-10-25-escape"></script>
61
62
  <!-- jump palette (Ctrl/Cmd-K). Optional by design: without it the shell's slot stays hidden. -->
62
63
  <script src="/builders/palette.js" defer></script>
63
- <!-- shared frontend toolkit (window.OTB) — loaded FIRST so task.js can pull from it. -->
64
- <script src="/builders/dom-utils.js?v=2026-06-14-domutils" defer></script>
65
64
  <!-- task-detail.js still owns the #/idea/N and #/blocker/N deep-link overlay
66
65
  (and the #/task/N → /task/N redirect, task 751); load it here too so those
67
66
  links still resolve from this page. -->
@@ -138,9 +138,10 @@
138
138
  </div>
139
139
  </div>
140
140
 
141
+ <script src="/builders/dom-utils.js?v=2026-10-25-escape"></script>
141
142
  <script src="/builders/shell-trail.js?v=2026-10-08-city-tab"></script>
142
143
  <script src="/builders/craft-mode.js?v=2026-10-09-living3"></script>
143
- <script src="/builders/shell.js?v=2026-10-25-autobongos"></script>
144
+ <script src="/builders/shell.js?v=2026-10-25-escape"></script>
144
145
  <script src="/builders/palette.js" defer></script>
145
146
 
146
147
  <script src="/builders/idea-objects.js?v=2026-09-27-split"></script>
@@ -142,11 +142,11 @@
142
142
 
143
143
  <div id="toast" class="toast" role="status" aria-live="polite" data-visible="0"></div>
144
144
 
145
+ <script src="/builders/dom-utils.js?v=2026-10-25-escape"></script>
145
146
  <script src="/builders/shell-trail.js?v=2026-10-08-city-tab"></script>
146
147
  <script src="/builders/craft-mode.js?v=2026-10-09-living3"></script>
147
- <script src="/builders/shell.js?v=2026-10-25-autobongos"></script>
148
+ <script src="/builders/shell.js?v=2026-10-25-escape"></script>
148
149
  <script src="/builders/palette.js" defer></script>
149
- <script src="/builders/dom-utils.js?v=2026-06-23-contrib"></script>
150
150
  <script src="/builders/brand-holes.js?v=2026-09-29-aqfix"></script>
151
151
  <script src="/builders/tweak-editor-lib.js?v=2026-09-29-tw27"></script>
152
152
  <script src="/builders/tweak-editor.js?v=2026-09-29-tw27-aqfix"></script>
@@ -30,7 +30,7 @@
30
30
  insufficient_rank: 'Voting opens at Metic rank.',
31
31
  };
32
32
 
33
- const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
33
+ const esc = (s) => window.OTB.escapeHtml(s);
34
34
  const netText = (n) => { const v = Number(n) || 0; return v > 0 ? `+${v}` : `${v}`; };
35
35
  const validId = (id) => { const n = Number(id); return Number.isInteger(n) && n > 0 ? n : null; };
36
36
 
@@ -163,13 +163,12 @@
163
163
 
164
164
  <!-- The app shell (sidebar + top bar). Dependency-free; loaded FIRST so the
165
165
  chrome exists before the page script runs. -->
166
+ <script src="/builders/dom-utils.js?v=2026-10-25-escape"></script>
166
167
  <script src="/builders/shell-trail.js?v=2026-10-08-city-tab"></script>
167
168
  <script src="/builders/craft-mode.js?v=2026-10-09-living3"></script>
168
- <script src="/builders/shell.js?v=2026-10-25-autobongos"></script>
169
+ <script src="/builders/shell.js?v=2026-10-25-escape"></script>
169
170
  <!-- jump palette (Ctrl/Cmd-K). Optional by design: without it the shell's slot stays hidden. -->
170
171
  <script src="/builders/palette.js" defer></script>
171
- <!-- shared frontend toolkit (window.OTB) — loaded before watch.js, which pulls from it. -->
172
- <script src="/builders/dom-utils.js?v=2026-06-14-domutils"></script>
173
172
  <!-- shared component kit (window.OTBKit) — tabs, ledger, pager (task 2166). -->
174
173
  <script src="/builders/hall-kit.js"></script>
175
174
  <script src="/builders/task-detail.js?v=2026-07-03-taskdetail"></script>
@@ -139,11 +139,9 @@
139
139
  }
140
140
 
141
141
  // ---------- the overlay ----------
142
- function esc(s) {
143
- return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
144
- return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c];
145
- });
146
- }
142
+ // The shared escaper: window.OTB in the page; under Node (this file is also require()d as a
143
+ // CommonJS lib — see its module.exports and its tests) dom-utils.js's own export (task 1004876).
144
+ function esc(s) { return (typeof window !== 'undefined' ? window.OTB : require('./dom-utils.js')).escapeHtml(s); }
147
145
  function craft() { return window.OTBCraftMode || null; }
148
146
  function reducedMotion() {
149
147
  return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
@@ -171,13 +171,12 @@
171
171
 
172
172
  <!-- The app shell (sidebar + top bar + footer). Dependency-free; runs at parse
173
173
  time so the chrome exists before the deferred page scripts execute. -->
174
+ <script src="/builders/dom-utils.js?v=2026-10-25-escape"></script>
174
175
  <script src="/builders/shell-trail.js?v=2026-10-08-city-tab"></script>
175
176
  <script src="/builders/craft-mode.js?v=2026-10-09-living3"></script>
176
- <script src="/builders/shell.js?v=2026-10-25-autobongos"></script>
177
+ <script src="/builders/shell.js?v=2026-10-25-escape"></script>
177
178
  <!-- jump palette (Ctrl/Cmd-K). Optional by design: without it the shell's slot stays hidden. -->
178
179
  <script src="/builders/palette.js" defer></script>
179
- <!-- shared frontend toolkit (window.OTB) — loaded FIRST so work.js can pull from it. -->
180
- <script src="/builders/dom-utils.js?v=2026-06-14-domutils" defer></script>
181
180
  <!-- task 1004727: the ONE karma vote control every task/idea list renders -->
182
181
  <script src="/builders/vote-control.js"></script>
183
182
  <!-- shared component kit (window.OTBKit) — tabs, pager, filter bar (task 2166). -->
@@ -112,4 +112,4 @@ function weakestSectionPayload(fieldValues, { templateKey = DEFAULT_TEMPLATE_KEY
112
112
  };
113
113
  }
114
114
 
115
- module.exports = { completenessScore, scoreFieldValues, substanceOf, weakestField, weakestSectionPayload };
115
+ module.exports = { completenessScore, scoreFieldValues, weakestField, weakestSectionPayload };
@@ -275,7 +275,6 @@ async function syncDescentForTask(taskId, { client = null } = {}) {
275
275
 
276
276
  module.exports = {
277
277
  DESCENT_MAX_DEPTH,
278
- DESCENT_RELATIONS,
279
278
  linkTaskDescent,
280
279
  ancestorsOfTask,
281
280
  descendantsOfTask,
@@ -221,10 +221,8 @@ function contributeIdeasToDocket() {
221
221
  module.exports = {
222
222
  contributeIdeasToDocket,
223
223
  blockerDocketMatter,
224
- blockerOptions,
225
224
  ratifyDeskRows,
226
225
  rulesReading,
227
226
  rulesFloor,
228
227
  rulesHistory,
229
- countRoutedThisMonth,
230
228
  };
@@ -247,7 +247,6 @@ module.exports = {
247
247
  IDEA_STATES,
248
248
  IDEA_STATE_VALUES,
249
249
  IDEA_POSITIONS,
250
- AWAITING_NOD_STATUS,
251
250
  taskFactsFromIdeaRow,
252
251
  resolveIdeaState,
253
252
  attachStateToTrail,
@@ -146,4 +146,4 @@ async function readIdeatorStats(builderId, deps = {}) {
146
146
  return summarizeIdeatorTrail(ideas, { ideatorCredits, ratifiedIds, truncated: sky && sky.truncated, total: sky && sky.total });
147
147
  }
148
148
 
149
- module.exports = { readIdeatorStats, summarizeIdeatorTrail, PUBLIC_VIEWER_RANK };
149
+ module.exports = { readIdeatorStats, summarizeIdeatorTrail };
@@ -90,4 +90,4 @@ async function readIdeaVotes(pool, { voterId, ids }) {
90
90
  return out;
91
91
  }
92
92
 
93
- module.exports = { castIdeaVote, readIdeaVotes, ideaVoteTally };
93
+ module.exports = { castIdeaVote, readIdeaVotes };
@@ -130,10 +130,7 @@ function refusalMessage(r) {
130
130
  }
131
131
 
132
132
  module.exports = {
133
- SHIP_WRITES,
134
- pageIdFromRef,
135
133
  pageFiles,
136
- decideFiles,
137
134
  readRound,
138
135
  autoPickupFileRefusal,
139
136
  refusalMessage,
@@ -551,5 +551,4 @@ module.exports = {
551
551
  unmergedPaths,
552
552
  hasConflictMarkers,
553
553
  GENERATOR_SCRIPTS,
554
- MARKER_GREP_RE,
555
554
  };
@@ -271,10 +271,6 @@ async function setBackendOnly({ criterionId, builderId, backendOnly, authorize }
271
271
 
272
272
  module.exports = {
273
273
  DEPLOY_PORT,
274
- linkedTasks,
275
- summarizeLinked,
276
- currentSignoff,
277
- isBackendOnly,
278
274
  readLive,
279
275
  signOff,
280
276
  recordOverride,
@@ -340,6 +340,6 @@ function findProseGatedTasks(tasks, statusById) {
340
340
  module.exports = {
341
341
  DEAD_DEP_STATUSES, LIVE_STATUSES,
342
342
  absorbedInto, depRefusalRow, splitDeadDeps, deadDepHint, findStrandedTasks,
343
- proseGatedIds, findProseGatedTasks, idCandidates, GATE_PHRASE_RE, GATE_WINDOW, OTHER_ENTITY_RE,
344
- LIVENESS_BEFORE_RE, LIVENESS_AFTER_RE, IMPORT_ID_OFFSETS,
343
+ proseGatedIds, findProseGatedTasks, idCandidates,
344
+ IMPORT_ID_OFFSETS,
345
345
  };
@@ -186,4 +186,4 @@ async function buildEstAdvisory({ db, task } = {}) {
186
186
  }
187
187
  }
188
188
 
189
- module.exports = { adviseEstimate, pickRatio, buildEstAdvisory, calibrationSummary, resetCalibrationCache, CALIBRATION_TTL_MS, MIN_MATERIAL_DELTA, SCALE_OK_RATIO, MIN_KIND_SAMPLES, MIN_OVERALL_SAMPLES };
189
+ module.exports = { adviseEstimate, pickRatio, buildEstAdvisory, calibrationSummary, resetCalibrationCache, CALIBRATION_TTL_MS, MIN_MATERIAL_DELTA, SCALE_OK_RATIO };
@@ -379,16 +379,13 @@ function goalCategoryHandler({ db, authorizeGoalManagement, validateOrRespond, p
379
379
  }
380
380
 
381
381
  module.exports = {
382
- CATEGORY_COLS,
383
382
  slugify,
384
383
  isValidSlug,
385
384
  listCategories,
386
385
  countGoalsByCategory,
387
386
  getCategory,
388
387
  adviseCategory,
389
- createCategory,
390
388
  updateCategory,
391
- setGoalCategory,
392
389
  decorateGoalCategory,
393
390
  categoryIndex,
394
391
  categoriesListHandler,
@@ -126,4 +126,4 @@ async function createGoalWithSpec({ db, withTx, goalFields, withSpecTask = false
126
126
  return { goal, specTask };
127
127
  }
128
128
 
129
- module.exports = { SPEC_SOURCE, specSourceRef, specTaskFields, openSpecTaskId, gateOnSpecTask, ensureSpecTask, createGoalWithSpec };
129
+ module.exports = { SPEC_SOURCE, specSourceRef, specTaskFields, gateOnSpecTask, ensureSpecTask, createGoalWithSpec };
@@ -463,7 +463,6 @@ module.exports = {
463
463
  overrideMatter,
464
464
  removalMatter,
465
465
  uatMatter,
466
- uatActs,
467
466
  joinRequestMatter,
468
467
  flowReading,
469
468
  promisesReading,
@@ -130,4 +130,4 @@ async function genesisStageTasks(deps = {}) {
130
130
  return out;
131
131
  }
132
132
 
133
- module.exports = { seedKickoffIfEmpty, specFromBranding, FIRST_VERSION_SQL, seedGenesisStages, genesisStageTasks, GENESIS_SOURCE };
133
+ module.exports = { seedKickoffIfEmpty, specFromBranding, FIRST_VERSION_SQL, seedGenesisStages, genesisStageTasks };
@@ -345,9 +345,9 @@ async function decidePair(pairId, builderId, decision, deps = {}) {
345
345
  }
346
346
 
347
347
  module.exports = {
348
- MINGLE_ENABLED_KEY, MAX_ROWS, MATCHING, matchingModel,
348
+ MAX_ROWS, MATCHING, matchingModel,
349
349
  parseEnabled, projectEnabled, setProjectEnabled,
350
- optInState, setOptIn, mingleStateFor,
351
- eligibleBuilders, isCrossCraft, planPairs, pairKey, openPairKeys,
350
+ setOptIn, mingleStateFor,
351
+ eligibleBuilders, isCrossCraft, planPairs, openPairKeys,
352
352
  runMingleRound, openPairsFor, countOpenPairsFor, decidePair,
353
353
  };
@@ -181,4 +181,4 @@ async function webClaimPageTweak({ pageId, builderId, versionId = null, round },
181
181
  }
182
182
  }
183
183
 
184
- module.exports = { webClaimPageTweak, lockKey, roundNumber };
184
+ module.exports = { webClaimPageTweak, lockKey };
@@ -75,4 +75,4 @@ function rebaseRefusalTasks(split) {
75
75
  ];
76
76
  }
77
77
 
78
- module.exports = { REBASE_GATE_LIMIT, WAITING_REASONS, waitsOn, splitRebaseGate, rebaseRefusalTasks };
78
+ module.exports = { REBASE_GATE_LIMIT, waitsOn, splitRebaseGate, rebaseRefusalTasks };
@@ -326,7 +326,6 @@ module.exports = {
326
326
  removalCandidatesForTask,
327
327
  listCommitsForPath,
328
328
  deletedPathsFrom,
329
- groupByTask,
330
329
  attributeDeletions,
331
330
  deriveRemovalsForShip,
332
331
  };
@@ -148,4 +148,4 @@ function makeAbandonHandler(deps) {
148
148
  };
149
149
  }
150
150
 
151
- module.exports = { makeAbandonHandler, requiredAtoms, floorsFor };
151
+ module.exports = { makeAbandonHandler };
@@ -222,5 +222,4 @@ module.exports = {
222
222
  authorizeVersionBuild,
223
223
  planVersionClose,
224
224
  rollForwardNeedsPlanningVersion,
225
- VERSION_CLOSE_VERBS,
226
225
  };
@@ -587,10 +587,7 @@ function renderMonospaceCard(model) {
587
587
  }
588
588
 
589
589
  // ---- HTML renderer (the in-feed branded card) ------------------------------
590
- function esc(s) {
591
- return String(s == null ? '' : s).replace(/[&<>"']/g, (c) =>
592
- ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
593
- }
590
+ function esc(s) { return require('../../src/module-api').escapeHtml(s); } // the one server escaper (task 1004876)
594
591
  function factHtml(f) {
595
592
  let inner = esc(f.value);
596
593
  if (f.mono) inner = `<span class="cc-mono">${inner}</span>`;
@@ -867,7 +864,7 @@ module.exports = {
867
864
  // untrusted-title rule is pinned by a test rather than trusted by eye.
868
865
  sanitizeOneLine, MAX_CONFIRM_LINE,
869
866
  // exported for unit tests:
870
- fmtTokens, fmtUsd, fmtInt, fmtMins, nextActionFor, esc, wrap, changedText,
867
+ fmtTokens, fmtUsd, fmtInt, fmtMins, esc, wrap,
871
868
  // task 1003150 — the session-boundary nudge, pure so every branch is pinned.
872
869
  handoffAdvice, HEAVY_SESSION_CACHED_TOKENS,
873
870
  PIPELINE, FORMS, trailSteps,
@@ -323,7 +323,6 @@ module.exports = {
323
323
  untrackedLeftBehind,
324
324
  untrackedWarningLines,
325
325
  cleanupMacFinderDupRefs,
326
- gitDirFor,
327
326
  findMainWorktree,
328
327
  findPrimaryWorktree,
329
328
  closeoutPlan,
@@ -301,4 +301,4 @@ function skyHandler({ read = sky, log = console, cache = skyCache() } = {}) {
301
301
  };
302
302
  }
303
303
 
304
- module.exports = { sky, skyRows, shapeSky, foldCriteria, normalizeBorn, skyCache, skyHandler, SKY_CACHE_TTL_MS };
304
+ module.exports = { sky, skyRows, shapeSky, foldCriteria, normalizeBorn, skyCache, skyHandler };
@@ -551,7 +551,6 @@ module.exports = {
551
551
  VALID_KINDS,
552
552
  VALID_DISCIPLINES,
553
553
  WRITABLE_DISCIPLINES,
554
- DISCIPLINE_CONFIDENCE_FLOOR,
555
554
  resolveWriteDiscipline,
556
555
  VOTABLE_TASK_STATUSES,
557
556
  TASK_FIELD_BOUNDS,
@@ -390,8 +390,6 @@ module.exports = {
390
390
  screenImage,
391
391
  readImageFile,
392
392
  normalizeAlt,
393
- urlForName,
394
- SERVE_PREFIX,
395
393
  isPubliclyViewable,
396
394
  persistImageBuffer,
397
395
  deleteStored,
@@ -101,7 +101,6 @@ async function getCloseSuggestionsForBuildingVersions() {
101
101
  }
102
102
 
103
103
  module.exports = {
104
- PERCENT_GATE,
105
104
  suggestClose,
106
105
  getCloseSuggestionsForBuildingVersions,
107
106
  };
@@ -568,5 +568,4 @@ module.exports = {
568
568
  assertBfgPath,
569
569
  isReservedNamespacePath,
570
570
  BFG_NAMESPACE_PREFIX,
571
- BFG_KINDS,
572
571
  };
@@ -275,4 +275,4 @@ function chunkMarkdown({ path, content, maxTokens = DEFAULT_MAX_TOKENS, targetTo
275
275
  return { path: path || null, title, frontmatter: frontmatter || null, chunks };
276
276
  }
277
277
 
278
- module.exports = { chunkMarkdown, parseFrontMatter, estTokens, fileLabel, stripPrivate, sanitizeForText, PG_INVALID_TEXT_RE, DEFAULT_TARGET_TOKENS, DEFAULT_MAX_TOKENS };
278
+ module.exports = { chunkMarkdown, parseFrontMatter, estTokens, stripPrivate, sanitizeForText };
@@ -581,8 +581,5 @@ module.exports = {
581
581
  RANK_LADDER,
582
582
  DEFAULT_LIMIT,
583
583
  MAX_LIMIT,
584
- RRF_K,
585
584
  TRGM_THRESHOLD,
586
- USEFULNESS_WEIGHT,
587
- USEFULNESS_SCALE,
588
585
  };
@@ -102,4 +102,4 @@ function createDivert({ supervisor, forward, requireBuilder, requirePermission }
102
102
  };
103
103
  }
104
104
 
105
- module.exports = { createDivert, cookieVersion, clearCookie, setCookie, AUTH_PATH, PREVIEW_PATH };
105
+ module.exports = { createDivert, cookieVersion, clearCookie, setCookie, AUTH_PATH };
@@ -29,9 +29,8 @@ function withoutPreviewCookie(cookieHeader) {
29
29
  .join('; ');
30
30
  }
31
31
 
32
- function escapeHtml(s) {
33
- return String(s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
34
- }
32
+ // The one server escaper, through the doorway (task 1004876); this copy used to skip '.
33
+ const { escapeHtml } = require('../../../src/module-api');
35
34
 
36
35
  /** The banner markup: which version this is, which one the hall runs, and the way out. */
37
36
  function bannerHtml({ viewing, running, exitHref }) {
@@ -114,4 +114,4 @@ function createRuntime({ liveDb, log, env = process.env, instanceRoot = null } =
114
114
  return supervisor;
115
115
  }
116
116
 
117
- module.exports = { createRuntime, runCommand, probeHealth };
117
+ module.exports = { createRuntime, probeHealth };
@@ -16,7 +16,7 @@
16
16
  'use strict';
17
17
 
18
18
  const API = '/api/bongos';
19
- const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
19
+ const esc = (s) => window.OTB.escapeHtml(s); // the hall's shared escaper (dom-utils.js, task 1004876)
20
20
  const client = window.BongosClient && window.BongosClient.createClient({ baseUrl: '', credentials: 'same-origin', throwOnError: false });
21
21
  const DONE = ['completed', 'confirmed', 'shipped'];
22
22
 
@@ -124,4 +124,4 @@ async function foundingBuildersFor(deps = {}) {
124
124
  }
125
125
  }
126
126
 
127
- module.exports = { stageAt, shapeFoundingBuilders, foundingBuildersFor, MAX_MARKS };
127
+ module.exports = { stageAt, shapeFoundingBuilders, foundingBuildersFor };
@@ -204,6 +204,6 @@ async function setFoundingMode({ active, stage } = {}, builderId = null, deps =
204
204
 
205
205
  module.exports = {
206
206
  STAGES, WAKES, WAKES_WHEN_ALIVE, KEYS, stageAtKey,
207
- parseActive, asleepRooms, dayOf, shapeFoundingMode, waitingOnFromGovernment,
207
+ dayOf, shapeFoundingMode, waitingOnFromGovernment,
208
208
  foundingModeFor, setFoundingMode,
209
209
  };
@@ -262,4 +262,4 @@ if (require.main === module) {
262
262
  }
263
263
  }
264
264
 
265
- module.exports = { MOMENTS, STEPS, MOMENT_IDS, stepById, stepsForMoment, nextUnread, formatStep, formatGuide };
265
+ module.exports = { MOMENTS, STEPS, MOMENT_IDS, stepById, stepsForMoment, nextUnread, formatGuide };
@@ -105,4 +105,4 @@ async function reset(builderId, { steps, all = false } = {}, deps = {}) {
105
105
  return { ok: true, state: await readState(builderId, deps) };
106
106
  }
107
107
 
108
- module.exports = { HOWS, checkSteps, shapeState, readState, markRead, reset };
108
+ module.exports = { shapeState, readState, markRead, reset };
@@ -495,12 +495,8 @@ module.exports = {
495
495
  GRADUATED,
496
496
  ALL_STAGES,
497
497
  PRE_AUTH_STEP,
498
- SHIP_GRADUATION_TARGET,
499
- STAGE_LABELS,
500
498
  STAGE_HINTS,
501
- DISPLAY_STEPS,
502
499
  DISPLAY_LABELS,
503
- DISPLAY_HINTS,
504
500
  isKnownStage,
505
501
  nextStage,
506
502
  hasCleared,
@@ -489,20 +489,14 @@ function buildIdeaPayload({ sessionMeta = {}, analysis, signals = {} }) {
489
489
 
490
490
  module.exports = {
491
491
  ONBOARDING_FRICTION_TAG,
492
- ONBOARDING_FRICTION_KIND,
493
492
  // parsing
494
493
  parseTranscript,
495
- stripMachineNoise,
496
494
  // signals
497
495
  detectFrictionSignals,
498
- LONG_RESPONSE_CHARS,
499
- SIMILARITY_THRESHOLD,
500
496
  // subagent
501
497
  buildAnalysisPrompt,
502
- compactTranscript,
503
498
  extractJson,
504
499
  validateAnalysis,
505
- VALID_MOMENT_KINDS,
506
500
  // payload
507
501
  buildIdeaPayload,
508
502
  };
@@ -236,7 +236,6 @@ module.exports = {
236
236
  wholeDocIdea,
237
237
  noteLink,
238
238
  SITE_SURFACE,
239
- STUDIO_PATH,
240
239
  isSiteNote,
241
240
  siteListItem,
242
241
  ideaBody,
@@ -231,5 +231,4 @@ module.exports = {
231
231
  MAX_LIMIT,
232
232
  MAX_OFFSET,
233
233
  MAX_DISCIPLINE_CHARS,
234
- TOTALS_TTL_MS,
235
234
  };
@@ -157,8 +157,6 @@ function mintHubApplicationVouch({ clientId, githubId, githubLogin, handle }, op
157
157
  }
158
158
 
159
159
  module.exports = {
160
- ASSERTION_TTL_MS,
161
- ISSUER,
162
160
  LOGOUT_PURPOSE,
163
161
  generateHubKeypair,
164
162
  loadHubSigningKey,
@@ -229,7 +229,6 @@ module.exports = {
229
229
  sha256Hex,
230
230
  projectOrigin,
231
231
  isHostedBy,
232
- verifyDirectReport,
233
232
  fileDirectReport,
234
233
  FEEDBACK_KINDS,
235
234
  MESSAGE_MAX,
@@ -65,4 +65,4 @@ function createReadRateLimit({ scope, limit, windowMs = 60 * 1000, maxTrackedIps
65
65
  return limiter;
66
66
  }
67
67
 
68
- module.exports = { createReadRateLimit, MAX_TRACKED_IPS };
68
+ module.exports = { createReadRateLimit };
@@ -118,9 +118,7 @@ function reportAsOf(req) {
118
118
  // The /sso/authorize failures are pre-redirect (bad client / bad redirect_uri), so
119
119
  // we must render our OWN page rather than bounce to an unvalidated URI.
120
120
  function errorPage(detail) {
121
- const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => (
122
- { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]
123
- ));
121
+ const esc = api.escapeHtml; // the one server escaper (task 1004876)
124
122
  return `<!doctype html><html lang="en"><head><meta charset="utf-8">`
125
123
  + `<meta name="viewport" content="width=device-width, initial-scale=1">`
126
124
  + `<title>Sign-in handoff failed</title></head><body>`
@@ -59,14 +59,6 @@ const { pool: defaultPool } = require('../../src/module-api');
59
59
  const { ORB_BY_STATE } = require('./projects-feed');
60
60
  const projectStats = require('./project-stats');
61
61
 
62
- // The manifest route every Cloud Bongos instance already serves, unauthenticated and
63
- // CORS-open (ADR 0114's discovery surface; `src/bongos/routes/instance.js`). Nothing is
64
- // added to it by this task — ADR 0252 §2.3: the field already ships in every core, so
65
- // there is no wire change on anyone else's upgrade schedule. The API router is
66
- // dual-mounted at `/api/bongos` (canonical) and at the permanent legacy alias ADR 0252
67
- // happened to write, so either prefix reaches it; the fetch uses the canonical one.
68
- const MANIFEST_ROUTE = '/api/bongos/instance';
69
-
70
62
  // Rows the PULL may write: the ones the ADR 0246 control-plane bridge has never claimed.
71
63
  // `IS DISTINCT FROM` rather than `<> `, deliberately — a NULL source is the unclaimed
72
64
  // state and plain inequality would drop exactly those rows on a NULL comparison.
@@ -190,7 +182,6 @@ async function sweepVisibilityOnce({ pool = defaultPool, limit = 200, fetchVisib
190
182
  }
191
183
 
192
184
  module.exports = {
193
- MANIFEST_ROUTE,
194
185
  PULLABLE_SQL,
195
186
  visibilityFromManifest,
196
187
  pullDecision,
@@ -93,4 +93,4 @@ function retryAnswers(h) {
93
93
  return r;
94
94
  }
95
95
 
96
- module.exports = { appStatus, appUrl, serviceLinks, oneSentence, retryAnswers, STAGES, QUIET_AFTER_MS, RENDER_URL_RE, SERVICE_ID_RE };
96
+ module.exports = { appStatus, appUrl, serviceLinks, oneSentence, retryAnswers, STAGES, QUIET_AFTER_MS, RENDER_URL_RE };