tamperward 2.10.6 → 2.10.8
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 +21 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2869,21 +2869,33 @@ import { readFileSync as readFileSync3, realpathSync as realpathSync2 } from "no
|
|
|
2869
2869
|
import { homedir } from "node:os";
|
|
2870
2870
|
import { basename, dirname, isAbsolute as isAbsolute3, join as join5, posix } from "node:path";
|
|
2871
2871
|
import { fileURLToPath } from "node:url";
|
|
2872
|
+
var PLAIN_SEMVER = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;
|
|
2872
2873
|
function shippedVersion() {
|
|
2873
2874
|
try {
|
|
2874
2875
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
2875
2876
|
for (const rel of ["../package.json", "../../package.json", "../../../package.json"]) {
|
|
2876
2877
|
try {
|
|
2877
2878
|
const pkg = JSON.parse(readFileSync3(join5(here, rel), "utf8"));
|
|
2878
|
-
if (pkg.name === "tamperward" && pkg.version
|
|
2879
|
+
if (pkg.name === "tamperward" && typeof pkg.version === "string" && PLAIN_SEMVER.test(pkg.version)) {
|
|
2880
|
+
return pkg.version;
|
|
2881
|
+
}
|
|
2879
2882
|
} catch {
|
|
2880
2883
|
}
|
|
2881
2884
|
}
|
|
2882
2885
|
} catch {
|
|
2883
2886
|
}
|
|
2884
|
-
return
|
|
2887
|
+
return null;
|
|
2888
|
+
}
|
|
2889
|
+
var RESOLVED_TW_VERSION = shippedVersion();
|
|
2890
|
+
var TW_VERSION = RESOLVED_TW_VERSION ?? "0.0.0-unresolved";
|
|
2891
|
+
function requireShippedVersion() {
|
|
2892
|
+
if (RESOLVED_TW_VERSION === null) {
|
|
2893
|
+
throw new Error(
|
|
2894
|
+
"cannot resolve a plain TamperWard release version from package.json; refusing to generate canonical wiring"
|
|
2895
|
+
);
|
|
2896
|
+
}
|
|
2897
|
+
return RESOLVED_TW_VERSION;
|
|
2885
2898
|
}
|
|
2886
|
-
var TW_VERSION = shippedVersion();
|
|
2887
2899
|
var PRE_TOOLS = ["Bash", "Edit", "Write", "MultiEdit", "NotebookEdit"];
|
|
2888
2900
|
var PRE_MATCHER = PRE_TOOLS.join("|");
|
|
2889
2901
|
var MARKER = "# tamperward: block agent shortcuts before they land";
|
|
@@ -2893,7 +2905,6 @@ var HOOK_CMD = `${NPX_AUTHORITY} tamperward@${TW_VERSION} hook claude${AUTHORITY
|
|
|
2893
2905
|
var SWEEP_CMD = `${NPX_AUTHORITY} tamperward@${TW_VERSION} sweep claude${AUTHORITY_FAIL_CLOSED}`;
|
|
2894
2906
|
var PRECOMMIT_CMD = `${NPX_AUTHORITY} tamperward@${TW_VERSION} check --staged`;
|
|
2895
2907
|
var OURS = /^\s*npx --yes --global --userconfig=\/dev\/null --globalconfig=\/dev\/null\/npmrc-global --registry=https:\/\/registry\.npmjs\.org\/ --node-options=' ' --script-shell= --ignore-scripts --offline=false --prefer-online tamperward(?:@(\S+))? (?:(hook claude|sweep claude) \|\| \(echo tamperward: authority failed to start >&2 && exit 2\)|(check --staged))\s*$/;
|
|
2896
|
-
var PLAIN_SEMVER = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;
|
|
2897
2908
|
function compareVersions(a, b) {
|
|
2898
2909
|
if (!PLAIN_SEMVER.test(a) || !PLAIN_SEMVER.test(b)) return null;
|
|
2899
2910
|
const pa = a.split(".").map(Number);
|
|
@@ -7652,7 +7663,7 @@ jobs:
|
|
|
7652
7663
|
runs-on: ubuntu-latest
|
|
7653
7664
|
timeout-minutes: 10
|
|
7654
7665
|
steps:
|
|
7655
|
-
- uses: actions/setup-node@v6
|
|
7666
|
+
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
|
7656
7667
|
with:
|
|
7657
7668
|
node-version: 22
|
|
7658
7669
|
# Install the authority before candidate files exist in the job workspace.
|
|
@@ -7662,9 +7673,12 @@ jobs:
|
|
|
7662
7673
|
- name: Install Tamperward authority
|
|
7663
7674
|
working-directory: \${{ runner.temp }}
|
|
7664
7675
|
run: npm install --global --registry=https://registry.npmjs.org/ --node-options=' ' --script-shell= --ignore-scripts --offline=false --prefer-online tamperward@${TW_VERSION}
|
|
7665
|
-
- uses: actions/checkout@v5
|
|
7676
|
+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
|
7666
7677
|
with:
|
|
7667
7678
|
fetch-depth: 0 # the range diff needs both endpoints
|
|
7679
|
+
# Candidate code runs later in this job. Do not leave the checkout
|
|
7680
|
+
# token in .git/config where a verifier command can read/reuse it.
|
|
7681
|
+
persist-credentials: false
|
|
7668
7682
|
- name: Resolve out-of-band sign-off from PR labels
|
|
7669
7683
|
id: oob
|
|
7670
7684
|
env:
|
|
@@ -8092,6 +8106,7 @@ function planned(item, path, plan) {
|
|
|
8092
8106
|
}
|
|
8093
8107
|
}
|
|
8094
8108
|
function planInit(cwd, opts = {}) {
|
|
8109
|
+
requireShippedVersion();
|
|
8095
8110
|
return [
|
|
8096
8111
|
planned("policy", POLICY_FILE, () => planPolicy(cwd)),
|
|
8097
8112
|
planned("agent", ".claude/settings.json", () => planClaudeHooks(cwd)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamperward",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.8",
|
|
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",
|