Skip to content

Commit 345de1f

Browse files
jaypatrickclaudeCopilot
authored
Add event pipeline with zero-trust validation and file locking (#198)
* Deleted dummy files * Add event pipeline with zero-trust validation and file locking This commit adds a comprehensive event pipeline system across all three rules compilers (.NET, Python, Rust) with the following features: ## Event System - CompilationStarted, ConfigurationLoaded, CompilationCompleted, CompilationError - SourceLoading/SourceLoaded - track source processing with metrics - ChunkStarted/ChunkCompleted/ChunksMerging/ChunksMerged - chunking events - Validation - zero-trust checkpoints with severity levels (Info/Warning/Error/Critical) ## File Locking - FileLockService for acquiring read/write locks on local source files - SHA-256 hash computation for integrity verification - Cross-platform support (fcntl on Unix, file handles on Windows) - Lock events: FileLockAcquired, FileLockReleased, FileLockFailed ## Chunking (from previous work) - Parallel compilation via source chunking for improved performance - ChunkingOptions, ChunkMetadata, ChunkedCompilationResult types - Automatic deduplication during merge - --benchmark CLI flag for all compilers ## Documentation - docs/event-pipeline.md - comprehensive event pipeline guide - docs/chunking-guide.md - parallel chunking documentation ## Tests - .NET: 97 tests pass - Python: 132 tests pass - Rust: 47 tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Initial plan (#200) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --------- Signed-off-by: Jayson Knight <jayson.knight@jaysonknight.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 3a9957e commit 345de1f

52 files changed

Lines changed: 807824 additions & 14 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.local.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@
88
"Bash(VSTEST_CONNECTION_TIMEOUT=180 dotnet test:*)",
99
"Bash(export VSTEST_CONNECTION_TIMEOUT=180)",
1010
"Bash(find:*)",
11-
"Bash(xargs ls:*)",
12-
"Bash(gh run view:*)",
13-
"Bash(cargo fmt:*)",
14-
"Bash(cargo check:*)",
15-
"Bash(git checkout:*)",
16-
"Bash(git add:*)"
11+
"Bash(python -m pytest:*)",
12+
"Bash(pip install:*)",
13+
"Bash(cargo build:*)",
14+
"Bash(cargo test:*)",
15+
"Bash(python quick_benchmark.py:*)",
16+
"Bash(python generate_synthetic_data.py:*)",
17+
"Bash(python -m rules_compiler:*)",
18+
"Bash(rules-compiler:*)",
19+
"Bash(\"C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/src/rules-compiler-rust/target/release/rules-compiler\" --benchmark --benchmark-rules 50000)",
20+
"Bash(./target/release/rules-compiler.exe:*)",
21+
"Bash(\"C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/target/release/rules-compiler.exe\" --benchmark --benchmark-rules 50000)",
22+
"Bash(dotnet run:*)",
23+
"Bash(python:*)"
1724
],
1825
"deny": [],
1926
"ask": []

Cargo.lock

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ which = "7.0"
6666
# Runtime version detection
6767
rustc_version_runtime = "0.3"
6868

69+
# Async utilities
70+
futures = "0.3"
71+
72+
# Logging/tracing
73+
tracing = "0.1"
74+
6975
# WASM support
7076
wasm-bindgen = "0.2"
7177
js-sys = "0.3"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"generated_at": "2025-12-28T22:32:29.255598",
3+
"seed": 42,
4+
"filter_files": [
5+
{
6+
"name": "small",
7+
"path": "C:\\Users\\jayson.knight\\.claude-worktrees\\ad-blocking\\reverent-lehmann\\benchmarks\\data\\small.txt",
8+
"rules": 10000,
9+
"lines": 10551,
10+
"size_bytes": 244857,
11+
"size_kb": 239.1,
12+
"hash": "a8b64564993ca728"
13+
},
14+
{
15+
"name": "medium",
16+
"path": "C:\\Users\\jayson.knight\\.claude-worktrees\\ad-blocking\\reverent-lehmann\\benchmarks\\data\\medium.txt",
17+
"rules": 50000,
18+
"lines": 52541,
19+
"size_bytes": 1222046,
20+
"size_kb": 1193.4,
21+
"hash": "09d5e4fe067978b8"
22+
},
23+
{
24+
"name": "large",
25+
"path": "C:\\Users\\jayson.knight\\.claude-worktrees\\ad-blocking\\reverent-lehmann\\benchmarks\\data\\large.txt",
26+
"rules": 200000,
27+
"lines": 210125,
28+
"size_bytes": 4885288,
29+
"size_kb": 4770.8,
30+
"hash": "75511d1b8fcd9148"
31+
},
32+
{
33+
"name": "xlarge",
34+
"path": "C:\\Users\\jayson.knight\\.claude-worktrees\\ad-blocking\\reverent-lehmann\\benchmarks\\data\\xlarge.txt",
35+
"rules": 500000,
36+
"lines": 525228,
37+
"size_bytes": 12217006,
38+
"size_kb": 11930.7,
39+
"hash": "5d783b47850bc6cc"
40+
}
41+
],
42+
"total_rules": 760000,
43+
"total_size_kb": 18134.0
44+
}

