@bongos/core 1.21.98 → 1.21.100
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 +38 -18
- package/GOVERNMENT.md +145 -0
- package/README.md +2 -0
- package/docs/adr/0371-auto-pickup-applies-a-submitted-tweak-on-the-runner.md +64 -0
- package/docs/adr/README.md +1 -0
- package/docs/module-api-changelog.md +4 -0
- package/docs/onboarding/primer.md +1 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +16 -0
- package/scripts/gds/government-walk.js +842 -0
- package/scripts/gds/publish-manifest.js +1 -0
- package/src/bongos/module-scope-map.js +1 -0
- package/src/module-api.js +1 -1
- package/tests/government_walk.mjs +56 -0
|
@@ -90,6 +90,7 @@ const PUBLISH_ALLOWLIST = [
|
|
|
90
90
|
'README.md',
|
|
91
91
|
'LICENSE',
|
|
92
92
|
'GOVERNANCE.md',
|
|
93
|
+
'GOVERNMENT.md', // the plain-language guide to a project's own government (task 1004659)
|
|
93
94
|
'CONTRIBUTING.md',
|
|
94
95
|
'CODE_OF_CONDUCT.md',
|
|
95
96
|
'docs/adr/', // sanitized — ADR 0065 §4 "docs/ADRs (sanitized)"
|
|
@@ -596,6 +596,7 @@ const UNOWNED_ROOTS = Object.freeze({
|
|
|
596
596
|
'CODE_OF_CONDUCT.md': 'project governance text',
|
|
597
597
|
'CONTRIBUTING.md': 'project governance text',
|
|
598
598
|
'GOVERNANCE.md': 'project governance text',
|
|
599
|
+
'GOVERNMENT.md': 'project governance text',
|
|
599
600
|
// Top-level product/design statements, read by humans before any module matters.
|
|
600
601
|
'README.md': 'repo front door',
|
|
601
602
|
'DESIGN.md': 'top-level design statement',
|
package/src/module-api.js
CHANGED
|
@@ -75,7 +75,7 @@ const { responsibilityFor, ROLE_RESPONSIBILITIES } = require('./role-responsibil
|
|
|
75
75
|
// MAJOR (see allowBoxScope below): passes the request through untouched.
|
|
76
76
|
function deprecatedNoopMiddleware(_req, _res, next) { next(); }
|
|
77
77
|
|
|
78
|
-
const CORE_VERSION = '1.21.
|
|
78
|
+
const CORE_VERSION = '1.21.100'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
|
|
79
79
|
|
|
80
80
|
// A namespaced logger so a module's log lines are attributable + consistent.
|
|
81
81
|
// Usage: const log = api.logger('discord'); log.info('mounted');
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// tests/government_walk.mjs — the government walk stays true (task 1004658, goal
|
|
2
|
+
// 1000111, criterion gov-proven-and-kept-proven).
|
|
3
|
+
//
|
|
4
|
+
// scripts/gds/government-walk.js walks a throwaway project's whole government —
|
|
5
|
+
// genesis, every form, every building's act-alone gate, every matter action — and
|
|
6
|
+
// writes the pass/fail table to docs/governance/government-walk.md. This runs the
|
|
7
|
+
// walk again in its own process (it points the instance root at a temp folder and
|
|
8
|
+
// swaps the government db layer for its in-memory store, so it must not share a
|
|
9
|
+
// module graph with other tests) and fails if ANY row differs from the committed
|
|
10
|
+
// table: a change that breaks a decision flips a row from PASS to FAIL here, and a
|
|
11
|
+
// fix to a filed bug flips one back, which asks for the table to be regenerated.
|
|
12
|
+
//
|
|
13
|
+
// Also pins the walk's own coverage, so it cannot quietly walk less: every bound
|
|
14
|
+
// route of every building has a request in the walk, and every router a bound route
|
|
15
|
+
// lives on is mounted.
|
|
16
|
+
//
|
|
17
|
+
// Run: node --test tests/government_walk.mjs
|
|
18
|
+
|
|
19
|
+
import { strict as assert } from 'node:assert';
|
|
20
|
+
import { test } from 'node:test';
|
|
21
|
+
import { spawnSync } from 'node:child_process';
|
|
22
|
+
import path from 'node:path';
|
|
23
|
+
import { createRequire } from 'node:module';
|
|
24
|
+
import { fileURLToPath } from 'node:url';
|
|
25
|
+
|
|
26
|
+
const require = createRequire(import.meta.url);
|
|
27
|
+
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
28
|
+
const SCRIPT = path.join(ROOT, 'scripts', 'gds', 'government-walk.js');
|
|
29
|
+
const walk = require(SCRIPT);
|
|
30
|
+
const dr = require(path.join(ROOT, 'modules', 'government', 'decision-rules.js'));
|
|
31
|
+
const decisionBoard = require(path.join(ROOT, 'modules', 'government', 'decision-board.js'));
|
|
32
|
+
|
|
33
|
+
test('the walk covers every bound route of every building', () => {
|
|
34
|
+
const bound = dr.AREAS.flatMap((a) => a.acts).sort();
|
|
35
|
+
assert.deepEqual(Object.keys(walk.REQUESTS).sort(), bound, 'a route added to decision-rules AREAS[].acts needs a request in the walk');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('the walk passes a matter for every action a passed matter can carry out', () => {
|
|
39
|
+
const planned = walk.MATTER_PLAN.map(([area, , action]) => `${area}.${action.type}`).sort();
|
|
40
|
+
const actions = Object.entries(decisionBoard.MATTER_ACTIONS)
|
|
41
|
+
.flatMap(([area, acts]) => Object.keys(acts).map((type) => `${area}.${type}`)).sort();
|
|
42
|
+
assert.ok(actions.length > 0, 'the matter-action table is not empty');
|
|
43
|
+
assert.deepEqual(planned, actions, 'a new matter action needs a matter in the walk');
|
|
44
|
+
// and every planned action is one the server would accept as written
|
|
45
|
+
for (const [area, , action] of walk.MATTER_PLAN) {
|
|
46
|
+
assert.equal(decisionBoard.validateMatterAction(area, action).ok, true, `${area} ${action.type} validates`);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('the walk re-runs and matches the committed pass/fail table', () => {
|
|
51
|
+
const env = { ...process.env };
|
|
52
|
+
delete env.DATABASE_URL;
|
|
53
|
+
const r = spawnSync(process.execPath, [SCRIPT, '--check'], { cwd: ROOT, env, encoding: 'utf8', timeout: 240000 });
|
|
54
|
+
assert.equal(r.status, 0, `government-walk --check failed (exit ${r.status}):\n${r.stdout}\n${r.stderr}`);
|
|
55
|
+
assert.match(r.stdout, /matches the committed table/);
|
|
56
|
+
});
|