lsp-max 26.6.24

Law-state LSP runtime: max LSP 3.18 coverage, process-mining conformance, receipt-chain admission
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# IDE Setup Guides for lsp-max

Step-by-step setup instructions for different development workflows and IDE combinations.

## Quick Setup (5 minutes)

### For VS Code Users

```bash
# 1. Install extension
code --install-extension seanchatmangpt.lsp-max

# 2. Install server
cargo install lsp-max-cli

# 3. Open any Rust project
code ~/my-rust-project

# Done! Diagnostics should appear automatically.
```

### For JetBrains Users

```bash
# 1. Open Settings → Plugins → Marketplace
# 2. Search "lsp-max" and click Install
# 3. Restart IDE
# 4. Install server:
cargo install lsp-max-cli

# Done! Features available via Tools → LSP-Max
```

### For Desktop Users (No IDE Required)

```bash
# macOS
brew install lsp-max-desktop
open -a "LSP Max"

# Windows
choco install lsp-max-desktop
# or download .msi from GitHub releases
```

---

## Full Setup Guides

### 1. Rust Project with VS Code + CLI

**Target:** Rust developers wanting LSP + CLI tools

**Time:** 15 minutes

#### Step 1: Install Tools

```bash
# Install Rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install lsp-max CLI
cargo install lsp-max-cli

# Install VS Code extension
code --install-extension seanchatmangpt.lsp-max

# Verify installation
lsp-max-server --version
lsp-max-cli --version
```

#### Step 2: Create Workspace Config

```bash
# Navigate to your Rust project
cd /path/to/rust-project

# Create VS Code settings
mkdir -p .vscode

cat > .vscode/settings.json << 'EOF'
{
  "lsp-max.enabled": true,
  "lsp-max.conformance.enableConformanceChecks": true,
  "lsp-max.trace.server": "messages",
  "editor.formatOnSave": false,
  "[rust]": {
    "editor.defaultFormatter": "rust-lang.rust-analyzer",
    "editor.formatOnSave": true
  }
}
EOF

cat > .vscode/keybindings.json << 'EOF'
[
  {
    "key": "ctrl+shift+d",
    "command": "lsp-max.showDiagnostics",
    "when": "editorFocus && editorLangId == rust"
  },
  {
    "key": "ctrl+shift+c",
    "command": "lsp-max.checkConformance",
    "when": "editorFocus"
  }
]
EOF
```

#### Step 3: Verify Setup

```bash
# Open project in VS Code
code .

# Open any .rs file
# Expected: Diagnostics appear in gutter, hover shows type info

# Test CLI
lsp-max-cli gate check
# Expected: "Gate status: OPEN"

lsp-max-cli conformance vector
# Expected: Conformance vector JSON output
```

#### Step 4: Enable Additional Features

**Inlay Hints:**
```json
{
  "lsp-max.inlayHints.enabled": true,
  "[rust]": {
    "editor.inlayHints.enabled": true
  }
}
```

**Semantic Tokens:**
```json
{
  "lsp-max.semanticTokens.enabled": true,
  "editor.semanticHighlighting.enabled": true
}
```

**Type Hierarchy:**
```json
{
  "lsp-max.typeHierarchy.enabled": true
}
```

---

### 2. Multi-Language Project with JetBrains IDE

**Target:** Teams with mixed Rust/Java/Kotlin/Go codebases

**Time:** 20 minutes

#### Step 1: Install Plugin

**IntelliJ IDEA:**
1. Open **Settings** (Cmd+, on macOS, Ctrl+Alt+S on Windows/Linux)
2. Navigate to **Plugins**
3. Click **Marketplace**
4. Search for "lsp-max"
5. Click **Install**
6. Restart IDE

**RustRover / CLion / GoLand:**
- Same steps as IntelliJ IDEA
- No additional configuration needed

#### Step 2: Configure Server

```bash
# Install server
cargo install lsp-max-cli

# Find installation path
which lsp-max-server
# Example output: /Users/user/.cargo/bin/lsp-max-server
```

Now configure in IDE:

1. **Settings****Languages & Frameworks****LSP-Max**
2. Set **Server Path:** `/Users/user/.cargo/bin/lsp-max-server` (your path)
3. Leave **Server Arguments** empty (or add `--log-level debug`)
4. Click **Apply** and **OK**

#### Step 3: Create Project Config

