Skip to main content
Loading navigation
Back to prompt library

Build a Production Lot Genealogy and Recall Rehearsal Engine — implementation

Linked challenge: Build a Production Lot Genealogy and Recall Rehearsal Engine

Prompt source

implementation88 lines11 sectionsNo variables1 code block
## Build
Trace serialized component consumption across sub-assemblies by parsing open62541 OPC UA lot tracking nodes. Generate containment blast-radius reports and supplier recall rehearsal dossiers for quality compliance teams.

## User
Quality Assurance Manager

## Workflow
1. Ingest simulated OPC UA node variable hierarchies detailing component lot bindings and parent sub-assemblies.
2. Traverse upstream and downstream parent-child lot relations to map the complete production genealogy tree.
3. Calculate the defect blast radius given a simulated quarantine lot identifier.
4. Generate a structured recall rehearsal packet specifying quarantined serialized units and warehouse locations.

## Interface
Genealogy graph explorer showing forward and reverse lot relationships, affected item totals, and quarantine export tables.

## Data
Simulated multi-tier bills of materials and lot binding records provided as JSON fixtures matching open62541 variable schemas.
Starter examples below are synthetic. They are not downloaded records.

## Source
[open62541 OPC UA](https://raw.githubusercontent.com/open62541/open62541/master/README.md)
OPC UA information model node attributes and variable browse paths from open62541 core node storage.

## Tools
langgraph, pydantic, networkx.
Manages cyclic parent-child lot traversal graph state and recursive genealogy tree expansion.
Structured LLM capable of generating clean compliance audit reports from nested JSON trees.

## 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
- Traverses multi-level lot trees up to 5 tiers without cycle deadlocks.
- Identifies 100% of downstream units associated with a designated bad lot.
- Outputs ISO 9001 audit-compliant containment action plans in structured JSON.

## Starter Examples
```json
[
  {
    "input": {
      "quarantined_lot": "LOT-STEEL-402",
      "genealogy_records": [
        {
          "lot_id": "LOT-STEEL-402",
          "parent_subassembly": "SUB-CHASSIS-11",
          "station": "ST_PRESS_01"
        },
        {
          "lot_id": "SUB-CHASSIS-11",
          "parent_subassembly": "FINAL-VEHICLE-8801",
          "station": "ST_FINAL_02"
        },
        {
          "lot_id": "SUB-CHASSIS-11",
          "parent_subassembly": "FINAL-VEHICLE-8802",
          "station": "ST_FINAL_02"
        }
      ]
    },
    "expected_output": {
      "quarantine_id": "LOT-STEEL-402",
      "impacted_subassemblies": [
        "SUB-CHASSIS-11"
      ],
      "impacted_final_units": [
        "FINAL-VEHICLE-8801",
        "FINAL-VEHICLE-8802"
      ],
      "containment_action": "HOLD_SHIPMENT"
    }
  },
  {
    "input": {
      "quarantined_lot": "LOT-RESISTOR-99",
      "genealogy_records": [
        {
          "lot_id": "LOT-RESISTOR-99",
          "parent_subassembly": "PCB-MOD-01",
          "station": "ST_SMT_04"
        }
      ]
    },
    "expected_output": {
      "quarantine_id": "LOT-RESISTOR-99",
      "impacted_subassemblies": [
        "PCB-MOD-01"
      ],
      "impacted_final_units": [],
      "containment_action": "QUARANTINE_WIP"
    }
  }
]
```

## Safety
Operates strictly in an offline rehearsal mode on historical lot logs without triggering physical warehouse lockouts.
Use mock external writes. Require human review before any real deployment.