# bom-rollup

Generate a flattened bill of materials with total quantities and cost from an assembly tree

- **Space:** manufacturing-public (https://github.com/Tech-Realm/space-manufacturing-public/tree/main/bom-rollup)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** local-python; checks: 3
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use manufacturing-public/bom-rollup` or MCP `get_pack manufacturing-public/bom-rollup`
- **Files:** CHANGELOG.md, code/bom.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/assembly.csv, outcome/fixtures/cycle.csv, outcome/fixtures/parts.csv, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

A flat BOM CSV (part, description, total qty, unit cost, extended cost) rolled up from a multi-level assembly CSV, plus a grand total.

Verified by: Totals on a fixture tree match hand-computed values; cycles are rejected.

## Steps

1. Export the assembly structure as parent,child,qty and the parts master as part,description,unit_cost.
2. Run `python3 code/bom.py assembly.csv parts.csv TOP-LEVEL-PART --units 10 > bom.csv`.
3. Review parts with missing cost (flagged) and the grand total line.

## Edge cases

- Cycles in the tree (A contains B contains A) must stop with an error.
- Phantom/sub-assemblies have no cost of their own: only leaves are costed.
- Units of measure must match between assembly and parts master.

## Don'ts

- Don't hand-edit totals; fix the source CSVs and re-run.
- Don't mix revisions of the assembly in one run.



---

Canonical URL: https://logicpacks.io/packs/manufacturing-public/bom-rollup

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