```bash
cd /path/to/project

# Create lsp-max config file
mkdir -p ~/.config/lsp-max

cat > ~/.config/lsp-max/jetbrains.toml << 'EOF'
[server]
path = "/Users/user/.cargo/bin/lsp-max-server"
args = ["--log-level", "info"]
enable = true

[conformance]
enabled = true
report_unknown = true
max_per_file = 100

[diagnostics]
victory_language = true
version_violations = true
gate_violations = false

[performance]
debounce_ms = 500
max_parallel = 4
compression = true

[features]
semantic_tokens = true
inlay_hints = true
type_hierarchy = true
call_hierarchy = true
code_lens = true
receipts = true
gates = true
EOF
```

#### Step 4: Customize Keybindings

**Settings** → **Keymap** → **Plug-ins** → **LSP-Max**

Right-click each action to bind custom keys:
- Show diagnostics
- Check conformance
- View conformance vector
- Show receipts
- Check ANDON gate

#### Step 5: Verify Setup

1. Open a Rust/Java/Go file
2. Hover over identifiers → Should show type information
3. **Tools****LSP-Max****Server Status** → Should say "Connected"
4. **Ctrl+Shift+D** (or your bound key) → Should show diagnostics panel

---

### 3. Full-Stack Development (Web App + Server)

**Target:** Frontend + backend developers building on lsp-max

**Time:** 30 minutes

#### Step 1: Install Backend Server

```bash
# Clone lsp-max
git clone https://github.com/seanchatmangpt/lsp-max.git
cd lsp-max

# Build server
cargo build --release

# Install globally
cargo install --path . lsp-max-cli
```

#### Step 2: Install Frontend Tools

```bash
# Node.js (if not installed)
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

# OR macOS:
brew install node

# Install web dependencies
cd web
npm install
```

#### Step 3: Setup Development Environment

Create `.env.development.local` in `web/`:

```env
LSP_MAX_SERVER_URL=http://localhost:8080
LSP_MAX_SERVER_TIMEOUT=30000
NEXT_PUBLIC_CONFORMANCE_ENABLED=true
NEXT_PUBLIC_RECEIPTS_ENABLED=true
NEXT_PUBLIC_GATES_ENABLED=true
NEXT_PUBLIC_OCEL_ENABLED=true
NEXT_PUBLIC_THEME=dark
```

#### Step 4: Run Development Servers

**Terminal 1 — Backend:**
```bash
cd /path/to/lsp-max
cargo run --bin lsp-max-server --release -- --port 8080
```

**Terminal 2 — Frontend:**
```bash
cd /path/to/lsp-max/web
npm run dev
```

**Terminal 3 — IDE (optional):**
```bash
code .
```

#### Step 5: Open in Browser

Navigate to: `http://localhost:3000`

Check each section:
- `/receipts` — Should load receipt artifacts
- `/conformance` — Should show live conformance vector
- `/gate` — Should show gate status
- `/ocel` — Should show process evidence (if available)
- `/cli` — Should show all CLI commands

---

### 4. Team Collaboration (Shared Server)

**Target:** Teams running centralized lsp-max server

**Time:** 15 minutes per developer

#### Step 1: Network Setup (Admin)

```bash
# On server machine (e.g., 192.168.1.100)
cargo install lsp-max-cli

# Start server accessible on network
lsp-max-server --host 0.0.0.0 --port 8080 &

# Test from another machine
curl http://192.168.1.100:8080/max/state
```

#### Step 2: Developer Setup (VS Code)

```bash
# Edit .vscode/settings.json
{
  "lsp-max.serverPath": "http://192.168.1.100:8080",
  "lsp-max.serverArgs": [],
  "[rust]": {
    "editor.defaultFormatter": "lsp-max"
  }
}
```

#### Step 3: Developer Setup (JetBrains)

**Settings** → **Tools** → **LSP-Max**:
- Server Path: `http://192.168.1.100:8080`
- Enable: checked

#### Step 4: Verify Connection

```bash
# From any developer machine
curl http://192.168.1.100:8080/max/state
# Should return JSON server state
```

---

### 5. CI/CD Pipeline Integration

**Target:** Automated testing and quality gates

**Time:** 20 minutes

#### Step 1: Local Pre-Commit Hook

