@bongos/core 1.24.6 → 1.24.8
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 +106 -46
- package/clients/bongos-client/README.md +1 -1
- package/clients/bongos-client/bongos-client.global.js +8 -0
- package/clients/bongos-client/index.cjs +8 -0
- package/clients/bongos-client/index.d.ts +13 -1
- package/clients/bongos-client/index.mjs +8 -0
- package/docs/adr/0371-auto-pickup-applies-a-submitted-tweak-on-the-runner.md +1 -0
- package/docs/api/openapi.json +264 -4
- package/docs/api-reference.md +7 -3
- package/docs/copy-inventory.md +41 -13
- package/docs/copy-registry.json +319 -35
- package/docs/module-api-changelog.md +4 -0
- package/docs/page-inventory.json +40 -4
- package/docs/page-readings.json +69 -9
- package/modules/government/decision-board.js +5 -0
- package/modules/government/decision-rules.js +3 -0
- package/modules/government/routes/government.js +2 -0
- package/modules/hall-ui/public/market-watch-rules-lib.js +207 -0
- package/modules/hall-ui/public/market-watch-rules.css +68 -0
- package/modules/hall-ui/public/market-watch-rules.html +54 -0
- package/modules/hall-ui/public/market-watch-rules.js +129 -0
- package/modules/hall-ui/public/market-watch-rules.states.json +17 -0
- package/modules/hall-ui/public/project-settings.html +4 -4
- package/modules/hall-ui/public/project-settings.js +51 -1
- package/modules/lifecycle/autopickup.js +26 -9
- package/modules/lifecycle/db-claims.js +1 -1
- package/modules/lifecycle/routes/project-settings.js +71 -10
- package/modules/market-watch/matter-acts.js +59 -0
- package/modules/market-watch/module.json +5 -4
- package/modules/market-watch/proposals.js +214 -0
- package/modules/market-watch/research.js +49 -8
- package/modules/market-watch/routes/rules.js +202 -0
- package/modules/market-watch/rules-logic.js +264 -0
- package/modules/market-watch/rules-view.js +165 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +12 -0
- package/scripts/bongos/government-walk.js +18 -2
- package/scripts/bongos/run-unit-tests.js +3 -0
- package/src/bongos/module-scope-map.js +2 -0
- package/src/bongos/project-settings.js +59 -15
- package/src/bongos/serve-internal.js +2 -1
- package/src/module-api.js +1 -1
- package/tests/autopickup_cap.mjs +203 -11
- package/tests/government_act_alone_buildings.mjs +3 -0
- package/tests/government_decision_rules.mjs +4 -1
- package/tests/governor_matter_acts.mjs +5 -1
- package/tests/hall_page_gate_map.mjs +3 -0
- package/tests/market_watch_module.mjs +1 -0
- package/tests/market_watch_rules.mjs +496 -0
- package/tests/market_watch_rules_db.mjs +133 -0
- package/tests/project_settings_page.mjs +8 -5
|
@@ -65,9 +65,11 @@ function buildRouterWithStubs({ timer, categories, reward = WORKING_REWARD }) {
|
|
|
65
65
|
list: gc.listCategories,
|
|
66
66
|
set: api.projectSettings.set,
|
|
67
67
|
resolveShipMode: api.projectSettings.resolveShipMode,
|
|
68
|
+
resolveTweak: api.projectSettings.resolveTweakAutopickup,
|
|
68
69
|
};
|
|
69
70
|
api.resolveRotDays = async () => timer;
|
|
70
71
|
api.projectSettings.resolveShipMode = async () => ({ mode: 'auto', source: 'default', chosen: false, invalid: null });
|
|
72
|
+
api.projectSettings.resolveTweakAutopickup = async () => ({ mode: 'off', cap: 200, rank_caps: {}, source: { mode: 'default', cap: 'default', rank_caps: 'default' }, invalid: [] });
|
|
71
73
|
// reward: WORKING_REWARD (default) | null (port absent) | 'throws' (rewardConfig raises).
|
|
72
74
|
const rewardPort = reward === 'throws'
|
|
73
75
|
? { rewardConfig: () => { throw new Error('reward boom'); } }
|
|
@@ -84,6 +86,7 @@ function buildRouterWithStubs({ timer, categories, reward = WORKING_REWARD }) {
|
|
|
84
86
|
gc.listCategories = saved.list;
|
|
85
87
|
api.projectSettings.set = saved.set;
|
|
86
88
|
api.projectSettings.resolveShipMode = saved.resolveShipMode;
|
|
89
|
+
api.projectSettings.resolveTweakAutopickup = saved.resolveTweak;
|
|
87
90
|
};
|
|
88
91
|
// The handler is the LAST layer on the matching route (requireBuilder and the
|
|
89
92
|
// permission gate sit in front); calling it directly is what keeps this a unit test
|
|
@@ -103,22 +106,22 @@ const CATS = [
|
|
|
103
106
|
{ id: 2, slug: 'retired-thing', label: 'Retired thing', sort_order: 20, active: false },
|
|
104
107
|
];
|
|
105
108
|
|
|
106
|
-
test('one read returns all
|
|
109
|
+
test('one read returns all seven fundamentals, each naming where its value came from', async () => {
|
|
107
110
|
const { handlerFor, restore } = buildRouterWithStubs({ timer: TIMER_OK, categories: CATS });
|
|
108
111
|
try {
|
|
109
112
|
const res = fakeRes();
|
|
110
113
|
await handlerFor('get', '/project-settings')({ query: {} }, res);
|
|
111
114
|
const rows = res.payload.rows;
|
|
112
|
-
assert.equal(rows.length,
|
|
115
|
+
assert.equal(rows.length, 7, 'the page draws seven rows, so the read returns seven');
|
|
113
116
|
assert.deepEqual(rows.map((r) => r.key),
|
|
114
|
-
['ship_mode', 'rot_timer', 'work_categories', 'credit_calculation', 'equity_calculation', 'upmarket_percent']);
|
|
117
|
+
['ship_mode', 'tweak_round_cap', 'rot_timer', 'work_categories', 'credit_calculation', 'equity_calculation', 'upmarket_percent']);
|
|
115
118
|
// Provenance is the point of the page: every row says where its value came from.
|
|
116
119
|
for (const r of rows) {
|
|
117
120
|
assert.ok(r.reads && r.reads.file, `${r.key} names no file`);
|
|
118
121
|
assert.ok(r.sentence && r.sentence.length > 20, `${r.key} has no readable sentence`);
|
|
119
122
|
}
|
|
120
|
-
//
|
|
121
|
-
assert.deepEqual(rows.filter((r) => r.editable).map((r) => r.key), ['ship_mode', 'rot_timer', 'work_categories']);
|
|
123
|
+
// Four knobs: the criterion's two, ship mode (task 1004628) and the monthly tweak-round cap (task 1005003).
|
|
124
|
+
assert.deepEqual(rows.filter((r) => r.editable).map((r) => r.key), ['ship_mode', 'tweak_round_cap', 'rot_timer', 'work_categories']);
|
|
122
125
|
// A no-store receipt: a cached settings read is wrong the moment a knob turns.
|
|
123
126
|
assert.equal(res.headers['Cache-Control'], 'no-store');
|
|
124
127
|
} finally { restore(); }
|