Build a FormSG Marine Bunkering Fuel Quality Intake Analyzer — implementation
Linked challenge: Build a FormSG Marine Bunkering Fuel Quality Intake Analyzer
Prompt source
implementation72 lines11 sectionsNo variables1 code block
## Build
Ingest marine bunker fuel surveyor reports submitted via FormSG webhooks. Validate sulfur content limits against maritime regulations and issue OpenAttestation wrapped quality certificates for vessel compliance and transparent fuel provenance.
## User
Maritime Bunker Surveyor Operations
## Workflow
1. Receive and parse encrypted submission webhooks modeled on Singapore FormSG payloads containing marine fuel lab results.
2. Extract tested sulfur content percentages, density, and viscosity parameters from the submitted bunker reports.
3. Evaluate the sulfur content against MARPOL 0.5% global limits or 0.1% ECA limits using defined validation rules.
4. Produce a wrapped OpenAttestation bunker delivery note attesting to fuel compliance or generate a rejection report.
## Interface
Terminal dashboard showing real-time FormSG fuel survey submissions, sulfur compliance status, and generated OpenAttestation certificates.
## Data
Simulated FormSG submission webhooks containing marine fuel quality data, vessel details, and MARPOL limit specifications.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Singapore government FormSG](https://raw.githubusercontent.com/opengovsg/FormSG/develop/README.md)
Adopts FormSG webhook payload architecture for structured maritime surveyor data intake.
## Tools
pydantic-ai, fastapi, pandas.
Pydantic AI provides robust data validation for complex nested FormSG webhook payloads and ensures rigorous schema enforcement for regulatory compliance checks.
Local or hosted LLM API capable of interpreting structured test results and applying logical compliance rules.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Decrypt or parse simulated FormSG webhook attachments representing marine bunker fuel reports.
- Accurately evaluate sulfur content against specific MARPOL global or ECA limits provided in the payload.
- Generate a wrapped OpenAttestation intake certificate confirming compliant receipt for valid bunker fuel.
- Produce a clear rejection message when the sulfur content exceeds the stated regulatory threshold.
## Starter Examples
```json
[
{
"input": {
"formsg_submission_id": "BUNK-991",
"vessel_name": "Oceanic Spirit",
"fuel_grade": "VLSFO",
"test_results": {
"sulfur_percent": 0.45,
"density_kg_m3": 920
},
"marpol_limit_percent": 0.5
},
"expected_output": {
"compliance_verified": true,
"sulfur_deviation_flag": false,
"oa_bunker_note_hash": "0x78ab12eef45c6",
"operator_memo": "VLSFO compliant with 0.5% MARPOL limit. Wrapped delivery note generated. Simplified synthetic application record."
}
},
{
"input": {
"formsg_submission_id": "BUNK-992",
"vessel_name": "Baltic Trader",
"fuel_grade": "MGO",
"test_results": {
"sulfur_percent": 0.15,
"density_kg_m3": 890
},
"marpol_limit_percent": 0.1
},
"expected_output": {
"compliance_verified": false,
"sulfur_deviation_flag": true,
"oa_bunker_note_hash": null,
"operator_memo": "REJECTED: MGO sulfur content (0.15%) exceeds ECA limit (0.1%). Non-compliant bunker note withheld. Simplified synthetic application record."
}
}
]
```
## Safety
Automated compliance checks are operational aids; final bunker delivery authorizations must be verified by certified maritime surveyors.
Use mock external writes. Require human review before any real deployment.