Back to prompt library
Build a Flat-Rack Lashing Inspection and Tamper Proof Wrapper — implementation
Linked challenge: Build a Flat-Rack Lashing Inspection and Tamper Proof Wrapper
Prompt source
implementation72 lines11 sectionsNo variables1 code block
## Build
Parse out-of-gauge flat-rack container lashing inspection logs and surveyor photos. Wrap compliance findings into verifiable OpenAttestation proofs to prevent maritime rejection and generate urgent re-securing dispatch notices.
## User
Cross-Border Logistics Dispatcher
## Workflow
1. Ingest flat-rack container inspection logs and lashing tension metrics from terminal operations.
2. Evaluate lashing point securing requirements against out-of-gauge cargo mass distribution profiles.
3. Package non-compliant lashing inspection data into an OpenAttestation schema document and generate a merkle root.
4. Export the wrapped evidence dossier and generate an urgent re-securing dispatch notice.
## Interface
Web incident triage console showing lashing tension metrics, inspection photographs, OpenAttestation proof trees, and draft dispatch notices.
## Data
Simulated terminal flat-rack inspection logs and tension measurements stored in local JSON fixtures mimicking maritime surveyor operations.
Starter examples below are synthetic. They are not downloaded records.
## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Invokes wrapDocuments and validateSchema from @govtechsg/open-attestation to wrap normalized lashing inspection reports into verifiable merkle proofs.
## Tools
pydantic-ai, fastapi, typescript.
Pydantic AI enforces type-safe schemas across lashing inspection entries and verified OpenAttestation document generation.
Fast hosted instruction model via API for generating concise dispatch notices based on structured compliance codes.
## 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
- Wrap lashing inspection records into an OpenAttestation compliant wrapped document hash.
- Calculate lashing compliance deficit based on the difference between required points and secured points.
- Verify document schema conformance using validateSchema from the OpenAttestation SDK.
- Export a dispatch notice payload with clear shipment IDs and securing instructions.
## Starter Examples
```json
[
{
"input": {
"shipment_id": "OOG-2024-001",
"cargo_type": "Generator Stator",
"mass_tonnes": 45,
"lashing_points_secured": 6,
"required_lashing_points": 8,
"inspector_notes": "Aft chains loose"
},
"expected_output": {
"exception_verified": true,
"lashing_compliant": false,
"compliance_deficit": 2,
"wrapped_document_id": "urn:tradetrust:lashing:OOG-2024-001",
"target_hash_generated": true,
"customer_notice_summary": "Shipment OOG-2024-001 rejected due to insufficient lashing points (6/8). Re-securing required."
}
},
{
"input": {
"shipment_id": "OOG-2024-002",
"cargo_type": "Steel Pipes",
"mass_tonnes": 20,
"lashing_points_secured": 10,
"required_lashing_points": 10,
"inspector_notes": "Fully secured"
},
"expected_output": {
"exception_verified": true,
"lashing_compliant": true,
"compliance_deficit": 0,
"wrapped_document_id": "urn:tradetrust:lashing:OOG-2024-002",
"target_hash_generated": true,
"customer_notice_summary": "Shipment OOG-2024-002 approved. Lashing compliant."
}
}
]
```
## Safety
Ensures all compliance alerts and notifications remain simulated drafts without pushing live updates to port systems or shipping ledgers.
Use mock external writes. Require human review before any real deployment.