Skip to content
Draft
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
4 changes: 4 additions & 0 deletions app/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def capture_exception(exception: Exception, **kwargs) -> str | None:
try:
return sentry_sdk.capture_exception(exception, **kwargs)
except Exception:
# Silently fail if Sentry capture fails - don't crash the app for monitoring issues
return None


Expand Down Expand Up @@ -218,6 +219,7 @@ def set_user(user_id: str | None = None, email: str | None = None, **kwargs):

sentry_sdk.set_user(user_data)
except Exception:
# Silently fail if setting user context fails - non-critical operation
pass


Expand Down Expand Up @@ -245,6 +247,7 @@ def add_breadcrumb(message: str, category: str = "default", level: str = "info",
data=data,
)
except Exception:
# Silently fail if adding breadcrumb fails - non-critical operation
pass


Expand All @@ -268,4 +271,5 @@ def set_context(scope):
try:
sentry_sdk.configure_scope(callback)
except Exception:
# Silently fail if configuring scope fails - non-critical operation
pass
15 changes: 0 additions & 15 deletions autofire_layer_intelligence.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,6 @@ def analyze_cad_file(self, file_path: str) -> dict[str, Any]:
try:
logger.info(f"Starting CAD analysis: {file_path}")

# Simulate layer analysis (would use ezdxf for real CAD files)
analysis_results = {
"file_path": file_path,
"total_layers": 0,
"fire_layers": [],
"all_layers": [],
"devices_detected": [],
"analysis_timestamp": None,
"precision_data": {
"total_fire_devices": 0,
"layer_classification_accuracy": 0.0,
"confidence_score": 0.95,
},
}

# Check if file exists
if not Path(file_path).exists():
logger.warning(f"File not found: {file_path}")
Expand Down
4 changes: 3 additions & 1 deletion backend/ops_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def _find_line_intersection(self, seg1: SegmentDTO, seg2: SegmentDTO) -> PointDT

# Line 2: seg2.a to seg2.b
x3, y3 = seg2.a.x, seg2.a.y
x4, y4 = seg2.b.x, seg2.b.y # Calculate denominators
x4, y4 = seg2.b.x, seg2.b.y

# Calculate denominators
denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)

if abs(denom) < 1e-10: # Lines are parallel
Expand Down
4 changes: 4 additions & 0 deletions docs/CLI_AGENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ Then commit the reports to docs/analysis/ with message:
```

That's it! Copilot will:

1. Set up the environment
2. Run the analysis
3. Generate reports
Expand All @@ -285,16 +286,19 @@ That's it! Copilot will:
## 🔍 Troubleshooting

### **No DXF files found**

- Check `Projects/` directory exists
- Verify DXF files have `.dxf` extension
- Try custom search path: `--search-path "path/to/files"`

### **Analysis fails**

- Verify DXF file is valid (open in CAD software)
- Check for corrupted files
- Review error messages in console output

### **No devices detected**

- Verify layer names match expected patterns (FP-, FIRE-, etc.)
- Check `autofire_layer_intelligence.py` layer detection logic
- Add custom layer patterns if needed
Expand Down