arborist/pyproject.toml
russell@unturf.com 70ecda3d6c
#000049 Phase 2: NLI shadow scaffold in arborist (§7 #19)
arborist/qa/nli/ — SHADOW ONLY (never an audit_mode input; manifest not
yet in governance_policy_hash per §7 #2). manifest.json pins
cross-encoder/nli-MiniLM2-L6-H768 @ a fixed HF revision + the
bench-validated θc 0.5/θe 0.9 + 2 alternates + the Phase-3 TODO;
shadow.py = ShadowNLI/shadow_check (lazy transformers+torch behind a new
[nli] extra, clauses() segmenter, the §7 #5 clause-level Demote()
decision, degrades to available=False when [nli] absent);
bench/scripts/nli_shadow_sweep.py + make bootstrap-nli / bench-nli-shadow
(the gate-item-4 instrument); 16 tests.

First sweep (116 records — 5f-falsification packs + the arborist-nli-bench
eval sets): 28/28 synth recombination demoted, 0/26 FP on legit summaries,
0/9 fires on already-STRICT_SPAN records, 25/50 on UNGROUNDED (the
contradiction half; quiet on non-sequiturs). Gate items 1/2/3/5/6 clear
on available data; item 4 — shadow FP rate on a real live-bench-qa
sample — remains the open measurement. Production verifier unchanged;
falsification-hard stays 10/12.
2026-05-12 14:14:21 -04:00

117 lines
3.6 KiB
TOML

[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[project]
name = "arborist"
version = "0.0.1"
description = "An arborist for trees and forests of cross-linked information"
readme = "README.md"
license = { text = "AGPL-3.0-only" }
requires-python = ">=3.10"
authors = [
{ name = "Russell Ballestrini", email = "russell@unturf.com" },
{ name = "foxhop" },
{ name = "TimeHexOn" },
]
dependencies = [
"httpx>=0.27",
"zstandard>=0.22",
"cryptography>=42",
]
[project.optional-dependencies]
html = [
"selectolax>=0.3",
]
wikitext = [
"mwparserfromhell>=0.6",
]
mesh = [
# httpx is already in core deps; mesh wire only depends on stdlib +
# cryptography (also core). This extras block exists as the documented
# opt-in surface even though no extra packages are required today.
]
math = [
# Symbolic algebra/calculus π* substrate (ticket #000030). SymPy is
# ~30 MB installed; pulling it into core deps would inflate every
# fresh checkout. Tests skip via pytest.importorskip when absent.
"sympy>=1.13",
]
hessian = [
# Phi_alignment_probe (ticket #000034 Phase 1a). Lanczos top-k +
# bottom-k eigendecomposition for measuring whether v7's frozen
# linear projection W aligns with the loss Hessian's low-eigenvalue
# subspace. Numpy + scipy together ~80 MB; gated separately from
# core to keep the default install lightweight. Tests skip via
# pytest.importorskip when absent. Install with:
# pip install 'arborist[hessian]'
"numpy>=1.26",
"scipy>=1.11",
]
crawler = [
# Verbatim lift from agents.ai.unturf.com/core. Off by default — the
# default test suite never imports the crawler. Install with:
# pip install 'arborist[crawler]'
# then run `make test-crawler`.
"aiohttp>=3.8",
"beautifulsoup4>=4.11",
"lxml>=4.9",
"html5lib>=1.1",
"html2text>=2024.2.26",
"miniuri>=1.1",
"feedparser>=6.0",
"Pillow>=10.0",
"cairosvg>=2.7",
"pypdf>=4.0",
]
vec = [
# Optional sqlite-vec semantic retrieval backend (ticket #000039).
# sqlite-vec ships only the loadable SQLite extension (~1 MB);
# fastembed pulls onnxruntime + tokenizers + huggingface-hub
# (~150 MB) and downloads the bge-small-en-v1.5 ONNX model
# (~130 MB) on first use. Gated separately so a fresh checkout
# stays python3.12 + venv + sqlite3. CLI surfaces `arborist embed`
# / `--backend vec` only when `sqlite_vec` imports. Install with:
# pip install 'arborist[vec]'
# (sentence-transformers is the heavier "official" embedder path
# the ticket §5 names; fastembed is the lightweight ONNX one.)
"sqlite-vec>=0.1.9",
"fastembed>=0.4",
]
nli = [
# Sentence-pair NLI for the #000049 Phase-2 *shadow* path
# (arborist/qa/nli/) — measures whether a clause-level contradiction
# veto would demote a weakly-grounded answer; never touches
# audit_mode. transformers + a CPU torch is ~600 MB installed, so it
# is gated hard out of core / dev — a fresh checkout stays
# python3.12 + venv + sqlite3, and the default test suite skips the
# NLI tests via pytest.importorskip when this extra is absent.
# Install with:
# pip install 'arborist[nli]'
# Phase 3 (if it happens) should ONNX-export the pinned checkpoint
# and switch this to onnxruntime-cpu to drop torch (cf. [vec]).
"transformers>=4.40",
"torch>=2.2",
"sentencepiece>=0.2",
"protobuf>=4.0",
]
dev = [
"pytest>=8",
"pytest-asyncio>=0.23",
"pytest-xdist>=3.5",
"arborist[html]",
"arborist[wikitext]",
"arborist[mesh]",
"arborist[crawler]",
"arborist[math]",
"arborist[hessian]",
"arborist[vec]",
]
[project.scripts]
arborist = "arborist.cli:main"
[tool.setuptools.packages.find]
where = ["."]
include = ["arborist*"]