t1-t2-protocol 2.5.2__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.
- t1_t2_protocol-2.5.2/LICENSE +21 -0
- t1_t2_protocol-2.5.2/PKG-INFO +250 -0
- t1_t2_protocol-2.5.2/README.md +223 -0
- t1_t2_protocol-2.5.2/pyproject.toml +51 -0
- t1_t2_protocol-2.5.2/setup.cfg +4 -0
- t1_t2_protocol-2.5.2/src/t1_t2_mcp_server.py +783 -0
- t1_t2_protocol-2.5.2/src/t1_t2_protocol.egg-info/PKG-INFO +250 -0
- t1_t2_protocol-2.5.2/src/t1_t2_protocol.egg-info/SOURCES.txt +14 -0
- t1_t2_protocol-2.5.2/src/t1_t2_protocol.egg-info/dependency_links.txt +1 -0
- t1_t2_protocol-2.5.2/src/t1_t2_protocol.egg-info/entry_points.txt +2 -0
- t1_t2_protocol-2.5.2/src/t1_t2_protocol.egg-info/requires.txt +3 -0
- t1_t2_protocol-2.5.2/src/t1_t2_protocol.egg-info/top_level.txt +1 -0
- t1_t2_protocol-2.5.2/tests/test_checksum.py +94 -0
- t1_t2_protocol-2.5.2/tests/test_locale.py +71 -0
- t1_t2_protocol-2.5.2/tests/test_mcp_stdio.py +42 -0
- t1_t2_protocol-2.5.2/tests/test_weight_hints.py +35 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fauxetine
|
|
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.
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: t1-t2-protocol
|
|
3
|
+
Version: 2.5.2
|
|
4
|
+
Summary: Heterogeneous validation protocol for MCP — structured reasoning (T1) + cross-model confidence evaluation (T2) + deterministic checksum
|
|
5
|
+
Author: Fauxetine
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Fauxetine/t1-t2-protocol
|
|
8
|
+
Project-URL: PyPI, https://pypi.org/project/t1-t2-protocol/
|
|
9
|
+
Project-URL: Source, https://github.com/Fauxetine/t1-t2-protocol
|
|
10
|
+
Project-URL: Documentation, https://github.com/Fauxetine/t1-t2-protocol#readme
|
|
11
|
+
Project-URL: Issues, https://github.com/Fauxetine/t1-t2-protocol/issues
|
|
12
|
+
Keywords: mcp,model-context-protocol,ai-safety,llm-validation,cross-validation,structured-reasoning,ai-agent,heterogeneous
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
[](https://www.python.org/)
|
|
29
|
+
[](https://pypi.org/project/t1-t2-protocol/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
[](https://modelcontextprotocol.io/)
|
|
32
|
+
|
|
33
|
+
# T1/T2 Protocol — Heterogeneous Validation for MCP
|
|
34
|
+
|
|
35
|
+
<!-- mcp-name: io.github.fauxetine/t1-t2-protocol -->
|
|
36
|
+
|
|
37
|
+
**T1/T2 is an MCP server that makes AI reasoning verifiable, auditable, and trustworthy** — by decomposing ambiguous questions into structured tiers (T1), then validating answers through cross-model evaluation (T2), with a deterministic checksum layer that doesn't depend on any LLM.
|
|
38
|
+
|
|
39
|
+
## Why?
|
|
40
|
+
|
|
41
|
+
When an LLM checks its own answer, it uses the same training data, the same reasoning preferences, and the same systematic biases. **Self-reflection cannot catch its own blind spots.**
|
|
42
|
+
|
|
43
|
+
T1/T2 introduces **heterogeneous validation**: the model that produces the answer and the model that evaluates it should be different. Their different training distributions cover each other's blind spots.
|
|
44
|
+
|
|
45
|
+
## Tools
|
|
46
|
+
|
|
47
|
+
| Tool | Function | Why it matters |
|
|
48
|
+
|------|----------|---------------|
|
|
49
|
+
| **t1_protocol** | Decomposes ambiguous questions into L1 (facts) / L2 (assumptions) / L3 (hypotheses) / L4 (unknowns) | Forces structured reasoning before answering |
|
|
50
|
+
| **t2_protocol** | Evaluates answer quality from another model's perspective | Catches blind spots self-reflection misses |
|
|
51
|
+
| **checksum** | Deterministic structural validation — pure regex, zero LLM dependency | Safety that doesn't scale with intelligence |
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### Requirements
|
|
56
|
+
|
|
57
|
+
- Python 3.10+
|
|
58
|
+
- An MCP client: [Cursor](https://cursor.sh/), [Claude Desktop](https://claude.ai/download), [Windsurf](https://codeium.com/windsurf), or any MCP-compatible host
|
|
59
|
+
|
|
60
|
+
### Install
|
|
61
|
+
|
|
62
|
+
From PyPI (recommended):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install t1-t2-protocol
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
From source (development):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/Fauxetine/t1-t2-protocol.git
|
|
72
|
+
cd t1-t2-protocol
|
|
73
|
+
pip install -e ".[dev]"
|
|
74
|
+
python -m pytest tests/ -v
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or run directly without installing:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
python3 src/t1_t2_mcp_server.py
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
After `pip install`, register the console script in MCP config:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"t1-t2-protocol": {
|
|
89
|
+
"type": "stdio",
|
|
90
|
+
"command": "t1-t2-protocol"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Configure
|
|
97
|
+
|
|
98
|
+
**Cursor** — add to `.cursor/mcp.json`:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"t1-t2-protocol": {
|
|
104
|
+
"type": "stdio",
|
|
105
|
+
"command": "python3",
|
|
106
|
+
"args": ["/path/to/src/t1_t2_mcp_server.py"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Claude Desktop** — add to `claude_desktop_config.json`:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"t1-t2-protocol": {
|
|
118
|
+
"command": "python3",
|
|
119
|
+
"args": ["/path/to/src/t1_t2_mcp_server.py"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Usage
|
|
126
|
+
|
|
127
|
+
### T1: Structure a vague question
|
|
128
|
+
|
|
129
|
+
Call `t1_protocol` with your question. It returns a structured prompt with four tiers:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Input: "Should we migrate our monolith to microservices?"
|
|
133
|
+
|
|
134
|
+
Output: Structured prompt with:
|
|
135
|
+
[L1 Facts] Team size, codebase size, current stack
|
|
136
|
+
[L2 Assumptions] Expected benefits that need verification
|
|
137
|
+
[L3 Hypotheses] Testable claims about migration risk
|
|
138
|
+
[L4 Unknown] Future growth trajectory
|
|
139
|
+
[Core Question] The precise feasibility question
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### T2: Cross-validate a decision
|
|
143
|
+
|
|
144
|
+
Call `t2_protocol` with a decision or answer text. It returns confidence assessment + adoption recommendations:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
Input: "Decision text for approach A..."
|
|
148
|
+
|
|
149
|
+
Output:
|
|
150
|
+
Confidence: Medium-High
|
|
151
|
+
Adoption table with:
|
|
152
|
+
✅ Adopt — verified conclusions (L1)
|
|
153
|
+
⚠️ Reserved — needs more evidence (L2)
|
|
154
|
+
❌ N/A — blind spots to address
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### checksum: Validate output structure
|
|
158
|
+
|
|
159
|
+
Call `checksum` with structured text. It returns pass/fail based on deterministic rules:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Input: "[L1 Facts]\n1. ...\n[L2 Assumptions]\n1. ...\n---"
|
|
163
|
+
Output: {"checksum_passed": true, "errors": []}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Full pipeline
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
Vague question → T1 structured decomposition → Decision based on structure → checksum (optional) → T2 validation → Refined decision
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
For time-sensitive factual claims, **search on the caller side before T2** — see [Caller-side web verification (v2.6)](docs/caller-protocol.md).
|
|
173
|
+
|
|
174
|
+
## Configuration
|
|
175
|
+
|
|
176
|
+
### Locale
|
|
177
|
+
|
|
178
|
+
Both `t1_protocol` and `t2_protocol` accept an optional `locale` parameter:
|
|
179
|
+
|
|
180
|
+
| Value | Output |
|
|
181
|
+
|-------|--------|
|
|
182
|
+
| `en` (default) | English templates |
|
|
183
|
+
| `zh` | Chinese templates |
|
|
184
|
+
|
|
185
|
+
Example: `{"question": "...", "locale": "zh"}`
|
|
186
|
+
|
|
187
|
+
### Weight hints
|
|
188
|
+
|
|
189
|
+
Both `t1_protocol` and `t2_protocol` accept an optional `weight_hint` parameter to bias evaluation criteria:
|
|
190
|
+
|
|
191
|
+
| Weight | Effect |
|
|
192
|
+
|--------|--------|
|
|
193
|
+
| `事实优先` / `fact-first` | Prioritizes factual accuracy |
|
|
194
|
+
| `效率优先` / `efficiency-first` | Prioritizes efficiency |
|
|
195
|
+
| `成本优先` / `cost-first` | Prioritizes cost |
|
|
196
|
+
| `鲁棒性优先` / `robustness-first` | Prioritizes robustness |
|
|
197
|
+
| `通用优先` / `general-first` | No specific bias |
|
|
198
|
+
|
|
199
|
+
### Recursion protection
|
|
200
|
+
|
|
201
|
+
T2 automatically detects recursion depth and terminates at depth >= 3, where marginal information gain drops below 5%.
|
|
202
|
+
|
|
203
|
+
## Design Philosophy
|
|
204
|
+
|
|
205
|
+
See [docs/philosophy.md](docs/philosophy.md) for the full design rationale.
|
|
206
|
+
|
|
207
|
+
Core tenets:
|
|
208
|
+
|
|
209
|
+
1. **Separate intelligence from trust** — AI capability and AI safety should be guaranteed by different systems
|
|
210
|
+
2. **Heterogeneous over self-referential** — Cross-model validation is more reliable than self-reflection
|
|
211
|
+
3. **Deterministic over probabilistic** — What can be checked by code should not be left to model judgment
|
|
212
|
+
|
|
213
|
+
## Examples
|
|
214
|
+
|
|
215
|
+
See [examples/](examples/) for step-by-step walkthroughs:
|
|
216
|
+
|
|
217
|
+
- [T1: Structure a vague question](examples/t1-basic.md)
|
|
218
|
+
- [T2: Cross-validate a decision](examples/t2-basic.md)
|
|
219
|
+
- [Full pipeline: T1 → decision → T2](examples/full-pipeline.md)
|
|
220
|
+
|
|
221
|
+
## Positioning
|
|
222
|
+
|
|
223
|
+
| Project | Layer | What it does | T1/T2 relationship |
|
|
224
|
+
|---------|-------|--------------|-------------------|
|
|
225
|
+
| [Sequential Thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking) (official MCP) | Caller-side chain-of-thought | One model logs iterative steps | Complementary — T1 adds L1–L4 tiers + T2 cross-model review |
|
|
226
|
+
| [ThoughtProof](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/2574) / verdict APIs | Server-side verification | `APPROVE`/`DENY`/`UNCERTAIN` with confidence | Complementary — T1/T2 structures reasoning *before* verdict APIs act |
|
|
227
|
+
| Self-reflection / prompt chains | Same model | Re-reads or re-prompts its own output | Replaced — heterogeneous validation catches shared blind spots |
|
|
228
|
+
| Tool integrity (e.g. Phionyx) | Transport / tool schema | Detects tool poisoning, schema drift | Orthogonal — T1/T2 does not secure tool definitions |
|
|
229
|
+
|
|
230
|
+
T1/T2 is a **stdlib reference implementation** for [MCP Discussion #2574](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/2574)-style reasoning discipline: structure first (T1), cross-validate second (T2), checksum what code can verify. It is not a signed verdict API and not a security scanner.
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT — see [LICENSE](LICENSE).
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
*Built for the MCP ecosystem. Part of a broader exploration into AI safety through deterministic architecture.*
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Links
|
|
243
|
+
|
|
244
|
+
- [Contributing](CONTRIBUTING.md)
|
|
245
|
+
- [MCP Registry](https://registry.modelcontextprotocol.io/)
|
|
246
|
+
- [Security policy](SECURITY.md)
|
|
247
|
+
- [Changelog](CHANGELOG.md)
|
|
248
|
+
- [Design philosophy](docs/philosophy.md)
|
|
249
|
+
- [Caller-side web verification v2.6](docs/caller-protocol.md)
|
|
250
|
+
- [Agent / MCP host instructions](AGENTS.md)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
[](https://www.python.org/)
|
|
2
|
+
[](https://pypi.org/project/t1-t2-protocol/)
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://modelcontextprotocol.io/)
|
|
5
|
+
|
|
6
|
+
# T1/T2 Protocol — Heterogeneous Validation for MCP
|
|
7
|
+
|
|
8
|
+
<!-- mcp-name: io.github.fauxetine/t1-t2-protocol -->
|
|
9
|
+
|
|
10
|
+
**T1/T2 is an MCP server that makes AI reasoning verifiable, auditable, and trustworthy** — by decomposing ambiguous questions into structured tiers (T1), then validating answers through cross-model evaluation (T2), with a deterministic checksum layer that doesn't depend on any LLM.
|
|
11
|
+
|
|
12
|
+
## Why?
|
|
13
|
+
|
|
14
|
+
When an LLM checks its own answer, it uses the same training data, the same reasoning preferences, and the same systematic biases. **Self-reflection cannot catch its own blind spots.**
|
|
15
|
+
|
|
16
|
+
T1/T2 introduces **heterogeneous validation**: the model that produces the answer and the model that evaluates it should be different. Their different training distributions cover each other's blind spots.
|
|
17
|
+
|
|
18
|
+
## Tools
|
|
19
|
+
|
|
20
|
+
| Tool | Function | Why it matters |
|
|
21
|
+
|------|----------|---------------|
|
|
22
|
+
| **t1_protocol** | Decomposes ambiguous questions into L1 (facts) / L2 (assumptions) / L3 (hypotheses) / L4 (unknowns) | Forces structured reasoning before answering |
|
|
23
|
+
| **t2_protocol** | Evaluates answer quality from another model's perspective | Catches blind spots self-reflection misses |
|
|
24
|
+
| **checksum** | Deterministic structural validation — pure regex, zero LLM dependency | Safety that doesn't scale with intelligence |
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
### Requirements
|
|
29
|
+
|
|
30
|
+
- Python 3.10+
|
|
31
|
+
- An MCP client: [Cursor](https://cursor.sh/), [Claude Desktop](https://claude.ai/download), [Windsurf](https://codeium.com/windsurf), or any MCP-compatible host
|
|
32
|
+
|
|
33
|
+
### Install
|
|
34
|
+
|
|
35
|
+
From PyPI (recommended):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install t1-t2-protocol
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
From source (development):
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://github.com/Fauxetine/t1-t2-protocol.git
|
|
45
|
+
cd t1-t2-protocol
|
|
46
|
+
pip install -e ".[dev]"
|
|
47
|
+
python -m pytest tests/ -v
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or run directly without installing:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
python3 src/t1_t2_mcp_server.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
After `pip install`, register the console script in MCP config:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"t1-t2-protocol": {
|
|
62
|
+
"type": "stdio",
|
|
63
|
+
"command": "t1-t2-protocol"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Configure
|
|
70
|
+
|
|
71
|
+
**Cursor** — add to `.cursor/mcp.json`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"t1-t2-protocol": {
|
|
77
|
+
"type": "stdio",
|
|
78
|
+
"command": "python3",
|
|
79
|
+
"args": ["/path/to/src/t1_t2_mcp_server.py"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Claude Desktop** — add to `claude_desktop_config.json`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"mcpServers": {
|
|
90
|
+
"t1-t2-protocol": {
|
|
91
|
+
"command": "python3",
|
|
92
|
+
"args": ["/path/to/src/t1_t2_mcp_server.py"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage
|
|
99
|
+
|
|
100
|
+
### T1: Structure a vague question
|
|
101
|
+
|
|
102
|
+
Call `t1_protocol` with your question. It returns a structured prompt with four tiers:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Input: "Should we migrate our monolith to microservices?"
|
|
106
|
+
|
|
107
|
+
Output: Structured prompt with:
|
|
108
|
+
[L1 Facts] Team size, codebase size, current stack
|
|
109
|
+
[L2 Assumptions] Expected benefits that need verification
|
|
110
|
+
[L3 Hypotheses] Testable claims about migration risk
|
|
111
|
+
[L4 Unknown] Future growth trajectory
|
|
112
|
+
[Core Question] The precise feasibility question
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### T2: Cross-validate a decision
|
|
116
|
+
|
|
117
|
+
Call `t2_protocol` with a decision or answer text. It returns confidence assessment + adoption recommendations:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Input: "Decision text for approach A..."
|
|
121
|
+
|
|
122
|
+
Output:
|
|
123
|
+
Confidence: Medium-High
|
|
124
|
+
Adoption table with:
|
|
125
|
+
✅ Adopt — verified conclusions (L1)
|
|
126
|
+
⚠️ Reserved — needs more evidence (L2)
|
|
127
|
+
❌ N/A — blind spots to address
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### checksum: Validate output structure
|
|
131
|
+
|
|
132
|
+
Call `checksum` with structured text. It returns pass/fail based on deterministic rules:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Input: "[L1 Facts]\n1. ...\n[L2 Assumptions]\n1. ...\n---"
|
|
136
|
+
Output: {"checksum_passed": true, "errors": []}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Full pipeline
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Vague question → T1 structured decomposition → Decision based on structure → checksum (optional) → T2 validation → Refined decision
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
For time-sensitive factual claims, **search on the caller side before T2** — see [Caller-side web verification (v2.6)](docs/caller-protocol.md).
|
|
146
|
+
|
|
147
|
+
## Configuration
|
|
148
|
+
|
|
149
|
+
### Locale
|
|
150
|
+
|
|
151
|
+
Both `t1_protocol` and `t2_protocol` accept an optional `locale` parameter:
|
|
152
|
+
|
|
153
|
+
| Value | Output |
|
|
154
|
+
|-------|--------|
|
|
155
|
+
| `en` (default) | English templates |
|
|
156
|
+
| `zh` | Chinese templates |
|
|
157
|
+
|
|
158
|
+
Example: `{"question": "...", "locale": "zh"}`
|
|
159
|
+
|
|
160
|
+
### Weight hints
|
|
161
|
+
|
|
162
|
+
Both `t1_protocol` and `t2_protocol` accept an optional `weight_hint` parameter to bias evaluation criteria:
|
|
163
|
+
|
|
164
|
+
| Weight | Effect |
|
|
165
|
+
|--------|--------|
|
|
166
|
+
| `事实优先` / `fact-first` | Prioritizes factual accuracy |
|
|
167
|
+
| `效率优先` / `efficiency-first` | Prioritizes efficiency |
|
|
168
|
+
| `成本优先` / `cost-first` | Prioritizes cost |
|
|
169
|
+
| `鲁棒性优先` / `robustness-first` | Prioritizes robustness |
|
|
170
|
+
| `通用优先` / `general-first` | No specific bias |
|
|
171
|
+
|
|
172
|
+
### Recursion protection
|
|
173
|
+
|
|
174
|
+
T2 automatically detects recursion depth and terminates at depth >= 3, where marginal information gain drops below 5%.
|
|
175
|
+
|
|
176
|
+
## Design Philosophy
|
|
177
|
+
|
|
178
|
+
See [docs/philosophy.md](docs/philosophy.md) for the full design rationale.
|
|
179
|
+
|
|
180
|
+
Core tenets:
|
|
181
|
+
|
|
182
|
+
1. **Separate intelligence from trust** — AI capability and AI safety should be guaranteed by different systems
|
|
183
|
+
2. **Heterogeneous over self-referential** — Cross-model validation is more reliable than self-reflection
|
|
184
|
+
3. **Deterministic over probabilistic** — What can be checked by code should not be left to model judgment
|
|
185
|
+
|
|
186
|
+
## Examples
|
|
187
|
+
|
|
188
|
+
See [examples/](examples/) for step-by-step walkthroughs:
|
|
189
|
+
|
|
190
|
+
- [T1: Structure a vague question](examples/t1-basic.md)
|
|
191
|
+
- [T2: Cross-validate a decision](examples/t2-basic.md)
|
|
192
|
+
- [Full pipeline: T1 → decision → T2](examples/full-pipeline.md)
|
|
193
|
+
|
|
194
|
+
## Positioning
|
|
195
|
+
|
|
196
|
+
| Project | Layer | What it does | T1/T2 relationship |
|
|
197
|
+
|---------|-------|--------------|-------------------|
|
|
198
|
+
| [Sequential Thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking) (official MCP) | Caller-side chain-of-thought | One model logs iterative steps | Complementary — T1 adds L1–L4 tiers + T2 cross-model review |
|
|
199
|
+
| [ThoughtProof](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/2574) / verdict APIs | Server-side verification | `APPROVE`/`DENY`/`UNCERTAIN` with confidence | Complementary — T1/T2 structures reasoning *before* verdict APIs act |
|
|
200
|
+
| Self-reflection / prompt chains | Same model | Re-reads or re-prompts its own output | Replaced — heterogeneous validation catches shared blind spots |
|
|
201
|
+
| Tool integrity (e.g. Phionyx) | Transport / tool schema | Detects tool poisoning, schema drift | Orthogonal — T1/T2 does not secure tool definitions |
|
|
202
|
+
|
|
203
|
+
T1/T2 is a **stdlib reference implementation** for [MCP Discussion #2574](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/2574)-style reasoning discipline: structure first (T1), cross-validate second (T2), checksum what code can verify. It is not a signed verdict API and not a security scanner.
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT — see [LICENSE](LICENSE).
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
*Built for the MCP ecosystem. Part of a broader exploration into AI safety through deterministic architecture.*
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Links
|
|
216
|
+
|
|
217
|
+
- [Contributing](CONTRIBUTING.md)
|
|
218
|
+
- [MCP Registry](https://registry.modelcontextprotocol.io/)
|
|
219
|
+
- [Security policy](SECURITY.md)
|
|
220
|
+
- [Changelog](CHANGELOG.md)
|
|
221
|
+
- [Design philosophy](docs/philosophy.md)
|
|
222
|
+
- [Caller-side web verification v2.6](docs/caller-protocol.md)
|
|
223
|
+
- [Agent / MCP host instructions](AGENTS.md)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "t1-t2-protocol"
|
|
3
|
+
version = "2.5.2"
|
|
4
|
+
description = "Heterogeneous validation protocol for MCP — structured reasoning (T1) + cross-model confidence evaluation (T2) + deterministic checksum"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = {text = "MIT"}
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [
|
|
9
|
+
{name = "Fauxetine"},
|
|
10
|
+
]
|
|
11
|
+
keywords = [
|
|
12
|
+
"mcp", "model-context-protocol", "ai-safety", "llm-validation",
|
|
13
|
+
"cross-validation", "structured-reasoning", "ai-agent", "heterogeneous",
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/Fauxetine/t1-t2-protocol"
|
|
28
|
+
PyPI = "https://pypi.org/project/t1-t2-protocol/"
|
|
29
|
+
Source = "https://github.com/Fauxetine/t1-t2-protocol"
|
|
30
|
+
Documentation = "https://github.com/Fauxetine/t1-t2-protocol#readme"
|
|
31
|
+
Issues = "https://github.com/Fauxetine/t1-t2-protocol/issues"
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
t1-t2-protocol = "t1_t2_mcp_server:main"
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
dev = ["pytest>=7.0"]
|
|
38
|
+
|
|
39
|
+
[tool.setuptools]
|
|
40
|
+
py-modules = ["t1_t2_mcp_server"]
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.package-dir]
|
|
43
|
+
"" = "src"
|
|
44
|
+
|
|
45
|
+
[tool.pytest.ini_options]
|
|
46
|
+
testpaths = ["tests"]
|
|
47
|
+
pythonpath = ["src"]
|
|
48
|
+
|
|
49
|
+
[build-system]
|
|
50
|
+
requires = ["setuptools>=64"]
|
|
51
|
+
build-backend = "setuptools.build_meta"
|