tribunal-kit 9.2.6 → 9.2.7

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.
Files changed (63) hide show
  1. package/.agent/ARCHITECTURE.md +2 -2
  2. package/.agent/history/architecture-intelligence.html +1487 -401
  3. package/.agent/history/architecture-model.json +9365 -5697
  4. package/.agent/history/architecture-verification.json +37 -9
  5. package/.agent/routing_index.json +2069 -3340
  6. package/.agent/rules/GEMINI.md +1 -1
  7. package/.agent/scripts/adaptive_execution.js +511 -0
  8. package/.agent/scripts/architecture_diff.js +303 -260
  9. package/.agent/scripts/architecture_extractor.js +792 -753
  10. package/.agent/scripts/architecture_health.js +293 -256
  11. package/.agent/scripts/architecture_intelligence.js +3100 -0
  12. package/.agent/scripts/architecture_verifier.js +303 -270
  13. package/.agent/scripts/architecture_visualizer.js +880 -873
  14. package/.agent/scripts/blast_radius_engine.js +274 -234
  15. package/.agent/scripts/capability_evolution.js +453 -0
  16. package/.agent/scripts/concept_extractor.js +240 -0
  17. package/.agent/scripts/consideration_engine.js +284 -0
  18. package/.agent/scripts/coverage_engine.js +102 -0
  19. package/.agent/scripts/cross_domain_engine.js +1883 -0
  20. package/.agent/scripts/engineering_memory.js +1313 -0
  21. package/.agent/scripts/integrity_manifest.js +1 -5
  22. package/.agent/scripts/judgment_engine.js +790 -0
  23. package/.agent/scripts/materiality_engine.js +251 -0
  24. package/.agent/scripts/outcome_engine.js +624 -0
  25. package/.agent/scripts/outcome_optimization_engine.js +1632 -0
  26. package/.agent/scripts/simulation_engine.js +1478 -0
  27. package/.agent/scripts/skill_intelligence.js +1371 -0
  28. package/.agent/scripts/validation_engine.js +236 -236
  29. package/.agent/scripts/verification_auditor.js +266 -0
  30. package/.agent/skill-intelligence/taxonomy/engineering-concepts.json +555 -0
  31. package/.agent/skill_topic_map.json +301 -341
  32. package/.agent/skills_inventory.json +4272 -6922
  33. package/.agent/workflows/arch.md +96 -80
  34. package/.agent/workflows/skill-intelligence.md +216 -0
  35. package/CONTRIBUTING.md +2 -2
  36. package/README.md +24 -24
  37. package/bin/adapter-install.js +1 -1
  38. package/package.json +8 -9
  39. package/plugins/core-plugin.json +1 -1
  40. package/plugins/gemini/extension.json +1 -1
  41. package/src/browser/index.js +2 -1
  42. package/src/browser/launcher.js +41 -1
  43. package/src/cli.js +3 -1
  44. package/src/commands/arch.js +261 -172
  45. package/src/commands/context.js +27 -8
  46. package/src/commands/learn.js +21 -6
  47. package/src/commands/memory.js +10 -1
  48. package/src/commands/native.js +12 -3
  49. package/src/commands/skill-intelligence.js +1165 -0
  50. package/src/commands/system1.js +105 -4
  51. package/src/context/ranker.js +337 -339
  52. package/src/evolution/engine.js +296 -295
  53. package/src/synthesis/claim_check_separator.js +294 -271
  54. package/src/system1/browser_intelligence.js +300 -0
  55. package/src/system1/constants.js +49 -0
  56. package/src/system1/decision_engine.js +498 -0
  57. package/src/system1/evidence_engine.js +602 -0
  58. package/src/system1/evolution_pipeline.js +581 -0
  59. package/src/system1/index.d.ts +114 -0
  60. package/src/system1/index.js +102 -0
  61. package/src/system1/reviewer_orchestrator.js +477 -0
  62. package/src/tui/banner.js +1 -1
  63. package/src/utils/fs.js +27 -0
