@niscorp/nisc 0.8.1 → 0.8.4
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 +3 -3
- package/CHANGELOG.md +44 -0
- package/package.json +6 -6
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
|
|
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.
|
|
@@ -437,7 +437,7 @@ Say this out loud in the interview, because it is the part a user cannot infer:
|
|
|
437
437
|
## Order of work
|
|
438
438
|
|
|
439
439
|
1. **The interview** (see "Before any code") — every decision answered or delegated by name, recorded in `PLAN.md` with scope, data model, and roles.
|
|
440
|
-
2. **Scaffold** — manifest + runtime + terminal (moss), or boot + shell factory (degrade); canvases + empty registry; one placeholder action renders. `npm create nisc` makes exactly this —
|
|
440
|
+
2. **Scaffold** — manifest + runtime + terminal (moss), or boot + shell factory (degrade); canvases + empty registry; one placeholder action renders. `npm create nisc` makes exactly this — every app it can make is made, installed and checked by CI — and writes `PLAN.md` with D1 and the renderer answered and the rest open; the interview (step 1) is then about what it left open.
|
|
441
441
|
3. **Kit** — primitives against a kitchen-sink action; lock the look before any real feature.
|
|
442
442
|
4. **Data layer** — per D2/D3: schema, seed, entries, behaviors; prove one read end-to-end.
|
|
443
443
|
5. **Actions** — domain by domain: list → detail → form; chrome and routes as they're needed; new action ids granted in the charter as they're minted.
|
|
@@ -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,49 @@
|
|
|
1
1
|
# @niscorp/nisc
|
|
2
2
|
|
|
3
|
+
## 0.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2d9219a: `nisc dev` registers the project's `routes` on the app server, as `nisc start` does, before it checks the app's functions.
|
|
8
|
+
|
|
9
|
+
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`.
|
|
10
|
+
|
|
11
|
+
- 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.
|
|
12
|
+
- Updated dependencies [2d9219a]
|
|
13
|
+
- Updated dependencies [5e07fbb]
|
|
14
|
+
- Updated dependencies [98695fb]
|
|
15
|
+
- Updated dependencies [b43afd8]
|
|
16
|
+
- Updated dependencies [6ba0eeb]
|
|
17
|
+
- Updated dependencies [a72f2bb]
|
|
18
|
+
- Updated dependencies [2a6f8d6]
|
|
19
|
+
- Updated dependencies [915efe6]
|
|
20
|
+
- @niscorp/cli@0.8.2
|
|
21
|
+
- @niscorp/moss@0.8.2
|
|
22
|
+
- @niscorp/nova@0.5.1
|
|
23
|
+
- @niscorp/vex@0.4.2
|
|
24
|
+
|
|
25
|
+
## 0.8.3
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- 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.
|
|
30
|
+
|
|
31
|
+
## 0.8.2
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 49a4766: `npm create nisc` makes an app from items instead of four whole templates. Each answer is a folder under `templates/` — `moss` or `page`, `react` or `dom`, and the kind of app — with its files, its files for another item (`with/<item>/`), its `package.json` fragment, the keys it asks for and its lines in AGENTS.md and PLAN.md; the questions are `templates/questions.json`. The command names no item, so a new kit, shell or kind of app is a new folder, and its flag follows from it. The four apps it made before come out as they were, but for a sentence: the welcome screen no longer says which kit draws it, PLAN.md's scaffold step says "the files `npm create nisc` wrote", and AGENTS.md's line for `nisc.config.ts` is one sentence for both shells.
|
|
36
|
+
|
|
37
|
+
An item that needs keys asks for them masked, after the questions, and writes them to `.env` (`.env.example` gets the names); with no terminal they are read from the environment, never from a flag. `--workspace` keeps `workspace:^` ranges, for an app made inside the nisc repository.
|
|
38
|
+
|
|
39
|
+
- 49a4766: `npm create nisc` asks who leads. **Model-first** (`--model-first`) is a moss app where a person types a message and the answer is a screen: up to six canvases, each an action opened with an input, on the areas of an arrangement (`src/app/arrangements.ts`) or a grid the model writes. One dock at the bottom holds the screens, a chip naming the answer shown with back, forward and every answer to go back to, and the line to ask in.
|
|
40
|
+
|
|
41
|
+
Jev, a fast decision model, reads the message and the open screen and says which actions likely belong; gpt-oss-120b on Groq composes the screen as a cortex agent, naming only the areas that change, and its reply is checked against the app's actions, their input schemas and the arrangements, and corrected inside the run when it does not hold. The answer streams in. What a person presses, ticks and picks stays on the screen, the model sees it, and an answer gone back to shows it as it was left. A card's link opens a screen at once; only what is typed, or a thing to ask pressed, goes to the model. Every message is recorded as a run for each model it went to, through `session.recordRun`. It asks for its keys — Groq, and TypeSafe for Jev — and writes them to `.env`.
|
|
42
|
+
|
|
43
|
+
The app starts as a tour of nisc: five screens of cards to read, and a counter, a checklist and a quick check to use, which the model can fill in too. Its AGENTS.md says how to remove the tour — a folder, a check, and edits in five files — and what to build next. The checks run the loop offline with a scripted decision model and chat model, and `src/dev/live-ask.ts` asks the real models a run of cases.
|
|
44
|
+
|
|
45
|
+
Both kits gain the components it uses — a frame, the dock, a menu, a grid and its areas, a card, code, points, steps, a checkbox, an input and the line to ask in — and a classic app has them too. The stylesheet gains their look. `src/dev/strata.ts` is each kind's own: a model-first app's also records its frame and arrangements.
|
|
46
|
+
|
|
3
47
|
## 0.8.1
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/nisc",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
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,16 +20,16 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@niscorp/charter": "0.1.4",
|
|
23
|
-
"@niscorp/cli": "0.8.1",
|
|
24
23
|
"@niscorp/cortex": "0.1.4",
|
|
25
|
-
"@niscorp/
|
|
24
|
+
"@niscorp/nova": "0.5.1",
|
|
26
25
|
"@niscorp/loom": "0.5.0",
|
|
27
|
-
"@niscorp/
|
|
28
|
-
"@niscorp/prism": "0.3.1",
|
|
26
|
+
"@niscorp/cli": "0.8.2",
|
|
29
27
|
"@niscorp/signal": "0.1.5",
|
|
28
|
+
"@niscorp/prism": "0.3.1",
|
|
30
29
|
"@niscorp/solid": "0.1.2",
|
|
30
|
+
"@niscorp/moss": "0.8.2",
|
|
31
31
|
"@niscorp/tide": "0.1.7",
|
|
32
|
-
"@niscorp/vex": "0.4.
|
|
32
|
+
"@niscorp/vex": "0.4.2",
|
|
33
33
|
"@niscorp/strata": "0.1.7"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|