@simetrajs/designer 0.3.0-next.6 → 0.3.0-next.8

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/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "./package-BEbVS6e5.js";
2
+ import { t as version } from "./package-zZa694z7.js";
3
3
  import { n as TOOL_NAMES } from "./types-CMcZhIci.js";
4
4
  import { defineCommand, runCommand, runMain, showUsage } from "citty";
5
5
  // src/main.ts
@@ -11,7 +11,7 @@ const main = defineCommand({
11
11
  },
12
12
  subCommands: {
13
13
  ...Object.fromEntries(TOOL_NAMES.map((name) => [name, () => import("./command-BfioPN5J.js").then((m) => m.commandByName(name))])),
14
- mcp: () => import("./mcp-i0qLiS5n.js").then((m) => m.default),
14
+ mcp: () => import("./mcp-CZctSVr4.js").then((m) => m.default),
15
15
  init: () => import("./init-BS7fCOls.js").then((m) => m.default)
16
16
  }
17
17
  });
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { d as parseDataLaunch, f as databaseResource, i as structureOf, l as checkEnvName, n as TOOLS, o as formatDiagnostics, r as presentation, t as invoke, u as dataResource } from "./invoke-Dkbpi4Fq.js";
3
3
  import { a as dataWriteHint, l as readOnlyHint, n as trimSlash, o as databaseWriteHint, p as UsageError, r as ALLOW_RIGHTS_WRITE_FLAG } from "./default-dir-DerxTbci.js";
4
- import { t as version } from "./package-BEbVS6e5.js";
4
+ import { t as version } from "./package-zZa694z7.js";
5
5
  import { t as mcpArgs } from "./mcp-args-D63akJ97.js";
6
6
  import { defineCommand } from "citty";
7
7
  import { z } from "zod";
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  // package.json
3
- var version = "0.3.0-next.6";
3
+ var version = "0.3.0-next.8";
4
4
  export { version as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simetrajs/designer",
3
- "version": "0.3.0-next.6",
3
+ "version": "0.3.0-next.8",
4
4
  "description": "Simetra developer tools: command line and MCP server over the metadata compiler",
5
5
  "keywords": [
6
6
  "simetra",
@@ -37,7 +37,7 @@
37
37
  "pg-connection-string": "2.14.1",
38
38
  "smol-toml": "1.9.1",
39
39
  "zod": "^4.6.7",
40
- "simetra": "0.3.0-next.6"
40
+ "simetra": "0.3.0-next.8"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@arethetypeswrong/cli": "0.18.5",
@@ -57,7 +57,7 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "f4b281b5a9cce3b0a52185a0dd435f0717e273c8",
60
+ "gitHead": "4d002f9fecbef5ef2fa463a30319ec3ee0a2e9d8",
61
61
  "scripts": {
62
62
  "build": "tsc --noEmit",
63
63
  "build:package": "tsdown",
@@ -129,8 +129,51 @@ with a trigger on the target table, see "Carrier copies").
129
129
  reference becomes a composite foreign key within the scope.
130
130
  - **`rightsContainer`** — the catalog is a rights container: roles can be
131
131
  assigned on its rows. `"rightsContainer": true`
132
- - **`containerBinding`** — the carrier that binds a row to its container.
133
- `"containerBinding": "<attribute>"` or `["<ref attribute>", "<attribute>"]`
132
+ - **`containerBinding`** — the `Ref` attribute that binds a row to its
133
+ container. `"containerBinding": "<attribute>"`; the path form
134
+ `["<ref attribute>", "<attribute>"]` is a schema error (it stays valid for
135
+ `ownership` and `access`). The target is a `rightsContainer` catalog (a
136
+ direct binding) or an object with its own `containerBinding` (a chain, of
137
+ any length: comment → task → project, where only the project is a container). The container of a row is the first
138
+ `rightsContainer` the chain reaches, so a container never continues the
139
+ chain. A hierarchy (a kind whose rows point at a parent row of the same
140
+ kind) is not a chain: bind every node directly to its container, never
141
+ through the parent attribute, because a binding to the kind itself is a
142
+ cycle. Any cycle in the kind graph, including a
143
+ reference to itself and two containers bound to each other, is
144
+ `rights.container-binding-cycle` on every kind of the cycle; a target that
145
+ is neither a container nor bound is `rights.container-target`.
146
+
147
+ A chained row carries a platform-owned copy of its binding, a standard
148
+ column named from the binding attribute and the end column of the direct
149
+ binding (`rights.carrier-column-taken` on a clash). The platform writes it;
150
+ a value in a request is ignored. A read policy compares only that column, so
151
+ the cost of a read does not grow with the chain. A container role reads the
152
+ chained row when the grant covers its kind.
153
+
154
+ **Rebinding.** Changing the binding attribute of a row whose kind has chained
155
+ descendants moves all of them to another container. Besides the right to
156
+ update the row itself, the actor needs `update` at extent `any` on every
157
+ descendant kind, on every level below, in the container before and in the
158
+ container after: through a role on that container or a scope-level role.
159
+ An empty binding on either side needs the scope-level right. Otherwise the
160
+ command fails with `command.forbidden` / `no-right`, and the database error
161
+ names the descendant kind; the check runs before any copy is rewritten. A
162
+ change made by a `beforeWrite` handler is judged the same way. Moving a row
163
+ between targets of the same container needs no extra right, and neither
164
+ does the copy update that a rebinding cascades. Outside a command
165
+ (maintenance, a plan data step) the check does not run.
166
+
167
+ **Limits.** Reading costs the same at any depth. Writing pays: a rebind
168
+ rewrites the copies of all descendants on every level below, in the same
169
+ transaction, one `UPDATE` per level through the foreign key index. Measured
170
+ on one developer machine (16 cores, Postgres 17 on the local stack, light
171
+ load), one task moved between two projects, 5 replies per
172
+ comment: 10 comments (60 copies) 6.5 ms median, 100 comments (600 copies)
173
+ 47 ms, 1 000 comments (6 000 copies) 489 ms (p90 528 ms), roughly 80 µs per
174
+ rewritten row. Keep the number of descendants of one row that can be
175
+ rebound in a single command in the low thousands, and give a deep or wide
176
+ subtree its own container instead of rebinding it.
134
177
  - **`access`** — the project access dimensions that narrow the rows, each with
135
178
  its carrier to the dimension's value catalog.
136
179
  `"access": [{ "attribute": "<attribute>", "dimension": "<dimension>" }]` or
@@ -209,7 +252,11 @@ the role's key in an adopted assignment table of the same level).
209
252
  objects of that scope kind, only `read` on unscoped ones. The scope kind
210
253
  needs a membership.
211
254
  - `{ "container": <ref> }` — per row of a `rightsContainer` catalog: objects
212
- whose `containerBinding` leads to it.
255
+ whose `containerBinding` chain ends in it. Any such assignment also gives
256
+ implicit `read` of the container's own row, even for a role with no grants.
257
+ It covers that row only: not its tabular sections, no write, no
258
+ change-channel subscription, and a `rights_require` check without a target
259
+ row does not take it.
213
260
  - `"everyUser"` — every valid user without an assignment: unscoped objects,
214
261
  `own` or a dimension extent only, no `fullAccess`, no source keys.
215
262