@niscorp/nisc 0.9.4 → 0.10.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/AGENTS.md +3 -1
- package/CHANGELOG.md +51 -0
- package/package.json +10 -9
package/AGENTS.md
CHANGED
|
@@ -71,6 +71,7 @@ Pick per need; every piece works standalone. Nova is the only mandatory one for
|
|
|
71
71
|
| `signal` | LLM calls | — |
|
|
72
72
|
| `cortex` | agents, tools, orchestration | — |
|
|
73
73
|
| `solid` | streaming structured LLM output into UI | — |
|
|
74
|
+
| `haptic` | reading data from web pages: `discover({ url, instruction })` (`/discovery`, a model run) writes a JSON artifact once, and `prepareArtifact(artifact).run({ url })` reads the page's current values from it later with no model. `/search` finds the pages first when there is only an instruction. An artifact can also be written by hand and checked with `prepared.inspect()` (its `ARTIFACTS.md`). Stored artifacts are upgraded through the `nisc.haptic` grammar (`/migrations`) | scheduling the runs, storing the data, or deciding what happens with it — those are the caller's |
|
|
74
75
|
| `cli` | the `nisc` command: `dev`, `build` (bundle, then say how each path is served — a file, or a server, and why), `export` (the site as a folder; only ever the page as nobody sees it), `start` (the built terminal, pages drawn), `check`, `migrate` (the tables' pending migrations, applied only if the app's entries fit the result). One file, `nisc.config.ts`, says how the app boots and how a screen is drawn | configuration of anything derivable — which paths exist and what each needs is read off the app |
|
|
75
76
|
| `strata` | versions: an app's tables as ledgered sequences; stored and submitted documents stamped and upgraded through grammar sequences; `strata upgrade` for artifacts in source (see Versions) | editing a migration that has run — append one |
|
|
76
77
|
|
|
@@ -120,7 +121,7 @@ Pick per need; every piece works standalone. Nova is the only mandatory one for
|
|
|
120
121
|
|
|
121
122
|
17. No package — and no app, where it can help it — runs DDL outside a strata sequence. Tables change by APPENDING a migration to their owner's sequence; a migration that has run is history, checksummed in the ledger, and editing it makes every database that ran it refuse to boot. The first migration of a sequence may be the old `IF NOT EXISTS` DDL verbatim — split with `sqlSteps(ddl)`, never on every `;` — and that is how an existing database adopts. An app's own tables are its `<app>.app` sequence, handed to moss in `runtime.tables` — with `TIDE_SEQUENCE` (from `@niscorp/tide/postgres`, the store made `migrate: false`) when it keeps tide's tables — and a real database's tables change only through `nisc migrate`: a boot checks them and refuses to start while a migration is pending (`migrations: 'verify'`, the default); only a runtime whose database starts empty every time (PGlite in memory) writes `migrations: 'apply'`. The function that opens a runtime migrates nothing, seeds nothing and calls no `cache.init()`: what it changes itself is changed before the step can check it. A sequence that has run on a database stays in `runtime.tables` even when nothing uses it any more — the run refuses a ledger that records a sequence nobody names (`UNKNOWN_SEQUENCE`) — and its tables go by an appended migration that drops them. One app per database schema: a schema has one ledger. `nisc migrate` refuses a run that removes a table or column or changes a column's type unless it is given `--allow-removal`. Rows an app needs in order to start are written by a migration step, in the same transaction as its tables; a seed that runs at start is for development and demos.
|
|
122
123
|
18. A grammar change is a migration. Changing a schema behind a document kind — nova's actions and layouts, Prism's config, vex's entries, an app kit's component props (`NiscApp.grammars`) — appends to that grammar's sequence: an empty marker for an addition (strict readers must still refuse the newer documents), document steps (a Prism config over ONE node; the grammar's embeddings find every node) for anything else. `pnpm check:grammars` refuses the change until it does, and checks every captured document still upgrades and parses. A grammar version is history — its migrations, and every corpus file captured at an earlier stamp. Its snapshot is its fingerprint: when the grammar did not change but what records it did (a validator describing the same schema differently, strata reading it differently), the current version is re-recorded with `pnpm strata:snapshot --rebaseline` (an app kit: its own snapshot script with `--rebaseline`) in a commit that changes nothing else, and only while the corpus passes — never edited by hand, never answered with a marker.
|
|
123
|
-
19. Stored and submitted documents carry the stamp they were written at and are upgraded where they are read. Ahead of the reader on any grammar the reader was given is refused (`TOO_NEW`), never guessed at: the reader upgrades first — host before add-on, server before terminal.
|
|
124
|
+
19. Stored and submitted documents carry the stamp they were written at and are upgraded where they are read. Ahead of the reader on any grammar the reader was given is refused (`TOO_NEW`), never guessed at: the reader upgrades first — host before add-on, server before terminal. A JSON column an app reads through vex is upgraded by vex: name it once in `upgradedColumns` ("Using Vex"), not in a function around the read.
|
|
124
125
|
20. An app's source records its grammars in `strata.lock.json`. When a grammar moves: `pnpm strata upgrade` writes the exact expected JSON and a report; edit what it lists; `pnpm strata verify` holds the edit to that JSON and only then moves the lock. Never edit the lock by hand, and never "fix" an edit toward a green verify by any route but the expected JSON. `pnpm check:sources` fails an app whose source is behind.
|
|
125
126
|
|
|
126
127
|
## A worked trio
|
|
@@ -248,6 +249,7 @@ export const todosOpen: SeedEntry = {
|
|
|
248
249
|
- **Under moss (the D1 default), hand the entries to `defineApp({ entries })`.** The server derives the data layer: boots the engine, holds the entries and compiles them, serves locked replay-only endpoints, and compiles each principal's `ScopePolicy` from the charter's `data` section. The app never touches an engine, and never writes an entry into vex's cache table itself: entries that arrive while the app runs are handed over with `server.replaceEntries(source, entries)`.
|
|
249
250
|
- **A client-degrade app boots its own engine** — database adapter + cache backend + `ScopePolicy` — `introspect()` once at startup, memoized behind a single accessor. Prewarm at boot through the cache backend's own `set()`: key = the entry's `fingerprint`, `prismIr` = `await compile(mapping ?? { $ref: '$.result' })` (`@niscorp/prism`), plus the shape, the schema fingerprint, and `protected: true` — a seeded entry can never be replaced by a stray request. Seed the identity IR for mapping-less entries explicitly — a NULL IR falls through to the LLM mapper. Throw on duplicate names while seeding.
|
|
250
251
|
- **The fingerprint is the cache key.** Every entry replays as `{ fingerprint, context }` — no shape, no intent on the wire. Id fields still follow `<entity>_id` (self-describing rows); never a shared `{ value, label }`.
|
|
252
|
+
- **A JSON column whose values carry a stamp is named once, in `defineApp({ upgradedColumns })`**, keyed by table and column: `{ answers: { plan: { stamp: 'grammar', kind: 'acme.answers/plan' } } }`, or `kind: { grammar, column }` when the row says which kind it is. Only the app's own tables: a feature's tables are its own, and naming one refuses the boot. Its grammar goes in `grammars`. Every read of it, replay or reactive, hands the mapping the value upgraded and the stamp current (rule 19). A read returns it only as one of its own fields, and returns its stamp column (and the kind column) beside it; vex refuses any other read of it when the read is compiled, and moss compiles every seeded read at boot, so such an entry refuses the boot. A row that does not upgrade (written by newer code, `TOO_NEW`; a step that fails, `STEP_FAILED`; a kind no grammar declares, `UNKNOWN_KIND`) refuses the whole read, unless the column says `unreadable: 'omit'` (the row is left out) or `'null'` (the value is null); either is said in `meta.warnings`. vex DOCS.md, "Upgraded columns", has every rule. A client-degrade app hands its engine `upgradedColumns` and `upgrader` (strata's `createUpgrader(...)`) itself.
|
|
251
253
|
- **The mapping owns the result shape.** Vex evaluates it over `{ result, context, scope }` and returns the output verbatim — array, object, or scalar. The entry's stored shape picks what `$.result` is: an **array** shape → `$.result` is the rows (map with `$map`, or `{ $ref: '$.result' }` for identity); an **object** shape → `$.result` is the single (first) row, `null` when none came back (read fields as `$.result.monthly`, never `[0, …]`). Formatting (money, dates) lives here, in shared helpers.
|
|
252
254
|
- **App reads are replay-only.** Moss serves its endpoints locked; a client-degrade app passes `{ locked: true }` itself. An unknown fingerprint (a missed prewarm, a discipline break) is a 500, never a silent LLM call. With no AI features, also wire no hooks: warm-only, enforced twice.
|
|
253
255
|
- **Live queries are the opt-in LLM path.** Wire `createQueryDsl` / `createShapeMapper` (`@niscorp/vex/agent`) as the engine's `generateDsl` / `mapToShape` hooks; a request without a fingerprint generates, caches, and mints one (`meta.cache.fingerprint`) — embed that to replay the proven query. App reads stay locked and never depend on this path; agents and ad-hoc features do.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @niscorp/nisc
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- eaf381a: **Haptic renders a page only where Node closes the network to the page's scripts: Node 25 or later.** jsdom is not a sandbox. A page's inline script reaches Node itself in the render process, and on Node 24 and earlier that process could open connections to any address (private and cloud-metadata addresses too, past the transport the app hands Haptic). It could also signal any process of the same user, or open the app's own inspector and run code in the app. Discovery renders any level where 3 or more links share one address with different texts, which the page's author decides. A run renders when the artifact says `render: true`.
|
|
8
|
+
|
|
9
|
+
Now the render process starts under Node's permission model with no network, which Node enforces from version 25, and `process.kill` and `process._debugProcess` are removed before the page runs. On Node 24 and earlier nothing is rendered: the page is read as fetched, as a page that cannot be rendered always was.
|
|
10
|
+
|
|
11
|
+
BREAKING — approved by moccadroid, 2026-11-17: run on Node 25 or later (26 is the LTS) to keep rendering pages. On Node 24 and earlier, an artifact with `render: true` and discovery on a page whose links a script writes read the page as fetched.
|
|
12
|
+
|
|
13
|
+
`@niscorp/nisc` installs Haptic, so it moves with it.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 637d412: **A vex read returns stamped JSON columns upgraded.** A JSON column whose values carry the grammar stamp they were written at in another JSON column of the row can now be named once on the engine, with a strata upgrader beside it: `createQueryEngine({ upgrader: await createUpgrader(grammars, { transform: evaluate }), upgradedColumns: { answers: { plan: { stamp: 'grammar', kind: 'acme.answers/plan' } } } })`. A kind can also be read from the row: `kind: { grammar: 'acme.notes', column: 'kind' }`. Every read that returns the column (a replay, a generated read, a reactive read's every answer, `engine.test`) hands its mapping and its caller the value upgraded, with the stamp set to the stamp the upgrade gives back. A read returns the column only as one of its own fields, with its stamp (and kind) column beside it; vex refuses any other read of it when the read is compiled. A row that does not upgrade refuses the read, or, where the column says `unreadable: 'omit'` or `'null'`, is left out or has that value set to null, with a line in `meta.warnings`. New exports: `UpgradedColumnsSchema`, `UNREADABLE_MODES`, and the types `UpgradedColumn`, `UpgradedColumns`, `ColumnUpgrader`.
|
|
18
|
+
|
|
19
|
+
**Moss takes them on the manifest.** `defineApp({ upgradedColumns })` hands them to the app's engine and to the one that answers intents, with the upgrader moss builds from nova's, Prism's and vex's grammars and the app's `grammars`. Only the app's own tables can be named. The boot is refused where a table named is a feature's, the artifactory's or the generation pointer's (their owners read them as stored), where a kind is in none of those grammars, where a column or its stamp is not a json column of the database, or where a seeded read does not compile: an app that names `upgradedColumns` has every seeded read compiled at boot and on a refresh, so a read of an upgraded column that vex refuses stops the boot rather than its first replay.
|
|
20
|
+
|
|
21
|
+
**The rulebook** says so under "Using Vex" and in rule 19.
|
|
22
|
+
|
|
23
|
+
**What to change:** nothing. An app or engine that names no `upgradedColumns` reads every column as stored, as before. No grammar, table, entry or cache format changes.
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [eaf381a]
|
|
26
|
+
- Updated dependencies [03adbbe]
|
|
27
|
+
- Updated dependencies [637d412]
|
|
28
|
+
- @niscorp/haptic@0.2.0
|
|
29
|
+
- @niscorp/tide@0.1.12
|
|
30
|
+
- @niscorp/vex@0.4.5
|
|
31
|
+
- @niscorp/moss@0.9.3
|
|
32
|
+
|
|
33
|
+
## 0.9.6
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [686e9c7]
|
|
38
|
+
- @niscorp/prism@0.3.4
|
|
39
|
+
- @niscorp/haptic@0.1.1
|
|
40
|
+
|
|
41
|
+
## 0.9.5
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 8af2922: **`@niscorp/nisc` installs `@niscorp/haptic`.** The bundle is every nisc package at the version it was released with, and Haptic was missing from it. AGENTS.md lists Haptic in the toolbox: what it is for and what stays the caller's.
|
|
46
|
+
|
|
47
|
+
**Haptic accepts zod from 4.2.0, as every nisc package does.** 0.1.0 asked for `^4.6.5`, so an app on zod 4.2 to 4.5 was warned about a peer it could keep. Haptic's package check passes with one zod 4.2.0 copy shared by Haptic, Prism, Strata, Cortex and Signal: the saved artifacts run and every entry point typechecks.
|
|
48
|
+
|
|
49
|
+
**What to change:** nothing.
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [8af2922]
|
|
52
|
+
- @niscorp/haptic@0.1.1
|
|
53
|
+
|
|
3
54
|
## 0.9.4
|
|
4
55
|
|
|
5
56
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/nisc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
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": {
|
|
@@ -19,18 +19,19 @@
|
|
|
19
19
|
"node": ">=22.12"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@niscorp/charter": "0.1.5",
|
|
22
23
|
"@niscorp/cortex": "0.1.6",
|
|
23
|
-
"@niscorp/
|
|
24
|
+
"@niscorp/haptic": "0.2.0",
|
|
25
|
+
"@niscorp/cli": "0.9.1",
|
|
24
26
|
"@niscorp/loom": "0.5.0",
|
|
25
|
-
"@niscorp/
|
|
27
|
+
"@niscorp/moss": "0.9.3",
|
|
26
28
|
"@niscorp/nova": "0.5.2",
|
|
27
|
-
"@niscorp/
|
|
28
|
-
"@niscorp/prism": "0.3.3",
|
|
29
|
-
"@niscorp/signal": "0.1.9",
|
|
29
|
+
"@niscorp/prism": "0.3.4",
|
|
30
30
|
"@niscorp/solid": "0.1.3",
|
|
31
|
-
"@niscorp/
|
|
32
|
-
"@niscorp/
|
|
33
|
-
"@niscorp/
|
|
31
|
+
"@niscorp/signal": "0.1.9",
|
|
32
|
+
"@niscorp/strata": "0.1.9",
|
|
33
|
+
"@niscorp/tide": "0.1.12",
|
|
34
|
+
"@niscorp/vex": "0.4.5"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"zod": "^4.2.0"
|