tamperward 2.13.1 → 2.13.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/dist/cli/index.js +24 -24
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -7025,7 +7025,7 @@ function dropTurnTree(cwd, sessionId) {
|
|
|
7025
7025
|
}
|
|
7026
7026
|
|
|
7027
7027
|
// src/cli/watch.ts
|
|
7028
|
-
import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync4, readdirSync as readdirSync2,
|
|
7028
|
+
import { appendFileSync as appendFileSync3, lstatSync as lstatSync3, mkdirSync as mkdirSync4, readdirSync as readdirSync2, watch } from "node:fs";
|
|
7029
7029
|
import { join as join11 } from "node:path";
|
|
7030
7030
|
import { createHash as createHash4 } from "node:crypto";
|
|
7031
7031
|
var SKIP2 = /(^|\/)(\.git|node_modules)(\/|$)/;
|
|
@@ -7060,7 +7060,7 @@ function watchTree(dir, cb) {
|
|
|
7060
7060
|
const child = rel ? `${rel}/${String(fname)}` : String(fname);
|
|
7061
7061
|
cb(kind, child);
|
|
7062
7062
|
try {
|
|
7063
|
-
if (
|
|
7063
|
+
if (lstatSync3(join11(dir, child)).isDirectory()) addDir(child);
|
|
7064
7064
|
} catch {
|
|
7065
7065
|
}
|
|
7066
7066
|
});
|
|
@@ -7081,7 +7081,7 @@ function watchTree(dir, cb) {
|
|
|
7081
7081
|
const child = rel ? `${rel}/${name}` : name;
|
|
7082
7082
|
if (SKIP2.test(child + "/")) continue;
|
|
7083
7083
|
try {
|
|
7084
|
-
if (
|
|
7084
|
+
if (lstatSync3(join11(dir, child)).isDirectory()) walk2(child);
|
|
7085
7085
|
} catch {
|
|
7086
7086
|
}
|
|
7087
7087
|
}
|
|
@@ -7126,12 +7126,12 @@ function runWatch(args) {
|
|
|
7126
7126
|
}
|
|
7127
7127
|
|
|
7128
7128
|
// src/detectors/fs-events.ts
|
|
7129
|
-
import { readFileSync as readFileSync10, statSync
|
|
7129
|
+
import { readFileSync as readFileSync10, statSync } from "node:fs";
|
|
7130
7130
|
var RULE11 = "transient-protected-mutation";
|
|
7131
7131
|
function readEvents(log, offset) {
|
|
7132
7132
|
let size = 0;
|
|
7133
7133
|
try {
|
|
7134
|
-
size =
|
|
7134
|
+
size = statSync(log).size;
|
|
7135
7135
|
} catch {
|
|
7136
7136
|
return { events: [], newOffset: offset };
|
|
7137
7137
|
}
|
|
@@ -7598,7 +7598,7 @@ Honored at LOCAL pre-commit only. The agent-layer hook ignores this file; CI req
|
|
|
7598
7598
|
// src/cli/init.ts
|
|
7599
7599
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
7600
7600
|
import { createHash as createHash6 } from "node:crypto";
|
|
7601
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as readFileSync12, writeFileSync as writeFileSync5, chmodSync, statSync as
|
|
7601
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as readFileSync12, writeFileSync as writeFileSync5, chmodSync, statSync as statSync2 } from "node:fs";
|
|
7602
7602
|
import { basename as basename2, dirname as dirname4, isAbsolute as isAbsolute8, join as join12, relative as relative3, resolve as resolve3 } from "node:path";
|
|
7603
7603
|
|
|
7604
7604
|
// src/verifier-limits.ts
|
|
@@ -7985,7 +7985,7 @@ function planPreCommit(cwd) {
|
|
|
7985
7985
|
}
|
|
7986
7986
|
}
|
|
7987
7987
|
const rel = display(cwd, path);
|
|
7988
|
-
if (existsSync9(path) && !
|
|
7988
|
+
if (existsSync9(path) && !statSync2(path).isFile()) {
|
|
7989
7989
|
return { item: "pre-commit", path: rel, status: "error", detail: "exists but is not a regular file \u2014 refusing to write" };
|
|
7990
7990
|
}
|
|
7991
7991
|
const existing = existsSync9(path) ? readFileSync12(path, "utf8") : null;
|
|
@@ -8535,7 +8535,7 @@ function runDoctor(opts = {}) {
|
|
|
8535
8535
|
// src/cli/verify.ts
|
|
8536
8536
|
import { execFileSync as execFileSync9, spawnSync as spawnSync2 } from "node:child_process";
|
|
8537
8537
|
import { createHash as createHash10 } from "node:crypto";
|
|
8538
|
-
import { chmodSync as chmodSync2, cpSync, lstatSync as
|
|
8538
|
+
import { chmodSync as chmodSync2, cpSync, lstatSync as lstatSync5, mkdirSync as mkdirSync6, mkdtempSync as mkdtempSync2, readFileSync as readFileSync16, readlinkSync as readlinkSync3, rmSync as rmSync3, symlinkSync, writeFileSync as writeFileSync6 } from "node:fs";
|
|
8539
8539
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
8540
8540
|
import { dirname as dirname7, isAbsolute as isAbsolute10, join as join16, relative as relative5, resolve as resolve7, sep as sep2 } from "node:path";
|
|
8541
8541
|
|
|
@@ -8569,12 +8569,12 @@ function treeFingerprint(cwd, keepIgnored) {
|
|
|
8569
8569
|
import { createHash as createHash8 } from "node:crypto";
|
|
8570
8570
|
import {
|
|
8571
8571
|
existsSync as existsSync11,
|
|
8572
|
-
lstatSync as
|
|
8572
|
+
lstatSync as lstatSync4,
|
|
8573
8573
|
readdirSync as readdirSync4,
|
|
8574
8574
|
readFileSync as readFileSync14,
|
|
8575
8575
|
readlinkSync as readlinkSync2,
|
|
8576
8576
|
realpathSync as realpathSync3,
|
|
8577
|
-
statSync as
|
|
8577
|
+
statSync as statSync3
|
|
8578
8578
|
} from "node:fs";
|
|
8579
8579
|
import {
|
|
8580
8580
|
basename as basename3,
|
|
@@ -8593,7 +8593,7 @@ function inside(root, candidate) {
|
|
|
8593
8593
|
return rel === "" || rel !== ".." && !rel.startsWith(".." + sep) && !isAbsolute9(rel);
|
|
8594
8594
|
}
|
|
8595
8595
|
function modeKind(path) {
|
|
8596
|
-
const st =
|
|
8596
|
+
const st = lstatSync4(path);
|
|
8597
8597
|
if (st.isFile()) return { kind: "file", mode: st.mode };
|
|
8598
8598
|
if (st.isDirectory()) return { kind: "dir", mode: st.mode };
|
|
8599
8599
|
if (st.isSymbolicLink()) return { kind: "symlink", mode: st.mode };
|
|
@@ -8603,7 +8603,7 @@ function fingerprintRoot(root, cwd, h) {
|
|
|
8603
8603
|
let rootStat;
|
|
8604
8604
|
let currentReal;
|
|
8605
8605
|
try {
|
|
8606
|
-
rootStat =
|
|
8606
|
+
rootStat = lstatSync4(root.path);
|
|
8607
8607
|
currentReal = realpathSync3(root.path);
|
|
8608
8608
|
} catch (e) {
|
|
8609
8609
|
throw new Unattestable(
|
|
@@ -8615,7 +8615,7 @@ function fingerprintRoot(root, cwd, h) {
|
|
|
8615
8615
|
root.kind + " root moved from " + JSON.stringify(root.realPath) + " to " + JSON.stringify(currentReal)
|
|
8616
8616
|
);
|
|
8617
8617
|
}
|
|
8618
|
-
if (!
|
|
8618
|
+
if (!statSync3(root.path).isDirectory()) {
|
|
8619
8619
|
throw new Unattestable(root.kind + " root " + JSON.stringify(root.path) + " is not a directory");
|
|
8620
8620
|
}
|
|
8621
8621
|
h.update("root\0" + root.kind + "\0" + root.path + "\0" + root.realPath + "\0" + String(rootStat.mode) + "\0");
|
|
@@ -8625,7 +8625,7 @@ function fingerprintRoot(root, cwd, h) {
|
|
|
8625
8625
|
const hashFile = (path, label) => {
|
|
8626
8626
|
let st;
|
|
8627
8627
|
try {
|
|
8628
|
-
st =
|
|
8628
|
+
st = statSync3(path);
|
|
8629
8629
|
if (!st.isFile()) throw new Error("not a regular file");
|
|
8630
8630
|
h.update(label + "\0external-file\0" + path + "\0" + String(st.mode) + "\0");
|
|
8631
8631
|
h.update(readFileSync14(path));
|
|
@@ -8691,7 +8691,7 @@ function fingerprintRoot(root, cwd, h) {
|
|
|
8691
8691
|
} catch {
|
|
8692
8692
|
continue;
|
|
8693
8693
|
}
|
|
8694
|
-
const followed =
|
|
8694
|
+
const followed = statSync3(path);
|
|
8695
8695
|
if (followed.isFile()) {
|
|
8696
8696
|
hashFile(resolved, "@target:" + rel);
|
|
8697
8697
|
continue;
|
|
@@ -8729,7 +8729,7 @@ function snapshot(roots, probes, cwd) {
|
|
|
8729
8729
|
}
|
|
8730
8730
|
function freezeRoot(kind, path) {
|
|
8731
8731
|
try {
|
|
8732
|
-
if (!
|
|
8732
|
+
if (!statSync3(path).isDirectory()) {
|
|
8733
8733
|
throw new Error("not a directory");
|
|
8734
8734
|
}
|
|
8735
8735
|
return { kind, path: resolve5(path), realPath: realpathSync3(path) };
|
|
@@ -8778,7 +8778,7 @@ function resolveExecutable(token, cwd, env) {
|
|
|
8778
8778
|
for (const entry of (env.PATH ?? "").split(delimiter).filter(Boolean)) {
|
|
8779
8779
|
const candidate = resolve5(entry, token);
|
|
8780
8780
|
try {
|
|
8781
|
-
if (existsSync11(candidate) &&
|
|
8781
|
+
if (existsSync11(candidate) && statSync3(candidate).isFile()) return realpathSync3(candidate);
|
|
8782
8782
|
} catch {
|
|
8783
8783
|
}
|
|
8784
8784
|
}
|
|
@@ -8921,7 +8921,7 @@ function dependencyEnvironmentSummary(descriptor) {
|
|
|
8921
8921
|
// src/verifier-backend.ts
|
|
8922
8922
|
import { createHash as createHash9, randomUUID } from "node:crypto";
|
|
8923
8923
|
import { spawnSync } from "node:child_process";
|
|
8924
|
-
import { accessSync, constants as constants2, readFileSync as readFileSync15, realpathSync as realpathSync4, statSync as
|
|
8924
|
+
import { accessSync, constants as constants2, readFileSync as readFileSync15, realpathSync as realpathSync4, statSync as statSync4 } from "node:fs";
|
|
8925
8925
|
import { delimiter as delimiter2, dirname as dirname6, join as join15, resolve as resolve6 } from "node:path";
|
|
8926
8926
|
var DEFAULT_CONTAINER_RESOURCE_LIMITS = Object.freeze({
|
|
8927
8927
|
memoryBytes: 2 * 1024 * 1024 * 1024,
|
|
@@ -8939,7 +8939,7 @@ function identity() {
|
|
|
8939
8939
|
}
|
|
8940
8940
|
function writableByCaller(path) {
|
|
8941
8941
|
try {
|
|
8942
|
-
const st =
|
|
8942
|
+
const st = statSync4(path);
|
|
8943
8943
|
const { uid, groups } = identity();
|
|
8944
8944
|
if (uid === 0) return true;
|
|
8945
8945
|
if ((st.mode & 2) !== 0) return true;
|
|
@@ -9512,7 +9512,7 @@ function validateSymlinkGraph(target, out2, root, dependencyRoot, label) {
|
|
|
9512
9512
|
const current = join16(base, ...stack);
|
|
9513
9513
|
let st;
|
|
9514
9514
|
try {
|
|
9515
|
-
st =
|
|
9515
|
+
st = lstatSync5(current);
|
|
9516
9516
|
} catch {
|
|
9517
9517
|
continue;
|
|
9518
9518
|
}
|
|
@@ -9548,7 +9548,7 @@ function rejectLinkedParent(cwd, rel) {
|
|
|
9548
9548
|
current = join16(current, part);
|
|
9549
9549
|
let st;
|
|
9550
9550
|
try {
|
|
9551
|
-
st =
|
|
9551
|
+
st = lstatSync5(current);
|
|
9552
9552
|
} catch {
|
|
9553
9553
|
continue;
|
|
9554
9554
|
}
|
|
@@ -9565,7 +9565,7 @@ function materialize(cwd, dest, dependencyRoot) {
|
|
|
9565
9565
|
rejectLinkedParent(cwd, rel);
|
|
9566
9566
|
let st;
|
|
9567
9567
|
try {
|
|
9568
|
-
st =
|
|
9568
|
+
st = lstatSync5(src);
|
|
9569
9569
|
} catch {
|
|
9570
9570
|
continue;
|
|
9571
9571
|
}
|
|
@@ -9590,7 +9590,7 @@ function materialize(cwd, dest, dependencyRoot) {
|
|
|
9590
9590
|
}
|
|
9591
9591
|
function dropSymlink(p) {
|
|
9592
9592
|
try {
|
|
9593
|
-
if (
|
|
9593
|
+
if (lstatSync5(p).isSymbolicLink()) rmSync3(p, { force: true });
|
|
9594
9594
|
} catch {
|
|
9595
9595
|
}
|
|
9596
9596
|
}
|
|
@@ -9621,7 +9621,7 @@ function overlayDigest(dest, paths) {
|
|
|
9621
9621
|
h.update("\0");
|
|
9622
9622
|
const p = join16(dest, rel);
|
|
9623
9623
|
try {
|
|
9624
|
-
const st =
|
|
9624
|
+
const st = lstatSync5(p);
|
|
9625
9625
|
h.update(String(st.mode));
|
|
9626
9626
|
h.update(st.isSymbolicLink() ? readlinkSync3(p) : readFileSync16(p));
|
|
9627
9627
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamperward",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.2",
|
|
4
4
|
"description": "The deterministic agent-integrity gate. One ruleset, evaluated on the actual diff/commands as a verdict, enforced everywhere a change can be made.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "hexrift",
|