@bongos/core 1.19.191 → 1.19.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.bongos-core.json CHANGED
@@ -2,22 +2,22 @@
2
2
  "artifact": "bongos-core",
3
3
  "manifest_schema": 1,
4
4
  "generator": "scripts/gds/package-core.js",
5
- "core_version": "1.19.191",
6
- "core_contract": "1.19.191",
7
- "source_commit": "0a30e8955f1b4904fc8eca19d56228a7dff4b32e",
5
+ "core_version": "1.19.192",
6
+ "core_contract": "1.19.192",
7
+ "source_commit": "d87e3afc4422bfa953d231c4d7bfefca3a6f05bd",
8
8
  "source_ref": "HEAD",
9
- "built_at": "2026-08-17T01:01:06.099Z",
9
+ "built_at": "2026-08-17T01:19:26.923Z",
10
10
  "redaction": {
11
11
  "model": "docs-redacted+functional-verbatim",
12
12
  "docs_redacted": 309,
13
13
  "agent_docs_stubbed": 21,
14
- "functional_verbatim": 1283,
14
+ "functional_verbatim": 1284,
15
15
  "rules": 3,
16
16
  "gate_literals": 3,
17
17
  "gate": "passed"
18
18
  },
19
- "file_count": 1613,
20
- "tree_sha256": "234f75ccb67ec7927d6010bbcbd597c9f256e10615cce8d0cbda596850bc0e34",
19
+ "file_count": 1614,
20
+ "tree_sha256": "6589484df659db7863875d9e249da97f452a6f76b2875410ba1084dfa5dd3394",
21
21
  "files": [
22
22
  {
23
23
  "path": ".claude/skills/blocker-review/SKILL.md",
@@ -2949,6 +2949,11 @@
2949
2949
  "mode": "0000644",
2950
2950
  "sha256": "6c8bad4aace2518459c78afc808852e1e00ebf070a57d1240b1b411f4ea15704"
2951
2951
  },
2952
+ {
2953
+ "path": "modules/government/migrations/government_003_board_tables.sql",
2954
+ "mode": "0000644",
2955
+ "sha256": "e4802709d31031f2a7b66e1c3a07fd71def94b2eaf4eff7ad8a0f22bf6eeaf5e"
2956
+ },
2952
2957
  {
2953
2958
  "path": "modules/government/module.json",
2954
2959
  "mode": "0000644",
@@ -4262,12 +4267,12 @@
4262
4267
  {
4263
4268
  "path": "package-lock.json",
4264
4269
  "mode": "0000644",
4265
- "sha256": "ecea40048b1e131835510177f7e19c5cff45b3449c8115b1f1303bde7961a1a4"
4270
+ "sha256": "38cf20e4ca4bfe7aa88598c2fa00a115a477538f21ae1570358bbac79cd52732"
4266
4271
  },
4267
4272
  {
4268
4273
  "path": "package.json",
4269
4274
  "mode": "0000644",
4270
- "sha256": "7f2cdbd17679eff46f8f1d19f593e2f75e909c25e536094b650fe47529547ba7"
4275
+ "sha256": "e35863cc6ec37b4c3fc096f58db91936fde9fba4737d363aadecc132bf094003"
4271
4276
  },
4272
4277
  {
4273
4278
  "path": "public-docs/index.html",
@@ -5877,7 +5882,7 @@
5877
5882
  {
5878
5883
  "path": "src/module-api.js",
5879
5884
  "mode": "0000644",
5880
- "sha256": "1ecbb2895d1ef012f455fe9827f59dade9bfee689b9a86230122a0334c4bff9d"
5885
+ "sha256": "e0f3b40f12f5a425d4113216fc666af615452e1b82342a8485beb5c7fbe8ce93"
5881
5886
  },
5882
5887
  {
5883
5888
  "path": "src/module-loader/catalog.js",
@@ -6862,7 +6867,7 @@
6862
6867
  {
6863
6868
  "path": "tests/government_seed.mjs",
6864
6869
  "mode": "0000644",
6865
- "sha256": "97c9728181f98dcf2daed14a4f87b8acb0fa9fa1d6d55e628eaa06c60c539094"
6870
+ "sha256": "e7f980f02abfb057d725beaf5730fdd71f4e8249af2180bf4a355632481330d6"
6866
6871
  },
6867
6872
  {
6868
6873
  "path": "tests/government_session_scope.mjs",
@@ -0,0 +1,149 @@
1
+ -- government_003_board_tables.sql — the Board Room's items and votes
2
+ -- (task 1003016 / R03 of goal 1000069). Decision of record: ADR 0175.
3
+ --
4
+ -- The Board Room is the first UPWARD-pointing gate in a system where every other
5
+ -- gate points down the rank ladder. Its subjects are exactly TWO, both rare by
6
+ -- construction: a Full Idea, and a change to the constitution itself.
7
+ --
8
+ -- Module migrations are ADDITIVE and NAMESPACED (ADR 0083 §Decision #5): every
9
+ -- object is government_-prefixed, there is no down-migration, and the filename is
10
+ -- government_-prefixed (ADR 0108 §5) so its stem never collides across repos. NEW
11
+ -- migrations in this module must use the `government_` prefix — the historical
12
+ -- `governance_` files keep theirs forever, because `schema_migrations` is keyed by
13
+ -- filename stem and renaming an applied migration makes it look unapplied and
14
+ -- RE-RUNS it. Idempotent: safe to re-run.
15
+ --
16
+ -- ── WHY TWO TABLES AND NOT THREE ────────────────────────────────────────────
17
+ -- A rejection is not its own entity. ADR 0175 §3 makes one reasoned objection
18
+ -- sufficient to return an idea, so the objection IS the vote, and its reason lives
19
+ -- on the vote row. The other half of criterion C2 — a SUB-BAR idea returning with
20
+ -- its weakest section flagged — never reaches the board at all, because ADR 0175
21
+ -- §5 gates window-opening on the completeness bar. That path is modules/ideas
22
+ -- work under R13 (task 1003026), not schema here.
23
+ --
24
+ -- ── WHAT IS DELIBERATELY NOT IN THE SCHEMA ──────────────────────────────────
25
+ -- ANTI-SELF-VOTE (ADR 0175 §11) is enforced in the route, not by a constraint: it
26
+ -- needs the subject's author, which lives in another module's table
27
+ -- (`ideas.captured_by`), and a government migration may not reach across that
28
+ -- boundary. `peer_votes` (migration 058) has the same shape and enforces
29
+ -- server-side for the same reason. R08 (task 1003021) owns it.
30
+ --
31
+ -- MEMBERSHIP is a CONFIGURED PREDICATE resolved per request and uncached
32
+ -- (ADR 0175 §6), so it is absent by design. Storing who may vote would fork
33
+ -- authority truth and defeat ADR 0016's instant-demotion property — the same rule
34
+ -- that forbids memoising the resolver.
35
+ --
36
+ -- THE COUNTING RULE (consent, nulled absences, the zero-vote pass — ADR 0175 §3)
37
+ -- is R10's logic. Nothing here presumes a tally, which is exactly what lets the
38
+ -- constitution be amended without a migration.
39
+
40
+ BEGIN;
41
+
42
+ -- ---------------------------------------------------------------------------
43
+ -- government_board_items — one row per thing put to the board.
44
+ -- ---------------------------------------------------------------------------
45
+ CREATE TABLE IF NOT EXISTS government_board_items (
46
+ id bigserial PRIMARY KEY,
47
+
48
+ -- ADR 0175 §1. Present FROM DAY ONE precisely so a third subject is a row
49
+ -- rather than a migration. Also load-bearing downstream: an amendment travels
50
+ -- the same close path as an idea and must book NO credits, so the economy
51
+ -- consumer filters on this column and never on `subject_id IS NOT NULL`
52
+ -- (docs/specs/board-room-pass-event-contract.md, Decision 2).
53
+ subject_type text NOT NULL
54
+ CHECK (subject_type IN ('full_idea', 'constitutional_amendment')),
55
+ subject_id bigint NOT NULL,
56
+
57
+ -- NULLABLE by design. A full_idea window opens AUTOMATICALLY the moment the
58
+ -- idea clears the completeness bar (ADR 0175 §5), so there is no human opener
59
+ -- to record; an amendment is proposed by a person and this is set. Do not
60
+ -- backfill a system id — "the grade opened this, nobody did" is the true fact.
61
+ opened_by bigint REFERENCES builders(id) ON DELETE SET NULL,
62
+
63
+ opened_at timestamptz NOT NULL DEFAULT now(),
64
+
65
+ -- The sitting's clock (ADR 0175 §2). Absolute rather than a duration, so
66
+ -- changing the project's window length never moves an already-open deadline.
67
+ -- NULL means NO CLOCK — the day-one monarchy configuration, where pass_rule is
68
+ -- `first_ratifier` and the item closes on the first vote instead of on time.
69
+ closes_at timestamptz,
70
+
71
+ closed_at timestamptz,
72
+ outcome text CHECK (outcome IN ('passed', 'returned')),
73
+
74
+ -- The rule IN FORCE when this item opened, snapshotted. ADR 0175 §7 lets the
75
+ -- constitution be amended by the board itself, so the live config is not a
76
+ -- reliable account of how a past item was decided — without this, an amendment
77
+ -- silently rewrites the history of every closed item. Shape:
78
+ -- { membership, pass_rule, window_minutes, close_early_on_full_turnout }
79
+ constitution jsonb NOT NULL,
80
+
81
+ -- An item is either open (no outcome, no closed_at) or closed (both set).
82
+ CONSTRAINT government_board_items_closed_consistent
83
+ CHECK ((closed_at IS NULL) = (outcome IS NULL))
84
+ );
85
+
86
+ -- At most ONE open item per subject. PARTIAL, so the many CLOSED items a
87
+ -- resubmitted idea accumulates are all legal — ADR 0175 §4 makes resubmission
88
+ -- unbounded and keeps every past rejection visible on the history.
89
+ CREATE UNIQUE INDEX IF NOT EXISTS government_board_items_one_open_per_subject
90
+ ON government_board_items (subject_type, subject_id)
91
+ WHERE closed_at IS NULL;
92
+
93
+ -- Serves the expiry poller (R11) and the re-drive sweep the pass-event contract
94
+ -- requires — "callable in a sweep over items WHERE outcome = 'passed'", so a
95
+ -- missed credit is reconcilable without replaying an event.
96
+ CREATE INDEX IF NOT EXISTS government_board_items_open_by_deadline
97
+ ON government_board_items (closes_at)
98
+ WHERE closed_at IS NULL;
99
+
100
+ CREATE INDEX IF NOT EXISTS government_board_items_by_outcome
101
+ ON government_board_items (outcome)
102
+ WHERE outcome IS NOT NULL;
103
+
104
+ -- ---------------------------------------------------------------------------
105
+ -- government_board_votes — open ballot (ADR 0175 §9), one vote per member.
106
+ -- ---------------------------------------------------------------------------
107
+ CREATE TABLE IF NOT EXISTS government_board_votes (
108
+ id bigserial PRIMARY KEY,
109
+ item_id bigint NOT NULL
110
+ REFERENCES government_board_items(id) ON DELETE CASCADE,
111
+ voter_id bigint NOT NULL REFERENCES builders(id) ON DELETE CASCADE,
112
+
113
+ direction text NOT NULL CHECK (direction IN ('yes', 'no')),
114
+
115
+ -- ADR 0175 §4. A 'no' MUST carry free text AND exactly one of the five Full
116
+ -- Idea sections. This pair is the reason the hall is the only possible voting
117
+ -- surface: a Discord reaction can express direction and nothing else, so
118
+ -- reaction-voting would make every rejection feedback-free — the precise thing
119
+ -- criterion C2 exists to prevent.
120
+ --
121
+ -- Section keys are the `base-v1` template in modules/ideas/templates.js — the
122
+ -- owner's own wording. A CHECK rather than a foreign key because that template
123
+ -- is a code declaration, not a table. If a project ever defines its own idea
124
+ -- shape (the goal-1000062 "simple base, built to be altered" promise), this
125
+ -- constraint is what must move, and it should move deliberately.
126
+ reason_md text,
127
+ section_key text CHECK (section_key IN
128
+ ('purpose', 'big_picture', 'why_had', 'why_matters', 'fit')),
129
+
130
+ cast_at timestamptz NOT NULL DEFAULT now(),
131
+
132
+ -- An objection without a reason and a flagged section is not an objection; a
133
+ -- 'yes' carries neither. Enforced here so no route can forget it.
134
+ CONSTRAINT government_board_votes_objection_is_reasoned
135
+ CHECK (
136
+ (direction = 'no' AND reason_md IS NOT NULL AND btrim(reason_md) <> ''
137
+ AND section_key IS NOT NULL)
138
+ OR
139
+ (direction = 'yes' AND reason_md IS NULL AND section_key IS NULL)
140
+ ),
141
+
142
+ -- One vote per member per item, on the `peer_votes` precedent (migration 058).
143
+ CONSTRAINT government_board_votes_one_per_voter UNIQUE (item_id, voter_id)
144
+ );
145
+
146
+ CREATE INDEX IF NOT EXISTS government_board_votes_by_item
147
+ ON government_board_votes (item_id);
148
+
149
+ COMMIT;
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.191",
3
+ "version": "1.19.192",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.191",
9
+ "version": "1.19.192",
10
10
  "license": "AGPL-3.0-or-later",
11
11
  "dependencies": {
12
12
  "express": "^4.21.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.191",
3
+ "version": "1.19.192",
4
4
  "description": "Cloud Bongos — the AI-first build platform core (GDS + platform surfaces + module system), installed as a versioned dependency (ADR 0108).",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "main": "src/platform-server.js",
package/src/module-api.js CHANGED
@@ -809,8 +809,10 @@ const { validateOrRespond, LIMITS, parseId, asyncHandler, corsPublicGet, parsePa
809
809
  // landed since 1.19.189 with no explicit bump. run 31983360426. (task 1002620)
810
810
  // 1.19.191 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
811
811
  // landed since 1.19.190 with no explicit bump. run 31983663234. (task 1002620)
812
+ // 1.19.192 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
813
+ // landed since 1.19.191 with no explicit bump. run 31984583069. (task 1002620)
812
814
  // ---------------------------------------------------------------------------
813
- const CORE_VERSION = '1.19.191'; // CI auto-patch carrier (ADR 0161); see changelog above
815
+ const CORE_VERSION = '1.19.192'; // CI auto-patch carrier (ADR 0161); see changelog above
814
816
 
815
817
  // A namespaced logger so a module's log lines are attributable + consistent.
816
818
  // Usage: const log = api.logger('dev-box'); log.info('mounted');
@@ -36,6 +36,7 @@ const NON_GRANT_MIGRATIONS = new Set([
36
36
  'governance_001_tables.sql', // creates the three tables
37
37
  'government_001_rename_from_governance.sql', // ADR 0174 table rename (task 1003004)
38
38
  'government_002_rename_permission_keys.sql', // ADR 0174 key rename (task 1003006)
39
+ 'government_003_board_tables.sql', // ADR 0175 Board Room schema (task 1003016)
39
40
  ]);
40
41
 
41
42
  // Permission keys RENAMED after the grant migrations that first granted them.