@niscorp/nisc 0.8.12 → 0.9.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 +1 -1
- package/CHANGELOG.md +28 -0
- package/package.json +5 -5
package/AGENTS.md
CHANGED
|
@@ -116,7 +116,7 @@ Pick per need; every piece works standalone. Nova is the only mandatory one for
|
|
|
116
116
|
|
|
117
117
|
**Versions** (`@niscorp/strata`; the why is `packages/strata/DESIGN.md`)
|
|
118
118
|
|
|
119
|
-
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,
|
|
119
|
+
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.
|
|
120
120
|
18. A grammar change is a migration. Changing a schema behind a document kind — nova's actions and layouts, Prism's config, 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.
|
|
121
121
|
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.
|
|
122
122
|
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.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @niscorp/nisc
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2780c56: A real database's tables change only through `nisc migrate`. `migrations` on the runtime defaults to `'verify'`: `createServer` — and so `nisc dev`, `nisc build` and `nisc start` — checks the tables and refuses to start while a migration is pending, naming each one and the two commands that apply it (`npx nisc migrate --check`, then `npx nisc migrate`). On a database that is up to date the check only reads the ledger, so the app's database role needs `SELECT` on `strata_ledger` and no right to change tables. A runtime whose database starts empty every time (PGlite in memory) writes `migrations: 'apply'` and is migrated at boot as before.
|
|
8
|
+
|
|
9
|
+
The boot and `migrateTables` refuse a database whose ledger records a sequence they do not name (`UNKNOWN_SEQUENCE`): a sequence that has run stays in `runtime.tables`.
|
|
10
|
+
|
|
11
|
+
`migrateTables` and `nisc migrate` refuse a run that removes a table or a column, or changes a column's type, unless `allowRemoval` / `--allow-removal` is given; the refusal names each. A run that applied nothing, because another run had already applied it, is not refused.
|
|
12
|
+
|
|
13
|
+
`tableStatus(runtime, app)` and `nisc migrate --status`: what is applied and what is pending, read and nothing else.
|
|
14
|
+
|
|
15
|
+
BREAKING — approved by moccadroid, 2026-11-07: a runtime on a real database runs `nisc migrate` before the app starts (on Railway, the service's pre-deploy command `pnpm exec nisc migrate`); a runtime on in-memory PGlite writes `migrations: 'apply'`; every sequence that has run on the database is in `runtime.tables` (`TIDE_SEQUENCE` with the store made `migrate: false`), and the runtime migrates nothing itself and calls no `cache.init()`; a database that has not yet run `nisc.moss/4` is migrated once with `--allow-removal`.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2780c56: A moss app's `nisc.config.ts` hands over `app` and `runtime`, so `nisc migrate` works the day the app moves to a real database; `boot` uses the same `runtime`, so the tables `nisc migrate` applies are the ones the boot checks. The in-memory runtime writes `migrations: 'apply'` and no longer calls `cache.init()`.
|
|
20
|
+
|
|
21
|
+
AGENTS.md rule 17: a real database's tables change only through `nisc migrate`; a boot checks them; only a runtime whose database starts empty every time writes `migrations: 'apply'`; every sequence that has run stays in `runtime.tables`; one app per database schema.
|
|
22
|
+
|
|
23
|
+
**What to change:** an app already made from the moss template writes `migrations: 'apply'` in its in-memory runtime when it takes this release (see the moss changeset): without it, its boot refuses with `PENDING`. A new app gets all of the above.
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [2780c56]
|
|
26
|
+
- Updated dependencies [2780c56]
|
|
27
|
+
- @niscorp/moss@0.9.0
|
|
28
|
+
- @niscorp/cli@0.9.0
|
|
29
|
+
- @niscorp/strata@0.1.8
|
|
30
|
+
|
|
3
31
|
## 0.8.12
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/nisc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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": {
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@niscorp/charter": "0.1.4",
|
|
23
|
+
"@niscorp/cli": "0.9.0",
|
|
23
24
|
"@niscorp/cortex": "0.1.5",
|
|
24
|
-
"@niscorp/cli": "0.8.2",
|
|
25
25
|
"@niscorp/loom": "0.5.0",
|
|
26
|
-
"@niscorp/moss": "0.
|
|
26
|
+
"@niscorp/moss": "0.9.0",
|
|
27
27
|
"@niscorp/nova": "0.5.1",
|
|
28
28
|
"@niscorp/prism": "0.3.2",
|
|
29
29
|
"@niscorp/signal": "0.1.8",
|
|
30
30
|
"@niscorp/solid": "0.1.2",
|
|
31
|
-
"@niscorp/strata": "0.1.7",
|
|
32
31
|
"@niscorp/tide": "0.1.9",
|
|
33
|
-
"@niscorp/vex": "0.4.3"
|
|
32
|
+
"@niscorp/vex": "0.4.3",
|
|
33
|
+
"@niscorp/strata": "0.1.8"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"zod": "^4.2.0"
|