@niscorp/moss 0.6.0 → 0.7.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.
- package/CHANGELOG.md +100 -0
- package/DESIGN.md +77 -40
- package/DOCS.md +636 -78
- package/README.md +2 -2
- package/dist/{chunk-VBWNHF4H.cjs → chunk-C2DNDIQX.cjs} +4 -3
- package/dist/chunk-C2DNDIQX.cjs.map +1 -0
- package/dist/{chunk-R66WUKGC.cjs → chunk-DSTHFSTO.cjs} +1988 -1328
- package/dist/chunk-DSTHFSTO.cjs.map +1 -0
- package/dist/chunk-F45SFR7W.cjs +903 -0
- package/dist/chunk-F45SFR7W.cjs.map +1 -0
- package/dist/{chunk-NSK7QSSG.js → chunk-IMZZB4JE.js} +4 -3
- package/dist/chunk-IMZZB4JE.js.map +1 -0
- package/dist/{chunk-V5YMJL7Z.js → chunk-MTC46PGQ.js} +1971 -1309
- package/dist/chunk-MTC46PGQ.js.map +1 -0
- package/dist/chunk-MYGVHWS5.js +870 -0
- package/dist/chunk-MYGVHWS5.js.map +1 -0
- package/dist/{chunk-WKBH3UMB.js → chunk-X2Q546EB.js} +3 -3
- package/dist/{chunk-WKBH3UMB.js.map → chunk-X2Q546EB.js.map} +1 -1
- package/dist/{chunk-D3YZIAYV.cjs → chunk-Z2VA6AOE.cjs} +5 -5
- package/dist/{chunk-D3YZIAYV.cjs.map → chunk-Z2VA6AOE.cjs.map} +1 -1
- package/dist/document-AbQUbQaP.d.ts +381 -0
- package/dist/document-wHHxIXJz.d.cts +381 -0
- package/dist/{index-B411sK9M.d.cts → index-Dml1klpZ.d.cts} +4 -0
- package/dist/{index-B411sK9M.d.ts → index-Dml1klpZ.d.ts} +4 -0
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +7 -9
- package/dist/index.d.ts +7 -9
- package/dist/index.js +3 -3
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.cts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.js +1 -1
- package/dist/node.cjs +8 -8
- package/dist/node.d.cts +3 -4
- package/dist/node.d.ts +3 -4
- package/dist/node.js +4 -4
- package/dist/tide.d.cts +1 -1
- package/dist/tide.d.ts +1 -1
- package/dist/unverified.cjs +3 -3
- package/dist/unverified.js +2 -2
- package/dist/vite.cjs +9 -9
- package/dist/vite.d.cts +6 -1
- package/dist/vite.d.ts +6 -1
- package/dist/vite.js +4 -4
- package/package.json +13 -13
- package/dist/app-CUnDcXQu.d.ts +0 -143
- package/dist/app-CdANzi2q.d.cts +0 -143
- package/dist/chunk-NSK7QSSG.js.map +0 -1
- package/dist/chunk-PWUO4RET.js +0 -374
- package/dist/chunk-PWUO4RET.js.map +0 -1
- package/dist/chunk-R2YPQHQH.cjs +0 -383
- package/dist/chunk-R2YPQHQH.cjs.map +0 -1
- package/dist/chunk-R66WUKGC.cjs.map +0 -1
- package/dist/chunk-V5YMJL7Z.js.map +0 -1
- package/dist/chunk-VBWNHF4H.cjs.map +0 -1
- package/dist/document-D7nroBww.d.cts +0 -169
- package/dist/document-DeTPGBil.d.ts +0 -169
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,105 @@
|
|
|
1
1
|
# @niscorp/moss
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e9b987e: Moss holds an app's entries itself, in memory, and copies none into `vex_cache`. `server.replaceEntries(source, entries)` hands a set of entries over while a server runs. **Breaking.**
|
|
8
|
+
|
|
9
|
+
BREAKING — approved by moccadroid, 2026-10-12: an app that runs a vex engine of its own over `runtime.cache` gives that engine the entries it replays (`seedCache(cache, entries)`), and an app that wrote an entry into that table for moss to serve hands it over with `server.replaceEntries(source, entries)`.
|
|
10
|
+
- **Where a fingerprint resolves.** The entries an app ships are read from the build at every boot and held by the running manifest, compiled as vex replays them. The engine asks it first, and the cache table (`vex_cache`, or what `runtime.cache` hands over) only for what vex wrote itself while the app runs, such as a query `session.answerIntent` wrote. A boot still refuses an entry vex cannot run.
|
|
11
|
+
- **Nothing is copied into the cache table, and a row in it that no request wrote is not replayed.** Until now every entry was written there at each boot, and a replay resolved in the table. Moss now answers from the table only for a row vex wrote for a request (it carries that request's hash). The rows an earlier release wrote stay where they are and are answered from no longer: an entry the app stopped shipping is refused (`cache_miss`), where it went on answering before. Moss deletes none of them.
|
|
12
|
+
- **`server.replaceEntries(source, entries)`** is new, and is to entries what `server.replaceActions` is to actions: a named set, replaced whole, checked before it is taken (the schema the manifest's entries are read by, vex's authoring lint for a write, the reach it declares), frozen, and this process's alone. An entry of a set is replayed in place of one the app shipped under the same fingerprint.
|
|
13
|
+
- **The list of fingerprints** a feature or a discovery is told of holds the entries in force and the queries vex wrote. An app whose `runtime.cache` could not list its rows (vex's tiered cache) was told of none; it is told of the entries in force now.
|
|
14
|
+
- **`nisc migrate`** is as it was. Its pass for an entry that already did not fit before a run asks the cache table for a copy of that entry. Moss writes no such copy from this release on, so in a database only moss writes to, an entry first shipped from now on gets no pass. A copy an earlier release wrote, or one the app writes itself for an engine of its own, still gives one.
|
|
15
|
+
- **What a discovery says of an entry of the app.** `createdAt` is when this process compiled it, and `lastUsedAt` is not said: a replay of an entry moss holds stamps nothing. Both came from the row in the table before.
|
|
16
|
+
- **The refusal for a set that is not the caller's** says `the set "…"` where it said `the set of actions "…"`: a set holds entries too.
|
|
17
|
+
- The CLI and `@niscorp/nisc` change in the moss they bring; `AGENTS.md` says where entries are held.
|
|
18
|
+
|
|
19
|
+
- fc96c47: `functions(session)` returns a list of `FunctionDefinition`, `{ id, description, execute }`, and `session.functions()` lists each function a session may call with its description.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
functions: (session) => [
|
|
23
|
+
{
|
|
24
|
+
id: 'notes.archive',
|
|
25
|
+
description: 'Archives one of the person’s notes. Send { id }.',
|
|
26
|
+
execute: async ({ id }, signal) => archive(session, id, signal),
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- **`id`** is what the charter's `functions` and every `fn:` endpoint name. **`execute`** is what an `fn:` endpoint calls, `(data, signal) => Promise<unknown>`, as a handler in the map was. **`description`** says what it does and what to send, for the model that writes a call to it: `session.functions()` answers `[{ id: 'notes.archive', description: '…' }]`.
|
|
32
|
+
- **Two functions under one id are refused** when a shell is built: `moss: functions(session) returned "auth.leave" twice.`
|
|
33
|
+
- **A map of handlers by id still works, and is deprecated.** The first shell a process builds says once what to change, read off what that session was given: `[moss] functions(session) returned a map of handlers, which is deprecated: return a list of { id, description, execute }.`, or, for a list, `[moss] functions with no description: auth.leave. Give each a description.` An empty description counts as none; such a function, and one given by a map, is listed by its id alone.
|
|
34
|
+
- `FunctionDefinition` is exported, for a helper that returns some of an app's functions.
|
|
35
|
+
|
|
36
|
+
For whoever upgrades an app, person or agent: turn the map into a list, one `{ id, description, execute }` for each handler, the id being its key; a helper that returns part of the map returns part of the list, and the parts are joined with `[...a, ...b]`. Write each description as what the function does and what to send.
|
|
37
|
+
|
|
38
|
+
- 9e6a7c3: The charter decides which of an app's functions a principal may call. **Breaking.**
|
|
39
|
+
|
|
40
|
+
BREAKING — approved by moccadroid, 2026-10-14: give every role of the charter a `functions` part, the functions its actions call, or `functions: ['*']` to keep calling all of them; a role written as a list (`member: ['home', 'settings']`) becomes `member: { actions: ['home', 'settings'], functions: [...] }`.
|
|
41
|
+
- **A shell holds only the functions its principal's roles grant** (`functions`, beside `actions`, `data` and `layouts`, with the same globs, `extends` and `deny`). A role with no `functions` may call none. Before, every shell held every function. A living shell follows the roles an adopt answers, as its actions do.
|
|
42
|
+
- **The boot is refused, with the list of what to grant**, where a role on its own, a combination people wear, or `public` holds an action (or the shells ship a fragment) that calls a function its grants miss: `"member" hold "chrome.topbar", which calls "auth.leave": their functions do not grant it`. A name with a template in it is decided when it is called.
|
|
43
|
+
- **`'*'` is said at boot**: `role "member" allows every function ('*'): the generated actions of the people who hold it, or a role that extends it, may call any it does not deny`.
|
|
44
|
+
- **A grant that names no function** (a typo) is said at the first shell a process builds, with a deny that matches nothing and a function no role grants: the names of the app's functions are known once `functions(session)` has run, and are read as that first session's.
|
|
45
|
+
- **A generated action or fragment may call a function its owner's roles grant**, named written out; one they do not grant is refused when it is saved and left out when a shell is built. `session.functions()` lists the functions a session may call, `{ id, description? }`, for the model that writes one.
|
|
46
|
+
- `@niscorp/charter` has the `functions` section, and `verifyCharter` checks it where a `functions` universe is handed in.
|
|
47
|
+
|
|
48
|
+
For whoever upgrades an app, person or agent: boot it. The refusal lists, per role combination, each function an action calls that the charter does not grant. Add those names to the `functions` of the role that holds the action, or `['*']` to the roles whose people may call everything. This is the app's permissions table: write it deliberately, and do not generate it.
|
|
49
|
+
|
|
50
|
+
- b7fabdb: Moss keeps every action's layout in the shell's layout store, under `action/<id>`. A layout that changes now reaches a screen that is already open. **Breaking.**
|
|
51
|
+
|
|
52
|
+
BREAKING — approved by moccadroid, 2026-10-12 (`action/`) and 2026-10-13 (`frame`, `canvas/`): a manifest's `layoutStore` declares no name beginning with `action/` or `canvas/` and not the name `frame`, no action's layout and no layout variant names one of those by ref, and code that takes the whole shell (`unverifiedShell(session)`) to read an action's layout off a definition reads it from the layout store (`shell.layoutStore.get('action/<id>')`).
|
|
53
|
+
- **An open screen follows a layout that changed, with its data kept.** A set of actions handed over with `server.replaceActions` used to reach only a screen opened afterwards: an instance that was open kept the layout it was opened with. What an open instance still keeps is the rest of its definition (its data's shape, its endpoints, its triggers).
|
|
54
|
+
- **Where the layout is kept does not show to an app.** An app writes an action's layout in its definition as before. `server.actions()` answers it as written, and so does a definition read off a session's shell (`session.shell.getRuntime(id).definition`), with the layout the screen is drawn with now in place. Inside nova's own shell, which `unverifiedShell(session)` hands out, the definition names its layout by `{ ref: 'action/<id>' }` and the store holds the layout, or the layout variant the person's roles hold. An action with no layout, or one whose `layout` is the name of a stored layout, is handed over as it is.
|
|
55
|
+
- **A session's shell hands out its layout store to read.** `set` and `delete` on `session.shell.layoutStore` throw, as `setLayout` does. They went through before.
|
|
56
|
+
- **`action/` is moss's in a layout store.** A manifest whose `layoutStore` declares a name beginning with it, in the app's shell or in a page, refuses the boot and says where. So does an action's layout or a layout variant that names one, at boot and when a set of actions is handed over: a layout cannot be drawn inside itself.
|
|
57
|
+
- **The layout of an action that leaves a shell is taken out of its store.**
|
|
58
|
+
- **The shell's own layout and a canvas's are kept in the store too**, under `frame` and `canvas/<id>`, and the shell draws each by that name. An app writes `layout` and a canvas's `actionLayout` as before, and a screen is drawn as before; one that is the name of a stored layout is handed over as it is. A manifest whose `layoutStore` declares `frame`, or a name beginning with `canvas/`, in the app's shell or in a page, refuses the boot and says where. So does an action's layout or a layout variant that names one of them, at boot and when a set of actions is handed over. A layout is named by a node that is `{ ref }` and nothing else: a `ref` a component carries, on its node or in its props, names none.
|
|
59
|
+
- **Whether a page can still do something is read through every ref.** A layout a screen names by `{ ref }` is read where the store holds it, so a two-way bound field in a stored layout the app names itself makes its page live. It was missed before, and such a page was reported as a file.
|
|
60
|
+
- The CLI and `@niscorp/nisc` change in the moss they bring.
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 0a7beae: Moss's source has a module for what the running app consists of, `artifactory`. Nothing an app imports, calls or is handed changes.
|
|
65
|
+
- What is in force while a server runs, what a set of roles holds of it, and the clock of the generation pointer are in `artifactory`, where they were in `manifest`. `manifest` keeps the app as it is handed over: its types, its schema and its verification.
|
|
66
|
+
- `DESIGN.md`, "How the code is laid out", says which module answers what.
|
|
67
|
+
|
|
68
|
+
- 4dc982a: Moss keeps what was generated while the app runs for the person who saved it (a layout, an action, a fragment), and a layout an app publishes for everybody.
|
|
69
|
+
- **`session.artifacts`, on the session an app's functions are handed.** `save`, `list`, `history`, `restore` and `reset`. A layout is saved for the action it is for (`{ kind: 'layout', body: { ref: 'action/<id>', layout, use? } }`). It is the session's principal's alone, gets its id from moss, and is drawn on their screens while it is marked `use: true`; their open screens follow at once, with their data kept. Who may save is the charter's: the function that calls it is the app's, and the charter says who holds the action that calls that function. A session nobody is signed in to saves nothing.
|
|
70
|
+
- **A row is its principal's, and vex keeps it so.** Moss reads and writes the two tables as the caller, under one row rule: a caller reads and writes only the rows whose `principal` is their `userId`, and a row they insert or update carries it. No call names whose rows are meant. The same rule is part of the policy an app's charter compiles to, so a role that is granted the tables, by name or by a wildcard, reaches its own rows there and nobody else's. A row of `artifact_saves` is moss's alone to make: an app's entry that inserts or updates one is refused. An app's `behaviors` that name `artifacts` or `artifact_saves` refuse the boot.
|
|
71
|
+
- **`server.defaults(publisher)`, on the server: what is published for everybody.** The same five calls and the same body. A published layout is drawn for everybody who holds its action; every living shell adopts it at once, and every other process follows the generation pointer, which a publish moves. It is kept as the rows of one principal no caller is (`*`), under the same row rule, with who published in `created_by`. No session can publish: only the app's own server code reaches the call, and the charter says who holds the action that makes it. One read of what is published answers every shell a process builds: a boot makes it, and the first shell after a publish there or a move of the pointer makes it again.
|
|
72
|
+
- **`session.artifacts` also keeps an action and a fragment** (`kind: 'action'`, `kind: 'fragment'`). Moss gives the id, `generated.` and a uuid; a body that names another is refused. It is its owner's alone: it is in the shells built for them and in nobody else's, and in no catalog. 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 or was handed 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 (see the charter's `functions`); a write, a query a model wrote that nobody saved and every other address are refused, and so is a generated action that opens an action its owner does not hold. Moss checks the artifact; once it is in a shell it is an action or a fragment like any other, on nova's channels and in nova's merge of a fragment into the action it is wrapped around. It is checked at the save and at every shell, and one that no longer passes is left out with a line. `session.actions`, and the `actions` the `inputs` and `seeds` hooks are handed, are the ids the shell was built with, so they hold a principal's generated actions too.
|
|
73
|
+
- **`session.draft`, on the same session: what is being generated in one shell, before it is saved.** `put` takes what `save` takes, runs the same check with the draft laid over what is in force and against what that one shell can draw, and answers when that shell has it, so a function puts an action and opens it on its next line. `list`, `remove` and `discard`; each put or removal is a numbered step, and `show(step)` has the shell show the draft as it was after it; `save` is one save of all of it under the ids it had. A draft is in no other shell, is saved nowhere, and is gone when its shell is.
|
|
74
|
+
- **An id beginning with `generated.` is moss's to give.** A boot and `replaceActions` refuse an action under one, and the manifest's parse refuses a shell's fragment under one.
|
|
75
|
+
- **No caller's `userId` is `*`, and no caller's scope carries `artifactSavedBy`.** For one whose sign-in or `scope` says either, no shell is built and `/api/vex` answers 500.
|
|
76
|
+
- **Under an action's ref a shell draws**, the first of these there is: the person's own layout marked in use, the layout variant their roles hold, the published layout marked in use, the build's.
|
|
77
|
+
- **Every save is a version, and moss changes and deletes none.** Going back to a version is a new save that holds a copy of it; a reset is a new save that says none is in force, and the layout under it is drawn again.
|
|
78
|
+
- **A layout is checked when it is saved and when a shell is built**: its shape, that the action it is for has a layout of its own and is held by whom it is saved for, its components against what the app's shells have, that it names no ref moss keeps a layout under (`action/…`, `canvas/…`, `frame`), and what nova's audit finds of its action with the layout in place and not of the action as it is built. A save is refused with a sentence. A saved layout that no longer passes is left out with a line in the log, and what is under it is drawn.
|
|
79
|
+
- **Two tables, in migration `nisc.moss/5`: `artifact_saves` and `artifacts`.** A deployment that boots with `migrations: 'verify'` runs `nisc migrate` first, as for every migration. An app whose database already has a table by either name renames its own before it takes this release.
|
|
80
|
+
- **The fabric carries one more message, `adopt`**: it names a principal and tells a process to bring the shells it holds for them level. A process that runs an earlier release drops it as a message it does not know, as it drops every such message.
|
|
81
|
+
- **The layouts of the app's own shell are saved the same way: its own under `ref: 'frame'`, a canvas's under `ref: 'canvas/<id>'`**, by a session for its principal and by `server.defaults` for everybody. The app's own shell draws the person's own in use, else the published one, else the one its manifest declares; their open screen follows at once. A page draws the layout it declares. A shell manifest with no `layout`, or a canvas with no `actionLayout` of its own, has none to take the place of, and a save for it is refused. It is checked as a layout for an action is, against the components of the app's own shell and without nova's audit. A frame that leaves a canvas of the shell out is saved as it is: that canvas is drawn nowhere.
|
|
82
|
+
- **A canvas that only a layout's slot draws goes when the slot goes.** Nova gives a shell a canvas when something is first pushed onto it. Where a layout in force for a principal holds a canvas slot with a written-out `canvasId` for a canvas their shell's manifest does not declare, and then no layout does (the saved layout was reset, the action left the shell), an open shell loses that canvas with what is mounted on it. It stayed before, drawn nowhere. The canvases a manifest declares are never taken out, and moss gives a shell none.
|
|
83
|
+
- **A read vex wrote is kept the same way** (`{ kind: 'read', id: 'fp_…' }`, no body): moss takes the query and the Prism config of its mapping from vex's table. It is answered to the person who saved it and to nobody else (never to a caller nobody is signed in for), held to vex's limits as a query vex wrote is, it survives a schema change that does not touch what it reads, and their generated actions may replay it. One whose query no longer runs is left out with a line, with the generated actions that replay it. Moss's data layer hands vex's table only what vex wrote for a request: a saved read vex replays is not copied into it.
|
|
84
|
+
- Not built yet: publishing an action, a fragment or a read; a layout of a page's shell.
|
|
85
|
+
- The CLI and `@niscorp/nisc` change in the moss they bring. `AGENTS.md` gains rule 7b: how a layout, an action or a fragment generated while the app runs is saved or kept in a draft, how a layout is published for everybody, and that the charter decides who may do either.
|
|
86
|
+
|
|
87
|
+
- c7c4f9b: A nova shell keeps actions and fragments in one registry. **Breaking.**
|
|
88
|
+
|
|
89
|
+
BREAKING — approved by moccadroid, 2026-10-13: `shell.registerFragment` is gone, and an action and a fragment no longer share an id.
|
|
90
|
+
- **`shell.registerAction(definition)` takes an action or a fragment**, told apart by the fragment's `kind: 'fragment'`, and **`shell.removeAction(id)` takes either out**. There was no call to take a fragment out. Taken out, a fragment is unknown to a later `with: [...]`; an instance that was opened with it keeps the definition it was composed into, and `back` skips a position that was opened with it, as it skips one it cannot put back.
|
|
91
|
+
- **A fragment handed to `createShell` is validated**, as an action is: one that does not parse throws `DefinitionValidationError` at construction. Only `registerFragment` validated one before.
|
|
92
|
+
- **An id names an action or a fragment, never both.** `createShell` and `registerAction` throw `DefinitionValidationError` for an id that is already the other kind's.
|
|
93
|
+
- Opening a fragment by itself still throws `UnknownActionError`, and a `with: [...]` that names an action still throws `UnknownFragmentError`. `ShellConfig` keeps `actions` and `fragments`.
|
|
94
|
+
- **Moss:** a fragment that is no longer answered for a principal is taken out of their open shell, as an action is. A boot, and a set of actions handed over, refuse an action under the id of a fragment a shell ships. On a session's own shell, `registerAction` (refused there as before) is the one call that would take a fragment.
|
|
95
|
+
|
|
96
|
+
**What to change:** `shell.registerFragment(fragment)` becomes `shell.registerAction(fragment)`. Give an action and a fragment that share an id two ids.
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [c7c4f9b]
|
|
99
|
+
- Updated dependencies [4068f98]
|
|
100
|
+
- @niscorp/nova@0.4.0
|
|
101
|
+
- @niscorp/vex@0.4.0
|
|
102
|
+
|
|
3
103
|
## 0.6.0
|
|
4
104
|
|
|
5
105
|
### Minor Changes
|
package/DESIGN.md
CHANGED
|
@@ -39,8 +39,8 @@ app.
|
|
|
39
39
|
### 2. Deployment is a data operation
|
|
40
40
|
|
|
41
41
|
Every field of the manifest is an authored artifact — the charter, the action
|
|
42
|
-
definitions, the layout variants, the
|
|
43
|
-
canvases. Publishing a change is a write to that data; moss derives the rest.
|
|
42
|
+
definitions, the layout variants, the entries that are its API surface, the
|
|
43
|
+
shell's canvases. Publishing a change is a write to that data; moss derives the rest.
|
|
44
44
|
Consequences:
|
|
45
45
|
|
|
46
46
|
- **No version skew.** The shell and the definitions it runs live server-side;
|
|
@@ -52,9 +52,10 @@ Consequences:
|
|
|
52
52
|
*"crm.quotes → gained by: sales, intern, ray."* A human approves that.
|
|
53
53
|
|
|
54
54
|
Today the manifest is what the app handed `createServer`: read by a schema,
|
|
55
|
-
then frozen, so an edit to it throws.
|
|
56
|
-
runs, through one door: a set of actions is handed over
|
|
57
|
-
(`server.replaceActions`)
|
|
55
|
+
then frozen, so an edit to it throws. Two parts of it change while a server
|
|
56
|
+
runs, each through one door: a set of actions is handed over
|
|
57
|
+
(`server.replaceActions`), a set of entries (`server.replaceEntries`), and
|
|
58
|
+
each is verified before it is taken. The artifact library
|
|
58
59
|
that makes publish a runtime write for every artifact is specified and unbuilt
|
|
59
60
|
(see below). The mechanism is already the function it needs to be: what a set
|
|
60
61
|
of roles holds, and the policy it reads and writes under, are derived from what
|
|
@@ -62,20 +63,46 @@ is in force and dropped when that changes, so there is no invalidation
|
|
|
62
63
|
protocol; a pointer in the database tells every other process that it did.
|
|
63
64
|
The pointer tells them *that*, not *what*: another process reads again the
|
|
64
65
|
sets of actions it has a loader for (the ones a feature keeps in rows), and a
|
|
65
|
-
set handed to one process with `replaceActions` and no
|
|
66
|
-
process's alone. A library every process reads is the part that is unbuilt.
|
|
66
|
+
set handed to one process with `replaceActions` or `replaceEntries` and no
|
|
67
|
+
loader is that process's alone. A library every process reads is the part that is unbuilt.
|
|
67
68
|
|
|
68
69
|
And there is one place it will be asked. Everything a shell loads that
|
|
69
70
|
somebody authored (its actions, its frame and layout store, its fragments, the
|
|
70
71
|
entries its reads replay) is answered by the running manifest in one function,
|
|
71
|
-
for a shell and a
|
|
72
|
+
for a shell and a principal with their roles (`artifactsFor`, `src/artifactory/running.ts`). A shell is built
|
|
72
73
|
from that answer and adopts it: an adopt puts in place the actions that are
|
|
73
|
-
held now, and
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
the
|
|
78
|
-
|
|
74
|
+
held now, and each `{ ref }` of the layout store and each fragment that the
|
|
75
|
+
answer says differently from the last time. Every layout the shell draws is
|
|
76
|
+
one of those refs, under the name of what draws it: the answer holds an
|
|
77
|
+
action's in the layout store under `action/<id>`, and the definition names
|
|
78
|
+
it; the shell's own is under `frame` and a canvas's under `canvas/<id>`
|
|
79
|
+
(`shellWithStoredLayouts`, `src/artifactory/artifacts.ts`). So a layout is changed by setting
|
|
80
|
+
a ref, which a screen that is open follows with its data kept, and not by
|
|
81
|
+
registering the action again, which only a screen opened afterwards sees. It
|
|
82
|
+
is also how a saved layout reaches a screen: under an action's ref the answer
|
|
83
|
+
holds the principal's own layout that is marked in use, else the layout
|
|
84
|
+
variant their roles hold, else the one published for everybody, else the
|
|
85
|
+
build's. The first two tables of the
|
|
86
|
+
library are built for that: a row for each save and a row for each version it
|
|
87
|
+
holds, never changed (`src/artifactory/saves.ts`). A row is its principal's,
|
|
88
|
+
and vex keeps it so. What is published for everybody is the rows of one
|
|
89
|
+
principal no caller is, under that same rule: publishing is the save a person
|
|
90
|
+
makes, made by the app's own server code as that principal
|
|
91
|
+
(`server.defaults`), and no second mechanism. An action or a fragment
|
|
92
|
+
somebody generated is a row of theirs too: it is added to what their shell is
|
|
93
|
+
built from, under an id moss gave it, and it may only replay reads its owner
|
|
94
|
+
may replay (`src/artifactory/generated.ts`). A layout saved under `frame` or
|
|
95
|
+
`canvas/<id>` takes the place of that layout of the app's own shell, a
|
|
96
|
+
person's own over the published one over the build's; a page draws the ones
|
|
97
|
+
it declares. (The
|
|
98
|
+
canvases a manifest declares are what a shell starts with: an adopt does not
|
|
99
|
+
take them again, a reset does. Nova gives a shell a canvas when something is
|
|
100
|
+
first pushed onto it; an adopt takes out one the manifest does not declare
|
|
101
|
+
once no layout in force holds a slot for it, where one did: `slottedCanvases`,
|
|
102
|
+
`src/artifactory/artifacts.ts`.) The
|
|
103
|
+
entries vex replays it asks the running manifest for as well, before its own
|
|
104
|
+
cache table; nothing else in moss reads one of the four off what the app
|
|
105
|
+
handed over.
|
|
79
106
|
|
|
80
107
|
### 3. One gate, every kind of principal
|
|
81
108
|
|
|
@@ -117,9 +144,9 @@ against the wire alone (`src/terminal/targets.ts`).
|
|
|
117
144
|
The organizing principle: an app hands over **artifacts** and an
|
|
118
145
|
**environment**, and everything mechanical is *derived* — never configured.
|
|
119
146
|
|
|
120
|
-
- The **data layer** stands up from what's present: the
|
|
121
|
-
|
|
122
|
-
|
|
147
|
+
- The **data layer** stands up from what's present: the app's entries are the
|
|
148
|
+
API surface (nothing is generated), and the grantable set is the
|
|
149
|
+
introspected schema × vex's verb leaves. No table list is authored.
|
|
123
150
|
- **Per-principal resolution** is the charter applied at login: roles from the
|
|
124
151
|
app's `identity` seam or its assignment rows, granted action ids (with a
|
|
125
152
|
content-hash version token), the compiled vex scope policy, and the granted
|
|
@@ -159,8 +186,8 @@ open.)
|
|
|
159
186
|
Per-principal UI difference is existence (ring 1) or a served variant (ring 2),
|
|
160
187
|
never a runtime capability flag in a layout. A layout variant (`NiscApp.layouts`)
|
|
161
188
|
is `{ action, layout }` under a minted id; the charter's `layouts` section
|
|
162
|
-
selects who holds which. At shell build, moss
|
|
163
|
-
layout
|
|
189
|
+
selects who holds which. At shell build, moss puts the granted variant's
|
|
190
|
+
layout where that action's layout is kept *before* the shell exists, so every downstream render
|
|
164
191
|
and serialize is already per-principal and the terminal renders what it is served
|
|
165
192
|
— nothing on the wire says why a button is absent. The base layout is the floor
|
|
166
193
|
(the least-privileged holder's shape); variants enrich upward as grants, so
|
|
@@ -180,23 +207,27 @@ entry.
|
|
|
180
207
|
1. **Who is calling?** `identity`: a token is a principal (the deployment's
|
|
181
208
|
verifier, moss's stored credential, the browser's cookie and its seal), and
|
|
182
209
|
a principal is a record (roles, scope values, what is installed for them).
|
|
183
|
-
2. **What exists for them?** `
|
|
184
|
-
|
|
185
|
-
that may be served; and what a set of roles holds of it. Every artifact a
|
|
210
|
+
2. **What exists for them?** `artifactory`: what the app consists of right
|
|
211
|
+
now, with one writer, and what a set of roles holds of it. Every artifact a
|
|
186
212
|
shell is handed is asked of it: the actions, the frame and the layout
|
|
187
|
-
store, the fragments and the entries, in one answer for a shell and a
|
|
188
|
-
|
|
189
|
-
|
|
213
|
+
store, the fragments and the entries, in one answer for a shell and a
|
|
214
|
+
principal, and read off the app by nothing else. It keeps what somebody
|
|
215
|
+
saved while the app runs (a layout, today) and answers it in the same
|
|
216
|
+
place. It is the one holder of the
|
|
217
|
+
entries too: the ones the app shipped and each set handed over, compiled as
|
|
218
|
+
vex replays them. It stands on `manifest`,
|
|
219
|
+
the app as it was handed over: the types an app is written in, the schema
|
|
220
|
+
it is read by and frozen under, and the one verification of whether what
|
|
221
|
+
is in force may be served.
|
|
190
222
|
3. **What may they read and write?** `data`: the vex engine, the policy a set
|
|
191
|
-
of roles reads and writes under, the routes,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
fragment resolves to in `manifest`.
|
|
223
|
+
of roles reads and writes under, the routes, an entry run as a charter
|
|
224
|
+
role, and the tables with their migration. The engine's cache asks the
|
|
225
|
+
artifactory for a fingerprint first, through two functions the server
|
|
226
|
+
hands it, and its own table (`vex_cache`) for what the artifactory does not
|
|
227
|
+
hold: a query written for an intent while the app runs. Nothing is copied
|
|
228
|
+
into that table, and a copy an earlier release left in it is not replayed.
|
|
229
|
+
So what a fingerprint resolves to is decided in `artifactory`, as what an
|
|
230
|
+
action, a layout or a fragment resolves to is.
|
|
200
231
|
4. **What are they looking at?** `shells`: the shell host, one shell's build,
|
|
201
232
|
the stream of frames, and the screen read without attaching.
|
|
202
233
|
5. **How does it reach them?** `socket` for the live wire, `documents` for a
|
|
@@ -247,6 +278,7 @@ this is a copy of it:
|
|
|
247
278
|
| `feature` | `runtime` |
|
|
248
279
|
| `identity` | `runtime`, `protocol` |
|
|
249
280
|
| `manifest` | `identity`, `feature` |
|
|
281
|
+
| `artifactory` | `identity`, `manifest` |
|
|
250
282
|
| `data` | `runtime`, `identity`, `manifest` |
|
|
251
283
|
| `shells` | `runtime`, `protocol`, `manifest`, `data` |
|
|
252
284
|
| `socket` | `runtime`, `protocol`, `identity`, `shells` |
|
|
@@ -260,8 +292,12 @@ this is a copy of it:
|
|
|
260
292
|
|
|
261
293
|
The table has no cycle, and what it leaves out is as deliberate as what it
|
|
262
294
|
names. `shells` does not import `identity`: who somebody is, it is told.
|
|
263
|
-
`socket` does not import `
|
|
264
|
-
handed. `
|
|
295
|
+
`socket` does not import `artifactory`: what somebody holds is a function it
|
|
296
|
+
is handed. `artifactory` and `data` do not import each other: the generation
|
|
297
|
+
pointer's row is `data`'s, when it moves is the artifactory's, the entries
|
|
298
|
+
over the artifactory's two tables are written by the artifactory and replayed
|
|
299
|
+
by `data`, and each reaches the other as functions the server hands over. `integrations` does not
|
|
300
|
+
import `data`: what it reads and writes it
|
|
265
301
|
authors as vex entries and replays through a seam. Nor `manifest`: what it
|
|
266
302
|
asks about a bundle before letting it in (does a layout fit the kit, which
|
|
267
303
|
chains of steps never end) it asks through two seams. A feature imports `feature`, and `runtime` for where a span
|
|
@@ -285,7 +321,8 @@ that made the table:
|
|
|
285
321
|
| Table | Whose | Where its statements are written | What is somewhere else, and why |
|
|
286
322
|
|---|---|---|---|
|
|
287
323
|
| `sessions` | `identity` | `identity/sessions.ts`: five statements straight to the pool, before anybody is signed in | Its table is made in `data`'s one migration run, from a sequence `identity` declares |
|
|
288
|
-
| `moss_generation` | `data` | `data/own-entries.ts`: two entries, one that reads and one that moves | `
|
|
324
|
+
| `moss_generation` | `data` | `data/own-entries.ts`: two entries, one that reads and one that moves | `artifactory` decides when it moves (`artifactory/generation.ts`), through a function `data` hands over |
|
|
325
|
+
| `artifact_saves`, `artifacts` | `artifactory` | `artifactory/saves.ts`: three vex entries and the row rule they run under, replayed through a function `data` hands over (`Data.artifactEntries`) | The two tables are made by the core's sequence (`data/tables.ts`, `nisc.moss/5`). Their rows are somebody's, unlike the pointer's: the entries are replayed with the caller's scope, and vex keeps every read and write to the rows whose `principal` is the caller's `userId`. What is published for everybody is the rows of the principal `*`, replayed with that as the `userId` by the server's own code and by no caller. Moss updates and deletes no row, so a stored body is not rewritten when a grammar moves: it is brought to the current grammars where it is read |
|
|
289
326
|
| `integrations`, `integration_actions` | the `integrations` feature | `integrations/entries.ts`: vex entries, replayed through the seam the feature is handed | The two tables are made by the core's own sequence (`data/tables.ts`, `nisc.moss`): that is the history every database has run, and it is not edited. The documents stored in `integration_actions` are brought to the current grammars by `data`, which holds the pool, when the feature asks through its seam |
|
|
290
327
|
|
|
291
328
|
`data` holds the engine and the one ledgered migration run, so every owner's
|
|
@@ -826,7 +863,7 @@ nothing.
|
|
|
826
863
|
| Temptation | Refusal |
|
|
827
864
|
|---|---|
|
|
828
865
|
| An auth provider | BYO identity. Who somebody is, the app decides at its own door (magic link is the default strategy); the server only asks who a token is. Moss does keep a credential an app may use for that: `mintSession` stores a token by its hash once the app has decided, and `'dev-open'` trusts an unsigned one for a harness. Neither decides anything. |
|
|
829
|
-
| A framework | An assembly point. The intelligence lives in the artifacts; the server resolves, serves, pushes, enforces. Its core is
|
|
866
|
+
| A framework | An assembly point. The intelligence lives in the artifacts; the server resolves, serves, pushes, enforces. Its core is eleven modules, each one question or the wiring, and a twelfth that runs it on Node (*How the code is laid out*). |
|
|
830
867
|
| A place where policy hides | Every opinion it enforces is a readable artifact: charter, scope policy, assertion. No annotations, no interceptor magic. |
|
|
831
868
|
| A second way to do anything | Reads are vex, writes are vex, compute is functions, UI is actions, permissions are the charter. Moss's core adds no vocabulary of its own, and holds itself to the same: the rows it keeps it reads and writes through vex entries, and the statements left outside vex are counted, each with its reason (`pnpm check:raw-sql`). |
|
|
832
869
|
| A web framework | A page is a shell manifest at a path; a drawn document is a first frame delivered early. No file-system routes, no layouts-of-layouts, no loaders, and no chain of middleware for an app to configure (one gate may be laid over the operator prefix, `runtime.operatorGate`). A page's `<head>` is not managed either: it is a node in a layout, written into the document like the rest of the screen. The template, the route and the kit are the app's. |
|
|
@@ -851,9 +888,9 @@ On the record, so nothing reads as finished that isn't:
|
|
|
851
888
|
context management for models — one mechanism, two products.
|
|
852
889
|
- **Scale-out** beyond sticky sessions pinned by session id. What crosses
|
|
853
890
|
processes today is invalidation only: `refresh` moves a generation pointer
|
|
854
|
-
every process polls (`src/
|
|
891
|
+
every process polls (`src/artifactory/generation.ts` holds the clock; the row is
|
|
855
892
|
read and moved through vex, `src/data/own-entries.ts`), and an optional fabric
|
|
856
|
-
(`runtime.fabric`, `src/server/signals.ts`) carries identity invalidations and
|
|
893
|
+
(`runtime.fabric`, `src/server/signals.ts`) carries identity invalidations, nudges, and the word to adopt for one principal.
|
|
857
894
|
A set of actions does not cross: a process that follows the pointer reads
|
|
858
895
|
again the sets it has a loader for, and a set handed to another process
|
|
859
896
|
with `replaceActions` alone never reaches it (DOCS.md, "Many processes").
|