Rebuild printable roast plans and remove machine-based adjustments
Test and deploy / test-and-deploy (push) Successful in 2m28s

This commit is contained in:
snowspeeder committed 2026-09-05 14:56:11 -04:00
1 parent e9f2393c96
commit 824a964f9d
30 files changed
+1721 -908

No files matched your search

+7 -7
View File
@@ -35,18 +35,18 @@ test("ledger: this is the one pre-existing caller's exact shape — server/prefi
assert.equal(Array.isArray(ledger.warnings), true);
});
test("ledger: pace multiplies the whole pre-pace sum, including the manual batch correction", () => {
test("ledger: ignores machine pace and retains explicit manual corrections", () => {
// anchor 8:00 (480s) + 6.4 +1:00 (60s) = 540s base; pace 0.9 -> A = round(540*0.9) = 486s = 8:06.
// This is the fix for the double-counting bug: pace applies to l4 too, not just l1-l3.
const ledger = computeLedger(plan({ "6.4": "+1:00" }), { pace: { value: 0.9 } });
assert.equal(ledger.A, 486);
assert.equal(ledger.A, 540);
assert.equal(ledger.lines.l4, 60);
});
test("ledger: subtotalA and pace are exposed and reconstruct A exactly — this is what the printed worksheet's disclosure rows display", () => {
const ledger = computeLedger(plan({ "6.4": "+1:00" }), { pace: { value: 0.9 } });
assert.equal(ledger.subtotalA, 540); // 480 + 60, before pace
assert.equal(ledger.pace, 0.9);
assert.equal(ledger.pace, 1);
assert.equal(ledger.A, Math.round(ledger.subtotalA * ledger.pace));
});
@@ -55,13 +55,13 @@ test("ledger: pace of 1.1 on a plan with refine and bean-condition lines", () =>
const ledger = computeLedger(plan({ "1.6": "+0:15", "5.6": "-0:05" }), {
pace: { value: 1.1 },
});
assert.equal(ledger.A, 539);
assert.equal(ledger.A, 490);
});
test("ledger: yellow and Maillard are derived from the paced A, not the pre-pace sum", () => {
test("ledger: yellow and Maillard stay independent of machine pace", () => {
const ledger = computeLedger(plan(), { pace: { value: 0.9 } });
assert.equal(ledger.A, 432); // 480 * 0.9
assert.equal(ledger.yellow, Math.round(432 * 0.56));
assert.equal(ledger.A, 480); // 480 * 0.9
assert.equal(ledger.yellow, Math.round(480 * 0.56));
assert.equal(ledger.maillard, ledger.A - ledger.yellow);
});