Repository navigation
E03: bill of materials export (bom-export) as CSV - #111
Conversation
axisrow
left a comment
There was a problem hiding this comment.
Verdict: approved
E03 bill-of-materials promotion, reviewed as the six-commit delta on top of the A09 branch it stacks on (the shared A09 tail is reviewed in #110).
crates/engine/src/bom.rsis pure and owns the report rules: capped row count refused before rendering, deterministic sort (kind, profile, mark), grouping withmass_unknowncounted and unknown mass excluded from totals and never rendered as zero, RFC-4180 quoting applied only where needed. All pinned by tests, including the CSV header and the empty-cell contract.- The CLI adapter (
apps/beamcraft-cli/src/bom.rs) derives area as volume/thickness for plates and volume/length for members with explicit denominator guards, resolves profile/material labels from the pinned definitions (designation, then display name, then the digest as the visible last resort), and takes the mark from the A09 marks of the same stack with the element-id fallback the issue requires. - cdf95ae reserves both output files with
create_newbefore any bytes are written and removes the earlier reservations when a later reserve fails; the refusal test covers the taken-summary path. One benign gap, optional to address: if the first write itself fails after both files are reserved, the later empty file is left behind — a retry then refuses with "exists", visible rather than destructive, and the real fix (write-to-temp-then-install) is what the store already does for blobs. - The dedup commit (34bba58) leaves the module registrations and dispatch clean for the upstream base, and the design note names the adapter module correctly (784d6b4).
No CI checks have reported on the branch yet; the approval rests on the review above and on this code having run in the fork since its E03 slice.
|
Thank you for E03 — reserving both report files before writing anything is exactly the behaviour we want. One blocker: this PR is stacked on #110, which we have closed in favour of #103 (A09 as approval of the A08 numbering preview, marks stored as |
|
Note on merge order after #110 was closed in favour of #103: this PR's |
e05d06c to
b8d0c62
Compare
axisrow
left a comment
There was a problem hiding this comment.
Verdict: approved
E03 rebased from the stacked fork-A09 branch onto the natively merged A09 (#103); the delta against the version I approved is exactly the adaptation, and it is right:
- The mark source moved from the fork marks API to the native one: the adapter takes
&[StoredMark]fromnumbering_approval::head_marks, renders through the reader rule (mark.text(kind)with the properGroupKind), and falls back to the element id for unnumbered elements — same contract as before, now on the upstream type. head_markswas widened frompub(crate)topubwith a doc comment naming the BOM/IFC readers as the reason; no logic in the native A09 adapter changed.- The command cross-checks revisions: the marks read is rejected unless
mark_revisionequals the inspected revision id, so the report cannot mix a scene from one head with marks of another. - The engine tables, CSV rendering, reserve-both-files-then-write flow and the mass-unknown rules are unchanged from what I approved; no schema descriptor or pin changes, which is correct for a slice that adds no attributes.
- The test suite grew with the native-marks cases (415 lines vs 384).
No CI checks have reported on the branch yet; the approval rests on the diff review and on the earlier approved version of the same code.
axisrow
left a comment
There was a problem hiding this comment.
Verdict: approved
Re-reviewed the new head against the previously approved one: the entire delta is a rustfmt line-wrap inside one test assertion (groups[0][3] in apps/beamcraft-cli/tests/bom.rs); the adapter, command, engine tables, marks integration through head_marks with the revision cross-check, and the reserve-both-files flow are byte-identical to the approved version. Nothing to change.
|
Thanks for switching the
Please run |
The report rules (sort order, grouping, unknown-mass handling, derived columns, CSV schema) live in a pure engine module, beamcraft_engine::bom: one BomRow per element in, the sorted per-element table, the grouped summary and their CSV text out. The CLI adapter maps the verified read of the head to rows (labels from the pinned definitions, areas derived from the current volume), and `bom-export` writes the files created-new. The quantities are the engine's re-evaluated records, so only current values enter a report; a mass without a density stays an empty cell, excluded from totals and counted in mass_unknown. Marks do not exist until A08/A09, so the mark column falls back to the element id, with the id written beside it so the schema does not change when real marks land. Design note: docs/design/e03-bom-reports.md. (cherry picked from commit 9178933)
(cherry picked from commit 878d6bd)
(cherry picked from commit 5f2d28a)
(cherry picked from commit f92eda8)
(cherry picked from commit 4594e40)
b8d0c62 to
65bb36d
Compare
|
Rebased onto current 🤖 Generated with Claude Code |
axisrow
left a comment
There was a problem hiding this comment.
Verdict: approved
Re-re base review: the branch is rebased onto the master that now carries the merged #108 and #109, and the E03 content is byte-identical to the previously approved version (b8d0c62) — the adapter, the command with the marks revision cross-check, the engine tables, tests and design note all diff clean.
The only changes in the delta are the base-wide registration lines the merged A05 brings in: the bolt module in lib.rs, the bolt_cmd module and the help-literal additions (create-bolt | bolts after the welds segment) in main.rs — consistent with how the branch already dispatched its own command, no ordering or surface surprises.
The marks source remains the native A09 head_marks with the revision-id cross-check; no pin or descriptor changes, correct for a slice that adds no schema lines.
|
Thanks for the rebase — the code merges cleanly and CI is green. One item from the previous review is still open:
With that doc fix pushed we will merge. |
What this changes
Mirror of the fork's #28 (
axisrow/BeamCraft, E03), rebased onto the mirror's A09 branch(#110) because the BOM's
markcolumn reads the A09 assigned/approved mark. Five commits,verbatim:
9178933):bom-exportwrites one elements CSV (a row per plate, beam and column: kind, name, mark, profile,
material, dimensions, gross and net volume/mass with the
mass_unknowncount) and anoptional summary CSV (one group per kind, profile and material); both files are reserved
before anything is written, so a refusal leaves nothing on disk.
878d6bd)5f2d28a)f92eda8)4594e40)Stacked on #110 (A09 marks) — merge that first. Until #110 is merged, this PR's diff
against
masterincludes the A09 commits; the E03-only delta is the five commits above.How you verified it
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warningscargo test -p beamcraft-cli --test bom(2 tests, real binary, 0 failed) on macOSProvenance (clean-room)
dependencies.
🤖 Generated with Claude Code
Issue tracking
Fixes #122