@bongos/core 1.19.585 → 1.19.586

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.585",
6
- "core_contract": "1.19.585",
7
- "source_commit": "9352691bb382c387bdccba87b372194ba8c689b0",
5
+ "core_version": "1.19.586",
6
+ "core_contract": "1.19.586",
7
+ "source_commit": "ac6f287b895b1259c7b9fcc6b3a13e4fe178fbc0",
8
8
  "source_ref": "HEAD",
9
- "built_at": "2026-09-07T22:05:13.505Z",
9
+ "built_at": "2026-09-07T22:34:04.491Z",
10
10
  "redaction": {
11
11
  "model": "docs-redacted+functional-verbatim",
12
- "docs_redacted": 453,
12
+ "docs_redacted": 454,
13
13
  "agent_docs_stubbed": 24,
14
- "functional_verbatim": 2057,
14
+ "functional_verbatim": 2058,
15
15
  "rules": 3,
16
16
  "gate_literals": 3,
17
17
  "gate": "passed"
18
18
  },
19
- "file_count": 2534,
20
- "tree_sha256": "afd5fa885788c749e7a91e2ae3761266dc7c5ebe26278185542576129ecf7dd2",
19
+ "file_count": 2536,
20
+ "tree_sha256": "7986b516ffada3b257352c5ecedda7fbc33f7e216f58f11fd2cd8edf23920cae",
21
21
  "files": [
22
22
  {
23
23
  "path": ".claude/skills/blocker-review/SKILL.md",
@@ -1819,10 +1819,15 @@
1819
1819
  "mode": "0000644",
1820
1820
  "sha256": "fa04f8d71fff8186ae975a949c045ca7481bd0f22f395cb8c7397bbe03ddd449"
1821
1821
  },
1822
+ {
1823
+ "path": "docs/adr/0261-a-preselect-always-carries-a-reason-the-bundle-summary-is-the-floor.md",
1824
+ "mode": "0000644",
1825
+ "sha256": "04382d76f04c9317b565fb72951b36503e67acc95981a388d5c45efc80faaa26"
1826
+ },
1822
1827
  {
1823
1828
  "path": "docs/adr/README.md",
1824
1829
  "mode": "0000644",
1825
- "sha256": "1fa7dcf1456d26896e5cec77026ace0f08db8bed65527dee563cd7fdd2d07525"
1830
+ "sha256": "6d2df0c7c0e6cfd3381935d14a703f8cfa7854d107a6add03bc743e631823ada"
1826
1831
  },
1827
1832
  {
1828
1833
  "path": "docs/api-reference.md",
@@ -2707,7 +2712,7 @@
2707
2712
  {
2708
2713
  "path": "docs/module-api-changelog.md",
2709
2714
  "mode": "0000644",
2710
- "sha256": "0aaa401d7dc70186f6b739772f0411eb9458e93e3266d1d4301e212ee7d9473b"
2715
+ "sha256": "3474ae19a143b381a4da0091daa41c301338dac6ffd97e7ef396079803589160"
2711
2716
  },
2712
2717
  {
2713
2718
  "path": "docs/modules-contract.md",
@@ -6832,7 +6837,7 @@
6832
6837
  {
6833
6838
  "path": "modules/public-landing/public/projects.html",
6834
6839
  "mode": "0000644",
6835
- "sha256": "9c3a537d8c0ae0e5d8ddcdf2c69a859e1c72647203c8b177cc282dcad0c97e7f"
6840
+ "sha256": "eca7a7b580db8a794f5e0e17c8bfbb106529f14bf43c6e627d8f32e1dc9d6a53"
6836
6841
  },
6837
6842
  {
6838
6843
  "path": "modules/public-landing/public/projects.probes.json",
@@ -7577,12 +7582,12 @@
7577
7582
  {
7578
7583
  "path": "package-lock.json",
7579
7584
  "mode": "0000644",
7580
- "sha256": "995314658da0abc7f33ea3719d38b99ee78336573d89c5af94b6a752bb840ea4"
7585
+ "sha256": "d60a7d4e330cfd6154a5dea888aa9062d7571dee2d62aafc73cadb19b4afa604"
7581
7586
  },
7582
7587
  {
7583
7588
  "path": "package.json",
7584
7589
  "mode": "0000644",
7585
- "sha256": "d48fe5ff721c79f7f5673e1c1a9fa8aff96c5bc0bb86af3795ec5b6bb15f0fe9"
7590
+ "sha256": "14e7286fe47165dabdc74cb24b6bb5afdc1e7b949ae612b2f72c7a56107a246b"
7586
7591
  },
7587
7592
  {
7588
7593
  "path": "public-docs/index.html",
@@ -9292,7 +9297,7 @@
9292
9297
  {
9293
9298
  "path": "src/module-api.js",
9294
9299
  "mode": "0000644",
9295
- "sha256": "1f7f432992c33dfa9ab9c06722b952fd6f4ae1239b3ddb591be5f1c72ae77319"
9300
+ "sha256": "b3b115c1a4652247daebb85a6c393400361c2269cb047e691121193c45a63648"
9296
9301
  },
9297
9302
  {
9298
9303
  "path": "src/module-loader/catalog.js",
@@ -11702,7 +11707,7 @@
11702
11707
  {
11703
11708
  "path": "tests/projects_hub_module_picker.mjs",
11704
11709
  "mode": "0000644",
11705
- "sha256": "44981254fda6a07522d650210127fae6d65ed4d06e539f8a555c860c74de8c64"
11710
+ "sha256": "bae4d97b96d9aa747e70ee3a62f40bb7ef16c3702f4c2be362b12fe814a60aa6"
11706
11711
  },
11707
11712
  {
11708
11713
  "path": "tests/projects_hub_pre_uat.mjs",
@@ -12654,6 +12659,11 @@
12654
12659
  "mode": "0000644",
12655
12660
  "sha256": "74ffbc7e4585e651d00ab879ece6f3d23089d7c9ae7acb15483d3752b47bbdc0"
12656
12661
  },
12662
+ {
12663
+ "path": "tests/wizard_preselect_why.mjs",
12664
+ "mode": "0000644",
12665
+ "sha256": "2dc90311d8a4f31b543ed7ef711b4d3fc8b387a241bf0bbe797ab360107eac38"
12666
+ },
12657
12667
  {
12658
12668
  "path": "tests/workflow_exec_paths.mjs",
12659
12669
  "mode": "0000644",
@@ -0,0 +1,78 @@
1
+ # ADR 0261 — A preselect always carries a reason; the bundle's summary is the floor
2
+
3
+ **Status:** Accepted · 2026-09-07 · task 1003684
4
+ **Supersedes nothing. Resolves a tension between [ADR 0237](<redacted>.md) and [ADR 0243](<redacted>.md).**
5
+
6
+ ## Context
7
+
8
+ Two rules were each right on their own and wrong together.
9
+
10
+ **ADR 0243** made `bundle.adjustments` a **delta**: a team-shape rule that fires without moving
11
+ anything claims nothing. That is correct — a sentence explaining a change that did not happen is
12
+ a claim the owner cannot check, and the module contract states it plainly ("a rule that changed
13
+ nothing claims nothing").
14
+
15
+ **ADR 0237** says a preselect the owner cannot see a reason for is one they have to audit, which
16
+ is worse than no preselect at all. The wizard's own paint site quotes this.
17
+
18
+ The two collide whenever a type's bundle **already contains** what a rule would add. The live
19
+ case: `game` is `['dev-box','discord']` and the `small-team` rule adds `dev-box`. The rule fires,
20
+ moves nothing, and correctly reports `adjustments: []`. Confirmed against live core 1.19.580:
21
+
22
+ ```
23
+ GET /provisioning/starter-bundles → bundles[type=game].byTeamShape['small-team']
24
+ {"bundle":["dev-box","discord"],"adjustments":[]}
25
+ ```
26
+
27
+ The owner then reached step 4 of the create wizard and saw **two extras switched on and no reason
28
+ beside them** — `#modWhy` rendered as an empty, hidden div. Exactly the state ADR 0237 exists to
29
+ prevent, produced by ADR 0243 behaving correctly.
30
+
31
+ This was originally filed as a bug against the recommendation engine (a "dropped adjustment").
32
+ It was not: the engine is right. The gap is that the panel had only one voice — the rule's — and
33
+ fell silent when the rule had nothing to say.
34
+
35
+ ## Decision
36
+
37
+ **The why-line has two voices, and the type's is the floor.**
38
+
39
+ 1. When one or more rules **moved** something, their sentences are shown, unchanged. A real
40
+ adjustment still speaks for itself and is never displaced.
41
+ 2. When no rule moved anything, the **type's own curated `summary`** explains the preselect.
42
+ 3. When the owner has answered the picker for themselves (`state.modules !== null`), the panel
43
+ says nothing at all — unchanged. Handing back a reason for a toggle they just flipped reads
44
+ as the panel arguing with them.
45
+ 4. A bundle carrying no summary still says nothing. The floor is a floor, not an invention.
46
+
47
+ The summary was already authored for this job (`STARTER_BUNDLES[type].summary` in
48
+ `modules/provisioning/starter-bundles.js`), already served on every row of
49
+ `GET /provisioning/starter-bundles`, and — until this change — **rendered nowhere in the
50
+ product**.
51
+
52
+ ## Consequences
53
+
54
+ - No new copy, no new endpoint, no new field. The change is which existing sentence is rendered
55
+ when the delta is empty.
56
+ - `adjustments` keeps its meaning exactly. Nothing about ADR 0243 is weakened: the delta is still
57
+ a delta, and no rule is credited with a change it did not make. What changed is that the
58
+ panel's silence is no longer the *only* alternative to a rule sentence.
59
+ - The pin `tests/projects_hub_module_picker.mjs` had a fixture with **no `summary` field**, which
60
+ made four "no adjustment, no sentence" cases pass for the wrong reason. The fixture now carries
61
+ the real summaries and those cases assert the new contract — including, explicitly, that no
62
+ *rule* sentence is invented for a change that did not happen.
63
+ - `tests/wizard_preselect_why.mjs` pins the resolver directly across every combination.
64
+
65
+ ## Alternatives rejected
66
+
67
+ **Make the rule claim a no-op change.** Report `a-team-shares-one-environment` as an adjustment
68
+ even when `dev-box` was already in the bundle. Rejected: it re-introduces exactly the unverifiable
69
+ claim ADR 0243 removed, and the owner would read "a small team gets one shared environment" beside
70
+ a module that was on before they answered.
71
+
72
+ **Widen the bundles so no rule is ever redundant.** Rejected: it contorts curated per-type presets
73
+ to serve an unrelated rendering concern, and the redundancy would return the moment a rule or a
74
+ bundle changed.
75
+
76
+ **Leave it silent.** Rejected by the owner on 2026-09-07 after the trade-off was put to them
77
+ directly. The preselect is the wizard's most consequential default, and shipping it unexplained
78
+ for the most common answer combination is the failure ADR 0237 names.
@@ -352,3 +352,4 @@ This keeps the decision history honest and traceable.
352
352
  | 0258 | [**The public CLI is a generated client-only package, and its file list is proven by running it** ([task 1003679](https://cloudbongos.com/builders#/task/1003679) · goal 1000054 — *A newcomer can build without the UI*). The core ships private as `@bongos/core` ([ADR 0108](<redacted>.md)), so a newcomer with no credential can install NOTHING and the web hall is the only way in — the owner's words: "how am I supposed to easily take on tasks as a new builder? I should be able to do everything without the UI." Open task 1002025 proposed publishing the core, which ships the SERVER and bypasses [ADR 0099](<redacted>.md)'s redaction pipeline (dormant until ~2026-11). **Decision: generate a separate public `@cloudbongos/cli` from the core and do not publish the core.** Four load-bearing parts. (1) SCOPED NAME, because npm shares one namespace between org names and unscoped packages — the bare `cloudbongos` is unpublishable *precisely because the owner owns that org*, which npm reports as "invalid" and reads like the name is taken; and a package name cannot be created on the npm website at all (it exists on first publish, which is why "Add Existing Package" answered `Forbidden`). (2) THE FILE LIST IS DECLARED AND PROVEN BY BEHAVIOUR, never computed — a static require-closure CANNOT answer this, because `src/module-api.js` is the doorway a module may only import ([ADR 0083](<redacted>.md)) and it *names* every kernel capability, so a static walk sees 33 `src/` files from `start.js` alone where runtime resolves **one** (`api-prefix.js`, which imports nothing) — the same trap as task 1003677's unsatisfiable done-when. So the test packs the tarball, installs it into an empty dir with NO repo, and runs every verb: it may fail for want of a session, never for a missing file. That caught two real holes on its first strengthened run — `clients/bongos-client/index.mjs`, reached by a dynamic `import()` no `require()` walk can see, and a hand-listed `files` array that dropped `clients/` and produced a tarball which installed cleanly then died on first use; both are now build-time refusals, and the `files` array is derived from the manifest. (3) `claim`/`ship`/`dev`/`serve`/`module`/`upgrade`/`onboard`/`doctor`/`exec`/`package-core` are ABSENT and the CLI says WHY plus the next step (`bongos shell` → a cloud box with the full CLI) — a bare `unknown command` teaches nothing, which is the exact failure being fixed. The supported journey is `login` → `start` → `shell`. (4) A REDACTION GATE fails the build closed on non-loopback IPv4 (RFC 5737 doc ranges exempt), token/key shapes, and every domain + owner login readable from the instance's own `config/branding.json` — needles come from host config so the core carries no instance identity ([ADR 0062 §7](<redacted>.md)); `cloudbongos.com` is allowlisted as public by design. No `repository` field while the core repo is private (it would 404 for every user and publish the owner's login for nothing). 31 files, one dependency (`undici`), version independent of the core's ([ADR 0161](<redacted>.md)). `@bongos/client` is VENDORED, not depended on — a public package depending on a private one is uninstallable. **The owner runs `npm publish`; a builder must not.** Task 1002025 is superseded. Rejected: publishing the core; deriving from a static closure (structurally impossible past the doorway); waiting for the mirror (dormant, and this is a build product not a source release); an unscoped name; depending on `@bongos/client`; a degraded `claim`; shipping all of `src/` to make lazy getters safe.](<redacted>.md) | cli / distribution / public surface |
353
353
  | 0259 | [**A project’s departure from the public list is public, and the copy says so** ([task 1003672](https://cloudbongos.com/builders#/task/1003672) · goal 1000046 — *Project creation*). Decides the leak [ADR 0255](<redacted>.md) §6.2 deliberately filed rather than implied fixed. The public projects feed publishes a named list plus a count of anonymous rows, so when a project flips to stealth its named row LEAVES the identified block while the count RISES BY ONE — *“Mercury is gone, and there is one more black hole”* names it, and the moment, from a single diff of two snapshots. **Everything [ADR 0182](<redacted>.md) D2a does is defeated by it**, because the identity was never carried ON the anonymous row (`STEALTH_ANONYMOUS_KEEPS` is an allow-list precisely so a column added next year is anonymous by default) — it is carried by the ABSENCE of the named row that used to sit beside it. **Larger than the channel 0255 closed**, which needed repeated sampling and correlation; this one is exact and needs two reads. No `ORDER BY` change touches it: it is inherent in publishing a named list at all, so every fix is a product decision with a visible cost and the owner’s call, not a builder’s. **Decision: accept it, and make the copy say so.** Two reasons it is the right end of the trade and not merely the cheapest — (1) it is ALREADY the honest reading of the existing promise, since D2a made existence and count public *by design*, and a count that is public and truthful is a count whose CHANGES are public; (2) both alternatives damage the control they defend. A **delay window** means the owner clicks the privacy setting and is not private yet *without knowing it*, converting an information leak into a false belief — strictly worse, and the wrong direction for a privacy control. **Decoys** spend the count’s truthfulness (it is truthful today) on a guarantee that is still only probabilistic, and a decoy scheme needs some way to tell padding from real rows — the exact stable per-project key D2a forbids. The promise stealth actually keeps is about the project’s CONTENTS, not the TRANSITION: an anonymous row stays anonymous (no name, tagline, art, origin, or key surviving to the next snapshot); what is not private is stepping off a published list readers may keep copies of. So the copy — which read *“its name, and everything else about it, stay yours”*, every clause true and the paragraph as a whole overselling, because a reader takes it to cover the switch — now names the boundary in BOTH places an owner meets the setting (the choice’s blurb and the what-changes fold), in the plain register 0182’s interview fixed for this card. **A privacy control that oversells is worse than one that admits a limit**, the same standard 0255 §6 set for itself. **No behaviour changes** in `projects-feed.js` — the feed, the redaction allow-list and the keyed rotating permutation are decided FINISHED, not insufficient. `tests/projects_hub.mjs` pins the sentence in both surfaces (the copy IS the fix, so a future edit tightening the blurb must not quietly drop it) and re-applies the no-space-metaphor ban to it. Carries 0255 §6.3’s smaller residual so both live in one place: within one 24h epoch the permutation is stable, so same-day snapshots tell black holes apart (not name them) — accepted on the same reasoning, since the fix is a per-request permutation, which breaks pagination exactly as `ORDER BY random()` was rejected for. Guards recorded for any future attempt: no stable per-project key on an anonymous row, and no anonymous ordering an observer can predict or correlate. Rejected: the delay; decoys; dropping the named list (protects a privacy nobody asked for at the cost of the feature); and saying nothing, which is the failure mode this closes.](<redacted>.md) | platform-identity / privacy boundary / copy honesty |
354
354
  | 0260 | [**An application IS the consent, and the hub’s own echo is the gate** ([task 1002972](https://cloudbongos.com/builders#/task/1002972) · goal 1000045, criterion C4). Privacy spec **D7** asks that a reviewer see what the applicant’s OWN profile rules would already show, evaluated LIVE at review time. The rule is ONE port composing the two EXISTING views — `getPublicProfileExtras` for a public account, `recruiter-sliver`’s own `sliverShapeFor` for a private one — because a third five-key lookalike **is** the new disclosure class D7 forbids. **The one deliberate difference from the D3 sliver:** `getRecruiterSliver` floors on recruiting REACH, and reusing it verbatim would be wrong in the direction that looks safe — `recruiter_discoverable` defaults to FALSE for a private account, so a private builder who deliberately applied would show their reviewer NOTHING and C4 would be satisfied by an empty box. D7 settles it: *“applying is an explicit act”*. The swap relaxes REACH only; `accountActiveSql` (active **and** terms accepted) and `hide_stats` still floor it, and the proof asserts both directions on the same account so the tempting refactor cannot pass quietly. **The federated route’s gate is the whole security story** ([ADR 0205](<redacted>.md) / security report 1000027): client credentials name a PROJECT and never a person, so `POST /sso/applicant-profile` authenticated alone is a bulk disclosure oracle over every account on the platform, private ones included. `applicationBacksProfileRead` demands a HUB-WRITTEN echo for exactly (this account, this client) inside the same 30-day window — a row only the hub’s own join relay creates — refusing **404, never 403**, and BEFORE any account is read (asserted on the statement log, because a gate that refuses after reading has already done the disclosure work). LIVE means nothing is stored at either end; the queue keys on the VOUCH and never on `github_login` (the one PUBLIC unauthenticated write makes an unvouched login an impersonation surface); and the hub client secret stays in core behind a narrow doorway port. **The path is complete but DORMANT until R09 ([task 1002285](https://cloudbongos.com/builders#/task/1002285)) ships the vouch writer** — nothing writes `applicant_github_id` today, and that dependency was missing from 1002972’s graph. Rejected: routing the port through `getRecruiterSliver`, a snapshot at apply time, resolving by `github_login`, and putting `loadIdpConfig` on the doorway.](<redacted>.md) | platform identity / privacy |
355
+ | 0261 | [**A preselect always carries a reason; the bundle’s summary is the floor** ([task 1003684](https://cloudbongos.com/builders#/task/1003684) · goal 1000046 — *Project creation*). Resolves a collision between two rules that were each right alone. [ADR 0243](<redacted>.md) made `adjustments` a **delta** — a team-shape rule that fires without moving anything claims nothing, because a sentence explaining a change that did not happen is a claim the owner cannot check. [ADR 0237](<redacted>.md) says a preselect the owner cannot see a reason for is one they must audit, which is worse than no preselect at all. The two collide whenever a type’s bundle **already contains** what a rule would add: `game` is `[dev-box, discord]` and the `small-team` rule adds `dev-box`, so the rule fires, moves nothing, and correctly reports `adjustments: []`. Confirmed on live core 1.19.580 — `byTeamShape[small-team]` = `{"bundle":["dev-box","discord"],"adjustments":[]}`. The owner then reached step 4 and saw **two extras switched on with no reason beside them**, `#modWhy` an empty hidden div: exactly what 0237 exists to prevent, produced by 0243 behaving correctly. Filed as a dropped adjustment; it was not — the engine is right, and the panel simply had ONE voice and fell silent when the rule had nothing to say. **Decision: the why-line has two voices and the type’s is the floor.** A real adjustment still speaks for itself and is never displaced; when none moved, the type’s own curated `summary` explains the preselect; when the owner has answered the picker themselves the panel stays silent (unchanged — a reason handed back for a toggle they just flipped reads as the panel arguing with them); a bundle with no summary still says nothing, because a floor is not an invention. **No new copy, endpoint or field** — the summary was authored for this job in `starter-bundles.js`, served on every row of `GET /provisioning/starter-bundles`, and rendered NOWHERE in the product until now. 0243 is not weakened: the delta stays a delta and no rule is credited with a change it did not make. The pin `tests/projects_hub_module_picker.mjs` carried a fixture with **no `summary` field**, which made four “no adjustment, no sentence” cases pass for the wrong reason; the fixture now carries the real summaries and those cases assert the new contract, including explicitly that no RULE sentence is invented for a change that did not happen. Rejected: making the rule claim a no-op change (re-introduces the unverifiable claim 0243 removed); widening the bundles so no rule is ever redundant (contorts curated presets for a rendering concern, and the redundancy returns on the next edit); and leaving it silent, declined by the owner once the trade-off was put to them directly.](<redacted>.md) | provisioning / starter bundles / owner-facing copy |
@@ -1619,5 +1619,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
1619
1619
  landed since 1.19.583 with no explicit bump. run 34164936809. (task 1002620)
1620
1620
  1.19.585 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1621
1621
  landed since 1.19.584 with no explicit bump. run 34165392436. (task 1002620)
1622
+ 1.19.586 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1623
+ landed since 1.19.585 with no explicit bump. run 34167072966. (task 1002620)
1622
1624
  ---------------------------------------------------------------------------
1623
1625
  ```
@@ -3408,13 +3408,29 @@ summary{min-height:24px;padding:3px 0;}
3408
3408
  return row ? row.bundle.slice() : [];
3409
3409
  }
3410
3410
  /* Why the preselect is what it is, in the owner's own words — one sentence per
3411
- rule that ACTUALLY moved something. Empty when nothing did, and empty once
3412
- the owner has answered for themselves: a reason given back for a toggle they
3413
- flipped reads as the panel arguing with them. */
3411
+ rule that ACTUALLY moved something, and failing that the type's own summary.
3412
+ Returns SENTENCES, not rule rows.
3413
+
3414
+ The fallback is the point (task 1003684). `adjustments` is a DELTA: a rule that
3415
+ fires without changing anything claims nothing (ADR 0243). So for a type whose
3416
+ bundle ALREADY contains what the rule would add — game is [dev-box, discord] and
3417
+ the small-team rule adds dev-box — the delta is empty and the owner was shown a
3418
+ tailored preselect with no reason beside it at all. That is the state ADR 0237
3419
+ calls worse than no preselect: one the owner has to audit. Each bundle carries a
3420
+ curated summary authored for exactly this, served on every row, and until now
3421
+ never rendered anywhere (ADR 0261). It is the floor, not a replacement — an adjustment
3422
+ still speaks for itself and wins.
3423
+
3424
+ Still empty once the owner has answered for themselves: a reason given back for
3425
+ a toggle they flipped reads as the panel arguing with them. */
3414
3426
  function preselectReasons() {
3415
3427
  if (state.modules !== null) return [];
3416
3428
  var row = tailoredRow();
3417
- return row ? (row.adjustments || []) : [];
3429
+ if (!row) return [];
3430
+ var moved = (row.adjustments || []).map(function (a) { return a.reason; });
3431
+ if (moved.length) return moved;
3432
+ var b = bundleRow();
3433
+ return b && b.summary ? [b.summary] : [];
3418
3434
  }
3419
3435
  /* What the panel paints and the review names: the owner's answer if they
3420
3436
  gave one, otherwise the type's preselect. */
@@ -3507,7 +3523,7 @@ summary{min-height:24px;padding:3px 0;}
3507
3523
  var why = $('modWhy');
3508
3524
  var reasons = preselectReasons();
3509
3525
  why.innerHTML = reasons.length
3510
- ? reasons.map(function (a) { return '<span>' + esc(a.reason) + '</span>'; }).join('')
3526
+ ? reasons.map(function (r) { return '<span>' + esc(r) + '</span>'; }).join('')
3511
3527
  : '';
3512
3528
  why.classList.toggle('on', reasons.length > 0);
3513
3529
  var core = (starterBundles.core || []).length;
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.585",
3
+ "version": "1.19.586",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.585",
9
+ "version": "1.19.586",
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.585",
3
+ "version": "1.19.586",
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",
package/src/module-api.js CHANGED
@@ -55,7 +55,7 @@ const { buildInfo } = require('./build-info');
55
55
  // there. scripts/gds/bump-version.js still rewrites the literal below; it appends
56
56
  // the entry to that file. Look for a version's history there, not here.
57
57
  // ---------------------------------------------------------------------------
58
- const CORE_VERSION = '1.19.585'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
58
+ const CORE_VERSION = '1.19.586'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
59
59
 
60
60
  // A namespaced logger so a module's log lines are attributable + consistent.
61
61
  // Usage: const log = api.logger('dev-box'); log.info('mounted');
@@ -56,12 +56,16 @@ const PAYLOAD = {
56
56
  core: ['autonomy', 'builder-settings', 'copy-desk', 'economy', 'government', 'grading',
57
57
  'hall-ui', 'ideas', 'lifecycle', 'memory', 'onboarding', 'public-landing',
58
58
  'security', 'sessions', 'status-ui', 'ui-design'],
59
+ // `summary` is part of every real bundle row and is the why-line's FLOOR since task
60
+ // 1003684 — the sentence shown when no rule moved anything. The fixture carried none
61
+ // before that, which quietly made every "no adjustment, no sentence" case pass for the
62
+ // wrong reason. These are the real strings from starter-bundles.js.
59
63
  bundles: [
60
- { type: 'game', bundle: ['dev-box', 'discord'] },
61
- { type: 'research', bundle: ['agents'] },
62
- { type: 'business', bundle: ['agents', 'dev-box'] },
63
- { type: 'non-profit', bundle: ['discord'] },
64
- { type: 'not-sure', bundle: [] },
64
+ { type: 'game', bundle: ['dev-box', 'discord'], summary: 'Somewhere for players to gather, and a place to walk a change through before anyone plays it.' },
65
+ { type: 'research', bundle: ['agents'], summary: 'Extra agents to run the reading and the experiments the question needs.' },
66
+ { type: 'business', bundle: ['agents', 'dev-box'], summary: 'A place to try a change before customers see it, and agents to look it over first.' },
67
+ { type: 'non-profit', bundle: ['discord'], summary: 'Somewhere the community around the cause can gather and be heard.' },
68
+ { type: 'not-sure', bundle: [], summary: 'Just the core, and nothing else to decide today. Add modules whenever you know what you need.' },
65
69
  ],
66
70
  optional: [
67
71
  { key: 'agents', label: 'Extra agents', summary: 'More AI agents alongside the ones every project gets.' },
@@ -460,8 +464,14 @@ test('a rule that changed nothing claims nothing', async () => {
460
464
  await h.open();
461
465
 
462
466
  assert.deepEqual(h.rows().filter((r) => r.pressed).map((r) => r.key), ['dev-box', 'discord']);
463
- assert.deepEqual(h.why(), [], 'no adjustment, no sentence');
464
- assert.equal(h.whyShown(), false, 'and no empty block sitting on the panel');
467
+ // No adjustment, so no adjustment-sentence the rule still claims nothing. But the
468
+ // panel is not silent: the TYPE explains its own preselect (task 1003684), because two
469
+ // extras switched on with no reason beside them is the state ADR 0237 calls worse than
470
+ // no preselect at all. The rule's voice and the type's voice are different things.
471
+ assert.deepEqual(h.why(), ['Somewhere for players to gather, and a place to walk a change through before anyone plays it.']);
472
+ assert.ok(!h.why().some((s) => /shared cloud environment|somewhere for it to gather is switched on/.test(s)),
473
+ 'and no RULE sentence is invented for a change that did not happen');
474
+ assert.equal(h.whyShown(), true, 'the block carries the type\'s reason');
465
475
  });
466
476
 
467
477
  test('an added module is preselected and explained', async () => {
@@ -520,7 +530,9 @@ test('a payload with no byTeamShape degrades to the untailored bundle, never to
520
530
  await h.open();
521
531
 
522
532
  assert.deepEqual(h.rows().filter((r) => r.pressed).map((r) => r.key), ['dev-box', 'discord']);
523
- assert.deepEqual(h.why(), []);
533
+ // Degraded, but still explained: with no byTeamShape there is no adjustment to report,
534
+ // and the type's own summary is exactly the untailored reason (task 1003684).
535
+ assert.deepEqual(h.why(), ['Somewhere for players to gather, and a place to walk a change through before anyone plays it.']);
524
536
  });
525
537
 
526
538
  test('an off-vocabulary team shape adjusts nothing', async () => {
@@ -530,7 +542,9 @@ test('an off-vocabulary team shape adjusts nothing', async () => {
530
542
  await h.open();
531
543
 
532
544
  assert.deepEqual(h.rows().filter((r) => r.pressed).map((r) => r.key), ['dev-box', 'discord']);
533
- assert.deepEqual(h.why(), []);
545
+ // No rule fires, so nothing is CLAIMED about the unknown shape — the sentence shown is
546
+ // the type's, which is true regardless of who is building it (task 1003684).
547
+ assert.deepEqual(h.why(), ['Somewhere for players to gather, and a place to walk a change through before anyone plays it.']);
534
548
  });
535
549
 
536
550
  test('a couldn\'t-load read clears any reasons it had already painted', async () => {
@@ -582,8 +596,12 @@ test('the picker and the server resolve the same set for every answer an owner c
582
596
  `type=${preset.type} team_shape=${teamShape}: the panel preselects what the server resolves`);
583
597
  assert.deepEqual(h.rows().filter((r) => r.pressed).map((r) => r.key), server.selected,
584
598
  `type=${preset.type} team_shape=${teamShape}: and the toggles show it`);
585
- assert.deepEqual(h.why().length, server.adjustments.length,
586
- `type=${preset.type} team_shape=${teamShape}: one sentence per adjustment the server made`);
599
+ // One sentence per adjustment the server made — and when it made none, the single
600
+ // floor sentence the type carries, so no combination leaves a preselect unexplained
601
+ // (task 1003684). A preset with no summary of its own still says nothing.
602
+ const expectedWhy = server.adjustments.length || (preset.summary ? 1 : 0);
603
+ assert.equal(h.why().length, expectedWhy,
604
+ `type=${preset.type} team_shape=${teamShape}: a sentence per adjustment, or the type's own when none moved`);
587
605
  }
588
606
  }
589
607
  });
@@ -0,0 +1,137 @@
1
+ // tests/wizard_preselect_why.mjs — the module picker always says WHY the preselect is on
2
+ // (task 1003684).
3
+ //
4
+ // The bug as filed said the starter-bundle "why" sentence was being dropped for
5
+ // Game + small-team. It was not: `adjustments` is a DELTA, and a rule that fires without
6
+ // changing anything claims nothing (ADR 0243). The game bundle is already
7
+ // ['dev-box','discord'] and the small-team rule ADDS dev-box, so the rule fires, moves
8
+ // nothing, and correctly reports []. Verified against live core 1.19.580:
9
+ // byTeamShape['small-team'] => {"bundle":["dev-box","discord"],"adjustments":[]}
10
+ //
11
+ // The real defect is what the owner then saw: two extras pre-switched-on with no reason
12
+ // beside them — precisely the state the paint site's own comment calls out, "a preselect an
13
+ // owner cannot see the reason for is one they have to audit, which is the thing ADR 0237
14
+ // says is worse than no preselect at all". Each bundle carries a curated `summary` authored
15
+ // for this, served on every row of GET /provisioning/starter-bundles, and never rendered
16
+ // anywhere in the wizard. It is now the floor beneath the adjustment sentences.
17
+ //
18
+ // Harness: the vm-slice idiom (tests/project_door_ui.mjs), since the wizard's script is
19
+ // inline in the page and there is no jsdom here.
20
+ //
21
+ // Run: node --test --test-reporter=tap tests/wizard_preselect_why.mjs
22
+
23
+ import assert from 'node:assert/strict';
24
+ import { test } from 'node:test';
25
+ import fs from 'node:fs';
26
+ import path from 'node:path';
27
+ import vm from 'node:vm';
28
+ import { fileURLToPath } from 'node:url';
29
+
30
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
31
+ const HUB = fs.readFileSync(path.join(ROOT, 'modules', 'public-landing', 'public', 'projects.html'), 'utf8');
32
+
33
+ const SLICE_RE = /function bundleRow\(\)[\s\S]*?function preselectReasons\(\)[\s\S]*?\n {4}\}/;
34
+ const slice = (HUB.match(SLICE_RE) || [null])[0];
35
+
36
+ test('the preselect-reason slice is still findable', () => {
37
+ assert.ok(slice, 'bundleRow/tailoredRow/preselectReasons were not found in projects.html');
38
+ assert.match(slice, /function tailoredRow\(\)/, 'the slice spans the tailoring lookup too');
39
+ });
40
+
41
+ // Faithful to the real payload shape (confirmed against live): every bundle row carries
42
+ // label/summary/bundle, and byTeamShape holds the resolved answer per team shape.
43
+ const BUNDLES = {
44
+ bundles: [
45
+ {
46
+ type: 'game',
47
+ label: 'Game starter',
48
+ summary: 'Somewhere for players to gather, and a place to walk a change through before anyone plays it.',
49
+ bundle: ['dev-box', 'discord'],
50
+ byTeamShape: {
51
+ // the live case: the rule fires, moves nothing, reports nothing
52
+ 'small-team': { bundle: ['dev-box', 'discord'], adjustments: [] },
53
+ solo: {
54
+ bundle: ['discord'],
55
+ adjustments: [{ reason: 'You are building this alone, so the shared cloud environment is off — your own machine is the setup.' }],
56
+ },
57
+ },
58
+ },
59
+ {
60
+ type: 'research',
61
+ label: 'Research starter',
62
+ summary: 'Extra agents to run the reading and the experiments the question needs.',
63
+ bundle: ['agents'],
64
+ byTeamShape: {
65
+ 'small-team': {
66
+ bundle: ['agents', 'dev-box'],
67
+ adjustments: [{ reason: 'A small team gets one shared environment to build in, so nobody is debugging their own laptop.' }],
68
+ },
69
+ },
70
+ },
71
+ { type: 'not-sure', label: 'Not sure', summary: '', bundle: [], byTeamShape: {} },
72
+ ],
73
+ };
74
+
75
+ function why({ projType, teamShape, modules = null, bundles = BUNDLES }) {
76
+ const sandbox = { starterBundles: bundles, state: { projType, teamShape, modules } };
77
+ sandbox.globalThis = sandbox;
78
+ vm.createContext(sandbox);
79
+ vm.runInContext(slice + '\nvar __out = preselectReasons();', sandbox);
80
+ // Copy out of the vm realm: its Array has a different prototype, and assert/strict's
81
+ // deepEqual compares prototypes — so a correct result would otherwise fail as
82
+ // "same structure but not reference-equal".
83
+ return Array.from(sandbox.__out);
84
+ }
85
+
86
+ test('game + small-team: no delta, so the type\'s own summary is the reason', () => {
87
+ // This is the exact combination from the live walk that surfaced the bug.
88
+ const out = why({ projType: 'game', teamShape: 'small-team' });
89
+ assert.deepEqual(out, ['Somewhere for players to gather, and a place to walk a change through before anyone plays it.']);
90
+ });
91
+
92
+ test('a REAL adjustment still speaks for itself — the summary does not displace it', () => {
93
+ const out = why({ projType: 'research', teamShape: 'small-team' });
94
+ assert.equal(out.length, 1);
95
+ assert.match(out[0], /shared environment/);
96
+ assert.doesNotMatch(out[0], /reading and the experiments/, 'the rule\'s sentence wins, not the summary');
97
+ });
98
+
99
+ test('a removal adjustment is reported the same way', () => {
100
+ const out = why({ projType: 'game', teamShape: 'solo' });
101
+ assert.equal(out.length, 1);
102
+ assert.match(out[0], /building this alone/);
103
+ });
104
+
105
+ test('no team shape answered: falls through to the bundle, still explained', () => {
106
+ // tailoredRow() returns the unadjusted bundle with adjustments: [] when no shape is set,
107
+ // which before this change also produced an unexplained preselect.
108
+ const out = why({ projType: 'game', teamShape: null });
109
+ assert.deepEqual(out, ['Somewhere for players to gather, and a place to walk a change through before anyone plays it.']);
110
+ });
111
+
112
+ test('once the owner has answered for themselves, the panel says nothing', () => {
113
+ // The pre-existing rule, and the one a careless fallback would have broken: handing back
114
+ // a reason for a toggle they just flipped reads as the panel arguing with them.
115
+ assert.deepEqual(why({ projType: 'game', teamShape: 'small-team', modules: [] }), []);
116
+ assert.deepEqual(why({ projType: 'game', teamShape: 'small-team', modules: ['agents'] }), []);
117
+ });
118
+
119
+ test('an unknown type, or a bundle with no summary, says nothing rather than crashing', () => {
120
+ assert.deepEqual(why({ projType: 'no-such-type', teamShape: 'small-team' }), []);
121
+ assert.deepEqual(why({ projType: null, teamShape: 'small-team' }), []);
122
+ assert.deepEqual(why({ projType: 'not-sure', teamShape: 'small-team' }), [], 'empty summary is not a sentence');
123
+ });
124
+
125
+ test('before the bundles read lands, nothing is claimed', () => {
126
+ assert.deepEqual(why({ projType: 'game', teamShape: 'small-team', bundles: null }), []);
127
+ });
128
+
129
+ test('every sentence returned is a plain string, so the paint site can escape it directly', () => {
130
+ for (const t of ['game', 'research']) {
131
+ for (const s of ['small-team', 'solo', null]) {
132
+ for (const line of why({ projType: t, teamShape: s })) {
133
+ assert.equal(typeof line, 'string', `${t}/${s} yielded a non-string`);
134
+ }
135
+ }
136
+ }
137
+ });