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