Skip to main content
Loading navigation
Back to prompt library

Build a Dangerous Goods Intake and Yard Segregation Planner — implementation

Linked challenge: Build a Dangerous Goods Intake and Yard Segregation Planner

Prompt source

implementation68 lines11 sectionsNo variables1 code block
## Build
Review chemical dangerous goods declarations submitted via FormSG webhooks. Validate segregation constraints and synthesize compliant warehouse yard staging plans before vessel berthing.

## User
Dangerous Goods Safety Officer

## Workflow
1. Process incoming dangerous goods declarations from FormSG intake webhooks.
2. Cross-reference UN classification codes against dangerous goods compatibility tables.
3. Scan designated yard blocks to detect hazardous co-location violations.
4. Synthesize a verified container yard placement plan and output handling instructions.

## Interface
Interactive 2D container yard grid visualizer flagging segregation breaches and proposing safe staging slots.

## Data
Construct sample dangerous goods declarations following the FormSG attachment and field payload format.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Singapore government FormSG](https://raw.githubusercontent.com/opengovsg/FormSG/develop/README.md)
Parses multi-field FormSG form submissions and attachment metadata representing commercial hazmat filings.

## Tools
pydantic-ai, fastapi, open-attestation.
Pydantic AI ensures rigid type validation and guardrails over hazardous goods classification data.
Local or hosted LLM to interpret SDS handling guidelines and explain hazardous segregation 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
- Ingest FormSG hazardous chemical declarations and SDS submittals.
- Validate chemical classes against Singapore port dangerous goods yard compatibility matrices.
- Generate compliant container yard stacking coordinates preventing incompatible co-location.
- Export verified staging manifests with TradeTrust-compatible OpenAttestation digital signatures.

## Starter Examples
```json
[
  {
    "input": {
      "un_class": "Class 3 Flammable Liquids",
      "un_number": "UN1203",
      "volume_liters": 5000,
      "yard_adjacent_containers": [
        "UN3101 Class 5.2 Organic Peroxide"
      ]
    },
    "expected_output": {
      "action": "RELOCATE_CONTAINER",
      "buffer_distance_required_meters": 12,
      "segregation_violation": true,
      "staging_permitted": false
    }
  },
  {
    "input": {
      "un_class": "Class 3 Flammable Liquids",
      "un_number": "UN1203",
      "volume_liters": 5000,
      "yard_adjacent_containers": [
        "UN1263 Class 3 Paint"
      ]
    },
    "expected_output": {
      "action": "ASSIGN_SLOT",
      "buffer_distance_required_meters": 0,
      "segregation_violation": false,
      "staging_permitted": true
    }
  }
]
```

## Safety
Staging plans are synthetic simulations; strictly non-operational for actual physical hazardous material handling.
Use mock external writes. Require human review before any real deployment.