visiq 0.1.0-aarch64-linux → 0.1.1-aarch64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff880d1b8f59c8f8af6a81d49511545f8addb24612caf6b208336134626eae65
4
- data.tar.gz: 69a3eca3e9b046a707496818c75eea06682499ce1a5bb8fac75bdfc69fdee170
3
+ metadata.gz: 62019e14f6eaca1722c3c9e897e641838a2ea88d367a7aa24f86a402baa2a33c
4
+ data.tar.gz: 4c3b6db8a3597acaf928e7f3dbecc54bed637158496975f02d9672b173c258aa
5
5
  SHA512:
6
- metadata.gz: 5a046a1c32d4de7ae66b7c320d5a221458a868e10e31e3fc4b5b6f6d47e209cba1ab6d97dab5e116dc700a7f97c039c00b6ebaef3d043da5795d659e5f12679e
7
- data.tar.gz: 9c6dbe1b3fb49b4e4c94d52f6978972ca34512236c60a2712456ff7621ba078c8256d38eded40c7b11e53670387a1b663391c8f34fb23bf2f5a4357858a9d088
6
+ metadata.gz: 0616f7861f3c5626e69aaefed5a80fc6a929211bda0294c9751bc7b7782833374dbc5ef6f31a3bf949fa9b2c90fb89482a74f365d142246b994bbda1d7b3abcc
7
+ data.tar.gz: ef37ebca47c208cb12afef8622af63b4f456a61a6cf53303addfdd0780a4eb53fc999c5cca637338a394fa687549152275c89bce01596288c1b9e1e376a26dbe
data/README.md CHANGED
@@ -1,12 +1,17 @@
1
1
  # visiq — VisIQ agent-governance SDK for Ruby
2
2
 
3
- Local, in-process governance decisions for AI agents. ONE compiled Rust core
4
- (Path B) makes the **same** decisions as the shipped TypeScript SDK
5
- (`@visiq/harness`), bound to Ruby through the stdlib `Fiddle` FFI. The engine
3
+ Returns a `permit`, `deny`, `approval_required`, `redact`, `escalate`, or `mask`
4
+ decision for a tool call or retrieval **before your application executes it**
5
+ your code acts on the verdict; this SDK does not block for you. Decisions are made
6
+ in-process by the compiled VisIQ core that every VisIQ SDK shares (the same engine
7
+ behind `@visiq/harness`), bound to Ruby through the stdlib `Fiddle` FFI. The engine
6
8
  ships as **compiled machine code** (closed); the Ruby is thin FFI plumbing only.
7
9
 
8
10
  - **Local & fast** — every decision is in-process, no network.