benchmarks/data/config-large.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Synthetic Benchmark - Large",
3+
"description": "Synthetic 200,000 rule filter list for benchmarking",
4+
"version": "1.0.0",
5+
"homepage": "https://github.com/jaypatrick/ad-blocking",
6+
"license": "MIT",
7+
"sources": [
8+
{
9+
"name": "large-source",
10+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/large.txt",
11+
"type": "adblock"
12+
}
13+
],
14+
"transformations": [
15+
"Deduplicate",
16+
"RemoveEmptyLines",
17+
"TrimLines"
18+
]
19+
}

benchmarks/data/config-medium.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Synthetic Benchmark - Medium",
3+
"description": "Synthetic 50,000 rule filter list for benchmarking",
4+
"version": "1.0.0",
5+
"homepage": "https://github.com/jaypatrick/ad-blocking",
6+
"license": "MIT",
7+
"sources": [
8+
{
9+
"name": "medium-source",
10+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
11+
"type": "adblock"
12+
}
13+
],
14+
"transformations": [
15+
"Deduplicate",
16+
"RemoveEmptyLines",
17+
"TrimLines"
18+
]
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "Multi-Source Benchmark (2 sources)",
3+
"description": "Benchmark with 2 parallel sources",
4+
"version": "1.0.0",
5+
"sources": [
6+
{
7+
"name": "source-1",
8+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
9+
"type": "adblock"
10+
},
11+
{
12+
"name": "source-2",
13+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
14+
"type": "adblock"
15+
}
16+
],
17+
"transformations": [
18+
"Deduplicate",
19+
"RemoveEmptyLines"
20+
]
21+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "Multi-Source Benchmark (4 sources)",
3+
"description": "Benchmark with 4 parallel sources",
4+
"version": "1.0.0",
5+
"sources": [
6+
{
7+
"name": "source-1",
8+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
9+
"type": "adblock"
10+
},
11+
{
12+
"name": "source-2",
13+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
14+
"type": "adblock"
15+
},
16+
{
17+
"name": "source-3",
18+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
19+
"type": "adblock"
20+
},
21+
{
22+
"name": "source-4",
23+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
24+
"type": "adblock"
25+
}
26+
],
27+
"transformations": [
28+
"Deduplicate",
29+
"RemoveEmptyLines"
30+
]
31+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "Multi-Source Benchmark (8 sources)",
3+
"description": "Benchmark with 8 parallel sources",
4+
"version": "1.0.0",
5+
"sources": [
6+
{
7+
"name": "source-1",
8+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
9+
"type": "adblock"
10+
},
11+
{
12+
"name": "source-2",
13+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
14+
"type": "adblock"
15+
},
16+
{
17+
"name": "source-3",
18+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
19+
"type": "adblock"
20+
},
21+
{
22+
"name": "source-4",
23+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
24+
"type": "adblock"
25+
},
26+
{
27+
"name": "source-5",
28+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
29+
"type": "adblock"
30+
},
31+
{
32+
"name": "source-6",
33+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
34+
"type": "adblock"
35+
},
36+
{
37+
"name": "source-7",
38+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
39+
"type": "adblock"
40+
},
41+
{
42+
"name": "source-8",
43+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/medium.txt",
44+
"type": "adblock"
45+
}
46+
],
47+
"transformations": [
48+
"Deduplicate",
49+
"RemoveEmptyLines"
50+
]
51+
}

benchmarks/data/config-small.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Synthetic Benchmark - Small",
3+
"description": "Synthetic 10,000 rule filter list for benchmarking",
4+
"version": "1.0.0",
5+
"homepage": "https://github.com/jaypatrick/ad-blocking",
6+
"license": "MIT",
7+
"sources": [
8+
{
9+
"name": "small-source",
10+
"source": "C:/Users/jayson.knight/.claude-worktrees/ad-blocking/reverent-lehmann/benchmarks/data/small.txt",
11+
"type": "adblock"
12+
}
13+
],
14+
"transformations": [
15+
"Deduplicate",
16+
"RemoveEmptyLines",
17+
"TrimLines"
18+
]
19+
}

0 commit comments

Comments
 (0)