@niscorp/nisc 0.8.2 → 0.8.6

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/AGENTS.md CHANGED
@@ -89,7 +89,7 @@ Pick per need; every piece works standalone. Nova is the only mandatory one for
89
89
  5. All data in and out of an action flows through its declared `endpoints`. Shaping is declared on the endpoint: a static request body is plain JSON; a body derived from the action's data is a Prism config, kept in a sibling `.prism.ts`. Prefer plain JSON when no mapping is required. Components never shape data.
90
90
  6. Nova doesn't know Prism: the shell's injected `transform` is the socket that makes Prism endpoint configs work. Wire it once in setup, and fold ambient app context (the app's "today", the session's principal) into the source there — per session on the server under moss, in the shell factory in a client-degrade app — never into per-action data. The socket takes Prism's `evaluate` as it is (`transform: evaluate`), or a wrapper that adds to the source: `(config, source) => evaluate(config, { ...source, today })`. Hand `evaluate` the config object itself, never a copy of it and never one parsed again: it checks a config the first time it sees the object and only evaluates it after that. A test or a tool that must check everything on every call passes `{ check: 'always' }`. A config that is stored is compiled once and its IR executed (`compile`, `execute`).
91
91
  7. An endpoint is a contract, not an implementation (D1, D2). In-browser, server, or mixed — actions can't tell the difference, and must not be able to. Server functions are endpoints too: the manifest's `functions(session)` seam runs them in-process under the caller's policy. The seam returns a list of `{ id, description, execute }`: the id is what the charter and an `fn:` endpoint name, and the description says what the function does and what to send, for the model that writes a call to it; a map of handlers is deprecated. A client-side `fn` registry is the escape hatch for client-degrade apps, and discouraged elsewhere.
