@bongos/core 1.19.366 → 1.19.368
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 +57 -27
- 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 +9 -1
- package/clients/bongos-client/index.mjs +8 -0
- package/docs/adr/0192-a-category-orients-and-authorises-nothing.md +97 -0
- package/docs/adr/README.md +1 -0
- package/docs/api/openapi.json +117 -1
- package/docs/api-reference.md +11 -3
- package/migrations/core_226_work_categories.sql +100 -0
- package/modules/dev-box/app/src/vendor/bongos-client.cjs +8 -0
- package/modules/lifecycle/db-goals.js +5 -5
- package/modules/lifecycle/goal-category.js +273 -0
- package/modules/lifecycle/routes/goals.js +38 -2
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/scripts/gds/category-advisory-guard.js +153 -0
- package/scripts/gds/fitness.js +6 -1
- package/scripts/gds/redteam-patrol.js +48 -8
- package/src/bongos/route-rank-check.js +11 -0
- package/src/module-api.js +5 -1
- package/tests/category_advisory_guard.mjs +135 -0
- package/tests/goal_category.mjs +199 -0
- package/tests/goal_tier.mjs +7 -5
- package/tests/redteam_patrol.mjs +70 -0
package/tests/redteam_patrol.mjs
CHANGED
|
@@ -128,3 +128,73 @@ test('filingBlocker reports a sessionless runner instead of exiting with re-auth
|
|
|
128
128
|
assert.doesNotMatch(r.stdout + r.stderr, /builder-reauth/,
|
|
129
129
|
'the sessionless path must not print interactive re-auth guidance into a cron log');
|
|
130
130
|
});
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// overrideVerdict (task 1003283, report 1000025). The first scheduled patrol run
|
|
134
|
+
// filed a medium saying `undici` was "pinned ^6.28.0 while latest is 8.10.0".
|
|
135
|
+
// It was wrong: 6.28.0 IS the newest 6.x, discord.js (the only consumer) requires
|
|
136
|
+
// the 6.x line, and npm audit finds nothing — acting on it would have broken the
|
|
137
|
+
// dependent, and ignoring it weekly is the alert-fatigue failure the patrol is
|
|
138
|
+
// supposed to avoid. These pin the narrower rule that replaced it.
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
test('a pin holding a major line on purpose is a NOTE, never a finding', () => {
|
|
142
|
+
// THE regression. An override exists precisely to hold a line; "latest is a
|
|
143
|
+
// higher major" is the expected steady state, not a defect.
|
|
144
|
+
const v = p.overrideVerdict({
|
|
145
|
+
name: 'undici', range: '^6.28.0', locked: '6.28.0',
|
|
146
|
+
satisfying: ['6.24.1', '6.27.0', '6.28.0'], latest: '8.10.0',
|
|
147
|
+
});
|
|
148
|
+
assert.equal(v.finding, undefined, 'a deliberate major pin must not file weekly forever');
|
|
149
|
+
assert.match(v.note, /trails the latest major/);
|
|
150
|
+
assert.match(v.note, /do NOT bump blind/);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test('a lock that trails what the pin already allows IS a finding — rot nobody chose', () => {
|
|
154
|
+
const v = p.overrideVerdict({
|
|
155
|
+
name: 'undici', range: '^6.28.0', locked: '6.27.0',
|
|
156
|
+
satisfying: ['6.27.0', '6.28.0'], latest: '8.10.0',
|
|
157
|
+
});
|
|
158
|
+
assert.equal(v.finding.severity, 'medium');
|
|
159
|
+
assert.match(v.finding.item, /locked at 6\.27\.0 but its own pin .* already allows 6\.28\.0/);
|
|
160
|
+
assert.equal(v.note, undefined, 'the actionable finding replaces the note, not doubles it');
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('a current pin with no newer major says nothing at all', () => {
|
|
164
|
+
const v = p.overrideVerdict({
|
|
165
|
+
name: 'x', range: '^3.1.0', locked: '3.4.0', satisfying: ['3.1.0', '3.4.0'], latest: '3.4.0',
|
|
166
|
+
});
|
|
167
|
+
assert.deepEqual(v, {});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
test('no npm data produces silence, not a guess', () => {
|
|
171
|
+
// A registry failure must not read as "the pin is fine" OR invent a finding —
|
|
172
|
+
// the caller adds an explicit skipped-check note instead.
|
|
173
|
+
assert.deepEqual(p.overrideVerdict({ name: 'x', range: '^3.0.0', locked: '3.0.0', satisfying: [], latest: null }), {});
|
|
174
|
+
assert.deepEqual(p.overrideVerdict(), {});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
test('a locked version OUTSIDE the declared range is not reported as a stale lock', () => {
|
|
178
|
+
// If the lock does not satisfy the range at all, the mismatch is a different
|
|
179
|
+
// (worse) problem than "refresh the lockfile", and this rule must not mislabel
|
|
180
|
+
// it — the `satisfying.includes(locked)` guard is what keeps that honest.
|
|
181
|
+
const v = p.overrideVerdict({
|
|
182
|
+
name: 'x', range: '^6.0.0', locked: '5.9.9', satisfying: ['6.0.0', '6.1.0'], latest: '6.1.0',
|
|
183
|
+
});
|
|
184
|
+
assert.equal(v.finding, undefined);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test('LIVE: the repo\'s own overrides produce no medium finding today', () => {
|
|
188
|
+
// The end state report 1000025 should have had. Uses the committed package.json
|
|
189
|
+
// + lockfile, with the registry answers stubbed to what they really are, so the
|
|
190
|
+
// assertion is hermetic but not fictional.
|
|
191
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
|
192
|
+
const lock = JSON.parse(fs.readFileSync(path.join(ROOT, 'package-lock.json'), 'utf8'));
|
|
193
|
+
const ranges = Object.entries(pkg.overrides || {}).filter(([, r]) => typeof r === 'string');
|
|
194
|
+
assert.ok(ranges.length > 0, 'this test is pointless if the repo declares no overrides');
|
|
195
|
+
for (const [name, range] of ranges) {
|
|
196
|
+
const locked = p.lockedVersion(lock, name);
|
|
197
|
+
const v = p.overrideVerdict({ name, range, locked, satisfying: [locked], latest: '99.0.0' });
|
|
198
|
+
assert.equal(v.finding, undefined, `${name} should not file a medium: ${JSON.stringify(v)}`);
|
|
199
|
+
}
|
|
200
|
+
});
|