@htilabs/platform-common-models 0.54.0 → 0.55.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.
Files changed (33) hide show
  1. package/README.md +48 -0
  2. package/dist/authz/index.cjs.map +1 -1
  3. package/dist/authz/index.d.cts +10 -8
  4. package/dist/authz/index.d.ts +10 -8
  5. package/dist/authz/index.js.map +1 -1
  6. package/dist/{index-XWSYon40.d.cts → index-Bj-s0nZy.d.cts} +1 -1
  7. package/dist/{index-Bh1zO_Vu.d.ts → index-DvAypMJV.d.ts} +1 -1
  8. package/dist/index.cjs +152 -2
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +3 -3
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +145 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/models/index.d.cts +2 -2
  15. package/dist/models/index.d.ts +2 -2
  16. package/dist/schemas/index.d.cts +25 -25
  17. package/dist/schemas/index.d.ts +25 -25
  18. package/dist/sharing-ceiling/index.cjs +152 -2
  19. package/dist/sharing-ceiling/index.cjs.map +1 -1
  20. package/dist/sharing-ceiling/index.d.cts +214 -2
  21. package/dist/sharing-ceiling/index.d.ts +214 -2
  22. package/dist/sharing-ceiling/index.js +145 -2
  23. package/dist/sharing-ceiling/index.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/__tests__/core-function-default-bounds.test.ts +2 -2
  26. package/src/authz/functionDoor.ts +4 -4
  27. package/src/authz/resolveEffectiveFunctions.ts +6 -4
  28. package/src/sharingCeiling/__tests__/fireShareEvent.test.ts +437 -0
  29. package/src/sharingCeiling/fireShareEvent.ts +352 -0
  30. package/src/sharingCeiling/index.ts +4 -0
  31. package/src/sharingCeiling/resolve.ts +31 -5
  32. package/dist/{cvcEntry-D787utvP.d.cts → cvcEntry-BLeRivoF.d.cts} +8 -8
  33. package/dist/{cvcEntry-D787utvP.d.ts → cvcEntry-BLeRivoF.d.ts} +8 -8
package/README.md CHANGED
@@ -16,6 +16,54 @@ 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.55.0 — event-driven sharing's pure half: `ShareEvent` + `fireShareEvent(policies, event)` (additive; Kickoff 13 item 9a)
20
+
21
+ **What changed.** `/sharing-ceiling` (and the root) now export the one answer
22
+ to "this just happened on a case — which listeners fire, and to whom?":
23
+
24
+ - `fireShareEvent(policies, event, { alreadyFired? })` → `FiredShare[]`. A
25
+ listener is a policy with the `ongoing` cadence and a trigger
26
+ (`trigger.on`, CVC-285 event names), linked team → team or team → partner
27
+ (a `team_pair` assignment whose `teamId` is the acting team). Each answer
28
+ names the policy (id · family · name · version), its purpose, the link row
29
+ (`teamRowId`), the recipient in the resolver's own vocabulary
30
+ (`{ kind: "sibling_team", teamId }` / `{ kind: "partner", id }`,
31
+ `partnerTeamId` when the link names the partner's team), and a stable `key`
32
+ (event · subject · policy · sending team · recipient) so the same event on
33
+ the same case fires each listener once.
34
+ - `ShareEvent` (`event`, `teamId`, optional `accountId` / `caseId` /
35
+ `sessionId` / `ref`), `SHARE_EVENT` (`SESSION_SUBMITTED` = `sessionSubmitted`,
36
+ `CASE_CLOSED` = `caseCloseRuled`), `SHARE_TRIGGER_EVENTS` (the prototype's
37
+ ten trigger codes with labels), `shareTriggerLabel`, `policyIsShareListener`,
38
+ `shareListenersFor`, `firedShareKey`.
39
+ - `SharePolicyDoc` gains the two fields a listener is read from —
40
+ `cadences?: { ongoing?, automatic? }` and `trigger.on?: string[]` — and the
41
+ `team_pair` assignment gains `with?: { type, id }` (the other end of the
42
+ row, as the Admin Hub stores it: a team of the account's own, or the
43
+ partner's team). The ladder (`resolveShare`) reads none of them; nothing it
44
+ answers changes.
45
+ - Only the policy that HOLDS a row's cell for its purpose listens (the same
46
+ index the ladder reads), so the share a listener fires is governed by that
47
+ policy. Pass the account's team rows as `teamRows` and a link whose row is
48
+ gone, or no longer agrees with the document, fires nothing.
49
+ - The once-only subject (`ref`) defaults to the session for
50
+ `sessionSubmitted` and to the case for every other event; an event that can
51
+ repeat on one case needs an explicit `ref`. `key` is opaque.
52
+
53
+ **Pure, and it decides nothing about what leaves.** No I/O, no clock. The app
54
+ calls it AFTER the event's own write commits (session submit, case close),
55
+ then sends each answer as an ordinary share through its own send door —
56
+ `resolveShare` for the scope and the posture, a release that covers the
57
+ ongoing cadence for a partner. A share-back policy
58
+ (`trigger.answers === "received"`) never fires here. Home ruled by Crysta
59
+ 2026-11-01; contract of record: platform-prototype `src/data.js`
60
+ `policyIsListener` / `listenersFor` / `fireShareEvent`.
61
+
62
+ **Who needs to act.** Nobody until an app adopts it: Thread and PAVE call it
63
+ at session submit and case close (Kickoff 13 dev-facing spec § 6). Until the
64
+ platform stores policies and links (`registry_policies` + `policy_links`), an
65
+ app has no listener documents to pass and it returns `[]`.
66
+
19
67
  ## vehicleColor 1.0.0 + vehicleBodyType 1.0.0 — CVC-257 `core-vehicle_color` / CVC-258 `core-vehicle_body_type` / 0.54.0 (additive; two new domains, nothing existing changes)
20
68
 
21
69
  **What changed.** The Vehicle object's two descriptive vocabularies (IC-77