@bongos/core 1.21.176 → 1.21.178

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 (214) hide show
  1. package/.bongos-core.json +186 -496
  2. package/.claude/skills/planning-session/SKILL.md +2 -2
  3. package/clients/bongos-client/README.md +1 -1
  4. package/clients/bongos-client/bongos-client.global.js +0 -6
  5. package/clients/bongos-client/index.cjs +0 -6
  6. package/clients/bongos-client/index.d.ts +0 -6
  7. package/clients/bongos-client/index.mjs +0 -6
  8. package/config/scheduled-routines.json +3 -8
  9. package/docs/adr/0042-builder-self-deploy-ci-auto-merge.md +3 -2
  10. package/docs/adr/0091-bounding-the-kernel-and-db-carve.md +1 -1
  11. package/docs/adr/0093-tranche-2-core-carve-sequence.md +1 -1
  12. package/docs/api/openapi.json +1 -87
  13. package/docs/api-reference.md +1 -8
  14. package/docs/canonical-permissions.md +4 -4
  15. package/docs/copy-inventory.md +25 -39
  16. package/docs/copy-registry.json +73 -200
  17. package/docs/file-map.md +6 -11
  18. package/docs/handoff-template.md +1 -1
  19. package/docs/module-api-changelog.md +4 -0
  20. package/docs/modules-contract.md +2 -2
  21. package/docs/onboarding/diagrams/README.md +3 -7
  22. package/docs/onboarding/diagrams/assertions.json +3 -3
  23. package/docs/page-inventory.json +4 -7
  24. package/docs/page-readings.json +1520 -1569
  25. package/docs/recipes/ops-gotchas.md +3 -1
  26. package/modules/autonomy/db.js +9 -0
  27. package/modules/autonomy/module.json +2 -2
  28. package/modules/autonomy/pollers/daily-checks.js +262 -0
  29. package/modules/autonomy/pollers/routine-timers.js +7 -5
  30. package/modules/autonomy/rank-roles.js +64 -0
  31. package/modules/autonomy/server-schedule.js +37 -0
  32. package/modules/government/catalog.js +10 -7
  33. package/modules/government/decision-board.js +0 -1
  34. package/modules/government/decision-rules.js +0 -1
  35. package/modules/government/docket.js +0 -1
  36. package/modules/government/protected-surfaces.js +1 -1
  37. package/modules/government/protected-surfaces.json +2 -3
  38. package/modules/hall-ui/public/atlas.html +1 -1
  39. package/modules/hall-ui/public/blockers.html +1 -1
  40. package/modules/hall-ui/public/board-room.html +1 -1
  41. package/modules/hall-ui/public/city.html +1 -1
  42. package/modules/hall-ui/public/collab.html +1 -1
  43. package/modules/hall-ui/public/commands.html +1 -1
  44. package/modules/hall-ui/public/copy-desk.html +1 -1
  45. package/modules/hall-ui/public/deploy.html +1 -1
  46. package/modules/hall-ui/public/diagrams.html +1 -1
  47. package/modules/hall-ui/public/drachmae.html +1 -1
  48. package/modules/hall-ui/public/fleet.html +1 -1
  49. package/modules/hall-ui/public/gate.css +4 -26
  50. package/modules/hall-ui/public/gate.html +12 -27
  51. package/modules/hall-ui/public/gate.js +26 -176
  52. package/modules/hall-ui/public/gate.states.json +4 -22
  53. package/modules/hall-ui/public/goal-map.html +1 -1
  54. package/modules/hall-ui/public/goals.html +1 -1
  55. package/modules/hall-ui/public/government.html +1 -1
  56. package/modules/hall-ui/public/idea.html +1 -1
  57. package/modules/hall-ui/public/ideas.html +1 -1
  58. package/modules/hall-ui/public/index.html +1 -1
  59. package/modules/hall-ui/public/modules.html +1 -1
  60. package/modules/hall-ui/public/my-agents.html +1 -1
  61. package/modules/hall-ui/public/primer.html +1 -1
  62. package/modules/hall-ui/public/profile.html +1 -1
  63. package/modules/hall-ui/public/project-settings.html +1 -1
  64. package/modules/hall-ui/public/ranks.html +1 -1
  65. package/modules/hall-ui/public/roadmap.html +1 -1
  66. package/modules/hall-ui/public/roster.html +1 -1
  67. package/modules/hall-ui/public/sessions.html +1 -1
  68. package/modules/hall-ui/public/settings.html +1 -1
  69. package/modules/hall-ui/public/shell.js +1 -1
  70. package/modules/hall-ui/public/street-card.js +5 -9
  71. package/modules/hall-ui/public/street-desk.js +2 -2
  72. package/modules/hall-ui/public/street-inside.js +1 -1
  73. package/modules/hall-ui/public/street.html +1 -1
  74. package/modules/hall-ui/public/studio.html +1 -1
  75. package/modules/hall-ui/public/task.html +1 -1
  76. package/modules/hall-ui/public/thinking.html +1 -1
  77. package/modules/hall-ui/public/tweak-editor.html +1 -1
  78. package/modules/hall-ui/public/watch.html +1 -1
  79. package/modules/hall-ui/public/work.html +1 -1
  80. package/modules/lifecycle/matter-acts.js +0 -6
  81. package/modules/lifecycle/module.json +0 -1
  82. package/package-lock.json +2 -2
  83. package/package.json +1 -1
  84. package/release-notes.json +36 -0
  85. package/scripts/bongos/adopt-preflight.js +3 -3
  86. package/scripts/bongos/api-alias-caller-scan.js +2 -2
  87. package/scripts/bongos/audit-authorship.sh +1 -8
  88. package/scripts/bongos/audit-rank-roles.js +15 -56
  89. package/scripts/bongos/bump-version.js +46 -9
  90. package/scripts/bongos/codemod-rename-scripts-gds.js +0 -1
  91. package/scripts/bongos/diagram-facts.js +1 -1
  92. package/scripts/bongos/do-api.js +1 -1
  93. package/scripts/bongos/doc-cli-guard.js +2 -0
  94. package/scripts/bongos/doc-control-claims.js +2 -2
  95. package/scripts/bongos/fitness-checks-identity.js +4 -15
  96. package/scripts/bongos/gen-diagrams.js +3 -3
  97. package/scripts/bongos/government-walk.js +3 -9
  98. package/scripts/bongos/hard-floor.js +52 -0
  99. package/scripts/bongos/publish-manifest.js +3 -3
  100. package/scripts/bongos/pulse.js +5 -3
  101. package/scripts/bongos/routine-schedule.js +38 -3
  102. package/scripts/bongos/run-unit-tests.js +17 -5
  103. package/scripts/bongos/ship-regen.js +2 -3
  104. package/scripts/gds/{goal-names.js → hard-floor.js} +3 -4
  105. package/scripts/security/dep-audit.js +50 -124
  106. package/src/bongos/module-scope-map.js +2 -2
  107. package/src/bongos/permission-path-check.js +1 -1
  108. package/src/bongos/route-rank-check.js +1 -8
  109. package/src/bongos/routes.js +1 -2
  110. package/src/module-api.js +1 -1
  111. package/src/modules.js +1 -1
  112. package/tests/acclaim_feed_evidence_db.mjs +42 -23
  113. package/tests/adr_0089_scope.mjs +7 -5
  114. package/tests/autonomy_daily_checks.mjs +201 -0
  115. package/tests/bump_version.mjs +52 -18
  116. package/tests/claude_materialize.mjs +12 -12
  117. package/tests/copy_desk_flags_db.mjs +22 -14
  118. package/tests/effective_visibility_predicate.mjs +0 -18
  119. package/tests/gating_review_retired.mjs +1 -1
  120. package/tests/government_act_alone_buildings.mjs +1 -3
  121. package/tests/government_board_membership_db.mjs +35 -22
  122. package/tests/government_protected_surfaces.mjs +29 -13
  123. package/tests/governor_docket.mjs +0 -2
  124. package/tests/governor_matter_acts.mjs +6 -8
  125. package/tests/hall_city.mjs +1 -1
  126. package/tests/hall_matter_card.mjs +2 -2
  127. package/tests/hall_oversight_world.mjs +16 -12
  128. package/tests/hall_street_desk.mjs +4 -3
  129. package/tests/hall_street_inside.mjs +1 -1
  130. package/tests/helpers.mjs +34 -0
  131. package/tests/howto_state.mjs +33 -56
  132. package/tests/howto_state_db.mjs +68 -0
  133. package/tests/idea_credit_streams_db.mjs +11 -3
  134. package/tests/integration_parked_ratchet.mjs +7 -1
  135. package/tests/nav_permission_atoms.mjs +1 -1
  136. package/tests/page_notes_db.mjs +12 -8
  137. package/tests/page_tweak_no_rearm.mjs +50 -0
  138. package/tests/publish_manifest.mjs +64 -0
  139. package/tests/routine_capture_kind.mjs +18 -7
  140. package/tests/routine_schedule.mjs +42 -0
  141. package/tests/search_isolation.mjs +5 -103
  142. package/tests/search_isolation_db.mjs +140 -0
  143. package/tests/session_earnings_mirror_db.mjs +2 -0
  144. package/tests/workflow_exec_paths.mjs +9 -11
  145. package/modules/lifecycle/routes/gate-approvals.js +0 -299
  146. package/scripts/bongos/artifact-staleness.js +0 -267
  147. package/scripts/bongos/ci-grade.js +0 -82
  148. package/scripts/bongos/classify-discipline.js +0 -153
  149. package/scripts/bongos/codemod-rename-src-gds.js +0 -145
  150. package/scripts/bongos/coreB-carve-proof.sh +0 -725
  151. package/scripts/bongos/gate-review.js +0 -330
  152. package/scripts/bongos/goal-names.js +0 -102
  153. package/scripts/bongos/rename-goals.js +0 -109
  154. package/scripts/bongos/seed-adopt-tasks.js +0 -75
  155. package/scripts/bongos/seed-api-contract-goal-tasks.js +0 -141
  156. package/scripts/bongos/seed-board-room-tasks.js +0 -196
  157. package/scripts/bongos/seed-bongos-app-tasks.js +0 -294
  158. package/scripts/bongos/seed-bongos-coreB-tranche1-tasks.js +0 -81
  159. package/scripts/bongos/seed-bongos-coreB-tranche2-tasks.js +0 -100
  160. package/scripts/bongos/seed-bongos-goal-hierarchy-tasks.js +0 -307
  161. package/scripts/bongos/seed-bongos-module-system-tasks.js +0 -346
  162. package/scripts/bongos/seed-bongos-tasks.js +0 -214
  163. package/scripts/bongos/seed-bongos-v1-seo-tasks.js +0 -104
  164. package/scripts/bongos/seed-bv1-community-tasks.js +0 -131
  165. package/scripts/bongos/seed-bv1-privacy-invites-tasks.js +0 -133
  166. package/scripts/bongos/seed-bv1-profile-page-tasks.js +0 -161
  167. package/scripts/bongos/seed-bv1-r01-delta-tasks.js +0 -154
  168. package/scripts/bongos/seed-bv2-tweak-mode-tasks.js +0 -277
  169. package/scripts/bongos/seed-gds-v4-tasks.js +0 -624
  170. package/scripts/bongos/seed-governance-tasks.js +0 -340
  171. package/scripts/bongos/seed-medusa-tasks.js +0 -440
  172. package/scripts/bongos/seed-module-upstreaming.js +0 -219
  173. package/scripts/bongos/seed-productization-tasks.js +0 -235
  174. package/scripts/bongos/seed-project-admin-console-tasks.js +0 -88
  175. package/scripts/bongos/seed-provisioning-tasks.js +0 -83
  176. package/scripts/bongos/seed-strict-versioning-tasks.js +0 -275
  177. package/scripts/bongos/seed-v2-world-tasks.js +0 -283
  178. package/scripts/gds/artifact-staleness.js +0 -7
  179. package/scripts/gds/ci-grade.js +0 -7
  180. package/scripts/gds/classify-discipline.js +0 -7
  181. package/scripts/gds/codemod-rename-src-gds.js +0 -7
  182. package/scripts/gds/coreB-carve-proof.sh +0 -8
  183. package/scripts/gds/gate-review.js +0 -7
  184. package/scripts/gds/rename-goals.js +0 -7
  185. package/scripts/gds/seed-adopt-tasks.js +0 -7
  186. package/scripts/gds/seed-api-contract-goal-tasks.js +0 -7
  187. package/scripts/gds/seed-board-room-tasks.js +0 -6
  188. package/scripts/gds/seed-bongos-app-tasks.js +0 -7
  189. package/scripts/gds/seed-bongos-coreB-tranche1-tasks.js +0 -7
  190. package/scripts/gds/seed-bongos-coreB-tranche2-tasks.js +0 -7
  191. package/scripts/gds/seed-bongos-goal-hierarchy-tasks.js +0 -7
  192. package/scripts/gds/seed-bongos-module-system-tasks.js +0 -7
  193. package/scripts/gds/seed-bongos-tasks.js +0 -7
  194. package/scripts/gds/seed-bongos-v1-seo-tasks.js +0 -6
  195. package/scripts/gds/seed-bv1-community-tasks.js +0 -6
  196. package/scripts/gds/seed-bv1-privacy-invites-tasks.js +0 -6
  197. package/scripts/gds/seed-bv1-profile-page-tasks.js +0 -6
  198. package/scripts/gds/seed-bv1-r01-delta-tasks.js +0 -6
  199. package/scripts/gds/seed-bv2-tweak-mode-tasks.js +0 -6
  200. package/scripts/gds/seed-gds-v4-tasks.js +0 -7
  201. package/scripts/gds/seed-governance-tasks.js +0 -7
  202. package/scripts/gds/seed-medusa-tasks.js +0 -7
  203. package/scripts/gds/seed-module-upstreaming.js +0 -7
  204. package/scripts/gds/seed-productization-tasks.js +0 -7
  205. package/scripts/gds/seed-project-admin-console-tasks.js +0 -6
  206. package/scripts/gds/seed-provisioning-tasks.js +0 -7
  207. package/scripts/gds/seed-strict-versioning-tasks.js +0 -7
  208. package/scripts/gds/seed-v2-world-tasks.js +0 -7
  209. package/scripts/migrate_cost_ledger.sh +0 -178
  210. package/tests/artifact_staleness.mjs +0 -207
  211. package/tests/gate_approvals.mjs +0 -611
  212. package/tests/gate_review.mjs +0 -152
  213. package/tests/goal_names.mjs +0 -120
  214. package/tests/newcomer_generator.mjs +0 -48
