visiq 0.1.0-x86_64-linux → 0.1.1-x86_64-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 +4 -4
- data/README.md +9 -4
- data/lib/visiq.rb +42 -5
- data/vendor/libvisiq_core.so +0 -0
- metadata +9 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59fdf18306fae52394f76fef053f6fa43101b2bb35fb0d600d365c0f417c96bc
|
|
4
|
+
data.tar.gz: 87d2048ad63900902379436fb5e7fd1e7e9ef4d9b007b5c1c1dcb42751048a16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30fc08b2017c157cea8dbccefcb58b1a1d157c40377fe8ff0304f200502d5b1f3b215b66ddedfe191707ca47abb88e9553848fd1b417a07879736dd6481beac9
|
|
7
|
+
data.tar.gz: 3022c4da2ae3f40aa0b320e10ed3c6dcf1f07f49345b86f24ca191616fcf6829a736761d256a679bcfdc5202ddae3b832ad03adaff0a798e9e605525975379c9
|
data/README.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
# visiq — VisIQ agent-governance SDK for Ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
- **
|
|
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
|
-
#
|
|
6
|
-
#
|
|
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)
|
|
11
|
-
#
|
|
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.
|
|
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
|
data/vendor/libvisiq_core.so
CHANGED
|
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.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- VisIQ Labs Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
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:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
70
|
+
summary: VisIQ agent-governance SDK for Ruby
|
|
69
71
|
test_files: []
|