tamperward 2.38.3 → 2.38.4
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 +47 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -19896,6 +19896,18 @@ var init_runtimes = __esm({
|
|
|
19896
19896
|
});
|
|
19897
19897
|
|
|
19898
19898
|
// src/adapters/contract.ts
|
|
19899
|
+
function unknownToolFinding(toolName) {
|
|
19900
|
+
const name = toolName.length > 80 ? toolName.slice(0, 77) + "..." : toolName;
|
|
19901
|
+
const detail = 'Copilot tool "' + name + `" is not in TamperWard's explicit operation vocabulary`;
|
|
19902
|
+
return {
|
|
19903
|
+
rule: "unknown-tool",
|
|
19904
|
+
severity: "block",
|
|
19905
|
+
message: "TamperWard cannot safely classify " + detail + "; it is denied rather than treated as a no-op.",
|
|
19906
|
+
evidence: detail,
|
|
19907
|
+
remediation: "Confirm the tool is non-mutating and add it to the Copilot adapter allowlist, or obtain an explicit sign-off before retrying.",
|
|
19908
|
+
signoff: { required: true, command: 'tamperward allow --reason "..."' }
|
|
19909
|
+
};
|
|
19910
|
+
}
|
|
19899
19911
|
function steeringUnavailableFinding(detail) {
|
|
19900
19912
|
return {
|
|
19901
19913
|
rule: "tamperward-unavailable",
|
|
@@ -20567,7 +20579,8 @@ function copilotOperationKind(toolName) {
|
|
|
20567
20579
|
if (FILE_EDIT_TOOLS2.has(name)) return "file-edit";
|
|
20568
20580
|
if (name.startsWith(MCP_PREFIX2)) return "mcp";
|
|
20569
20581
|
if (FILE_READ_TOOLS2.has(name)) return "file-read";
|
|
20570
|
-
return "other";
|
|
20582
|
+
if (NON_MUTATING_TOOLS.has(name)) return "other";
|
|
20583
|
+
return "unknown";
|
|
20571
20584
|
}
|
|
20572
20585
|
function argsFrom(parsed) {
|
|
20573
20586
|
if (isRecord(parsed.tool_input)) return parsed.tool_input;
|
|
@@ -20630,14 +20643,38 @@ function copilotStopInput(raw) {
|
|
|
20630
20643
|
...input.stop_hook_active !== void 0 ? { stop_hook_active: input.stop_hook_active } : {}
|
|
20631
20644
|
});
|
|
20632
20645
|
}
|
|
20633
|
-
var SHELL_TOOLS2, FILE_EDIT_TOOLS2, FILE_READ_TOOLS2, MCP_PREFIX2;
|
|
20646
|
+
var SHELL_TOOLS2, FILE_EDIT_TOOLS2, FILE_READ_TOOLS2, NON_MUTATING_TOOLS, MCP_PREFIX2;
|
|
20634
20647
|
var init_schema2 = __esm({
|
|
20635
20648
|
"src/adapters/copilot/schema.ts"() {
|
|
20636
20649
|
"use strict";
|
|
20637
20650
|
init_narrow();
|
|
20638
20651
|
SHELL_TOOLS2 = /* @__PURE__ */ new Set(["bash", "powershell", "write_bash", "write_powershell"]);
|
|
20639
20652
|
FILE_EDIT_TOOLS2 = /* @__PURE__ */ new Set(["create", "edit", "write", "multiedit", "apply_patch", "str_replace_editor"]);
|
|
20640
|
-
FILE_READ_TOOLS2 = /* @__PURE__ */ new Set(["view", "read"]);
|
|
20653
|
+
FILE_READ_TOOLS2 = /* @__PURE__ */ new Set(["view", "read", "grep", "rg", "glob"]);
|
|
20654
|
+
NON_MUTATING_TOOLS = /* @__PURE__ */ new Set([
|
|
20655
|
+
"read_bash",
|
|
20656
|
+
"read_powershell",
|
|
20657
|
+
"stop_bash",
|
|
20658
|
+
"stop_powershell",
|
|
20659
|
+
"list_bash",
|
|
20660
|
+
"list_powershell",
|
|
20661
|
+
"web_fetch",
|
|
20662
|
+
"webfetch",
|
|
20663
|
+
"web_search",
|
|
20664
|
+
"websearch",
|
|
20665
|
+
"ask_user",
|
|
20666
|
+
"askuserquestion",
|
|
20667
|
+
"report_intent",
|
|
20668
|
+
"task",
|
|
20669
|
+
"agent",
|
|
20670
|
+
"skill",
|
|
20671
|
+
"update_todo",
|
|
20672
|
+
"todowrite",
|
|
20673
|
+
"todo",
|
|
20674
|
+
"list_agents",
|
|
20675
|
+
"read_agent",
|
|
20676
|
+
"write_agent"
|
|
20677
|
+
]);
|
|
20641
20678
|
MCP_PREFIX2 = "mcp__";
|
|
20642
20679
|
}
|
|
20643
20680
|
});
|
|
@@ -20678,6 +20715,7 @@ var init_adapter3 = __esm({
|
|
|
20678
20715
|
"preToolUse is the only PRE-EXECUTION tool veto; agentStop can only block turn completion and force continuation (a lifecycle control, not a filesystem veto), and Copilot overrides the hook after 8 consecutive blocks (stop_hook_active lifecycle); postToolUse observation is not yet consumed by this adapter",
|
|
20679
20716
|
"apply_patch / str_replace_editor exact hook payloads are modelled from the published contract but not yet confirmed against a pinned real-run fixture (str_replace_editor sub-ops other than str_replace/create fail closed); a PascalCase Edit carrying a patch-style payload fails closed unless a fixture proves the Edit-field rewrite",
|
|
20680
20717
|
"shell-session write tools (write_bash / write_powershell) are classified as mutation-capable shell ops; their exact hook payload is not yet confirmed against a pinned fixture, so an event carrying no reconstructable command/input fails closed",
|
|
20718
|
+
"MCP names are recognized by prefix but are not reconstructed into pre-action changes here; until MCP payload modelling is proven, the end-of-turn sweep remains the authority for their effects",
|
|
20681
20719
|
"network-egress control",
|
|
20682
20720
|
"identity / authentication"
|
|
20683
20721
|
]
|
|
@@ -20747,6 +20785,12 @@ var init_adapter3 = __esm({
|
|
|
20747
20785
|
const wire = stopFromRaw(stopInput, defaultCwd, idv.trustedRoot).stdout;
|
|
20748
20786
|
return { outcome: "ok", wire, decision: { verdict: wire ? "deny" : "allow", findings: [], reason: wire || void 0 } };
|
|
20749
20787
|
}
|
|
20788
|
+
if (parsed.operation.kind === "unknown") {
|
|
20789
|
+
const detail = `unrecognized Copilot tool ${parsed.operation.name}; refusing to evaluate it as a no-op`;
|
|
20790
|
+
const findings = [unknownToolFinding(parsed.operation.name)];
|
|
20791
|
+
const wire = this.denyPayload(findings, "pre-action");
|
|
20792
|
+
return { outcome: "ok", wire, detail, decision: { verdict: "deny", findings, reason: wire } };
|
|
20793
|
+
}
|
|
20750
20794
|
try {
|
|
20751
20795
|
const root = idv.trustedRoot ?? repoRoot(defaultCwd ?? process.cwd());
|
|
20752
20796
|
const sessionCwd = parsed.identity.claimedCwd ?? defaultCwd ?? process.cwd();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamperward",
|
|
3
|
-
"version": "2.38.
|
|
3
|
+
"version": "2.38.4",
|
|
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",
|