@bongos/core 1.20.73 → 1.20.75

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 (43) hide show
  1. package/.bongos-core.json +66 -46
  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/0359-nobody-sets-a-module-score-by-hand-metic-can-ask-for-a-re-check.md +40 -0
  8. package/docs/adr/README.md +1 -0
  9. package/docs/api/openapi.json +185 -3
  10. package/docs/api-reference.md +5 -3
  11. package/docs/architecture.md +1 -1
  12. package/docs/copy-inventory.md +447 -373
  13. package/docs/copy-registry.json +1157 -468
  14. package/docs/module-api-changelog.md +4 -0
  15. package/docs/page-inventory.json +6 -1
  16. package/docs/page-readings.json +1044 -650
  17. package/modules/government/catalog.js +3 -0
  18. package/modules/government/migrations/government_021_module_assessment_rerun.sql +36 -0
  19. package/modules/provisioning/routes/provisioning.js +35 -0
  20. package/modules/public-landing/public/assets/cosmos.css +1 -1
  21. package/modules/public-landing/public/projects.html +589 -63
  22. package/modules/public-landing/public/projects.probes.json +8 -5
  23. package/modules/public-landing/public/projects.states.json +19 -14
  24. package/modules/ui-design/kit/lib.js +4 -2
  25. package/modules/ui-design/kit/serve.js +5 -0
  26. package/package-lock.json +2 -2
  27. package/package.json +1 -1
  28. package/release-notes.json +12 -0
  29. package/src/bongos/route-rank-check.js +3 -0
  30. package/src/bongos/routes/modules.js +27 -0
  31. package/src/module-api.js +1 -1
  32. package/tests/module_store_reassess.mjs +120 -0
  33. package/tests/projects_hub.mjs +9 -5
  34. package/tests/projects_hub_app_status.mjs +1 -1
  35. package/tests/projects_hub_app_step.mjs +10 -10
  36. package/tests/projects_hub_look.mjs +7 -7
  37. package/tests/projects_hub_module_picker.mjs +9 -9
  38. package/tests/projects_hub_pre_uat.mjs +2 -1
  39. package/tests/wizard_demo.mjs +1 -1
  40. package/tests/wizard_draft_resume.mjs +1 -1
  41. package/tests/wizard_front_door.mjs +11 -7
  42. package/tests/wizard_intent_resume.mjs +9 -9
  43. package/tests/wizard_physics.mjs +264 -0
@@ -16533,6 +16533,55 @@
16533
16533
  "security": []
16534
16534
  }
16535
16535
  },
16536
+ "/provisioning/physics-check": {
16537
+ "post": {
16538
+ "operationId": "post_provisioning_physics_check",
16539
+ "tags": [
16540
+ "provisioning"
16541
+ ],
16542
+ "summary": "POST /provisioning/physics-check",
16543
+ "description": "POST /provisioning/physics-check — the planet-physics questions' read BEFORE anything exists (task 1004418, BV2.PS07). The create wizard asks it as the founder answers: would this description stop at the screening screen, and which options do the answers so far hide, grey or annotate (the PS02 soft-limit table, spec D6)? It is the same screen and the same table the create runs, so the screens can never disagree with the Create. Writes nothing, and the soft limits stay advice (`enforced: false`); the create still re-checks everything itself.\n\n**Rank:** `any-builder` — Any authenticated builder (row-level ownership enforced in-handler).",
16544
+ "x-rank": "any-builder",
16545
+ "x-source": "modules/provisioning/routes/provisioning.js",
16546
+ "requestBody": {
16547
+ "required": false,
16548
+ "content": {
16549
+ "application/json": {
16550
+ "schema": {
16551
+ "$ref": "#/components/schemas/PostProvisioningPhysicsCheckRequest"
16552
+ }
16553
+ }
16554
+ },
16555
+ "x-validated": true
16556
+ },
16557
+ "responses": {
16558
+ "200": {
16559
+ "description": "Success.",
16560
+ "content": {
16561
+ "application/json": {
16562
+ "schema": {
16563
+ "$ref": "#/components/schemas/PostProvisioningPhysicsCheckResponse"
16564
+ }
16565
+ }
16566
+ }
16567
+ },
16568
+ "400": {
16569
+ "$ref": "#/components/responses/ValidationFailed"
16570
+ },
16571
+ "401": {
16572
+ "$ref": "#/components/responses/Unauthorized"
16573
+ },
16574
+ "403": {
16575
+ "$ref": "#/components/responses/Forbidden"
16576
+ }
16577
+ },
16578
+ "security": [
16579
+ {
16580
+ "builderSession": []
16581
+ }
16582
+ ]
16583
+ }
16584
+ },
16536
16585
  "/provisioning/recommendations": {
16537
16586
  "get": {
16538
16587
  "operationId": "get_provisioning_recommendations",
@@ -20132,6 +20181,81 @@
20132
20181
  ]
20133
20182
  }
