-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Introduce Extended Compliance Rules #1–#15 #6885
Comments
pethers
added a commit
that referenced
this issue
Dec 22, 2024
#6885 Add new Drools rules and move existing rules to a new folder structure. * Add `PoliticianAttendance.drl` with rules for checking low daily attendance and low attendance in a specific region. * Add `PartyAttendance.drl` with rules for checking high abstain rates, high absence rates for new parties, and no official documents. * Add `PoliticianLeadership.drl` with rules for checking high committee leadership ratio and multiple committee leadership roles. * Add `PartyLeadership.drl` with rules for checking single person controlling multiple leadership roles and forming coalitions with previously opposed parties. * Add `PoliticianAgeAndExperience.drl` with rules for checking extensive EU experience but zero government experience and overshadowed committee leadership. * Add `PartyAgeAndExperience.drl` with rules for checking low headcount but claims nationwide reach. * Add `PoliticianDocumentActivity.drl` with rules for checking high daily and annual document output. * Add `PartyDocumentActivity.drl` with rules for checking no official documents. * Add `PoliticianSpeechMotion.drl` with rules for checking zero motions filed in the past year. * Add `PartyPressReleases.drl` with rules for checking no press releases in the past year. * Add `PoliticianComplianceGeneral.drl` with rules for general compliance checks for politicians. * Add `PartyComplianceGeneral.drl` with rules for general compliance checks for parties. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Hack23/cia?shareId=XXXX-XXXX-XXXX-XXXX).
pethers
added a commit
that referenced
this issue
Dec 23, 2024
…6886) * Add new Drools rules and move existing rules to new folder structure #6885 Add new Drools rules and move existing rules to a new folder structure. * Add `PoliticianAttendance.drl` with rules for checking low daily attendance and low attendance in a specific region. * Add `PartyAttendance.drl` with rules for checking high abstain rates, high absence rates for new parties, and no official documents. * Add `PoliticianLeadership.drl` with rules for checking high committee leadership ratio and multiple committee leadership roles. * Add `PartyLeadership.drl` with rules for checking single person controlling multiple leadership roles and forming coalitions with previously opposed parties. * Add `PoliticianAgeAndExperience.drl` with rules for checking extensive EU experience but zero government experience and overshadowed committee leadership. * Add `PartyAgeAndExperience.drl` with rules for checking low headcount but claims nationwide reach. * Add `PoliticianDocumentActivity.drl` with rules for checking high daily and annual document output. * Add `PartyDocumentActivity.drl` with rules for checking no official documents. * Add `PoliticianSpeechMotion.drl` with rules for checking zero motions filed in the past year. * Add `PartyPressReleases.drl` with rules for checking no press releases in the past year. * Add `PoliticianComplianceGeneral.drl` with rules for general compliance checks for politicians. * Add `PartyComplianceGeneral.drl` with rules for general compliance checks for parties. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Hack23/cia?shareId=XXXX-XXXX-XXXX-XXXX). * Remove duplicate methods `getCommitteeLeadershipRatio()` and `getAge()` from `PoliticianComplianceCheckImpl.java` * Remove references to old document summary classes and add new ones * **Imports** - Remove references to `ViewRiksdagenPoliticianDocumentDailySummary`, `ViewRiksdagenPoliticianDocument`, and `ViewRiksdagenPartyDocumentDailySummary` from `com.hack23.cia.model.internal.application.data.politician.impl` and `com.hack23.cia.model.internal.application.data.party.impl` - Add references to `ViewRiksdagenPoliticianDocumentDailySummary`, `ViewRiksdagenPoliticianDocument`, and `ViewRiksdagenPartyDocumentDailySummary` from `com.hack23.cia.model.internal.application.data.document.impl` * Replace method calls in compliance check implementations * Replace `getDocumentCount()` with `getTotalAssignments()` in `PartyComplianceCheckImpl` and `PoliticianComplianceCheckImpl` * Replace `getPressReleaseCount()` with `getCurrentAssignments()` in `PartyComplianceCheckImpl` * Replace `getPartySwitchingCount()` with `getTotalPartyAssignments()` in `PartyComplianceCheckImpl` * Replace `getPersonId()` with `getEmbeddedId().getPersonId()` and `getPartyShortCode()` with `getEmbeddedId().getPartyShortCode()` in `RulesEngineImpl` * Implement proper null checks and handle long to int conversions explicitly using `Math.min()` in `RulesEngineImpl` * Replace method calls and handle long to int conversions explicitly * Replace `getDocumentCount()` with `getTotalAssignments()` and handle long to int conversion using `Math.min()` in `PartyComplianceCheckImpl.java` and `PoliticianComplianceCheckImpl.java` * Replace `getPressReleaseCount()` with `getCurrentAssignments()` and handle long to int conversion using `Math.min()` in `PartyComplianceCheckImpl.java` * Replace `getPartySwitchingCount()` with `getTotalPartyAssignments()` and handle long to int conversion using `Math.min()` in `PartyComplianceCheckImpl.java` * Implement proper null checks when accessing embedded objects in `RulesEngineImpl.java` * Replace method calls and handle conversions in `RulesEngineImpl.java` and `PartyComplianceCheckImpl.java`. * **RulesEngineImpl.java** - Replace `getEmbeddedId()` with `getPersonReferenceId()` in `ViewRiksdagenPoliticianDocument` - Implement proper null checks when accessing embedded objects * **PartyComplianceCheckImpl.java** - Replace `getDocumentCount()` with `getTotalAssignments()` - Replace `getPressReleaseCount()` with `getCurrentAssignments()` - Replace `getPartySwitchingCount()` with `getTotalPartyAssignments()` - Handle long to int conversions explicitly using `Math.min()`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Objective / Context
We want to enhance the existing Drools-based compliance checks in the CIA project to capture more domain-focused scenarios that a political analyst, journalist, or researcher might find valuable. These new or extended rules build upon the existing
PoliticianComplianceCheckImpl
andPartyComplianceCheckImpl
classes, leveraging annual summaries and additional attributes (e.g., days served, document counts, leadership roles, etc.). By adding these rules, we aim to:Below is a list of 15 proposed rules (short names + purpose). They can be integrated into the new
.drl
files or integrated into existing ones based on the current rule structure.Summary of Proposed Rules
Politician with Extremely High Committee Leadership Ratio
committeeLeadershipDays / committeeDays
exceeds a certain threshold (e.g., >70%), indicating outsized influence in committee leadership roles.Politician with Extremely Low Annual Attendance
Newly Registered Party with High Absence Rate
Politician Leading Multiple Committees Simultaneously
Politician with Extensive EU Experience but Zero Government Experience
activeEu
) but never served in national government, possibly indicating a gap in domestic policy background.Politician with High Annual Document Output
Politician Filed Zero Motions in the Past Year
Party with Single Person Controlling Multiple Leadership Roles
Party Forming Coalition with Previously Opposed Party
Politician Changed Party Multiple Times
Party with Single-Year Abstain Spike
Politician Near or Past Retirement Age Holding Multiple Roles
Party with No Official Documents This Year
Politician Overshadowed in Committee Leadership
Party Reliant on Very Small Headcount
headCount
is under a minimal threshold while still claiming broad coverage, raising representation concerns or potential compliance issues.Implementation Details
ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual
) or parties (ViewRiksdagenVoteDataBallotPartySummaryAnnual
).PoliticianComplianceCheckImpl
(e.g.,getAnnualDocumentCount()
,isMultipleLeadershipRolesActive()
, etc.)PartyComplianceCheckImpl
(e.g.,daysSinceRegistered()
,getPartyHeadCount()
, orgetAnnualDocumentCount()
).RulesEngineImpl
or embed them in these compliance-check objects.Goal: Merge these extended checks into the project’s
.drl
files, providing more comprehensive oversight and producing newRuleViolation
records for both Politicians and Parties when they meet these conditions.The text was updated successfully, but these errors were encountered: