@ouro.bot/cli 0.1.0-alpha.808 → 0.1.0-alpha.809
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.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.809",
|
|
6
|
+
"changes": [
|
|
7
|
+
"D-004: keep native device/inode checks exact for large filesystem identities in confined session transactions and private repair artifacts."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.808",
|
|
6
12
|
"changes": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0"?>
|
|
2
2
|
<Container version="2">
|
|
3
3
|
<Name>ouro-butler</Name>
|
|
4
|
-
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.809</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -92,7 +92,7 @@ function directoryChain(directory) {
|
|
|
92
92
|
parts.push(current);
|
|
93
93
|
}
|
|
94
94
|
return parts.map((file) => {
|
|
95
|
-
const stat = fs.lstatSync(file);
|
|
95
|
+
const stat = fs.lstatSync(file, { bigint: true });
|
|
96
96
|
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
97
97
|
refuse("directory symlink or type mismatch");
|
|
98
98
|
return { path: file, dev: stat.dev, ino: stat.ino };
|
|
@@ -100,14 +100,14 @@ function directoryChain(directory) {
|
|
|
100
100
|
}
|
|
101
101
|
function checkDirectories(pin) {
|
|
102
102
|
for (const entry of pin) {
|
|
103
|
-
const stat = fs.lstatSync(entry.path);
|
|
103
|
+
const stat = fs.lstatSync(entry.path, { bigint: true });
|
|
104
104
|
if (!stat.isDirectory() || stat.isSymbolicLink() || !sameInode(entry, stat))
|
|
105
105
|
refuse("directory identity changed");
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
function privateDirectory(directory) {
|
|
109
109
|
const pin = directoryChain(directory);
|
|
110
|
-
if ((fs.lstatSync(directory).mode &
|
|
110
|
+
if ((fs.lstatSync(directory, { bigint: true }).mode & 511n) !== 448n)
|
|
111
111
|
refuse("artifact directory must have mode 0700");
|
|
112
112
|
return pin;
|
|
113
113
|
}
|
|
@@ -115,12 +115,12 @@ function privateFile(file, label, limit) {
|
|
|
115
115
|
if (!path.isAbsolute(file) || path.resolve(file) !== file)
|
|
116
116
|
refuse("noncanonical file path");
|
|
117
117
|
directoryChain(path.dirname(file));
|
|
118
|
-
const stat = fs.lstatSync(file);
|
|
118
|
+
const stat = fs.lstatSync(file, { bigint: true });
|
|
119
119
|
if (!stat.isFile() || stat.isSymbolicLink())
|
|
120
120
|
refuse(`${label} must be a regular file`);
|
|
121
|
-
if ((stat.mode &
|
|
121
|
+
if ((stat.mode & 511n) !== 384n)
|
|
122
122
|
refuse(`${label} must have mode 0600`);
|
|
123
|
-
if (stat.size > limit)
|
|
123
|
+
if (stat.size > BigInt(limit))
|
|
124
124
|
refuse(`${label} exceeds ${limit / (1024 * 1024)} MiB`);
|
|
125
125
|
return stat;
|
|
126
126
|
}
|
|
@@ -129,12 +129,12 @@ function readArtifact(file, label, limit) {
|
|
|
129
129
|
const original = privateFile(file, label, limit);
|
|
130
130
|
const fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
|
|
131
131
|
try {
|
|
132
|
-
const opened = fs.fstatSync(fd);
|
|
133
|
-
if (!opened.isFile() || !sameInode(original, opened) || (opened.mode &
|
|
132
|
+
const opened = fs.fstatSync(fd, { bigint: true });
|
|
133
|
+
if (!opened.isFile() || !sameInode(original, opened) || (opened.mode & 511n) !== 384n || opened.size > BigInt(limit))
|
|
134
134
|
refuse("artifact identity changed");
|
|
135
135
|
const bytes = fs.readFileSync(fd);
|
|
136
136
|
checkDirectories(pin);
|
|
137
|
-
if (bytes.length > limit || !sameInode(opened, fs.lstatSync(file)))
|
|
137
|
+
if (bytes.length > limit || !sameInode(opened, fs.lstatSync(file, { bigint: true })))
|
|
138
138
|
refuse("artifact changed during read");
|
|
139
139
|
return bytes;
|
|
140
140
|
}
|
|
@@ -326,7 +326,7 @@ function publishArtifacts(directory, artifacts) {
|
|
|
326
326
|
const pin = privateDirectory(directory);
|
|
327
327
|
for (const artifact of artifacts) {
|
|
328
328
|
try {
|
|
329
|
-
fs.lstatSync(artifact.path);
|
|
329
|
+
fs.lstatSync(artifact.path, { bigint: true });
|
|
330
330
|
refuse("final artifact already exists");
|
|
331
331
|
}
|
|
332
332
|
catch (error) {
|
|
@@ -342,7 +342,7 @@ function publishArtifacts(directory, artifacts) {
|
|
|
342
342
|
created.push(record);
|
|
343
343
|
const fd = fs.openSync(record.temporary, fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL | fs.constants.O_NOFOLLOW, 0o600);
|
|
344
344
|
try {
|
|
345
|
-
record.identity = fs.fstatSync(fd);
|
|
345
|
+
record.identity = fs.fstatSync(fd, { bigint: true });
|
|
346
346
|
fs.writeFileSync(fd, artifact.bytes);
|
|
347
347
|
fs.fsyncSync(fd);
|
|
348
348
|
}
|
|
@@ -369,8 +369,8 @@ function publishArtifacts(directory, artifacts) {
|
|
|
369
369
|
checkDirectories(pin);
|
|
370
370
|
const readFd = fs.openSync(record.final, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
|
|
371
371
|
try {
|
|
372
|
-
const stat = fs.fstatSync(readFd);
|
|
373
|
-
if (!stat.isFile() || !sameInode(record.identity, stat) || (stat.mode &
|
|
372
|
+
const stat = fs.fstatSync(readFd, { bigint: true });
|
|
373
|
+
if (!stat.isFile() || !sameInode(record.identity, stat) || (stat.mode & 511n) !== 384n || stat.size !== BigInt(artifact.bytes.length)
|
|
374
374
|
|| sha(fs.readFileSync(readFd)) !== sha(artifact.bytes))
|
|
375
375
|
refuse("published artifact identity or hash mismatch");
|
|
376
376
|
}
|
|
@@ -385,7 +385,7 @@ function publishArtifacts(directory, artifacts) {
|
|
|
385
385
|
continue;
|
|
386
386
|
try {
|
|
387
387
|
checkDirectories(pin);
|
|
388
|
-
const current = fs.lstatSync(record.final);
|
|
388
|
+
const current = fs.lstatSync(record.final, { bigint: true });
|
|
389
389
|
if (current.isFile() && !current.isSymbolicLink() && sameInode(current, record.identity))
|
|
390
390
|
fs.unlinkSync(record.final);
|
|
391
391
|
}
|
|
@@ -401,7 +401,7 @@ function publishArtifacts(directory, artifacts) {
|
|
|
401
401
|
continue;
|
|
402
402
|
try {
|
|
403
403
|
checkDirectories(pin);
|
|
404
|
-
const current = fs.lstatSync(record.temporary);
|
|
404
|
+
const current = fs.lstatSync(record.temporary, { bigint: true });
|
|
405
405
|
if (current.isFile() && !current.isSymbolicLink() && sameInode(current, record.identity))
|
|
406
406
|
fs.unlinkSync(record.temporary);
|
|
407
407
|
}
|
|
@@ -101,7 +101,7 @@ function refuseConfinement() {
|
|
|
101
101
|
function confinedFile(filePath) {
|
|
102
102
|
let stat;
|
|
103
103
|
try {
|
|
104
|
-
stat = fs.lstatSync(filePath);
|
|
104
|
+
stat = fs.lstatSync(filePath, { bigint: true });
|
|
105
105
|
}
|
|
106
106
|
catch (error) {
|
|
107
107
|
if (error?.code === "ENOENT")
|
|
@@ -118,7 +118,7 @@ function checkConfinement(pin) {
|
|
|
118
118
|
for (const directory of pin.directories) {
|
|
119
119
|
let stat;
|
|
120
120
|
try {
|
|
121
|
-
stat = fs.lstatSync(directory.path);
|
|
121
|
+
stat = fs.lstatSync(directory.path, { bigint: true });
|
|
122
122
|
}
|
|
123
123
|
catch {
|
|
124
124
|
return refuseConfinement();
|
|
@@ -149,7 +149,7 @@ function pinConfinement(sessionPath, root) {
|
|
|
149
149
|
const directories = paths.map((directory) => {
|
|
150
150
|
let stat;
|
|
151
151
|
try {
|
|
152
|
-
stat = fs.lstatSync(directory);
|
|
152
|
+
stat = fs.lstatSync(directory, { bigint: true });
|
|
153
153
|
}
|
|
154
154
|
catch {
|
|
155
155
|
return refuseConfinement();
|
|
@@ -498,7 +498,7 @@ function writeSessionTransaction(sessionPath, value, options) {
|
|
|
498
498
|
try {
|
|
499
499
|
fd = fs.openSync(tempPath, "wx", 0o600);
|
|
500
500
|
if (confinement)
|
|
501
|
-
temporaryIdentity = fs.fstatSync(fd);
|
|
501
|
+
temporaryIdentity = fs.fstatSync(fd, { bigint: true });
|
|
502
502
|
fs.writeFileSync(fd, bytes, "utf8");
|
|
503
503
|
fs.fsyncSync(fd);
|
|
504
504
|
fs.closeSync(fd);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.809",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ouro.bot/cli",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.809",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@azure/identity": "^4.13.0",
|