20134
20183
  },
20184
+ "/store/modules/{key}/versions/{version}/reassess": {
20185
+ "post": {
20186
+ "operationId": "post_store_modules_key_versions_version_reassess",
20187
+ "tags": [
20188
+ "store"
20189
+ ],
20190
+ "summary": "POST /store/modules/:key/versions/:version/reassess",
20191
+ "description": "POST /api/bongos/store/modules/:key/versions/:version/reassess — a Metic+ person asks for a published version's assessment to run again: the Security gate, the Docs grader, then the score (task 1003796, ADR 0359). There is deliberately no way to SET a score: the owner ruled a person may trigger a re-check, never change the number. A reason is required; the audit middleware records it with who asked. Answers 202 — the run is queued like a publish's.\n\n**Rank:** `metic+archon` — Metic or Archon rank (review/triage powers).\n\n**Permissions:** `module.assessment.rerun` (all required).",
20192
+ "x-rank": "metic+archon",
20193
+ "x-source": "src/bongos/routes/modules.js",
20194
+ "x-permissions": [
20195
+ "module.assessment.rerun"
20196
+ ],
20197
+ "parameters": [
20198
+ {
20199
+ "name": "key",
20200
+ "in": "path",
20201
+ "required": true,
20202
+ "schema": {
20203
+ "type": "string"
20204
+ },
20205
+ "description": "Path parameter `key`."
20206
+ },
20207
+ {
20208
+ "name": "version",
20209
+ "in": "path",
20210
+ "required": true,
20211
+ "schema": {
20212
+ "type": "string"
20213
+ },
20214
+ "description": "Path parameter `version`."
20215
+ }
20216
+ ],
20217
+ "requestBody": {
20218
+ "required": false,
20219
+ "content": {
20220
+ "application/json": {
20221
+ "schema": {
20222
+ "$ref": "#/components/schemas/PostStoreModulesKeyVersionsVersionReassessRequest"
20223
+ }
20224
+ }
20225
+ },
20226
+ "x-validated": true
20227
+ },
20228
+ "responses": {
20229
+ "200": {
20230
+ "description": "Success.",
20231
+ "content": {
20232
+ "application/json": {
20233
+ "schema": {
20234
+ "$ref": "#/components/schemas/PostStoreModulesKeyVersionsVersionReassessResponse"
20235
+ }
20236
+ }
20237
+ }
20238
+ },
20239
+ "400": {
20240
+ "$ref": "#/components/responses/ValidationFailed"
20241
+ },
20242
+ "401": {
20243
+ "$ref": "#/components/responses/Unauthorized"
20244
+ },
20245
+ "403": {
20246
+ "$ref": "#/components/responses/Forbidden"
20247
+ },
20248
+ "404": {
20249
+ "$ref": "#/components/responses/NotFound"
20250
+ }
20251
+ },
20252
+ "security": [
20253
+ {
20254
+ "builderSession": []
20255
+ }
20256
+ ]
20257
+ }
20258
+ },
20135
20259
  "/store/modules/{key}/versions/{version}/tarball": {
20136
20260
  "get": {
20137
20261
  "operationId": "get_store_modules_key_versions_version_tarball",
@@ -29208,6 +29332,33 @@
29208
29332
  ],
29209
29333
  "additionalProperties": false
29210
29334
  },
29335
+ "PostProvisioningPhysicsCheckRequest": {
29336
+ "type": "object",
29337
+ "properties": {
29338
+ "description": {
29339
+ "type": "string"
29340
+ },
29341
+ "detail": {
29342
+ "type": "object"
29343
+ }
29344
+ },
29345
+ "additionalProperties": false
29346
+ },
29347
+ "PostProvisioningPhysicsCheckResponse": {
29348
+ "type": "object",
29349
+ "properties": {
29350
+ "stop": {
29351
+ "type": "boolean"
29352
+ },
29353
+ "message": {},
29354
+ "soft_limits": {}
29355
+ },
29356
+ "required": [
29357
+ "stop",
29358
+ "message",
29359
+ "soft_limits"
29360
+ ]
29361
+ },
29211
29362
  "PostProvisioningRenderLookupRequest": {
29212
29363
  "type": "object",
29213
29364
  "properties": {
@@ -30083,6 +30234,37 @@
30083
30234
  "version"
30084
30235
  ]
30085
30236
  },
