@htilabs/platform-common-models 0.80.0 → 0.81.0
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/README.md +17 -0
- package/dist/{index-Bj-s0nZy.d.cts → index-1pWiqEBC.d.cts} +1 -1
- package/dist/{index-DvAypMJV.d.ts → index-uz57Fic9.d.ts} +1 -1
- package/dist/index.cjs +33 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/schemas/index.d.cts +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/sharing-ceiling/index.cjs +33 -3
- package/dist/sharing-ceiling/index.cjs.map +1 -1
- package/dist/sharing-ceiling/index.d.cts +11 -7
- package/dist/sharing-ceiling/index.d.ts +11 -7
- package/dist/sharing-ceiling/index.js +33 -3
- package/dist/sharing-ceiling/index.js.map +1 -1
- package/dist/validation/index.d.cts +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/sharingCeiling/__tests__/fixtures_starterVerdicts.json +1727 -0
- package/src/sharingCeiling/__tests__/personContactRows.test.ts +185 -0
- package/src/sharingCeiling/coverage.ts +55 -6
- package/src/sharingCeiling/resolve.ts +31 -8
- package/dist/{agency-CnVTwLeV.d.ts → agency-BHv54o79.d.ts} +4 -4
- package/dist/{agency-8ufZJJDH.d.cts → agency-Djp57S71.d.cts} +4 -4
- package/dist/{cvcEntry-BLeRivoF.d.cts → cvcEntry-DAuhe0cd.d.cts} +16 -16
- package/dist/{cvcEntry-BLeRivoF.d.ts → cvcEntry-DAuhe0cd.d.ts} +16 -16
package/README.md
CHANGED
|
@@ -16,6 +16,23 @@ Package exports are organized into a public root API and a small number of
|
|
|
16
16
|
dedicated subpaths (`/validation`, `/cvcs`) — consult `package.json` for the
|
|
17
17
|
authoritative `exports` map.
|
|
18
18
|
|
|
19
|
+
## 0.81.0 — an internal referral carries other people's phones and emails again: the per-kind "Contact & safety" rows are no longer withheld as "under the platform safety floor" (sharing ceiling; CVC-236 `core-information_scope` unchanged)
|
|
20
|
+
|
|
21
|
+
**What changed.** Another person's phones, emails and contact log (the person who caused harm, an eligible family member, another person on the case) ride that person's **Contact & safety** row (`offenders.contact` · `family.contact` · `others.contact`): canon homes them on `contact_info` and rule 1 routes them to the deepest per-kind row whose `kindRow` is that home or an ancestor (prototype `resolveHome`; the scope tree, `INFOSCOPE_TREE_V4_PROPOSAL_2026-10-08.md`: "offenders.contact — their phones / emails — shareable yes"). Each of those rows has one child, `<kind>.safe_locations`, the platform floor. `resolveShare` counted that one floor child as "every leaf withheld" and withheld the whole row ("Never shared — under the platform safety floor"), so `shareRowCeiling` never listed it and Thread's and PAVE's composers masked it away: an internal share under the inside starter offered 3 fewer categories than the prototype's full record (`shareFullRecordIds`, whose catalog lists no floor row) and carried no other person's phone or email.
|
|
22
|
+
|
|
23
|
+
- `hasOwnScopeContent` reads rule 1 as canon does: a per-kind row holds every client field home that routes to it (`contact_info` → `<kind>.contact`). Rows with no children gain the flag too (`<kind>.services`, `<kind>.instrument_summary`, …); no verdict reads it there.
|
|
24
|
+
- `resolveShare`'s group flip skips a category that has fields of its own and whose every leaf is under the floor.
|
|
25
|
+
- `shareRowCeiling` lists such a category itself (only floor rows withheld beneath it).
|
|
26
|
+
- The floor still never leaves: under a bound ceiling a row under the floor is within only when the list names it itself, never through a listed ancestor, and `maskSelectionToCeiling` drops a floor row the ceiling does not name.
|
|
27
|
+
|
|
28
|
+
**Verdicts that move (platform starter, no account rule; every other verdict pinned unchanged in `src/sharingCeiling/__tests__/fixtures_starterVerdicts.json`):**
|
|
29
|
+
|
|
30
|
+
| Purpose × recipient | Now allowed |
|
|
31
|
+
|---|---|
|
|
32
|
+
| every purpose, inside the account (`sibling_team`) | `offenders.contact` · `family.contact` · `others.contact` |
|
|
33
|
+
| `mandatory_reporting`, `authority_reporting` to a partner or off-platform | `family.contact` (the starter lists the whole Eligible family members branch, `family`) |
|
|
34
|
+
|
|
35
|
+
Note: the Platform prototype's `HTI_SHARE_POLICY_API.effectiveCeiling` (`src/data.js`) counts the floor item in its group flip and would still withhold these rows; the monolith, which builds and sends the share, never does. This release follows the monolith and the scope-tree ruling.
|
|
19
36
|
## 0.80.0 — seatAppAccess: a seat's app access from its teams, inside the account's grant (additive, `./authz` and the root)
|
|
20
37
|
|
|
21
38
|
**What changed.** One shared answer to "may this person open this app?" for Thread's and PAVE's sign-in doors and the platform's app tiles (Kickoff 08c), so the three stop deciding from the Auth0 role alone.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-
|
|
1
|
+
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-DAuhe0cd.cjs';
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import { HydratedDocument, Connection, Model } from 'mongoose';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-
|
|
1
|
+
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-DAuhe0cd.js';
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import { HydratedDocument, Connection, Model } from 'mongoose';
|
|
4
4
|
|
package/dist/index.cjs
CHANGED
|
@@ -28374,10 +28374,11 @@ function treeFacts(scope) {
|
|
|
28374
28374
|
const coverageChildren = memoize(
|
|
28375
28375
|
(code) => Object.freeze(scope.childrenOf(code).filter(isCoverageRow))
|
|
28376
28376
|
);
|
|
28377
|
+
const kindHomed = kindHomedRows(scope);
|
|
28377
28378
|
const hasOwnContent = memoize((code) => {
|
|
28378
28379
|
const row = scope.row(code);
|
|
28379
28380
|
if (row === void 0) return false;
|
|
28380
|
-
const homed = INFORMATION_SCOPE_FIELD_HOME_ROWS.has(code) ||
|
|
28381
|
+
const homed = INFORMATION_SCOPE_FIELD_HOME_ROWS.has(code) || kindHomed.has(code);
|
|
28381
28382
|
if (!homed) return false;
|
|
28382
28383
|
return !scope.childrenOf(code).some((c) => scope.row(c)?.rowType === "category_rest" && isLive(c));
|
|
28383
28384
|
});
|
|
@@ -28392,6 +28393,28 @@ function treeFacts(scope) {
|
|
|
28392
28393
|
factsCache.set(scope, facts);
|
|
28393
28394
|
return facts;
|
|
28394
28395
|
}
|
|
28396
|
+
function kindHomedRows(scope) {
|
|
28397
|
+
const perKind = /* @__PURE__ */ new Map();
|
|
28398
|
+
const kinds = /* @__PURE__ */ new Map();
|
|
28399
|
+
for (const r of scope.rows) {
|
|
28400
|
+
if (r.status === "retired" || r.kindBranch === null) continue;
|
|
28401
|
+
if (r.rowType === "person_type") kinds.set(r.kindBranch, r.scopeCode);
|
|
28402
|
+
else if (r.kindRow !== void 0) perKind.set(`${r.kindBranch}\0${r.kindRow}`, r.scopeCode);
|
|
28403
|
+
}
|
|
28404
|
+
const out = /* @__PURE__ */ new Set();
|
|
28405
|
+
for (const home of INFORMATION_SCOPE_FIELD_HOME_ROWS) {
|
|
28406
|
+
const row = scope.row(home);
|
|
28407
|
+
if (row === void 0 || row.specialDataType === "criminal_intelligence") continue;
|
|
28408
|
+
const chain = scope.ancestorsOf(home);
|
|
28409
|
+
if (scope.row(chain[chain.length - 1])?.rowType !== "branch") continue;
|
|
28410
|
+
for (const [kind, root] of kinds) {
|
|
28411
|
+
if (chain.includes(root)) continue;
|
|
28412
|
+
const hit = chain.map((c) => perKind.get(`${kind}\0${c}`)).find((c) => c !== void 0);
|
|
28413
|
+
if (hit !== void 0) out.add(hit);
|
|
28414
|
+
}
|
|
28415
|
+
}
|
|
28416
|
+
return out;
|
|
28417
|
+
}
|
|
28395
28418
|
function asCeilingSet(allowed) {
|
|
28396
28419
|
if (allowed === null) return null;
|
|
28397
28420
|
if (allowed instanceof Set) return allowed;
|
|
@@ -28416,6 +28439,7 @@ function ceilingCoverage(scope, allowed) {
|
|
|
28416
28439
|
let out;
|
|
28417
28440
|
if (!facts.isLive(code)) out = false;
|
|
28418
28441
|
else if (set === null) out = true;
|
|
28442
|
+
else if (facts.underFloor(code)) out = set.has(code);
|
|
28419
28443
|
else if (scope.ancestorsOf(code).some((c) => set.has(c))) out = true;
|
|
28420
28444
|
else if (facts.hasOwnContent(code)) out = false;
|
|
28421
28445
|
else {
|
|
@@ -28513,6 +28537,10 @@ function maskSelectionToCeiling(scope, selection, allowed) {
|
|
|
28513
28537
|
for (const child of scope.childrenOf(code)) if (!sel.includes(child)) sel.push(child);
|
|
28514
28538
|
}
|
|
28515
28539
|
for (const code of outside) sel = subtractRow(scope, sel, code);
|
|
28540
|
+
if (asCeilingSet(allowed) !== null) {
|
|
28541
|
+
const within = ceilingCoverage(scope, allowed);
|
|
28542
|
+
sel = sel.filter((c) => !facts.underFloor(c) || within(c));
|
|
28543
|
+
}
|
|
28516
28544
|
return withSystemInfo(sel.filter((c) => facts.isLive(c)));
|
|
28517
28545
|
}
|
|
28518
28546
|
function isPermittedByCeiling(scope, ceiling, code) {
|
|
@@ -28794,7 +28822,8 @@ function shareRowCeiling(resolution, scope) {
|
|
|
28794
28822
|
...e.teamExcludedItems,
|
|
28795
28823
|
...e.floorItems
|
|
28796
28824
|
]);
|
|
28797
|
-
|
|
28825
|
+
const onlyFloorWithheld = [...withheld].every((r) => e.floorItems.includes(r));
|
|
28826
|
+
if (withheld.size === 0 || onlyFloorWithheld && hasOwnScopeContent(scope, g)) {
|
|
28798
28827
|
out.push(g);
|
|
28799
28828
|
continue;
|
|
28800
28829
|
}
|
|
@@ -29186,7 +29215,8 @@ function resolveShare(input) {
|
|
|
29186
29215
|
teamExcludedItems.push(r);
|
|
29187
29216
|
if (teamExcludedItems.length > 0) teamExcludedReason = why;
|
|
29188
29217
|
}
|
|
29189
|
-
|
|
29218
|
+
const floorOnlyOwnContent = leaves.length > 0 && leaves.every((r) => floorItems.includes(r)) && hasOwnScopeContent(scope, g);
|
|
29219
|
+
if (allowed && (!req || platformRequired !== null) && leaves.length > 0 && !floorOnlyOwnContent) {
|
|
29190
29220
|
const gone = new Set(
|
|
29191
29221
|
[...floorItems, ...excludedItems, ...teamExcludedItems].filter(
|
|
29192
29222
|
(r) => leaves.includes(r)
|