Metadata-Version: 2.4
Name: visiq
Version: 0.2.1
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
License-File: LICENSE
Summary: VisIQ agent-governance SDK — local, in-process policy decisions from ONE compiled core (Path B).
Keywords: agent,governance,authorization,ai,security,policy
Author-email: VisIQ Labs <dev@visiqlabs.com>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://docs.visiqlabs.com
Project-URL: Homepage, https://visiqlabs.com
Project-URL: Repository, https://github.com/VISIQ-LABS/xy

# `visiq` — VisIQ agent-governance Python SDK (Path B)

The first REAL, installable, CLOSED multi-language SDK. ONE compiled Rust core
(the Path-B engine) makes the SAME governance decisions as the shipped TypeScript
SDK (`@visiq/harness`), exposed through an ergonomic Python API.

```python
import visiq
d = visiq.gate_action(bundle, tool_name="wire_transfer", args={"amount": 999}, agent_id="a")
if not d["allowed"]:
    ...  # block — the tool never runs
```

## Why it's real (not a prototype)
- **Installable**: `maturin` builds an **abi3 wheel** (`pip install visiq`) — ONE
  binary for py3.9+; the engine is **compiled machine code, no source in the
  artifact** (closed / hard-to-RE, better than npm minification).
- **Correct**: it reuses the proven rego engine (`../rseval/engine`, 1316/1316 vs
  L0) + the unified-runtime layer matched to the real TS `UnifiedRuntime`.

## Structure
- `src/lib.rs` — the Path-B core + PyO3 `_core.evaluate(event_json, bundle_json)`.
- `python/visiq/__init__.py` — the ergonomic API (`decide` / `gate_action` / `gate_retrieval`).
- `conformance.py` — **GATE 1**: the installable SDK reproduces the event-corpus
  stamps (== shipped TS SDK decisions) across the full 93-vector corpus.
- `interception_smoke.py` — **GATE 2**: a REAL LlamaIndex `FunctionAgent`'s tool
  dispatch is governed by the REAL compiled core (denied tool never executes;
  committed negative control).

## Publishing (CTO-gated)
`.github/workflows/pypi-publish.yml` — `workflow_dispatch`-only; builds closed
abi3 wheels for every platform, runs **both gates (required)**, then publishes via
PyPI OIDC Trusted Publishing behind the `production` environment (CTO approval).
No SDK is claimed "supported" on the integrations page until it is genuinely
installable AND passes both gates.

## Build + verify
```
./run.sh
```
Prereq: Rust toolchain + `python3 -m venv .venv && .venv/bin/pip install maturin llama-index-core`.

## Scope + next
Covers every event→input dimension + verb + the no-coverage posture (action:
verb→read/write/delete/admin→approve/deny/ask, a faithful port of the TS
`resolveNoCoverage`; retrieval: always fail-closed). **Next:** grow the event
corpus toward full L0 breadth; then the Ruby/Go/Java/Node bindings over the SAME
core, each gated by this same corpus.

