@armoriq/policy-ir 0.1.3 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoriq/policy-ir",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Armor Policy v2 intermediate representation: types, canonical serializer, policy hash, evaluator, compiler and the golden vectors every runtime must pass",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -55,22 +55,21 @@
55
55
  "sideEffects": false,
56
56
  "scripts": {
57
57
  "build": "tsup",
58
- "typecheck": "tsc -p tsconfig.json --noEmit",
59
- "lint": "eslint .",
58
+ "typecheck": "tsgo -p tsconfig.json --noEmit",
59
+ "lint": "oxlint",
60
60
  "test": "vitest run",
61
61
  "smoke": "node test/smoke/consume.mjs && node test/smoke/consume.cjs && node test/smoke/typecheck.mjs && node test/smoke/browser.mjs",
62
62
  "check": "npm run lint && npm run typecheck && npm test && npm run build && npm run smoke",
63
63
  "vectors:generate": "tsx scripts/generate-vectors.ts"
64
64
  },
65
65
  "devDependencies": {
66
- "@eslint/js": "^9.12.0",
67
66
  "@types/node": "^20.16.0",
67
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
68
68
  "esbuild": "^0.27.7",
69
- "eslint": "^9.12.0",
69
+ "oxlint": "1.89.0",
70
70
  "tsup": "^8.3.0",
71
71
  "tsx": "^4.19.0",
72
72
  "typescript": "^5.6.0",
73
- "typescript-eslint": "^8.8.0",
74
73
  "vitest": "^2.1.0"
75
74
  },
