Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/config/parseInstructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,30 @@ const USER_PROMPT = `Please parse the following human rights report and extract
}
]
}
<<<<<<< HEAD
]
\`\`\`
=======
- description: {en: "English description (REQUIRED, 10-2000 chars)", ar: "Arabic description (REQUIRED, 10-2000 chars)"}
- perpetrator_affiliation: assad_regime, post_8th_december_government, various_armed_groups, isis, sdf, israel, turkey, druze_militias, russia, iran_shia_militias, international_coalition, bedouins, unknown
- certainty_level: confirmed, probable, possible
- verified: false (default)
- casualties: number (deaths, default 0)
- injured_count: number (default 0)
- kidnapped_count: number (default 0)
- detained_count: number (default 0)
- displaced_count: number (default 0)

# OPTIONAL FIELDS:
- reported_date: YYYY-MM-DD format (optional)
- source: {en: "English source", ar: "Arabic source"} (optional, max 1500 chars)
- source_url: {en: "English URL", ar: "Arabic URL"} (optional, max 1000 chars)
- perpetrator: {en: "English perpetrator", ar: "Arabic perpetrator"} (optional, max 200 chars)
- verification_method: {en: "English method", ar: "Arabic method"} (optional, max 500 chars)
- victims: array of victim objects (optional)
- media_links: array of URLs (optional)
- tags: array of {en: "English tag", ar: "Arabic tag"} (optional, max 50 chars each)
>>>>>>> 864bb26 (add bedouins as a separate perpetrator affiliation)
Comment on lines +101 to +124

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

This file contains merge conflict markers (<<<<<<< HEAD, =======, >>>>>>>). These must be resolved before the pull request can be merged. Please rebase your branch onto the target branch and resolve the conflicts.


# PARSING GUIDELINES

Expand Down Expand Up @@ -301,6 +323,12 @@ For found Mass graves, use "assad_regime" as the perpetrator_affiliation, unless
- Maghawir al-Thawra / Revolutionary Commando Army (when identified as U.S.-backed)
- Any forces explicitly identified as "U.S.-backed" or operating under U.S. direction

### Bedouin Tribes ("bedouins")
- Bedouin tribes
- Bedouin tribesmen
- Bedouin tribespeople
- Bedouin tribespeople

## IMPORTANT CLASSIFICATION RULES

1. **Time-Based Classification**: For incidents before December 8, 2024, classify all government forces as "assad_regime". For incidents after this date, use "assad_regime" only for forces explicitly identified as Assad loyalists or remnants.
Expand Down
2 changes: 1 addition & 1 deletion src/models/Violation.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const ViolationSchema = new mongoose.Schema({
},
perpetrator_affiliation: {
type: String,
enum: ['assad_regime', 'post_8th_december_government', 'various_armed_groups', 'isis', 'sdf', 'israel', 'turkey', 'druze_militias', 'russia', 'iran_shia_militias', 'international_coalition', 'unknown'],
enum: ['assad_regime', 'post_8th_december_government', 'various_armed_groups', 'isis', 'sdf', 'israel', 'turkey', 'druze_militias', 'russia', 'iran_shia_militias', 'international_coalition', 'bedouins', 'unknown'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The perpetrator_affiliation enum is now defined in multiple places (Violation.js, src/config/parseInstructions.js, src/swagger.yaml). This can lead to inconsistencies and makes it harder to maintain.

To improve maintainability, consider defining this list as a constant in a shared file (e.g., src/config/constants.js) and importing it wherever it's needed. This ensures a single source of truth for these values.

For example:

src/config/constants.js

export const PERPETRATOR_AFFILIATIONS = [
  'assad_regime',
  'post_8th_december_government',
  'various_armed_groups',
  'isis',
  'sdf',
  'israel',
  'turkey',
  'druze_militias',
  'russia',
  'iran_shia_militias',
  'international_coalition',
  'bedouins',
  'unknown'
];

src/models/Violation.js

import { PERPETRATOR_AFFILIATIONS } from '../config/constants';
// ...
perpetrator_affiliation: {
  type: String,
  enum: PERPETRATOR_AFFILIATIONS,
  // ...
}

While this change is a larger refactor, it would significantly improve the codebase's quality.

required: [true, 'Perpetrator affiliation is required'],
default: 'unknown'
},
Expand Down
2 changes: 1 addition & 1 deletion src/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ components:
description: Entity that committed the violation
perpetrator_affiliation:
type: string
enum: [assad_regime, post_8th_december_government, various_armed_groups, isis, sdf, israel, turkey, druze_militias, russia, iran_shia_militias, international_coalition, unknown]
enum: [assad_regime, post_8th_december_government, various_armed_groups, isis, sdf, israel, turkey, druze_militias, russia, iran_shia_militias, international_coalition, bedouins, unknown]
description: Type of perpetrator affiliation
perpetrator_affiliation_type:
type: string
Expand Down
Loading