Skip to content

feat: document and test daily civic intelligence refinement engine#567

Open
RohanExploit wants to merge 9 commits intomainfrom
daily-civic-intelligence-refinement-engine-1889031046119834928
Open

feat: document and test daily civic intelligence refinement engine#567
RohanExploit wants to merge 9 commits intomainfrom
daily-civic-intelligence-refinement-engine-1889031046119834928

Conversation

@RohanExploit
Copy link
Owner

@RohanExploit RohanExploit commented Mar 20, 2026

This PR updates the Daily Civic Intelligence Refinement Engine by explicitly documenting the algorithm and evolution logic directly in the TypeScript services using JSDoc. It also implements additional unit testing edge cases for default severity categorization and empty dataset handling, fulfilling the request to "Write unit tests" and "Add documentation explaining algorithm and evolution logic." Finally, it ensures the test suite accurately runs unit, integration, and system testing.


PR created automatically by Jules for task 1889031046119834928 started by @RohanExploit


Summary by cubic

Documents the Daily Civic Intelligence Refinement Engine with exact rules, hotspot detection, and a resolutions‑weighted index; adds edge‑case tests; migrates Netlify config to fix frontend CI.

  • New Features

    • Added JSDoc in DailyRefinementJob, TrendAnalyzer, AdaptiveWeights, IntelligenceIndex, and PriorityEngine detailing: 24h cadence; keyword extraction (>=3 chars, stop‑words, top 5); spike rule (>50% with >5 guard) and “Emerging Concern” flag; ~1.1 km geoclusters with highest‑density region; adaptive boosts (+0.5 up to 10) and duplicate‑threshold range 0.70–0.95 by volume; index math (baseline 50, +0.5 per keyword, −1.5 per spike, weighted by resolved issues); and daily snapshot JSON path.
    • Tests: empty issue lists return baseline index (50.0, delta 0); descriptions with no keywords default to Low severity with 10/10 scores and clear reasoning.
  • Bug Fixes

    • Migrated Netlify config to the frontend app to resolve CI failures: added frontend/netlify.toml (publish dist), moved SPA routing and security headers to frontend/public/_redirects and frontend/public/_headers, and removed redirects/headers from root netlify.toml.
    • Updated dev dependencies to keep tests stable: @types/jest to ^29.5.14, jest-util to ^30.3.0, ts-jest to ^29.4.6.

Written for commit acdaeed. Summary will update on new commits.

Summary by CodeRabbit

  • Chores

    • Updated TypeScript/Jest dev tooling versions.
  • Documentation

    • Added comprehensive docs for several core services describing orchestration, tuning, scoring, trend detection, and snapshot behaviors.
  • Tests

    • Added an integration test for baseline index output.
    • Added a unit test for severity/urgency edge-case behavior.
  • Configuration

    • Added SPA routing and global security headers for frontend; removed previous global Netlify routing/headers.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants