@geonosis/policy 2.3.1 → 2.4.3

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 (2) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/package.json +2 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,130 @@
1
+ # @geonosis/policy
2
+
3
+ ## 2.4.3
4
+
5
+ ## 2.4.2
6
+
7
+ ## 2.4.1
8
+
9
+ ## 2.4.0
10
+
11
+ ## 2.3.1
12
+
13
+ ## 2.3.0
14
+
15
+ ## 2.2.0
16
+
17
+ ## 2.1.0
18
+
19
+ ## 2.0.0
20
+
21
+ ### Minor Changes
22
+
23
+ - 6c88bf1: The compile-time tier: `declareThreshold({ value, authority, reason })`, frozen, refused at the
24
+ declaration when it is incomplete, with a `revisit` that is reported rather than thrown. And
25
+ `verify-arch`'s `thresholds` pack, which makes a threshold with no authority — and one name with two
26
+ values — a finding.
27
+
28
+ ## 1.4.0
29
+
30
+ ## 1.3.0
31
+
32
+ ### Minor Changes
33
+
34
+ - 79a2880: **The packages a CommonJS backend imports ship a CJS build (#108).** A Medusa backend is
35
+ `module: Node16` CommonJS by upstream requirement, not by preference, and an ESM-only package is a
36
+ wall no amount of parity gets over: dielime measured `@geonosis/testbed` at 15/15 identical and
37
+ still could not adopt it. A static import is TS1479, and `await import()` cannot serve the
38
+ synchronous `describe()` registration its 107 suites are built on.
39
+
40
+ `@geonosis/testbed`, `@geonosis/events`, `@geonosis/policy`, `@geonosis/integrations` and
41
+ `@geonosis/observability` — every subpath of each — now build `esm` and `cjs`, and every export names both conditions with its OWN
42
+ `types`: `.d.ts` under `import`, `.d.cts` under `require`. A `.d.ts` written for an ES module is the
43
+ wrong file for the require branch, and TypeScript reads it anyway when that branch names no other.
44
+ No other package changed.
45
+
46
+ Held by a compile probe, not by a claim: a scratch `module: Node16` CommonJS project links all four,
47
+ statically imports and `import x = require(…)`s every subpath, and `tsc --noEmit` must pass with no
48
+ TS1479 — plus a real `require()` in a real CommonJS process. The size of the second build, from
49
+ `npm pack`: testbed 131,829 B unpacked of which 51,120 B is the new half (38 %), events 65,884 /
50
+ 22,418 (34 %), policy 182,089 / 83,350 (45 %), integrations 52,455 / 14,780 (28 %), observability
51
+ 142,738 / 50,669 (35 %).
52
+
53
+ `geonosis-observability`, the bin, stays ESM alone: nothing `require()`s a bin, and its entry opens
54
+ with a top-level await that esbuild cannot express in CommonJS at all. Building it twice would mean
55
+ rewriting a working entry point for a consumer that does not exist, so that package builds its
56
+ library and its CLI as two configurations.
57
+ - f37950f: `definePolicy` refuses a `Set` for `scopeKeys` at runtime — the order IS the precedence lattice and a Set has none — and the new `assertScopeOrder(policy, expected)` export pins that order in a consumer's tests (dielime Block D, #110).
58
+
59
+ ## 1.2.0
60
+
61
+ ## 1.1.0
62
+
63
+ ## 1.0.1
64
+
65
+ ### Patch Changes
66
+
67
+ - 1c2ee0b: **Every package ships its declarations and says where they are.** `@geonosis/visual-diff` and
68
+ `@geonosis/verify` emitted no `.d.ts` at all (TS7016 in a consumer: the comparator every visual test
69
+ calls became `any` at the one seam that decides whether a screenshot regressed), and no package
70
+ declared `types` — the nineteen that worked did so through the sibling-file fallback, which ends the
71
+ day `exports` gains a condition. Every export now carries a `types` condition beside `default`, every
72
+ manifest a `types` field, and `tooling/types.test.ts` holds all twenty-one to it after the build.
73
+
74
+ `geonosis-verify-arch` prints a check once when its label is its id ("direction, orphan", not
75
+ "direction direction").
76
+
77
+ ## 1.0.0
78
+
79
+ ### Major Changes
80
+
81
+ - 739b0c0: New package: the policy kernel two repos arrived at independently, with everything either of them
82
+ hardcoded lifted out as data. `definePolicy({ tiers, kinds, scopeKeys, rules })` — one consumer's
83
+ strongest authority is `regulatory` and the other's is `physics`, so no tier, kind or scope key is
84
+ built in, and scope weights are DERIVED from declaration order rather than hand-maintained beside
85
+ the type (the failure both repos needed a test to catch). `readPolicy` resolves authored rule →
86
+ config row → the caller's own constant through injected ports and records the third case ONCE per
87
+ boot through a `journal` port, because the honest unit of evidence for "nobody set this knob" is a
88
+ deployment, not a request; `policyOrDefault` treats a value that cannot be applied as the same kind
89
+ of gap, and still throws when the DEFAULT is the thing that cannot be applied. A rule naming a tier,
90
+ a kind or a value this build cannot honour is NAMED, never silently ranked against NaN.
91
+ `generatePolicyMarkdown` and `describePolicy` derive every count and the precedence sentence from
92
+ the lattice. The learning loop is here too, and enters the lattice at whatever tier the policy calls
93
+ advisory instead of a hardcoded `learned`.
94
+ - 884f39a: `@geonosis/policy/permissions`: Medusa 2.19.0's `definePolicies` / `hasPermission` /
95
+ `resolvePermissions` with the container lifted out, so the answer is a value and the grants are data
96
+ the caller fetched. One wildcard constant in both slots, ANY role granting is enough, EVERY action
97
+ required — pinned from the shipped implementation, because no test file ships in either tarball. The
98
+ two fail-open paths are reproduced and named: `hasPermission` allows an actor with no roles while
99
+ the route wrapper denies one, and the wrapper throws before it ever reads the feature flag. So
100
+ `onEmptyRoles` is a choice, and `checkPermissions` — the guard's decision, carrying WHICH permissions
101
+ were required — denies a role-less actor while still honouring the flag. `definePolicies` registers
102
+ nothing globally and does not rewrite the caller's objects; `createPolicyCatalog` refuses a name
103
+ already taken, where upstream's global object lets load order decide. `normalizePolicyKey` is
104
+ exported because a `<noun>:<action>` operation normalises to an underscored one, which a repo
105
+ authoring its own rows has to know.
106
+ - d2cbeb4: `@geonosis/policy/medusa` and `@geonosis/policy/drizzle`: two stores behind the same ports, neither
107
+ importing the store it adapts. The Medusa one takes the container as an argument — which is what
108
+ lets every check run without a booted server, and what stopped 219 lines of resolution logic
109
+ dragging a module, a service and three ORM models behind them; it carries `configRow` bindings, the
110
+ playbook's rules appended LAST because the lattice decides authority and a list order that could
111
+ stand in for it is a second silent one, `medusaGrants` turning the native RBAC module's roles into
112
+ grants the permission lattice reads, and `requirePermission` with a signature that survives two
113
+ copies of the framework in one store. The drizzle one takes the query, because a repo whose law says
114
+ queries are builders in its own data layer would not accept one written in a dependency; the columns
115
+ ship as data. `runPolicyAdapterConformance` is the one suite both pass, answering with a report
116
+ rather than an exit code — and it is shown red four ways, including an adapter that records nothing
117
+ and one that lets a downed store throw out of a config read. A rejected value is written into
118
+ `error`, a column that exists, rather than a `rejected` key that does not.
119
+ - bb4a9bf: `journalRowForEvent` extracted with the keys as options and no default, because the learning loop
120
+ reads four signals and only one of them — the reader's own journalled fallback — had any data in the
121
+ repo it came from: the other three computed over an empty table and reported nothing, nightly,
122
+ convincingly. Domain events are the missing input; which field carries the id of the thing an event
123
+ is about is a fact about one system, so a build that has not said writes no rows rather than
124
+ guessing.
125
+ - 0a4720d: The README carries the API, dielime's migration in five lines, and the measurement behind
126
+ during.day's non-adoption: all 34 of its `constants.ts` files enumerated, and not one
127
+ `SCREAMING_SNAKE` export in them carries an authority, a subject or a reason — §13.3 is a law about
128
+ where a constant lives, not about thresholds a tenant may set. The D-027 status is stated where a
129
+ reader will find it: one consumer with pull, musa's lattice is a fixture and not a second consumer,
130
+ and the package is DONE when dielime depends on the published version and has deleted its `lib/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geonosis/policy",
3
- "version": "2.3.1",
3
+ "version": "2.4.3",
4
4
  "types": "./dist/index.d.ts",
5
5
  "description": "A threshold is a value plus the authority that set it, the subject it reaches and the reason it exists. The precedence lattice, the rule → config → constant read with its fallback journalled once per boot, the learning loop, the generated policy prose, and a permission lattice with the runtime lifted out.",
6
6
  "keywords": [
@@ -64,6 +64,7 @@
64
64
  }
65
65
  },
66
66
  "files": [
67
+ "CHANGELOG.md",
67
68
  "dist"
68
69
  ],
69
70
  "peerDependencies": {