@@ -77,8 +77,8 @@ const SKIP_PREFIXES = ['docs/session-logs/', 'docs/audits/', 'limitations/'];
77
77
  const ALLOW = new Map([
78
78
  ['docs/adr/0025-structured-criterion-task-link.md::scripts/bongos/seed-v3-tasks.js',
79
79
  'describes the grep a session HAD to do before this ADR; a seed script, not a control'],
80
- ['docs/adr/0042-builder-self-deploy-ci-auto-merge.md::.github/workflows/grade-gate.yml',
81
- 'the CI grader gate this ADR designed; it was armed in the grader-off variant its own Status line records, and grading runs server-side (scripts/bongos/ci-grade.js)'],
80
+ ['docs/adr/0089-modular-multi-model-adversarial-grader.md::scripts/bongos/gate-review.js',
81
+ 'ADR 0089 section 8 names the ADR 0058 gatekeeper as a surface the grading engine does not own; task 1004859 deleted it (the CI check it drove never ran) and moved its hard-floor list to scripts/bongos/hard-floor.js'],
82
82
  ['docs/adr/0111-instance-hosting-provisioning-module.md::scripts/bongos/box.js',
83
83
  'the dev-box control-plane runner, retired with dev boxes by ADR 0346 (dev-box-guard.js keeps it out)'],
84
84
  ['docs/adr/0150-box-first-boot-bringup-vendored-instances.md::scripts/bongos/box.js',
@@ -79,10 +79,8 @@ const IDENTITY_SCAN_EXTRA_FILES = [];
79
79
  // * backfill-sessions.js / version-close.js — one-time operator runbook text
80
80
  // naming the actual prod DB + a historical local directory. Describing what
81
81
  // an operator must literally type is the correct content.
82
- // * seed-*.js — the hits are PROSE INSIDE seeded task descriptions: historical
83
- // records of what those tasks said when they were filed. Rewriting them would
84
- // falsify the record; deleting the files would destroy it. They are inert
85
- // (idempotent on source_ref) and referenced only by generated manifests.
82
+ // * seed-*.js — the nine one-shot seeders once listed here (prose inside seeded
83
+ // task descriptions) were deleted by task 1004856; the repo history keeps them.
86
84
  // * the four *.sh entries — surfaced when `.sh` joined the extension set (task
87
85
  // 1002567). Each is a HOST-PINNED OPS script, not portable code: they name the
88
86
  // live box's actual Postgres database/role and its actual /etc secrets dir, and
@@ -94,7 +92,7 @@ const IDENTITY_SCAN_EXTRA_FILES = [];
94
92
  // NEW literal in any of them fails exactly like one in an unlisted file.
95
93
  // * fitness-checks-identity.js / package-core.js — THE DETECTORS THEMSELVES: Check 13's regexes
96
94
  // and package-core's PRIOR_INSTANCE_FLOOR name the brand because hunting it is
97
- // their job. * seed-v3-tasks.js — the seeded-task-prose rationale above. All
95
+ // their job. (seed-v3-tasks.js was the third; it is gone.) All
98
96
  // three passed pre-1002756 only by the old stripper's accidents (phantom
99
97
  // blocks + regex-blindness); now they are seen and counted.
100
98
  const IDENTITY_SCAN_ALLOWED = {
@@ -113,19 +111,10 @@ const IDENTITY_SCAN_ALLOWED = {
113
111
  'scripts/bongos/seed-staging.sh': 4,
114
112
  'scripts/bongos/backfill-sessions.js': 2,
115
113
  'scripts/bongos/publish-manifest.js': 3,
116
- 'scripts/bongos/seed-bongos-coreB-tranche1-tasks.js': 1,
117
- 'scripts/bongos/seed-bongos-coreB-tranche2-tasks.js': 1,
118
- 'scripts/bongos/seed-bongos-goal-hierarchy-tasks.js': 1,
119
- 'scripts/bongos/seed-bongos-tasks.js': 1,
120
- 'scripts/bongos/seed-gds-v4-tasks.js': 1,
121
- 'scripts/bongos/seed-medusa-tasks.js': 7,
122
- 'scripts/bongos/seed-module-upstreaming.js': 1,
123
- 'scripts/bongos/seed-productization-tasks.js': 6,
124
- 'scripts/bongos/seed-provisioning-tasks.js': 2,
125
114
  'scripts/bongos/version-close.js': 1,
126
115
  // task 1002853 (the company literal joined the list): audit-authorship.sh is itself a
127
116
  // detector — its ops allowlist names the founder's commit address so it can exempt it; grade-smoke.js
128
- // is a protected grader probe whose fixture task prose names the company, the seed-*.js rationale.
117
+ // is a protected grader probe whose fixture task prose names the company.
129
118
  'scripts/bongos/audit-authorship.sh': 1,
130
119
  'scripts/bongos/grade-smoke.js': 1,
131
120
  };
@@ -488,7 +488,7 @@ function rebuildAssertions(prev, f) {
488
488
  next.architecture = {
489
489
  diagram: '04-architecture',
490
490
  _comment:
491
- "Pieces of 04-architecture gated on a backing Bongos task. A piece is LIVE iff its task is 'shipped'; live_tasks must ALL be shipped, pending_tasks must NOT yet be. Rebuilt by scripts/bongos/gen-diagrams.js in lockstep with the diagram, so this is the drift checker's backstop. The machine/server/GitHub topology is structural (not task-gated); these are the LIVE/PLANNED markers. MEMORY layer (ADR 0024): 273 schema / 274 sync-on-ship / 275 pull-on-start / 276 isolation. Ship flow: 1025 (server-mediated publish, for a checkout with no push credential), 1028 (GitHub App push credential). The deploy leg is the standalone AUTO-PULL (ADR 0108/0129), not a task-gated GitHub-Actions CI job, so 859 is intentionally absent.",
491
+ "Pieces of 04-architecture gated on a backing Bongos task. A piece is LIVE iff its task is 'shipped'; live_tasks must ALL be shipped, pending_tasks must NOT yet be. Rebuilt by scripts/bongos/gen-diagrams.js in lockstep with the diagram. The machine/server/GitHub topology is structural (not task-gated); these are the LIVE/PLANNED markers. MEMORY layer (ADR 0024): 273 schema / 274 sync-on-ship / 275 pull-on-start / 276 isolation. Ship flow: 1025 (server-mediated publish, for a checkout with no push credential), 1028 (GitHub App push credential). The deploy leg is the standalone AUTO-PULL (ADR 0108/0129), not a task-gated GitHub-Actions CI job, so 859 is intentionally absent.",
492
492
  live_tasks: arch.live_tasks,
493
493
  pending_tasks: arch.pending_tasks,
494
494
  };
@@ -499,7 +499,7 @@ function rebuildAssertions(prev, f) {
499
499
  ...next.drachmae_karma,
500
500
  diagram: '03-drachmae-karma',
501
501
  _comment:
502
- "Pieces of 03-drachmae-karma that are gated on a backing Bongos task. A piece is LIVE iff its task is 'shipped'. live_tasks must ALL be shipped live; pending_tasks must NOT yet be shipped. Rebuilt automatically by scripts/bongos/gen-diagrams.js from the authenticated /tasks/:id status; the diagram is regenerated in lockstep, so this slice is a redundant backstop the drift checker verifies. D_SHIP (credit_log trigger) and D_ACH (achievement bonuses) have no task gate and are always LIVE. achievements_seeded mirrors 03's 'N seeded' label, counted from the achievements seed INSERTs in migrations/.",
502
+ "Pieces of 03-drachmae-karma that are gated on a backing Bongos task. A piece is LIVE iff its task is 'shipped'. live_tasks must ALL be shipped live; pending_tasks must NOT yet be shipped. Rebuilt automatically by scripts/bongos/gen-diagrams.js from the authenticated /tasks/:id status; the diagram is regenerated in lockstep. D_SHIP (credit_log trigger) and D_ACH (achievement bonuses) have no task gate and are always LIVE. achievements_seeded mirrors 03's 'N seeded' label, counted from the achievements seed INSERTs in migrations/.",
503
503
  };
504
504
  next.drachmae_karma.live_tasks = dk.live_tasks;
505
505
  next.drachmae_karma.pending_tasks = dk.pending_tasks;
@@ -589,7 +589,7 @@ const CONCEPTUAL_TARGETS = [
589
589
  // r.error (ENOENT) and r.status is null. The .mmd sources are already
590
590
  // written above and the caller (ship.js regenerateDiagrams) will commit
591
591
  // them; PNGs get re-rendered on the Linux droplet at deploy time, and the
592
- // diagram-drift routine backstops any staleness. So skip the render
592
+ // next render-capable ship refreshes them. So skip the render
593
593
  // NON-FATALLY rather than hard-failing the whole ship on a missing bash.
594
594
  console.warn(
595
595
  `gen-diagrams: could not run the render step (${r.error.code || r.error.message}). ` +
@@ -37,8 +37,8 @@
37
37
  // an in-memory fake with the same row shapes and the same guards (one open sitting
38
38
  // per subject, one vote per member, single-winner close, the decision-rules write
39
39
  // only from a passed decision-rules amendment), and the few writes a passed matter
40
- // makes into other modules are recorded in memory instead of written to a database
41
- // (or, for a gate approval, sent to GitHub). The table says which mode ran.
40
+ // makes into other modules are recorded in memory instead of written to a database.
41
+ // The table says which mode ran.
42
42
  //
43
43
  // Usage:
44
44
  // node scripts/bongos/government-walk.js run it and print the table
@@ -102,7 +102,6 @@ const REQUESTS = Object.freeze({
102
102
  'POST /autonomy/builders/:builderId/pause': ['POST', `/autonomy/builders/${BAD}/pause`, { paused: false }],
103
103
  'POST /done-when/:criterionId/satisfy': ['POST', `/done-when/${BAD}/satisfy`, {}],
104
104
  'POST /done-when/:criterionId/unsatisfy': ['POST', `/done-when/${BAD}/unsatisfy`, {}],
105
- 'POST /gate-approvals/:pr/approve': ['POST', `/gate-approvals/${BAD}/approve`, {}],
106
105
  'POST /override-requests/:id/decide': ['POST', `/override-requests/${BAD}/decide`, { decision: 'approve' }],
107
106
  'POST /provisioning/instances/:id/core-upgrade': ['POST', `/provisioning/instances/${BAD}/core-upgrade`, { to: '1.2.3' }],
108
107
  'POST /provisioning/instances/:id/update-channel': ['POST', `/provisioning/instances/${BAD}/update-channel`, { channel: 'nightly' }],
@@ -122,7 +121,6 @@ const MATTER_PLAN = Object.freeze([
122
121
  ['automation', 'Switch unattended building off', { type: 'switch_off' }, 'fence off'],
123
122
  ['automation', 'Allow goal 77 to build unattended', { type: 'allow_goal', goal_id: 77 }, 'goal 77 allowed'],
124
123
  ['release', 'Approve override request 5', { type: 'approve_override', request_id: 5 }, 'request 5 approved'],
125
- ['release', 'Clear the gate on PR 1500', { type: 'approve_gate', pr: 1500 }, 'PR 1500 cleared'],
126
124
  ['review', 'Sign off criterion 9', { type: 'satisfy_criterion', criterion_id: 9 }, 'criterion 9 satisfied'],
127
125
  ['treasury', 'Dee gets $50 a month', { type: 'set_budget', builder_id: 45, monthly_usd: 50 }, 'Dee\'s limit is $50'],
128
126
  ]);
@@ -135,7 +133,6 @@ const ROUTERS = Object.freeze([
135
133
  // no HTTP surface; it contributes the Release and Review matter acts, as at boot
136
134
  'modules/lifecycle/routes/lifecycle.js',
137
135
  'modules/lifecycle/routes/done-when.js',
138
- 'modules/lifecycle/routes/gate-approvals.js',
139
136
  'modules/lifecycle/routes/tasks.js',
140
137
  'modules/lifecycle/routes/goals.js',
141
138
  'modules/lifecycle/routes/versions.js',
@@ -618,7 +615,6 @@ async function runWalk() {
618
615
  const lifeDb = req('modules/lifecycle/db.js');
619
616
  const doneWhen = req('modules/lifecycle/done-when.js');
620
617
  const doneWhenRoutes = req('modules/lifecycle/routes/done-when.js');
621
- const gateRoutes = req('modules/lifecycle/routes/gate-approvals.js');
622
618
  const express = require('express');
623
619
  const http = require('http');
624
620
 
@@ -634,11 +630,10 @@ async function runWalk() {
634
630
  projectSettings.setSetting = async (k, v) => { settings.set(k, String(v)); return { key: k, value: String(v) }; };
635
631
 
636
632
  // What passed matters write into other modules, recorded.
637
- const effects = { fence: null, allowedGoals: [], overrides: [], gates: [], criteria: new Map([['9', false]]), budgets: new Map() };
633
+ const effects = { fence: null, allowedGoals: [], overrides: [], criteria: new Map([['9', false]]), budgets: new Map() };
638
634
  autoDb.setFenceEnabled = async ({ enabled }) => { effects.fence = enabled; return { enabled }; };
639
635
  autoDb.allowGoal = async ({ goalId }) => { effects.allowedGoals.push(String(goalId)); return { goal_id: goalId }; };
640
636
  lifeDb.decideOverrideRequest = async ({ requestId, decision }) => { effects.overrides.push([String(requestId), decision]); return {}; };
641
- gateRoutes.approveGatePr = async ({ number }) => { effects.gates.push(String(number)); return { ok: true, body: {} }; };
642
637
  doneWhen.getCriterion = async (id) => (effects.criteria.has(String(id)) ? { id, satisfied: effects.criteria.get(String(id)) } : null);
643
638
  doneWhenRoutes.satisfyByOverride = async ({ criterionId }) => { effects.criteria.set(String(criterionId), true); return { updated: {}, goalResult: {} }; };
644
639
 
@@ -971,7 +966,6 @@ async function runWalk() {
971
966
  'automation.switch_off': () => effects.fence === false,
972
967
  'automation.allow_goal': () => effects.allowedGoals.includes('77'),
973
968
  'release.approve_override': () => effects.overrides.some(([id, d]) => id === '5' && d === 'approve'),
974
- 'release.approve_gate': () => effects.gates.includes('1500'),
975
969
  'review.satisfy_criterion': () => effects.criteria.get('9') === true,
976
970
  'treasury.set_budget': () => effects.budgets.get('45') === 50,
977
971
  };
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ // scripts/bongos/hard-floor.js — the trust-boundary HARD FLOOR: the repo paths that,
4
+ // if a compromised or injected senior session changed them, would disable the safety
5
+ // system itself or the deploy switch. A subset of PROTECTED_GLOBS (the protected-surface
6
+ // registry, modules/government/protected-surfaces.json); tests/government_protected_surfaces.mjs
7
+ // holds the subset honest.
8
+ //
9
+ // WHERE IT CAME FROM. This list lived in scripts/bongos/gate-review.js, the ADR 0058
10
+ // classifier a planned gate-review CI check was meant to run. That check never ran on
11
+ // main, and task 1004859 removed the classifier with the hall Gate page that waited on
12
+ // it. Two live readers still need the list, so it moved here unchanged (minus the two
13
+ // deleted drivers that named themselves):
14
+ // - scripts/bongos/publish-manifest.js — what the public mirror must never carry;
15
+ // - scripts/bongos/adopt-preflight.js — whether an adopted repo lands on the floor.
16
+ //
17
+ // Imported, never re-typed: a consumer that needs the floor requires this file.
18
+ // Kept as globs so the matcher is the one permission-path-check builds (trailing '/' =
19
+ // subtree, case- and NFC-folded — task 1002874: a byte-exact matcher let an uppercased
20
+ // spelling of a floor surface walk past).
21
+
22
+ const { compileGlobMatcher } = require('../../src/bongos/permission-path-check');
23
+
24
+ const HARD_FLOOR_GLOBS = [
25
+ 'scripts/bongos/hard-floor.js', // self
26
+ 'src/bongos/permission-path-check.js', // defines the protected set
27
+ 'src/bongos/route-rank-check.js', // the route-gate auditor
28
+ 'src/bongos/auth.js', // requireRank / requireBuilder — the enforcement point
29
+ 'modules/grading/grader.js', // BV1.R73: grading carved to modules/grading/
30
+ 'modules/grading/grader-workers/',
31
+ 'modules/grading/grader-rubric.json',
32
+ 'scripts/bongos/grade-smoke.js', // grade-smoke driver
33
+ 'scripts/bongos/conductor-dispatch.js', // mid-flight grader dispatch
34
+ 'scripts/bongos/main-audit.js', // the authoritative deploy-time audit (the backstop)
35
+ 'scripts/bongos/push-main.js', // the sanctioned main-push carrying the override
36
+ 'scripts/bongos/run-unit-tests.js', // the unit-gate test selector
37
+ 'scripts/bongos/install-git-hooks.js',
38
+ 'scripts/bongos/hooks/',
39
+ 'scripts/migrate.sh',
40
+ 'scripts/deploy/',
41
+ 'config/deploy.json', // the laptop/ci/bypass deploy switch
42
+ 'infra/', // branch-protection.json + deploy substrate
43
+ '.github/', // CI workflows: the unit gate, secret scan, publish
44
+ 'CODEOWNERS',
45
+ '.husky/', // pre-push/pre-commit gate delivery
46
+ '.claude/hooks/',
47
+ '.claude/settings.json',
48
+ ];
49
+
50
+ const matchesHardFloor = compileGlobMatcher(HARD_FLOOR_GLOBS);
51
+
52
+ module.exports = { HARD_FLOOR_GLOBS, matchesHardFloor };
@@ -16,7 +16,7 @@
16
16
  // that falls inside an allowlisted subtree is dropped if the denylist forbids it.
17
17
  // isPublishable(p) == matchesDeny(p) ? false : matchesAllow(p)
18
18
  //
19
- // REUSE, NEVER RE-TYPE (the task's explicit instruction; the gate-review.js doctrine):
19
+ // REUSE, NEVER RE-TYPE (the task's explicit instruction; the hard-floor.js doctrine):
20
20
  // The three canonical sensitive-surface inventories are IMPORTED, never copied —
21
21
  // PROTECTED_GLOBS (write-protection over trust/pipeline/infra code),
22
22
  // HARD_FLOOR_GLOBS (the rank-independent escalate subset), and
@@ -28,10 +28,10 @@
28
28
  // cross-checks the partition against the live inventory so it cannot silently drift.
29
29
 
30
30
  // The three canonical sensitive-surface inventories — imported from their homes,
31
- // NEVER re-typed (the gate-review.js "imported, never hand-retyped" doctrine). All
31
+ // NEVER re-typed (the "imported, never hand-retyped" doctrine). All
32
32
  // three are pure to require (no DB/network at load; their CLIs are require.main-guarded).
33
33
  const { PROTECTED_GLOBS, globToRegExp } = require('../../src/bongos/permission-path-check');
34
- const { HARD_FLOOR_GLOBS } = require('./gate-review');
34
+ const { HARD_FLOOR_GLOBS } = require('./hard-floor');
35
35
  const { SENSITIVE_DOC_GLOBS } = require('./search-ingest-md');
36
36
 
37
37
  // ---------------------------------------------------------------------------
@@ -8,9 +8,11 @@
8
8
  // node scripts/bongos/pulse.js --claim-id <N>
9
9
  //
10
10
  // 2) Release-stale mode (V3.R49 / #268) — scan for active claims with
11
- // no pulse in N hours and auto-release them. Used by the
12
- // `stale-claim-release` scheduled task (runs every 15 min on the
13
- // droplet) and runnable by hand for ops.
11
+ // no pulse in N hours and auto-release them. Runnable by hand for ops
12
+ // ONLY: the scheduled `stale-claim-release` routine was retired unscheduled
13
+ // in task 1004878, because nothing records pulses yet (no POST /pulse route,
14
+ // no hook sends one), so a timed sweep would release every claim older
15
+ // than the threshold.
14
16
  // node scripts/bongos/pulse.js --release-stale [--threshold-hours 6] [--dry-run]
15
17
  //
16
18
  // -------------------------------------------------------------------------
@@ -51,6 +51,9 @@ const TASKS_DIR = path.join(ROOT, '.claude', 'scheduled-tasks');
51
51
  const WORKFLOWS_DIR = path.join(ROOT, '.github', 'workflows');
52
52
 
53
53
  const { parseRoutineFrontmatter } = require('./run-routine.js');
54
+ // The routines the always-on server fires itself (task 1004878) — the second
55
+ // scheduler this check reads, beside .github/workflows/.
56
+ const { SERVER_ROUTINES } = require('../../modules/autonomy/server-schedule.js');
54
57
 
55
58
  // The NAMED cadences a routine may declare. The value is the period a cron
56
59
  // expression must resolve to for the two to agree. Add a name here and
@@ -189,17 +192,32 @@ function readWorkflows(dir = WORKFLOWS_DIR) {
189
192
  // `workflows === null` means "this checkout has no CI to schedule with", which
190
193
  // downgrades unscheduled routines from violations to warnings (see the two-repo
191
194
  // note in the header).
192
- function evaluate({ withCadence, withoutCadence }, workflows) {
195
+ //
196
+ // `server` is the in-process scheduler (modules/autonomy/server-schedule.js): rows
197
+ // of { routine, cadence } the always-on server fires itself. A row there IS a
198
+ // scheduler, at exactly its cadence — and it travels with the core, so it fires in
199
+ // an instance checkout too, where there are no workflows. It is held to the same
200
+ // rules as a cron: the routine must declare the cadence the server realizes, and
201
+ // must still exist.
202
+ function evaluate({ withCadence, withoutCadence }, workflows, server = []) {
193
203
  const violations = [];
194
204
  const warnings = [];
195
205
  const hasCI = workflows !== null;
196
206
  const wf = workflows || [];
207
+ const serverRow = new Map(server.map((s) => [s.routine, s]));
197
208
 
198
209
  for (const r of withCadence) {
199
210
  if (!isCadence(r.cadence)) {
200
211
  violations.push(`routine '${r.name}': unknown cadence "${r.cadence}" (want ${[...CADENCES].join('|')}, or <N>min where N divides 60)`);
201
212
  continue;
202
213
  }
214
+ const srv = serverRow.get(r.name);
215
+ if (srv) {
216
+ if (srv.cadence !== r.cadence) {
217
+ violations.push(`routine '${r.name}' declares cadence: ${r.cadence} but the server fires it ${srv.cadence} (modules/autonomy/server-schedule.js)`);
218
+ }
219
+ continue;
220
+ }
203
221
  const firing = wf.filter((w) => invokesRoutine(w.text, r.name, r.steps));
204
222
  if (!firing.length) {
205
223
  const msg = `routine '${r.name}' declares cadence: ${r.cadence} but NOTHING fires it — no scheduled workflow invokes it`;
@@ -242,7 +260,24 @@ function evaluate({ withCadence, withoutCadence }, workflows) {
242
260
  }
243
261
  violations.push(...dangling);
244
262
 
263
+ // The server-side rename rot, and a label that lies the other way: a routine the
264
+ // server fires on a schedule its own SKILL.md says nothing about. Skipped where
265
+ // there is no routine tree at all (an instance before materialization) — there
266
+ // every row would read as dangling, and none of them is.
267
+ const serverFired = new Set();
268
+ if (known.size) {
269
+ for (const s of server) {
270
+ if (!known.has(s.routine)) {
271
+ violations.push(`modules/autonomy/server-schedule.js fires routine '${s.routine}', which has no .claude/scheduled-tasks/${s.routine}/SKILL.md`);
272
+ } else if (withoutCadence.some((r) => r.name === s.routine)) {
273
+ violations.push(`routine '${s.routine}' is fired ${s.cadence} by the server but its SKILL.md declares no cadence: — add \`cadence: ${s.cadence}\``);
274
+ serverFired.add(s.routine);
275
+ }
276
+ }
277
+ }
278
+
245
279
  for (const r of withoutCadence) {
280
+ if (serverFired.has(r.name)) continue;
246
281
  warnings.push(`routine '${r.name}' declares no cadence: — it can only ever be run by hand`);
247
282
  }
248
283
  return { violations, warnings };
@@ -252,7 +287,7 @@ function evaluate({ withCadence, withoutCadence }, workflows) {
252
287
  function checkRoutineCadencesScheduled() {
253
288
  const routines = readRoutines();
254
289
  const workflows = readWorkflows();
255
- const { violations, warnings } = evaluate(routines, workflows);
290
+ const { violations, warnings } = evaluate(routines, workflows, SERVER_ROUTINES);
256
291
  const scheduled = routines.withCadence.length - violations.filter((v) => v.startsWith("routine '")).length;
257
292
  return {
258
293
  name: 'a declared cron cadence has something that fires it (task 1003209)',
@@ -262,7 +297,7 @@ function checkRoutineCadencesScheduled() {
262
297
  warnings,
263
298
  note: violations.length
264
299
  ? 'a scheduled routine is declared but dormant — add/repair the scheduler, or drop the cadence: field and stop claiming it runs'
265
- : `${scheduled}/${routines.withCadence.length} cadence-declaring routine(s) fired by a committed scheduler at the declared period; ${routines.withoutCadence.length} manual-only.`,
300
+ : `${scheduled}/${routines.withCadence.length} cadence-declaring routine(s) fired by a committed scheduler (a workflow or the server) at the declared period; ${routines.withoutCadence.length} manual-only.`,
266
301
  };
267
302
  }
268
303
 
@@ -258,6 +258,14 @@ const INTEGRATION = new Set([
258
258
  // branch over a fake table; only a real engine runs the one-shot DO block and
259
259
  // shows a legacy account published again and marked apart from a sign-in.
260
260
  'terms_grandfather_db',
261
+ // task 1004863: three database halves that no lane ran. page_notes_db (the page
262
+ // feedback doc schema rules; modules/page-notes is live and on by default) self-skipped
263
+ // in the unit lane and was in no set. howto_state_db and search_isolation_db are the
264
+ // database halves split out of howto_state and search_isolation, whose DB-free halves
265
+ // stay in the unit lane: the first runs the how-to read contract on the real schema,
266
+ // the second proves the search index never widens a caller past their rank or into
267
+ // another builder memory. Each skipped in CI before, so none had ever been gated.
268
+ 'page_notes_db', 'howto_state_db', 'search_isolation_db',
261
269
  ]);
262
270
 
263
271
  // Excluded so this gate is trustworthy in a CLEAN checkout (the CI condition):
@@ -448,6 +456,15 @@ function discoverModuleTests({ modulesDir = MODULES_DIR, isEnabled = isModuleEna
448
456
  // needed terms_accepted_at stamped: the public read requires both consent columns since
449
457
  // ADR 0213. If one of them reds again, check the module flag is still set first.
450
458
  //
459
+ // FIVE LEFT THIS LIST under task 1004863, each repaired against a freshly migrated
460
+ // database: copy_desk_flags_db, government_board_membership_db (builders.github_id is
461
+ // NOT NULL now; their rows go through insertTestBuilders in tests/helpers.mjs, and the
462
+ // stand-in tables that hid the drift are gone), idea_credit_streams_db and
463
+ // session_earnings_mirror_db (fixture rows named a version status and a task discipline
464
+ // the CHECK constraints no longer admit), and acclaim_feed_evidence_db, which now calls
465
+ // the real feed route handler instead of a sliced copy of its SQL and owns a building
466
+ // version rather than colliding with the seeded planning one (the oscillation above).
467
+ //
451
468
  // consumer_layout_boot LEFT THIS LIST under task 1002863. Its "missing core tarball" was
452
469
  // package-core's fail-closed leak gate reading the lane's throwaway database password (the
453
470
  // word postgres, present in hundreds of core files) as a leaked credential and refusing to
@@ -464,11 +481,6 @@ function discoverModuleTests({ modulesDir = MODULES_DIR, isEnabled = isModuleEna
464
481
  // with no blocker_ref, and db.shipTask called without the land assurance task 1002483
465
482
  // made mandatory. Each passes alone on a freshly migrated database.
466
483
  const INTEGRATION_PARKED = new Set([
467
- 'acclaim_feed_evidence_db',
468
- 'copy_desk_flags_db',
469
- 'government_board_membership_db',
470
- 'idea_credit_streams_db',
471
- 'session_earnings_mirror_db',
472
484
  ]);
473
485
 
474
486
  function main() {
@@ -22,7 +22,7 @@ function currentBranch() {
22
22
  // Task #357: keep the 3 mechanical onboarding diagrams current on every deploy.
23
23
  // Regenerate them from live facts; if any changed, commit the refresh on this
24
24
  // branch so it ships with the deploy. Non-fatal — a render/network hiccup must
25
- // never block a ship; the diagram-drift routine will flag any miss.
25
+ // never block a ship; the next render-capable ship refreshes any miss.
26
26
  //
27
27
  // Returns a status string ('skipped-server' | 'regen-failed' | 'current' |
28
28
  // 'committed' | 'committed-nofatal') so the regression test (task 1046) can
@@ -35,8 +35,7 @@ function regenerateDiagrams() {
35
35
  // leaving those files UNCOMMITTED in the builder's tree (had to be reverted by
36
36
  // hand). That path must not attempt the regen at all: skip here and let a
37
37
  // render-capable ship (the laptop path, which CAN render the PNGs) refresh them
38
- // as a matched .mmd+.png+assertions set; the diagram-drift routine backstops any
39
- // staleness in the meantime. Skipping entirely (vs --no-render) avoids committing
38
+ // as a matched .mmd+.png+assertions set. Skipping entirely (vs --no-render) avoids committing
40
39
  // a .mmd/.png mismatch to main. Mirrors gen-diagrams.js's own non-fatal skip when
41
40
  // bash itself is absent (ENOENT).
42
41
  if (pushVia() === 'server') {
@@ -1,7 +1,6 @@
1
- #!/usr/bin/env node
2
- // scripts/gds/goal-names.js — @bongos-forwarder (task 1004848). Generated by
1
+ // scripts/gds/hard-floor.js — @bongos-forwarder (task 1004848). Generated by
3
2
  // scripts/bongos/codemod-rename-scripts-gds.js; do not edit.
4
- // The real script is scripts/bongos/goal-names.js. This forwarder keeps callers that still name
3
+ // The real script is scripts/bongos/hard-floor.js. This forwarder keeps callers that still name
5
4
  // the old path working, and warns once so they get repointed. Task 1003706 removes it.
6
5
  'use strict';
7
- require('../bongos/forwarder.js').forward(module, 'goal-names.js');
6
+ require('../bongos/forwarder.js').forward(module, 'hard-floor.js');