@@ -1,80 +1,96 @@
1
- ---
2
- description: Tribunal Architecture Intelligence — Autonomous architecture extraction, zero-trust verification, blast radius simulation, semantic diffing, and health auditing.
3
- ---
4
-
5
- # /arch — Tribunal Architecture Intelligence
6
-
7
- Execute deterministic architecture intelligence, verification, and blast radius simulation.
8
-
9
- ## Overview
10
- Unlike superficial diagramming tools that only generate static pictures, `/arch` treats architecture as an **executable, verifiable Evidence Graph**.
11
-
12
- ```
13
- SOURCE CODE
14
- ↓ (AST & pattern extraction)
15
- FACT MODEL (.agent/history/architecture-model.json)
16
- ↓ (Zero-trust provenance verification)
17
- CONFIDENCE & CONTRADICTION GATES (L1-L5)
18
- ↓ (Downstream dependency closure)
19
- BLAST RADIUS & RISK SIMULATION
20
- ↓ (Projections: Topology, Security, Failure, Impact)
21
- INTERACTIVE STANDALONE EXPLORER & AUDIT REPORT
22
- ```
23
-
24
- ---
25
-
26
- ## Subcommands
27
-
28
- ### 1. Extract Architectural Fact Model
29
- ```bash
30
- tk arch map
31
- # or: node .agent/scripts/architecture_extractor.js
32
- ```
33
- Scans repository AST, route definitions, database models, queues, events, and auth middleware. Emits the canonical `.agent/history/architecture-model.json`.
34
-
35
- ### 2. Zero-Trust Verification
36
- ```bash
37
- tk arch verify [--strict]
38
- # or: node .agent/scripts/architecture_verifier.js
39
- ```
40
- Verifies that all entity code locations, lines, symbols, and hashes match ground truth. Surfaces any architectural contradictions or drifted/stale evidence.
41
-
42
- ### 3. Change Blast Radius & Impact Simulation
43
- ```bash
44
- tk arch impact <component-id-or-file>
45
- # or: node .agent/scripts/blast_radius_engine.js <query>
46
- ```
47
- Simulates the impact of changing a component: direct callers, transitive dependents across concentric depth rings, impacted API routes, affected test suites, and risk tier (LOW/MEDIUM/HIGH/CRITICAL).
48
-
49
- ### 4. Semantic Architecture Diff (PR Gate)
50
- ```bash
51
- tk arch diff <base-model.json> <head-model.json>
52
- # or: node .agent/scripts/architecture_diff.js <base> <head>
53
- ```
54
- Calculates true architectural shifts:
55
- - Trust boundaries crossed (e.g. public route directly accessing isolated database)
56
- - Resilience regressions (e.g. timeouts removed from external API calls)
57
- - Blast radius expansions (components whose downstream impact grew >25%)
58
- - New external SaaS/cloud dependencies introduced
59
-
60
- ### 5. Architectural Health Audit
61
- ```bash
62
- tk arch audit
63
- # or: node .agent/scripts/architecture_health.js
64
- ```
65
- Audits structural risks:
66
- - Circular dependencies (exact cycle chains)
67
- - Single Points of Failure (SPOFs / High Fan-In bottlenecks)
68
- - Excessive Coupling (God Modules / High Fan-Out)
69
- - Test coverage gaps on critical components
70
-
71
- ### 6. Multi-Projection Interactive Explorer
72
- ```bash
73
- tk arch project [--open]
74
- # or: node .agent/scripts/architecture_visualizer.js
75
- ```
76
- Generates a zero-dependency, standalone HTML explorer at `.agent/history/architecture-intelligence.html` with 4 interactive projections:
77
- 1. **Topology**: Services, routes, datastores, queues
78
- 2. **Security**: Trust zones & authentication gates
79
- 3. **Failure Modes**: Timeouts, retries, fallbacks
80
- 4. **Blast Radius Simulator**: Click any node to visualize live concentric blast rings
1
+ ---
2
+ description: Tribunal Architecture Intelligence — Autonomous architecture extraction, zero-trust verification, blast radius simulation, semantic diffing, and health auditing.
3
+ ---
4
+
5
+ # /arch — Tribunal Architecture Intelligence
6
+
7
+ Execute deterministic architecture intelligence, verification, and blast radius simulation.
8
+
9
+ ## Overview
10
+
11
+ Unlike superficial diagramming tools that only generate static pictures, `/arch` treats architecture as an **executable, verifiable Evidence Graph**.
12
+
13
+ ```
14
+ SOURCE CODE
15
+ ↓ (AST & pattern extraction)
16
+ FACT MODEL (.agent/history/architecture-model.json)
17
+ ↓ (Zero-trust provenance verification)
18
+ CONFIDENCE & CONTRADICTION GATES (L1-L5)
19
+ ↓ (Downstream dependency closure)
20
+ BLAST RADIUS & RISK SIMULATION
21
+ ↓ (Projections: Topology, Security, Failure, Impact)
22
+ INTERACTIVE STANDALONE EXPLORER & AUDIT REPORT
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Subcommands
28
+
29
+ ### 1. Extract Architectural Fact Model
30
+
31
+ ```bash
32
+ tk arch map
33
+ # or: node .agent/scripts/architecture_extractor.js
34
+ ```
35
+
36
+ Scans repository AST, route definitions, database models, queues, events, and auth middleware. Emits the canonical `.agent/history/architecture-model.json`.
37
+
38
+ ### 2. Zero-Trust Verification
39
+
40
+ ```bash
41
+ tk arch verify [--strict]
42
+ # or: node .agent/scripts/architecture_verifier.js
43
+ ```
44
+
45
+ Verifies that all entity code locations, lines, symbols, and hashes match ground truth. Surfaces any architectural contradictions or drifted/stale evidence.
46
+
47
+ ### 3. Change Blast Radius & Impact Simulation
48
+
49
+ ```bash
50
+ tk arch impact <component-id-or-file>
51
+ # or: node .agent/scripts/blast_radius_engine.js <query>
52
+ ```
53
+
54
+ Simulates the impact of changing a component: direct callers, transitive dependents across concentric depth rings, impacted API routes, affected test suites, and risk tier (LOW/MEDIUM/HIGH/CRITICAL).
55
+
56
+ ### 4. Semantic Architecture Diff (PR Gate)
57
+
58
+ ```bash
59
+ tk arch diff <base-model.json> <head-model.json>
60
+ # or: node .agent/scripts/architecture_diff.js <base> <head>
61
+ ```
62
+
63
+ Calculates true architectural shifts:
64
+
65
+ - Trust boundaries crossed (e.g. public route directly accessing isolated database)
66
+ - Resilience regressions (e.g. timeouts removed from external API calls)
67
+ - Blast radius expansions (components whose downstream impact grew >25%)
68
+ - New external SaaS/cloud dependencies introduced
69
+
70
+ ### 5. Architectural Health Audit
71
+
72
+ ```bash
73
+ tk arch audit
74
+ # or: node .agent/scripts/architecture_health.js
75
+ ```
76
+
77
+ Audits structural risks:
78
+
79
+ - Circular dependencies (exact cycle chains)
80
+ - Single Points of Failure (SPOFs / High Fan-In bottlenecks)
81
+ - Excessive Coupling (God Modules / High Fan-Out)
82
+ - Test coverage gaps on critical components
83
+
84
+ ### 6. Multi-Projection Interactive Explorer
85
+
86
+ ```bash
87
+ tk arch project [--open]
88
+ # or: node .agent/scripts/architecture_visualizer.js
89
+ ```
90
+
91
+ Generates a zero-dependency, standalone HTML explorer at `.agent/history/architecture-intelligence.html` with 4 interactive projections:
92
+
93
+ 1. **Topology**: Services, routes, datastores, queues
94
+ 2. **Security**: Trust zones & authentication gates
95
+ 3. **Failure Modes**: Timeouts, retries, fallbacks
96
+ 4. **Blast Radius Simulator**: Click any node to visualize live concentric blast rings
@@ -0,0 +1,216 @@
1
+ ---
2
+ description: Autonomous Skill Intelligence Engine for Tribunal Kit. Discover, compose, gate, and verify capabilities across 235+ engineering skills. Enforces Discover First, Compose Second, Create Only When Necessary, Verify Always.
3
+ tools: Read, Grep, Glob, Bash, Edit, Write
4
+ version: 1.0.0
5
+ last-updated: 2026-10-01
6
+ required-skills:
7
+ - agent-organizer
8
+ - skill-creator
9
+ - clean-code
10
+ scripts-binding:
11
+ - .agent/scripts/skill_intelligence.js
12
+ - .agent/scripts/swarm_dispatcher.js
13
+ - .agent/scripts/verify_all.js
14
+ ---
15
+
16
+ # /skill-intelligence — Tribunal Skill Intelligence Engine
17
+
18
+ ```text
19
+ DISCOVER FIRST.
20
+ COMPOSE SECOND.
21
+ CREATE ONLY WHEN NECESSARY.
22
+ VERIFY ALWAYS.
23
+ ```
24
+
25
+ The Skill Intelligence Engine determines the minimal sufficient set of capabilities required to produce a robust, production-grade outcome for any task without unnecessary skill generation or redundant analysis.
26
+
27
+ ---
28
+
29
+ ## Operating Protocol
30
+
31
+ ### Phase 1 — Discovery (Broad Search)
32
+
33
+ Before writing or changing code:
34
+
35
+ 1. Parse explicit user requirements and desired outcome.
36
+ 2. Extract technical concepts, implicit constraints, and likely failure modes.
37
+ 3. Discover existing skills in the 235+ repository (`node .agent/scripts/skill_intelligence.js --query "<task>"`).
38
+ 4. Evaluate relevance:
39
+ - **MANDATORY**: Critical safety, correctness, or transaction requirements.
40
+ - **RECOMMENDED**: Observability, performance, or hygiene additions.
41
+ - **OPTIONAL**: Ancillary optimizations.
42
+ - **IRRELEVANT**: Discard.
43
+
44
+ ### Phase 2 — Concept & Engineering Consideration Extraction
45
+
46
+ 1. Extract explicit and implicit concepts from the 35-category taxonomy.
47
+ 2. Formulate the **Engineering Consideration Matrix**:
48
+ - Categorize by severity: `[CRITICAL]`, `[HIGH]`, `[MEDIUM]`, `[LOW]`.
49
+ - Surface cross-domain risks (e.g. distributed transactions, concurrency race conditions, prompt injection).
50
+ - Enforce **The Consideration Invariant**: _Knowledge Availability ≠ Consideration Coverage_.
51
+
52
+ ### Phase 3 — Skill Coverage & Composition (Pipeline DAG)
53
+
54
+ 1. Measure concept-to-skill coverage: `FULL`, `PARTIAL`, or `NONE`.
55
+ 2. Automatically promote candidate skills into the execution pipeline DAG.
56
+ 3. Build an ordered execution DAG (e.g. Contract → Validation → State/DB → Logic → Tests → Security).
57
+ 4. Establish a **shared task context** (AST nodes, schema models, API types) to eliminate duplicate passes.
58
+
59
+ ### Phase 4 — Creation Gate (The 11-Point Audit)
60
+
61
+ A new skill may **only** be created if all 11 checks pass:
62
+
63
+ - [x] Existing skill searched
64
+ - [x] Semantic matches searched
65
+ - [x] Related skills checked
66
+ - [x] Composition attempted & proved insufficient
67
+ - [x] Duplicate capability checked
68
+ - [x] Material capability gap confirmed
69
+ - [x] Long-term reusability justified
70
+ - [x] Concept coverage checked
71
+ - [x] Failure-mode coverage checked
72
+ - [x] Verification capability checked
73
+ - [x] Existing skill improvement evaluated
74
+ _Decision Hierarchy: USE → COMPOSE → IMPROVE → EXTEND → CREATE._
75
+
76
+ ### Phase 5 — Materiality Engine & Outcome Contract Generation
77
+
78
+ 1. Evaluate each discovered consideration as `MATERIAL`, `NON_MATERIAL`, or `OPTIONAL` with technical rationale.
79
+ 2. Enforce **Minimum Sufficient Engineering** to prevent overengineering and respect the **Outcome Budget**.
80
+ 3. Generate the formal **Outcome Contract** specifying:
81
+ - Objective & Constraints
82
+ - Material Considerations & Tailored Quality Attributes
83
+ - Success Conditions (e.g. single side-effect under duplicate retries)
84
+ - Non-Goals (explicit anti-overengineering bounds)
85
+
86
+ ### Phase 6 — Verification, Post-Implementation Outcome Audit & Regression Analysis
87
+
88
+ 1. Execute concept-aligned verification tests (idempotency safety, atomic rollbacks, concurrency locks).
89
+ 2. Execute post-execution outcome audit via `auditOutcome`:
90
+ - Categorize outcome into `satisfied`, `partially_satisfied`, `unsatisfied`, `unverified`, `new_risks`, `unnecessary_complexity`.
91
+ - Distinguish **Task Completion** (code exists / tests pass) from **Outcome Completion** (all material considerations satisfied, zero regressions, zero overengineering).
92
+ 3. Analyze systemic architectural decisions via `detectTradeoffs` (e.g. Concurrency Locking vs Throughput/Latency).
93
+ 4. Guard against regressions via `evaluateOutcomeRegression`:
94
+ - Enforce: _A fix is only an improvement if the overall outcome improves_.
95
+ 5. Emit structured corrective actions and re-verify before declaring completion.
96
+
97
+ ### Phase 7 — Engineering Judgment, Uncertainty & Adaptive Execution
98
+
99
+ 1. Evaluate evidence across the 8-tier **Evidence Hierarchy** (Runtime > Tests > Static > Benchmarks > Repo > Config > Docs > Model).
100
+ 2. Track explicit **Uncertainty** (`verified`, `assumed`, `inferred`, `unknown`, `contradicted`) and calculate **Expected Information Value** before launching expensive investigations.
101
+ 3. Manage execution state transitions via the **Engineering Judgment State Machine** (`PROCEED`, `INVESTIGATE`, `REPLAN`, `CORRECT`, `ESCALATE`, `DEFER`, `STOP`, `COMPLETE`).
102
+ 4. Classify **Reversibility** and block irreversible operations (data drops, breaking API changes) using the **Escalation Engine**.
103
+ 5. Detect **Requirement Conflicts** (e.g. CAP / PACELC bounds, Low Cost vs Multi-Region, Caching vs Freshness) and surface them explicitly.
104
+ 6. Support **Dynamic Capability Graphs** (`DynamicCapabilityGraph`) to mutate pipelines (`ADD`, `REMOVE`, `REORDER`, `RETRY`, `SKIP`, `BRANCH`, `MERGE`) based on runtime signals (e.g. dynamic SSRF defense injection).
105
+ 7. Audit **Architectural Anti-Slop** to detect overengineering (premature microservices/Kafka) and underengineering (missing transaction boundaries/idempotency).
106
+
107
+ ### Phase 8 — Engineering Memory & Continuous Capability Evolution (Phase 5)
108
+
109
+ 1. Invariants:
110
+ - `SOLVE ONCE. VERIFY ONCE. LEARN ONCE. REUSE SAFELY.`
111
+ - `MEMORY MUST EARN TRUST THROUGH EVIDENCE.`
112
+ - `CURRENT EVIDENCE > STALE MEMORY.`
113
+ - `MEMORY → HYPOTHESIS → CURRENT EVIDENCE → DECISION.`
114
+ - `DO NOT REPEAT VERIFIED FAILURES. NEGATIVE KNOWLEDGE IS KNOWLEDGE.`
115
+ - `ZERO SILENT SELF-MODIFICATION.`
116
+ 2. Retrieve typed engineering memories (`pattern`, `failure`, `decision`, `verification`, `anti_pattern`, `skill_performance`, `concept_relationship`, `capability_gap`) as hypotheses.
117
+ 3. Validate contextual applicability to prevent false transfer across disparate technologies or scales.
118
+ 4. Promote verified hypotheses into considerations and enhance verification plans with proven strategies.
119
+ 5. Capture empirical failures into the negative knowledge vault so future executions avoid repeating them.
120
+ 6. Generate governed **Skill Improvement Proposals** (SIPs) when repeated weaknesses occur, requiring explicit human/governance approval.
121
+
122
+ ### Phase 9 — System Simulation & Pre-Mortem Intelligence (Phase 6)
123
+
124
+ 1. Core Invariants:
125
+ - `PREDICT BEFORE IMPLEMENTATION.`
126
+ - `IF A FAILURE CAN BE REASONED ABOUT BEFORE IMPLEMENTATION, IT SHOULD BE IDENTIFIED.`
127
+ - `PREDICTION IS NOT EVIDENCE. PREDICTION MUST BE VERIFIED.`
128
+ 2. Canonical 30-Category Failure Taxonomy:
129
+ - Evaluates Functional, Data Integrity, Concurrency, Distributed Systems, Network, Dependency, Security, Auth, Availability, Performance, Scalability, Capacity, Cost, Deployment, Configuration, Observability, Recovery, Human Error, Data Corruption, Consistency, Caching, Messaging, Storage, AI/Agent, Tool, and Supply Chain failures.
130
+ 3. Causal Failure Chain Modeling:
131
+ - Maps `Trigger → Propagation → Failure → Impact → Detection → Recovery` across multi-domain boundaries.
132
+ 4. Blast-Radius Analysis (8 Tiers):
133
+ - Categorizes potential fallout: `LOCAL`, `COMPONENT`, `SERVICE`, `WORKFLOW`, `DATASET`, `REGION`, `SYSTEM`, `MULTI_SYSTEM`.
134
+ 5. Multi-Domain Pre-Mortem Simulators:
135
+ - Dependencies (timeouts, partial/malformed responses, network partitions).
136
+ - Concurrency & Race Conditions (inventory decrement, double spend, lost updates).
137
+ - Retry Amplification & Storms (exponential backoff, jitter, idempotency violations).
138
+ - Queues & Poison Pills (message duplication, poison pill crash loops, lag).
139
+ - Database Failures (distinguishing slow-DB from dead-DB, connection pool exhaustion, replication lag).
140
+ - Cache Stampedes (thundering herd, cold starts, and cache-as-availability-dependency).
141
+ - Load, Capacity & Queueing Analysis (Little's Law arrival rate λ > μ service rate sustainability).
142
+ - Latency Budget (p50/p95/p99 tail latency decomposition).
143
+ - Security Pre-Mortem (SSRF, SQLi, command injection, auth bypass, privilege escalation).
144
+ - AI & Agent Failure Modes (hallucination, infinite loops, context poisoning, prompt injection).
145
+ - Runaway Cost Loops (agent retry spirals, token burn, high-cardinality telemetry).
146
+ - Deployment Version Skew & Rollback Failure (coexistence, schema drift).
147
+ - Chaos Scenario Generation (with strict sandbox/mock boundaries).
148
+ 6. Simulation Depth Hierarchy (Levels 0–5):
149
+ - LEVEL 0 (Static Reasoning) → LEVEL 1 (Architecture Simulation) → LEVEL 2 (Deterministic Test Simulation) → LEVEL 3 (Load Simulation) → LEVEL 4 (Fault Injection) → LEVEL 5 (Chaos Testing).
150
+ - Enforces **Minimum Sufficient Simulation Depth** proportional to task complexity and risk.
151
+ 7. Prediction Contract & Unsupported Claim Detection:
152
+ - Strict separation of unverified `PREDICTION` from empirical `FINDING`.
153
+ - Flags unsupported absolute claims ("exactly once", "impossible race conditions", "infinitely scalable").
154
+ 8. Post-Implementation Prediction vs Observed Verification:
155
+ - Compares predicted hazards against observed execution evidence (`VERIFIED` vs `DISPROVED`).
156
+ - Automatically stores verified outcomes into Phase 5 Engineering Memory to prevent regression.
157
+
158
+ ---
159
+
160
+ ## CLI Integration
161
+
162
+ ```bash
163
+ # Discover relevant concepts, considerations, skill coverage, and pipeline DAG
164
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with idempotency and retry"
165
+
166
+ # Surface relevant engineering memories, hypotheses, and failures to avoid
167
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with idempotency and retry" --memory
168
+
169
+ # Run Phase 6 Pre-Mortem & Simulation Analysis
170
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with idempotency and retry" --pre-mortem
171
+ tk pre-mortem "Build payment processing API with retries"
172
+
173
+ # Inspect Causal Failure Chains
174
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with retries" --chains
175
+ tk pre-mortem "Build payment API" --chains
176
+
177
+ # Detect Unsupported Architectural Claims
178
+ node .agent/scripts/skill_intelligence.js --query "Build API with guaranteed exactly once delivery and impossible race conditions" --claims
179
+ tk pre-mortem "Build API with guaranteed exactly once delivery" --claims
180
+
181
+ # Simulate Architecture against Pre-Mortem Engine
182
+ tk simulate --architecture architecture.json
183
+
184
+ # Compare Predictions against Observed Evidence and Update Engineering Memory
185
+ tk simulate --verify evidence.json
186
+
187
+ # Inspect historical failures and negative knowledge vault
188
+ node .agent/scripts/skill_intelligence.js --failures
189
+
190
+ # Inspect continuous capability improvement proposals
191
+ node .agent/scripts/skill_intelligence.js --proposals
192
+
193
+ # Inspect skill performance telemetry and precision ratios
194
+ node .agent/scripts/skill_intelligence.js --telemetry
195
+
196
+ # Inspect the formal Phase 3 Outcome Contract
197
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with idempotency and retry" --contract
198
+
199
+ # Inspect Phase 4 Engineering Judgment, Reversibility, and Requirement Conflicts
200
+ node .agent/scripts/skill_intelligence.js --query "Global API with < 50ms latency, strong cross-region consistency, and zero infrastructure cost" --judgment
201
+
202
+ # Run Architectural Anti-Slop Audit (detects overengineering / underengineering)
203
+ node .agent/scripts/skill_intelligence.js --query "Build simple static documentation website with kafka and kubernetes" --anti-slop
204
+
205
+ # Output machine-readable JSON (includes memories, outcome_contract, judgment, pre_mortem, and predictions)
206
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with idempotency and retry" --json
207
+
208
+ # Check if creating a new skill satisfies the 11-check creation gate
209
+ node .agent/scripts/skill_intelligence.js --gate --need "webhook-reconciliation"
210
+
211
+ # Post-execution outcome & verification audit against implementation evidence
212
+ node .agent/scripts/skill_intelligence.js --query "Build payment API with idempotency and retry" --evidence evidence.json
213
+
214
+ # Audit discovery readiness of all registered skills
215
+ node .agent/scripts/skill_intelligence.js --audit
216
+ ```
package/CONTRIBUTING.md CHANGED
@@ -42,9 +42,9 @@ tribunal-kit/
42
42
  │ └── index.d.ts # TypeScript declarations
43
43
  ├── crates/core/ # Rust core engine (Tokio-based)
44
44
  ├── .agent/ # The intelligence payload (agents, skills, workflows)
45
- │ ├── agents/ # 58 specialist and reviewer agent definitions
45
+ │ ├── agents/ # 60 specialist and reviewer agent definitions
46
46
  │ ├── skills/ # Reusable skill packs
47
- │ ├── workflows/ # 49 workflow definitions
47
+ │ ├── workflows/ # 51 workflow definitions
48
48
  │ └── scripts/ # Automation scripts
49
49
  ├── test/
50
50
  │ ├── unit/ # Unit tests (Jest)
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  <!-- BADGES -->
16
16
  <div style="margin-bottom: 25px;">
17
17
  <a href="https://github.com/Harmitx7/tribunal-kit/releases">
18
- <img src="https://img.shields.io/badge/Release-v9.2.6-blue?style=for-the-badge" alt="Release" />
18
+ <img src="https://img.shields.io/badge/Release-v9.2.7-blue?style=for-the-badge" alt="Release" />
19
19
  </a>
20
20
  <a href="https://www.npmjs.com/package/tribunal-kit">
21
21
  <img src="https://img.shields.io/npm/v/tribunal-kit?style=for-the-badge&logo=npm&logoColor=white&color=ff1637" alt="NPM Version" />
@@ -53,19 +53,19 @@ Tribunal Kit acts as a **neurosymbolic verification envelope**. It intercepts AI
53
53
 
54
54
  ---
55
55
 
56
- ## ⚡ What's New in v9.2.6
56
+ ## ⚡ What's New in v9.2.7
57
57
 
58
+ - **Skill Intelligence Engine (`tk skill-intel`):** Autonomous discovery, composition, and gating across 235+ engineering skills with concept extraction, DAG pipeline compilation, and 11-point creation gate.
59
+ - **System-1 Expansion Core:** Added specialized processing modules including browser intelligence, deterministic decision & evidence engines, and adaptive evolution pipeline.
60
+ - **Cross-Domain & Outcome Optimization:** Real-time second-order effect detection, emergent failure prediction, and non-downgrade monotonic security invariants.
58
61
  - **Backend Intelligence Trust Boundary:** Strict validation engine output isolation. LLMs can no longer self-authorize findings; evidence requires verifiable provenance hashes and terminal command records.
59
- - **Universal 18-Section Governance Standard:** All 235 modular skills upgraded to enforce Tri-State Evidence classification (`[OBSERVED]`, `[INFERRED]`, `[UNVERIFIED]`) and non-negotiable **Verification-Before-Completion (VBC)** gates.
60
- - **Anti-Slop Purpose-Gate:** Added the dedicated `anti-slop-auditor` (Wave 3) and `anti-slop-enforcement` skill to eradicate cliché AI design copy, gratuitous animations, and generic purple gradients.
61
- - **System-1 Concurrency & Isolation:** Atomic directory-based installation locks, isolated dependency packaging (~150MB overhead eliminated), and SHA-256 model verification for local ONNX inference.
62
- - **Zero-Trust Architecture Intelligence (`tk arch`):** Deterministic fact extraction (TAFE), blast-radius computation, circular dependency detection, and interactive HTML architecture projections.
62
+ - **Universal 18-Section Governance Standard:** All 235 modular skills enforce Tri-State Evidence classification (`[OBSERVED]`, `[INFERRED]`, `[UNVERIFIED]`) and non-negotiable **Verification-Before-Completion (VBC)** gates.
63
63
 
64
64
  ---
65
65
 
66
66
  ## ⚡ Core Capabilities
67
67
 
68
- - **Parallel Review Pipeline:** 28 domain-specific reviewers analyze generated code simultaneously across 3 waves (Logic, Security, Domain) before writing to disk.
68
+ - **Parallel Review Pipeline:** 31 domain-specific reviewers analyze generated code simultaneously across 3 waves (Logic, Security, Domain) before writing to disk.
69
69
  - **Compiled Rust Core:** Sub-10ms AST parsing, semantic graph extraction, and file synchronization using SHA-256 diffs.
70
70
  - **Phantom Package Guardrails:** Blocks "slopsquatting" and non-existent npm package imports during code generation.
71
71
  - **Cross-Session Memory:** "Supreme Court Case Law" (`tk case`) and key-value memory (`tk memory`) record past AI mistake precedents.
@@ -83,7 +83,7 @@ Tribunal Kit operates as a fast, intercepting middleware layer between the AI ge
83
83
  graph LR
84
84
  A[User Request] --> B[Context Broker]
85
85
  B --> C[Compiled Rust Core<br/>AST / Graph Extraction]
86
- C --> D[28 Parallel Reviewers<br/>Waves 1, 2 & 3]
86
+ C --> D[31 Parallel Reviewers<br/>Waves 1, 2 & 3]
87
87
  D -->|Violation| E[Inner-Loop Auto-Correct]
88
88
  E -.-> B
89
89
  D -->|Passed| F[Human Gate]
@@ -131,22 +131,22 @@ npx tribunal-kit tk-adapt aider
131
131
 
132
132
  Tribunal Kit CLI operations are routed through the compiled Rust binary when supported, falling back to the JavaScript engine gracefully.
133
133
 
134
- | Command | Arguments | Description |
135
- | :---------- | :-------------------------- | :--------------------------------------------------------------- |
136
- | `init` | `[--force]` | Initializes the `.agent/` configuration payload. |
137
- | `sync` | — | Syncs rules with IDEs (.cursorrules, .windsurfrules). |
138
- | `status` | — | Evaluates workspace rules and checks for violations. |
139
- | `validate` | `[--file <path>]` | Validates `.agent/` payload structure with live reviewer swarm. |
140
- | `guardrail` | `[--file <path>]` | Scans changes for phantom packages and `// VERIFY` tags. |
141
- | `arch` | `map \| verify \| impact \| diff \| audit \| project` | Verifiable Architecture Intelligence & Blast Radius engine. |
142
- | `system1` | `enable \| disable \| status` | Manages local ONNX neural tier assessment and model weights. |
143
- | `sdd` | `run \| status` | Subagent-Driven Development execution with reviewer waves. |
144
- | `minimal` | `[--prompt <text>]` | Analyzes change requests for minimal viable diffs (Decision 0-7).|
145
- | `contract` | `init \| verify \| list` | AI agent behavioral contract validation and trace replay. |
146
- | `memory` | `store \| recall \| gc` | Manages persistent cross-session AI memory. |
147
- | `case` | `add \| search <q>` | Records or searches for AI mistake precedents. |
148
- | `tk-adapt` | `[claude\|aider\|--global]` | Installs universal CLI agent adapters. |
149
- | `hook` | — | Installs the automated Git pre-push governance hook. |
134
+ | Command | Arguments | Description |
135
+ | :---------- | :---------------------------------------------------- | :---------------------------------------------------------------- |
136
+ | `init` | `[--force]` | Initializes the `.agent/` configuration payload. |
137
+ | `sync` | — | Syncs rules with IDEs (.cursorrules, .windsurfrules). |
138
+ | `status` | — | Evaluates workspace rules and checks for violations. |
139
+ | `validate` | `[--file <path>]` | Validates `.agent/` payload structure with live reviewer swarm. |
140
+ | `guardrail` | `[--file <path>]` | Scans changes for phantom packages and `// VERIFY` tags. |
141
+ | `arch` | `map \| verify \| impact \| diff \| audit \| project` | Verifiable Architecture Intelligence & Blast Radius engine. |
142
+ | `system1` | `enable \| disable \| status` | Manages local ONNX neural tier assessment and model weights. |
143
+ | `sdd` | `run \| status` | Subagent-Driven Development execution with reviewer waves. |
144
+ | `minimal` | `[--prompt <text>]` | Analyzes change requests for minimal viable diffs (Decision 0-7). |
145
+ | `contract` | `init \| verify \| list` | AI agent behavioral contract validation and trace replay. |
146
+ | `memory` | `store \| recall \| gc` | Manages persistent cross-session AI memory. |
147
+ | `case` | `add \| search <q>` | Records or searches for AI mistake precedents. |
148
+ | `tk-adapt` | `[claude\|aider\|--global]` | Installs universal CLI agent adapters. |
149
+ | `hook` | — | Installs the automated Git pre-push governance hook. |
150
150
 
