@nacre.work/core 0.30.0 → 0.31.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.
@@ -0,0 +1,44 @@
1
+ -- 0037 — a delegation's ceiling may hold `skill`.
2
+ --
3
+ -- The consent screen offers, per layer, "edit this layer's skill", and only on a
4
+ -- layer where the person holds `admin`. It is stored as `skill` in that layer's
5
+ -- ceiling, and therefore in the connection's: the consent handler refuses a
6
+ -- per-layer set the connection's ceiling excludes, and this value is no
7
+ -- exception to that rule. The specification is docs/skills.md, "Who writes
8
+ -- what".
9
+ --
10
+ -- `skill` is **not a permission**. `resolve` never sees it: the API strips it
11
+ -- before building a resolve input, so no search, ingest, grant or delete path
12
+ -- can be reached through it, and one function reads it — `skill-ceiling.ts`,
13
+ -- held there by `lint:skill-ceiling`. It widens nothing by being stored. It
14
+ -- only lets a token do what its person may already do on that layer, and only
15
+ -- that one thing.
16
+ --
17
+ -- Why not `admin` in the layer's ceiling, which already lets a delegation write
18
+ -- the skill: a token from the consent flow reaches REST as well as MCP, so
19
+ -- `admin` would let an MCP client rename the layer, delete it and issue grants
20
+ -- on it. Editing what agents are told is a narrower thing to approve.
21
+ --
22
+ -- The constraints are replaced rather than altered, because Postgres has no
23
+ -- ALTER for a CHECK. Every existing row satisfies the new one, since it admits
24
+ -- a superset, so this validates without rewriting anything.
25
+
26
+ ALTER TABLE oauth_consents
27
+ DROP CONSTRAINT oauth_consents_permissions_shape;
28
+
29
+ ALTER TABLE oauth_consents
30
+ ADD CONSTRAINT oauth_consents_permissions_shape CHECK (
31
+ permissions IS NULL
32
+ OR (cardinality(permissions) > 0
33
+ AND permissions <@ ARRAY['read', 'write', 'admin', 'skill']::text[])
34
+ );
35
+
36
+ ALTER TABLE oauth_consent_layers
37
+ DROP CONSTRAINT oauth_consent_layers_permissions_shape;
38
+
39
+ ALTER TABLE oauth_consent_layers
40
+ ADD CONSTRAINT oauth_consent_layers_permissions_shape CHECK (
41
+ permissions IS NULL
42
+ OR (cardinality(permissions) > 0
43
+ AND permissions <@ ARRAY['read', 'write', 'admin', 'skill']::text[])
44
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nacre.work/core",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Nacre core: data model, permission resolver, and shared types",
5
5
  "repository": {
6
6
  "type": "git",