tribunal-kit 5.8.0 → 5.8.1

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.
@@ -1,6 +1,6 @@
1
1
  # 🧠 Tribunal Memory Index
2
2
  > Auto-generated by `tribunal-kit memory export`. Do not edit manually.
3
- > Entries: 50 | Semantic: 40 | Procedural: 10 | Episodic: 0 | Working: 0
3
+ > Entries: 111 | Semantic: 89 | Procedural: 22 | Episodic: 0 | Working: 0
4
4
 
5
5
  ## SEMANTIC (Permanent Facts)
6
6
  | ID | Content | Tags | Source | Created |
@@ -45,6 +45,55 @@
45
45
  | 46 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783152364Z |
46
46
  | 47 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783152364Z |
47
47
  | 48 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783152364Z |
48
+ | 51 | āŒ Overriding project idioms without explicit justification -> āœ… Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783438387Z |
49
+ | 52 | āŒ Applying idioms from one project to a different project -> āœ… Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783438387Z |
50
+ | 53 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438387Z |
51
+ | 54 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438387Z |
52
+ | 55 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783438387Z |
53
+ | 56 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783438387Z |
54
+ | 57 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438387Z |
55
+ | 58 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438387Z |
56
+ | 61 | āŒ Overriding project idioms without explicit justification -> āœ… Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783438449Z |
57
+ | 62 | āŒ Applying idioms from one project to a different project -> āœ… Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783438449Z |
58
+ | 63 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438449Z |
59
+ | 64 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438449Z |
60
+ | 65 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783438449Z |
61
+ | 66 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783438449Z |
62
+ | 67 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438449Z |
63
+ | 68 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438449Z |
64
+ | 71 | āŒ Overriding project idioms without explicit justification -> āœ… Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783438727Z |
65
+ | 72 | āŒ Applying idioms from one project to a different project -> āœ… Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783438727Z |
66
+ | 73 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438727Z |
67
+ | 74 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438727Z |
68
+ | 75 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783438727Z |
69
+ | 76 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783438727Z |
70
+ | 77 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438727Z |
71
+ | 78 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438727Z |
72
+ | 81 | āŒ Overriding project idioms without explicit justification -> āœ… Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783782112Z |
73
+ | 82 | āŒ Applying idioms from one project to a different project -> āœ… Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783782112Z |
74
+ | 83 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782112Z |
75
+ | 84 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782112Z |
76
+ | 85 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783782112Z |
77
+ | 86 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783782112Z |
78
+ | 87 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782112Z |
79
+ | 88 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782112Z |
80
+ | 91 | āŒ Overriding project idioms without explicit justification -> āœ… Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783782132Z |
81
+ | 92 | āŒ Applying idioms from one project to a different project -> āœ… Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783782132Z |
82
+ | 93 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782132Z |
83
+ | 94 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782132Z |
84
+ | 95 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783782132Z |
85
+ | 96 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783782132Z |
86
+ | 97 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782132Z |
87
+ | 98 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782132Z |
88
+ | 101 | Database is PostgreSQL | db, postgres | manual | 1783783700Z |
89
+ | 102 | āŒ Overriding project idioms without explicit justification -> āœ… Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783785670Z |
90
+ | 103 | āŒ Applying idioms from one project to a different project -> āœ… Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783785670Z |
91
+ | 104 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783785670Z |
92
+ | 105 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783785670Z |
93
+ | 106 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783785670Z |
94
+ | 107 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783785670Z |
95
+ | 108 | āŒ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783785670Z |
96
+ | 109 | āœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783785670Z |
48
97
 
49
98
  ## PROCEDURAL (How-To Recipes)
50
99
  | ID | Content | Tags | Source | Created |
@@ -59,4 +108,16 @@
59
108
  | 40 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783148917Z |
60
109
  | 49 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783152364Z |
61
110
  | 50 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783152364Z |
111
+ | 59 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783438387Z |
112
+ | 60 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783438387Z |
113
+ | 69 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783438449Z |
114
+ | 70 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783438449Z |
115
+ | 79 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783438727Z |
116
+ | 80 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783438727Z |
117
+ | 89 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783782112Z |
118
+ | 90 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783782112Z |
119
+ | 99 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783782132Z |
120
+ | 100 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783782132Z |
121
+ | 110 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783785670Z |
122
+ | 111 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783785670Z |
62
123
 
@@ -22,6 +22,13 @@ Has this information possibly changed since my training?
22
22
  → Yes → Search before answering. Never serve stale facts.
23
23
  Am I importing a package/method that exists?
24
24
  → Verify against package.json / requirements.txt / official docs.
