@bongos/core 1.19.971 → 1.19.973

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 (77) hide show
  1. package/.bongos-core.json +116 -76
  2. package/docs/adr/0111-instance-hosting-provisioning-module.md +1 -0
  3. package/docs/adr/0323-hosting-is-three-shapes-and-we-are-not-the-landlord.md +1 -1
  4. package/docs/adr/0325-the-managed-fleet-control-plane-is-the-hub-we-already-run.md +1 -1
  5. package/docs/adr/0327-a-cloud-host-runs-on-the-owners-account-and-the-key-is-borrowed.md +107 -0
  6. package/docs/adr/README.md +1 -0
  7. package/docs/api/openapi.json +1 -1
  8. package/docs/api-reference.md +1 -1
  9. package/docs/architecture.md +6 -6
  10. package/docs/branding-contract.md +1 -1
  11. package/docs/canonical-permissions.md +24 -24
  12. package/docs/copy-inventory.md +193 -187
  13. package/docs/copy-registry.json +320 -276
  14. package/docs/design/projects-hub-direction-v2.md +1 -1
  15. package/docs/design/vanilla-hall-ui-redesign-scope.md +2 -2
  16. package/docs/file-map.md +7 -7
  17. package/docs/handoff-template.md +1 -1
  18. package/docs/module-api-changelog.md +4 -0
  19. package/docs/modules-contract.md +1 -1
  20. package/docs/onboarding/drachmae-and-karma.md +2 -2
  21. package/docs/packs/engineer.md +5 -5
  22. package/docs/packs/ideator.md +1 -1
  23. package/docs/recipes/README.md +1 -1
  24. package/docs/recipes/audit-replay.md +2 -2
  25. package/docs/recipes/gds-db-backup.md +3 -3
  26. package/docs/recipes/managed-settings-remote-control.md +9 -9
  27. package/docs/recipes/memory-sync-conflicts.md +2 -2
  28. package/docs/recipes/ops-gotchas.md +24 -5
  29. package/docs/recipes/overnight-builder.md +3 -3
  30. package/docs/recipes/parallel-goal-waves.md +3 -3
  31. package/docs/recipes/reranking-a-goals-board.md +2 -2
  32. package/docs/recipes/search-index-ingestion.md +1 -1
  33. package/docs/recipes/ship-and-regrade.md +2 -2
  34. package/docs/recipes/staging-environment.md +1 -1
  35. package/docs/recipes/windows-builders.md +1 -1
  36. package/modules/hall-ui/public/deploy.html +10 -5
  37. package/modules/hall-ui/public/deploy.js +199 -110
  38. package/modules/hall-ui/public/goals-page.js +6 -0
  39. package/modules/hall-ui/public/goals-render.js +16 -0
  40. package/modules/hall-ui/public/mine-lens.js +172 -0
  41. package/modules/hall-ui/public/project-settings.css +36 -0
  42. package/modules/hall-ui/public/work-summary.js +90 -0
  43. package/modules/hall-ui/public/work.css +50 -0
  44. package/modules/hall-ui/public/work.html +24 -0
  45. package/modules/hall-ui/public/work.js +38 -51
  46. package/modules/lifecycle/db-goals.js +20 -3
  47. package/modules/lifecycle/routes/goals.js +2 -2
  48. package/modules/provisioning/core-upgrade.js +61 -2
  49. package/modules/public-landing/public/contact.html +1 -1
  50. package/modules/public-landing/public/index.html +1 -1
  51. package/modules/public-landing/public/privacy.html +1 -1
  52. package/modules/public-landing/public/projects.html +1 -1
  53. package/modules/public-landing/public/terms.html +1 -1
  54. package/package-lock.json +2 -2
  55. package/package.json +1 -1
  56. package/scripts/gds/api-alias-caller-scan.js +47 -9
  57. package/scripts/gds/cloudbongos-token-isolation.conf +33 -0
  58. package/scripts/gds/fitness.js +3 -0
  59. package/scripts/gds/provision-core-upgrade.js +132 -1
  60. package/scripts/gds/run-unit-tests.js +14 -9
  61. package/scripts/gds/scope-roster-guard.js +118 -0
  62. package/scripts/hall-preview/server.js +5 -0
  63. package/src/bongos/module-scope-map.js +1 -0
  64. package/src/module-api.js +1 -1
  65. package/tests/api_alias_caller_ratchet.mjs +68 -2
  66. package/tests/core_upgrade_door.mjs +81 -0
  67. package/tests/core_upgrade_runner.mjs +132 -0
  68. package/tests/deploy_page_projects.mjs +234 -79
  69. package/tests/fitness_scope_roster.mjs +117 -0
  70. package/tests/goal_mine_lens.mjs +233 -0
  71. package/tests/goal_tier.mjs +30 -4
  72. package/tests/hall_mine_lens.mjs +381 -0
  73. package/tests/idea_spark_hall.mjs +101 -12
  74. package/tests/known_failing_ratchet.mjs +19 -9
  75. package/tests/landing_legal_pages.mjs +5 -1
  76. package/tests/projects_hub_pre_uat.mjs +12 -6
  77. package/tests/served_paths_shipped.mjs +36 -2
@@ -47,14 +47,39 @@ const INTENTIONALLY_UNSHIPPED = {
47
47
  // module is individually allowlisted), so the base alone is not a shippable-asset claim.
48
48
  const NOT_SERVED_BASE = new Set([
49
49
  'modules', // path.join(ROOT,'modules') → MODULES_ROOT; real serves are path.join(MODULES_ROOT, key, 'public', rel)
50
+ // Surfaced by widening the scan to root ladders (task 1002617). tryLoadInstanceConfig
51
+ // does path.join(root, 'config', name) with a DYNAMIC name, and the result is READ as
52
+ // instance configuration — never sendFile()d to a client, so it is not a served asset
53
+ // and this test's premise (a served path must ship or the box 404s) does not apply.
54
+ // Its exclusion is also deliberate rather than an oversight: serve-internal.js:59-62
55
+ // records that config/ is host content under publish-manifest INSTANCE_EXCLUDE, which
56
+ // is exactly WHY that function walks an instance-root-first ladder. Shipping it would
57
+ // be the bug.
58
+ 'config',
50
59
  ]);
51
60
 
52
61
  // Extract the leading contiguous string-literal prefix of every path.join(ROOT, ...)
53
62
  // call. A trailing non-literal arg (a variable) means "some file under this dir", so the
54
63
  // literal prefix is the directory that must ship.
64
+ // ROOT-LADDER FORMS (task 1002617). The scan originally matched `path.join(ROOT, …)`
65
+ // only. Task 1002200 made the OpenAPI spec self-healing and multi-rooted:
66
+ //
67
+ // const roots = [...new Set([resolveDocsRoot(), ROOT])];
68
+ // candidates: roots.map((r) => path.join(r, 'docs/api/openapi.json'))
69
+ //
70
+ // so the served path stopped matching and the scan silently stopped seeing it. The
71
+ // existence guard below is what caught that — it is the only reason this test was parked
72
+ // rather than quietly asserting nothing, which is precisely what a self-guard is for.
73
+ //
74
+ // The fix is to match any single-identifier first argument, not to special-case `r`.
75
+ // A root ladder is still a root: whichever entry wins, the file must be IN the package or
76
+ // the standalone box 404s. Accepting any identifier does pull in non-asset bases
77
+ // (`root + 'config'`, `ROOT + 'infra'`, `ROOT + 'modules'`); those are handled by the
78
+ // existing NOT_SERVED_BASE / INTENTIONALLY_UNSHIPPED lists, which is what they are for,
79
+ // and each is individually asserted by the stale-exception guard.
55
80
  function extractRootJoinPrefixes(src) {
56
81
  const out = new Set();
57
- const re = /path\.join\(\s*ROOT\s*,/g;
82
+ const re = /path\.join\(\s*[A-Za-z_$][\w$]*\s*,/g;
58
83
  let m;
59
84
  while ((m = re.exec(src))) {
60
85
  // Arg span up to the matching close paren. These calls contain no nested parens
@@ -84,10 +109,19 @@ function probe(prefix) {
84
109
 
85
110
  const prefixes = extractRootJoinPrefixes(fs.readFileSync(SERVE_INTERNAL, 'utf8'));
86
111
 
112
+ // THE SELF-GUARD, and it has now earned its keep once (task 1002617). A static source
113
+ // scan degrades to silence when the code it scans changes shape: the regex stops
114
+ // matching, `prefixes` empties, and every downstream assertion passes over nothing. That
115
+ // is strictly worse than a red test, because it reads as coverage. This test failed for
116
+ // months for exactly the right reason — the OpenAPI serve moved to a root ladder — and
117
+ // it was parked in KNOWN_FAILING rather than diagnosed. Keep it, and keep it specific:
118
+ // a bare `size > 0` would have stayed green through the very change that blinded it.
87
119
  test('extraction found the known served assets (guards against a silent no-match)', () => {
88
120
  assert.ok(prefixes.size >= 5, `expected several ROOT-served paths, found ${prefixes.size}`);
89
121
  assert.ok(prefixes.has('clients/bongos-client/bongos-client.global.js'), 'must see the client bundle read');
90
- assert.ok(prefixes.has('docs/api/openapi.json'), 'must see the openapi spec read');
122
+ assert.ok(prefixes.has('docs/api/openapi.json'),
123
+ 'must see the openapi spec read — it is served from a ROOT LADDER (roots.map(r => path.join(r, …))), '
124
+ + 'so a scan matching only `path.join(ROOT, …)` goes blind here');
91
125
  });
92
126
 
93
127
  test('every ROOT-served asset ships in the core package (isPublishable)', () => {