{
  "name": "Installed-coverage check, section by section",
  "page": "https://otherworldlabs.com/insulation-rvalue-material-log/",
  "endpoint": "https://otherworldlabs.com/insulation-rvalue-material-log/api.json",
  "question": "For one record of up to eight sections, each with its own material type: given the area measured, the target R-value supplied, and the figures printed on that material's bag, pack or data sheet, how many whole bags, packs or sets does the row ask for, what thickness does it state, what does the material cost at the price typed, and what is the gap between the quantity the row asked for and the quantity actually put in?",
  "answers": "one record at a time; the page keeps no history and this endpoint stores nothing",
  "version": "2026-10-11",
  "licence": "The arithmetic is not ours to license. Reuse the formulas; the page is free and needs no attribution.",
  "method": "static description plus a worked record; the same formulas run in the page in the reader's browser, with nothing sent anywhere",
  "currency": "whatever the prices are entered in; the page does no conversion and attaches no currency to a figure",
  "no_r_value_claims": "Every R figure is an input. This engine states no R-value per inch for any product, states no target or recommended R-value for any space, and derives no R-value from a thickness. For loose-fill the thickness it prints is the chart row's own settled thickness, reprinted exactly as typed; for spray foam the thickness is the typed target R divided by the typed R an inch, and no R-value is computed back out of it. There is no output named for an R-value anywhere in the list below, and that is deliberate.",
  "rounding": {
    "counts": "Quantities, areas, target R-values, pack R-values, board feet a set and installed counts are whole. A typed fraction is rounded to the nearest whole by Math.round, which puts a half toward positive infinity (0.5 becomes 1, and -0.5 would become 0, though every count here is clamped at zero first so a negative is unreachable), and the page prints both the figure typed and the figure used.",
    "quantity_asked_for": "The quantity a row asks for is the LEAST whole number of units that covers what the typed figures ask for: ceilUnits(numerator, denominator) returns the smallest c with c x denominator >= numerator. It is taken on the division ITSELF and never on the division as printed at two decimals. For loose-fill it is max(ceilUnits(area, maxSqFtPerBag), ceilUnits(area * bagsPer1000, 1000)), which is the same number as the ceiling of the larger of the two quotients; for batt ceilUnits(area, sqFtPerPack); for spray foam ceilUnits(boardFeet, boardFeetPerSet) where boardFeet is round2(area * thicknessIn) and thicknessIn is itself round2(targetR / rPerInch) - the board feet are deliberately worked at the thickness AS PRINTED, to two decimals, because that is the thickness the page prints beside the line and the thickness a crew sprays to, and working them from an unrounded targetR / rPerInch would make the page's own printed 'board feet at that thickness' line false by up to two sets on a large area. Rounding up is the only direction: a part bag short of what a row asks for is a trip back to the supplier. UNTIL REVIEW ROUND 2 THIS ENGINE AND THIS LINE SAID round2 FIRST, which floored away any quotient whose fractional part fell under 0.005 and asked for less than the typed figures require - 201 square feet at a bag that nets at most 200 printed one bag. A reimplementation of the old line disagrees with this engine in roughly one state in a hundred, always short. ceilUnits also walks the integer by one in each direction against a tolerance of a part in a million million, because a quotient that is mathematically whole can come back a hair either side of it in doubles and a hair above would add a whole bag to an order; the walk is the double's last bit and is not arithmetic the page prints.",
    "money": "two decimals by round2(x) = Math.round(x * 100) / 100 on the double, which puts a half toward POSITIVE INFINITY rather than away from zero: -0.125 would come out as -0.12 and not as -0.13. On this engine that branch is unreachable, because every money input is clamped to zero or above before it is used and no output subtracts one money figure from another, so no money figure here is ever negative. The sentence is stated anyway because it is the behaviour of the function, and an agent reimplementing it with a half-away-from-zero rounder would disagree with this engine the day a negative becomes reachable.",
    "thickness_and_coverage": "two decimals by the same round2, applied once at the point the figure is produced and never re-rounded. A loose-fill thickness is not rounded at all: it is the chart row's own figure, as typed, and the page prints it to two decimals, so a chart thickness typed as 16.5 is printed as 16.50 with nothing rounded away. The glossary said 'reprinted exactly as you typed it' until review round 2's M-5 measured it against the formatting.",
    "percentages": "none. This engine prints no percentage of any kind. The installed-against-required check is a difference in whole units, deliberately, because a percentage of a bag count is not a figure anybody acts on and it would invite a reading of adequacy this page may not make."
  },
  "inputs": [
    { "name": "sectionCount", "type": "integer", "unit": "sections", "required": true, "range": "1 to 8",
      "note": "How many sections this record holds. One section per area measured separately; the page never asks anyone to split an area they did not split, so a record of one section is a complete record. A value outside 1 to 8 is clamped into that range, a fraction is rounded first, and only the first sectionCount members of sections are read. The control offers exactly 1 to 8." },
    { "name": "labour", "type": "number", "unit": "currency", "required": false, "range": "0 to 100000, in steps of 0.01",
      "note": "Labour as entered, one figure for the whole record. Printed on its own line, never added into material cost and never apportioned across sections. 0 or absent means not entered." },
    { "name": "materialsTotal", "type": "number", "unit": "currency", "required": false, "range": "0 to 200000, in steps of 0.01",
      "note": "One materials invoice total for the whole record, for a delivery ticket that is a single lump sum covering more than one section, more than one material, or priced as a whole. Any value above 0 takes the lump route: every section's unitPrice is emptied and ignored, every section's cost cell reads 'one invoice, not split', and materialTotalCost is this figure at the cent. The two routes are exclusive per figure and no state carries both." },
    { "name": "installedTotalLooseFill", "type": "integer", "unit": "bags", "required": false, "range": "0 to 2000, in steps of 1",
      "note": "One loose-fill bag count for the whole record, for a crew that blew continuously across sections and kept one count. Any value above 0 empties and ignores unitsInstalled on every loose-fill section, prints 'one record total, not split' in their count and gap cells, and moves the installed-against-required check to the loose-fill subtotal line, against the summed quantity those sections asked for." },
    { "name": "installedTotalBatt", "type": "integer", "unit": "packs", "required": false, "range": "0 to 2000, in steps of 1",
      "note": "The same, for batt." },
    { "name": "installedTotalSprayFoam", "type": "integer", "unit": "sets", "required": false, "range": "0 to 2000, in steps of 1",
      "note": "The same, for spray foam." },
    { "name": "sections[].name", "type": "string", "unit": "text", "required": false, "range": "up to 40 characters",
      "note": "The operator's own name for the section. Whitespace is collapsed and trimmed; a blank or whitespace-only name is printed as 'Section N', with N the section's position in the record, so no row of the table is unlabelled." },
    { "name": "sections[].material", "type": "string", "unit": "one of three", "required": true, "range": "loose-fill, batt, spray-foam",
      "note": "Which of the three material types this section used. Each has its own typed figures, its own divisor and its own unit: bags, packs, sets. Case, spaces and underscores are normalised, and the accepted spellings are exactly these: loose-fill, loosefill or loose; batt or batts; spray-foam, sprayfoam, foam or spray. Anything else, including blank, means no material type has been chosen and the section is incomplete. The control offers exactly these three." },
    { "name": "sections[].area", "type": "integer", "unit": "square feet", "required": true, "range": "1 to 20000, in steps of 1",
      "note": "The area measured for that one section. 0 or absent means the section is incomplete and no quantity is printed for it." },
    { "name": "sections[].targetR", "type": "integer", "unit": "R-value", "required": true, "range": "1 to 100, in steps of 1",
      "note": "The target R-value the customer, the contract or the specification supplied. This engine never supplies, suggests or defaults it, and reprints it only as typed. It is used in two places and two only: as the row of the loose-fill chart the operator read the three cells off (the engine does not know which row that was and does not check it), and as the numerator of the spray-foam thickness." },
    { "name": "sections[].chartThickness", "type": "number", "unit": "inches", "required": "for loose-fill", "range": "0.5 to 30, in steps of 0.25",
      "note": "The minimum settled thickness the loose-fill bag's own coverage chart states on the row at the R-value typed. Copied as printed; reprinted as typed; never derived here." },
    { "name": "sections[].chartBagsPer1000", "type": "number", "unit": "bags per 1,000 square feet", "required": "for loose-fill", "range": "1 to 100, in steps of 0.1",
      "note": "The minimum bags per 1,000 square feet that chart row states. Copied as printed." },
    { "name": "sections[].chartCoveragePerBag", "type": "number", "unit": "square feet per bag", "required": "for loose-fill", "range": "1 to 200, in steps of 0.1",
      "note": "The maximum net coverage one bag may give on that chart row, in square feet. Copied as printed." },
    { "name": "sections[].packR", "type": "integer", "unit": "R-value", "required": "for batt", "range": "1 to 100, in steps of 1",
      "note": "The R-value printed on the batt pack. It is recorded and reprinted and nothing is concluded from it: the engine does not compare it with targetR and prints no verdict about whether a pack suits a target." },
    { "name": "sections[].sqftPerPack", "type": "number", "unit": "square feet per pack", "required": "for batt", "range": "1 to 200, in steps of 0.01",
      "note": "The square feet one pack holds, as printed on the pack." },
    { "name": "sections[].foamRPerInch", "type": "number", "unit": "R-value per inch", "required": "for spray foam", "range": "1 to 10, in steps of 0.1",
      "note": "The R an inch the installer's own system data sheet states. An input, always: this engine has no figure of its own for any material and offers no default." },
    { "name": "sections[].boardFeetPerSet", "type": "integer", "unit": "board feet per set", "required": "for spray foam", "range": "1 to 20000, in steps of 1",
      "note": "The board feet one set yields, from the same data sheet." },
    { "name": "sections[].unitPrice", "type": "number", "unit": "currency per bag, pack or set", "required": false, "range": "0 to 2000, in steps of 0.01",
      "note": "The price of one unit from the operator's supplier invoice, where that invoice quotes a price per unit. Emptied and ignored whenever materialsTotal is above 0. 0 or absent means no cost is printed for that section and its cost cell reads 'no unit price entered'. A price above 0 on a section that is NOT complete prints no cost either, and since review round 3's B-1 that cell reads 'nothing to work it on yet' and not 'no unit price entered', because the price is typed and what is missing is the quantity to work it on; the cell has four forms in all, a money figure, 'one invoice, not split', 'nothing to work it on yet' and 'no unit price entered'." },
    { "name": "sections[].unitsInstalled", "type": "integer", "unit": "bags, packs or sets", "required": false, "range": "0 to 2000, in steps of 1",
      "note": "The operator's own count of what went into that one section, blank until the work is done. Emptied and ignored whenever that material's record-level installed count is above 0. 0 or absent means the gap cell reads 'the work is not recorded yet' rather than printing a figure." }
  ],
  "outputs": [
    { "name": "sectionsInRecord", "unit": "sections", "formula": "sectionCount, clamped to 1 to 8 and rounded to a whole number" },
    { "name": "materialTypesDistinguished", "unit": "material types", "formula": "the constant 3: loose-fill, batt, spray foam. The only count of kinds this engine or the page prints" },
    { "name": "sectionsWaiting", "unit": "sections", "formula": "count of sections missing a material type, an area, a target R, or any label figure their own material needs" },
    { "name": "linesWithQuantityRecorded", "unit": "lines of the record", "formula": "count of LINES of the record carrying a quantity put in: a section whose gap cell carries one of the three forms, plus a material type whose subtotal line carries one count kept for the whole record. The two are exclusive per material - a material counted once for the record has no per-section gap cell at all - so no figure is counted twice. It is a count of lines and not of sections, because the check lands on whichever of the two the figure the operator kept belongs to. The page prints this figure only where every section is complete; while one is still being filled in the glance row prints the waiting words instead, because an unfinished row can carry a quantity put in and have nothing to compare it against (review round 2's B-4). The field itself is always the count, in that state as in every other: the completeness clause is about what the page PRINTS and not about what this field holds, so an agent reading the endpoint gets the tally whether or not the page is showing it (review round 4's m-1, which is the sentence the field below this one already carried and this one did not)" },
    { "name": "linesShortOfTheRow", "unit": "lines of the record", "formula": "count of those same lines whose gap form is 'short by': a section short of its own row, plus a material type short of the summed quantity its sections asked for where one count was kept for the record. The page prints this figure only where every section is complete AND at least one line carries a quantity put in; with nothing put in anywhere the glance row says so in words rather than printing a nought, because a nought there reads as 'nothing is short' over a record whose every gap cell says the work is not recorded yet (review round 2's B-2). The field itself is still a number in this endpoint, and it is 0 in that state: an agent reading the endpoint has linesWithQuantityRecorded beside it to tell the two apart" },
    { "name": "unitsRequired1", "unit": "bags, packs or sets", "formula": "the quantity section 1's row asks for, by its own material's rule above; null where section 1 is incomplete" },
    { "name": "thicknessIn1", "unit": "inches", "formula": "for loose-fill the chart row's settled thickness as typed; for spray foam round2(targetR / foamRPerInch); null for batt and null where the section is incomplete" },
    { "name": "unitsInstalled1", "unit": "bags, packs or sets", "formula": "section 1's own quantity put in, as a whole number. TWO UNRELATED STATES PUT 0 HERE and this endpoint does not tell them apart: 0 where that material's count was kept once for the record, because the figure then lives on the subtotal line, and 0 where nothing has been put in on that section yet, which is far the commoner of the two and is the state every record is in before the work is done (review round 4's m-1). The page distinguishes them in the cell itself - 'one record total, not split' against a dash - and an agent reading only this endpoint tells them apart by looseFillInstalled, battInstalled or sprayFoamInstalled for that section's own material: a figure there means the count was kept for the record, a null there means it was not" },
    { "name": "gapUnits1", "unit": "bags, packs or sets", "formula": "the absolute difference between unitsInstalled1 and unitsRequired1, never negative. THREE null conditions, all of them, and they are the engine's own three branches in order: null where that material's count was kept once for the record, because the comparison then runs on the material's subtotal line and not on the row; null where section 1 is INCOMPLETE, whether or not a quantity has been typed into it; and null where section 1 is complete and nothing has been put in on it. The gap column's three stand-in sentences stand one to one against those three conditions, in that order, and the engine chooses between them on the row and never on whether a quantity was typed. The closing round wrote all three out here: the line used to name only the third of them, by its page wording, which left a reimplementation to work out for itself that an unfinished row with a quantity typed also has no gap" },
    { "name": "gapForm1", "unit": "one of three words", "formula": "'short by' where put in is below asked for, 'over' where it is above, 'no difference' where the two are equal; null on the same three conditions as gapUnits1, written out in that field" },
    { "name": "achievedSqFtPerUnit1", "unit": "square feet per bag, pack or set", "formula": "round2(area / unitsInstalled) for section 1. THREE null conditions, all of them: null where section 1 is INCOMPLETE (the engine's guard is complete AND not on the record-count route AND a quantity put in above 0), null where that material's count was kept once for the whole record, because the figure then belongs to the subtotal line, and null where no quantity put in exists for it" },
    { "name": "materialCost1", "unit": "currency", "formula": "round2(quantity x unitPrice) for section 1, where quantity is the quantity put in once that exists and the quantity asked for until then. THREE null conditions, all of them: null on the lump-invoice route, null where no unit price was entered, and null where the section is INCOMPLETE - the engine's guard is unitPrice above 0 AND complete, so a section still missing a label figure has no cost even with a price typed, and the subtotal costs and materialTotalCost follow from that. The page prints a different stand-in cell in each of the three null cases, and since round 3's B-1 they are distinct: 'one invoice, not split' on the lump route, 'nothing to work it on yet' where a price is typed and the row is incomplete, and 'no unit price entered' where no price is typed at all" },
    { "name": "looseFillRequired", "unit": "bags", "formula": "the summed quantity the loose-fill sections asked for, printed only where one loose-fill count was kept for the record and every loose-fill section is complete; null otherwise" },
    { "name": "looseFillInstalled", "unit": "bags", "formula": "installedTotalLooseFill, but only where the loose-fill SUBTOTAL LINE EXISTS AND CARRIES THE CHECK: the record has at least one loose-fill section and every one of them is complete. Null otherwise - including the state where installedTotalLooseFill is above 0 and the record has no loose-fill section at all, and the state where one of them is still missing a label figure. The count is held rather than printed in both, and the page says in the entry notes that it is being held The count being KEPT ONCE FOR THE RECORD is part of the condition and not an assumption a reader has to make: with installedTotalLooseFill at 0 this field is null and not 0, because there is then no record-level count to print and the check is on each section's own row instead (review round 4's m-1 class: an endpoint sentence a reimplementer has to guess at)." },
    { "name": "looseFillGapUnits", "unit": "bags", "formula": "the absolute difference between the two above, never negative; null wherever either of them is null" },
    { "name": "looseFillAchievedSqFtPerUnit", "unit": "square feet per bag", "formula": "round2(the summed area of the loose-fill sections / installedTotalLooseFill), printed on the loose-fill subtotal line itself; null on the same conditions as looseFillInstalled, and null where the summed area is 0" },
    { "name": "looseFillCost", "unit": "currency", "formula": "the sum of the per-section material costs of the loose-fill sections, each of which is null unless that section is complete and has a unit price; null where none of them has one" },
    { "name": "battRequired", "unit": "packs", "formula": "the summed quantity the batt sections asked for, printed only where one batt count was kept for the record (installedTotalBatt above 0) and every batt section is complete; null otherwise. Written out rather than left as 'the same, for batt': review round 4's m-1 found the batt and spray-foam guards were a three-deep back-reference through the loose-fill ones, so a reimplementer had to follow a chain of four sentences to read one condition" },
    { "name": "battInstalled", "unit": "packs", "formula": "installedTotalBatt, but only where the batt SUBTOTAL LINE EXISTS AND CARRIES THE CHECK: the record has at least one batt section and every one of them is complete. Null otherwise - including the state where installedTotalBatt is above 0 and the record has no batt section at all, and the state where one of them is still missing a label figure. The count is held rather than printed in both, and the page says in the entry notes that it is being held The count being KEPT ONCE FOR THE RECORD is part of the condition and not an assumption a reader has to make: with installedTotalBatt at 0 this field is null and not 0, because there is then no record-level count to print and the check is on each section's own row instead (review round 4's m-1 class: an endpoint sentence a reimplementer has to guess at)." },
    { "name": "battGapUnits", "unit": "packs", "formula": "the absolute difference between battRequired and battInstalled, never negative; null wherever either of them is null" },
    { "name": "battAchievedSqFtPerUnit", "unit": "square feet per pack", "formula": "round2(the summed area of the batt sections / installedTotalBatt), printed on the batt subtotal line itself; null on the same two conditions as battInstalled - no batt section, or one of them incomplete - and null where the summed area is 0. It prints with no typed maximum beside it, because the sections it sums may have been read off packs with a different square-feet figure on each" },
    { "name": "battCost", "unit": "currency", "formula": "the sum of the per-section material costs of the batt sections, each of which is null unless that section is complete and has a unit price; null where none of them has one. This figure does not need the record-count route: it prints on the batt footing line whether the counts were kept per section or once for the record" },
    { "name": "sprayFoamRequired", "unit": "sets", "formula": "the summed quantity the spray-foam sections asked for, printed only where one spray-foam count was kept for the record (installedTotalSprayFoam above 0) and every spray-foam section is complete; null otherwise" },
    { "name": "sprayFoamInstalled", "unit": "sets", "formula": "installedTotalSprayFoam, but only where the spray-foam SUBTOTAL LINE EXISTS AND CARRIES THE CHECK: the record has at least one spray-foam section and every one of them is complete. Null otherwise - including the state where installedTotalSprayFoam is above 0 and the record has no spray-foam section at all, and the state where one of them is still missing a label figure The count being KEPT ONCE FOR THE RECORD is part of the condition and not an assumption a reader has to make: with installedTotalSprayFoam at 0 this field is null and not 0, because there is then no record-level count to print and the check is on each section's own row instead (review round 4's m-1 class: an endpoint sentence a reimplementer has to guess at)." },
    { "name": "sprayFoamGapUnits", "unit": "sets", "formula": "the absolute difference between sprayFoamRequired and sprayFoamInstalled, never negative; null wherever either of them is null" },
    { "name": "sprayFoamAchievedSqFtPerUnit", "unit": "square feet per set", "formula": "round2(the summed area of the spray-foam sections / installedTotalSprayFoam), printed on the spray-foam subtotal line itself; null on the same two conditions as sprayFoamInstalled, and null where the summed area is 0. The square-feet-a-set figure is printed on the subtotal line with no typed maximum beside it, because a foam data sheet states board feet a set and not square feet a set" },
    { "name": "sprayFoamCost", "unit": "currency", "formula": "the sum of the per-section material costs of the spray-foam sections, each of which is null unless that section is complete and has a unit price; null where none of them has one" },
    { "name": "materialTotalCost", "unit": "currency", "formula": "materialsTotal at the cent where the lump route was taken; otherwise the running round2 sum of the per-section material costs that exist; null where no section has a cost and no invoice was typed" },
    { "name": "labourAsEntered", "unit": "currency", "formula": "round2(labour). Printed beside the material total and never inside it. THIS FIELD USES 0 AND NOT NULL FOR NOT ENTERED, and it is the only field of the 29 that does: the labour input's own note says 0 or absent means not entered, and this field reprints that 0 rather than turning into a null, because a null here would change the field's type for a reason that is about layout - the same decision, for the same reason, that linesShortOfTheRow records. What the page does with it is different from what this endpoint does with it, and review round 4's B-2 is that the two had drifted: the glance row used to print money(0) as $0.00 on a record nobody had typed a labour figure into, which is a figure the operator never gave, printed on the one line the printable sheet exists to carry. The row now prints the words 'no labour figure typed' instead, exactly where this field is 0, and an agent reading the endpoint reads a 0 here as not entered and never as a labour bill of nothing" }
  ],
  "formula": [
    "a section is complete when it has a material type, an area above 0, a target R above 0, and every label figure its own material needs: loose-fill needs the chart row's three cells, batt needs the pack's R and its square feet, spray foam needs the R an inch and the board feet a set",
    "an incomplete section prints no quantity at all; the page names the cells it is missing instead",
    "loose-fill: byCoverage = round2(area / chartCoveragePerBag) and byChartRate = round2(area / 1000 x chartBagsPer1000) are the two figures PRINTED in part C, to two decimals; unitsRequired = max(ceilUnits(area, chartCoveragePerBag), ceilUnits(area x chartBagsPer1000, 1000)), which is rounded up from the divisions themselves and not from those two printed figures; thicknessIn = chartThickness as typed",
    "batt: byPackRate = round2(area / sqftPerPack) is the figure PRINTED; unitsRequired = ceilUnits(area, sqftPerPack)",
    "spray foam: thicknessIn = round2(targetR / foamRPerInch); boardFeet = round2(area x thicknessIn); unitsRequired = ceilUnits(boardFeet, boardFeetPerSet). The board feet are worked at the thickness as printed, which is the one place this page chooses a printed figure over a longer one, and it does so because the page prints the chain it works",
    "so a division printed as a whole number can ask for one unit on top of it: 13,539 square feet at 169.23 square feet a pack prints 80.00 and asks for 81 packs. Part C says this in the page's own words, above the figures",
    "achievedSqFtPerUnit = round2(area / unitsInstalled), printed beside the figure that row states for one unit as typed - the most square feet a bag may net for loose-fill, the square feet a pack holds for batt, which is a capacity and not a maximum - and alone for spray foam, whose data sheet states board feet a set and not square feet a set. Both figures are printed to two decimals, because two figures printed for comparison are printed alike",
    "for a material type whose count was kept once for the record, the same figure one level up: round2(the summed area of that type's sections / that one count), printed on that type's own subtotal line and alone, because the sections it sums may have been read off chart rows with a different typed maximum on each",
    "every per-section figure above - the quantity asked for, the thickness, the gap, the coverage reached and the material cost - is null while the section is INCOMPLETE, which is the state a card part way through being typed is in; nothing is worked from a cell the operator has not filled, and a figure that is null is absent from the page rather than printed as a zero",
    "gap = |unitsInstalled - unitsRequired|, with the form 'short by' when below, 'over' when above and 'no difference' when equal; the gap is never printed below zero",
    "materialCost = round2(quantity x unitPrice), with quantity = unitsInstalled once that exists and unitsRequired until then. The page says which of the two it is on, in the working line's own description, every time the figure prints: 'material cost at the price typed, on the quantity put in' or '... on the quantity the row asked for'. Until review round 2 that basis lived only in a source comment and in this file, so a record priced before the work printed the cost of bags nobody had bought with nothing visible saying so",
    "a material type's subtotal cost = the round2 running sum of its sections' material costs",
    "where one installed count was kept for a material type, that type's subtotal line carries the count, the summed quantity its sections asked for, and the gap between them; no per-section count is invented",
    "materialTotalCost = the typed materials invoice at the cent on the lump route, otherwise the round2 running sum of the section costs",
    "labour is never a term of any total above"
  ],
  "identities": [
    "the quantity columns are deliberately not totalled across material types, because a bag added to a pack is not a quantity of anything; only money is footed, and the footing prints one subtotal a material type",
    "ON THE PER-SECTION PRICE ROUTE ONLY, materialTotalCost equals the sum of the per-material subtotal costs, and equals the sum of the per-section material costs; both are asserted by the page's test harness at every swept state, under the same route condition the harness itself carries. On the lump-invoice route neither equality holds and neither is asserted: every per-section and per-material cost is null and materialTotalCost is the typed invoice, divided into nothing",
    "no state carries both a record total and the per-section cell it stands in for: a materials invoice total empties every unit price, and a material's record-level count empties that material's per-section counts. Asserted by the harness over every swept state",
    "every gap is a non-negative whole number, and gapForm is 'no difference' exactly when the gap is 0"
  ],
  "example": {
    "note": "the record the page ships filled in, so this endpoint and the page answer with the same figures",
    "inputs": {
      "sectionCount": 3,
      "labour": 1850,
      "materialsTotal": 0,
      "installedTotalLooseFill": 0,
      "installedTotalBatt": 0,
      "installedTotalSprayFoam": 0,
      "sections": [
        { "name": "Main attic", "material": "loose-fill", "area": 950, "targetR": 49, "chartThickness": 16.25, "chartBagsPer1000": 25.4, "chartCoveragePerBag": 39.4, "unitPrice": 44.5, "unitsInstalled": 22 },
        { "name": "Knee wall, west side", "material": "batt", "area": 180, "targetR": 21, "packR": 21, "sqftPerPack": 49.08, "unitPrice": 61.2, "unitsInstalled": 4 },
        { "name": "Rim joist, basement", "material": "spray-foam", "area": 160, "targetR": 21, "foamRPerInch": 6.5, "boardFeetPerSet": 4000, "unitPrice": 1150, "unitsInstalled": 1 }
      ]
    },
    "outputs": {
      "sectionsInRecord": 3,
      "materialTypesDistinguished": 3,
      "sectionsWaiting": 0,
      "linesWithQuantityRecorded": 3,
      "linesShortOfTheRow": 1,
      "unitsRequired1": 25,
      "thicknessIn1": 16.25,
      "unitsInstalled1": 22,
      "gapUnits1": 3,
      "gapForm1": "short by",
      "achievedSqFtPerUnit1": 43.18,
      "materialCost1": 979,
      "looseFillRequired": null,
      "looseFillInstalled": null,
      "looseFillGapUnits": null,
      "looseFillAchievedSqFtPerUnit": null,
      "looseFillCost": 979,
      "battRequired": null,
      "battInstalled": null,
      "battGapUnits": null,
      "battAchievedSqFtPerUnit": null,
      "battCost": 244.8,
      "sprayFoamRequired": null,
      "sprayFoamInstalled": null,
      "sprayFoamGapUnits": null,
      "sprayFoamAchievedSqFtPerUnit": null,
      "sprayFoamCost": 1150,
      "materialTotalCost": 2373.8,
      "labourAsEntered": 1850
    }
  },
  "not_covered": [
    "Whether the area was measured the way the label's own chart row assumes, and whether a section with two depths or two materials in it should have been one section or two. The page records what it is told and never splits an area it was not given split.",
    "What a part bag or part set at the end of a run should be counted as. The quantity a row asks for is rounded up; the quantity put in is whatever the operator counted, and the page compares the two without opinion.",
    "Whether a quantity put in that matches or exceeds what a row asked for means anything about the result. The page prints the two figures and their difference; it draws no conclusion about adequacy, and the square-feet-a-unit column is printed beside the typed maximum for the same reason: two figures, no verdict.",
    "Any R-value per inch, any target or recommended R-value, and any R-value derived from a thickness. All three are excluded on purpose, not missing.",
    "Anything about materials, handling, protective equipment, ventilation, clearances, wiring, moisture, or the condition of the space. Not arithmetic, and not this page's.",
    "Taxes, delivery, fuel, equipment hire, waste and anything else beyond the unit price typed, and any apportionment of labour into material cost."
  ],
  "no_advice": "This endpoint returns arithmetic on figures supplied to it. It recommends no material, no thickness, no R-value, no quantity and no price, it is not a sign-off of any kind, and it makes no claim that anything it prints is adequate or complete."
}