25
+
26
+ Epistemic Confidence Levels (L1-L5):
27
+ - L1: Absolute Certainty (Verified against active codebase or official docs)
28
+ - L2: High Confidence (Standard library or stable unchanged APIs)
29
+ - L3: Moderate Confidence (Likely but unverified custom utils; requires // VERIFY)
30
+ - L4: Low Confidence (Speculative unstable features; requires immediate search)
31
+ - L5: Pure Speculation (Guessed; strictly forbidden from code generation)
25
32
  ```
26
33
 
27
34
  ### 0b. Response Format Decision
@@ -210,12 +217,12 @@ The Human Gate is never skipped. No code is written to a file without explicit u
210
217
 
211
218
  | Code type | Reviewers |
212
219
  | --------------------- | --------------------------------------------------------------------------------------------------- |
213
- | Backend/API | logic + security + dependency + type-safety + resilience + schema |
214
- | Frontend/React | logic + security + frontend + type-safety + ui-ux-auditor + review-animations |
215
- | Database/SQL | logic + security + sql + schema |
216
- | Mobile/Cross-platform | logic + security + mobile-reviewer + type-safety |
220
+ | Backend/API | logic + security + dependency + type-safety + resilience + schema + complexity-reviewer |
221
+ | Frontend/React | logic + security + frontend + type-safety + ui-ux-auditor + review-animations + complexity-reviewer |
222
+ | Database/SQL | logic + security + sql + schema + complexity-reviewer |
223
+ | Mobile/Cross-platform | logic + security + mobile-reviewer + type-safety + complexity-reviewer |
217
224
  | Any domain | + performance (if optimization) |
218
- | Before merge | /tribunal-full (all 19) |
225
+ | Before merge | /tribunal-full (all 20) |
219
226
 
220
227
  ---
221
228
 
@@ -399,6 +406,24 @@ Before modifying any file:
399
406
 
400
407
  ---
401
408
 
409
+ ## Fabel-5 Cognitive Boundaries (Wellbeing, Evenhandedness, Memory)
410
+
411
+ ### User Wellbeing & Safety
412
+ * **No Psychoanalysis / Diagnosis**: Reflect what is said without diagnosing or assigning psychological narratives (e.g. "you restrict because of trauma"). Suggest professional help without clinical labels.
413
+ * **Self-Harm Interruptions**: Never suggest physical substitutes (holding ice, snapping rubber bands, drawing lines) or mimic self-harm. They reinforce the self-harm loop.
414
+ * **No Over-reliance**: Do not thank the user for reaching out, encourage them to stay, or reiterate willingness to continue. Avoid conversational dependencies.
415
+ * **Positive Paths**: Acknowledge distress without reflective listening that amplifies negative spirals. Keep paths to external help open.
416
+
417
+ ### Moral & Political Evenhandedness
418
+ * **Nuance Over Brevity**: Reject requests for simple yes/no or one-word answers on contested political, ethical, or policy issues. Give a fair, balanced overview of existing positions.
419
+ * **Opposing Perspectives**: Conclude arguments for positions by presenting opposing viewpoints or empirical disputes even if the user/AI agrees with the primary view.
420
+
421
+ ### Memory & Preference Boundaries
422
+ * **Invisible Integration**: Integrate remembered user context silently without attribution or observation verbs ("I notice in your profile...", "Based on your memory...").
423
+ * **Expertise Tuning**: Match language and technical depth to the user's stated background without lecturing.
424
+
425
+ ---
426
+
402
427
  ## Quick Reference
403
428
 
404
429
  **Scripts:** `.agent/scripts/`
@@ -32,6 +32,15 @@ CONFIDENCE CHECK:
32
32
  → Standard library (Node, Python, Rust) → Low risk. Proceed with confidence.
33
33
  ```
34
34
 
35
+ ### Epistemic Confidence Levels (L1-L5)
36
+
37
+ Rate the certainty of your implementation decisions using this hierarchy:
38
+ - **L1: Absolute Certainty (Verified Truth)**: Code is fully checked against active files in the workspace or verified in up-to-date documentation.
39
+ - **L2: High Confidence (Standard API)**: Using standard library or stable, unchanged language features (e.g. standard Node `fs` methods, basic Python functions).
40
+ - **L3: Moderate Confidence (Likely but Unverified)**: Custom utilities or package features that are likely correct but not actively verified. Must add `// VERIFY: [reason]` tags.
41
+ - **L4: Low Confidence (Speculative)**: Unstable APIs, recently modified dependencies, or legacy components. Search or audit first.
42
+ - **L5: Pure Speculation (Guessed / Blind)**: Complete guesswork. Strictly prohibited from code generation. Must stop and research or ask.
43
+
35
44
  ### Uncertainty Markers
36
45
 
37
46
  When uncertain, never silently guess. Use explicit markers:
@@ -193,7 +202,25 @@ ALWAYS:
193
202
 
194
203
  ---
195
204
 
196
- ## 6. Anti-Hallucination Quick Reference
205
+ ## 6. Fabel-5 Cognitive Boundaries (Wellbeing, Evenhandedness, Memory)
206
+
207
+ ### User Wellbeing & Safety
208
+ * **No Psychoanalysis / Diagnosis**: Reflect what is said without diagnosing or assigning psychological narratives (e.g. "you restrict because of trauma"). Suggest professional help without clinical labels.
209
+ * **Self-Harm Interruptions**: Never suggest physical substitutes (holding ice, snapping rubber bands, drawing lines) or mimic self-harm. They reinforce the self-harm loop.
210
+ * **No Over-reliance**: Do not thank the user for reaching out, encourage them to stay, or reiterate willingness to continue. Avoid conversational dependencies.
211
+ * **Positive Paths**: Acknowledge distress without reflective listening that amplifies negative spirals. Keep paths to external help open.
212
+
213
+ ### Moral & Political Evenhandedness
214
+ * **Nuance Over Brevity**: Reject requests for simple yes/no or one-word answers on contested political, ethical, or policy issues. Give a fair, balanced overview of existing positions.
215
+ * **Opposing Perspectives**: Conclude arguments for positions by presenting opposing viewpoints or empirical disputes even if the user/AI agrees with the primary view.
216
+
217
+ ### Memory & Preference Boundaries
218
+ * **Invisible Integration**: Integrate remembered user context silently without attribution or observation verbs ("I notice in your profile...", "Based on your memory...").
219
+ * **Expertise Tuning**: Match language and technical depth to the user's stated background without lecturing.
220
+
221
+ ---
222
+
223
+ ## 7. Anti-Hallucination Quick Reference
197
224
 
198
225
  High-risk hallucination zones (verify before using):
199
226
 
@@ -211,6 +238,15 @@ When in doubt: **search the official docs**. Never trust training data for API s
211
238
 
212
239
  ---
213
240
 
241
+ ## ⚔ Hallucination Heatmap (High-Risk Zones)
242
+
243
+ - **Next.js 15+ Route Handlers**: Dynamic functions (`headers()`, `cookies()`, `params`) are now async and must be awaited. Unawaited calls throw runtime errors.
244
+ - **React 19 Hooks**: `useFormState` was renamed to `useActionState`. Direct context creation using `React.createServerContext()` was removed.
245
+ - **Drizzle ORM Queries**: `db.select().from().filter()` does not exist; Drizzle uses `.where()` for filtering.
246
+ - **OpenAI / Anthropic SDKs**: Model strings (e.g., trying to use `gpt-5` or `claude-4-opus` which do not exist or are incorrect).
247
+
248
+ ---
249
+
214
250
  ## LLM Traps — Self-Audit
215
251
 
216
252
  ```
@@ -109,6 +109,7 @@ When unsure: write `// VERIFY: [specific reason]` instead of hallucinating.
109
109
  precedence-reviewer→ Enforces repository Case Law and past rejections (Runs First)
110
110
  logic-reviewer → Hallucinated methods, undefined refs, impossible logic
111
111
  security-auditor → OWASP vulnerabilities, hardcoded secrets, injection
112
+ complexity-reviewer→ Enforces the Dependency Ladder to prevent over-engineering
112
113
  ```
113
114
 
114
115
  **Auto-activated by keywords:**
@@ -1,9 +1,9 @@
1
1
  ---
2
- description: Run ALL 19 Tribunal reviewer agents simultaneously. Maximum hallucination coverage. Use before merging any AI-generated code, before production deployments, or when maximum confidence is required.
2
+ description: Run ALL 20 Tribunal reviewer agents simultaneously. Maximum hallucination coverage. Use before merging any AI-generated code, before production deployments, or when maximum confidence is required.
3
3
  required-skills: all domain skills auto-loaded
4
4
  ---
5
5
 
6
- # /tribunal-full — Complete 19-Reviewer Audit
6
+ # /tribunal-full — Complete 20-Reviewer Audit
7
7
 
8
8
  $ARGUMENTS
9
9
 
@@ -32,7 +32,7 @@ Read BEFORE full review:
32
32
 
33
33
  ---
34
34
 
35
- ## 19 Reviewers — All Active Simultaneously
35
+ ## 20 Reviewers — All Active Simultaneously
36
36
 
37
37
  ```
38
38
  Tier 1: Always active (universal concerns)
@@ -44,6 +44,7 @@ Tier 1: Always active (universal concerns)
44
44
  Tier 2: Code quality
45
45
  ā”œā”€ā”€ dependency-reviewer → Fabricated packages, supply chain, version compatibility
46
46
  ā”œā”€ā”€ type-safety-reviewer → 'any' epidemic, Zod parse vs cast, unguarded access
47
+ ā”œā”€ā”€ complexity-reviewer → Enforces the Dependency Ladder to prevent over-engineering
47
48
  ā”œā”€ā”€ schema-reviewer → Missing input validation, loose schemas, raw req.body
48
49
  └── sql-reviewer → Injection, N+1, missing indexes, unscoped mutations
49
50
 
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  [![NPM](https://img.shields.io/npm/v/tribunal-kit?style=for-the-badge&logo=npm&logoColor=white&color=ff1637)](https://www.npmjs.com/package/tribunal-kit)
14
14
  [![License](https://img.shields.io/badge/License-MIT-1a1a1a?style=for-the-badge)](LICENSE)
15
- [![Version](https://img.shields.io/badge/Version-5.8.0-1a1a1a?style=for-the-badge)](CHANGELOG.md)
15
+ [![Version](https://img.shields.io/badge/Version-5.8.1-1a1a1a?style=for-the-badge)](CHANGELOG.md)
16
16
  [![MCP](https://img.shields.io/badge/MCP-Ready-ccff00?style=for-the-badge&logo=openai&logoColor=1a1a1a)](mcp_config.json)
17
17
  [![Code Quality](https://img.shields.io/badge/Hallucination_Mitigation-ff1637?style=for-the-badge)](AGENT_FLOW.md)
18
18
  [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y6C122DUQJ)
@@ -23,13 +23,30 @@
23
23
 
24
24
  > [!IMPORTANT]
25
25
  > **AI GENERATES CODE. TRIBUNAL ENSURES IT WORKS.**
26
- > A zero-bloat `.agent/` intelligence payload that upgrades your IDE with **43 specialist agents**, **34 workflows**, and a **19-reviewer Tribunal pipeline**. Maximizes execution reliability and heavily mitigates hallucinations.
26
+ > A zero-bloat `.agent/` intelligence payload and **Model Context Protocol (MCP) server** that upgrades your IDE (**Cursor**, **VSCode**, **Windsurf**) and terminal AI coding assistants (**Claude Code**, **Aider**) with **43 specialist agents**, **34 workflows**, and a parallel **20-reviewer Tribunal pipeline**. Maximizes execution reliability, optimizes context windows, and heavily mitigates AI code hallucinations.
27
27
 
28
28
  <br>
29
29
  <hr style="border: 1px solid #222; margin: 40px 0;">
30
30
  <br>
31
31
 
32
- ## šŸš€ QUICK START
32
+ ## šŸ“‹ Table of Contents
33
+
34
+ - [šŸš€ Quick Start — Setting Up your AI Agent Code Review Engine](#-quick-start--setting-up-your-ai-agent-code-review-engine)
35
+ - [⚔ State-of-the-Art Performance (Tokio Rust Core)](#-state-of-the-art-performance-tokio-rust-core)
36
+ - [āš”ļø The Command Arsenal — Swarms & Agentic Workflows](#ļø-the-command-arsenal--swarms--agentic-workflows)
37
+ - [šŸ’» CLI Command Reference](#-cli-command-reference)
38
+ - [āš–ļø The Tribunal Pipeline — Mitigating AI Code Hallucinations](#ļø-the-tribunal-pipeline--mitigating-ai-code-hallucinations)
39
+ - [šŸ›ļø The Supreme Court Case Law Engine — Persistent Memory for AI Coding](#ļø-the-supreme-court-case-law-engine--persistent-memory-for-ai-coding)
40
+ - [šŸƒ The Marathon Harness — Long-Running Autonomous AI Agents](#-the-marathon-harness--long-running-autonomous-ai-agents)
41
+ - [🧠 Advanced Capabilities & System Prompt Rules (v5.8)](#-advanced-capabilities--system-prompt-rules-v58)
42
+ - [šŸ”Œ Model Context Protocol (MCP) Server for Cursor, VSCode & Windsurf](#-model-context-protocol-mcp-server-for-cursor-vscode--windsurf)
43
+ - [ā“ Frequently Asked Questions (FAQ)](#-frequently-asked-questions-faq)
44
+
45
+ <br>
46
+ <hr style="border: 1px solid #222; margin: 40px 0;">
47
+ <br>
48
+
49
+ ## šŸš€ Quick Start — Setting Up your AI Agent Code Review Engine
33
50
 
34
51
  Drop Tribunal into any existing project to instantly weaponize your IDE.
35
52
 
@@ -53,7 +70,7 @@ Tribunal Kit breaks out of the IDE with first-class support for terminal-based A
53
70
  <hr style="border: 1px solid #222; margin: 40px 0;">
54
71
  <br>
55
72
 
56
- ## ⚔ STATE-OF-THE-ART PERFORMANCE (v5.0)
73
+ ## ⚔ State-of-the-Art Performance (Tokio Rust Core)
57
74
 
58
75
  Tribunal-Kit v5 is rebuilt from the ground up to be blazingly fast. We've eliminated initialization latency and blocking I/O:
59
76
 
@@ -67,7 +84,7 @@ Tribunal-Kit v5 is rebuilt from the ground up to be blazingly fast. We've elimin
67
84
  <hr style="border: 1px solid #222; margin: 40px 0;">
68
85
  <br>
69
86
 
70
- ## āš”ļø THE COMMAND ARSENAL
87
+ ## āš”ļø The Command Arsenal — Swarms & Agentic Workflows
71
88
 
72
89
  | Workflow Command | Operational Scope |
73
90
  | :------------------------ | :----------------------------------------------------------------------- |
@@ -75,7 +92,7 @@ Tribunal-Kit v5 is rebuilt from the ground up to be blazingly fast. We've elimin
75
92
  | <kbd>/create</kbd> | Scaffold major applications via App Builder routing. |
76
93
  | <kbd>/enhance</kbd> | Safely extend existing codebases with zero regression. |
77
94
  | <kbd>/swarm</kbd> | Fan-out orchestrator. Dispatch isolated workers, synthesize output. |
78
- | <kbd>/tribunal-full</kbd> | Unleash **ALL 19** domain reviewers simultaneously for maximum scrutiny. |
95
+ | <kbd>/tribunal-full</kbd> | Unleash **ALL 20** domain reviewers simultaneously for maximum scrutiny. |
79
96
  | <kbd>/debug</kbd> | Systematic 4-phase root-cause investigation. No guessing. |
80
97
  | <kbd>/ui-ux-pro-max</kbd> | Advanced visual aesthetic engine. No generic AI slop. |
81
98
 
@@ -83,7 +100,98 @@ Tribunal-Kit v5 is rebuilt from the ground up to be blazingly fast. We've elimin
83
100
  <hr style="border: 1px solid #222; margin: 40px 0;">
84
101
  <br>
85
102
 
86
- ## āš–ļø THE PIPELINE // EVIDENCE-BASED CLOSEOUT
103
+ ## šŸ’» CLI Command Reference
104
+
105
+ You can run Tribunal commands using `npx tribunal-kit <command>` (or the short alias `tk <command>` if installed globally/locally).
106
+
107
+ ### Core Commands
108
+ * **`init`**: Initialize the `.agent/` configuration payload in the current directory.
109
+ ```bash
110
+ npx tribunal-kit init [--force] [--path <dir>] [--minimal] [--dry-run]
111
+ ```
112
+ * **`status`**: Check the status and integrity of the `.agent/` directory.
113
+ ```bash
114
+ npx tribunal-kit status
115
+ ```
116
+ * **`update`**: Re-install or refresh to pull the latest agent configurations into the project.
117
+ ```bash
118
+ npx tribunal-kit update
119
+ ```
120
+ * **`sync`**: Instantly synchronize the latest `.agent` rules directly with local IDE config files (Cursor, Windsurf, Copilot, VSCode, Gemini).
121
+ ```bash
122
+ npx tribunal-kit sync
123
+ ```
124
+ * **`hook`**: Install or configure Git `pre-push` hooks to auto-sync rules on push.
125
+ ```bash
126
+ npx tribunal-kit hook
127
+ ```
128
+ * **`compile`**: Compile static context rules into a `.tribunal-compiled.md` file for terminal agents.
129
+ ```bash
130
+ npx tribunal-kit compile
131
+ ```
132
+ * **`uninstall`**: Cleanly remove `.agent/` from the target project.
133
+ ```bash
134
+ npx tribunal-kit uninstall [--path <dir>]
135
+ ```
136
+
137
+ ### Case Law Engine (`case`)
138
+ Manage the Supreme Court Case Law database to prevent AI hallucinations.
139
+ * **`case add`**: Interactively record a new AI mistake/precedent.
140
+ * **`case list`**: List all recorded precedence entries.
141
+ * **`case search "<query>"`**: Search historical cases.
142
+ * **`case show --id <id>`**: Show details of a specific case.
143
+ * **`case stats`**: Display statistics on case counts and types.
144
+ * **`case export`**: Export database to a readable `.agent/history/case-law/CASE_LAW.md`.
145
+ * **`case overrule --id <id>`**: Remove/overrule a case entry.
146
+
147
+ ### Memory Engine (`memory`)
148
+ Manage the 4-Type Taxonomy Persistent Memory Engine.
149
+ * **`memory store`**: Store a tagged memory (`semantic`, `procedural`, `episodic`, or `working`).
150
+ ```bash
151
+ npx tribunal-kit memory store --type semantic --content "Uses PostgreSQL" --tags "db"
152
+ ```
153
+ * **`memory recall`**: Recall budget-gated memories.
154
+ ```bash
155
+ npx tribunal-kit memory recall --query "postgres" --budget 1000
156
+ ```
157
+ * **`memory gc`**: Garbage collect expired episodic and all working memories.
158
+ * **`memory stats`**: Show memory index statistics.
159
+ * **`memory export`**: Export the human-readable `MEMORY.md` index projection.
160
+
161
+ ### Codebase Graphs & Context
162
+ * **`graph`**: Analyze codebase dependencies, generate architecture graphs, and build context snapshots.
163
+ ```bash
164
+ npx tribunal-kit graph
165
+ ```
166
+ * **`context <file>`**: Read and inspect a specific context snapshot for a given file.
167
+ ```bash
168
+ npx tribunal-kit context src/utils.js
169
+ ```
170
+ * **`mutate <file> "<test-cmd>"`**: Run mutation testing on a file to verify test suite robustness.
171
+ ```bash
172
+ npx tribunal-kit mutate src/utils.js "npm test"
173
+ ```
174
+
175
+ ### Learning & Evolving
176
+ * **`learn`**: Evolve your project's custom skills and architectural idioms by reading git diffs.
177
+ ```bash
178
+ npx tribunal-kit learn [--dry-run] [--head]
179
+ ```
180
+
181
+ ### Marathon Long-Running Harness (`marathon`)
182
+ Run long-running, multi-session tasks tracked inside the feature DAG.
183
+ * **`marathon init "<spec>"`**: Start a new long-running task.
184
+ * **`marathon status`**: Show interactive progress dashboard.
185
+ * **`marathon next`**: Print next incomplete feature task.
186
+ * **`marathon mark <id> <pass|fail>`**: Mark a specific feature status.
187
+ * **`marathon log "<note>"`**: Append a progress log.
188
+ * **`marathon session-start` / `session-end`**: Manage session contexts.
189
+
190
+ <br>
191
+ <hr style="border: 1px solid #222; margin: 40px 0;">
192
+ <br>
193
+
194
+ ## āš–ļø The Tribunal Pipeline — Mitigating AI Code Hallucinations
87
195
 
88
196
  Code generation is solved. **Code correctness is the frontier.**
89
197
 
@@ -96,7 +204,7 @@ graph TD
96
204
  C -.->|Failed| E[Maker Auto-Correction]
97
205
  E -.-> C
98
206
 
99
- D -->|19 Domain Reviewers| F[Human Gate]
207
+ D -->|20 Domain Reviewers| F[Human Gate]
100
208
  F -->|Approved| G((Committed to Disk))
101
209
 
102
210
  classDef default fill:#1a1a1a,stroke:#333,stroke-width:2px,color:#fff;
@@ -111,7 +219,7 @@ graph TD
111
219
  <hr style="border: 1px solid #222; margin: 40px 0;">
112
220
  <br>
113
221
 
114
- ## šŸ›ļø THE SUPREME COURT (CASE LAW ENGINE)
222
+ ## šŸ›ļø The Supreme Court Case Law Engine — Persistent Memory for AI Coding
115
223
 
116
224
  The Tribunal Kit features persistent memory. The AI **never makes the same mistake twice** and auto-learns your engineering culture.
117
225
 
@@ -129,7 +237,7 @@ The Tribunal Kit features persistent memory. The AI **never makes the same mista
129
237
  <hr style="border: 1px solid #222; margin: 40px 0;">
130
238
  <br>
131
239
 
132
- ## šŸƒ THE MARATHON HARNESS (v4.4+)
240
+ ## šŸƒ The Marathon Harness — Long-Running Autonomous AI Agents
133
241
 
134
242
  The **Marathon Harness** is an engine designed to keep autonomous agents on track during long-running, multi-session projects without looping or losing context.
135
243
 
@@ -160,7 +268,7 @@ The **Marathon Harness** is an engine designed to keep autonomous agents on trac
160
268
  <hr style="border: 1px solid #222; margin: 40px 0;">
161
269
  <br>
162
270
 
163
- ## 🧠 ADVANCED CAPABILITIES (v5.8)
271
+ ## 🧠 Advanced Capabilities & System Prompt Rules (v5.8)
164
272
 
165
273
  The 5.8 update introduces a massive leap in long-running agent capabilities and code correctness:
166
274
 
@@ -173,7 +281,7 @@ The 5.8 update introduces a massive leap in long-running agent capabilities and
173
281
  <hr style="border: 1px solid #222; margin: 40px 0;">
174
282
  <br>
175
283
 
176
- ## šŸ”Œ NATIVE MCP SERVER
284
+ ## šŸ”Œ Model Context Protocol (MCP) Server for Cursor, VSCode & Windsurf
177
285
 
178
286
  Tribunal-Kit functions as a standalone **Model Context Protocol (MCP)** server via `stdio`.
179
287
 
@@ -184,6 +292,24 @@ Bind your AI IDE directly to `tribunal-kit` to unlock autonomous tool execution:
184
292
  - `sync_ide_bridges`: Force rule alignment directly from the AI chat.
185
293
  - `list_tribunal_agents` & `get_tribunal_skill`: Terminal agents can dynamically fetch specific skills without overloading their context windows.
186
294
 
295
+ <br>
296
+ <hr style="border: 1px solid #222; margin: 40px 0;">
297
+ <br>
298
+
299
+ ## ā“ Frequently Asked Questions (FAQ)
300
+
301
+ ### How does Tribunal-Kit prevent AI hallucinations?
302
+ Tribunal-Kit introduces a systematic, multi-reviewer pipeline called the **Tribunal Review**. When an AI agent generates code, it routes that code through up to 20 specialized domain reviewers (e.g., security, logic, schema) and verifies it against local tests and lint rules before presenting it to the developer.
303
+
304
+ ### Which IDEs and AI tools are supported by Tribunal-Kit?
305
+ Tribunal-Kit natively supports and automatically syncs rules with **Cursor**, **Windsurf**, **VSCode**, **Gemini**, **Copilot**, and **Claude Desktop**. It also supports terminal-based agents like **Claude Code**, **Aider**, and **OpenCode** via Model Context Protocol (MCP) or compiled static context files.
306
+
307
+ ### How do I connect Claude Code or Aider to Tribunal-Kit via MCP?
308
+ Tribunal-Kit includes a built-in Model Context Protocol (MCP) server. You can configure your AI assistant (like Claude Desktop or Claude Code) to spawn `node bin/wrapper.js` as an MCP server. This allows the AI agent to dynamically fetch custom skills, search the local case law precedence database, and run audits on demand.
309
+
310
+ ### What is the Supreme Court Case Law Engine?
311
+ It is a local, lightweight database that records past AI mistakes as legal precedent. Before code generation is committed, the `precedence-reviewer` queries this database to prevent the AI from repeating known codebase anti-patterns.
312
+
187
313
  <br>
188
314
  <br>
189
315
 
package/bin/mcp-server.js CHANGED
@@ -272,6 +272,21 @@ function handleRequest(req) {
272
272
  additionalProperties: false,
273
273
  },
274
274
  },
275
+ {
276
+ name: "align_output",
277
+ description: "Align model outputs to Fabel-5 constraints: strips conversational introductions and conclusions, collapses single/double bullet items to prose, and checks for code traps (unawaited dynamic functions in Next.js 15, deprecated hooks in React 19, or non-existent models).",
278
+ inputSchema: {
279
+ type: "object",
280
+ properties: {
281
+ text: {
282
+ type: "string",
283
+ description: "The raw output text generated by the model to be aligned.",
284
+ },
285
+ },
286
+ required: ["text"],
287
+ additionalProperties: false,
288
+ },
289
+ },
275
290
  ],
276
291
  };
277
292
  }
@@ -455,6 +470,29 @@ function handleRequest(req) {
455
470
  }
456
471
  }
457
472
 
473
+ if (toolName === "align_output") {
474
+ const text = req.params?.arguments?.text;
475
+ if (typeof text !== "string") {
476
+ throw { code: -32602, message: "Missing or invalid required argument: text (string)" };
477
+ }
478
+ try {
479
+ const { alignText, validateCodeContent } = require("../dist/commands/align.js");
480
+ const aligned = alignText(text);
481
+ const warnings = validateCodeContent(aligned);
482
+
483
+ let outputText = aligned;
484
+ if (warnings.length > 0) {
485
+ outputText += "\n\nāš ļø OCAE Alignment Validator Warnings:\n";
486
+ for (const warnMsg of warnings) {
487
+ outputText += `ā— ${warnMsg}\n`;
488
+ }
489
+ }
490
+ return { content: [{ type: "text", text: outputText }] };
491
+ } catch (e) {
492
+ return { content: [{ type: "text", text: `Alignment failed: ${e.message}` }] };
493
+ }
494
+ }
495
+
458
496
  throw { code: -32601, message: `Unknown tool: ${toolName}` };
459
497
  }
460
498
 
package/bin/wrapper.js CHANGED
@@ -20,12 +20,16 @@ const RUST_COMMANDS = new Set([
20
20
  "sync",
21
21
  "hook",
22
22
  "uninstall",
23
+ "memory",
23
24
  ]);
24
25
 
25
26
  // Determine the path to the compiled Rust binary
26
27
  // In a full production release, this checks optionalDependencies in node_modules
27
28
  // For development, it checks the local target/release folder
28
29
  function getBinaryPath() {
30
+ if (process.env.TRIBUNAL_FORCE_JS === "1") {
31
+ return null;
32
+ }
29
33
  const isWindows = os.platform() === "win32";
30
34
  const ext = isWindows ? ".exe" : "";
31
35
  const platform = os.platform();
@@ -77,7 +81,7 @@ function getBinaryPath() {
77
81
  function runRustBinary(binPath, args) {
78
82
  const stdio = [
79
83
  "inherit",
80
- process.stdout.isTTY ? "ignore" : "inherit",
84
+ "inherit",
81
85
  "inherit",
82
86
  ];
83
87
  const result = spawnSync(binPath, args, {
package/dist/cli.js CHANGED
@@ -46,6 +46,10 @@ function parseArgs(argv) {
46
46
  args.flags.skipUpdateCheck = true;
47
47
  continue;
48
48
  }
49
+ if (arg === '--write') {
50
+ args.flags.write = true;
51
+ continue;
52
+ }
49
53
  if (arg === '--head') {
50
54
  args.flags.head = true;
51
55
  continue;
@@ -96,6 +100,7 @@ function cmdHelp(quiet = false) {
96
100
  (0, logger_1.log)(cmd('mutate', 'Run the Mutation Engine to test test-suite reliability'));
97
101
  (0, logger_1.log)(cmd('context', 'Retrieve a highly-optimized Context Snapshot for a file'));
98
102
  (0, logger_1.log)(cmd('sync', 'Synchronize IDE bridge files with current rules'));
103
+ (0, logger_1.log)(cmd('align', 'Clean AI outputs (strip slop, collapse lists, validate code traps)'));
99
104
  (0, logger_1.log)(cmd('marathon', 'Long-running agent harness (init, status, next, mark)'));
100
105
  (0, logger_1.log)(cmd('hook', 'Install pre-push git hook for auto-learning'));
101
106
  (0, logger_1.log)(cmd('compile', 'Compile rules into a static instruction file for terminal agents'));
@@ -113,6 +118,7 @@ function cmdHelp(quiet = false) {
113
118
  (0, logger_1.log)(opt('--minimal', 'Install core agents/skills only (~13 agents)'));
114
119
  (0, logger_1.log)(opt('--skip-update-check', 'Skip auto-update version check'));
115
120
  (0, logger_1.log)(opt('--head', '(learn) Diff against last commit instead of staged'));
121
+ (0, logger_1.log)(opt('--write', '(align) Write aligned output in-place to the target file'));
116
122
  console.log();
117
123
  (0, logger_1.log)((0, logger_1.bold)(' Aliases'));
118
124
  (0, logger_1.log)(` ${(0, logger_1.c)('gray', '─'.repeat(40))}`);
@@ -144,6 +150,8 @@ function cmdHelp(quiet = false) {
144
150
  (0, logger_1.log)(ex('tk marathon mark 5 pass'));
145
151
  (0, logger_1.log)(ex('tk hook'));
146
152
  (0, logger_1.log)(ex('tk compile'));
153
+ (0, logger_1.log)(ex('echo "Certainly! Here is - item 1" | tk align'));
154
+ (0, logger_1.log)(ex('tk align output.md --write'));
147
155
  (0, logger_1.log)(ex('tk memory store --type semantic --content "Uses PostgreSQL" --tags db,orm'));
148
156
  (0, logger_1.log)(ex('tk memory recall --query "database" --budget 2000'));
149
157
  (0, logger_1.log)(ex('tk memory gc'));
@@ -221,6 +229,11 @@ async function runWithUpdateCheck(command, flags) {
221
229
  await cmdSync();
222
230
  break;
223
231
  }
232
+ case 'align': {
233
+ const cmdAlign = loadCmd('./commands/align', 'cmdAlign');
234
+ await cmdAlign(flags, process.argv, quiet);
235
+ break;
236
+ }
224
237
  case 'marathon': {
225
238
  const cmdMarathon = loadCmd('./commands/marathon', 'cmdMarathon');
226
239
  await cmdMarathon(flags, process.argv, quiet);