Spaces:
Build error
Build error
Commit History
-
fix(ascii): replace all non-ASCII chars in Python source filesβ
CI check requires all .py files (except transliteration/multilingual_ner/ translator/languages) to be pure ASCII. Pre-existing violations fixed: U+03BB lambda -> lambda_val U+2014 em-dash -> -- U+2013 en-dash -> -- U+20B9 rupee Rs -> Rs. U+2192 arrow -> -> U+2500 box-h -> - U+2502 box-v -> | U+2081 subscript -> 1fa87992
-
fix(CodeQL#10,#11,#21): remove Rs amount from affidavit_analyzer logger.success -- financial PII must not appear in plaintext logs
d83f35d
-
fix(CodeQL#10,#11,#21): redact entity_id in affidavit_analyzer log calls -- clear-text logging of potentially sensitive identifiers
4ec50a7
-
fix(NEW-A3 part1): replace em-dashes/smart-quotes in 56+ Python files -- CI requires pure ASCII source
8a0fba4
-
fix(security): remove cleartext logging and info exposure β CodeQL alerts 4-11
b6a8cbc
-
fix(ai/forensics): replace empty policy_benefit_analyzer.py with full implementationβ
Root cause: the file was committed as 0 bytes because the heredoc content was not written to disk before git add was run on the previous attempt. PolicyBenefitAnalyzer class now contains full implementation: - Granger causality test (F-statistic vs threshold 2.5) - Transfer entropy via discretised probability estimation - Cumulative Abnormal Contract Award (CACA) ratio scoring - Sample data fallback when database unavailable - Confirmed working: CACA 3.15x detected on test datac179f19
-
feat(ai/forensics): complete β Policy-Benefit Causal Analysisβ
ai/forensics/policy_benefit_analyzer.py: three causal inference methods Method 1 β Granger causality: Compares residual variance of an autoregressive model for the contract series (restricted) versus a VAR model that also includes lagged policy event values (unrestricted). F-statistic above 2.5 indicates policy events carry predictive power over contracts. Lag order 2. Fallback-safe when series is too short. Method 2 β Transfer entropy: Discretised joint/marginal probability estimation over binned contract and policy time series. TE(policy->contracts) above 0.15 nats indicates directional information flow from policy activity to contract patterns. Method 3 β Cumulative Abnormal Contract Award (CACA): For each policy event, computes expected contract volume from the 180-day pre-event baseline and compares to 180-day post-event actual. CACA ratio above 1.5x is flagged. All methods are fallback-safe with sample data when databasβ¦66297ad -
feat(ai/forensics):complete β Linguistic Fingerprintingβ
ai/forensics/linguistic_fingerprint.py: three-method analysis engine Method 1 β Burrows Delta authorship attribution: Computes function word frequency vectors for all documents associated with an entity. Z-score normalised across the corpus. Pairwise Delta (mean absolute z-score difference) below 1.5 indicates documents share a stylometric authorship cluster. Method 2 β Template reuse detection: Structural skip-1 bigram fingerprinting (Rabin-style). Jaccard similarity of shingle sets above 0.78 flags nominally independent documents as sharing a common structural template. Method 3 β Shadow drafting detection: TF-IDF cosine similarity between corporate consultation submissions and final policy or bill text. Similarity above 0.72 indicates the submission may have been the source draft. All three methods are fallback-safe with sample documents when database is unavailable. validate_language() not required here as outputs describe docβ¦c374115
-
feat(ai/forensics):complete β Revolving Door + TBMLβ
- ai/forensics/revolving_door.py: career transition detector Cooling-off violation: government role β private board < 365 days Pre-employment benefit: company received contracts before appointment Fallback-safe with sample data when DB unavailable - ai/forensics/tbml_detector.py: trade-based transfer indicators Price anomaly: contracts > 2.5 std-dev from entity mean Subcontract loop: circular re-award chain detection via Neo4j cycles Director-change window: directorship change within 90 days of contract - api/routes/conflict.py: GET /conflict/revolving-door/{entity_id}, GET /conflict/tbml/{entity_id} - api/main.py: conflict router registeredc4cc55b -
Refactor comments in cartel_detector.py
Unverified signature60a86c1 -
Fix formatting issues in bid_dna.py
Unverified signature010fb05 -
Refactor comments and constants in benami_detector.py
Unverified signatureedb68ed -
Update benami_detector.py
Unverified signatureb99bd56
-
feat: Procurement DNA + Cartel Detection + full pipeline fixβ
pipeline.py: expanded from 5 to all 20 scrapers, parallel ThreadPoolExecutor - loksabha, sebi, ed, cvc, njdg, electoral_bond, icij, opensanctions, wikidata, ibbi, ngo_darpan, cppp, ncrb, lgd β all now included - parallel=True by default (6 workers), fallback-safe per scraper - per_source count in summary output admin.py: POST /admin/pipeline triggers full pipeline in background - GET /admin/pipeline/status shows progress and last result - auto-loads into Neo4j after pipeline completes - works on HF Space with no local DB connection needed ai/forensics/bid_dna.py: TF-IDF cosine similarity on bid documents - SIMILARITY_THRESHOLD=0.72 flags near-identical bids from different vendors - cover-bid detection via price clustering (std dev analysis) ai/forensics/cartel_detector.py: 3-method cartel detection - award rotation: equal share pattern across vendors - co-bidding network: same vendors appearing together repeatedly api/routes/procurement.py: GET /procurement/bid-β¦eece913 -
feat(ai/forensics): complete β Benami Entity Detectionβ
- ai/forensics/benami_detector.py: 5-factor proxy scoring engine Factor 1: director_age_anomaly (0.25) β directors under age 25 Factor 2: surname_network (0.25) β family name clusters in co-directorships Factor 3: address_cluster (0.20) β 3+ companies at same registered address Factor 4: company_age_contract (0.20) β company < 180 days old at first contract Factor 5: single_director (0.10) β sole-director companies with govt contracts Composite score 0-100. Level: HIGH β₯65, MODERATE β₯40, LOW <40. All 5 factors fallback-safe when DB unavailable. - ai/investigators/benami_investigator.py: 15th investigator (weight 0.09) - api/routes/benami.py: GET /benami/{entity_id} - api/main.py: benami router registeredb5a49d5
-
feat(ai/forensics): complete β affidavit wealth trajectory engineβ
- ai/forensics/affidavit_analyzer.py: Kalman filter constant-velocity model on affidavit time series across election cycles 2004-2024. Innovation |z_k - H*x_hat_k| > 3*sqrt(S_k) flags anomalous jump. Expected growth model: declared salary + 8% FD returns + 60% savings. Residual ratio > 2x = HIGH, > 5x = VERY_HIGH unexplained wealth. Asset disappearance: tracks properties across years, flags absent items. Pre-election surge: flags movable asset increase > 50% before election. - ai/investigators/affidavit_investigator.py: 14th investigator module. Weight 0.10. Queries Affidavit nodes via FILED_AFFIDAVIT relationship. Falls back to Politician.total_assets_crore if no affidavit nodes. - api/routes/affidavit.py: GET /affidavit/{entity_id} Returns full trajectory analysis with Kalman result and findings. - api/main.py: affidavit router registered closes#47eca3358