Companion guide ยท Check one cost report

Compare two saved acquisition-cost plans

Use this when you have two complete plans for one identical numerical job and one identical row-price list. Each plan must pass the independent cost checker before its score enters the comparison. Different quotes, prices, units, part codes, inventory or stock rows do not qualify.

Extract the whole companion. From its cost folder, use Python 3.11 or later:

python compare_costs.py input.json A-report.json B-report.json --a-cuts A-cuts.csv --a-stock A-stock.csv --b-cuts B-cuts.csv --b-stock B-stock.csv --uniform-proof --output new-comparison

Keep the original input and complete REPORT objects from both runs. Both reports must use schema 2.0, components 2.0.0, 2.1.0 or 2.1.1 and acquisitionCost. The comparison has its own kind: "same_cost_job_comparison" and schema 1.0; it is a saved comparison record, separate from either Actor report. No version field should be renamed to force a file through a checker.

The four CSV arguments are optional. Supply each only to check that file against its own report. A's CSV cannot stand in for B's CSV. The original input, including explicit string amounts for every stock row, is required.

The command writes comparison.json and a printable comparison.html in a new output folder. Existing folders are refused without changing them. Exit 0 means the two complete numerical layouts and any supplied CSVs verified; exit 2 means a file, proof, common-job constraint or output path failed. No layout, API start or payment is generated by this command. It needs no installation, key, account, SDK, scientific library or network.

Read the objective in order

Compare supplied acquisition amount first, then raw stock length, then bar count. The record shows both full scores and signed differences B minus A. A negative amount means B uses a lower supplied acquisition amount; a positive raw-length difference means B consumes more raw length. A lower amount wins even when it uses more material. Length breaks only an amount tie; bar count breaks only a tie in both amount and length.

A lower feasible score refutes the higher score's full-objective optimum. A lower amount also refutes its cost optimum. This comparison alone does not prove the preferred plan globally best. The record reports source flags, refuted claims and independent proofs separately. An independent proof that contradicts a verified better feasible score is an error.

--uniform-proof asks for a separate complete equal-length replay where applicable. Mixed lengths remain outside that replay; a supplied all-pattern dual can still prove acquisition amount while leaving the raw/bar ties unassessed. A cutoff remains unverified. bestFullObjectiveStatus concerns the best compared score, and only says independently_verified when its full objective has a completed independent proof.

If both complete objective scores tie, the comparison has no preferred plan. One layout might leave a single 4 mm reusable offcut while another leaves two 2 mm scrap offcuts. That distribution stays visible and separate. No residual value, suitability or money is assigned to either offcut distribution.

Keep the complete record

The HTML retains both plans' coordinates, part codes, original stock rows, amounts, subtotals and proof wording. Its opening table can be scrolled with the keyboard on a narrow screen. Printing keeps both complete plans.

Every original input/report and supplied CSV byte hash appears in the saved record. Keep those original files: hashes bind bytes, not authorship or physical material identity. JSON reads are limited to 4 MiB and optional CSVs to 1 MiB; repeated JSON names and nonfinite numbers are refused. The numerical input's own smaller limits still apply. Arbitrary source prose is omitted.

This compares numerical amounts in one common cost unit. It does not establish an invoice, purchase, physical stock identity, tax, labour, conversion, billing or realized saving.

Try a complete included pair

python compare_costs.py comparisons/cost-before-raw/input.json comparisons/cost-before-raw/A-report.json comparisons/cost-before-raw/B-report.json --uniform-proof --output my-first-comparison

Open my-first-comparison/comparison.html. Plan B uses 7 fewer supplied cost units and 2 mm more raw material. With the requested equal-length replay, its full objective is independently verified. Without replay, the two feasible scores alone establish only which of these plans has the lower score.

The six folders under comparisons are local mathematical controls, separate from the twelve single-report controls under examples. They cover all three objective priorities, tied scores with different offcuts, large aggregate totals, and a staged mixed-length fallback/improved pair with cost-only proof. Three synthetic A reports deliberately claim a false full optimum to exercise refutation. They are labelled in each folder and do not represent a native producer defect, customer job or platform run. The staged mixed pair uses amounts 262.50 and 262.45; these are numerical controls, not realized savings.

Open the included saved records from the links below, then check your own complete files before relying on a comparison.