Skip to content
TechTideOhioPublic

About

TideOS Eval Kit (Tool 12): CI deployment regression gate with per-category thresholds, trigger path detection, and PR reporting

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

weir: TideOS Eval Kit (Tool 12)

Gating Deploys in CI: Fail-Closed Per-Category Regression Prevention for AI Agents and Language Model Systems

CI Release License: MIT Rust: 2021 / 1.82+ Zero-FFI

Quickstart | Why weir? | Global Score Mirage Table | Author Reviews | Feature Matrix | How Soft Factory Uses weir | The Complete TideOS Eval Kit | Contributing


Why weir?

In modern autonomous software engineering and generative AI workflows, models, prompts, tools, and retrieval pipelines are iterated daily. A fundamental flaw in existing CI pipelines is Global Score Masking:

"Run the eval suite on every PR that touches prompts, models, tools, or retrieval config. Set per-category thresholds instead of one global score, so a big win in one area cannot hide a regression in another. Fail the build on a regression."

When teams use a single scalar score (e.g. "PR increased benchmark accuracy from 82% to 85%"), they suffer silent production catastrophic failures. A +15% improvement in generic conversational fluency masks a -20% regression in critical Supabase Row-Level Security checks, MCP tool argument parsing, or context attribution.

weir acts as an automated waterflow gate in CI:

  1. PR Trigger Detection: Instantly scans changed files against configured trigger globs (prompts/**, **/models.toml, tools/**, retrieval/**). If no eval-sensitive paths changed, CI finishes in milliseconds.
  2. Zero Global Score Masking: Evaluates categories independently. Every category must satisfy its floor and maximum allowable drop. If ANY single category regresses, the gate fails closed.
  3. Paired Exact Significance: Employs exact McNemar discordance testing on paired evaluation IDs. Distinguishes genuine model regressions from small-sample statistical noise.
  4. Actionable PR Feedback: Automatically generates Markdown step summaries and PR comments for GitHub Actions ($GITHUB_STEP_SUMMARY).
flowchart TD
    PR["Pull Request / Commit"] --> TRIG{"Touch Gated Paths?\n(prompts/**, models.toml, tools/**, retrieval/**)"}
    TRIG -->|No| SKIP["Skip Gate (0ms Exit 0)"]
    TRIG -->|Yes| EVAL["Run Evaluation Suite\n(Outputs JSONL or Envelope)"]
    EVAL --> WEIR["weir gate\n(Exact McNemar + Per-Category Thresholds)"]
    WEIR --> CATS{"Category Audits:\n1. Retrieval (Floor: 90%, Drop <= 1%)\n2. Tool Use (Floor: 85%, Drop <= 2%)\n3. Prompt Fidelity (Floor: 85%, Drop <= 2%)"}
    CATS -->|All Pass| SHIP["[PASS] Deployment Approved\nUpdate Step Summary"]
    CATS -->|Any Regress| FAIL["[BLOCKED] CI Build Failed\nPost Diagnostics & Block Merge"]
Loading

The Global Score Mirage

Consider a real-world candidate PR modifying studio prompt builder templates and model temperatures:

Evaluation Category Baseline Pass Rate Candidate Pass Rate Category Delta Naive Global Eval Weir Gating Decision Production Consequence
Retrieval & RLS 96.0% (24/25) 76.0% (19/25) -20.0% Ignored BLOCKED (Floor Breach & Regression) Catastrophic data leaks in production
Tool Use & MCP 92.0% (23/25) 100.0% (25/25) +8.0% Averaged PASS Valid tool calling improvements
Prompt Fidelity 88.0% (22/25) 100.0% (25/25) +12.0% Averaged PASS Enhanced prompt adherence
GLOBAL COMPOSITE 92.0% (69/75) 92.0% (69/75) 0.0% PASSED (No Change) BUILD FAILED CLOSED Naive CI deploys broken retrieval

Under a naive single score, the PR is merged because the composite score remained unchanged (92.0%). Under weir, the build is failed closed because retrieval breached its 90.0% floor and suffered a statistically significant 20.0% drop.


Architectural Foundations & Author Reviews

weir is designed to satisfy the rigorous standards of three key software and evaluation engineering philosophies:

1. Extreme Craft & Desktop Ergonomics (Peter Steinberger / @steipete Lens)

  • Sub-2 MB Standalone Static Binary: Compiles to a 1.76 MB static binary with opt-level = "z", lto = true, and strip = true.
  • Zero Python/Node Runtime & Sub-5ms Offline Execution: Eliminates massive Python/Node dependency chains in CI runners. Runs as a single native binary with zero Docker overhead.
  • Fail-Fast Trigger Detection: weir changed executes in under 2ms. If a PR touches only documentation or frontend styling, it skips long eval jobs immediately.
  • Developer-First Terminal & CI UX: Renders beautiful, clean ANSI terminal tables locally, and native GitHub Actions Markdown summaries ($GITHUB_STEP_SUMMARY) in CI.

2. Production vs Demo Observability (Harrison Chase / @hwchase17 Lens)

  • W3C OpenTelemetry / OpenInference Export: Generates compliant trace spans (weir.gate_evaluation, weir.category.<name>) capturing pass rates, deltas, and diagnostics for enterprise dashboards.
  • Flywheel Ingestion for Multi-Agent Harnesses: Ingests session evaluations directly from agent-harness/runs and outputs standard HarnessEnvelope<T>.
  • Incident Prevention Economics: Models the tangible economic value of blocking deployment regressions (e.g. preventing a $15,000 production outage) versus the trivial cost of evaluation tokens.

"In production agent applications, a prompt change that improves conversational elegance often breaks structured tool calling or retrieval filters. weir connects directly to CI pull requests, enforcing strict per-category regression barriers so high scores in easy tasks never hide failures in hard ones."

3. Mathematical Rigor & Cryptographic Ledgers (Daniel Orneryd / @orneryd Lens)

  • Zero Hand-Waving Metrology: Replaces naive normal approximations on small discordant samples with exact cumulative Binomial distribution testing under $H_0: p=0.5$.
  • Wilson Score Intervals: Computes continuity-sound 95% Wilson score confidence bounds on every category pass rate, preventing sample size illusions.
  • Closed State Machine Verdicts: Gating uses an exhaustive, non-leaky enum (Pass, Regression, FloorBreach, InsufficientData, MissingCategory, WarningRegression, NewCategory).
  • sha256-framed-v1 Cryptographic Lockfiles: Implements domain-separated, length-prefixed SHA-256 lockfiles (weir lock / weir verify), guaranteeing that evaluation criteria, baselines, and floors cannot be silently relaxed in PRs.

Feature Comparison Matrix

Capability weir (TideOS) Naive Global CI Gates Promptfoo LangSmith / Tracing Custom CI Scripts
Per-Category Regression Gating Yes (Independent) No (Global average) Partial No (Observability only) Fragile bash
Exact Binomial McNemar Test Yes (Exact log-gamma) No No No Rare
Zero Global Score Masking Strictly Enforced No (Vulnerable) No No Rare
PR Trigger Path Detection Yes (weir changed) No No No Manual shell
sha256-framed-v1 Lockfile Yes (Cryptographic) No No No No
GitHub Step Summary Native Yes (Markdown) Partial HTML Web UI Custom curl
W3C OTel / OpenInference Yes (Built-in) No No Proprietary Manual
Single Standalone Static Binary Pure Rust (1.76 MB) CI Shell script Node.js Python / Cloud Python / Node

60-Second Quickstart

1. Installation

Install from source or prebuilt binary:

cargo install --path Tools/weir
# Or run with the PowerShell wrapper:
.\Tools\weir\weir.ps1 --help

2. Initialize Specification

Generate a starter weir.toml:

weir init

3. Check If PR Touches Gated Paths

In your GitHub Actions workflow:

weir changed --base origin/main

4. Gate Candidate Results Against Baseline

weir gate \
  --spec weir.toml \
  --baseline packs/fixtures/baseline.jsonl \
  --candidate candidate_results.jsonl \
  --markdown step_summary.md

5. Ratchet Baseline Upon Verified Ship

When a new model release is approved, update the baseline and sign the cryptographic lockfile:

weir baseline --from candidate_results.jsonl --output packs/fixtures/baseline.jsonl

How Soft Factory Uses weir Internally

Inside Alex Cinovoj's Soft Factory development environment at TechTide AI:

  • An ensemble of specialized coding agents (Muse, Claude Code, Codex, Cursor, OpenCode, and Antigravity) collaborate inside Apps/vertical-series-platform (Throughline Studio).
  • Prompts, tool declarations, and retrieval settings are iterated constantly:
    • apps/studio-api/src/adaptation-studio/prompts.ts
    • apps/studio-worker/licensed/adaptationStudioPromptBuilder.cjs
    • packages/contracts/src/agent-package-evaluation.ts
  • Before weir, agents could inadvertently improve creative dialogue generation while degrading tool schema serialization or retrieval vector relevance.
  • With weir integrated into GitHub Actions and local harness scripts:
    • Every PR touching prompt or model configurations executes narrow vitest/node benchmarks.
    • weir gate ingests the results, runs exact McNemar discordance tests across each category, and renders rich Markdown step summaries.
    • If any category drops beyond its configured tolerance (e.g. 1% for retrieval), the deployment is halted immediately.

Statistical Foundations

1. Exact McNemar Discordance Test

For paired evaluation benchmarks where both candidate and baseline evaluate identical case IDs ($i \in {1 \dots n}$):

  • $a$: Baseline Pass, Candidate Pass (Concordant Pass)
  • $b$: Baseline Pass, Candidate Fail (Candidate Regression)
  • $c$: Baseline Fail, Candidate Pass (Candidate Improvement)
  • $d$: Baseline Fail, Candidate Fail (Concordant Fail)

The total discordant pairs $n_{\text{disc}} = b + c$. Under the null hypothesis $H_0$ that the candidate does not differ from the baseline ($p = 0.5$):

$$P = 2 \times \sum_{i=0}^{\min(b, c)} \binom{b + c}{i} 0.5^{b + c}$$

Continuity-corrected Edwards chi-squared:

$$\chi^2 = \frac{(|b - c| - 1)^2}{b + c}$$

A regression is declared statistically significant only when $b &gt; c$ and $p &lt; \alpha$ (default $\alpha = 0.05$).

2. Wilson Score Confidence Intervals

For category pass rate proportions $\hat{p} = k / n$, weir computes the 95% Wilson score interval:

$$\tilde{p} = \frac{k + z^2/2}{n + z^2}, \quad \text{Margin} = \frac{z}{1 + z^2/n} \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}$$

Ensuring robust estimation even with moderate sample sizes ($n \approx 20$).


The Complete TideOS Eval Kit

weir completes Tool 12 in the complete TideOS evaluation and harness stack:

Tool # Binary / Dir Crate Name Companion Skill Release Binary Core Responsibility
1 reval reval trace-error-analysis 2.07 MB Trace Error Analysis (Open/Axial Coding), Rubric Gates, MCP Server
2 gild gild golden-dataset-contract 2.46 MB Golden Dataset Governance, Schema Validation & Versioning
3 tessel tessel-eval synthetic-eval-dimensions 1.97 MB Combinatorial Synthetic Scenario Generator (Pairwise Covering Arrays)
4 assay assay-eval deterministic-assertions-first 2.09 MB Deterministic Assertions First (Layers 1-5) & In-Memory RLS
5 tide-rill tide-rill offline-retrieval-faithfulness 1.54 MB Offline Retrieval Ranking & Context Faithfulness
6 keel keel-eval trajectory-evals 1.91 MB Agent Trajectory Alignment & Step Efficiency (14 vs 3 calls)
7 temper temper-eval pass-k-reliability 0.89 MB Multi-Trial Reliability (pass@k vs pass^k at Real Temperature)
8 parley parley-eval simulated-user-evals 1.77 MB Simulated Users for Multi-Turn State, Memory & Policy Evals
9 gavel gavel-eval llm-judge-calibration 1.78 MB Classifier-Calibrated LLM Judge, TPR/TNR & Rogan-Gladen Debiasing
10 poise poise-eval pairwise-judge-bias 1.89 MB Pairwise A/B Position Bias Control, Length Capping & LC-WinRate
11 plumb plumb-eval paired-statistical-significance 0.85 MB Paired Statistical Significance, Bootstrap BCa, Exact McNemar & TOST
12 weir weir-eval eval-harness 1.76 MB CI Deployment Regression Gate, Per-Category Thresholds & PR Reporting
13 eddy eddy-eval online-evals-production < 2.0 MB Online Production Evals, Hash Sampling, CUSUM Drift & Shadow Replay

Architecture & Clippy Strictness

  • Zero Unsafe: Entire crate compiled under #![forbid(unsafe_code)].
  • Zero FFI: Pure Rust dependencies only (anyhow, clap, regex, serde, serde_json, sha2, thiserror, toml).
  • Binary Footprint: Stripped release binary budgeted under 2.0 MB (currently 1.76 MB).
  • Universal JSON Envelope: All commands support --json emitting canonical HarnessEnvelope<T>.
  • Zero Em-Dash Rule: Strictly enforces zero em-dashes and zero en-dashes across all code and documentation.

About

weir is developed by Alex Cinovoj and the engineering team at TechTide AI as part of the TideOS Eval Kit.

For enterprise evaluations, custom agent harnesses, and autonomous development infrastructure, visit techtideai.io.


License

MIT License. Copyright (c) 2026 TechTide AI.

About

TideOS Eval Kit (Tool 12): CI deployment regression gate with per-category thresholds, trigger path detection, and PR reporting

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages