Build a Logistics Cargo Declaration FormSG Webhook Processor
Process incoming cargo declaration webhooks from FormSG. Verify webhook authenticity, classify cargo descriptions into standardized HS codes using an LLM, and calculate initial port handling fees.
What you are building
Process incoming cargo declaration webhooks from FormSG. Verify webhook authenticity, classify cargo descriptions into standardized HS codes using an LLM, and calculate initial port handling fees.
Freight forwarding operations agent
Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG.
Authenticate the payload by verifying the mock FormSG webhook signature to ensure data origin authenticity.
Analyze the cargo description field with an LLM to predict the most likely 6-digit HS commodity code.
Calculate port handling fees based on the submitted weight (0.50 SGD per kg for standard cargo, 0.70 SGD per kg for hazardous cargo), generating a billing draft.
Freight operations dashboard showing verified FormSG submissions, predicted HS codes, and calculated handling fee estimates.
Synthetic JSON array of 20 simplified synthetic app records (not complete official schema files) representing mock FormSG webhook payloads containing cargo descriptions and weights. Starter examples below are synthetic. They are not downloaded records.
Singapore government FormSG Utilizes the FormSG webhook verification concepts to authenticate incoming cargo declarations before processing.
dspy, fastapi, pydantic. DSPy provides robust LLM prompt optimization for accurate text-to-HS code classification from raw cargo descriptions. Capable LLM for classifying varied cargo descriptions into standardized HS codes.
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.
Correctly parses and validates mock FormSG webhook payload structures.
Predicts valid 6-digit HS codes for diverse cargo descriptions using the LLM.
Accurately calculates handling fees using the specified weight-based formula.
Outputs a structured billing summary JSON for each authenticated payload.
```json [ { "input": { "submission_id": "sub_123", "signature_valid": true, "form_responses": { "cargo_description": "Frozen Atlantic Salmon fillets, packaged in dry ice", "weight_kg": 500, "hazardous": false } }, "expected_output": { "submission_id": "sub_123", "authentication_status": "VERIFIED", "predicted_hs_code": "0304.41", "cargo_category": "FROZEN_SEAFOOD", "handling_fee_sgd": 250, "billing_status": "DRAFT_READY" } }, { "input": { "submission_id": "sub_124", "signature_valid": true, "form_responses": { "cargo_description": "Lithium-ion batteries for electric vehicles, UN3480", "weight_kg": 1200, "hazardous": true } }, "expected_output": { "submission_id": "sub_124", "authentication_status": "VERIFIED", "predicted_hs_code": "8507.60", "cargo_category": "DANGEROUS_GOODS", "handling_fee_sgd": 840, "billing_status": "DRAFT_READY" } } ] ```
Maintains offline processing of mock webhook payloads without connecting to live customs or government endpoints. Use mock external writes. Require human review before any real deployment.
Rules
Maintains offline processing of mock webhook payloads without connecting to live customs or government endpoints. Use mock external writes and human review.
How work is evaluated
Correctly parses and validates mock FormSG webhook payload structures. Predicts valid 6-digit HS codes for diverse cargo descriptions using the LLM. Accurately calculates handling fees using the specified weight-based formula. Outputs a structured billing summary JSON for each authenticated payload.
Runnable source, pinned dependencies, setup commands, working interface, example outputs, recorded demo, tests, and action logs.
Datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
Complete workflow
Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG. Authenticate the payload by verifying the mock FormSG webhook signature to ensure data origin authenticity. Analyze the cargo description field with an LLM to predict the most likely 6-digit HS commodity code. Calculate port handling fees based on the submitted weight (0.50 SGD per kg for standard cargo, 0.70 SGD per kg for hazardous cargo), generating a billing draft.
Missing or incorrect.
Partly complete, with documented gaps.
Complete, with reproducible evidence.
Correctness and evidence
Correctly parses and validates mock FormSG webhook payload structures. Predicts valid 6-digit HS codes for diverse cargo descriptions using the LLM. Accurately calculates handling fees using the specified weight-based formula. Outputs a structured billing summary JSON for each authenticated payload.
Missing or incorrect.
Partly complete, with documented gaps.
Complete, with reproducible evidence.
Review interface
Freight operations dashboard showing verified FormSG submissions, predicted HS codes, and calculated handling fee estimates.
Missing or incorrect.
Partly complete, with documented gaps.
Complete, with reproducible evidence.
Safe execution
Maintains offline processing of mock webhook payloads without connecting to live customs or government endpoints.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Learning goals
Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG.
Authenticate the payload by verifying the mock FormSG webhook signature to ensure data origin authenticity.
Analyze the cargo description field with an LLM to predict the most likely 6-digit HS commodity code.
Calculate port handling fees based on the submitted weight (0.50 SGD per kg for standard cargo, 0.70 SGD per kg for hazardous cargo), generating a billing draft.
Resources
Synthetic JSON array of 20 simplified synthetic app records (not complete official schema files) representing mock FormSG webhook payloads containing cargo descriptions and weights. Supplied starter examples are synthetic, not source extracts.
Challenge setup
Challenge input
Input details are not configured.
DSPy
Prompt and LM program optimization framework.
Evaluated output
No output checks are configured.
- Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG. Authenticate th...
- Correctly parses and validates mock FormSG webhook payload structures. Predicts valid 6-digit HS codes for...
- Freight operations dashboard showing verified FormSG submissions, predicted HS codes, and calculated handli...
- 2 public reference cases
- 3 configured tools
Shows the first task, up to three tools, and up to three evidence items.
View technical recipe
Configured tools
- DSPy · Optional
- DSPy · Optional
- DSPy · Optional
Evaluation contract
- Complete workflow · Weight 40
- Correctness and evidence · Weight 30
- Review interface · Weight 20
- Safe execution · Weight 10
Reference cases
- 2 public reference cases
Workflow tasks
No workflow tasks are configured.
Recipe freeze marker
No recipe freeze time is recorded.