Build a Chemical Manifest IP Obfuscation and Sharing Hub — implementation
Linked challenge: Build a Chemical Manifest IP Obfuscation and Sharing Hub
Prompt source
implementation78 lines11 sectionsNo variables1 code block
## Build
Process OpenAttestation wrapped chemical transport manifests. Obfuscate proprietary chemical mixture ratios before sharing transit documents with external heavy hauler fleets.
## User
Chemical Logistics Compliance Officer
## Workflow
1. Parse wrapped OpenAttestation chemical manifests containing proprietary mixture formulas and safety hazard classes.
2. Identify fields tagged as proprietary chemical compound ratios for intellectual property protection.
3. Execute the obfuscateDocument utility from @govtechsg/open-attestation to strip proprietary ratios while retaining hazard classes.
4. Export the redacted verification bundle to external transport subcontractors.
## Interface
Obfuscation pipeline dashboard showing processed manifests, retained hazard classes, and redacted payload schema validation.
## Data
Synthetic OpenAttestation v2 JSON documents representing Singapore chemical transport manifests. Explicitly note these are simplified synthetic app records, not complete official schema files.
Starter examples below are synthetic. They are not downloaded records.
## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Uses the obfuscateDocument and validateSchema functions from @govtechsg/open-attestation to securely strip intellectual property fields.
## Tools
mastra-ai, typescript, zod, @govtechsg/open-attestation.
Mastra AI orchestrates the multi-step document parsing, field classification, and cryptographic redaction pipeline.
General LLM via API for classifying proprietary text blocks and drafting redacted document transmittal notices.
## 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
- Correctly parse OpenAttestation v2 JSON payloads representing chemical transport manifests.
- Apply obfuscateDocument on specified proprietary fields without invalidating cryptographic target hashes.
- Retain critical hazard class visibility while successfully validating the redacted payload schema.
- Output a verified subset bundle of the original transport manifest ready for sharing.
## Starter Examples
```json
[
{
"input": {
"document_id": "DOC-CHEM-1101",
"document_type": "CHEMICAL_TRANSPORT_MANIFEST",
"hazard_class": "CORROSIVE",
"mixture_data": {
"sulfuric_acid_percent": 45,
"proprietary_catalyst_percent": 5
},
"fields_to_obfuscate": [
"mixture_data"
]
},
"expected_output": {
"valid_schema": true,
"obfuscation_applied": true,
"redacted_fields": [
"mixture_data"
],
"retained_hazard_class": "CORROSIVE",
"clean_bundle_exported": true
}
},
{
"input": {
"document_id": "DOC-CHEM-1102",
"document_type": "STANDARD_TRANSPORT_MANIFEST",
"hazard_class": "NONE",
"mixture_data": {
"water_percent": 99,
"salt_percent": 1
},
"fields_to_obfuscate": []
},
"expected_output": {
"valid_schema": true,
"obfuscation_applied": false,
"redacted_fields": [],
"retained_hazard_class": "NONE",
"clean_bundle_exported": true
}
}
]
```
## Safety
Ensures proprietary mixture ratios are permanently stripped locally prior to third-party distribution without impacting valid document structures.
Use mock external writes. Require human review before any real deployment.