92
- 7a. The manifest's three code seams are distinct, and app code goes in the one that describes it. `functions(session)` is for **endpoints** — things an action calls. `onSession(session)` is for per-shell code that is **not** an endpoint: an observer, a roster, an agent watching the screen. `runs` is the **sink** for model runs, fed by `session.recordRun`. Registering a handler nothing calls, to get code to run per session, is a lie about what that code is — use `onSession`. Both it and `functions` run before the shell finishes building, so neither may touch `session.shell` synchronously. The members of that shell that change what it is made of (`registerAction`, `setLayout`, `addCanvas` and their kin) throw there; the whole shell is `unverifiedShell(session)` from `@niscorp/moss/unverified`.
92
+ 7a. The manifest's four code seams are distinct, and app code goes in the one that describes it. `functions(session)` is for **endpoints** — things an action calls. `onSession(session)` is for per-shell code that is **not** an endpoint: an observer, a roster, an agent watching the screen. `runs` is the **sink** for model runs, fed by `session.recordRun`. `reconcilers` is for **how a canvas is reconciled**: a function a canvas names with `reconcile`, which decides from a `reconcile` step's rows what that canvas keeps, matches, moves and removes — several cards of one action, matched by a key and kept in the list's order (moss DOCS.md, `reconcilers`). A function that pushes and removes cards itself is not one: each of its moves is a step `back` takes on its own, where everything a reconcile does is one. Registering a handler nothing calls, to get code to run per session, is a lie about what that code is — use `onSession`. Both it and `functions` run before the shell finishes building, so neither may touch `session.shell` synchronously. The members of that shell that change what it is made of (`registerAction`, `setLayout`, `addCanvas` and their kin) throw there, and a reconciler is handed that same shell; the whole shell is `unverifiedShell(session)` from `@niscorp/moss/unverified`.
93
93
  7b. A layout generated while the app runs is saved through `session.artifacts`, not set on the shell. `session.artifacts.save([{ kind: 'layout', body: { ref: 'action/<the action’s id>', layout, use: true } }])` keeps it for the session's principal: it is theirs alone, it is drawn on their screens at once with their data kept, and every save is a version (`list`, `history`, `restore`, `reset`). Without `use: true` it is kept and not drawn. The layout of the app's own shell is saved the same way under `ref: 'frame'`, and a canvas's under `ref: 'canvas/<the canvas’s id>'`: a page keeps the layouts it declares, a shell manifest with no `layout` (or a canvas with no `actionLayout`) has none to take the place of, and a frame that leaves a canvas out is saved as it is, so check that yourself where it matters. A canvas their shell does not declare, that a layout in force for a person has a canvas slot for, is taken out of their shell, with what is mounted on it, once no layout has the slot: declare a canvas that is to stay. No call can name anybody else: moss reads and writes those rows as the caller, and vex keeps them to the caller's own. **Who may save is the charter's**: put the call in a function, and grant the action that calls it to the roles that may. A body moss refuses (a ref no action of theirs keeps a layout under, a component no shell has, a binding to data the action lacks, a control the action listens on left out) rejects with a sentence: hand it back to whoever wrote the layout. With `runtime.artifactsUnusedMs`, what a person saved and nobody has loaded for that long is deleted, every version of it; what is published never ages. What is for everybody is published from the app's own server code and never from a session: `server.defaults(publisher).save([...])`, with the same kinds, the same bodies and the same five calls. A published layout is drawn for everybody who holds the action, under a person's own layout in use and their roles' layout variant, and over the build's. A published action or fragment is given its id by whoever publishes it (`{ kind: 'action', id: 'promo', body }`): the charter grants it by that id, and one under a shipped id replaces the build's for everybody until it is reset. A published read is answered to everybody under its fingerprint. `publisher` is who published, kept with the save: hand it the session's principal. **Who may publish is the charter's** too: put the call in a function and grant the action that calls it to the owners' role. No `userId` is `*`: that is whose the published rows are. An action or a fragment generated while the app runs is saved the same way: `{ kind: 'action', body }` or `{ kind: 'fragment', body }`, the body without an `id`, because moss gives it (`generated.` and a uuid, which `save` answers). It is its owner's alone, and what it defines replays reads and calls the functions its owner's roles grant: each endpoint is a `POST` to the app's vex route naming one fingerprint of a read the app ships and its owner may replay, or of a read vex wrote that its owner saved, or an `fn:` endpoint to a function its owner's roles grant (`session.functions()` lists them with their descriptions: hand that list to the model that writes the action). A read vex wrote for `session.answerIntent` is kept the same way: `session.artifacts.save([{ kind: 'read', id: '<the fingerprint vex answered>' }])`, with no body. It is answered to that person alone, it survives a schema change that does not touch what it reads, and their generated actions may replay it. `session.answerIntent` also replays a read by its fingerprint, `{ fingerprint, context }`, and answers it with what vex knows of it (the context it binds, what the call left out, its warnings), where the wire answers the rows alone. A function its owner's roles do not grant, a write and any other address are refused with a sentence, and so is a generated action that opens an action its owner does not hold. Once it is in the shell it is an action like any other: it emits and listens on channels, and a fragment's steps run inside the action it is wrapped around. What an assistant may generate is the app's to decide, in its prompt and in the function that calls `save`. It is in its owner's shells a moment after `save` answers, not before. What is still being generated, and is to be seen at once, goes into the draft of the one shell it is worked on in: `session.draft.add([...])` takes what `save` takes and answers when that shell has it, so the function opens it on its next line; `session.draft.save()` then keeps all of it in one save, and `discard()` drops it. A draft is saved nowhere and is gone when its shell is. Never give an action or a fragment the app ships an id beginning with `generated.`.
94
94
  8. Writes are endpoints fired by triggers, never inline mutations (D4). Identity and tenancy are stamped server-side from the session, never client-supplied: a form never carries `owner_id`. What a principal *is* beyond its id — a tenant, an org, a region — is the manifest's `scope(principal)` seam: moss always injects `{ userId }`, `scope` contributes the rest, and the merged set is what a behavior's `to:` resolves against at execute. The mapping is application knowledge, so the app supplies it; the values are injected server-side and unreferenceable by a request.
95
95
  9. Formatting and derivation live in Prism transforms, never in components and never in action code.
@@ -458,7 +458,7 @@ A review pass checks, in order:
458
458
  4. Every displayer of an entity stays current after a write: its read is `refresh: 'reactive'`, or the write's success path emits a change channel the displayer listens to.
459
459
  5. No component name contains a domain noun; no component imports shell, action, or data code.
460
460
  6. No layout or component branches on roles or capability data (rule 11) — per-principal difference is existence or a served variant.
