@bongos/core 1.17.0 → 1.17.1

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 (90) hide show
  1. package/.bongos-core.json +154 -83
  2. package/CLAUDE.md +11 -238
  3. package/bin/bongos.js +1 -0
  4. package/clients/bongos-client/README.md +4 -4
  5. package/clients/bongos-client/bongos-client.global.js +14 -1
  6. package/clients/bongos-client/index.cjs +14 -1
  7. package/clients/bongos-client/index.d.ts +19 -2
  8. package/clients/bongos-client/index.mjs +11 -1
  9. package/clients/bongos-client/package.json +1 -1
  10. package/docs/adr/0133-github-app-manifest-onboarding-signin.md +2 -0
  11. package/docs/adr/0134-private-first-npm-distribution.md +20 -6
  12. package/docs/adr/0135-module-upstream-submission-interim-queue.md +34 -0
  13. package/docs/adr/README.md +5 -4
  14. package/docs/api/openapi.json +315 -6
  15. package/docs/api-reference.md +10 -5
  16. package/docs/architecture.md +1 -1
  17. package/docs/file-map.md +2 -2
  18. package/docs/modules-contract.md +2 -0
  19. package/docs/recipes/instance-deploy.md +4 -4
  20. package/docs/recipes/instance-first-run.md +51 -0
  21. package/docs/recipes/packaging-the-core.md +5 -5
  22. package/docs/recipes/private-npm-distribution.md +22 -12
  23. package/docs/recipes/self-host.md +1 -1
  24. package/docs/recipes/upgrading-the-core.md +8 -8
  25. package/migrations/core_191_module_submissions.sql +45 -0
  26. package/modules/autonomy/CLAUDE.md +11 -45
  27. package/modules/builder-settings/CLAUDE.md +11 -54
  28. package/modules/dev-box/CLAUDE.md +11 -34
  29. package/modules/discord/CLAUDE.md +11 -46
  30. package/modules/economy/CLAUDE.md +11 -44
  31. package/modules/grading/CLAUDE.md +11 -38
  32. package/modules/hall-ui/CLAUDE.md +11 -57
  33. package/modules/hall-ui/public/goals-page.js +227 -22
  34. package/modules/hall-ui/public/goals.html +16 -0
  35. package/modules/hall-ui/public/new-project-wizard.js +5 -4
  36. package/modules/ideas/CLAUDE.md +11 -33
  37. package/modules/lifecycle/CLAUDE.md +11 -59
  38. package/modules/lifecycle/routes/goals.js +80 -0
  39. package/modules/memory/CLAUDE.md +11 -36
  40. package/modules/onboarding/CLAUDE.md +11 -51
  41. package/modules/security/CLAUDE.md +11 -40
  42. package/modules/sessions/CLAUDE.md +11 -35
  43. package/modules/status-ui/CLAUDE.md +11 -43
  44. package/package-lock.json +2 -2
  45. package/package.json +1 -1
  46. package/public-landing/create.html +58 -12
  47. package/public-landing/index.html +40 -21
  48. package/scripts/gds/CLAUDE.md +11 -140
  49. package/scripts/gds/claude-materialize.js +151 -18
  50. package/scripts/gds/claude-md-template.js +84 -0
  51. package/scripts/gds/cli-lib.js +112 -2
  52. package/scripts/gds/gen-api-client.js +10 -10
  53. package/scripts/gds/init.js +53 -13
  54. package/scripts/gds/migration-namespace.js +1 -1
  55. package/scripts/gds/module.js +118 -4
  56. package/scripts/gds/npmrc.js +93 -0
  57. package/scripts/gds/onboard.js +13 -24
  58. package/scripts/gds/package-core.js +56 -14
  59. package/scripts/gds/provision.js +102 -17
  60. package/scripts/gds/seed-adopt-tasks.js +1 -1
  61. package/scripts/gds/status.js +6 -1
  62. package/scripts/gds/task.js +166 -0
  63. package/scripts/gds/upgrade.js +58 -18
  64. package/src/bongos/CLAUDE.md +11 -60
  65. package/src/bongos/auth.js +11 -0
  66. package/src/bongos/module-submissions.js +56 -0
  67. package/src/bongos/route-rank-check.js +6 -0
  68. package/src/bongos/routes/CLAUDE.md +11 -39
  69. package/src/bongos/routes/auth.js +6 -1
  70. package/src/bongos/routes/modules.js +123 -21
  71. package/src/instance-config.js +1 -1
  72. package/src/module-api.js +13 -1
  73. package/tests/claude_materialize.mjs +105 -0
  74. package/tests/device_flow_start.mjs +73 -0
  75. package/tests/first_run_engine_check.mjs +79 -0
  76. package/tests/goal_membership_requests.mjs +33 -3
  77. package/tests/hook_user_agents.mjs +62 -0
  78. package/tests/init.mjs +59 -6
  79. package/tests/instance_mismatch_guard.mjs +101 -0
  80. package/tests/module_cli.mjs +130 -2
  81. package/tests/module_submissions.mjs +135 -0
  82. package/tests/npmrc.mjs +105 -0
  83. package/tests/onboard.mjs +49 -0
  84. package/tests/package_core.mjs +68 -22
  85. package/tests/platform_boot.mjs +5 -2
  86. package/tests/provision.mjs +107 -8
  87. package/tests/provisioning_github_app_routes.mjs +29 -2
  88. package/tests/served_paths_shipped.mjs +2 -2
  89. package/tests/task_cli.mjs +99 -0
  90. package/tests/upgrade.mjs +89 -25
@@ -1,63 +1,15 @@
1
- # `lifecycle` module — the build state machine + the `lifecycle` kernel port
1
+ # @bongos/core — installed platform dependency (not your project's CLAUDE.md)
2
2
 
3
- > The **LAST and most-coupled CORE-domain** carved into a module (BV1.R86, [ADR 0093](../../docs/adr/<redacted>.md) §1,§3) — after memory (R72), grading (R73), economy (R77), ideas (R78), security (R79), builder-settings (R80), onboarding (R81), sessions (R82), autonomy (R83), status-UI (R84), hall-UI (R85). Carved last on purpose: by now every capability it INVOKES (`grade`, `reward`, `onboarding`) is a kernel port it resolves, so the lifecycle imports only the kernel + resolves those ports ([02-module-map §4](../../docs/design/modular-architecture/02-module-map.md): keep the state machine WHOLE, never split). `default: true` — every instance runs the lifecycle. This carve makes the `db.js` residue exactly what ADR 0093 §3 predicted: the kernel identity/auth/twin slice + `db-kernel.js`.
3
+ This file is a placeholder shipped inside the **@bongos/core** package. The core's own
4
+ internal agent notes are intentionally omitted from the published artifact so they cannot
5
+ load into your instance's context.
4
6
 
5
- Owns the **build state machine**: tasks · claims · versions · done-when criteria · goals · dependencies · the claim→ship→grade→credit lifecycle · override requests · the ship/confirm/promote orchestration · `github-push` (server-mediated branch publish) · `merge-lock` · `conflict-resolve` · the `publish-reconciler` (confirmed→shipped auto-heal) · `ship-card`/`ship-preflight` · `version-close` · the peer-vote→karma fold-in · the work-tracking analytics (est-drift, grade trend, AI-dev curve).
7
+ **It does not govern this repository.** Your own root `CLAUDE.md`, your `.claude/`
8
+ directory, and the live Bongos database are the source of truth for how work happens here
9
+ and who may do what.
6
10
 
