← Back to Pull requests

fix(windows): hide console window, harden FilesystemWatcher junctions, and add live Defender/CodeIntegrity forensics #63

Open
unknown opened this pull request with 310 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 10, 2026 16:50 UTC
Author

Summary

1. Zero Visible DOS / Console Windows on Windows:
- Added automatic Windows console window hiding and detachment (GetConsoleWindow() -> ShowWindow(hwnd, 0) + FreeConsole()) at the start of main() in crates/quorum-daemon/src/main.rs whenever quorumrag.exe is started as the Web UI / background daemon (SubCommand::Serve or None) or SubCommand::WatchP2p.
- Redirected tracing_subscriber output to <data-dir>/logs/quorumrag-service.log whenever the console is detached so background daemon logs are persisted without keeping any console window open.
- Added CREATE_NO_WINDOW (0x0800_0000) to all Windows subprocess spawns across quorum-daemon, quorum-coordinator, and quorum-ingest, and updated packaging/windows/quorumrag-launch.cmd to launch with start "" /B.

2. Resilient FilesystemWatcher & NTFS Junction Filtering:
- Updated ReindexWorker::expand_drive_roots (crates/quorum-ingest/src/reindex.rs) and FilesystemWatcher::start_watching (crates/quorum-ingest/src/watcher.rs) to skip restricted Windows NTFS junction directories (C:\Documents and Settings, All Users, Default User, Default, $WinREAgent) and symlinks, and log per-path watch errors without aborting the entire watcher.
- Normalized \\?\ extended-length paths in is_internal_noise (crates/quorum-daemon/src/main.rs) so internal storage writes (data/.metadata.json, data/p2p_known_peers.json, quorumrag-service.log, AppData\Local\Temp) never trigger recursive reindex loops.

3. Live Windows Defender Antivirus & CodeIntegrity Blocked-Process Forensics ("what was the last process blockes by antivirus"):
- Enhanced collect_live_os_forensics (crates/quorum-ingest/src/artemis.rs) to query Microsoft-Windows-Windows Defender/Operational (EventID=1116 or EventID=1117 or EventID=1121 or EventID=1122 via /q: syntax) and Microsoft-Windows-CodeIntegrity/Operational (EventID=3077 or EventID=3076 or EventID=3033 or EventID=3089) and format natural, sentence-structured event summaries with timestamps, threat names, and blocked command lines.
- Added on-demand forensic event log synchronization (ensure_live_forensics_for_query in crates/quorum-daemon/src/handlers/chat.rs), local Tier3Restricted retrieval promotion (scatter_gather.rs, retrieve.rs), typo correction ("blockes" -> "blocked"), and fast deterministic forensic synthesis (offline_engine.rs, answer_orchestrator.rs).

Diff: 310 lines (+232 / -78) across 3 files Reviewer: github-actions[bot] Review duration: 1m
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.40) × (1 − Review Confidence (0.17)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 310 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 15% · Reviewer familiarity: 35%
16%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.343
Real PR Conversation Timeline
1 comments
"Review active on #63"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 16.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.3% (MEDIUM) · Higher = larger blast radius
40.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 16.8% · Lower = rushed or shallow review
16.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 33.5% · Safe to merge
33.5%