30237
+ "PostStoreModulesKeyVersionsVersionReassessRequest": {
30238
+ "type": "object",
30239
+ "properties": {
30240
+ "reason": {
30241
+ "type": "string",
30242
+ "maxLength": 2000
30243
+ }
30244
+ },
30245
+ "additionalProperties": false
30246
+ },
30247
+ "PostStoreModulesKeyVersionsVersionReassessResponse": {
30248
+ "type": "object",
30249
+ "properties": {
30250
+ "ok": {
30251
+ "type": "boolean"
30252
+ },
30253
+ "queued": {
30254
+ "type": "boolean"
30255
+ },
30256
+ "module_key": {},
30257
+ "version": {},
30258
+ "version_id": {}
30259
+ },
30260
+ "required": [
30261
+ "ok",
30262
+ "queued",
30263
+ "module_key",
30264
+ "version",
30265
+ "version_id"
30266
+ ]
30267
+ },
30086
30268
  "PostTaskRecommendationsRequest": {
30087
30269
  "type": "object",
30088
30270
  "properties": {
@@ -31044,9 +31226,9 @@
31044
31226
  "description": "A required dependency/feature is not configured or is temporarily down."
31045
31227
  }
31046
31228
  },
31047
- "x-endpoint-count": 486,
31048
- "x-schema-count": 514,
31229
+ "x-endpoint-count": 488,
31230
+ "x-schema-count": 518,
31049
31231
  "x-undocumented-bodies": 12,
31050
- "x-response-schemas": 344,
31232
+ "x-response-schemas": 346,
31051
31233
  "x-generated-by": "scripts/gds/gen-api-docs.js"
31052
31234
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Bongos API reference
4
4
 
5
- > **Generated from the live route files** — the route file is authoritative. 486 endpoints across 89 route files.
5
+ > **Generated from the live route files** — the route file is authoritative. 488 endpoints across 89 route files.
6
6
  > Machine-readable spec: [`docs/api/openapi.json`](api/openapi.json) (OpenAPI 3.1). Rendered docs site: **`/docs`** (e.g. `cloudbongos.com/docs`).
7
7
 
8
8
  Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust-boundary-server-enforced-permissions.md)): `public` < `any-builder` < `metic+archon` < `archon`.
@@ -588,7 +588,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
588
588
  | GET | `/api/bongos/projects/featured` | `public` | — | the public map of projects; no auth by design. |
589
589
  | POST | `/api/bongos/projects/invite` | `metic+archon` | `client_id`, `github_login` | own-or-metic in effect: where to invite a builder into a project, asked by a `project.curate` holder OR the project's OWN OWNER (task 100… |
590
590
 
591
- ## `provisioning` (41)
591
+ ## `provisioning` (42)
592
592
 
593
593
  | Method | Path | Rank | Body | Description |
594
594
  |---|---|---|---|---|
@@ -628,6 +628,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
628
628
  | POST | `/api/bongos/provisioning/instances/:id/update-channel` | `archon` | — | POST /provisioning/instances/:id/update-channel — set the project's update rule (task 1004445). |
629
629
  | GET | `/api/bongos/provisioning/logos/:file` | `public` | — | a logo is shown on a public hall, and its address is its own sha256, so it names no project and cannot be guessed. |
630
630
  | GET | `/api/bongos/provisioning/onboard-plan` | `public` | — | GET /provisioning/onboard-plan?mode=greenfield\|adopt&domain=<host> — the CANONICAL onboarding step sequence (task 2085; goal 35 / criteri… |
631
+ | POST | `/api/bongos/provisioning/physics-check` | `any-builder` | `description`, `detail` | POST /provisioning/physics-check — the planet-physics questions' read BEFORE anything exists (task 1004418, BV2.PS07). |
631
632
  | GET | `/api/bongos/provisioning/recommendations` | `public` | — | GET /provisioning/recommendations?type=<project type>&team_shape=<interview answer> — the RULE-BASED recommendation for one set of creati… |
632
633
  | POST | `/api/bongos/provisioning/render/lookup` | `any-builder` | `key`, `owner_id` | POST /provisioning/render/lookup — rank: any authenticated builder. |
633
634
  | GET | `/api/bongos/provisioning/slug-available` | `any-builder` | — | GET /provisioning/slug-available?slug=<handle> — is this handle free to create under? rank: any authenticated builder (same gate as the c… |
@@ -769,7 +770,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
769
770
  | GET | `/api/bongos/sso/pubkey` | `public` | — | GET /sso/pubkey — the hub's Ed25519 assertion-verification key (public). |
770
771
  | POST | `/api/bongos/sso/token` | `public` | `client_id`, `client_secret`, `code`, `redirect_uri` | POST /sso/token — server-to-server code redemption. |
771
772
 
772
- ## `store` (8)
773
+ ## `store` (9)
773
774
 
774
775
  | Method | Path | Rank | Body | Description |
775
776
  |---|---|---|---|---|
@@ -779,6 +780,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
779
780
  | GET | `/api/bongos/store/modules/:key/entitlement` | `any-builder` | — | |
780
781
  | POST | `/api/bongos/store/modules/:key/versions` | `metic+archon` | _undocumented_ | POST /api/bongos/store/modules/:key/versions — publish one module version to the store (task 1004271, ADR 0338 D1). |
781
782
  | GET | `/api/bongos/store/modules/:key/versions/:version/howto` | `any-builder` | — | GET /api/bongos/store/modules/:key/versions/:version/howto — the how-to a version shipped with (task 1004366, ADR 0347 D1/D3), read from … |
783
+ | POST | `/api/bongos/store/modules/:key/versions/:version/reassess` | `metic+archon` | `reason` | POST /api/bongos/store/modules/:key/versions/:version/reassess — a Metic+ person asks for a published version's assessment to run again: … |
782
784
  | GET | `/api/bongos/store/modules/:key/versions/:version/tarball` | `any-builder` | — | |
783
785
  | GET | `/api/bongos/store/modules/latest` | `any-builder` | — | The newest published version of each named module — what `bongos upgrade` compares an instance's installed store modules against to repor… |
784
786
 
@@ -273,7 +273,7 @@ module_assessment_scores(id, version_id, kind IN (computed|override), overall 0-
273
273
  -- and is a new row on the computed history, never an edit (D6)
274
274
  ```
275
275
 
276
- Signals that fill it: **Tests** — `scripts/gds/module-assess-tests.js <version id>` (task 1003791) unpacks the published tarball to `<core root>/.module-assess-<run>/<key>/` (gitignored, removed after), runs each `tests/*.mjs` in its own node process with a timeout and a credential-free environment — regardless of `isModuleEnabled`, which skips every default-off catalog module in the unit gate — and appends one `tests` row: `scored` = % of test files passing (sample_size = files), `no_data` = declares no tests, `not_scored` = tarball unreadable. The store path **refuses unless `MODULE_TEST_SANDBOX=1`** — a published module's tests run only in a separate testing environment with no secrets on disk, never on the control plane (owner, 2026-09-30). `--dir modules/<key>` is a DB-free dry run on your own checkout. On publish the version's Tests part is recorded `pending` until that environment runs it. **Security** — `scripts/gds/module-assess-security.js <version id>` (task 1003792, ADR 0343 D2 gate) appends one `security` row, `passed`/`failed` only: fails on a publish-denylist file, a `module.json` dependency fetched outside the registry (an allowlist: a plain npm name with a plain semver range or dist-tag, anything else fails and is never handed to npm), or a high/critical `npm audit` advisory (resolved metadata-only with `--ignore-scripts`; nothing of the module runs, so it is control-plane safe). An audit that cannot run is `not_scored` — the gate stays shut. Floating ranges and the `maintenance` posture (ADR 0166) are noted in `detail`, never failed on. **Docs** — `scripts/gds/module-assess-docs.js <version id>` (task 1004367, ADR 0347 D5/D6) grades the version's `HOWTO.md`, read from its verified tarball (never the optional `howto.artifactUrl`), with one Claude Sonnet 5 call through the `grade` port's cached `runSubagent` (no tools, the file fenced as untrusted, cut to 40,000 characters to stay under 5¢), retried once. It appends a `pending` row, then `scored` (the average of four 0–100 criteria — purpose, newcomer could use it, runnable example, limits stated — each with a reason, kept in `detail`) or `not_scored` (outage, malformed reply twice, no `HOWTO.md`, bad tarball). Each call's spend goes to `cost_log` via the `reward` port (source `module-docs-grader`). Price is never in the prompt. `--file <HOWTO.md>` is a DB-free dry run. **Score** — `scripts/gds/module-assess-score.js` (task 1003794) composes a version's newest signal per part into a `module_assessment_scores` row: `security_passed` from the gate (NULL = not run), `overall` = the plain average of the SCORED parts among Tests, Install, Reliability and Tester feedback (a part with no data is left out, never zero; none → NULL), Docs shown but never averaged, `is_new` until Install or Reliability is scored, plus the signal ids and a readable `formula`. A recompose that would repeat the current score writes nothing. All three signal CLIs recompose after recording, and the store's publish route queues `assessVersion` after answering the author (one at a time per process, at most 20 waiting; past that it is logged as not assessed): Tests `pending` (only if no Tests result exists), the Security gate, Docs, then the score. `node scripts/gds/module-assess-version.js <id>` re-runs it by hand (`scripts/gds/module-assess-version.js` holds the publish-time half, apart from the composer so the signal CLIs recompose without a require cycle).
276
+ Signals that fill it: **Tests** — `scripts/gds/module-assess-tests.js <version id>` (task 1003791) unpacks the published tarball to `<core root>/.module-assess-<run>/<key>/` (gitignored, removed after), runs each `tests/*.mjs` in its own node process with a timeout and a credential-free environment — regardless of `isModuleEnabled`, which skips every default-off catalog module in the unit gate — and appends one `tests` row: `scored` = % of test files passing (sample_size = files), `no_data` = declares no tests, `not_scored` = tarball unreadable. The store path **refuses unless `MODULE_TEST_SANDBOX=1`** — a published module's tests run only in a separate testing environment with no secrets on disk, never on the control plane (owner, 2026-09-30). `--dir modules/<key>` is a DB-free dry run on your own checkout. On publish the version's Tests part is recorded `pending` until that environment runs it. **Security** — `scripts/gds/module-assess-security.js <version id>` (task 1003792, ADR 0343 D2 gate) appends one `security` row, `passed`/`failed` only: fails on a publish-denylist file, a `module.json` dependency fetched outside the registry (an allowlist: a plain npm name with a plain semver range or dist-tag, anything else fails and is never handed to npm), or a high/critical `npm audit` advisory (resolved metadata-only with `--ignore-scripts`; nothing of the module runs, so it is control-plane safe). An audit that cannot run is `not_scored` — the gate stays shut. Floating ranges and the `maintenance` posture (ADR 0166) are noted in `detail`, never failed on. **Docs** — `scripts/gds/module-assess-docs.js <version id>` (task 1004367, ADR 0347 D5/D6) grades the version's `HOWTO.md`, read from its verified tarball (never the optional `howto.artifactUrl`), with one Claude Sonnet 5 call through the `grade` port's cached `runSubagent` (no tools, the file fenced as untrusted, cut to 40,000 characters to stay under 5¢), retried once. It appends a `pending` row, then `scored` (the average of four 0–100 criteria — purpose, newcomer could use it, runnable example, limits stated — each with a reason, kept in `detail`) or `not_scored` (outage, malformed reply twice, no `HOWTO.md`, bad tarball). Each call's spend goes to `cost_log` via the `reward` port (source `module-docs-grader`). Price is never in the prompt. `--file <HOWTO.md>` is a DB-free dry run. **Score** — `scripts/gds/module-assess-score.js` (task 1003794) composes a version's newest signal per part into a `module_assessment_scores` row: `security_passed` from the gate (NULL = not run), `overall` = the plain average of the SCORED parts among Tests, Install, Reliability and Tester feedback (a part with no data is left out, never zero; none → NULL), Docs shown but never averaged, `is_new` until Install or Reliability is scored, plus the signal ids and a readable `formula`. A recompose that would repeat the current score writes nothing. All three signal CLIs recompose after recording, and the store's publish route queues `assessVersion` after answering the author (one at a time per process, at most 20 waiting; past that it is logged as not assessed): Tests `pending` (only if no Tests result exists), the Security gate, Docs, then the score. `node scripts/gds/module-assess-version.js <id>` re-runs it by hand (`scripts/gds/module-assess-version.js` holds the publish-time half, apart from the composer so the signal CLIs recompose without a require cycle). **No score is ever set by hand** (owner, ADR 0359): a Metic+ person can only ask for a re-check, `POST /store/modules/:key/versions/:version/reassess { reason }` (atom `module.assessment.rerun`, metic + archon via `government_021`), which queues the same `assessVersion` a publish runs and answers 202.
277
277
 
278
278
  Code: `src/bongos/module-entitlements.js` (`grantEntitlement`, `recordAcquired`, `revokeEntitlement`, `checkEntitlement`, `listEntitlements`). Read routes (own-scoped, `requireBuilder`): `GET /store/entitlements`, `GET /store/modules/:key/entitlement`. Install (task 1003785) grants a free module through `POST /store/modules/:key/acquire`; the buy action (area 8) will grant a paid one.
279
279