@htilabs/platform-common-models 0.41.0 → 0.42.1

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 CHANGED
@@ -16,6 +16,122 @@ 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
+ ## share-resolver / 0.42.1 (behaviour fix)
20
+
21
+ A row is OUTSIDE a governing list only when neither it nor anything beneath
22
+ it is covered. 0.42.0 withheld a GROUPING as a unit when the list named only
23
+ its rows (`instrument_summary` named through `summary_lap`): the grouping
24
+ landed in `excludedItems`, and `shareRowCeiling` then dropped the named rows
25
+ with it — Thread's inside-ceiling adoption found the `risk_only_handoff`
26
+ preset's seven screen summaries refused by the ceiling built from that very
27
+ preset. Now the uncovered rows are withheld each at their own grain and the
28
+ named ones stand. Same rule for the legacy cell chain's list, a field-group
29
+ limit (`infoScopeItems`) and the team ceiling's list.
30
+
31
+ **Consumers:** `excludedItems` / `teamExcludedItems` changed shape. A code is
32
+ withheld when it or an ancestor is listed; a grouping is listed only when
33
+ nothing beneath it is covered, so a grouping code's absence no longer means
34
+ the whole grouping may leave. For a send decision read `shareRowCeiling` +
35
+ `rowsOverCeiling`, never a grouping-code check against `excludedItems` alone.
36
+
37
+ ## share-resolver / 0.42.0 (additive)
38
+
39
+ 0.42.0 (Kickoff 13, GDR § 5.79 "ONE resolver per runtime") ships THE share
40
+ resolver beside the ceiling at `@htilabs/platform-common-models/sharing-ceiling`
41
+ (also from the root): `resolveShare(input)` — the one pure read Thread and
42
+ PAVE call to learn, for one sender (account + team) × one recipient × one
43
+ purpose, which **policy** governs and at which **level**, the **posture**,
44
+ whether the share is excluded as a whole, and which information-scope
45
+ **categories** may leave. Every answer names policy · version · level. The
46
+ contract of record is platform-prototype `src/data.js` @ becfab4
47
+ (`governingPolicyFor`, `effectiveCeiling`, `platformStarterScope`,
48
+ `scopeListCovers`); the vectors of its two behavioural smoke flows
49
+ (`one-resolver-k13`, `sharing-four-state-k13`) are the test suite.
50
+
51
+ What it reads, in order:
52
+
53
+ - **The ladder** (`governingPolicyFor`): the team-to-team row → [inside the
54
+ account: the account's inside default → the platform's inside starter (the
55
+ full record, open, v1) — stop] → the relationship (the partner id, or
56
+ `__external__`) → the account default → the Platform default (a versioned
57
+ document, `pol-starter-<purpose>`). One policy = one purpose; a policy that
58
+ ANSWERS shares received (`trigger.answers === "received"`) never governs a
59
+ send; a retired document governs nowhere. The index is built from each
60
+ document's `assignments` (`attachmentIndexFromPolicies`); `matchTeamRow`
61
+ finds the row the first rung reads, exactly as the prototype does.
62
+ - **The team ceiling**: the sending team's own policy for the purpose rides
63
+ as a ceiling on every rung's answer (inside the account too) when it is not
64
+ itself the governing one — only what both allow, the stricter posture,
65
+ never a widening.
66
+ - **Posture**: the relationship's, raised (never lowered) by the governing
67
+ policy, then by the ceiling. A `blocked` posture excludes a discretionary
68
+ share and CARVES OUT a report (`mandatory_reporting`, `authority_reporting`
69
+ — `SHARE_REPORTING_PURPOSES`, derived from the purpose, never a caller
70
+ flag): the posture still reads `blocked`, `reportCarveOut` names what
71
+ blocks ordinary sharing, and the share is not excluded. The account's
72
+ purpose switch (`purposeOff`) excludes the whole share, reports included —
73
+ the carve-out is a policy / partner-layer rule, the switch sits above it.
74
+ - **The Platform default as the four states** (`derivePlatformDefault`;
75
+ CVC-133 keys `always · default_on · default_off · never`, the words
76
+ Required · Default On · Default Off · Blocked): System metadata and a
77
+ category the platform requires for the purpose are Required and bypass
78
+ every account-grain clamp; an off-by-default (heightened) category is
79
+ Blocked for every account; the seed list covers a category by itself, by
80
+ an ancestor (a kind) or by any row of it; a Platform Admin's bound
81
+ overrides. Neither Required nor Blocked is read inside the account.
82
+ - **Which list binds** (K13-12): a synced account default or the raw
83
+ Platform default → the default's starting scope is the ceiling; an
84
+ authored policy (an edited account default, a relationship, a team row, an
85
+ inside default) → its own list, within the default's cap. A legacy cell
86
+ chain's list (`effectiveCeiling(...).allowed` from this same module) arrives
87
+ as `legacyCeiling` and stays a ceiling even over an authored policy.
88
+ - **Per category**: the account's Information Scope, the default's Blocked,
89
+ the binding list, the governing policy's list, the team ceiling's list —
90
+ then rows: the platform floor, heightened rows off in the account,
91
+ field-group limits (`infoScopeItems`), and a
92
+ category every row of which is withheld is withheld. `scopeListCovers`
93
+ reads a stored list the way the prototype does — a category, a kind above
94
+ it, or a row of it; never a flat `indexOf` (HANDOFF K13-14).
95
+
96
+ Helpers the apps adopt with: `platformDefaultFor(scope, purpose)` — the
97
+ Platform default from the PUBLISHED starter (day-one, version 1) with the
98
+ platform's Required list (`HTI_SHARE_PLATFORM_REQUIRED_BY_PURPOSE`: Identifying
99
+ information on every report), until the platform stores `pol-starter-<purpose>`
100
+ as a versioned document; `shareRowCeiling(resolution, scope)` — the ROW-grain
101
+ ceiling one answer amounts to (an allowed category by its code, or its rows minus
102
+ the withheld ones), which `maskSelectionToCeiling` (the composer) and
103
+ `rowsOverCeiling` (the send door) take as their ceiling; `legacyCeiling` takes
104
+ `effectiveCeiling`'s ANSWER and binds it only when an account rule answered — its
105
+ `platform_default` rung is the document the resolver already reads (passing that
106
+ as a list would clamp every authored policy to the starter and undo K13-12).
107
+
108
+ **The account's Information Scope starts from the codebook** (`accountScope`;
109
+ the prototype's clamps 4 / 4b). A CVC-236 heightened category or row
110
+ (`shareableDefault: false` — immigration & legal status, the full instrument
111
+ narratives) stays OFF until the account turns it on. `accountScope` carries
112
+ only the account's explicit choices: `categoriesOff` / `rowsOff` (switched
113
+ off) and `categoriesOn` / `rowsOn` (a heightened code turned on; turning a
114
+ grouping on does not turn on an off-by-default row beneath it). A caller that
115
+ omits `accountScope` gets the codebook's defaults — heightened information
116
+ held back, inside the account too — never everything. A code in both lists
117
+ is off.
118
+
119
+ Fail closed: an unknown purpose (no `platformDefault`) governs nothing —
120
+ `governing: null`, every category withheld. A document's `infoScope: null`
121
+ **or an absent `infoScope`** is "no category list" (the prototype reads every
122
+ non-array that way; the inside starter, a field-limits-only team ceiling and
123
+ a posture-only policy are written that way); an explicit `[]` binds an empty
124
+ list; a present value that is not a list of strings reads as `[]` (stricter
125
+ than the prototype). An assignment with an unknown `scope` is skipped.
126
+ `matchTeamRow` matches a sibling team's pair row on `their.id` alone, as the
127
+ prototype's `internalPairRow` does.
128
+
129
+ Left to the caller, deliberately: the partner row's direction / team-scoped
130
+ gates and item `restrictions`, the legacy `sharingPolicies` narrowing rows
131
+ (#451 moved them onto cards), the `byPurpose` virtual fork, and the
132
+ item-grain door (`rowsOverCeiling` / `maskSelectionToCeiling`, which take
133
+ `allowedCategories` as their ceiling).
134
+
19
135
  ## share-rules + sharing-ceiling defaults / 0.41.0 (additive)
20
136
 
21
137
  PAVE is adopting the shared Next Steps share window Thread already uses. The