@ai-ecoverse/slicc-kernel 1.146.0 → 1.146.2
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/README.md +1 -1
- package/dist/kernel-worker.js +4 -1
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +384 -365
- package/dist/node-process-worker.js.map +4 -4
- package/dist/node.js +4 -1
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +30 -11
- package/dist/process-worker.js.map +3 -3
- package/dist/types/kernel/vfs-file.d.ts +1 -0
- package/dist/types/process/js/async-sab.d.ts +1 -1
- package/dist/types/realm/sync-sab-bridge.d.ts +4 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1128,7 +1128,7 @@ A character device (`0666`), there in every `users` mode, through which programs
|
|
|
1128
1128
|
- **No hash known:** when `lookup` has none (`undefined`), `unknown: 'allow'` (the default) runs the file and reports `{ op: 'exec-unverified', errno: 'ENODATA', … }` once per path, while `unknown: 'deny'` refuses it as a mismatch.
|
|
1129
1129
|
- **The cache:** a result is kept per real path and the file's version: what OPFS itself reports (its `lastModified` and `size`), plus the count of writes kernels made to the file, which the metadata store keeps (Chrome doesn't move `lastModified` for a write through a sync access handle). A kernel with `integrity` set counts a write to a protected file before its bytes change, and again once the write is over (also when it failed), at wherever the file is by then; the count follows a rename, and no `utimes` turns it back. The version also holds the count of moves into protection: a rename or a symlink at or above a protected path counts one before and after it, so a move into a protected path re-verifies every protected program once. So a change made around the kernel, same size included, is checked again at the next start. A kernel without `integrity` counts nothing (so writes into protected paths cost no metadata update), and its writes don't move the version another kernel on the origin reads: give every kernel on one origin the same `integrity`. The cache is the kernel's own, in memory, so nothing verified outlives it. The compiled module is cached by the same key, so a program that hasn't changed costs nothing more to start.
|
|
1130
1130
|
- **Revoking:** a result is kept until the file changes, so when `lookup`'s answers change (an updated hash list, a package revoked or reinstalled), call `await kernel.integrity.revoke(path?)` (on the page and in Node). It drops what the kernel verified for that path, or for everything under it when it's a directory (its real path and the name a link reached it by both count), or for every path without one, and rebuilds the command catalog from the manifests as checked again. A load that was under way when `revoke` was called keeps nothing. It takes effect at the next start: running processes keep what they loaded. `path` must be absolute; without `integrity` it does nothing.
|
|
1131
|
-
- **Where `lookup` gets its hashes:** from a source independent of the installed files, such as the per-file hashes the embedder derives from the
|
|
1131
|
+
- **Where `lookup` gets its hashes:** from a source independent of the installed files, such as the per-file hashes the embedder derives from the published package tarball when it builds its catalog. Hashes read back from the installed files prove nothing.
|
|
1132
1132
|
- **Links out of the paths:** a file reached through a protected path but whose real path lies outside every path (a symlink at or below a protected path, or one of its directories, pointing elsewhere, a command of the catalog included) is still checked, under the last protected name on the way: the kernel asks `lookup(name)` for the bytes of the real file, `unknown` applies when it has no hash, and `onDenial` reports the name as `path`. Writes outside the paths aren't counted, so such a result isn't cached: the file is hashed again at every start.
|
|
1133
1133
|
- **Sources a program reads itself** ([#454](https://github.com/ai-ecoverse/slicc-kernel/issues/454)): a runtime that loads code on its own is checked too, when a process reads the file through the kernel. That covers jsh's and slicc-node's modules and the `package.json` files whose `main`/`exports` they follow, python's `.py`, `.pyc`, `.pth` and zip imports, `dlopen`'s side modules, and a script's interpreter reading the script after its exec check (a file swapped in between is refused then).
|
|
1134
1134
|
- **Which files:** those under a path whose name ends in one of `integrity.sources`, plus every regular file with an execute bit (a `#!` script without a suffix, a sourced script). The default is `['.js', '.mjs', '.cjs', '.json', '.py', '.pyc', '.pth', '.zip', '.so', '.wasm', '.sh']`. An embedder can replace the list, and `sources: []` turns these checks off and leaves only the ones above. Data files aren't checked, since a package can hold files no `lookup` knows (lock files, caches), which `unknown: 'deny'` would make unreadable.
|
package/dist/kernel-worker.js
CHANGED
|
@@ -7728,7 +7728,7 @@ function satisfies(version, range2) {
|
|
|
7728
7728
|
}
|
|
7729
7729
|
|
|
7730
7730
|
// src/version.ts
|
|
7731
|
-
var KERNEL_VERSION = true ? "1.146.
|
|
7731
|
+
var KERNEL_VERSION = true ? "1.146.2" : "0.0.0-dev";
|
|
7732
7732
|
var OS_RELEASE = "6.0.0-slicc";
|
|
7733
7733
|
function procVersion() {
|
|
7734
7734
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -22134,6 +22134,7 @@ var VfsNode = class {
|
|
|
22134
22134
|
opens = 0;
|
|
22135
22135
|
writers = 0;
|
|
22136
22136
|
missing = false;
|
|
22137
|
+
made = false;
|
|
22137
22138
|
revoked = false;
|
|
22138
22139
|
fs;
|
|
22139
22140
|
path;
|
|
@@ -22217,6 +22218,7 @@ var VfsNode = class {
|
|
|
22217
22218
|
if (!isMissing(err)) throw err;
|
|
22218
22219
|
while (this.moving.size > 0) await Promise.all(this.moving);
|
|
22219
22220
|
if (this.path !== at) continue;
|
|
22221
|
+
if (!this.made) throw new KernelError("ENOENT");
|
|
22220
22222
|
this.data = new Uint8Array(0);
|
|
22221
22223
|
this.missing = true;
|
|
22222
22224
|
}
|
|
@@ -22866,6 +22868,7 @@ function vfsFile(fs, opts, nodes) {
|
|
|
22866
22868
|
openError ??= { err };
|
|
22867
22869
|
});
|
|
22868
22870
|
};
|
|
22871
|
+
if (opts.create || opts.truncate) node.made = true;
|
|
22869
22872
|
if (opts.create) atOpen(() => node.materialize());
|
|
22870
22873
|
if (opts.truncate) atOpen(() => node.truncate(0));
|
|
22871
22874
|
const takeOpenError = () => {
|