7
- ## The boundary (the one rule)
11
+ You are seeing this only because an agent opened a file under `node_modules/@bongos/core/`.
12
+ Nothing in here needs to be read to use the platform — run `bongos help` for commands.
8
13
 
9
- This module reaches core **only** through the published doorway [`../../src/module-api.js`](../../src/module-api.js) (`coreVersion ^1.12.0` — it needs the R86 doorway additions: `repoInfo`, `moduleScopeMap`, `pathMatch`, `userAgent`, `asyncHandler`, `corsPublicGet`). It must **never** `require()` a core internal directly, and never another module. Core, in turn, must never `require()` a file in here — it reaches the lifecycle only through the `lifecycle` port (below). Both directions are enforced by the BV1.R44/R45 fitness checks.
10
-
11
- ## The `lifecycle` kernel PORT (ADR 0093 §3 — the headline of this carve)
12
-
13
- The inverse of every prior carve: the lifecycle is carved last, so every capability it *invokes* (`grade`/`reward`/`onboarding`) is already a port it RESOLVES; the `lifecycle` port is the surface **core and the other modules resolve to reach the build state machine** without importing this module.
14
-
15
- - **Provides — port `lifecycle`** → the surface in [`lifecycle.js`](lifecycle.js) (DELEGATES, does not spread, to `./db` + `./task-classifier` so test stubs bite at call time — the economy `reward` precedent). Registered in [`routes/lifecycle.js`](routes/lifecycle.js)'s factory (the loader runs it at boot + on every test router rebuild; `hasProvider`-guarded). It **retires the three ADR-0091 §3 doorway leaks** — `createTask`, `VOTABLE_TASK_STATUSES`, `tallyPeerVotes` — plus exposes `classifyTaskKind` and the work-tracking READS the staying-core read routes need.
16
- - **Core + the other modules consume it WITHOUT importing this module** (all via `seams.resolveOptional('lifecycle')`):
17
- - `src/bongos/routes/public.js` (the status surface) — `getTask`/`listVersions`/`versionProgress`/`recentShippedTasks`/`estimationDriftSummary`/`rollingAvgGrade`/`gradeTrendByDay`.
18
- - `src/bongos/routes/me.js` (the profile reader) — `<redacted>`/`getEstVsActualRatio`/`recentGradesForBuilder`/`<redacted>`/`<redacted>`.
19
- - `src/bongos/routes/builders.js` (the Archon roster) — `getBuildersRoster`/`<redacted>`/`gradeByBuilder`/`<redacted>`.
20
- - `src/bongos/cascade-dispatch.js` (dormant System 3) — `classifyTaskKind`.
21
- - `modules/onboarding/db.js` (newcomer-restock) + `modules/discord/db.js` (#bugs→task) — `createTask`.
22
- - `modules/discord/discord-reaction.js` — `VOTABLE_TASK_STATUSES`.
23
- - `modules/autonomy/pollers/routine-timers.js` — `tallyPeerVotes`.
24
- - **It RESOLVES (as a transaction-participant consumer)** the `reward` + `onboarding` ports inside its own `withTx` — `claimTask`/`confirmTask`/`decideOverrideRequest`/`applyGrade` open the tx, run the state-machine SQL, and call `seams.resolveOptional('reward')|('onboarding').*(client, …)` so the credit/achievement/stage writes commit atomically with the status flip (ADR 0093 §2). It resolves via `resolveOptional` (graceful), so `consumes: []` — a vanilla instance without economy/onboarding degrades those writes to best-effort no-ops, it does not fail.
25
-
26
- ## Files
27
-
28
- | File | What |
29
- |---|---|
30
- | `db.js` | the lifecycle data layer — ~97 functions: tasks/claims/versions/goals/dependencies/criteria, the claim→ship→grade→credit lifecycle (`claimTask`/`resolveClaim`/`confirmTask`/`shipTask`/`applyGrade`/`abandonTask`), overrides, estimation + work analytics, the merge lease, `tallyPeerVotes`, `createTask`. Reaches the pool/withTx/seams via the doorway; resolves `reward`/`onboarding` as a consumer. |
31
- | `task-classifier.js` | the `tasks.kind`/discipline heuristic + `VOTABLE_TASK_STATUSES`/`VALID_KINDS`/`VALID_DISCIPLINES`/`TASK_FIELD_BOUNDS`. `branding()` (instance blocker-vendors) via the doorway. |
32
- | `done-when.js` · `hierarchy.js` · `version-close.js` | the done-when criterion read/write surface, the shallow one-level task hierarchy, and the version-close gate evaluator. Pool via the doorway. |
33
- | `github-push.js` · `conflict-resolve.js` · `publish-reconciler.js` | server-mediated branch publish ([ADR 0055](../../docs/adr/<redacted>.md)) + the [ADR 0082](../../docs/adr/<redacted>.md) generated-file conflict resolver + the confirmed→shipped reconciler. `repoInfo`/`branding`/`userAgent` via the doorway; siblings require each other. |
34
- | `ship-card.js` · `ship-preflight.js` · `merge-lock.js` | the CLI lifecycle card, the ship preflight guards, and the cross-machine merge lease serializer (pure; `branding` via the doorway). |
35
- | `lifecycle.js` | the `lifecycle` port provider surface (delegates to `./db` + `./task-classifier`). |
36
- | `routes/{tasks,claims,versions,done-when,goals,dependencies,gate-approvals,analytics}.js` | the lifecycle HTTP surface — moved out of `src/bongos/routes/`; the loader mounts them via `contributes.routes`. Auth/validators/seams via the doorway; `./db` + libs are siblings. |
37
- | `routes/lifecycle.js` | the route factory that registers the `lifecycle` port (no HTTP endpoint). |
38
- | `pollers/publish-reconciler.js` | the loader poller entry (`start`/`stop`) for the publish reconciler — inverts the old `server.js` hardcoded start (the autonomy routine-timers precedent). |
39
-
40
- ## Boundary-forced duplication (keep in sync)
41
-
42
- Two helpers are **deliberately duplicated** with core `src/bongos/db.js` (ADR 0091 §2 — "boundary-forced duplication is allowed + documented"): the same SQL runs on both sides of the kernel↔module line, and a module can't import core:
43
-
44
- - **`sealSessionLog`** — core `deactivateBuilder` (rank/identity management, stays core) writes the same `session_logs` close row; here `resolveClaim`/`shipTask` write it.
45
- - **`_applyRankChangeTx` (+ its `RANKS` / `singleRungPromotionError` deps)** — core `setBuilderRank` (Archon-driven, stays core) runs the same in-tx rank change; here it backs the automatic xenos→thetes graduation on ship (`maybeAutoGraduateToThetes`).
46
- - **the `gradePassCount` SQL fragment** — core `builderRollingAvgGrade` (the grade-trend read the sessions BFG also consumes, kept on the doorway) + the module's grade reads share it.
47
-
48
- ## NOT in this module (the db.js residue — stays core)
49
-
50
- - **Builder IDENTITY + admission** (`upsertBuilder`/`getBuilderByGithubId`/`hasInvitedAccessRequest`/`linkAnthropicAccount`/`updateBuilderDisciplines`) — `auth.js` imports these; they CANNOT live in a module.
51
- - **Rank + status MANAGEMENT** (`setBuilderRank`/`_applyRankChangeTx`/`<redacted>`/`deactivate`/`reactivateBuilder`) — Archon identity ops consumed by `routes/builders.js`, NOT the task lifecycle.
52
- - **AUTH sessions** (`createSession`/`lookupSession`/`revoke*`/`hasCliSession`/`SESSION_TTL_MS`) — the `builder_sessions` token store `auth.js` drives.
53
- - **TWIN / social** (Discord link flow, karma feed, `listAuditLog`, the grade-trend `builderRollingAvgGrade`) + the **security_docs** store (the kernel security-PROPERTY plane).
54
- - **The Gemini-key leak** (`getBuilderGeminiKeyRow`/…) — art-pipeline credential infra.
55
- - **The lifecycle CLIs** — a command travels with its domain but stays a CLI under `scripts/gds/` (`ship.js`/`claim.js`/`release.js`/`merge-mode.js`/`confirm.js`/`merge-lock.js`/`version-close.js`/`main-audit.js`/`gate-review.js`/`push-main.js`/`ci-grade.js`), outside the kernel boundary — they may require this module directly (the grading/economy precedent).
56
-
57
- ## Tables
58
-
59
- None owned. `tasks`/`claims`/`versions`/`goals`/`done_when_criteria`/`dependencies`/`task_grades`/`task_override_requests`/`merge_leases` (+ their migrations) were created before the module system and stay in core `migrations/` (the shared-schema additive rule). The module owns the *queries*; any **new** lifecycle migration belongs in `modules/lifecycle/migrations/` namespaced `lifecycle_*`.
60
-
61
- ## Tests
62
-
63
- The DB-free carved-surface tests in `scripts/gds/coreB-carve-proof.sh` (`task_classifier_vocab`, `criterion_progress`, `github_push_*`, `ship_card`, `ship_preflight`, `merge_lock`, `conflict_resolve`, `publish_reconciler`, `goal_achievement`, `context_pack`) import from `modules/lifecycle/…` and pass byte-identical. The DB-integration tests (`grade_attempts`, `rank_gate`, `abandon_task`, `confirm_attribution`/`override_attribution`/`grade_attribution`, `goal_routes`/`goal_tier`/`goal_achievement`, `dependencies_*`, `task_create_idempotency`, `worktree_disambiguation`, `cap_newcomer_tasks`, `migration_allocation`, `task_ownership_gate`, `verify_task_guard`, `versions_route`, `gate_approvals`, `merge_lease`, `autonomous_fit_protected_paths`, …) require/read `modules/lifecycle/{db,routes/*,libs}.js`; the route-consumer tests (`onboarding_route_signals`, `onboarding_observability`, `discord_reaction`) register the `lifecycle` port. See [ADR 0093](../../docs/adr/<redacted>.md).
14
+ _To work ON the platform core itself, use the standalone @bongos/core source repository,
15
+ not this vendored copy._
@@ -376,6 +376,32 @@ function authorizeJoinRequestResponse({ goal, actorId, actorRank, actorMembershi
376
376
  return { ok: true };
377
377
  }
378
378
 
379
+ // authorizeWithdrawJoinRequest — the gate for POST /goals/:id/requests/:reqId/withdraw
380
+ // (task 1953): ONLY the requester may withdraw their OWN pending join-request — a
381
+ // symmetric mirror of authorizeInvitationResponse (the invitee resolves their own
382
+ // invite; here the requester resolves their own request, self-served instead of
383
+ // waiting on an owner/manager deny). Ordering: request_not_found → wrong_goal →
384
+ // not_a_join_request → not_pending → not_your_request. PURE + exported.
385
+ function authorizeWithdrawJoinRequest({ request, goalId, actorId }) {
386
+ if (!request) return { ok: false, status: 404, body: { error: 'request_not_found' } };
387
+ if (String(request.goal_id) !== String(goalId)) {
388
+ return { ok: false, status: 404, body: { error: 'request_not_found', message: 'No such request on this goal.' } };
389
+ }
390
+ if (request.kind !== 'request') {
391
+ return { ok: false, status: 400, body: { error: 'not_a_join_request', message: 'That row is an invitation, not a join-request.' } };
392
+ }
393
+ if (request.status !== 'pending') {
394
+ return { ok: false, status: 409, body: { error: 'not_pending', status: request.status } };
395
+ }
396
+ if (String(request.builder_id) !== String(actorId)) {
397
+ return { ok: false, status: 403, body: {
398
+ error: 'not_your_request',
399
+ message: 'Only the requester may withdraw their own join-request.',
400
+ } };
401
+ }
402
+ return { ok: true };
403
+ }
404
+
379
405
  module.exports = function buildGoalsRouter() {
380
406
  const router = express.Router();
381
407
 
@@ -798,6 +824,57 @@ module.exports = function buildGoalsRouter() {
798
824
  }
799
825
  });
800
826
 
827
+ // GET /goals/:id/requests — the goal's own pending invite/join-request queue
828
+ // (task 1953): every pending row on THIS goal, both kinds — outstanding invites
829
+ // the goal has sent (awaiting the invitee) and join-requests awaiting approval.
830
+ // db.listPendingRequestsForGoal was built for this route in task 1952's landing
831
+ // but never wired to HTTP; this is the goals-page manager view alongside the
832
+ // cross-goal GET /goals/inbox.
833
+ // rank: any-builder (requireBuilder) + the in-handler owner|manager|Archon gate
834
+ // (authorizeGoalManagement) — same wall as visibility/invite/request-respond.
835
+ router.get('/goals/:id/requests', auth.requireBuilder, async (req, res) => {
836
+ const id = parseId(req, res, { code: 'bad_goal_id' });
837
+ if (id === null) return;
838
+ try {
839
+ const goal = await db.getGoal(id);
840
+ const actorMembership = goal
841
+ ? await db.getGoalMember({ goalId: id, builderId: req.builder.id })
842
+ : null;
843
+ const decision = authorizeGoalManagement({
844
+ goal, actorId: req.builder.id, actorRank: req.builder.rank, actorMembership,
845
+ });
846
+ if (!decision.ok) return res.status(decision.status).json(decision.body);
847
+ const requests = await db.listPendingRequestsForGoal(id);
848
+ return res.json({ requests });
849
+ } catch (err) {
850
+ console.error('[gds] GET /goals/:id/requests', err);
851
+ return res.fail('fetch_failed', { status: 500, message: 'internal error' });
852
+ }
853
+ });
854
+
855
+ // POST /goals/:id/requests/:reqId/withdraw — the requester cancels their OWN
856
+ // pending join-request (task 1953): the symmetric self-served mirror of a
857
+ // manager's deny. Sets status='cancelled' (kept as the audit trail, like a
858
+ // deny's 'rejected'); never touches an invitation row.
859
+ // rank: any-builder (requireBuilder) + the in-handler authorizeWithdrawJoinRequest.
860
+ router.post('/goals/:id/requests/:reqId/withdraw', auth.requireBuilder, async (req, res) => {
861
+ const id = parseId(req, res, { code: 'bad_goal_id' });
862
+ if (id === null) return;
863
+ const reqId = parseId(req, res, { param: 'reqId', code: 'bad_request_id', positiveInt: true });
864
+ if (reqId === null) return;
865
+ try {
866
+ const request = await db.getMembershipRequest(reqId);
867
+ const decision = authorizeWithdrawJoinRequest({ request, goalId: id, actorId: req.builder.id });
868
+ if (!decision.ok) return res.status(decision.status).json(decision.body);
869
+ const resolved = await db.resolveMembershipRequest({ id: reqId, status: 'cancelled', resolvedBy: req.builder.id });
870
+ if (!resolved) return res.fail('not_pending', { status: 409, message: 'The request changed underneath this withdrawal — re-read and retry.' });
871
+ return res.json({ ok: true, request: resolved });
872
+ } catch (err) {
873
+ console.error('[gds] POST /goals/:id/requests/:reqId/withdraw', err);
874
+ return res.fail('withdraw_failed', { status: 500, message: 'internal error' });
875
+ }
876
+ });
877
+
801
878
  // POST /goals/:id/members — the goal's own authority (owner | manager | Archon)
802
879
  // invites a builder to the goal (task 1762: widened from Archon-only so a
803
880
  // manager doesn't need an Archon in the loop for a normal goal). This stays the
@@ -1417,3 +1494,6 @@ module.exports.protectedScopeAdmissionBlock = protectedScopeAdmissionBlock;
1417
1494
  module.exports.authorizeCreateJoinRequest = authorizeCreateJoinRequest;
1418
1495
  module.exports.authorizeInvitationResponse = authorizeInvitationResponse;
1419
1496
  module.exports.authorizeJoinRequestResponse = authorizeJoinRequestResponse;
1497
+ // task 1953: the withdraw gate — exported for tests/goal_membership_requests.mjs,
1498
+ // same precedent as its siblings above.
1499
+ module.exports.authorizeWithdrawJoinRequest = authorizeWithdrawJoinRequest;
@@ -1,40 +1,15 @@
1
- # `memory` module — builder memory, recall/search, learnings
1
+ # @bongos/core — installed platform dependency (not your project's CLAUDE.md)
2
2
 
3
- > The **first CORE-domain** carved into a module (BV1.R72, [ADR 0091](../../docs/adr/<redacted>.md) §2) — not an optional feature like dev-box/discord/art/game, but a core methodology domain extracted to prove the kernel↔core-domain boundary. It is the reference every later core-domain carve (grading R73, …) copies.
3
+ This file is a placeholder shipped inside the **@bongos/core** package. The core's own
4
+ internal agent notes are intentionally omitted from the published artifact so they cannot
5
+ load into your instance's context.
4
6
 
5
- Owns per-builder session **memory** (the BFG-scoped store the hall syncs), the lexical **recall/search** retrieval layer ([ADR 0060](../../docs/adr/0060-gds-retrieval-layer.md): Postgres FTS + trigram/RRF), and durable **learnings**. `default: true` in `module.json` — the build system's memory ships to **every** instance (unlike the default-off feature modules), so it mounts unconditionally unless an instance explicitly disables it.
7
+ **It does not govern this repository.** Your own root `CLAUDE.md`, your `.claude/`
8
+ directory, and the live Bongos database are the source of truth for how work happens here
9
+ and who may do what.
6
10
 
7
- ## The boundary (the one rule)
11
+ You are seeing this only because an agent opened a file under `node_modules/@bongos/core/`.
12
+ Nothing in here needs to be read to use the platform — run `bongos help` for commands.
8
13
 
9
- This module reaches core **only** through the published doorway `../../src/module-api.js` (`coreVersion ^1.5.0`). It must **never** `require()` a core internal (`../../src/bongos/db`, `../../src/bongos/auth`, `../../src/bongos/pool`, …) directly, and never another module. Core, in turn, must never `require()` a file in here — the route mounts left `src/bongos/routes.js`; `moduleLoader.mountModuleRoutes` discovers + mounts them now. Both directions are enforced by the BV1.R44/R45 fitness checks; R70's `kernel-imports-no-domain` check additionally keeps the kernel from reaching back in.
10
-
11
- ## Files
12
-
13
- | File | What |
14
- |---|---|
15
- | `memory.js` | per-builder memory store (quotas, BFG namespace, store/fetch/list). Manages its own transactions via the doorway `pool`. |
16
- | `search.js` | the recall query engine — FTS + trigram, RRF fusion, rank-scoped (ADR 0060). |
17
- | `search-chunker.js` | pure markdown→chunk splitter (no DB). Also used by the `search-ingest-*` CLIs (memory-owned scripts). |
18
- | `learnings.js` | durable paid-once knowledge capture (the `learnings` table). |
19
- | `routes/memory.js` | `/memory/*` — sync/read/forensic. Carries its own larger `express.json` for `/memory/sync` (1 MB batches); core `routes.js` still skips the global parser for that path. |
20
- | `routes/search.js` | `/search` (recall) + `/search/mark` (the ADR 0095 C3 usefulness vote — `POST {chunk_id, useful?}`, session-scoped). |
21
- | `routes/learnings.js` | `/learnings` (POST capture + GET). |
22
-
23
- All four lib files reach Postgres through the doorway `pool`; the routes reach auth gates + the kernel db helpers (`getBuilderById`, `insertAuditLog`) + the shared request validators (`validateOrRespond`/`LIMITS`) off the doorway `api`, and the lib files via intra-module relative requires.
24
-
25
- ## Tables (owned, not moved)
26
-
27
- `builder_memory`, `memory_search_chunks`, `learnings` (+ their migrations) were created before the module system and stay in core `migrations/` (the schema-migrations stem-key makes a later relocation a no-op). The module owns the *queries*; any **new** memory migration belongs in `modules/memory/migrations/` namespaced `memory_*` (the additive rule).
28
-
29
- ## Seams
30
-
31
- None yet — memory neither provides nor consumes a port/event. Core reads memory only through its HTTP routes (the hall's sync/recall), never a direct import.
32
-
33
- ## NOT in this module
34
-
35
- - **`bfg.js`** — the BFG memory-hygiene evaluator stays core (it scores memory quality across builders); it touches memory through the routes/store contract, not a sibling import.
36
- - **`migrations/`** — the memory tables' creating migrations stay in core `migrations/` (pre-module-system; see Tables above).
37
-
38
- ## Tests
39
-
40
- `tests/memory_isolation.mjs`, `tests/bfg*.mjs`, `tests/search_*.mjs`, `tests/search_chunker.mjs`, `tests/diff_derived_signals.mjs`, `tests/recall_*.mjs` import from `modules/memory/…`. The ADR 0095 C3 mark/rank loop's DB-backed cases live in the `tests/search_isolation.mjs` Layer C class (integration gate); the pure ranker-factor + scope logic is exercised by the in-module assertions in `markChunkUsefulness`.
14
+ _To work ON the platform core itself, use the standalone @bongos/core source repository,
15
+ not this vendored copy._
@@ -1,55 +1,15 @@
1
- # `onboarding` module — admission · onboarding state machine · newcomer floor + the `onboarding` kernel port
1
+ # @bongos/core — installed platform dependency (not your project's CLAUDE.md)
2
2
 
3
- > The **seventh CORE-domain** carved into a module (BV1.R81, [ADR 0093](../../docs/adr/<redacted>.md) §1) — after memory (R72), grading (R73), economy (R77), ideas (R78), security (R79), and builder-settings (R80). `default: true` in `module.json` — every instance onboards its own builders.
3
+ This file is a placeholder shipped inside the **@bongos/core** package. The core's own
4
+ internal agent notes are intentionally omitted from the published artifact so they cannot
5
+ load into your instance's context.
4
6
 
5
- Owns the **newcomer ADMISSION + ORIENTATION domain**:
7
+ **It does not govern this repository.** Your own root `CLAUDE.md`, your `.claude/`
8
+ directory, and the live Bongos database are the source of truth for how work happens here
9
+ and who may do what.
6
10
 
7
- - **admission** ([`routes/access-requests.js`](routes/access-requests.js) + [`approval-broadcast.js`](approval-broadcast.js)) — the public `POST /access-requests` (the one unauthenticated GDS write) → the two Archon-only resolve endpoints. A pending request also posts a one-line approve/decline prompt to Discord `#member-approvals` (best-effort; the in-process bot's reaction handler closes the loop).
8
- - **the onboarding state machine** ([`onboarding-state.js`](onboarding-state.js)) — the server-ticked "Path into the City" checklist (`auth_complete → pick_disciplines → first_start → first_claim → ship_three → graduated`). The terminal `ship_three` stage clears at the same threshold that auto-promotes a Xenos to Thetes, so checklist-graduation coincides with the rank promotion. Backed by the `builder_onboarding_state` table (migration 045); the module reads/writes it directly with the client/pool its callers hand it.
9
- - **the friction analyzer** ([`onboarding.js`](onboarding.js)) — the *pure* half of "feedback without asking" (V3.R79 / C1): parse a consented onboarding transcript, compute deterministic friction signals, build the subagent prompt, validate its JSON, shape the `idea_inbox` payload. No FS/network/DB (those live in `scripts/gds/onboarding-analyze.js`).
10
- - **the evergreen newcomer-chore restock** ([`newcomer-restock.js`](newcomer-restock.js) + [`db.js`](db.js)) — a fresh first-builder task is always waiting: claiming a chore instance stamps a replacement synchronously, in the claim request. Template content lives in `scripts/gds/newcomer-floor.templates.json`; the supply read (`newcomerInstanceStats`) is the module's db slice.
11
+ You are seeing this only because an agent opened a file under `node_modules/@bongos/core/`.
12
+ Nothing in here needs to be read to use the platform — run `bongos help` for commands.
11
13
 
12
- ## The boundary (the one rule)
13
-
14
- This module reaches core **only** through the published doorway [`../../src/module-api.js`](../../src/module-api.js) (`coreVersion ^1.9.0`). It must **never** `require()` a core internal directly, and never another module. Core, in turn, must never `require()` a file in here — it reaches the state-machine + restock surface only through the `onboarding` port (below). Both directions are enforced by the BV1.R44/R45 fitness checks.
15
-
16
- ## The `onboarding` kernel PORT
17
-
18
- The novel shape of this carve: it is the FIRST **core → module** port the LIFECYCLE drives (alongside the economy `reward` port). The onboarding state machine is ticked from inside core's claim/ship transactions, so the boundary can't be "module reaches into core" (the builder-settings pattern) — it's "core reaches the module's state machine through a kernel port."
19
-
20
- - **Provides — port `onboarding`** → the surface in [`port.js`](port.js): `{ getState, shapeForApi, safeMarkStage, markStage, broadcastGraduation, restockForClaim, restockAll, SOURCE_TAG }`. Registered in [`routes/onboarding.js`](routes/onboarding.js)'s factory (the loader runs it at boot, and again whenever a test rebuilds the GDS router — `hasProvider`-guarded). Mirrors `modules/economy/routes/reward.js`.
21
- - **The core consumers resolve it WITHOUT importing this module** (all via `seams.resolveOptional('onboarding')`):
22
- - `src/bongos/db.js` — `claimTask`/`shipTask` tick `markStage` INSIDE their transaction (passing the txn `client`) and fire `broadcastGraduation` after COMMIT. The transaction-participant direction.
23
- - `src/bongos/auth.js` — the Device-Flow + web auth callbacks mark `auth_complete` (`safeMarkStage`).
24
- - `src/bongos/routes/me.js` — `GET /me` reads+shapes the checklist (`getState`/`shapeForApi`); `PATCH /me/disciplines` marks `pick_disciplines`.
25
- - `src/bongos/routes/builders.js` — `GET /builders/:id/onboarding` reads+shapes the roster-visible checklist.
26
- - `src/bongos/routes/tasks.js` — `GET /tasks/claimable` marks `first_start`; `POST /tasks/newcomer-restock` is the Archon backstop (`restockAll`).
27
- - `src/bongos/routes/claims.js` — `POST /claims` restocks the chore shelf the instant one is claimed (`restockForClaim`/`SOURCE_TAG`).
28
- - All degrade gracefully when the module is off (a vanilla instance): the state-machine ticks become best-effort no-ops and the restock is skipped (the chore shelf simply isn't maintained), exactly as the surrounding try/catch already tolerated. The doorway gained one additive export (`enabledDisciplines`, CORE_VERSION → 1.9.0) the restock backstop needs; the onboarding capability itself is the port, not a doorway export.
29
-
30
- ## Files
31
-
32
- | File | What |
33
- |---|---|
34
- | `onboarding-state.js` | the server-ticked onboarding state machine (markStage/getState/shapeForApi/safeMarkStage/broadcastGraduation/requireStageCleared + the displayed-checklist shaping). Pure of core `require()` — moved verbatim. |
35
- | `onboarding.js` | the *pure* friction analyzer (transcript parse → signals → prompt → validate → idea payload). Reads `branding().llmProjectName` through the doorway (de-branded in BV1.R76). |
36
- | `newcomer-restock.js` | the on-claim chore stamper — template load + per-template floor + monotonic-seq stamping. Reaches `createTask`/`newcomerInstanceStats` via the module `db.js`; `enabledDisciplines` via the doorway. |
37
- | `db.js` | the onboarding db slice — `newcomerInstanceStats` (the chore-supply read; pool via the doorway) + a `createTask` re-export off the doorway so the stamper's call site stays byte-identical. |
38
- | `approval-broadcast.js` | the `#member-approvals` outbound (the admission route's sole consumer; travels with it). Posts via `scripts/discord/lib` (a scripts/ require — outside the boundary). |
39
- | `port.js` | the `onboarding` port provider surface — DELEGATES (does not spread) to onboarding-state / newcomer-restock so test stubs bite at call time. |
40
- | `routes/onboarding.js` | the module route factory: registers the `onboarding` port + mounts the admission router. |
41
- | `routes/access-requests.js` | the admission cold-start endpoints (the public POST + the two Archon-only resolves). Auth/pool/validators via the doorway; approval-broadcast intra-module. |
42
-
43
- ## NOT in this module (deliberately left in core)
44
-
45
- - **The admission GATE READS** — `db.hasInvitedAccessRequest` / `getBuilderByGithubId` stay core `db.js`: they are KERNEL identity/admission reads the trust boundary (`auth.js`) runs at first sign-in, not the onboarding state/restock domain (mirrors the Gemini-key staying core in the builder-settings carve).
46
- - **The `GET /me` + `GET /builders/:id/onboarding` AGGREGATORS** — `routes/me.js` / `routes/builders.js` stay core; they resolve this port for their onboarding slices (the facade precedent, 02-module-map §2).
47
- - **The onboarding-domain CLIs** — `scripts/gds/setup.js`, `onboarding-config.js`, `onboarding-analyze.js`, `newcomer-floor.js` travel with the domain but stay under `scripts/` and require the module directly (scripts are outside the kernel boundary — the grading/economy precedent).
48
-
49
- ## Tables
50
-
51
- None owned. `builder_onboarding_state` (045) + `access_requests` live on the CORE schema and stay in core `migrations/`. This module owns the *onboarding-state queries* (inside `onboarding-state.js`) + the chore-supply read; any **new** onboarding migration belongs in `modules/onboarding/migrations/` namespaced `onboarding_*` (the additive rule).
52
-
53
- ## Tests
54
-
55
- `tests/onboarding_state.mjs`, `tests/onboarding_gate.mjs`, `tests/onboarding_route_signals.mjs`, and `tests/newcomer_restock.mjs` import from `modules/onboarding/…` (the route-signal test registers the `onboarding` port). `tests/discord_approvals.mjs` imports the moved `approval-broadcast.js`. The doorway/boundary checks discover `onboarding` as a module. See [ADR 0093](../../docs/adr/<redacted>.md).
14
+ _To work ON the platform core itself, use the standalone @bongos/core source repository,
15
+ not this vendored copy._
@@ -1,44 +1,15 @@
1
- # `security` module — red-team reports + bounty + the `security` kernel port
1
+ # @bongos/core — installed platform dependency (not your project's CLAUDE.md)
2
2
 
3
- > The **fifth CORE-domain** carved into a module (BV1.R79, [ADR 0093](../../docs/adr/<redacted>.md) §1) — after memory (R72), grading (R73), economy (R77), and ideas (R78). This is **<redacted>**, not <redacted> ([02-module-map §5](../../docs/design/modular-architecture/02-module-map.md)): the optional, rank-gated red-team-reports + bounty surface. A clean slice — its SQL already lived in a dedicated `security.js` (not the `db.js` monolith), so the carve is a git-move + a route split + a doorway re-point, OTB byte-identical. `default: true` in `module.json` — every instance can take red-team reports.
3
+ This file is a placeholder shipped inside the **@bongos/core** package. The core's own
4
+ internal agent notes are intentionally omitted from the published artifact so they cannot
5
+ load into your instance's context.
4
6
 
5
- Owns the **red-team / vulnerability-report** lifecycle (file → adjudicate → pay) and the **bounty payout table**: the `/builder-redteam` skill POSTs a report (Metic+), the Archon dashboard reads + adjudicates it (confirm / dispute / fix / link-fix), and the env-aware per-severity drachmae schedule (the bounty table) is the single source of truth for "how much for a confirmed report."
7
+ **It does not govern this repository.** Your own root `CLAUDE.md`, your `.claude/`
8
+ directory, and the live Bongos database are the source of truth for how work happens here
9
+ and who may do what.
6
10
 
7
- ## The boundary (the one rule)
11
+ You are seeing this only because an agent opened a file under `node_modules/@bongos/core/`.
12
+ Nothing in here needs to be read to use the platform — run `bongos help` for commands.
8
13
 
9
- This module reaches core **only** through the published doorway [`../../src/module-api.js`](../../src/module-api.js) (`coreVersion ^1.8.0`). It must **never** `require()` a core internal directly, and never another module. Core, in turn, must never `require()` a file in here — it reaches the bounty schedule only through the `security` port (below). Both directions are enforced by the BV1.R44/R45 fitness checks.
10
-
11
- ## <redacted> stays KERNEL (the headline boundary call)
12
-
13
- [02-module-map §5](../../docs/design/modular-architecture/02-module-map.md) splits "security" in two, and only one half is here:
14
-
15
- - **PROPERTY → kernel (NOT moved):** the authz / trust-boundary machinery — `permission-path-check.js`, `route-rank-check.js`, `requireRank`/`requireBuilder` (`auth.js`). Imported everywhere, enforced by composition + fitness functions, never "called." Untouched by this carve.
16
- - **PROPERTY → kernel (NOT moved, the subtle part):** the **threat-model + engagement-doc plane** also stayed in core `src/bongos/routes/security.js`: `GET /security/adr` (reads the real ADR 0020 threat model off the droplet, Metic+) and `GET/POST /security/docs` (the Archon-only exploit-detail engagement-report store, backed by the core `db.js` `security_docs` queries). These document **defenses + exploits** — security-the-property's operational surface, not the bounty feature. They keep their `EXPECTED_RANKS` pins in `route-rank-check.js`.
17
- - **FEATURE → this module:** red-team / vulnerability **reports** + **bounty** (`/security/reports*`) and the payout table. Self-contained, optional, rank-gated.
18
-
19
- The core `src/bongos/routes/security.js` therefore did **not** disappear — it was *split*: the report/bounty routes moved here; the adr/docs (property) routes stayed.
20
-
21
- ## The `security` kernel PORT
22
-
23
- - **Provides — port `security`** → `{ bountyTableDetailed, bountyTable }`. Registered in `routes/reports.js`'s factory (the loader runs it at boot, and again whenever a test rebuilds the GDS router — `hasProvider`-guarded so re-instantiation never trips the single-provider guard). Mirrors `modules/economy/routes/reward.js`.
24
- - **Why:** the **one** core consumer of the security feature is `src/bongos/routes/public.js`'s `GET /public/bounty-table` (the public payout schedule the hall renders). Core can't `require()` a module, so it resolves `seams.resolveOptional('security').bountyTableDetailed()` — the economy `reward`-port precedent for a core read route reaching module data.
25
-
26
- ## Files
27
-
28
- | File | What |
29
- |---|---|
30
- | `security.js` | the bounty payout table (`bountyTable`/`bountyTableDetailed`, env-overridable per severity via `GDS_BOUNTY_*`) + the `vulnerability_reports` domain: `createVulnerabilityReport` (the `/builder-redteam` writer), `listVulnerabilityReports({scope})`, and the Archon adjudication transitions (`confirm`/`dispute`/`markFixed`/`linkFix`). Reaches the shared pool through the doorway. |
31
- | `routes/reports.js` | `POST /security/reports` (Metic+ file), `GET /security/reports` (Archon list), `POST /security/reports/:id/{confirm,dispute,fix,link-fix}` (Archon adjudicate). Its factory **registers the `security` port**. |
32
-
33
- ## NOT in this module (deliberately left in core)
34
-
35
- - **The threat-model + engagement-doc routes** — `src/bongos/routes/security.js` keeps `GET /security/adr` + `GET/POST /security/docs` (security-the-property; see the boundary call above). They use the core `db.js` `security_docs` queries and `auth`/`_helpers` directly — core code, not this module.
36
- - **The `/builder-redteam` skill** — `.claude/skills/builder-redteam/` travels with the feature but stays under `.claude/skills/` (it just POSTs to `/api/gds/security/reports`, which this module now mounts).
37
-
38
- ## Tables
39
-
40
- None owned. `vulnerability_reports` (migration 030) and `security_docs` (the property-side store) were created before the module system and stay in core `migrations/` (the `schema_migrations` stem-key makes a later relocation a no-op). This module owns the *report/bounty queries*; any **new** security-feature migration belongs in `modules/security/migrations/` namespaced `security_*` (the additive rule).
41
-
42
- ## Tests
43
-
44
- `tests/security_reports.mjs` exercises the report/bounty domain (the `security.js` helpers + the bounty table). The route-rank fitness check (`tests/module_route_rank.mjs`) asserts every write route in `routes/reports.js` is rank-gated. The doorway/boundary checks (`tests/fitness.mjs`, `tests/module_loader.mjs`) discover `security` as a module. See [ADR 0093](../../docs/adr/<redacted>.md).
14
+ _To work ON the platform core itself, use the standalone @bongos/core source repository,
15
+ not this vendored copy._
@@ -1,39 +1,15 @@
1
- # `sessions` module — session-records corpus, BFG, session-pulse
1
+ # @bongos/core — installed platform dependency (not your project's CLAUDE.md)
2
2
 
3
- > A CORE-domain carve (BV1.R82, [ADR 0093](../../docs/adr/<redacted>.md) §1) — the seventh tranche-2 domain extracted from the GDS core, after onboarding (R81). `default: true` — every instance records its builders' sessions for the BFG, so it mounts unconditionally unless an instance disables it.
3
+ This file is a placeholder shipped inside the **@bongos/core** package. The core's own
4
+ internal agent notes are intentionally omitted from the published artifact so they cannot
5
+ load into your instance's context.
4
6
 
5
- Owns the **session_records corpus** + its data plane (the `/sessions` upload + the Archon-gated cross-builder search/deep-dive), the **BFG** cross-builder "read-the-room" scorer ([ADR 0026](../../docs/adr/<redacted>.md) §6B), and the **session-pulse / stale-claim** heartbeat helpers.
7
+ **It does not govern this repository.** Your own root `CLAUDE.md`, your `.claude/`
8
+ directory, and the live Bongos database are the source of truth for how work happens here
9
+ and who may do what.
6
10
 
7
- ## The boundary (the one rule)
11
+ You are seeing this only because an agent opened a file under `node_modules/@bongos/core/`.
12
+ Nothing in here needs to be read to use the platform — run `bongos help` for commands.
8
13
 
9
- This module reaches core **only** through the published doorway `../../src/module-api.js` (`coreVersion ^1.10.0`). It must **never** `require()` a core internal (`../../src/bongos/db`, `../../src/bongos/auth`, `../../src/bongos/pool`, …) directly, and **never** another module. Core, in turn, must never `require()` a file in here — the route mount left `src/bongos/routes.js`; `moduleLoader.mountModuleRoutes` discovers + mounts it now. Both directions are enforced by the BV1.R44/R45 fitness checks.
10
-
11
- ## No port (the memory shape, not the economy shape)
12
-
13
- Unlike economy / security / builder-settings / onboarding, sessions registers **no kernel port** (`provides: []`) — exactly like `memory`. **Core never calls back into sessions:** the ship-time session-digest write is an **HTTP POST** to this module's own `/sessions` route (`scripts/gds/ship.js` → `POST /api/gds/sessions`), not a `require`. So there is nothing for a port to expose. The session-records db slice moved here cleanly with its sole consumer (the route).
14
-
15
- The **one outward edge** is the economy **`reward`** kernel port this module *consumes* (resolves, never imports): `upsertSessionRecordWithReward` (in `db.js`) and `POST /sessions` (in `routes/sessions.js`) both `seams.resolveOptional('reward')` — to award the cost-plus session token reward inside the upsert transaction (passing the tx `client`) and to sum the drachmae credited for the owned task(s). That is the kernel-mediated module↔module seam (ADR 0083 / 0093 §2).
16
-
17
- ## Files
18
-
19
- | File | What |
20
- |---|---|
21
- | `db.js` | the `session_records` db slice — `upsertSessionRecord[WithReward]` (the token-reward txn resolves the `reward` port), `searchSessions` / `summarizeSessions` / `getSessionById` / `listSessionsByBuilder`, `filterTaskIdsClaimedBy`, the ORDER-BY whitelist + limit/offset clamps + the shared filter clause. Reaches Postgres via the doorway `pool` + `withTx`. |
22
- | `bfg.js` | the BFG's PURE scorers (`scoreInteractionQuality` / `scoreMemoryQuality`) + extractors + the thin `gatherInteractionSignals` DB gatherer (ADR 0026 §6B). Reads via the doorway (`pool`, `getBuilderById`, `builderRollingAvgGrade`). |
23
- | `pulse.js` | session-pulse + stale-claim heartbeat helpers (`recordPulse` / `sweepStaleClaims` / `getStaleClaimsForBuilder`). The CLI shell stays at `scripts/gds/pulse.js` and requires this lib directly. |
24
- | `routes/sessions.js` | `/sessions` (upload — carries its own 4 MB `express.json`; core `routes.js` still skips the global parser for that path), `/sessions/search` + `/sessions/:id` (Archon-gated cross-builder, fail-closed audited), `/sessions/mine`. |
25
-
26
- ## Tables (owned, not moved)
27
-
28
- `session_records` (+ its migrations) was created before the module system and stays in core `migrations/` (the schema-migrations stem-key makes a later relocation a no-op). The module owns the *queries*; any **new** session migration belongs in `modules/sessions/migrations/` namespaced `sessions_*` (the additive rule). The `session_pulses` table (migration 006) is likewise shared-schema; pulse.js owns its queries.
29
-
30
- ## NOT in this module
31
-
32
- - **`session_logs`** — the per-claim session LOG (the ship-time handoff record, `sealSessionLog`) stays in core `db.js` (lifecycle): it's written inside the claim/ship transaction and read by `routes/claims.js`/`builders.js`. Distinct from `session_records` (the BFG transcript corpus).
33
- - **`builder_sessions`** — the AUTH token table (`createSession`/`lookupSession`/…) is kernel (auth), not this domain.
34
- - **cost / reconcileSessionCosts** — the cost ledger + the session-cost reconciler graduated to [`modules/economy/`](../economy/CLAUDE.md) at BV1.R77. `scripts/gds/session-cost.js` (the SessionEnd cost hook) stays a CLI and posts to `/cost`.
35
- - **the session-domain CLIs** — `session.js`, `session-eval.js` (the 6D evaluator), `session-digest.js`, `session-cost.js`, `backfill-sessions.js`, `bfg-principal-token.js`, `repo-metrics.js`, `pulse.js` travel with the domain but stay under `scripts/` (a command travels with its domain — design 02§1). They're outside the kernel boundary, so `session-eval.js`'s sibling read of `modules/builder-settings/wandering-prefs` is fine (not a cross-module import — fitness scans `src/` + `modules/`, not `scripts/`).
36
-
37
- ## Tests
38
-
39
- `tests/session_search.mjs` (ORDER-BY/clamp guards), `tests/session_caps.mjs` (SR-17 disk-fill bounds — route + db, with the `reward` port registered), `tests/session_eval.mjs` + `tests/session_506_regression.mjs` (the evaluator), `tests/session_digest.mjs` + `tests/session_records.mjs` (the ship-time digest), `tests/bfg*.mjs` (the scorers), `tests/backfill_sessions.mjs` import from `modules/sessions/…` or exercise it. `bfg`/`bfg_write`/`session_records`/`backfill_sessions` are DB-dependent (the `INTEGRATION` set in `run-unit-tests.js`).
14
+ _To work ON the platform core itself, use the standalone @bongos/core source repository,
15
+ not this vendored copy._
@@ -1,47 +1,15 @@
1
- # `status-ui` module — the public status dashboard ("The Watch")
1
+ # @bongos/core — installed platform dependency (not your project's CLAUDE.md)
2
2
 
3
- > A CORE-domain carve (BV1.R84, [ADR 0093](../../docs/adr/<redacted>.md) §1) — the **first WEB-SURFACE module** ([02-module-map §6](../../docs/design/modular-architecture/02-module-map.md): "a web surface is first-class"). `default: true` — a Cloud Bongos instance ships its status page like it ships its hall, so it mounts unconditionally unless an instance disables it.
3
+ This file is a placeholder shipped inside the **@bongos/core** package. The core's own
4
+ internal agent notes are intentionally omitted from the published artifact so they cannot
5
+ load into your instance's context.
4
6
 
5
- Owns the public build-status dashboard served at **`status.<apex>`** (`status.example.com`) — the live up/down banner, version-progress rollups, cost summary, recent ships, the leaderboard, and the kinds-of-work ecosystem fingerprint. A no-framework page (`status.js`) that polls the read-only `/api/gds/public/*` surface every 60s.
7
+ **It does not govern this repository.** Your own root `CLAUDE.md`, your `.claude/`
8
+ directory, and the live Bongos database are the source of truth for how work happens here
9
+ and who may do what.
6
10
 
7
- ## The shape: a static surface, not a backend domain
11
+ You are seeing this only because an agent opened a file under `node_modules/@bongos/core/`.
12
+ Nothing in here needs to be read to use the platform — run `bongos help` for commands.
8
13
 
9
- Unlike every prior tranche-2 carve (economy/ideas/security/…), this module has **no `.js`, no `db.js` slice, no kernel port, and no routes**. It is purely:
10
- - `public/` — the static dashboard (HTML/CSS/JS/cursors/snapshots), moved verbatim from the old repo-root `public-status/`.
11
- - `module.json` — declares one **`contributes.webSurfaces`** entry `{ host: "status.", dir: "public" }`.
12
-
13
- ## The serving seam (how a web surface reaches its host with no core edit)
14
-
15
- The loader exposes `moduleWebSurfaces({ isEnabled })` ([`src/module-loader/loader.js`](../../src/module-loader/loader.js)) — the Host-routed twin of `hallWidgetScripts`/`mountModuleRoutes`. It returns `[{ key, host, dir(abs) }]` for each enabled module that declares `webSurfaces` **and** ships the directory on disk. `src/bongos/serve-internal.js` iterates that set and serves each surface on its `Host:` prefix with the **same** machinery the status page always used:
16
- - the in-memory **content-hash-stamped** index (`buildStampedHtml`, #521 — defeats Cloudflare's 4h TTL),
17
- - the per-instance **branding/theme injection** (`injectBrandingInto`),
18
- - fall-through to `express.static` for assets.
19
-
20
- `serve-internal.js` names **no module key** (kernel stays module-agnostic, [ADR 0083](../../docs/adr/<redacted>.md) §Decision #4); it routes purely off the manifest-declared `host` prefix. The `isStatusHost` export stays the literal `status.` predicate the entrypoints (`server.js`/`src/platform-server.js`) use to keep their apex tail off the status host; **inside** `mountInternalSurfaces` the generic `isModuleSurfaceHost` (any enabled web-surface host) is used, so the next carved surface (hall-UI, R85) needs no new guard.
21
-
22
- ## The boundary
23
-
24
- This module reaches **nothing** in core (no doorway require — it has no JS). Core, in turn, must never `require()` a file in here — `serve-internal.js` resolves the surface through `loader.moduleWebSurfaces`, never an import of `modules/status-ui/*`. Both directions are enforced by the BV1.R44/R45 fitness checks.
25
-
26
- ## The data it renders STAYS shared core (the judgment call)
27
-
28
- The `/api/gds/public/*` read endpoints the dashboard polls (`/public/uptime`, `/public/progress`, `/public/cost-summary`, `/public/grades`, `/public/recent-shipped`, `/public/leaderboard`, `/public/analytics/ecosystem`, `/public/tasks|ideas|blockers/:id`, plus `/versions/:id/done-when`) **did not move** — they live in `src/bongos/routes/public.js` and are consumed by the hall and the **off-box GitHub-Pages mirror** too, not just this surface. A public read shared by multiple surfaces is correctly core/shared, not status-exclusive (the same call the economy/ideas carves made for `routes/public.js`'s inline reads). So the carve moves the *surface*, not the reads it happens to render.
29
-
30
- ## Off-box mirror (operational)
31
-
32
- The LIVE page is served **off the droplet** for outage resilience ([ADR 0029](../../docs/adr/<redacted>.md)) — GitHub Pages from `example-owner/example-status`, fed by `scripts/status-mirror-sync.js`. That script (status-UI domain tooling that travels with its domain but stays a CLI under `scripts/`, the sessions/autonomy precedent) was re-pointed at `modules/status-ui/public/`. **Follow-up:** `.github/workflows/sync-status-mirror.yml` still triggers on `public-status/**` and must be re-pointed at `modules/status-ui/public/**` by an owner/Archon (the GitHub App can't push workflow files — learning 107).
33
-
34
- ## Files & tooling
35
-
36
- | Path | What |
37
- |---|---|
38
- | `public/index.html` · `public/status.js` · `public/style.css` | the dashboard (no build step, no framework) |
39
- | `public/cursors/` · `public/snapshots/` | bronze cursors + the world-render snapshots the page shows |
40
- | `public/README.md` | the surface's own notes (off-box mirror, asset cache-busting) |
41
- | `module.json` | `contributes.webSurfaces: [{ host: "status.", dir: "public" }]`; no port, no routes |
42
-
43
- Generators that WRITE into this surface live under `scripts/` and were re-pointed: `scripts/art/gen-cursors.py` (cursors), `scripts/snapshots/render-*.mjs` (snapshots), `scripts/status-mirror-sync.js` (off-box publish).
44
-
45
- ## Tests
46
-
47
- The loader seam is covered in `tests/module_loader.mjs` (`moduleWebSurfaces` — enabled lists, disabled vanishes, declared-but-not-shipped skipped, plus the live status-ui surface); the manifest `webSurfaces` validation in `tests/module_manifest.mjs`; the carve discovery-key membership in `tests/fitness.mjs` / `tests/module_loader.mjs` / `tests/modules.mjs`; and the carve proof in `scripts/gds/coreB-carve-proof.sh` (leg 4h).
14
+ _To work ON the platform core itself, use the standalone @bongos/core source repository,
15
+ not this vendored copy._
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.17.0",
9
+ "version": "1.17.1",
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.17.0",
3
+ "version": "1.17.1",
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",