```bash
cd /path/to/project

mkdir -p .git/hooks

cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
set -e

echo "Checking lsp-max gate..."
lsp-max-cli gate check

if [ $? -ne 0 ]; then
  echo "Gate is ANDON. Resolve diagnostics before committing."
  exit 1
fi

echo "Running tests..."
cargo test --workspace

echo "Checking code style..."
cargo fmt --all -- --check
cargo clippy --workspace -- -D warnings

echo "All checks passed!"
EOF

chmod +x .git/hooks/pre-commit

# Test hook
git commit --allow-empty -m "test" 2>&1 | head -20
```

#### Step 2: GitHub Actions Workflow

```bash
mkdir -p .github/workflows

cat > .github/workflows/lsp-max-ci.yml << 'EOF'
name: LSP-Max CI

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  conformance:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install lsp-max-cli
        run: cargo install lsp-max-cli
      
      - name: Check gate
        run: lsp-max-cli gate check
      
      - name: Test
        run: cargo test --workspace
      
      - name: Lint
        run: cargo fmt --all -- --check && cargo clippy --workspace -- -D warnings
      
      - name: Export diagnostics
        if: always()
        run: |
          lsp-max-cli diagnostics export --format=json > diagnostics.json
          cat diagnostics.json

  conformance-vector:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install lsp-max-cli
        run: cargo install lsp-max-cli
      
      - name: Check conformance
        run: lsp-max-cli conformance vector --output=json | jq .
EOF
```

#### Step 3: GitLab CI (if using GitLab)

```yaml
# .gitlab-ci.yml
stages:
  - conform
  - test

conformance:
  stage: conform
  image: rust:latest
  script:
    - cargo install lsp-max-cli
    - lsp-max-cli gate check
    - lsp-max-cli conformance vector
  only:
    - merge_requests
    - main

test:
  stage: test
  image: rust:latest
  script:
    - cargo test --workspace
  needs:
    - conformance
```

---

### 6. Desktop + IDE Integration (Unified Workflow)

**Target:** Users wanting centralized LSP server + IDE integration

**Time:** 25 minutes

#### Step 1: Install Desktop App

**macOS:**
```bash
brew tap seanchatmangpt/lsp-max
brew install lsp-max-desktop
open -a "LSP Max"
```

**Windows:**
```powershell
choco install lsp-max-desktop
# or download .msi and run
```

#### Step 2: Verify Desktop App

1. Open **LSP Max** application
2. Check **Preferences****Server**
3. Verify port is **8080** (default)
4. Status should show **"Listening on 127.0.0.1:8080"**

#### Step 3: Configure VS Code

```json
// .vscode/settings.json
{
  "lsp-max.serverPath": "http://localhost:8080",
  "lsp-max.trace.server": "off"
}
```

#### Step 4: Configure JetBrains IDE

**Settings** → **Tools** → **LSP-Max**:
- Server Path: `http://localhost:8080`
- Arguments: (leave empty)

#### Step 5: Workflow

```bash
# 1. Open LSP Max desktop app (always running)
open -a "LSP Max"

# 2. Open VS Code — automatically connects
code /path/to/project

# 3. Open JetBrains IDE — automatically connects
idea /path/to/project

# 4. Optional: Open web dashboard
open http://localhost:3000

# 5. Use CLI for automation
lsp-max-cli conformance vector
lsp-max-cli gate check
```

---

### 7. Advanced: Custom Server Configuration

**Target:** Advanced users needing custom server parameters

**Time:** 10 minutes

#### Create Custom Server Binary

```bash
# Create custom wrapper script
cat > ~/bin/lsp-max-custom << 'EOF'
#!/bin/bash
exec lsp-max-server \
  --log-level=debug \
  --port=8081 \
  --host=127.0.0.1 \
  --max-cache=100 \
  --debounce=1000 \
  "$@"
EOF

chmod +x ~/bin/lsp-max-custom
```

#### Use in VS Code

```json
{
  "lsp-max.serverPath": "/Users/user/bin/lsp-max-custom"
}
```

#### Use in JetBrains

**Settings** → **Tools** → **LSP-Max**:
- Server Path: `/Users/user/bin/lsp-max-custom`

#### Environment Variables

Create `~/.config/lsp-max/env`:

```bash
export RUST_LOG=debug
export LSP_MAX_GATE_FILE=/tmp/lsp-max.gate
export WASM4PM_TRACE=true
export BLAKE3_VERIFY_RECEIPTS=true
```

Source before running:
```bash
source ~/.config/lsp-max/env
lsp-max-server
```

---

## Troubleshooting Setup

### Cannot Find lsp-max-server

