tamperward 2.20.0 → 2.20.1
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 +25 -25
- package/dist/cli/index.js +21 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,6 +89,9 @@ judged. In architectural terms, Tamperward separates **steering** from
|
|
|
89
89
|
"pristine" verification restores the protected verification state from the
|
|
90
90
|
trusted starting point and runs the checks again.
|
|
91
91
|
|
|
92
|
+
For the complete component map, trust boundaries, data flows, and deployment
|
|
93
|
+
surfaces, see [the full architecture diagram](./docs/architecture.md).
|
|
94
|
+
|
|
92
95
|
> **Core invariant:** the agent may author the candidate tree, but it must not
|
|
93
96
|
> choose the trusted baseline, the governing policy, the verifier, or the final
|
|
94
97
|
> verdict.
|
|
@@ -110,31 +113,28 @@ trusted starting point and runs the checks again.
|
|
|
110
113
|
### The local enforcement envelope
|
|
111
114
|
|
|
112
115
|
```mermaid
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
V --> X
|
|
136
|
-
Q --> X
|
|
137
|
-
end
|
|
116
|
+
graph TD
|
|
117
|
+
entry["Trusted entry snapshot"]
|
|
118
|
+
hooks["In-loop hooks and observer"]
|
|
119
|
+
agent["Agent runtime"]
|
|
120
|
+
tree["Candidate commit and worktree"]
|
|
121
|
+
adjudicate["Post-exit adjudication"]
|
|
122
|
+
checks["Diff and worktree checks"]
|
|
123
|
+
verify["Visible and pristine verification"]
|
|
124
|
+
integrity["Ancestry dependency and quiescence"]
|
|
125
|
+
verdict["Final exit verdict"]
|
|
126
|
+
|
|
127
|
+
entry --> agent
|
|
128
|
+
hooks --> agent
|
|
129
|
+
agent --> tree
|
|
130
|
+
entry --> adjudicate
|
|
131
|
+
tree --> adjudicate
|
|
132
|
+
adjudicate --> checks
|
|
133
|
+
adjudicate --> verify
|
|
134
|
+
adjudicate --> integrity
|
|
135
|
+
checks --> verdict
|
|
136
|
+
verify --> verdict
|
|
137
|
+
integrity --> verdict
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
Before starting the agent, the envelope
|
package/dist/cli/index.js
CHANGED
|
@@ -1394,8 +1394,27 @@ function countAny(src) {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
return r;
|
|
1396
1396
|
}
|
|
1397
|
-
var NARROW_LINE = /\bas\s+\(*\s*any\b|<\s*any\s
|
|
1397
|
+
var NARROW_LINE = /\bas\s+\(*\s*any\b|<\s*any\s*>|@ts-(?:ignore|expect-error|nocheck)\b/;
|
|
1398
1398
|
var BROAD_LINE = /:\s*any\b|<[^<>]*\bany\b[^<>]*>/;
|
|
1399
|
+
function lineHasDoubleCast(line) {
|
|
1400
|
+
let sf;
|
|
1401
|
+
try {
|
|
1402
|
+
sf = ts2.createSourceFile("line.ts", line, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TS);
|
|
1403
|
+
} catch {
|
|
1404
|
+
return false;
|
|
1405
|
+
}
|
|
1406
|
+
let found = false;
|
|
1407
|
+
const visit = (n) => {
|
|
1408
|
+
if (found) return;
|
|
1409
|
+
if ((ts2.isAsExpression(n) || ts2.isTypeAssertionExpression(n)) && isDoubleCast(n)) {
|
|
1410
|
+
found = true;
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
ts2.forEachChild(n, visit);
|
|
1414
|
+
};
|
|
1415
|
+
visit(sf);
|
|
1416
|
+
return found;
|
|
1417
|
+
}
|
|
1399
1418
|
var BLOCK_REMEDIATION = "Fix the underlying type instead of silencing the checker; do not cast to `any`.";
|
|
1400
1419
|
var WARN_REMEDIATION = "Prefer a precise type or `unknown` + a guard over `any` here \u2014 flagged for review.";
|
|
1401
1420
|
var tsAnyCast = {
|
|
@@ -1447,7 +1466,7 @@ var tsAnyCast = {
|
|
|
1447
1466
|
}
|
|
1448
1467
|
const jsdocCast = JS_FILE.test(c.path) ? new RegExp(JSDOC_ANY_CAST.source) : null;
|
|
1449
1468
|
for (const l of addedLines(c)) {
|
|
1450
|
-
if (NARROW_LINE.test(l.content) || jsdocCast && jsdocCast.test(l.content)) {
|
|
1469
|
+
if (NARROW_LINE.test(l.content) || lineHasDoubleCast(l.content) || jsdocCast && jsdocCast.test(l.content)) {
|
|
1451
1470
|
out2.push(
|
|
1452
1471
|
makeFinding(inTest ? WARN_RULE : BLOCK_RULE, policy, {
|
|
1453
1472
|
file: c.path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamperward",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.1",
|
|
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",
|