151
151
  _(For workflow execution, Tribunal Kit monitors for slash commands like `/orchestrate`, `/audit`, `/sdd`, or `/deploy` inside your AI context)._
152
152
 
@@ -204,7 +204,7 @@ function main() {
204
204
  console.log('');
205
205
  console.log('┌─────────────────────────────────────────────┐');
206
206
  console.log('│ 🔱 Tribunal Kit — Universal Agent Adapter │');
207
- console.log('│ v9.2.6 · 52 specialists · 185 skills │');
207
+ console.log('│ v9.2.7 · 52 specialists · 185 skills │');
208
208
  console.log('└─────────────────────────────────────────────┘');
209
209
  console.log('');
210
210
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tribunal-kit",
3
- "version": "9.2.6",
3
+ "version": "9.2.7",
4
4
  "description": "Tribunal Kit is the governance layer for AI coding agents that stops AI hallucinations and npm ghost packages before they hit disk. Works with Cursor, Windsurf, Claude Code, and Aider.",
5
5
  "keywords": [
6
6
  "ai",
@@ -142,16 +142,15 @@
142
142
  "onnxruntime-node": "^1.22.0",
143
143
  "prettier": "^3.2.5",
144
144
  "typescript": "^5.4.5",
145
- "ws": "^8.21.3",
146
- "zod": "^4.5.4"
145
+ "ws": "^8.21.3"
147
146
  },
148
147
  "optionalDependencies": {
149
- "@tribunal-kit/core-darwin-arm64": "^9.2.6",
150
- "@tribunal-kit/core-darwin-x64": "^9.2.6",
151
- "@tribunal-kit/core-linux-arm64": "^9.2.6",
152
- "@tribunal-kit/core-linux-x64": "^9.2.6",
153
- "@tribunal-kit/core-win32-arm64": "^9.2.6",
154
- "@tribunal-kit/core-win32-x64": "^9.2.6"
148
+ "@tribunal-kit/core-darwin-arm64": "^9.2.7",
149
+ "@tribunal-kit/core-darwin-x64": "^9.2.7",
150
+ "@tribunal-kit/core-linux-arm64": "^9.2.7",
151
+ "@tribunal-kit/core-linux-x64": "^9.2.7",
152
+ "@tribunal-kit/core-win32-arm64": "^9.2.7",
153
+ "@tribunal-kit/core-win32-x64": "^9.2.7"
155
154
  },
156
155
  "jest": {
157
156
  "testMatch": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tribunal-kit",
3
3
  "description": "Enterprise-grade governance layer and anti-hallucination engine for AI coding agents: 52 specialists, 28 parallel reviewers, Rust core, Subagent-Driven Development (SDD), and strict TDD workflows.",
4
- "version": "9.2.6",
4
+ "version": "9.2.7",
5
5
  "author": {
6
6
  "name": "Harmitx7",
7
7
  "email": "harmit@tribunalkit.com"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tribunal-kit",
3
3
  "description": "Enterprise-grade governance layer and anti-hallucination engine: 52 specialists, 28 parallel reviewers, Rust core, and SDD workflows.",
4
- "version": "9.2.6",
4
+ "version": "9.2.7",
5
5
  "contextFileName": ".agent/rules/GEMINI.md"
6
6
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  const { findBrowser, findPinchTabBinary, isPortOpen } = require('./discovery');
8
- const { launchBrowser, cleanupAll } = require('./launcher');
8
+ const { launchBrowser, cleanupAll, terminateProcessTree } = require('./launcher');
9
9
  const { CdpClient, createNewTab, closeTab } = require('./cdp');
10
10
  const { trimHTML, toSemanticMarkdown, truncateUTF8Bytes, MAX_TRIMMED_BYTES } = require('./trimmer');
11
11
  const { scanContent, sanitizeContent, sandboxWebContent, isDomainAllowed } = require('./idpi');
@@ -66,6 +66,7 @@ module.exports = {
66
66
  isPortOpen,
67
67
  launchBrowser,
68
68
  cleanupAll,
69
+ terminateProcessTree,
69
70
  CdpClient,
70
71
  createNewTab,
71
72
  closeTab,
@@ -139,7 +139,7 @@ async function launchBrowser(options = {}) {
139
139
 
140
140
  const close = async () => {
141
141
  activeInstances.delete(proc);
142
- proc.kill();
142
+ terminateProcessTree(proc);
143
143
  try {
144
144
  fs.rmSync(tempProfileDir, { recursive: true, force: true });
145
145
  } catch {
@@ -154,7 +154,47 @@ async function launchBrowser(options = {}) {
154
154
  };
155
155
  }
156
156
 
157
+ /**
158
+ * Cleanly terminates a process and its child process tree cross-platform.
159
+ * Handles null, dead, or invalid processes gracefully without throwing.
160
+ * @param {any} proc - ChildProcess instance or object with pid
161
+ */
162
+ function terminateProcessTree(proc) {
163
+ if (!proc || typeof proc !== 'object' || !proc.pid) return;
164
+ const pid = proc.pid;
165
+ try {
166
+ if (process.platform === 'win32') {
167
+ try {
168
+ const { execSync } = require('child_process');
169
+ execSync(`taskkill /pid ${pid} /T /F`, { stdio: 'ignore' });
170
+ } catch (_) {}
171
+ try {
172
+ if (typeof proc.kill === 'function') {
173
+ proc.kill('SIGKILL');
174
+ } else {
175
+ process.kill(pid, 'SIGKILL');
176
+ }
177
+ } catch (_) {}
178
+ } else {
179
+ try {
180
+ process.kill(-pid, 'SIGKILL');
181
+ } catch (_) {
182
+ try {
183
+ if (typeof proc.kill === 'function') {
184
+ proc.kill('SIGKILL');
185
+ } else {
186
+ process.kill(pid, 'SIGKILL');
187
+ }
188
+ } catch (_) {}
189
+ }
190
+ }
191
+ } catch (_) {
192
+ // Graceful error handling for missing, invalid, or already-dead process
193
+ }
194
+ }
195
+
157
196
  module.exports = {
158
197
  launchBrowser,
159
198
  cleanupAll,
199
+ terminateProcessTree,
160
200
  };
package/src/cli.js CHANGED
@@ -130,7 +130,9 @@ function cmdHelp(quiet = false) {
130
130
  cmd('contract', 'AI Agent Behavioral Contract Testing (init, verify, list, trace, replay)'),
131
131
  );
132
132
  (0, logger_1.log)(cmd('impact-tier', 'Classify task governance impact tier (0-3)'));
133
- (0, logger_1.log)(cmd('context-rank', 'Deterministic evidence-driven context ranking and token budgeting'));
133
+ (0, logger_1.log)(
134
+ cmd('context-rank', 'Deterministic evidence-driven context ranking and token budgeting'),
135
+ );
134
136
  (0, logger_1.log)(cmd('browse', 'Token-efficient page reader (pruned to <4k bytes)'));
135
137
  (0, logger_1.log)(cmd('audit-web', 'Live browser accessibility, console & vitals auditor'));
136
138
  (0, logger_1.log)(cmd('compare-web', 'Visual regression differ for CI & release gating'));