Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions .cursor/rules/ubs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,46 @@ UBS stands for "Ultimate Bug Scanner": **The AI Coding Agent's Secret Weapon: Fl

**Install:** `curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh | bash`

**Golden Rule:** `ubs <changed-files>` before every commit. Exit 0 = safe. Exit >0 = fix & re-run.
**Golden Rule:** `ubs --only=<lang> <changed-files>` before every commit. Exit 0 = safe. Exit >0 = fix & re-run.
Always specify language with `--only` to avoid false positives from cross-language scanning.

**Why --only is Critical:**
UBS auto-detects all 8 languages (js, python, cpp, rust, golang, java, ruby, swift) and scans every file with every scanner. Without `--only`:
- Python scanner reports "invalid-syntax" errors on Rust files
- JavaScript scanner flags "loose equality" in Rust code (false critical)
- Wasted time (8x slower) scanning files with wrong language parsers

**Always specify target language to avoid noise and false positives.**

**Commands:**
```bash
ubs file.ts file2.py # Specific files (< 1s) — USE THIS
ubs $(git diff --name-only --cached) # Staged files — before commit
ubs --only=js,python src/ # Language filter (3-5x faster)
ubs --ci --fail-on-warning . # CI mode — before PR
ubs --help # Full command reference
ubs sessions --entries 1 # Tail the latest install session log
ubs . # Whole project (ignores things like .venv and node_modules automatically)
# Language-specific scanning (RECOMMENDED)
ubs --only=rust crates/terraphim_automata/src/lib.rs # Rust files only
ubs --only=python test_*.py # Python files only
ubs --only=js desktop/src/lib/*.ts # JavaScript/TypeScript files only
ubs --only=js,python src/ # Multiple languages

# General commands
ubs file.ts file2.py # Specific files (use --only instead)
ubs $(git diff --name-only --cached) # Staged files — before commit
ubs --ci --fail-on-warning . # CI mode — before PR
ubs --help # Full command reference
ubs sessions --entries 1 # Tail the latest install session log
ubs . # Whole project (slow, avoid)
```

**Language Flags Quick Reference:**
| Flag | File Extensions | Use For |
|------|----------------|---------|
| `--only=rust` | .rs | Rust source files |
| `--only=python` | .py, .pyi | Python scripts and tests |
| `--only=js` | .js, .ts, .jsx, .tsx | JavaScript/TypeScript files |
| `--only=cpp` | .c, .cpp, .h, .hpp | C/C++ files |
| `--only=golang` | .go | Go source files |
| `--only=java` | .java | Java source files |
| `--only=ruby` | .rb | Ruby scripts |
| `--only=swift` | .swift | Swift source files |

**Output Format:**
```
⚠️ Category (N errors)
Expand Down Expand Up @@ -47,4 +74,5 @@ Parse: `file:line:col` → location | 💡 → how to fix | Exit 0/1 → pass/fa
- ❌ Ignore findings → ✅ Investigate each
- ❌ Full scan per edit → ✅ Scope to file
- ❌ Fix symptom (`if (x) { x.y }`) → ✅ Root cause (`x?.y`)
- ❌ Scan without `--only` → ✅ Always specify target language
````
3 changes: 3 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
name: Build Documentation
runs-on: [self-hosted, linux, x64]
steps:
- name: Pre-checkout cleanup
run: |
sudo rm -rf "${{ github.workspace }}/target" "${{ github.workspace }}/desktop/dist" "${{ github.workspace }}/desktop/node_modules" "${{ github.workspace }}/terraphim_server/dist" 2>/dev/null || true
- name: Checkout repository
uses: actions/checkout@v6

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
name: Lint Python Code
runs-on: [self-hosted, linux, x64]
steps:
- name: Pre-checkout cleanup
run: |
sudo rm -rf "${{ github.workspace }}/target" "${{ github.workspace }}/desktop/dist" "${{ github.workspace }}/desktop/node_modules" "${{ github.workspace }}/terraphim_server/dist" 2>/dev/null || true
- uses: actions/checkout@v6

- name: Set up Python
Expand Down
140 changes: 1 addition & 139 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/terraphim_automata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ pub async fn load_thesaurus_from_json_and_replace_async(
/// Note: Remote loading requires the "remote-loading" feature to be enabled.
#[cfg(feature = "remote-loading")]
pub async fn load_thesaurus(automata_path: &AutomataPath) -> Result<Thesaurus> {
#[allow(dead_code)]
async fn read_url(url: String) -> Result<String> {
log::debug!("Reading thesaurus from remote: {url}");
let response = reqwest::Client::builder()
Expand Down
Loading