9
- - **Fails closed (G001)** — malformed input, or a core that can't load, denies.
11
+ - **Fail-open by default (G001 rescope, owner 2026-07-15)** — a harness-internal
12
+ failure (the core can't load, an FFI error) returns a loud fail-open permit;
13
+ set `VISIQ_FAIL_MODE=closed` to block instead. Malformed input and explicit
14
+ policy denials always block.
10
15
  - **Cross-language parity** — reproduces the exact decisions of the TS/Python/…
11
16
  SDKs from the same core, verified against a shared corpus.
12
17
 
data/lib/visiq.rb CHANGED
@@ -2,13 +2,16 @@
2
2
 
3
3
  # VisIQ agent-governance SDK (Ruby) — local, in-process policy decisions.
4
4
  #
5
- # ONE compiled Rust core (Path B) makes the SAME decisions as the shipped
6
- # TypeScript SDK (`@visiq/harness`). This gem is a thin binding over the core's
5
+ # Governance evaluation has ONE source of truth the compiled Rust core and
6
+ # every VisIQ SDK evaluates through it rather than reimplementing the rules, which
7
+ # is what keeps decisions identical across languages; a shared conformance corpus
8
+ # is what enforces that. This gem is a thin binding over the core's
7
9
  # language-neutral C-ABI seam (`visiq_evaluate`/`visiq_free`) via Ruby's stdlib
8
10
  # `Fiddle` — zero runtime gem dependencies. The engine is compiled machine code;
9
11
  # the gem ships the shared library CLOSED (the Ruby is only FFI plumbing, no
10
- # policy). Every decision is local (no network) and fails closed on malformed
11
- # input (G001).
12
+ # policy). Every decision is local (no network); a harness-internal failure is
13
+ # routed by VISIQ_FAIL_MODE (default "open" — see #fail_mode below), while
14
+ # malformed input and explicit policy denials always block (G001 rescope).
12
15
  #
13
16
  # require "visiq"
14
17
  # d = Visiq.gate_action(bundle, tool_name: "wire_transfer", args: { "amount" => 999 }, agent_id: "a")
@@ -20,7 +23,7 @@ require "json"
20
23
  require "rbconfig"
21
24
 
22
25
  module Visiq
23
- VERSION = "0.1.0"
26
+ VERSION = "0.1.1"
24
27
 
25
28
  # Low-level binding to the compiled core over the C-ABI seam.
26
29
  module Core
@@ -86,10 +89,44 @@ module Visiq
86
89
 
87
90
  module_function
88
91
 
92
+ # Error posture (owner decision 2026-07-15, G001 rescope): a harness-internal
93
+ # failure (the compiled core cannot load, an FFI error) is routed by
94
+ # VISIQ_FAIL_MODE — "open" (DEFAULT): return a loud fail-open permit so a
95
+ # VisIQ packaging/outage bug never disrupts the agent; "closed": raise as
96
+ # before. Policy outcomes from a successful evaluation are unaffected.
97
+ def fail_mode
98
+ raw = ENV["VISIQ_FAIL_MODE"].to_s.strip.downcase
99
+ %w[open closed].include?(raw) ? raw : "open"
100
+ end
101
+
102
+ # A non-enforced permit decision naming the failure cause — the fail-open
103
+ # counterpart of the core's decisions, mirrored from the TS runtime.
104
+ def fail_open_decision(operations, cause)
105
+ warn "[VisIQ] FAIL-OPEN (core-error): #{cause} — proceeding UNGOVERNED. " \
106
+ "Set VISIQ_FAIL_MODE=closed to block instead."
107
+ has_action = operations.include?("action") || operations.include?("delegation")
108
+ has_retrieval = operations.include?("retrieval")
109
+ {
110
+ "decision" => "permit",
111
+ "allowed" => true,
112
+ "reason" => "fail-open: #{cause} — proceeding UNGOVERNED (set VISIQ_FAIL_MODE=closed to block instead)",
113
+ "ruleId" => nil,
114
+ "ruleCode" => nil,
115
+ "enforced" => false,
116
+ "action" => has_action ? { "decision" => "permit", "allowed" => true } : { "decision" => nil, "allowed" => true },
117
+ "retrieval" => has_retrieval ? { "action" => "allow" } : { "action" => nil }
118
+ }
119
+ end
120
+
89
121
  # Evaluate one governed agent event against a rules bundle. Returns the
90
122
  # UnifiedDecision hash: {"decision","allowed","action","retrieval"}.
91
123
  def decide(event, bundle)
92
124
  JSON.parse(Core.evaluate_json(JSON.generate(event), JSON.generate(bundle)))
125
+ rescue StandardError, Fiddle::DLError => e
126
+ # Core load / FFI / parse failure — a HARNESS error, never a policy one.
127
+ raise if fail_mode == "closed"
128
+
129
+ fail_open_decision(event["operations"] || [], e.message)
93
130
  end
94
131
 
95
132
  # Gate a tool/action call. Check ["allowed"]; on "mask" apply
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - VisIQ Labs Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-08 00:00:00.000000000 Z
11
+ date: 2026-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fiddle
@@ -24,10 +24,12 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
- description: ONE compiled Rust core (Path B) that reproduces the shipped TypeScript
28
- SDK's decisions, bound to Ruby via a stdlib Fiddle FFI. Fully local; fails closed
29
- on malformed input (G001). The engine ships as compiled machine code (closed); the
30
- Ruby is thin FFI plumbing only.
27
+ description: VisIQ agent-governance SDK for Ruby returns a permit, deny, approval_required,
28
+ redact, escalate, or mask decision for a tool call or retrieval before your application
29
+ executes it, evaluated in-process by the compiled VisIQ core that every VisIQ SDK
30
+ shares. Installs with no compiler toolchain on macOS and Linux, x86_64 and arm64,
31
+ with no Windows gem; malformed input denies, and core-load failures follow VISIQ_FAIL_MODE,
32
+ which defaults to open.
31
33
  email:
32
34
  - dev@visiqlabs.com
33
35
  executables: []
@@ -65,5 +67,5 @@ requirements: []
65
67
  rubygems_version: 3.5.22
66
68
  signing_key:
67
69
  specification_version: 4
68
- summary: VisIQ agent-governance SDK local, in-process policy decisions.
70
+ summary: VisIQ agent-governance SDK for Ruby
69
71
  test_files: []