76
75
  "publishConfig": {
@@ -1,6 +1,7 @@
1
1
  [
2
2
  {"id":"VC-14","name":"schemaHash of the declared tool is bound on every args condition (FR-14)","yaml":"apiVersion: armor.io/v2\nkind: Policy\nmetadata:\n name: vector\n orgId: 11111111-1111-4111-8111-111111111111\ntarget:\n agent: aaaaaaaa-0000-4000-8000-000000000001\nspec:\n tools:\n default: hold\n rules:\n create_payment:\n - when: {args.amount: {gt: 5000}}\n action: hold\n approval: {approvers: 2, roles: [finance_lead]}\n - action: allow\n approvalDefaults: {approvers: 1, roles: [admin]}\n","inventory":[{"name":"create_payment","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true},{"name":"Read","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","inputSchema":{"type":"object","properties":{"file_path":{"type":"string"}}},"declared":true},{"name":"create_issue","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__create_issue","capabilities":["destructive"]},{"name":"list_issues","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__list_issues","capabilities":[]},{"name":"delete_repo","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__delete_repo","capabilities":["destructive"]},{"name":"observed_only","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":null,"declared":false}],"expect":{"errors":[],"warnings":[],"statementIds":["st-create-payment-0","st-create-payment-1"],"bindings":{"st-create-payment-0":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}},
3
3
  {"id":"VC-15","name":"an unknown control identifier compiles with a warning naming it","yaml":"apiVersion: armor.io/v2\nkind: Policy\nmetadata:\n name: vector\n orgId: 11111111-1111-4111-8111-111111111111\ntarget:\n agent: aaaaaaaa-0000-4000-8000-000000000001\nspec:\n tools:\n default: hold\n rules:\n Read:\n - action: allow\n controls: [SOC2-CC6.1, NOT-A-CONTROL]\n approvalDefaults: {approvers: 1, roles: [admin]}\n","inventory":[{"name":"create_payment","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true},{"name":"Read","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","inputSchema":{"type":"object","properties":{"file_path":{"type":"string"}}},"declared":true},{"name":"create_issue","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__create_issue","capabilities":["destructive"]},{"name":"list_issues","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__list_issues","capabilities":[]},{"name":"delete_repo","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__delete_repo","capabilities":["destructive"]},{"name":"observed_only","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":null,"declared":false}],"expect":{"errors":[],"warnings":["unknown_control"],"statementIds":["st-read-0"]}},
4
+ {"id":"VC-15b","name":"FERPA, ITAR and EAR section identifiers compile with no warning","yaml":"apiVersion: armor.io/v2\nkind: Policy\nmetadata:\n name: vector\n orgId: 11111111-1111-4111-8111-111111111111\ntarget:\n agent: aaaaaaaa-0000-4000-8000-000000000001\nspec:\n tools:\n default: hold\n rules:\n Read:\n - action: allow\n controls: [FERPA-99.31, ITAR-120.50, EAR-734.13]\n approvalDefaults: {approvers: 1, roles: [admin]}\n","inventory":[{"name":"create_payment","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true},{"name":"Read","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","inputSchema":{"type":"object","properties":{"file_path":{"type":"string"}}},"declared":true},{"name":"create_issue","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__create_issue","capabilities":["destructive"]},{"name":"list_issues","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__list_issues","capabilities":[]},{"name":"delete_repo","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__delete_repo","capabilities":["destructive"]},{"name":"observed_only","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":null,"declared":false}],"expect":{"errors":[],"warnings":[],"statementIds":["st-read-0"]}},
4
5
  {"id":"VC-8","name":"a rule key not in the inventory compiles with a warning","yaml":"apiVersion: armor.io/v2\nkind: Policy\nmetadata:\n name: vector\n orgId: 11111111-1111-4111-8111-111111111111\ntarget:\n agent: aaaaaaaa-0000-4000-8000-000000000001\nspec:\n tools:\n default: hold\n rules:\n nonexistent_tool: block\n approvalDefaults: {approvers: 1, roles: [admin]}\n","inventory":[{"name":"create_payment","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true},{"name":"Read","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","inputSchema":{"type":"object","properties":{"file_path":{"type":"string"}}},"declared":true},{"name":"create_issue","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__create_issue","capabilities":["destructive"]},{"name":"list_issues","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__list_issues","capabilities":[]},{"name":"delete_repo","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__delete_repo","capabilities":["destructive"]},{"name":"observed_only","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":null,"declared":false}],"expect":{"errors":[],"warnings":["unknown_tool_key"],"statementIds":["st-nonexistent-tool-0"]}},
5
6
  {"id":"VC-8b","name":"an observed-only tool compiles without a binding and says so","yaml":"apiVersion: armor.io/v2\nkind: Policy\nmetadata:\n name: vector\n orgId: 11111111-1111-4111-8111-111111111111\ntarget:\n agent: aaaaaaaa-0000-4000-8000-000000000001\nspec:\n tools:\n default: hold\n rules:\n observed_only:\n - when: {args.x: {exists: true}}\n action: block\n approvalDefaults: {approvers: 1, roles: [admin]}\n","inventory":[{"name":"create_payment","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true},{"name":"Read","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","inputSchema":{"type":"object","properties":{"file_path":{"type":"string"}}},"declared":true},{"name":"create_issue","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__create_issue","capabilities":["destructive"]},{"name":"list_issues","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__list_issues","capabilities":[]},{"name":"delete_repo","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__delete_repo","capabilities":["destructive"]},{"name":"observed_only","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":null,"declared":false}],"expect":{"errors":[],"warnings":["observed_only_tool"],"bindings":{"st-observed-only-0":null}}},
6
7
  {"id":"VC-9","name":"an args key the schema does not declare compiles with a warning","yaml":"apiVersion: armor.io/v2\nkind: Policy\nmetadata:\n name: vector\n orgId: 11111111-1111-4111-8111-111111111111\ntarget:\n agent: aaaaaaaa-0000-4000-8000-000000000001\nspec:\n tools:\n default: hold\n rules:\n create_payment:\n - when: {args.nonexistent: {gt: 5}}\n action: block\n approvalDefaults: {approvers: 1, roles: [admin]}\n","inventory":[{"name":"create_payment","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true},{"name":"Read","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","inputSchema":{"type":"object","properties":{"file_path":{"type":"string"}}},"declared":true},{"name":"create_issue","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__create_issue","capabilities":["destructive"]},{"name":"list_issues","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__list_issues","capabilities":[]},{"name":"delete_repo","owner":{"type":"mcp_server","id":"srv-github","name":"github"},"schemaHash":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","inputSchema":{"type":"object","properties":{"amount":{"type":"number"},"recipient":{"type":"string"}}},"declared":true,"qualifiedName":"mcp__github__delete_repo","capabilities":["destructive"]},{"name":"observed_only","owner":{"type":"agent","id":"agent-1","name":"support-agent"},"schemaHash":null,"declared":false}],"expect":{"errors":[],"warnings":["unknown_argument"]}},