Skip to content

feat: Add Daily Civic Intelligence Refinement Engine#901

Open
RohanExploit wants to merge 1 commit into
mainfrom
feat/daily-refinement-engine-6467550914294898290
Open

feat: Add Daily Civic Intelligence Refinement Engine#901
RohanExploit wants to merge 1 commit into
mainfrom
feat/daily-refinement-engine-6467550914294898290

Conversation

@RohanExploit

@RohanExploit RohanExploit commented Jul 12, 2026

Copy link
Copy Markdown
Owner

This PR delivers the Daily Civic Intelligence Refinement Engine which parses new submissions daily and automatically improves parameters for severity, grouping, and issue intelligence tracking.

The implementation:

  • Uses node-cron inside scheduler/dailyRefinementJob.ts
  • Writes localized configuration updates into data/modelWeights.json & snapshots into data/dailySnapshots/YYYY-MM-DD.json.
  • Contains no external APIs (fully offline logic mapping to backend/data/issues.db).

All checks pass (Node tests via npm test and frontend suites via npm test --prefix frontend). Note that preexisting backend tests failures reported in backend/main.py are explicitly ignored for isolated Node sub-tasks based on the AGENTS.md/Memory.


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


Summary by cubic

Adds a daily refinement engine that analyzes new civic submissions and auto-tunes severity, grouping, and intelligence scores. Runs locally on a daily schedule and snapshots each update for auditability.

  • New Features

    • Daily job in scheduler/dailyRefinementJob.ts using node-cron; supports --run-now.
    • Engines: TrendAnalyzer (trends/spikes), AdaptiveWeights (severity multipliers), PriorityEngine (duplication thresholds), IntelligenceIndex (civic health score).
    • Reads from backend/data/issues.db; writes to data/modelWeights.json and data/dailySnapshots/YYYY-MM-DD.json; no external APIs.
  • Dependencies

    • Adds node-cron for scheduling.

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

Review in cubic

This PR introduces the automated, self-improving infrastructure requested for VishwaGuru. The engine is fully local and runs every 24 hours (or via `--run-now`) with the following logic:

- **TrendAnalyzer**: Detects trending keywords and category volume spikes in the last 24h.
- **AdaptiveWeights**: Dynamically optimizes issue severity multipliers.
- **PriorityEngine**: Adjusts duplication thresholds if mass reporting events occur.
- **IntelligenceIndex**: Generates a system-wide civic health score based on aggregate heuristics.

Includes comprehensive unit tests under `/tests` running successfully. Documentation is recorded in `docs/civic-intelligence-engine.md`.
Copilot AI review requested due to automatic review settings July 12, 2026 18:59
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@netlify

netlify Bot commented Jul 12, 2026

Copy link
Copy Markdown

Deploy Preview for fixmybharat canceled.

Name Link
🔨 Latest commit a3166d9
🔍 Latest deploy log https://app.netlify.com/projects/fixmybharat/deploys/6a53e405a027420008f4fb8a

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown

🙏 Thank you for your contribution, @RohanExploit!

PR Details:

Quality Checklist:
Please ensure your PR meets the following criteria:

  • Code follows the project's style guidelines
  • Self-review of code completed
  • Code is commented where necessary
  • Documentation updated (if applicable)
  • No new warnings generated
  • Tests added/updated (if applicable)
  • All tests passing locally
  • No breaking changes to existing functionality

Review Process:

  1. Automated checks will run on your code
  2. A maintainer will review your changes
  3. Address any requested changes promptly
  4. Once approved, your PR will be merged! 🎉

Note: The maintainers will monitor code quality and ensure the overall project flow isn't broken.

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