@bongos/core 1.19.579 → 1.19.580

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.
Files changed (33) hide show
  1. package/.bongos-core.json +60 -35
  2. package/clients/bongos-client/README.md +1 -1
  3. package/clients/bongos-client/bongos-client.global.js +2 -0
  4. package/clients/bongos-client/index.cjs +2 -0
  5. package/clients/bongos-client/index.d.ts +4 -0
  6. package/clients/bongos-client/index.mjs +2 -0
  7. package/docs/adr/0260-the-application-is-the-consent-and-the-echo-is-the-gate.md +146 -0
  8. package/docs/adr/README.md +1 -0
  9. package/docs/api/openapi.json +73 -3
  10. package/docs/api-reference.md +3 -2
  11. package/docs/copy-inventory.md +21 -18
  12. package/docs/copy-registry.json +50 -23
  13. package/docs/file-map.md +1 -0
  14. package/docs/module-api-changelog.md +2 -0
  15. package/modules/dev-box/app/src/vendor/bongos-client.cjs +2 -0
  16. package/modules/hall-ui/public/oversight.css +7 -0
  17. package/modules/hall-ui/public/watch.js +75 -0
  18. package/modules/onboarding/routes/access-requests.js +56 -1
  19. package/modules/platform-identity/applicant-profile.js +158 -0
  20. package/modules/platform-identity/application-echo.js +50 -0
  21. package/modules/platform-identity/recruiter-sliver.js +19 -0
  22. package/modules/platform-identity/routes/sso.js +126 -0
  23. package/package-lock.json +2 -2
  24. package/package.json +1 -1
  25. package/src/bongos/auth-admission.js +61 -0
  26. package/src/bongos/auth.js +2 -1
  27. package/src/module-api.js +11 -1
  28. package/tests/adr_renumber_integrity.mjs +84 -0
  29. package/tests/applicant_profile_boundary.mjs +641 -0
  30. package/tests/applicant_profile_read_bounds.mjs +95 -0
  31. package/tests/module_api.mjs +1 -0
  32. package/tests/recruiter_sliver_boundary.mjs +35 -2
  33. package/tests/watch_applications_queue.mjs +94 -0
@@ -0,0 +1,84 @@
1
+ // tests/adr_renumber_integrity.mjs — a renumbered ADR must move ALL of itself
2
+ // (task 1003681, from a grader finding).
3
+ //
4
+ // Renumbering an ADR is not one edit, it is four, and `fitness.js` only checks
5
+ // two of them (numbers are unique, and the index has one row per file). This
6
+ // pins the other two, plus the class of stale reference that caused the finding.
7
+ //
8
+ // THE INCIDENT. Task 1002972's branch authored ADR 0241 while main landed a
9
+ // DIFFERENT 0241; the collision failed fitness and stranded the PR for four
10
+ // days. Renumbering the never-landed one to 0260 moved its filename, its
11
+ // heading and its index row's link — but left its own session log still saying
12
+ // "ADR 0241" in prose, twice. Because 0241 is a REAL, DIFFERENT, ALREADY-LANDED
13
+ // ADR, that is worse than a dangling link: a reader follows it and arrives,
14
+ // with no error, at the wrong decision. `docs-entropy.js` cannot see this — it
15
+ // resolves LINKS, and these were bare prose references to a number that does
16
+ // resolve, just to something else.
17
+ //
18
+ // What each check would have caught:
19
+ // • heading vs filename — a rename that forgot the `# ADR NNNN` line
20
+ // • index row number vs its own link target — a row renumbered IN PLACE
21
+ // (which is also how the row ended up sorted between 0240 and 0241)
22
+ // • the session log's references — the finding itself, as a regression pin
23
+ //
24
+ // Run: node --test --test-reporter=tap tests/adr_renumber_integrity.mjs
25
+
26
+ import assert from 'node:assert/strict';
27
+ import { test } from 'node:test';
28
+ import fs from 'node:fs';
29
+ import path from 'node:path';
30
+ import { fileURLToPath } from 'node:url';
31
+
32
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
33
+ const ADR_DIR = path.join(ROOT, 'docs', 'adr');
34
+
35
+ const adrFiles = fs
36
+ .readdirSync(ADR_DIR)
37
+ .filter((f) => f.endsWith('.md') && /^\d{4}-/.test(f))
38
+ .sort();
39
+
40
+ test('every ADR file’s heading carries its own number — a rename must move the heading too', () => {
41
+ assert.ok(adrFiles.length > 200, 'the ADR corpus should be substantial; a tiny count means the glob broke');
42
+ const wrong = [];
43
+ for (const f of adrFiles) {
44
+ const fileNum = /^(\d{4})-/.exec(f)[1];
45
+ const first = fs.readFileSync(path.join(ADR_DIR, f), 'utf8').split(/\r?\n/)[0];
46
+ // both conventions ship in this corpus: "# ADR 0259 — …" and "# 0001 — …"
47
+ const heading = /^#\s*(?:ADR\s*)?(\d{4})\b/.exec(first);
48
+ if (!heading) { wrong.push(`${f} :: heading carries no number (${first.slice(0, 60)})`); continue; }
49
+ if (heading[1] !== fileNum) wrong.push(`${f} :: heading says ${heading[1]}`);
50
+ }
51
+ assert.deepEqual(wrong, [], 'an ADR whose heading and filename disagree is a half-finished renumber');
52
+ });
53
+
54
+ test('every index row’s number matches the file it links — a row renumbered in place is caught here', () => {
55
+ const readme = fs.readFileSync(path.join(ADR_DIR, 'README.md'), 'utf8');
56
+ const rows = readme.split(/\r?\n/).filter((l) => /^\|\s*\d{4}\s*\|/.test(l));
57
+ assert.ok(rows.length > 200, 'the index should carry a row per ADR');
58
+ const wrong = [];
59
+ for (const row of rows) {
60
+ const rowNum = /^\|\s*(\d{4})\s*\|/.exec(row)[1];
61
+ // A row's summary CITES many other ADRs, so the first `](NNNN-….md)` is
62
+ // usually a citation. The row's OWN target is the one closing its
63
+ // `[**Title**](…)` cell — i.e. the last link before the trailing category
64
+ // cell. Matching the first one instead reports ~60 false mismatches.
65
+ const link = /\]\((\d{4})-[^)]*\.md\)\s*\|[^|]*\|\s*$/.exec(row);
66
+ if (!link) continue; // a handful of legacy rows link elsewhere or not at all
67
+ if (link[1] !== rowNum) wrong.push(`row ${rowNum} links ${link[1]}-…`);
68
+ }
69
+ assert.deepEqual(wrong, [], 'a row whose number and link disagree sends every citation to the wrong ADR');
70
+ });
71
+
72
+ test('the ADR that was renumbered out of a collision leaves no reference to its old number (task 1003681)', () => {
73
+ // The regression itself. 0241 is a real, different, landed ADR — so a stale
74
+ // reference here resolves silently to the wrong decision rather than 404ing,
75
+ // which is exactly why no link checker flagged it.
76
+ const log = path.join(ROOT, 'docs', 'session-logs', '2026-09-03-goal-1000045-applicant-profile-d7.md');
77
+ const src = fs.readFileSync(log, 'utf8');
78
+ assert.doesNotMatch(src, /ADR 0241\b/, 'this task’s ADR moved to 0260; 0241 now names the artist-gate decision');
79
+ assert.match(src, /ADR 0260\b/, 'the log must cite the decision it actually produced');
80
+ assert.ok(
81
+ fs.existsSync(path.join(ADR_DIR, '0260-the-application-is-the-consent-and-the-echo-is-the-gate.md')),
82
+ 'and that ADR must exist under the number the log now cites',
83
+ );
84
+ });