Files
foxhunt/scripts/fix_audit_compliance_part2.sh
jgrusewski 8d89fe80ff chore: Second cleanup wave - organize root directory
- Archive: 85 agent .txt files → docs/archive/agents/legacy_txt/
- Scripts: Move 110 shell scripts → scripts/ (keep deploy.sh in root)
- Models: Move 18 .safetensors → ml/models/checkpoints/training_artifacts/
- Delete: 34 directories (~33GB freed) - target/, coverage_*, test artifacts
- Build: Clean 14 build artifacts (.rlib, .o, .pid, binaries)
- Tests: Move 14 .rs files → tests/standalone/
- SQL: Move 5 files → sql/ (keep init-db*.sql for Docker)
- Wave 153: Archive to docs/archive/historical/wave153/
- Docs: Archive 9 markdown files to wave_d/reports/ and historical/

Total impact: ~34GB freed (both waves), root directory cleaned from 583 to ~40 essential files
Directory count reduced from 65 to 31 (52% reduction)
All historical data preserved in organized archive structure
2025-10-30 01:26:02 +01:00

33 lines
1.4 KiB
Bash

#!/bin/bash
# Wave 112 Agent 10: Fix audit_compliance.rs lines 501-1000 compilation errors
# This script applies systematic API corrections
FILE="/home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs"
echo "Fixing audit_compliance.rs API mismatches..."
# Fix 1: Remove .await.unwrap() from AuditTrailEngine::new() calls (lines 177, 248, 309, 354, etc.)
sed -i 's/AuditTrailEngine::new(config)\.await\.unwrap()/AuditTrailEngine::new(config)/g' "$FILE"
# Fix 2: Change record_event to log_event
sed -i 's/\.record_event(/\.log_event(/g' "$FILE"
# Fix 3: Change query_events to query and wrap result
sed -i 's/\.query_events(query)\.await\.unwrap()/\.query(query).await.unwrap().events/g' "$FILE"
# Fix 4: Change event_id field in AuditTrailQuery to transaction_id
sed -i 's/event_id: Some(\([^)]*\))/transaction_id: Some(\1)/g' "$FILE"
# Fix 5: Change user_id to actor in TransactionAuditEvent
sed -i 's/event\.user_id/event.actor/g' "$FILE"
# Fix 6: Fix AuditTrailQuery to use start_time and end_time (not optional)
sed -i 's/start_time: Some(\([^)]*\))/start_time: \1/g' "$FILE"
sed -i 's/end_time: Some(\([^)]*\))/end_time: \1/g' "$FILE"
# Fix 7: Fix event_type field - should be event_types (plural) and Vec
sed -i 's/event_type: Some(\([^)]*\))/event_types: Some(vec![\1])/g' "$FILE"
echo "✅ Applied systematic API fixes to audit_compliance.rs"
echo "Now checking for remaining errors..."