```bash
# Check if installed
which lsp-max-server

# If not found, install via cargo
cargo install lsp-max-cli

# Verify
lsp-max-server --version
```

### Version Mismatch (Extension ≠ Server)

```bash
# Check extension version
# VS Code: Extensions → lsp-max → version number

# Check server version
lsp-max-server --version

# If mismatch, update both:
code --install-extension seanchatmangpt.lsp-max  # VS Code
cargo install --force lsp-max-cli  # Server
```

### IDE Not Detecting Server on Network

```bash
# Check server is accessible
curl http://192.168.1.100:8080/max/state

# Check firewall
sudo ufw allow 8080/tcp  # Linux
# macOS: System Preferences → Security & Privacy → Firewall

# Ensure server started with --host 0.0.0.0
lsp-max-server --host 0.0.0.0 --port 8080
```

### Gate Check Fails During CI

```bash
# Check for active diagnostics
lsp-max-cli diagnostics list

# View specific diagnostic
lsp-max-cli diagnostics view ANTI-LLM-VERSION-001

# Resolve (often false positives from auto-generated code)
# Then retry
lsp-max-cli gate check
```

---

## Configuration Reference

### VS Code `settings.json`

```json
{
  // Server
  "lsp-max.enabled": true,
  "lsp-max.serverPath": "/path/to/lsp-max-server",
  "lsp-max.serverArgs": ["--log-level", "debug"],
  
  // Trace/Debug
  "lsp-max.trace.server": "verbose",
  "lsp-max.logLevel": "debug",
  
  // Conformance
  "lsp-max.conformance.enableConformanceChecks": true,
  "lsp-max.conformance.reportUnknownAxes": true,
  "lsp-max.conformance.checkInterval": 5000,
  
  // Diagnostics
  "lsp-max.diagnostics.maxDiagnosticsPerDocument": 100,
  "lsp-max.diagnostics.reportVictoryLanguage": true,
  "lsp-max.diagnostics.reportVersionViolations": true,
  
  // Features
  "lsp-max.semanticTokens.enabled": true,
  "lsp-max.inlayHints.enabled": true,
  "lsp-max.typeHierarchy.enabled": true,
  "lsp-max.callHierarchy.enabled": true,
  "lsp-max.codeLens.enabled": true,
  "lsp-max.receipt.showReceiptDigests": true,
  "lsp-max.gates.enableAndonGate": true,
  
  // Performance
  "lsp-max.performance.debounceMs": 500,
  "lsp-max.performance.maxParallelRequests": 4,
  "lsp-max.performance.maxCachedDocuments": 50,
  "lsp-max.performance.enableCompression": true,
  "lsp-max.performance.gcIntervalMs": 60000,
  
  // Telemetry
  "lsp-max.telemetry.enabled": false
}
```

### JetBrains `jetbrains.toml`

```toml
[server]
path = "/usr/local/bin/lsp-max-server"
args = ["--log-level", "debug"]
enable = true

[conformance]
enabled = true
report_unknown = true
max_per_file = 100

[diagnostics]
victory_language = true
version_violations = true
gate_violations = false
max_total = 200

[performance]
debounce_ms = 500
max_parallel = 4
compression = true
gc_interval_ms = 60000
max_cached_documents = 50

[features]
semantic_tokens = true
inlay_hints = true
type_hierarchy = true
call_hierarchy = true
code_lens = true
receipts = true
gates = true
```

### Desktop App `config.toml`

**macOS:** `~/Library/Application\ Support/lsp-max/config.toml`
**Windows:** `%APPDATA%\lsp-max\config.toml`

```toml
[server]
port = 8080
host = "127.0.0.1"
enable_stdio = false
log_level = "info"

[ui]
theme = "dark"
font_size = 12
window_width = 1200
window_height = 800

[features]
conformance = true
receipts = true
gates = true
ocel = true

[performance]
max_cached_documents = 50
enable_compression = true
gc_interval_ms = 30000
```

---

## Next Steps

- [IDE_INTEGRATIONS.md]IDE_INTEGRATIONS.md — Detailed feature documentation
- [FEATURES.md]FEATURES.md — Complete LSP 3.18 feature matrix
- [AGENTS.md]../AGENTS.md — Law-state runtime and gate system
- [CLAUDE.md]../CLAUDE.md — Project guidelines and conventions

---

**Last updated:** 2026-06-14  
**Version:** 26.6.9 (CalVer)