tamperward 2.38.1 → 2.38.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.
Files changed (2) hide show
  1. package/dist/cli/index.js +14 -3
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -23832,8 +23832,10 @@ function assessCapabilities(caps, evidence) {
23832
23832
  }
23833
23833
  function aggregateInLoop(assessments) {
23834
23834
  const byId = new Map(assessments.map((a) => [a.id, a]));
23835
- const required = REQUIRED_IN_LOOP_IDS.map((id) => byId.get(id)).filter((a) => a !== void 0);
23836
- const anyDangerous = required.some((a) => a.state === "FAIL-OPEN" || a.state === "INCONCLUSIVE");
23835
+ const required = REQUIRED_IN_LOOP_IDS.map((id) => byId.get(id));
23836
+ const presentRequired = required.filter((a) => a !== void 0);
23837
+ const completeRequiredSet = required.every((a) => a !== void 0) && REQUIRED_IN_LOOP_IDS.every((id) => assessments.filter((a) => a.id === id).length === 1);
23838
+ const anyDangerous = presentRequired.some((a) => a.state === "FAIL-OPEN" || a.state === "INCONCLUSIVE");
23837
23839
  const present = (id) => {
23838
23840
  const s = byId.get(id)?.state;
23839
23841
  return s === "PROVEN" || s === "PARTIAL";
@@ -23841,7 +23843,7 @@ function aggregateInLoop(assessments) {
23841
23843
  const anyPreDenyPresent = PRE_DENY_IDS.some(present);
23842
23844
  const endOfTurnPresent = present("end-of-turn");
23843
23845
  if (!anyPreDenyPresent && !endOfTurnPresent) return "NONE";
23844
- if (!anyDangerous && required.every((a) => a.state === "PROVEN")) return "FULL";
23846
+ if (!anyDangerous && completeRequiredSet && presentRequired.every((a) => a.state === "PROVEN")) return "FULL";
23845
23847
  return "PARTIAL";
23846
23848
  }
23847
23849
  function sha16(s) {
@@ -24045,11 +24047,20 @@ function validateStoredReport(value) {
24045
24047
  if (!source || typeof detail !== "string") return { reason: "invalid capability evidence" };
24046
24048
  capabilities.push({ id, state, evidence: { source, detail } });
24047
24049
  }
24050
+ const capabilityIds = capabilities.map((c) => c.id);
24051
+ const capabilitySet = new Set(capabilityIds);
24052
+ const testedSet = new Set(testedCapabilities);
24053
+ if (capabilityIds.length !== capabilitySet.size || testedCapabilities.length !== testedSet.size || capabilitySet.size !== testedSet.size || capabilityIds.some((id) => !testedSet.has(id)) || testedCapabilities.some((id) => !capabilitySet.has(id))) {
24054
+ return { reason: "capabilities do not exactly match tested_capabilities" };
24055
+ }
24048
24056
  const inLoop = value.in_loop_protection;
24049
24057
  if (inLoop !== "FULL" && inLoop !== "PARTIAL" && inLoop !== "NONE") return { reason: "invalid in_loop_protection" };
24050
24058
  if (value.final_authority !== FINAL_AUTHORITY) return { reason: "invalid final_authority" };
24051
24059
  const note = value.note;
24052
24060
  if (typeof note !== "string") return { reason: "invalid note" };
24061
+ if (!recorded && (capabilities.length > 0 || inLoop !== "NONE")) {
24062
+ return { reason: "unrecorded report carries capability data" };
24063
+ }
24053
24064
  const base = {
24054
24065
  runtime: { id: rId, label: rLabel, version: rVersion },
24055
24066
  tamperward: { version: twVersion, commit: twCommit },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tamperward",
3
- "version": "2.38.1",
3
+ "version": "2.38.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",