xlaya-mcp 2.3.1__tar.gz

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.
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ .env
5
+ .pytest_cache/
6
+ .venv/
7
+ *.egg-info/
8
+ build/
9
+ dist/
10
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ISCV | Isocurve Research Lab (@iscvlab) & Napat Phasundhiae (@napattan)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
xlaya_mcp-2.3.1/NOTICE ADDED
@@ -0,0 +1,12 @@
1
+ XLaya
2
+ Copyright (c) 2026 ISCV | Isocurve Research Lab (@iscvlab) & Napat Phasundhiae (@napattan)
3
+
4
+ Upstream Attribution Notice:
5
+ Stage 1 (non-autoregressive ModernBERT-large & mmBERT decision heads) and
6
+ Stage 2 (conformal vega-U escalation) interoperate with ConvAI Innovations'
7
+ `laya` (https://github.com/NandhaKishorM/laya) and `vegaml` libraries, released
8
+ under the Apache-2.0 / MIT open-source licenses (Copyright (c) ConvAI Innovations).
9
+
10
+ Third-Party Dataset & Template Notices:
11
+ - `benchmarks/data/ple_dev_29_metadata.json` and generated Google ADK export
12
+ templates are released under the Apache License, Version 2.0.
@@ -0,0 +1,479 @@
1
+ Metadata-Version: 2.5
2
+ Name: xlaya-mcp
3
+ Version: 2.3.1
4
+ Summary: Local 5-profile semantic triage, AST code-graph sieve & conformal decision MCP server
5
+ Project-URL: Homepage, https://github.com/iscvlab/xlaya
6
+ Project-URL: Repository, https://github.com/iscvlab/xlaya
7
+ Project-URL: Issues, https://github.com/iscvlab/xlaya/issues
8
+ Author: ISCV | Isocurve Research Lab (@iscvlab), Napat (Tan) Phasundhiae
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Keywords: agent-tools,ast,code-graph,conformal-prediction,local-ai,mcp,model-context-protocol,semantic-triage
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Software Development :: Quality Assurance
24
+ Requires-Python: >=3.9
25
+ Provides-Extra: dev
26
+ Requires-Dist: flake8; extra == 'dev'
27
+ Requires-Dist: pytest; extra == 'dev'
28
+ Provides-Extra: neural
29
+ Requires-Dist: laya>=0.4.31; extra == 'neural'
30
+ Requires-Dist: torch; extra == 'neural'
31
+ Requires-Dist: vegaml>=0.16.1; extra == 'neural'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # XLaya (`/xlaya`) - 5-Profile Hardware-Adaptive System 1 → System 1.5 Semantic Triage, AST Code-Graph Sieve & Conformal Decision Sidecar
35
+
36
+ <!-- mcp-name: io.github.iscvlab/xlaya -->
37
+
38
+ [![Release](https://img.shields.io/badge/Release-v2.3.1-121417?style=flat-square)](https://github.com/iscvlab/xlaya)
39
+ [![License: MIT](https://img.shields.io/badge/License-MIT-059669?style=flat-square)](./LICENSE)
40
+ [![Nano RSS](https://img.shields.io/badge/Nano%20Profile-10.41%20MB%20RSS%20(0%20Torch)-059669?style=flat-square)](#tldr)
41
+ [![Warm MCP](https://img.shields.io/badge/Warm%20MCP-~30%20ms%20(6%20Tools)-D97706?style=flat-square)](#2-empirical-4-axis-benchmarks-rtx-5060-ti-16-gb-vram)
42
+ [![Batch Speed](https://img.shields.io/badge/Batch%20Speed-859%20q%2Fs%20(8.9x)-2563EB?style=flat-square)](#axis-1-cold-vs-resident-warm-mcp--official-predict_batch-throughput)
43
+ [![Engines](https://img.shields.io/badge/Engines-Laya%20v0.4.31%20%2B%20VegaML%20v0.16.1-7C3AED?style=flat-square)](https://github.com/NandhaKishorM/laya)
44
+ [![Watcher Gate](https://img.shields.io/badge/Watcher%20Gate-0.00%25%20False--Confident%20(XERJ%20%231108)-059669?style=flat-square)](#axis-3-conformal-calibration-joint-nli-contradiction-triad--xerj-1108-watcher-gate)
45
+ [![Agents](https://img.shields.io/badge/Agents-Any%20AI%20Agent-8A2BE2?style=flat-square)](#4-universal-installation--repository-layout)
46
+ [![Lab](https://img.shields.io/badge/Lab-ISCV%20%7C%20Isocurve%20Research%20Lab%20(%40iscvlab)-121417?style=flat-square)](https://github.com/iscvlab)
47
+ [![Paper Track](https://img.shields.io/badge/Kaggle%20Gemma%204-Paper%20Track%20Submitted-1E3A8A?style=flat-square)](https://www.kaggle.com/competitions/gemma-4-developer-agent-paper/writeups/new-writeup-1794525023839)
48
+
49
+ <p align="center">
50
+ <img src="./docs/figures/xlaya_v23_cover_1120x560.png" alt="XLaya v2.3 & XBoost v3.5: Regime-Invariant Code-Graph Sieves & Conformal Triage for Gemma 4" width="100%" />
51
+ </p>
52
+
53
+ > **Gemma 4 Developer Agent Paper Track**: [Official Research Writeup on Kaggle](https://www.kaggle.com/competitions/gemma-4-developer-agent-paper/writeups/new-writeup-1794525023839) (`Overall Best Paper` / `Best New Resource` / `Best New Application`) • **Repository**: `iscvlab/xlaya` (`v2.3.1`, core [`MIT License`](./LICENSE) + [`NOTICE`](./NOTICE); `benchmarks/data/ple_dev_29_metadata.json` & generated ADK exports `Apache-2.0`).
54
+
55
+ **XLaya** (`iscvlab/xlaya`, slash command `/xlaya`, legacy alias `/laya`) is a 100% pure-local, non-autoregressive **5-Profile System 1 → System 1.5 Semantic Decision, Regime-Invariant AST Code-Graph Sieve, 2-Stage Tool-Schema Gate, Joint NLI Contradiction Triad, Thorough Scan & Conformal Triage Sidecar** (`v2.3.0`) engineered by **[ISCV | Isocurve Research Lab (`@iscvlab`)](https://github.com/iscvlab)**. Powered by **[`laya 0.4.31+`](https://github.com/NandhaKishorM/laya)** (`ModernBERT-large` `en`, `subfolder="typed-decisions"`, calibrated `0.45*en + 0.55*typed` ensemble & `mmBERT`, `output_tokens: 0`), **`vega-U` (`vegaml 0.16.1+`, `0.8b` / `4b` / `gemma-1b` / `27b`)**, and a **100% repo-disjoint CUDA-evolved 8-feature AST + call-graph + Corpus-IDF simplex sieve (`policies/sieve_genomes.json`, `5,679 B` LF / `6,020 B` CRLF)**, it runs across **`--profile auto|nano|edge|workstation|max`** and **`--agent-tier auto|e4b-sniper|31b-deep`** as a **warm resident JSON-RPC 2.0 `stdio` MCP server (`xlaya_mcp_server.py`, `6` tools, `~30 ms` warm inference)**, a **standalone Python CLI (`laya_triage.py`)**, and a **portable AI Agent Skill (`skills/xlaya/SKILL.md`)** across **any AI coding agent — cloud, IDE, CLI, or local LLM** (`Claude`, `Grok`, `Gemini / Antigravity`, `Cursor`, `Codex`, `Ollama`, `OpenHands`, `Cline`, `Google ADK`, etc.).
56
+
57
+ ---
58
+
59
+ <a id="tldr"></a>
60
+
61
+ ## ⚡ TL;DR - Performance & Accuracy at a Glance (`v2.3.0`)
62
+
63
+ - **New in `v2.3.0` — Regime-Invariant 8D Code-Graph Sieve, Zero-Cheat Disjoint Evolution & 2-Stage Tool Gate (`1.28M` Genomes in `74.87 s`)**:
64
+ - **Zero-Torch / Zero-NumPy `--profile nano` (`ΔRSS = 10.41 MB`, `3.99 ms` warm / `255.33 ms/repo` cold, `"torch" not in sys.modules`)**: Partitioning repositories via a **2-Tier Source-First Lexical Pre-Ranker** (`Tier-1` core package before `Tier-2` `docs_src/` and `tests/`), attaching compact **AST Class/Import Skeleton Headers** (`100%` split-method coverage), and scoring an 8D AST + NetworkX `node_link_data` + All-but-the-Mean Top-4 PC Whitened `.npz` / Corpus-IDF simplex (`policies/sieve_genomes.json`, `5,679 B` LF / `6,020 B` CRLF) with **Smooth Realized Channel Availability (`M_avail`, `gamma_max = 1.45`)**.
65
+ - **100% Zero-Shot Blind SWE & Tool-Gate Verification**: Evolved strictly on `125` repo-disjoint `@base_commit` tasks (`21` repos, `80.00%` `E4B` / `85.71%` `31B` val task hit rate, `Top-1 ECE = 0.0654`), XLaya v2.3 achieves **`65.12%` `E4B Recall@3` and `78.29%` `31B Recall@8` (`94.59%` named/traceback, `71.74%` symptom-only, `80.60%` `fastapi`, `Top-1 ECE = 0.0568`, `|ΔS| = 0.0041` across `R1`/`R2`)** on the official `129`-task Kaggle suite, **`64.89%` `R@3` / `79.79%` `R@8` (`Top-1 ECE = 0.0155`)** on blind `SWE-bench_Verified` (`n = 94`), and **`81.37%` Val / `71.69%` Test MCQ binary conformal accuracy (`Top-1 ECE = 0.0279 / 0.0777`, `1.11 ms/row`)** on `nvidia/When2Call` (`triage_tool_call`).
66
+ - **Fitted `xerj#1108` & `PLE 29` Cross-Domain Verification**: Achieves **`100.0%` blind accuracy (`48/48`) and `0.00%` `Wrong_Confident(p ≥ 0.80)`** on `xerj#1108` (`120` adversarial boundary emails) and **`86.21%` (`25/29`)** zero-shot cross-domain triage on Google's `Physical Engineering's Last Exam (PLE)` dev metadata.
67
+
68
+ - **Zero-Token System 1 → System 1.5 Cascade (`output_tokens: 0`)**: Prunes **`99.35%` (`152.7×`)** of low-signal repository tokens before expensive System 2 LLM reading (`173,666` → `1,137` tokens in `170.3 ms`), cutting cold 32-chunk CLI sweeps by **`7.92×` (`74.51 s` → `9.41 s`)** and reaching **`29.99 ms` single-state / `662.5 ms` 32-chunk (`96`-decision) warm latency** via the resident MCP server.
69
+ - **Batched Cross-Lingual Determinism (`859.1 q/s`, `0 / 432` Flips)**: Length-sorted `predict_batch` accelerates mixed `50% EN / 50% HI` routing by **`8.9×` (`837.9 q/s`)** and `mmBERT` multilingual batches to **`859.1 q/s` (`1.16 ms/question`, `5.9×` at `B = 8`; up to `6.5×` at `B = 16`)** with **`0` discrete label flips** across `432` paired comparisons and **`5 / 5` (`100%`)** routing across `EN`, `DE`, `HI`, `JA`, and `TH`.
70
+ - **Calibrated Contradiction, Ensemble Watcher Gate & Persistent Conformal Policies**: Combines a **3-Question Joint NLI Contradiction Triad** (**`8 / 8 = 100%`** counter-anchor accuracy, **`16.6×`** OOD conflict separation, `0` false positives), a **calibrated `0.45*en + 0.55*typed` Stage 1 ensemble** with **`disagreement ≥ 0.15` gate** (**`0.00%` wrong-and-confident fires** vs `24.49%` baseline FAIL on XERJ `#1108`), **`views=1|2|3` multi-view debiasing**, **`--thorough` 4-facet decomposed rubric scans**, **local multimodal (`image`/`audio`/`video`) evaluation**, and **`xlaya_fit` persistent `TTTHead` + split-conformal policies** (**`90.0%`** held-out `folds=5` accuracy / `85.0%` `folds=4` evolution gate across `routing_labels.csv` after a `7.58 s` 40-row fit).
71
+ - **Which `/xlaya` Execution Tier Should You Choose?**
72
+ - **Stage 0 — Pure-Python Structural & Lexical Sieve (`0.15 ms/chunk`, `6,841 chunks/s`)**: Best for **zero-dependency CI environments**, `--lexical-prefilter` candidate pruning across `1,000+` chunks, and exact 4-backtick fence-safe `#L<start>-L<end>` breadcrumb chunking across `.md`, `.html`, `.txt`, `.json`, `.jsonl`, and `.csv`.
73
+ - **Stage 1 — Resident MCP `Laya` (`en`, `typed`, `ensemble`, `multi`, `~30 ms` warm / `859 q/s`)**: **Default daily driver** for `shortlist`, `contradiction` (Joint NLI Triad), `rubric` (`0..4` or `--thorough` 4-facet `specificity`/`completeness`/`consistency`/`actionability` + `file_summaries`), `classify` (including `predict_tournament` on `>20` labels), and bilingual Thai/CJK/multilingual triage.
74
+ - **Stage 2 — `vega-U` (`auto` / `0.8B` / `4B` / `gemma-1b` / `27B`) Conformal Verifier & Multimodal Engine (up to `73,728` tokens & `90.0%` `5-fold` / `85.0%` `4-fold` fitted accuracy)**: Opt-in `--vega` / `vega: true` escalation with **`views=1|2|3` multi-view debiasing**, **persistent `policy_path` (`TTTHead` + split-conformal + OOD `outbound` guard)**, **whole-file long-document audits (`--whole-file`)**, and **local `image`/`audio`/`video` decisions**.
75
+
76
+ > **One-Prompt Universal Agent Install** — Copy and paste into **any AI coding agent — cloud, IDE, CLI, or local LLM** (`Claude`, `Grok`, `Gemini`, `Cursor`, `Codex`, `Ollama`, `OpenHands`, `Cline`, etc.):
77
+ > ```text
78
+ > Clone https://github.com/iscvlab/xlaya and install skills/xlaya into my active agent skills directory (Windows: ./scripts/install.ps1 -All; macOS/Linux: ./scripts/install.sh --all; or copy skills/xlaya into ~/.gemini/config/skills/xlaya, ~/.claude/skills/xlaya, ~/.codex/skills/xlaya, or ~/.agents/skills/xlaya), then run python benchmarks/run_xlaya_benchmark.py --mode quick to verify /xlaya is ready.
79
+ > ```
80
+
81
+ ### Horizontal Bar Comparison (`RTX 5060 Ti 16 GB VRAM` • `Laya v0.4.31 × VegaML v0.16.1`)
82
+
83
+ | Evaluation Dimension | Configuration / Engine | Visual Comparison Bar | Measured Result & Delta vs. Baseline |
84
+ | :--- | :--- | :--- | :--- |
85
+ | **1. Cold CLI Boot Speed ↑**<br>*(32-Chunk Contradiction Sweep)* | **`xlaya v2.3.0` (`predict_batch` + Local Snap)**<br>`xlaya v1.0` Sequential CLI Baseline | `████████████████████` **`7.92× Faster`**<br>`███░░░░░░░░░░░░░░░░░` `1.0× Baseline` | **`9.41 s` (`8,459.7 ms` engine)** ✨<br>`74.51 s` (`-87.4%` cold wall time) |
86
+ | **2. Mixed-Language Batch Speed ↑**<br>*(50% EN / 50% HI, `32` States × `3` Qs)* | **`Router.predict_batch` (`sort_by_length`)**<br>Sequential `predict()` Loop | `████████████████████` **`8.9× Faster`**<br>`██░░░░░░░░░░░░░░░░░░` `1.0× Loop` | **`114.6 ms` (`837.9 q/s`, `0` flips)** ✨<br>`1,016.2 ms` (`279.3 states/s` batched) |
87
+ | **3. Peak Encoder Throughput ↑**<br>*(`8` States × `4` Questions/State)* | **`mmBERT` Multilingual Batched**<br>`ModernBERT-large` English Batched<br>Sequential `mmBERT` Loop | `████████████████████` **`859.1 q/s (5.9×)`**<br>`████████░░░░░░░░░░░░` `329.8 q/s (2.7×)`<br>`███░░░░░░░░░░░░░░░░░` `146.5 q/s (1.0×)` | **`1.16 ms/q` (`37.2 ms` vs `218.5 ms`)** ✨<br>`3.03 ms/q` (`97.0 ms` vs `263.8 ms`)<br>Unbatched (`6.5×` speedup at `B = 16`) |
88
+ | **4. Few-Shot Conformal Accuracy ↑**<br>*(`routing_labels.csv` Held-Out `N=20`)* | **`vega-U 0.8B` Fitted (`40` rows, `7.58 s`)**<br>`laya` English Zero-Shot<br>`laya-typed-decisions` Zero-Shot<br>Cold `vega-U 0.8B` Zero-Shot | `██████████████████░░` **`90.0% (18/20)`**<br>`████████████████░░░░` `80.0% (16/20)`<br>`███████████████░░░░░` `75.0% (15/20)`<br>`████████████░░░░░░░░` `60.0% (12/20)` | **`+30.0 pts` over cold (`ECE 0.214`)** ✨<br>`31.73 ms` median zero-shot<br>`25.75 ms` median (`ECE 0.188`)<br>`64.36 ms` (`auto: 8`, `review: 12`) |
89
+ | **5. Contradiction & Watcher Gate ↑**<br>*(NLI Triad + `xerj-org/xerj#1108`)* | **`/xlaya` 3-Question NLI Triad**<br>**XERJ `#1108` Gate (`100% - FalseConf`)**<br>XERJ `#1108` Baseline (`24/98` FAIL) | `████████████████████` **`100.0% (8/8)`**<br>`████████████████████` **`100.0% (0/30 False)`**<br>`███████████████░░░░░` `75.51% (24.49% FAIL)` | **`16.6×` OOD separation (`0` FP)** ✨<br>**`0.00%` False-Confident (`80%` ens.)** ✨<br>`24 / 98` (`24.49%`) wrong at `p ≥ 0.80` |
90
+ | **6. Pass-B Token Compression ↑**<br>*(`27` Specs / `1,165` Chunks)* | **`/xlaya` Top-5 Section Shortlist**<br>Full-Corpus Unfiltered Read | `████████████████████` **`99.35% Saved (152.7×)`**<br>`░░░░░░░░░░░░░░░░░░░░` `0.0% Saved (1.0×)` | **`1,137` tok in `170.3 ms` (`6.8k/s`)** ✨<br>`173,666` tok across `27` specifications |
91
+
92
+ ---
93
+
94
+ ## 1. Architecture & 5-Profile System 1 → System 1.5 Ecosystem (`v2.3.0`)
95
+
96
+ ### A. 3-Stage Cascade (`Stage 0 Sieve → Stage 1 Laya Ensemble → Stage 2 Vega-U Conformal Verifier`)
97
+
98
+ ```mermaid
99
+ %%{init: {'theme': 'neutral'}}%%
100
+ flowchart LR
101
+ subgraph Canvas [" "]
102
+ In["Input Corpus or Media (.md .html .txt .json .jsonl .csv .png .wav .mp4)"] --> S0["Stage 0: Fence-Safe Sieve + BM25 and Thai 3-Gram"]
103
+
104
+ subgraph Stage1 ["Stage 1: Laya v0.4.31 System 1 (output_tokens: 0)"]
105
+ Guard{"Head-Language Guard"}
106
+ EN["ModernBERT-large (en / typed / ensemble, 512 tok)"]
107
+ ML["mmBERT Multilingual (up to 8192 tok)"]
108
+ Triad["Joint NLI Triad + 4-Facet Rubric + Disagreement Gate (>= 0.15)"]
109
+ end
110
+
111
+ S0 --> Guard
112
+ Guard -->|"EN State and EN Head"| EN
113
+ Guard -->|"Non-EN State or Head"| ML
114
+ EN --> Triad
115
+ ML --> Triad
116
+
117
+ Triad -->|"Borderline, Disagreement >= 0.15, or Thorough"| S2["Stage 2: vega-U (auto / 0.8b / 4b / 27b) + Views 1..3 + Policy TTTHead"]
118
+ Triad -->|"Calibrated Spans + file_summaries"| Out["Exact file#Lstart-Lend + Conformal Route"]
119
+ S2 -->|"prediction_set + abstain + outbound + route"| Out
120
+ end
121
+ classDef default fill:#ffffff,stroke:#475569,color:#0f172a,stroke-width:1px
122
+ style Canvas fill:#ffffff,stroke:#cbd5e1,stroke-width:1.5px,color:#0f172a
123
+ style Stage1 fill:#f8fafc,stroke:#94a3b8,color:#0f172a
124
+ ```
125
+
126
+ ### B. Dual Execution Path (`Resident MCP Server` vs. `Standalone CLI` + Persistent `xlaya_fit` Policy)
127
+
128
+ ```mermaid
129
+ %%{init: {'theme': 'neutral'}}%%
130
+ flowchart LR
131
+ subgraph Canvas [" "]
132
+ subgraph Hosts ["1. Entry Points and Chained /x* Skills"]
133
+ Chain["Chained Skills (/xsync /xbrief /xdeep-research /xpublish)"]
134
+ Direct["Standalone Agent (/xlaya) or CI Pipeline"]
135
+ end
136
+
137
+ subgraph Paths ["2. Dual Execution Engine + Policy Fit"]
138
+ MCP["Tier 1: xlaya_mcp_server.py (6 Tools, ~30 ms Warm + Idle Unload)"]
139
+ CLI["Tier 2: laya_triage.py (7.92x Faster Batch CLI + --thorough)"]
140
+ Fit["Tier 3: xlaya_fit / --fit-rows Persistent TTTHead + Conformal Policy"]
141
+ end
142
+
143
+ subgraph Actions ["3. System 2 Surgical Action"]
144
+ Skip["Skip Clean Chunks (Zero Token Bloat)"]
145
+ Edit["Surgical read_file and edit_file on Flagged Spans"]
146
+ end
147
+
148
+ Chain --> MCP
149
+ Direct --> MCP
150
+ Direct --> CLI
151
+ Direct --> Fit
152
+ Fit --> MCP
153
+ Fit --> CLI
154
+ MCP --> Skip
155
+ MCP --> Edit
156
+ CLI --> Edit
157
+ end
158
+ classDef default fill:#ffffff,stroke:#475569,color:#0f172a,stroke-width:1px
159
+ style Canvas fill:#ffffff,stroke:#cbd5e1,stroke-width:1.5px,color:#0f172a
160
+ style Hosts fill:#f8fafc,stroke:#94a3b8,color:#0f172a
161
+ style Paths fill:#f8fafc,stroke:#94a3b8,color:#0f172a
162
+ style Actions fill:#f8fafc,stroke:#94a3b8,color:#0f172a
163
+ ```
164
+
165
+ ### C. Regime-Invariant Code-Graph Sieve (`R1` ↔ `R2`) & Zero-Cheat Evolution Workflows
166
+
167
+ <p align="center">
168
+ <img src="./docs/figures/fig1_system_architecture_flowchart.png" alt="Figure 1: XLaya v2.3 x XBoost v3.5 Dual-Channel Regime-Invariant Architecture Flowchart" width="100%" />
169
+ </p>
170
+ <p align="center">
171
+ <em><b>Figure 1:</b> Dual-Channel Regime-Invariant Architecture separating Host sidecar enrichment (<code>R1</code>) and Container-A pure-stdlib execution (<code>R2</code>) with bounded cross-regime drift (<code>|ΔS| = 0.0041</code>).</em>
172
+ </p>
173
+
174
+ <p align="center">
175
+ <img src="./docs/figures/fig2_zero_cheat_evolution_workflow.png" alt="Figure 2: Zero-Cheat Repo-Disjoint Evolution & Split-Conformal Calibration Workflow" width="100%" />
176
+ </p>
177
+ <p align="center">
178
+ <em><b>Figure 2:</b> Strict zero-overlap evolution workflow across 125 disjoint training/validation tasks (<code>15</code> unique blind repos blocked by startup <code>AssertionError</code>) and blind evaluation suites.</em>
179
+ </p>
180
+
181
+ ### Core Engineering Innovations in `v2.3.0`
182
+
183
+ 0. **Adaptive 5-Profile Hardware Cascade (`--profile nano|edge|workstation|max|auto`) & Regime-Invariant 8D Code-Graph Simplex (`sieve_genomes.json`, `5,679 B` LF / `6,020 B` CRLF)**:
184
+ - In `--profile nano`, runs **zero PyTorch and zero NumPy imports** (`10.414 MB` ΔRSS, `3.99 ms` warm / `255.33 ms/repo` cold), partitioning `.py` repositories via a 2-Tier Source-First Pre-Ranker, attaching compact AST `skeleton_header`s on split methods, and scoring an 8-feature AST + call-graph + Corpus-IDF / whitened `.npz` simplex with Smooth Channel Availability (`M_avail`, `gamma_max = 1.45`) across dual SWE tiers (`e4b-sniper` `K=3` / `≤ 800` tok and `31b-deep` `3` Anchor + `5` Conditional Residual slots / `≤ 4,096` tok), achieving **`65.12%` `E4B Recall@3` and `78.29%` `31B Recall@8` (`Top-1 ECE = 0.0568`)** on blind `Kaggle 129`, **`79.79%` `Recall@8` (`Top-1 ECE = 0.0155`)** on blind `SWE-bench_Verified`, and **`81.37%` Val / `71.69%` MCQ binary conformal accuracy** on `nvidia/When2Call` (`triage_tool_call`).
185
+
186
+ 1. **Stage 1 `typed` (`subfolder="typed-decisions"`) & Calibrated `ensemble` + Inter-Model Disagreement Gate**:
187
+ - Exposes `lang="typed"` (`ECE = 0.188`) and `lang="ensemble"` (`0.45 × P_en + 0.55 × P_typed`), achieving **`0.00%` false-confident fires** (`80.0%` accuracy) on the XERJ `#1108` Watcher Gate while computing inter-model `disagreement = max_k |P_en(k) − P_typed(k)|` and automatically flagging uncertain chunks (`disagreement ≥ 0.15`) for Stage 2 escalation.
188
+ 2. **Stage 2 Hardware-Aware `vega_model` Auto-Tiering (`auto` / `0.8b` / `4b` / `gemma-1b` / `27b`) + `views=1|2|3` Multi-View Debiasing**:
189
+ - `vega_model="auto"` selects the largest local `vega-U` checkpoint that fits comfortably in free GPU VRAM (`4b` on `≥ 10 GB` free VRAM, `0.8b` otherwise, up to `27b` for high-VRAM hosts and `73,728` tokens). Multi-view debiasing (`views=2` option-order reversal; `views=3` reversal + prose template paraphrase) cancels positional and phrasing bias, returning `view_agreement` and forcing `route = "review"` on view disagreement.
190
+ 3. **`--thorough` Full-Document Scan & 4-Facet Decomposed Rubric Scoring (`file_summaries`)**:
191
+ - Evaluates chunks across 4 orthogonal rubric facets (`specificity`, `completeness`, `consistency`, `actionability`) with domain presets (`--rubric-preset default|architecture|code_audit|doc_sync|research`), emits file-level sliding-window `file_summaries` (`mean_score`, `min_score`, `weakest_section`, `contradiction_hotspots`, `facet_breakdown`), runs Stage 1 `ensemble` + `disagreement ≥ 0.15` gating, and auto-escalates top/uncertain candidates to Stage 2 (`views=3`).
192
+ 4. **`xlaya_fit` / `--fit-rows` Persistent `TTTHead` + Split-Conformal Policy Calibration (`policy_path` & `outbound` OOD Guard)**:
193
+ - Fits ridge-regression `TTTHead` weights (`heads.npz`), out-of-fold split-conformal thresholds (`calibration.json`), OOD feature centroids (`outbound` guard), and question schemas (`questions.json`) in `< 8 s` (`60.0%` → `90.0%` held-out accuracy on `routing_labels.csv`), reloadable across CLI and MCP invocations via `policy_path`.
194
+ 5. **Local Multimodal Decision Support (`image`, `audio`, `video`) in `xlaya_predict`**:
195
+ - Evaluates local images via `VegaVision`, audio via local ASR + decision heads, and video via speech/contact-sheet inspection without requiring text `state`/`states`.
196
+ 6. **4-Backtick Fence-Safe Chunker, Head-Language Guard, 3-Question Joint NLI Triad (`P_eff`) & Tournament Elimination (`>20` Labels)**:
197
+ - Preserves 6-level CommonMark breadcrumbs across `.md`, `.html`, `.txt`, `.json`, `.jsonl`, and `.csv`; enforces the **Head-Language Guard** so non-English queries/heads route `100%` to `mmBERT`; evaluates `P_eff = P(is_relevant) × P(contradicts_ssot) × (1 − P(is_consistent))` (`8 / 8 = 100%` counter-anchor accuracy); and auto-runs `laya.predict_tournament(..., group_size=16)` on `>20` choice labels.
198
+
199
+ ---
200
+
201
+ ## 2. Empirical 4-Axis Benchmarks (`RTX 5060 Ti 16 GB VRAM`)
202
+
203
+ Full methodology and extended telemetry are documented in [`benchmarks/XLAYA_V2_BENCHMARK_REPORT.md`](./benchmarks/XLAYA_V2_BENCHMARK_REPORT.md) and [`benchmarks/xlaya_v2_benchmark_results.json`](./benchmarks/xlaya_v2_benchmark_results.json) (reproducible via [`benchmarks/run_xlaya_benchmark.py`](./benchmarks/run_xlaya_benchmark.py)).
204
+
205
+ ### Axis 1: Cold vs. Resident Warm MCP & Official `predict_batch` Throughput
206
+
207
+ | Execution Path / Model (`RTX 5060 Ti 16 GB`) | Batch / Workload | Batched / v2 Latency ↓ | Baseline / Loop ↓ | Speedup ↑ | Throughput ↑ |
208
+ | :--- | :--- | :---: | :---: | :---: | :---: |
209
+ | **Cold CLI Sweep (`laya_triage.py`)** | `32` chunks (`batch_size=32`) | **`9.41 s`** (`8,459.7 ms` engine) | `74.51 s` (`v1.0` CLI) | **`7.92×`** ✨ | `3.40 chunks/s` |
210
+ | **Resident Warm MCP (`xlaya_mcp_server.py`)** | `1` state / `32`-chunk Triad (`96` Qs) | **`29.99 ms` / `662.49 ms`** | `74,510 ms` (`v1.0` cold) | **`112.5×`** ✨ | `144.9 q/s` (`6.90 ms/q`) |
211
+ | **Stage 0 Pure-Python Sieve** | `27` specs / `1,165` chunks | **`170.29 ms`** (`0.15 ms/chunk`) | `173,666` full tokens | **`152.7×` tokens** | **`6,841.3 chunks/s`** |
212
+ | **`english` (`ModernBERT-large`, `4` Q/state)** | `1` / `8` / `64` states | **`26.4` / `97.0` / `853.8 ms`** | `39.5` (T4) / `263.8` / `2,119.4 ms` | **`2.7×–2.8×`** | **`329.8 q/s`** (`3.03 ms/q`) |
213
+ | **`multilingual` (`mmBERT-base`, `4` Q/state)** | `1` / `8` / `16` states | **`20.7` / `37.2` / `80.1 ms`** | `32.8` (T4) / `218.5` / `522.4 ms` | **`5.9×–6.5×`** ✨ | **`859.1 q/s`** (`1.16 ms/q`) ✨ |
214
+ | **`Router.predict_batch` (`50% EN / 50% HI`, `3` Q/s)** | `32` / `64` states | **`114.6 ms` / `236.4 ms`** | `1,016.2 ms` / `1,950.6 ms` | **`8.9×` / `8.3×`** ✨ | **`837.9 q/s`** (`279.3 states/s`) |
215
+
216
+ <details>
217
+ <summary><b>LaTeX (booktabs) Source for Academic Citations — Axis 1 Latency & Batch Throughput</b></summary>
218
+
219
+ ```latex
220
+ \begin{table}[t]
221
+ \centering
222
+ \caption{Empirical latency and batched throughput of \textsc{XLaya v2.1.0} (\texttt{laya 0.4.31}, \texttt{vegaml 0.16.1}) on an NVIDIA GeForce RTX 5060 Ti (16\,GB VRAM, \texttt{PyTorch 2.13.0+cu130}). All forward passes emit zero autoregressive tokens (\texttt{output\_tokens = 0}).}
223
+ \label{tab:xlaya_axis1_throughput}
224
+ \begin{tabular}{llrrrr}
225
+ \toprule
226
+ \textbf{Engine / Backbone} & \textbf{Workload} & \textbf{Batched (ms)} $\downarrow$ & \textbf{Baseline / Loop (ms)} $\downarrow$ & \textbf{Speedup} $\uparrow$ & \textbf{Throughput} $\uparrow$ \\
227
+ \midrule
228
+ Cold CLI (\texttt{laya\_triage.py}) & 32 chunks & \textbf{9,410.0} & 74,510.0 (\texttt{v1.0}) & \textbf{7.92$\times$} & 3.4 chunks/s \\
229
+ Warm Resident MCP (\texttt{xlaya\_predict}) & 1 state / 32-chunk Triad & \textbf{29.99 / 662.49} & 74,510.0 (\texttt{v1.0}) & \textbf{112.5$\times$} & 144.9 q/s \\
230
+ Stage 0 Pure-Python Sieve & 27 specs (1,165 chunks) & \textbf{170.29} & --- & 152.7$\times$ tok & \textbf{6,841.3 chunks/s} \\
231
+ \texttt{ModernBERT-large} (\texttt{english}) & $B=8 \times 4$ questions & \textbf{97.0} & 263.8 (loop) & 2.7$\times$ & 329.8 q/s \\
232
+ \texttt{mmBERT-base} (\texttt{multilingual}) & $B=8 \times 4$ questions & \textbf{37.2} & 218.5 (loop) & 5.9$\times$ (6.5$\times$ at $B=16$) & \textbf{859.1 q/s} \\
233
+ \texttt{Router.predict\_batch} (50\% EN / 50\% HI) & $B=32 \times 3$ questions & \textbf{114.6} & 1,016.2 (loop) & \textbf{8.9$\times$} & \textbf{837.9 q/s} \\
234
+ \bottomrule
235
+ \end{tabular}
236
+ \end{table}
237
+ ```
238
+
239
+ </details>
240
+
241
+ ---
242
+
243
+ ### Axis 2: Batch-vs-Single Numerical Determinism (`0 / 432` Flips), Cross-Lingual Router & Presets
244
+
245
+ - **Zero Discrete Label Flips (`0 / 432`)**: Across `144` `english` (`max_abs_dp = 0.00580`), `144` `multilingual` (`max_abs_dp = 0.00260`), and `144` `Router.predict_batch` (`max_abs_dp = 0.00650`) paired evaluations, dynamic length-sorted batching produced **`0` label or routing flips**.
246
+ - **`5 / 5 (100%)` Cross-Lingual Routing & 5 Built-In Presets**: Verified `100%` language routing accuracy across `EN`, `DE`, `HI`, `JA`, and `TH`, plus sub-50 ms multi-question preset execution:
247
+
248
+ | Preset / Check | Latency ↓ | Questions / Scope | Verified Telemetry Receipt |
249
+ | :--- | :---: | :---: | :--- |
250
+ | **Cross-Lingual Router (`EN/DE/HI/JA/TH`)** | `20.7–26.4 ms` | `5` languages | **`5 / 5 (100%)`** route accuracy + Head-Language Guard protection ✓ |
251
+ | **`moderation` / `email` Presets** | **`27.10 ms` / `32.71 ms`** | `5` questions each | `toxic=0.0` (clean) • `is_phishing=0.984`, `is_spam=0.993` ✓ |
252
+ | **`guard` / `router` / `triage` Presets** | `40.74` / `49.56` / `49.80 ms` | `4–5` questions each | `prompt_injection=1.000` • `domain="math_or_logic"` • `intent="cancellation"` ✓ |
253
+
254
+ ---
255
+
256
+ ### Axis 3: Conformal Calibration, Joint NLI Contradiction Triad & XERJ `#1108` Watcher Gate
257
+
258
+ | Benchmark Suite & Evaluation Target | Baseline / Cold Reference | `/xlaya v2.3.0` Calibrated Result | Empirical Gain & Safety Receipt |
259
+ | :--- | :--- | :--- | :--- |
260
+ | **1. `routing_labels.csv` (`40` Fit / `20` Test)**<br>*(Conformal Few-Shot Calibration)* | Cold `vega-U 0.8B`: `60.0%` acc (`auto: 8, review: 12`)<br>`laya-typed-decisions`: `75.0%` (`25.75 ms`, `ECE 0.188`)<br>`laya` `english`: `80.0%` (`31.73 ms`, `ECE 0.283`) | **`vega-U 0.8B` Fitted (`40` rows in `7.58 s`, `folds=5`)**:<br>**`90.0%` (`18/20`) team acc**, `ECE = 0.214`, `urgency_mae = 0.650` (`103.36 ms`) *(evol. regression gate `folds=4`: `85.0%`)* | **`+30.0 pts` over cold `vega-U`** & **`+10.0 pts` over zero-shot `laya`** in `< 8 s` fit time ✨ |
261
+ | **2. 3-Question Joint NLI Triad (`P_eff`)**<br>*(Counter-Anchor Contradiction Suite)* | 1-question `noul` suffers off-topic & verbatim-agreement false positives | **`8 / 8 (100.0%)` accuracy**, **`0` false positives**<br>`direct=0.6735`, `numeric=0.6806`, `ood_pgbouncer=0.7553` vs `0.0456` consistent, `73k_vega=0.6569` vs `0.0412` | **`16.6×` OOD conflict-vs-consistent separation** + `73,728`-token whole-file support ✨ |
262
+ | **3. `xerj-org/xerj#1108` Watcher Gate**<br>*(`120` Emails, Wrong-and-Confident `p ≥ 0.80`)* | Uncalibrated Baseline: **`24 / 98` (`24.49%` FAIL)** wrong-and-confident fires | Standalone Gate: **`0 / 30 (0.00% PASS)`**<br>Agreement Gate: `2 / 57` (`3.51% PASS`)<br>Ensemble: **`0 / 36 (0.00% PASS, 96/120 = 80.0% acc)`** | **`-100%` elimination of wrong-and-confident fires** (`24.49%` → `0.00%`) ✨ |
263
+
264
+ <details>
265
+ <summary><b>LaTeX (booktabs) Source for Academic Citations — Axis 3 Conformal Calibration & Contradiction Gates</b></summary>
266
+
267
+ ```latex
268
+ \begin{table}[t]
269
+ \centering
270
+ \caption{Conformal calibration on \texttt{routing\_labels.csv} ($N_{\text{fit}}=40$, $N_{\text{test}}=20$) and boundary-gate verification on \texttt{xerj-org/xerj\#1108} ($N=120$ emails, confident threshold $p \ge 0.80$).}
271
+ \label{tab:xlaya_axis3_calibration}
272
+ \begin{tabular}{llrrrr}
273
+ \toprule
274
+ \textbf{Suite} & \textbf{Configuration} & \textbf{Accuracy} $\uparrow$ & \textbf{ECE / Rate} $\downarrow$ & \textbf{Urg.\ MAE} $\downarrow$ & \textbf{Median (ms)} $\downarrow$ \\
275
+ \midrule
276
+ \texttt{routing\_labels} & \texttt{laya-typed-decisions} (0-shot) & 75.0\% (15/20) & \textbf{0.188} & 0.671 & \textbf{25.75} \\
277
+ \texttt{routing\_labels} & \texttt{laya} \texttt{english} (0-shot) & 80.0\% (16/20) & 0.283 & 0.780 & 31.73 \\
278
+ \texttt{routing\_labels} & \texttt{vega-U 0.8B} (Cold 0-shot) & 60.0\% (12/20) & 0.222 & \textbf{0.650} & 64.36 \\
279
+ \texttt{routing\_labels} & \textbf{\texttt{vega-U 0.8B} (Fitted 40 rows, 7.58\,s)} & \textbf{90.0\% (18/20)} & 0.214 & \textbf{0.650} & 103.36 \\
280
+ \midrule
281
+ XERJ \texttt{\#1108} & Uncalibrated Baseline (FAIL) & --- & 24.49\% (24/98) & --- & --- \\
282
+ XERJ \texttt{\#1108} & \textbf{\textsc{XLaya} Standalone / Ensemble (PASS)} & \textbf{80.0\% (96/120)} & \textbf{0.00\% (0/30, 0/36)} & --- & \textbf{29.99} \\
283
+ \bottomrule
284
+ \end{tabular}
285
+ \end{table}
286
+ ```
287
+
288
+ </details>
289
+
290
+ ---
291
+
292
+ ### Axis 4: Zero-Shot Blind SWE (`Kaggle 129`, `SWE-bench_Verified`), `nvidia/When2Call`, `PLE 29` & Container-A ADK
293
+
294
+ <p align="center">
295
+ <img src="./docs/figures/fig3_blind_evaluation_scorecard.png" alt="Figure 3: 100% Zero-Shot Blind Localization, Cross-Regime Invariance & Conformal Calibration" width="100%" />
296
+ </p>
297
+ <p align="center">
298
+ <em><b>Figure 3:</b> 100% zero-shot blind evaluation across official <code>Kaggle 129</code> (<code>R1</code> vs. <code>R2</code>), <code>SWE-bench_Verified</code> (<code>n = 94</code>), and <code>nvidia/When2Call</code> (<code>n = 3,952</code>).</em>
299
+ </p>
300
+
301
+ <p align="center">
302
+ <img src="./docs/figures/fig4_pareto_and_codegraph_topology.png" alt="Figure 4: Context-Budget Pareto Frontier & 2-Hop Code-Graph Seed Propagation Topology" width="100%" />
303
+ </p>
304
+ <p align="center">
305
+ <em><b>Figure 4:</b> Stage-A token budget Pareto frontier (left: <code>699.9</code> E4B tokens vs. <code>46,231.4</code> Top-3 full <code>.py</code> files vs. <code>32,768</code> vLLM wall) and 2-hop code-graph + 4-PC <code>.npz</code> whitening topology (right).</em>
306
+ </p>
307
+
308
+ 1. **Zero-Cheat Disjoint Evolution (`125` Tasks / `21` Repos)**: Startup `AssertionError` (`FORBIDDEN_BLIND_EVAL_REPOS`) blocks all `15` unique blind evaluation repos (`4` Kaggle + `12` `SWE-bench_Verified`, `psf/requests` shared). Running `5,000` gens × `256` pop (`1.28M` evaluations in `74.87 s` on RTX 5060 Ti) lifts `7`-repo unseen validation task hit rate from `45.71%` (BM25 K=3) to **`80.00%`** (`e4b_sniper_distilled`, file `R@3 = 75.95%`, `MRR = 0.6476`) and **`85.71%`** (`31b_deep`, file `R@8 = 83.10%`, `MRR = 0.6512`, `Top-1 ECE = 0.0654`).
309
+ 2. **Official Blind `Kaggle 129` (`R1` Sidecars vs. `R2` Pure Stdlib)**:
310
+
311
+ | Benchmark / Regime (`Kaggle 129` Blind) | E4B R@3 ↑ | 31B R@8 ↑ | Pos MRR (E4B / 31B) ↑ | Test-Echo (E4B / 31B) ↓ | Top-1 ECE ↓ |
312
+ | :--- | :---: | :---: | :---: | :---: | :---: |
313
+ | **`BM25-Only Baseline`** *(w/ Pre-Ranker)* | `37.21%` | `51.16%` | `— / 0.2381` *(MRR@8)* | `10.34% / —` *(Echo@3)* | — |
314
+ | `XLaya v2.2.0` *(Pre-Remediation)* | `31.01%` | `35.66%` | `0.2868 / 0.2941` | `1.81% / 1.07%` | `0.0705` *(82.2% abstain)* |
315
+ | **`XLaya v2.3.0 Regime R2` *(Pure Stdlib)*** | **`62.79%`** | **`78.29%`** | **`0.4871` / `0.4954`** | **`1.81%` / `2.23%`** | **`0.0641`** |
316
+ | **`XLaya v2.3.0 Regime R1` *(JSON + .npz)*** | **`65.12%`** | **`78.29%`** | **`0.4987` / `0.4999`** | **`1.55%` / `1.36%`** | **`0.0568`** |
317
+
318
+ - **Strata, Latency & Invariance (`R1`)**: `Named/Symbol/Traceback` (`n = 37`) reaches **`89.19%` E4B `R@3` / `94.59%` 31B `R@8`**; `Symptom-Only` (`n = 92`) reaches **`55.43%` E4B `R@3` / `71.74%` 31B `R@8`** (`vs 29.35% / 43.48% BM25`); per-repo: `fastapi/fastapi` (`n = 67`) `61.19% / 80.60%`, `Textualize/rich` (`n = 48`) `62.50% / 70.83%`, `psf/requests` (`n = 13`) `92.31% / 92.31%`, `encode/httpx` (`n = 1`) `100.0%`. Mean Stage-A E4B payload is **`699.9` tokens (`max = 800`, `-98.49%` / `66.1×` vs Top-3 `.py` `46,231.4` tok)**; uncontended cold sieve latency is **`255.33 ms/repo`** (`0/129` core gold files truncated); `4-PC` `.npz` whitening shifts `127/127` archives from median cos `0.8518` to **`-0.0158` (`[-0.1136, +0.0959]`)** with cross-regime drift **`|ΔS| = 0.0041`** (`|ΔECE| = 0.0073`); OOD negative SWE probes (`n = 25`) abstain at `80.0%` (`0.0%` wrong-confident at `p ≥ 0.80`).
319
+
320
+ 3. **External Blind `SWE-bench_Verified`, `nvidia/When2Call`, `PLE 29` & Container-A ADK**:
321
+
322
+ | Suite / Artifact Target | Split / Metric | Baseline / v2.2.0 | **XLaya v2.3.0 Verified** | Safety, ECE & Container Proof |
323
+ | :--- | :--- | :---: | :---: | :--- |
324
+ | **`SWE-bench_Verified` (`n = 94`)** | `E4B R@3` / `31B R@8` | `48.94%` / `64.89%` *(BM25 w/ Pre-Ranker)* | **`64.89%` / `79.79%`** | **`Top-1 ECE = 0.0155`** *(vs `0.2910` `v2.2.0`)* • `sympy` (`n=74`): `79.73%` (`365.4 ms`) |
325
+ | **`SWE-bench_Verified` Strata** | `Symptom (41)` / `Named (53)` `R@8` | `14.63%` / `35.85%` *(v2.2.0)* | **`73.17%` / `84.91%`** | `SpanIoU > 0.30 = 40.43%` (`31B`) • `2,031` mean tok |
326
+ | **`nvidia/When2Call` Val (`n = 1,616`)** | `BinAcc` (`ToolRec` / `Abstain`) | `62.75%` (`0%` / `100%`) | **`81.37%` (`81.40%` / `81.36%`)** | **`Top-1 ECE = 0.0279`** • Zero PyTorch / NumPy |
327
+ | **`When2Call` Blind MCQ (`n = 3,652`)** | `BinAcc` (`ToolRec` / `Abstain`) | `64.54%` (`0%` / `100%`, `ECE 0.3462`) | **`71.69%` (`69.11%` / `73.10%`)** | **`Top-1 ECE = 0.0777`** • `1.11 ms/row` (`4,045.4 ms` total) |
328
+ | **`When2Call` LLM-Judge (`n = 300`)** | `BinAcc` (`ToolRec` / `Abstain`) | `66.67%` (`0%` / `100%`, `ECE 0.3187`) | **`68.67%` (`68.00%` / `69.00%`)** | **`10-Bin ECE = 0.1210`** • `CannotAns = 79%`, `ReqInfo = 59%` • `1.41 ms/row` |
329
+ | **`PLE 29` (`Apache-2.0` Dev Meta)** | `nano` / `ensemble` 0-Shot Acc | `58.62%` (`nano`) | **`86.21%` (`25/29`)** | `benchmarks/data/ple_dev_29_metadata.json` (`29` tasks) |
330
+ | **`Container-A ADK` (`self-test`)** | Dual ZIPs / Subprocess Parity | Raw `> 32k` context | **`83,695 B` (`31B`) / `83,384 B` (`E4B`)** | `867` ch stdout (`≤ 4,500`), `0.0` diff vs Host, `workspace_clean: true` |
331
+
332
+ ---
333
+
334
+ ## 3. Resident MCP Server (`6` Tools) & Standalone CLI Usage
335
+
336
+ ### A. Optional Neural Dependencies (`Stage 0` Runs on Python 3.9+ Stdlib Alone)
337
+ ```bash
338
+ # Stage 1 (Laya ModernBERT-large en/typed/ensemble + mmBERT) & Stage 2 (VegaML conformal vega-U / VegaVision):
339
+ pip install "laya>=0.4.31" "vegaml>=0.16.1" torch
340
+ ```
341
+
342
+ ### B. Register the Resident MCP Server (`xlaya_mcp_server.py` — `6` Tools, MCP `2025-03-26`, `~30 ms` Warm)
343
+ Add `xlaya` to your MCP client configuration (`mcp_config.json`, Claude Desktop, Cursor, Antigravity, Windsurf, or Cline). All 6 tools expose explicit MCP `2025-03-26` `ToolAnnotations` (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) with `2024-11-05` fallback negotiation:
344
+ ```json
345
+ {
346
+ "mcpServers": {
347
+ "xlaya": {
348
+ "command": "python",
349
+ "args": ["/path/to/xlaya/xlaya_mcp_server.py"],
350
+ "env": {
351
+ "LAYA_IDLE_TTL_SEC": "1800"
352
+ }
353
+ }
354
+ }
355
+ }
356
+ ```
357
+
358
+ > **PyPI & Official MCP Registry Packaging (`PREPARED (pending tag release)`)**:
359
+ > Package metadata (`pyproject.toml`, PyPI distribution `xlaya-mcp` exposing console scripts `xlaya-mcp` and `xlaya`), Official MCP Registry manifest (`server.json` for `io.github.iscvlab/xlaya`), and OIDC Trusted Publishing + Sigstore Cosign release workflow (`.github/workflows/publish-mcp.yml`) are **PREPARED (pending tag release)**. Once the tagged release is live on PyPI, clients can launch the MCP server directly via `uvx xlaya-mcp` (or install locally via `pip install xlaya-mcp` / `pip install "xlaya-mcp[neural]"`).
360
+
361
+ | Resident MCP Tool | Core Parameters | Primary Use Case |
362
+ | :--- | :--- | :--- |
363
+ | **`xlaya_triage`** | `paths`, `mode` (`shortlist\|contradiction\|rubric\|classify`), `query`, `ssot`, `lang` (`auto\|en\|multi\|typed\|ensemble`), `profile` (`auto\|nano\|edge\|workstation\|max`), `agent_tier` (`auto\|e4b-sniper\|31b-deep`), `sieve_weights`, `thorough`, `rubric_preset` (`default\|architecture\|code_audit\|doc_sync\|research`), `views` (`1\|2\|3`), `policy_path`, `vega`, `vega_model` (`auto\|0.8b\|4b\|gemma-1b\|27b\|none`), `lexical_prefilter` | End-to-end Stage 0 → Stage 1 → Stage 2 directory/file/Python-AST sweep returning `#L<start>-L<end>` spans, code-sieve probabilities, 4-facet scores, `disagreement` gate, and `file_summaries` |
364
+ | **`xlaya_predict`** | `questions`, `state` or `states`, `model` (`auto\|en\|multi\|typed\|ensemble`), `profile` (`auto\|nano\|edge\|workstation\|max`), `vega`, `vega_model` (`auto\|0.8b\|4b\|gemma-1b\|27b\|none`), `views` (`1\|2\|3`), `policy_path`, `image`, `audio`, `video` | In-memory, zero-torch `nano`, or local multimodal (`image`/`audio`/`video`) `choice`, `score`, and `noul` evaluation (auto-runs Head-Language Guard, `views` debiasing & `predict_tournament`) |
365
+ | **`xlaya_fit`** | `rows` (`list[dict]` or `.csv`/`.jsonl` path), `questions`, `policy_path`, `vega_model="0.8b"`, `device="auto"`, `folds=5`, `calibrate=true`, `target_precision=0.95` | Fits and persists a `VegaAgent` `TTTHead` + split-conformal policy (`heads.npz`, `calibration.json`, `manifest.json`, `questions.json`) with OOD `outbound` centroid guard |
366
+ | **`xlaya_status`** | `profile="auto"` (`auto\|nano\|edge\|workstation\|max`) | Inspects warm-loaded models (`en`, `multi`, `typed`, `ensemble`, `vegaml`), active hardware profile & GPU/MPS/CPU device, MCP version (`2.3.1`), and `LAYA_IDLE_TTL_SEC` |
367
+ | **`xlaya_preload`** | `models=["en", "multi", "typed", "ensemble"]`, `vega=false`, `vega_model="auto"`, `device="auto"` | Pre-warms checkpoints in RAM/VRAM ahead of latency-critical sweeps |
368
+ | **`xlaya_unload`** | *(none)* | Immediately evicts cached models and reclaims CPU RAM and CUDA VRAM |
369
+
370
+ ### C. Run as a Standalone Python CLI (`laya_triage.py`)
371
+ ```bash
372
+ # 0. Zero-Torch (< 25 MB RAM) AST + 2-Hop Code-Graph Localization for Gemma E4B Sniper vs 31B Deep:
373
+ python laya_triage.py ./src --mode shortlist --query "OAuth2PasswordBearer Depends SecurityScopes bug" --profile nano --agent-tier e4b-sniper
374
+ python laya_triage.py ./src --mode shortlist --query "AsyncClient transport redirect leak" --profile workstation --agent-tier 31b-deep
375
+
376
+ # 1. Thorough 4-Facet Decomposed Rubric Scan (ensemble + disagreement >= 0.15 + file_summaries + views=3):
377
+ python laya_triage.py ./docs --mode rubric --thorough --rubric-preset architecture --top-k 10
378
+
379
+ # 2. 3-Question Joint NLI Contradiction Sweep with Calibrated Stage 1 Ensemble (0.45*en + 0.55*typed):
380
+ python laya_triage.py . --mode contradiction --ssot "ModernBERT-large uses a 512-token context window and outputs 0 LLM tokens." --lang ensemble --threshold 0.60
381
+
382
+ # 3. Multi-View Debiased Stage 2 vega-U Conformal Escalation (views=3 cancels position & phrasing bias):
383
+ python laya_triage.py ./skills --mode rubric --ssot "Production specification with CLI and MCP schemas" --vega --vega-model auto --views 3 --vega-top-k 10
384
+
385
+ # 4. Fit a Persistent TTTHead + Split-Conformal Policy & Evaluate with OOD Outbound Guard (supply your questions JSON):
386
+ python laya_triage.py --fit-rows benchmarks/data/routing_labels.csv --questions-file /path/to/questions.json --policy-path ./policies/routing_v1
387
+ python laya_triage.py ./docs --mode classify --policy-path ./policies/routing_v1
388
+
389
+ # 5. Local Multimodal Evaluation, 3-Phase CUDA Sieve Evolution (requires local disjoint snapshot manifest) & Self-Tests:
390
+ python laya_triage.py --image docs/figures/xlaya_v23_cover_1120x560.png --questions-file /path/to/vision_questions.json --vega-model 4b
391
+ python laya_triage.py README.md --mode contradiction --ssot "XLaya v2.3.0 runs with zero output tokens." --whole-file --vega
392
+ python laya_triage.py --self-test
393
+ python benchmarks/colab_kaggle_l4x4_runner.py --self-test --build-submissions --out-dir dist_adk
394
+ # python benchmarks/run_xlaya_evolution.py --verify-zero-leakage --manifest <path/to/disjoint_swe_v23_manifest.json>
395
+ python benchmarks/run_xlaya_benchmark.py --mode quick
396
+ ```
397
+
398
+ ---
399
+
400
+ ## 4. Universal Installation & Repository Layout
401
+
402
+ Install `/xlaya` into all detected agent skill directories on **Windows, macOS, or Linux** (automatically removing legacy `/layax` or `/laya` folders if present):
403
+
404
+ ```powershell
405
+ # Windows PowerShell (installs into ~/.gemini/config/skills, ~/.claude/skills, ~/.codex/skills, ~/.agents/skills):
406
+ .\scripts\install.ps1 -All
407
+ ```
408
+
409
+ ```bash
410
+ # macOS / Linux (copy or --symlink into all detected agent skill roots, or --target <custom_dir>):
411
+ chmod +x scripts/install.sh
412
+ ./scripts/install.sh --all
413
+ ```
414
+
415
+ | Agent Class / Host | Target Skill Directory | Activation Command | Compatibility |
416
+ | :--- | :--- | :--- | :--- |
417
+ | **Any AI Agent (`Cloud • IDE • CLI • Local LLM`)** | `~/.*/skills/xlaya` or `<repo>/.agents/skills/xlaya` | `/xlaya` | `universal` (zero-config `<SKILL_DIR>` resolution + pure-Python fallback) |
418
+ | **Google Gemini / Antigravity (`IDE` & `agy` CLI)** | `~/.gemini/config/skills/xlaya` | `/xlaya` (chains with `/xsync`, `/xbrief`, `/xplan`, `/xdeep-research`, `/xpublish`, `/xultra`, `/xlearn`, `/xocr`) | `tested` (Windows 11 + RTX 5060 Ti 16 GB + Resident MCP) |
419
+ | **Claude Code / Desktop** | `~/.claude/skills/xlaya` | `/xlaya` | `spec-compatible` (`SKILL.md` + `stdio` MCP server + CLI) |
420
+ | **Grok / Cursor / Codex / Windsurf / Cline / OpenHands** | `~/.grok/skills/xlaya`, `~/.codex/skills/xlaya`, or `~/.agents/skills/xlaya` | `/xlaya` | `spec-compatible` (`SKILL.md` + `stdio` MCP server + CLI) |
421
+
422
+ ### Repository Layout
423
+ ```text
424
+ xlaya/
425
+ ├── README.md # Flagship architecture, 5-profile & 4-axis benchmarks
426
+ ├── LICENSE # Pure OSI MIT License
427
+ ├── NOTICE # ConvAI Innovations upstream attribution & Apache-2.0 notices
428
+ ├── pyproject.toml # Hatchling PyPI packaging (xlaya-mcp / xlaya; runtime allowlist)
429
+ ├── server.json # Official MCP Registry manifest (io.github.iscvlab/xlaya)
430
+ ├── llms.txt # Concise machine-readable entrypoint index for LLMs
431
+ ├── laya_triage.py # Standalone 3-stage CLI, AST chunker & code-sieve engine
432
+ ├── xlaya_mcp_server.py # Zero-extra-dependency JSON-RPC 2.0 stdio MCP server (2025-03-26)
433
+ ├── .github/
434
+ │ └── workflows/
435
+ │ └── publish-mcp.yml # Tag-triggered PyPI OIDC + Official MCP Registry Cosign workflow
436
+ ├── docs/
437
+ │ └── figures/ # Academic White-Theme cover & Figures 1-4 (PNG)
438
+ │ ├── xlaya_v23_cover_1120x560.png
439
+ │ ├── fig1_system_architecture_flowchart.png
440
+ │ ├── fig2_zero_cheat_evolution_workflow.png
441
+ │ ├── fig3_blind_evaluation_scorecard.png
442
+ │ └── fig4_pareto_and_codegraph_topology.png
443
+ ├── policies/
444
+ │ └── sieve_genomes.json # CUDA-evolved L1 simplex genomes + Platt & tool_gate (5,679 B LF / 6,020 B CRLF)
445
+ ├── scripts/
446
+ │ ├── install.ps1 # Windows PowerShell multi-agent installer
447
+ │ └── install.sh # macOS / Linux POSIX bash installer (LF normalized)
448
+ ├── skills/
449
+ │ └── xlaya/
450
+ │ ├── SKILL.md # Portable /xlaya agent skill specification
451
+ │ ├── resources/
452
+ │ │ └── sieve_genomes.json # Co-located evolved genome policy for standalone skill copy
453
+ │ └── scripts/ # SHA-256 mirrored CLI & MCP server for standalone skill copy
454
+ │ ├── laya_triage.py
455
+ │ └── xlaya_mcp_server.py
456
+ ├── tests/
457
+ │ ├── test_mcp_annotations.py # MCP 2025-03-26 protocol negotiation & 6-tool ToolAnnotations tests
458
+ │ └── test_v23_sieve_and_adk.py # Deterministic pytest suite (G-01 through G-08, Container-A & ADK parity)
459
+ └── benchmarks/
460
+ ├── data/ # Clean Apache-2.0 fixtures (routing_labels, xerj#1108, PLE 29)
461
+ ├── XLAYA_V2_BENCHMARK_REPORT.md # Full RTX 5060 Ti technical benchmark report
462
+ ├── xlaya_v2_benchmark_results.json # Self-documented Stage 0/1/2 JSON telemetry receipts
463
+ ├── xlaya_v22_evolution_results.json # Legacy v2.2 evolution receipts
464
+ ├── xlaya_v23_evolution_results.json # Zero-Cheat repo-disjoint v2.3 evolution & calibration receipts
465
+ ├── run_xlaya_evolution.py # Vectorized 5,000-gen CUDA evolution & Funnel 2 verifier
466
+ ├── colab_kaggle_l4x4_runner.py # Colab/Kaggle L4x4 verifier & dual ADK submission builder
467
+ └── run_xlaya_benchmark.py # Reproducible --mode {quick,full} verification harness
468
+ ```
469
+
470
+ ---
471
+
472
+ ## 5. Related Toolkits & Author
473
+
474
+ - **[`iscvlab/xboost`](https://github.com/iscvlab/xboost)**: Composable 15-skill `/x*` AI agent engineering ecosystem, 7 Compound Learning Playbooks (`4-Tier Cascade`), and 10 Python CLI & MCP verification engines (`13,200+` LOC).
475
+ - **[`iscvlab/xocr`](https://github.com/iscvlab/xocr)**: High-speed Hybrid Document AI, Two-Stage LaTeX `booktabs` & HTML Table Surgery, Thai PUA/Sara-Am normalizer, and local `Typhoon-OCR v1.5` × `Baidu Unlimited-OCR-2` engine.
476
+ - **[`iscvlab/mcp-bridges`](https://github.com/iscvlab/mcp-bridges)**: Model Context Protocol (`MCP`) automation bridges for QGIS, Rhino 3D, Grasshopper, Adobe Illustrator, Figma, and Ghost Mouse.
477
+ - **[`iscvlab/sse-space-syntax`](https://github.com/iscvlab/sse-space-syntax)**: High-performance C++/Rust/Python Space Syntax, Axial/Segment Angular Choice, VGA, and Isovist simulation engine.
478
+
479
+ Engineered and maintained by **[Napat (Tan) Phasundhiae (`@napattan`)](https://github.com/napattan)** at **[ISCV | Isocurve Research Lab (`@iscvlab`)](https://github.com/iscvlab)**. Released under the **[MIT License](./LICENSE)** (`benchmarks/data/ple_dev_29_metadata.json` and ADK templates are **`Apache-2.0`**); Stage 1 and Stage 2 neural backends interoperate with ConvAI Innovations' open-source **[`laya`](https://github.com/NandhaKishorM/laya)** and `vegaml` libraries.