@bongos/core 1.19.26 → 1.19.28

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,11 +2,11 @@
2
2
  "artifact": "bongos-core",
3
3
  "manifest_schema": 1,
4
4
  "generator": "scripts/gds/package-core.js",
5
- "core_version": "1.19.26",
6
- "core_contract": "1.19.26",
7
- "source_commit": "522fdcf67202b1961ce21cc5bb1e9e21f3455105",
5
+ "core_version": "1.19.28",
6
+ "core_contract": "1.19.28",
7
+ "source_commit": "10e31a3212982a5385e83bec33a5ba12b733929f",
8
8
  "source_ref": "HEAD",
9
- "built_at": "2026-08-11T13:25:13.567Z",
9
+ "built_at": "2026-08-11T14:01:24.503Z",
10
10
  "redaction": {
11
11
  "model": "docs-redacted+functional-verbatim",
12
12
  "docs_redacted": 285,
@@ -17,7 +17,7 @@
17
17
  "gate": "passed"
18
18
  },
19
19
  "file_count": 1511,
20
- "tree_sha256": "ecaa7b2c50ea700a1da02925b30bc638ccef3e362d27f47a50c59957afc232be",
20
+ "tree_sha256": "e1dee62e1e6e30b75671474f69e5e6b97f0ea598c9a66b5ad49867906f85e51d",
21
21
  "files": [
22
22
  {
23
23
  "path": ".claude/skills/blocker-review/SKILL.md",
@@ -2882,7 +2882,7 @@
2882
2882
  {
2883
2883
  "path": "modules/grading/grader.js",
2884
2884
  "mode": "0000644",
2885
- "sha256": "a08e9c017a07bffa311a9de6df007c30d9f3766c86d0ce2ec88660fed60d37aa"
2885
+ "sha256": "bc2b580d2be98f5b2acb9a0dd9416dd3c2cad387bbe61a6823e37102d3468675"
2886
2886
  },
2887
2887
  {
2888
2888
  "path": "modules/grading/module.json",
@@ -3362,7 +3362,7 @@
3362
3362
  {
3363
3363
  "path": "modules/lifecycle/github-push.js",
3364
3364
  "mode": "0000644",
3365
- "sha256": "c8f356746096a6fe39e456b12367d29b6bbf4e39df1515c09144c95e239f1b49"
3365
+ "sha256": "60b9338ed47d01e9f38fe3fa9f2f2cde6ff241b8e47efcb8fcf4c4f19d32c766"
3366
3366
  },
3367
3367
  {
3368
3368
  "path": "modules/lifecycle/goal-advisory.js",
@@ -3457,7 +3457,7 @@
3457
3457
  {
3458
3458
  "path": "modules/lifecycle/routes/tasks.js",
3459
3459
  "mode": "0000644",
3460
- "sha256": "f5041a43ea0a74bc6b16f8ceb6490c70090e7959e66f137c92040ee842db1ec0"
3460
+ "sha256": "aa179ab79508a002e8f580fb839767d8aaa8b6f02a46d021bb61633dd9f8f9a4"
3461
3461
  },
3462
3462
  {
3463
3463
  "path": "modules/lifecycle/routes/versions.js",
@@ -4002,12 +4002,12 @@
4002
4002
  {
4003
4003
  "path": "package-lock.json",
4004
4004
  "mode": "0000644",
4005
- "sha256": "08c0827545637895b730387d92d4a0ce7fef7b055a966cb88ab70e6be901880c"
4005
+ "sha256": "8ecf54691f56a0579f3d732323aebbe9620b3b46fa6f8711a959f20dac1cffaa"
4006
4006
  },
4007
4007
  {
4008
4008
  "path": "package.json",
4009
4009
  "mode": "0000644",
4010
- "sha256": "1ac1c894e7f11d5502855775e3f2ca37031927a68ec7e8dca447661b872467e5"
4010
+ "sha256": "d7dcf7da61008463a0e5ddb5da440f85bd845a2a0ea8d8125c2684dad24cdac6"
4011
4011
  },
4012
4012
  {
4013
4013
  "path": "public-docs/index.html",
@@ -5042,7 +5042,7 @@
5042
5042
  {
5043
5043
  "path": "scripts/gds/run-unit-tests.js",
5044
5044
  "mode": "0000644",
5045
- "sha256": "85712b5cd1e20a2d84646b117cbaadf0ee4903f278ca904eb863da4612ee937b"
5045
+ "sha256": "7f0ad4e54c0e5c251f00c78c7a6065d4a8db7bc88f0492c75bc63f8929108203"
5046
5046
  },
5047
5047
  {
5048
5048
  "path": "scripts/gds/sandbox-stage.js",
@@ -5627,7 +5627,7 @@
5627
5627
  {
5628
5628
  "path": "src/module-api.js",
5629
5629
  "mode": "0000644",
5630
- "sha256": "39b05d86d4fbb1035769ff0c30a97b21c75eea8ee145a25784789d17fb20aa38"
5630
+ "sha256": "b97afd8c79d048c057170fb03010be8d89f051cc8d4c43a2ecb85343785fe194"
5631
5631
  },
5632
5632
  {
5633
5633
  "path": "src/module-loader/loader.js",
@@ -6357,7 +6357,7 @@
6357
6357
  {
6358
6358
  "path": "tests/gate_approvals.mjs",
6359
6359
  "mode": "0000644",
6360
- "sha256": "900923ab39dee11de4c59ec977555346aa52ba875d12e2b4ca27013bf99e51c2"
6360
+ "sha256": "df503f198853f6fe3497a2e0317d90bee69cc275f024027ad569ee1cef0155b6"
6361
6361
  },
6362
6362
  {
6363
6363
  "path": "tests/gate_review.mjs",
@@ -6587,7 +6587,7 @@
6587
6587
  {
6588
6588
  "path": "tests/grade_server_authoritative.mjs",
6589
6589
  "mode": "0000644",
6590
- "sha256": "c650bd3c79d469f3ffb1cdada6f23521dd09c97844affd5b9e7f340d1796daa6"
6590
+ "sha256": "b0af74bc3b3e203716b13fbf3fc174a90f51daf659d5c5e5400725e85a0da4fc"
6591
6591
  },
6592
6592
  {
6593
6593
  "path": "tests/grade_unavailable_display.mjs",
@@ -645,6 +645,37 @@ function serverSideGuards(gradeResult, { committedFiles, builderRank, diffStats,
645
645
  if (clientPassed) downgradeTo = 'fail';
646
646
  }
647
647
 
648
+ // --- Guard 1b: vacuous permission-path input (task 1002646 / report 1000021 G-1) ---
649
+ // The pre-pass above pairs the SERVER-known rank with CLIENT-supplied
650
+ // committed_files, so omitting the list (or sending []) made the sub-floor
651
+ // protected-path check pass VACUOUSLY — zero files, zero hits, hardFail:false —
652
+ // a trusted-rank check applied to an untrusted, omittable diff. The server
653
+ // still cannot re-derive the feature-branch diff at grade time (boundary note
654
+ // above; the task-1002645 published tip is recorded at ci-land, AFTER the
655
+ // grade), but it can refuse to treat "no input" as "no hits": a caller below
656
+ // the registry's lowest floor submitting NO file list makes the check
657
+ // UNPROVABLE → fail closed. Honest ships are unaffected (ship.js always sends
658
+ // the real committed list — task 878 — and a floor-clearing rank never enters
659
+ // this branch). The dishonest-LIST case (a sub-floor caller sending an
660
+ // innocuous list while touching protected paths) stays owned by gate-review CI
661
+ // + the post-push main audit, which read the REAL diff. Unknown rank keeps
662
+ // failing open at this layer (isBelowFloor → false) — the main audit reads the
663
+ // real author rank from the DB and owns that case, exactly as for the pre-pass.
664
+ const submittedFileCount = Array.isArray(committedFiles)
665
+ ? committedFiles.filter((f) => typeof f === 'string' && f.trim()).length
666
+ : 0;
667
+ if (permissionPathCheck.isBelowFloor(builderRank) && submittedFileCount === 0) {
668
+ // Resolve the floor label from the registry at runtime (the D-16/N-3
669
+ // stale-string rule) — never a hardcoded rank name.
670
+ const floorRank = Object.keys(permissionPathCheck.RANK_TIER)
671
+ .find((r) => permissionPathCheck.RANK_TIER[r] === permissionPathCheck.MIN_TIER) || 'the floor';
672
+ guardsTripped.push({ guard: 'permission_path_unprovable', severity: 'blocker',
673
+ summary: `rank '${builderRank}' is below the protected-path floor ('${floorRank}') and the grade submitted no committed_files — the permission-path check cannot run on an empty list, so a client PASS cannot stand (fail closed; task 1002646 / SR-9). Remedy: re-run the ship — ship.js submits the real committed file list; a genuinely file-less (DB-only) change needs a ${floorRank}+ builder to land it via /tasks/:id/confirm.` });
674
+ extraIssues.push({ severity: 'blocker', file: '(grade)', summary:
675
+ `[server permission-path] no committed_files submitted by a rank below the '${floorRank}' floor — the protected-path check is unprovable and fails closed (task 1002646)`, worker: 'server-permission-path' });
676
+ if (clientPassed) downgradeTo = 'fail';
677
+ }
678
+
648
679
  // --- Guard 2: implausible client verdict (SR-9) ---
649
680
  // A client PASS with an empty issues[] on a non-trivial diff is not a credible
650
681
  // default-fail panel verdict. Downgrade to manual-confirm (a human lands it via
@@ -697,7 +728,7 @@ function serverSideGuards(gradeResult, { committedFiles, builderRank, diffStats,
697
728
  ...base,
698
729
  signals: {
699
730
  ...(base.signals || {}),
700
- server_guard: { applied: ['route_rank', 'permission_path', 'implausible_pass', 'forged_net_negative'], ok: true, tripped: [] },
731
+ server_guard: { applied: ['route_rank', 'permission_path', 'permission_path_unprovable', 'implausible_pass', 'forged_net_negative'], ok: true, tripped: [] },
701
732
  },
702
733
  };
703
734
  }
@@ -729,7 +760,7 @@ function serverSideGuards(gradeResult, { committedFiles, builderRank, diffStats,
729
760
  // body already ran; this is the authoritative post-hoc adjustment).
730
761
  confidence: forwardedConfidence,
731
762
  server_guard: {
732
- applied: ['route_rank', 'permission_path', 'implausible_pass', 'forged_net_negative'],
763
+ applied: ['route_rank', 'permission_path', 'permission_path_unprovable', 'implausible_pass', 'forged_net_negative'],
733
764
  ok: guardsTripped.length === 0,
734
765
  downgraded_to: downgradeTo,
735
766
  client_passed: clientPassed,
@@ -739,7 +770,9 @@ function serverSideGuards(gradeResult, { committedFiles, builderRank, diffStats,
739
770
  // the code. Named here so clients render it as a wall, not a quality
740
771
  // FAIL the builder should fix-and-retry (the envelope used to teach
741
772
  // exactly that wrong lesson). route_rank stays a code finding.
742
- authorization_refusal: guardsTripped.some((g) => g.guard === 'permission_path'),
773
+ // task 1002646: permission_path_unprovable is the same wall — the rank
774
+ // floor refusing an unverifiable diff — so it renders the same way.
775
+ authorization_refusal: guardsTripped.some((g) => g.guard === 'permission_path' || g.guard === 'permission_path_unprovable'),
743
776
  },
744
777
  },
745
778
  notes_md: `${base.notes_md || ''}${guardNote}`,
@@ -1002,6 +1002,10 @@ async function recheckPullRequest({ number }, deps = {}) {
1002
1002
  const { owner, repo } = repoInfo;
1003
1003
  const doFetch = deps.fetchImpl || fetch;
1004
1004
  const reopenDelayMs = Number.isFinite(deps.reopenDelayMs) ? deps.reopenDelayMs : RECHECK_REOPEN_DELAY_MS;
1005
+ // task 1002644: injectable so the unit test pins the sleep's PLACE in the
1006
+ // close→reopen sequence without a real timer — a wall-clock elapsed assertion
1007
+ // around a real sleep flaked the unit lane (the only required merge check).
1008
+ const doSleep = deps.sleepImpl || sleep;
1005
1009
  const api = `https://api.github.com/repos/${owner}/${repo}`;
1006
1010
  const patchState = async (state) => {
1007
1011
  const res = await doFetch(`${api}/pulls/${number}`, {
@@ -1018,7 +1022,7 @@ async function recheckPullRequest({ number }, deps = {}) {
1018
1022
  await patchState('closed');
1019
1023
  // Let GitHub register the close as a distinct state transition before reopening, so
1020
1024
  // the reopen actually dispatches a `pull_request: reopened` event (task 1241).
1021
- if (reopenDelayMs > 0) await sleep(reopenDelayMs);
1025
+ if (reopenDelayMs > 0) await doSleep(reopenDelayMs);
1022
1026
  const reopened = await patchState('open');
1023
1027
  let autoMerge = false;
1024
1028
  try {
@@ -1431,8 +1431,10 @@ module.exports = function buildTasksRouter() {
1431
1431
  // forged {ff:10,cq:10,issues:[]} to self-pass. serverSideGuards re-runs the
1432
1432
  // two DETERMINISTIC pre-passes here (route-rank against the server's own
1433
1433
  // route files; permission-path against the caller's LIVE, authoritative
1434
- // rank — req.builder.rank, read fresh from the DB per request), rejects an
1435
- // implausible empty-issues PASS on a non-trivial diff, and neutralizes an
1434
+ // rank — req.builder.rank, read fresh from the DB per request), fails a
1435
+ // sub-floor PASS that submitted NO committed_files closed (the check is
1436
+ // unprovable on an empty list — task 1002646 / report 1000021 G-1), rejects
1437
+ // an implausible empty-issues PASS on a non-trivial diff, and neutralizes an
1436
1438
  // obviously-forged net-negative credit signal (SR-18). It is DOWNGRADE-ONLY:
1437
1439
  // it can flip a client PASS to a hard FAIL or manual-confirm, but never
1438
1440
  // upgrades a fail and never relaxes the existing gate — so a legitimate
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.26",
3
+ "version": "1.19.28",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.26",
9
+ "version": "1.19.28",
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.26",
3
+ "version": "1.19.28",
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",
@@ -184,16 +184,31 @@ function main() {
184
184
  const runOne = (displayName, filePath) => {
185
185
  try {
186
186
  execFileSync(process.execPath, [filePath], {
187
- stdio: ['ignore', 'ignore', 'pipe'],
187
+ // task 1002644: stdout used to be IGNORED, so the failing assertion (test
188
+ // files print their FAIL lines to stdout) was discarded and the only
189
+ // context shown was the last 3 STDERR lines — often stale diagnostic
190
+ // noise from an EARLIER, PASSING test. The live example: gate_approvals'
191
+ // route-catch console.error dump made every failure in that file read as
192
+ // a GraphQL/network outage, and the real flaky assertion was invisible.
193
+ stdio: ['ignore', 'pipe', 'pipe'],
194
+ maxBuffer: 16 * 1024 * 1024,
188
195
  timeout: perTestTimeout,
189
196
  env: { ...process.env, NODE_ENV: 'test' },
190
197
  });
191
198
  console.log(` ok ${displayName}`);
192
199
  } catch (err) {
193
200
  const why = err.killed ? 'TIMEOUT' : `exit ${err.status}`;
194
- const stderr = (err.stderr ? err.stderr.toString() : '').trim().split('\n').slice(-3).join('\n ');
195
201
  console.log(` FAIL ${displayName} (${why})`);
196
- if (stderr) console.log(` ${stderr}`);
202
+ const stdoutText = (err.stdout ? err.stdout.toString() : '').trim();
203
+ // The actual failures first: the file's own FAIL lines, then its stdout
204
+ // tail (the last failure's assertion detail + summary), both bounded.
205
+ const failLines = stdoutText ? stdoutText.split('\n').filter((l) => /\bFAIL\b/.test(l)).slice(0, 5) : [];
206
+ for (const l of failLines) console.log(` ${l.trim()}`);
207
+ if (stdoutText) {
208
+ for (const l of stdoutText.split('\n').slice(-5)) console.log(` ${l}`);
209
+ }
210
+ const stderr = (err.stderr ? err.stderr.toString() : '').trim().split('\n').slice(-3).join('\n ');
211
+ if (stderr) console.log(` stderr: ${stderr}`);
197
212
  failures.push(displayName);
198
213
  }
199
214
  };
package/src/module-api.js CHANGED
@@ -479,8 +479,12 @@ const { validateOrRespond, LIMITS, parseId, asyncHandler, corsPublicGet, parsePa
479
479
  // landed since 1.19.24 with no explicit bump. run 31495418623. (task 1002620)
480
480
  // 1.19.26 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
481
481
  // landed since 1.19.25 with no explicit bump. run 31495996665. (task 1002620)
482
+ // 1.19.27 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
483
+ // landed since 1.19.26 with no explicit bump. run 31497212656. (task 1002620)
484
+ // 1.19.28 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
485
+ // landed since 1.19.27 with no explicit bump. run 31499228797. (task 1002620)
482
486
  // ---------------------------------------------------------------------------
483
- const CORE_VERSION = '1.19.26'; // CI auto-patch carrier (ADR 0161); see changelog above
487
+ const CORE_VERSION = '1.19.28'; // CI auto-patch carrier (ADR 0161); see changelog above
484
488
 
485
489
  // A namespaced logger so a module's log lines are attributable + consistent.
486
490
  // Usage: const log = api.logger('dev-box'); log.info('mounted');
@@ -208,21 +208,26 @@ await t('recheckPullRequest: waits between close and reopen so GitHub fires a di
208
208
  // into no net change and dispatches no `pull_request: reopened` event, so the
209
209
  // gate-review run never re-fires. recheckPullRequest must sleep BETWEEN the close
210
210
  // PATCH and the reopen PATCH (deps.reopenDelayMs, default 4s in prod) so the reopen
211
- // lands as a distinct state transition. We assert the delay elapses strictly between
212
- // the two PATCHes and not before the close / after the reopen.
211
+ // lands as a distinct state transition.
212
+ //
213
+ // task 1002644: this used to sleep a REAL 30ms and assert wall-clock elapsed >=
214
+ // 30 — Date.now() truncation + NTP slew on CI runners can read a punctual timer
215
+ // as 29ms, which flaked the unit lane (the ONLY required merge check, ADR 0162).
216
+ // Inject the sleep and assert its PLACE in the event sequence instead — strictly
217
+ // stronger (total elapsed never proved the wait sat BETWEEN the two PATCHes) and
218
+ // fully deterministic.
213
219
  const events = [];
214
- const delayMs = 30;
220
+ const delayMs = 4000; // the prod-default shape — never actually slept (injected)
215
221
  const fetchImpl = async (url, opts) => {
216
222
  const method = (opts && opts.method) || 'GET';
217
223
  if (method === 'PATCH') { events.push('patch:' + JSON.parse(opts.body).state); return jsonRes(200, { node_id: 'N1', state: JSON.parse(opts.body).state }); }
218
224
  if (url === 'https://api.github.com/graphql') { events.push('automerge'); return jsonRes(200, { data: { enablePullRequestAutoMerge: {} } }); }
219
225
  throw new Error('unexpected ' + url + ' ' + method);
220
226
  };
221
- const t0 = Date.now();
222
- await gp.recheckPullRequest({ number: 202 }, { token: 'T', repoInfo: REPO, fetchImpl, reopenDelayMs: delayMs });
223
- const elapsed = Date.now() - t0;
224
- assert.deepEqual(events, ['patch:closed', 'patch:open', 'automerge'], 'close then (after a wait) reopen then re-arm');
225
- assert.ok(elapsed >= delayMs, `total elapsed (${elapsed}ms) must be at least the configured reopen delay (${delayMs}ms)`);
227
+ const sleepImpl = async (ms) => { events.push(`sleep:${ms}`); };
228
+ await gp.recheckPullRequest({ number: 202 }, { token: 'T', repoInfo: REPO, fetchImpl, sleepImpl, reopenDelayMs: delayMs });
229
+ assert.deepEqual(events, ['patch:closed', `sleep:${delayMs}`, 'patch:open', 'automerge'],
230
+ 'the wait happens BETWEEN the close and the reopen — a coalesced close+reopen dispatches no reopened event');
226
231
  });
227
232
 
228
233
  // ===========================================================================
@@ -141,6 +141,93 @@ await test('route-rank hard-fail (forged routes dir) flips a client PASS to FAIL
141
141
  }
142
142
  });
143
143
 
144
+ // ========================================================================
145
+ // Guard 1b — vacuous permission-path input fails CLOSED (task 1002646 /
146
+ // report 1000021 G-1). The pre-pass pairs the server-known rank with
147
+ // CLIENT-supplied committed_files, so omitting the list (or sending []) made
148
+ // the sub-floor protected-path check pass vacuously — the exact bypass the
149
+ // report demonstrated. A sub-floor caller submitting NO file list now fails
150
+ // closed; honest ships always send the real list (task 878).
151
+ // ========================================================================
152
+
153
+ const ppc = require('../src/bongos/permission-path-check.js');
154
+ const REGISTRY_FLOOR = Object.keys(ppc.RANK_TIER).find((r) => ppc.RANK_TIER[r] === ppc.MIN_TIER);
155
+
156
+ await test('1002646 sub-floor PASS with committed_files ABSENT → hard FAIL (omission no longer bypasses the floor)', () => {
157
+ const g = grader.serverSideGuards(
158
+ clientGrade({ issues: [{ severity: 'nit', file: 'a', summary: 'x' }] }),
159
+ { committedFiles: null, builderRank: 'thetes', diffStats: { files_changed: 1, lines_added: 3, lines_removed: 1 } }
160
+ );
161
+ assert.equal(g.passed, false, 'omitting committed_files must not make the protected-path floor vacuous');
162
+ assert.equal(g.signals.server_guard.downgraded_to, 'fail');
163
+ assert.equal(g.signals.confidence, 0, 'fail forwards confidence 0 so the server gate also fails');
164
+ assert.ok(g.signals.server_guard.tripped.some((t) => t.guard === 'permission_path_unprovable'));
165
+ assert.ok(g.issues.some((i) => i.worker === 'server-permission-path'));
166
+ assert.equal(g.signals.server_guard.authorization_refusal, true,
167
+ 'the unprovable trip is the same rank wall as permission_path — not a quality verdict (task 1002614 shape)');
168
+ });
169
+
170
+ await test('1002646 sub-floor PASS with committed_files [] → hard FAIL (empty list is the same omission)', () => {
171
+ const g = grader.serverSideGuards(
172
+ clientGrade({ issues: [{ severity: 'nit', file: 'a', summary: 'x' }] }),
173
+ { committedFiles: [], builderRank: 'xenos', diffStats: { files_changed: 1, lines_added: 3, lines_removed: 1 } }
174
+ );
175
+ assert.equal(g.passed, false);
176
+ assert.equal(g.signals.server_guard.downgraded_to, 'fail');
177
+ assert.ok(g.signals.server_guard.tripped.some((t) => t.guard === 'permission_path_unprovable'));
178
+ });
179
+
180
+ await test('1002646 whitespace-only entries do not count as a submitted list → hard FAIL', () => {
181
+ const g = grader.serverSideGuards(
182
+ clientGrade({ issues: [{ severity: 'nit', file: 'a', summary: 'x' }] }),
183
+ { committedFiles: [' ', ''], builderRank: 'thetes', diffStats: { files_changed: 1, lines_added: 3, lines_removed: 1 } }
184
+ );
185
+ assert.equal(g.passed, false, 'padding the list with blanks is still an empty list');
186
+ assert.ok(g.signals.server_guard.tripped.some((t) => t.guard === 'permission_path_unprovable'));
187
+ });
188
+
189
+ await test('1002646 the refusal names the registry-resolved floor + the remedy (wave-5 speech standard)', () => {
190
+ const g = grader.serverSideGuards(
191
+ clientGrade({ issues: [{ severity: 'nit', file: 'a', summary: 'x' }] }),
192
+ { committedFiles: null, builderRank: 'xenos', diffStats: { files_changed: 1, lines_added: 3, lines_removed: 1 } }
193
+ );
194
+ const trip = g.signals.server_guard.tripped.find((t) => t.guard === 'permission_path_unprovable');
195
+ assert.ok(trip, 'the guard must be recorded');
196
+ assert.ok(trip.summary.includes(`'${REGISTRY_FLOOR}'`),
197
+ 'the floor name comes from the registry at runtime, never a hardcoded rank string (D-16/N-3)');
198
+ assert.match(trip.summary, /re-run the ship/i, 'carries the remedy');
199
+ assert.match(trip.summary, /\/tasks\/:id\/confirm/, 'names the file-less-change exit too');
200
+ });
201
+
202
+ await test('1002646 a floor-clearing rank with an absent list is NOT blocked (guard scoped to the floor)', () => {
203
+ const g = grader.serverSideGuards(clientGrade(), {
204
+ committedFiles: null, builderRank: 'metic',
205
+ diffStats: { files_changed: 1, lines_added: 2, lines_removed: 1 },
206
+ });
207
+ assert.equal(g.passed, true, 'the floor does not apply to metic+ — no new refusal for them (ADR 0162)');
208
+ assert.equal(g.signals.server_guard.ok, true);
209
+ });
210
+
211
+ await test('1002646 an honest sub-floor ship with a real, unprotected list still passes (no new gate on honest work)', () => {
212
+ const g = grader.serverSideGuards(
213
+ clientGrade({ issues: [{ severity: 'nit', file: 'docs/notes.md', summary: 'x' }] }),
214
+ { committedFiles: ['docs/notes.md'], builderRank: 'thetes', diffStats: { files_changed: 1, lines_added: 5, lines_removed: 1 } }
215
+ );
216
+ assert.equal(g.passed, true,
217
+ 'a real submitted list keeps working; the dishonest-LIST residual is owned by gate-review CI + the post-push main audit');
218
+ });
219
+
220
+ await test('1002646 downgrade-only: a sub-floor client FAIL with an absent list stays FAIL (no behavior change)', () => {
221
+ const failGrade = grader.validateAndScore(
222
+ { functional_fidelity: 3, code_quality: 3, confidence: 1, issues: [{ severity: 'blocker', file: 'a', summary: 'broken' }] },
223
+ {}
224
+ );
225
+ const g = grader.serverSideGuards(failGrade, {
226
+ committedFiles: null, builderRank: 'xenos', diffStats: { files_changed: 1, lines_added: 1, lines_removed: 1 },
227
+ });
228
+ assert.equal(g.passed, false, 'still failed — the guard only ever downgrades');
229
+ });
230
+
144
231
  // ========================================================================
145
232
  // Guard 2 — implausible empty-issues PASS on a non-trivial diff → manual-confirm.
146
233
  // ========================================================================