| name | add-official-source |
| description | Add or update an official data source ingestion flow, including source registry, fetch job, normalization, logging and API exposure. |
| argument-hint | [source-name] |
Add Official Source
Add or update the official source requested in $ARGUMENTS.
Required process
-
Read:
docs/DATA_SOURCES.md
docs/DATABASE.md
docs/API.md
docs/SECURITY_AND_PRIVACY.md
-
Confirm the source type:
- seismic
- tsunami
- civil protection
- recommendations
- manual verified source
-
Add or update official_sources.
-
Implement fetch logic:
- timeout
- controlled retry
- error handling
- fetch run logging
- raw payload storage
-
Normalize data into internal tables.
-
Never expose raw external payload directly from public endpoints.
-
Ensure public API returns:
- normalized fields
- source name
- source URL if safe
- last updated timestamp
- stale indicator
-
Add tests for:
- successful normalization
- duplicate external ID
- source failure
- malformed payload
- stale data
-
Run backend checks.
-
Ask backend-official-data or qa-code-reviewer to review the source integration.