461
- 6a. Every artifact the manifest carries is pure JSON and parses its schema — a function, a `Date`, an `undefined`, or a class instance in an artifact is a code file masquerading as data. The manifest's declared code fields (`scope`, `identity`, `phrases`, `functions`, `onSession`, `runs`, a reaction's `run`, `features`, and the shell's `inputs` and `seeds` hooks) are the only exceptions; they live outside the artifact tree and are validated by running, not by this check. Moss reads the manifest by a schema when it is handed to `createServer` and refuses to boot on one that does not parse, a code field that is not a function included; this check finds it before a boot does.
461
+ 6a. Every artifact the manifest carries is pure JSON and parses its schema — a function, a `Date`, an `undefined`, or a class instance in an artifact is a code file masquerading as data. The manifest's declared code fields (`scope`, `identity`, `phrases`, `functions`, `onSession`, `runs`, `reconcilers`, a reaction's `run`, `features`, and the shell's `inputs` and `seeds` hooks) are the only exceptions; they live outside the artifact tree and are validated by running, not by this check. Moss reads the manifest by a schema when it is handed to `createServer` and refuses to boot on one that does not parse, a code field that is not a function included; this check finds it before a boot does.
462
462
  6b. Session code sits in the seam that describes it (rule 7a): no handler registered on `functions` that nothing calls. Tenancy resolves through `scope` and engine-side behaviors, never from a request field.
463
463
  6c. No role holding a data wildcard reaches the engine's tables, and the charter check resolves against the universe boot does (rule 10a).
464
464
  6d. Where pages are drawn on the server: a check opens the drawn page with the real wire and target and the terminal adopts it with nothing said (rule 2a), at every window width the kit distinguishes; a page drawn for somebody goes out `private, no-store`; and every sign-in the app answers over HTTP sets the session cookie on its response and hands the page nothing (rule 12).
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @niscorp/nisc
2
2
 
3
+ ## 0.8.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c5f8e64]
8
+ - @niscorp/vex@0.4.3
9
+
10
+ ## 0.8.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [718cb95]
15
+ - Updated dependencies [718cb95]
16
+ - @niscorp/tide@0.1.8
17
+
18
+ ## 0.8.4
19
+
20
+ ### Patch Changes
21
+
22
+ - 2d9219a: `nisc dev` registers the project's `routes` on the app server, as `nisc start` does, before it checks the app's functions.
23
+
24
+ A path that `dev.owned` sent to the app server for one of those routes was answered 404 under `nisc dev` and worked under `nisc start`.
25
+
26
+ - e130a62: The rulebook names `reconcilers` among the manifest's code seams (rule 7a) and its code fields (verification 6a): a function a canvas names with `reconcile`, which decides from a `reconcile` step's rows what that canvas keeps, matches, moves and removes.
27
+ - Updated dependencies [2d9219a]
28
+ - Updated dependencies [5e07fbb]
29
+ - Updated dependencies [98695fb]
30
+ - Updated dependencies [b43afd8]
31
+ - Updated dependencies [6ba0eeb]
32
+ - Updated dependencies [a72f2bb]
33
+ - Updated dependencies [2a6f8d6]
34
+ - Updated dependencies [915efe6]
35
+ - @niscorp/cli@0.8.2
36
+ - @niscorp/moss@0.8.2
37
+ - @niscorp/nova@0.5.1
38
+ - @niscorp/vex@0.4.2
39
+
40
+ ## 0.8.3
41
+
42
+ ### Patch Changes
43
+
44
+ - 2757814: A model-first app's AGENTS.md now names every helper in `src/dev/live-ask.ts` that only the tour's cases use (`at`, `listOf`, `tour`), so following its "Remove the tour" list leaves nothing of the tour behind. Its "the model never presses anything" line no longer gives the tour's checklist as its example.
45
+
3
46
  ## 0.8.2
4
47
 
5
48
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niscorp/nisc",
3
- "version": "0.8.2",
3
+ "version": "0.8.6",
4
4
  "description": "The nisc platform as one known-compatible set: every @niscorp package, each pinned to the exact version it was released with.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@niscorp/charter": "0.1.4",
23
- "@niscorp/cortex": "0.1.4",
23
+ "@niscorp/cli": "0.8.2",
24
24
  "@niscorp/loom": "0.5.0",
25
- "@niscorp/moss": "0.8.1",
26
- "@niscorp/cli": "0.8.1",
27
- "@niscorp/nova": "0.5.0",
28
- "@niscorp/signal": "0.1.5",
25
+ "@niscorp/cortex": "0.1.4",
26
+ "@niscorp/moss": "0.8.2",
27
+ "@niscorp/nova": "0.5.1",
29
28
  "@niscorp/prism": "0.3.1",
29
+ "@niscorp/signal": "0.1.5",
30
30
  "@niscorp/solid": "0.1.2",
31
- "@niscorp/vex": "0.4.1",
32
- "@niscorp/tide": "0.1.7",
33
- "@niscorp/strata": "0.1.7"
31
+ "@niscorp/strata": "0.1.7",
32
+ "@niscorp/tide": "0.1.8",
33
+ "@niscorp/vex": "0.4.3"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "zod": "^4.2.0"