From 824a964f9d8aa4f6c4cab77ef22c71797f702b6d Mon Sep 17 00:00:00 2001
From: Shane Maynard
Date: Sat, 5 Sep 2026 14:56:11 -0400
Subject: [PATCH] Rebuild printable roast plans and remove machine-based
adjustments
---
README.md | 46 +-
docs/project-review-2026-09-05.md | 38 ++
package-lock.json | 722 ++++++++++++++++++++++++------
package.json | 9 +-
public/app.css | 4 +
public/index.html | 28 +-
public/js/alog-ui.js | 4 +-
public/js/field-help-content.js | 373 ++-------------
public/js/field-help.js | 2 +-
public/js/main.js | 96 +---
public/js/print.js | 92 ++--
public/js/roasters.js | 93 +---
public/roasters.html | 14 +-
public/sw.js | 1 +
server/alog-library.js | 12 +-
server/app.js | 19 +-
server/evaluate-roast.js | 5 +
server/fetch-page.js | 273 +++++++----
server/plan-chat.js | 22 +-
shared/curve.js | 159 ++++---
shared/fields.js | 3 +-
shared/ledger.js | 94 ++--
shared/report.js | 142 ++++++
shared/time.js | 10 +-
test/alog-library.test.js | 45 ++
test/brewing.test.js | 7 +-
test/fetch-page.test.js | 101 +++++
test/ledger.test.js | 14 +-
test/report-browser.test.js | 95 ++++
test/report.test.js | 106 +++++
30 files changed, 1721 insertions(+), 908 deletions(-)
create mode 100644 docs/project-review-2026-09-05.md
create mode 100644 shared/report.js
create mode 100644 test/alog-library.test.js
create mode 100644 test/fetch-page.test.js
create mode 100644 test/report-browser.test.js
create mode 100644 test/report.test.js
diff --git a/README.md b/README.md
index decb6ee..d1698eb 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ A fillable, live-computing web version of the manual coffee roast plan worksheet
worksheet field IDs using the same reference tables as the paper worksheet. It never
invents a first-crack anchor or a modifier — those only ever come from the reference
tables, keyed off what the page actually states.
-- **Reference curve from an Artisan `.alog`** — upload a real roast log (or browse a local
+- **Reference curve from an Artisan `.alog`** — upload a real roast log (or browse an administrator-only local
library directory) to overlay its actual milestones/curve on the same SVG grid as your
plan, dashed and in a different color.
- **Finished-roast log with Pi agent review** — upload one or more finished Artisan `.alog`
@@ -23,11 +23,9 @@ A fillable, live-computing web version of the manual coffee roast plan worksheet
percolation / espresso & pressure — 13 methods), recipe fields (dose, water/yield, auto
ratio, grind, temp, times), a 0–10 rating, and tasting notes. Bean remaining weight is
derived from logged brew doses. Green inventory's lot form also prefills from a URL.
-- **Plan chat + learned roaster behavior** — an "Ask the LLM" drawer on the planner chats
- about the open plan, grounded in the computed ledger, the learned pace profile, and a
- roaster-behavior profile (`/api/roaster-profile`) aggregated from every uploaded .alog
- (turning-point lag, phase RoR, median milestone temps). The same profile feeds roast
- reviews and supplies the planner curve's fallback milestone temps.
+- **Plan chat and roast history** — plan chat uses the open plan and computed ledger.
+ Roasters organize uploads and show descriptive statistics; roaster selection, learned pace,
+ and historical temperature medians never modify plan timing or temperature suggestions.
- **API + tokens + Swagger** — every capability (including admin) is a JSON endpoint,
documented by a hand-authored OpenAPI 3 spec at `/api/openapi.json` and a self-hosted
Swagger UI at `/api-docs`. Users generate bearer tokens (`rpt_…`) on the Account page;
@@ -43,11 +41,18 @@ A fillable, live-computing web version of the manual coffee roast plan worksheet
`scripts/generate-academy-audio.mjs` (reads `AZURE_VOICE_KEY`/`AZURE_VOICE` from `.env`,
region eastus — run it locally after editing lesson scripts; production never needs the
key). Slides carry display transcripts as captions and phonetic respellings for the voice.
-- **Live ledger** — the worksheet's time-ledger math (first crack, yellow, Maillard,
- development, drop, and the four sanity-check ratios) recomputes as you type, using the
- exact same arithmetic as the paper worksheet (verified against both its worked examples).
-- **Print** — bakes typed values into the print layout and reuses the paper worksheet's
- print CSS, so `File > Print` produces the same 2-page front/back sheet.
+- **Live ledger** — shared timing math with explicit manual corrections, invalid-duration
+ checks, density-unit warnings, and a direct development override. Light-roast modifier
+ suggestions have a disclosed 1:15 floor; an explicit override takes precedence.
+- **Printable report** — preview, print, or download a standalone HTML file in grams and
+ Fahrenheit. Includes an annotated smooth SVG curve, phase durations, milestone cues,
+ separate preheat fields, actuator schedule, and roast/cup record. Blank temperature inputs
+ use an illustrative reference (not a calibrated prediction); entered readings are preserved.
+
+Local Node development requires Node 22.19 or newer (Docker uses Node 24).
+Product-page fetching accepts public HTTPS destinations on port 443, validates every DNS
+answer and redirect, pins the socket address, and keeps a deadline through body streaming.
+The former Browserless fallback is removed because it could bypass these network protections.
## Run it
@@ -96,9 +101,8 @@ simply as "the LLM".
(served statically at `/shared/`). This is the single source of truth for the ledger math,
time parsing, and reference data tables — never duplicate this logic in `server/` or `public/js/`.
- `server/` — Express routes: `/api/prefill`, `/api/alog`, `/api/alog/library[/:filename]`.
-- `public/` — the static frontend: `index.html` (the worksheet as a form), `worksheet.css`
- (a verbatim copy of the paper worksheet's print CSS — port changes from there, don't
- hand-edit divergently), `app.css` (screen-only chrome + form-control styling), `js/`.
+- `public/` — the static frontend: `index.html` (planning form), `app.css` (screen UI), and `js/`.
+ `shared/report.js` owns the standalone/print report. `worksheet.css` is a legacy asset.
## Where the reference numbers come from
@@ -113,3 +117,17 @@ If those tables change in the paper worksheet, port the change here too.
- Roastetta (roastetta.com) integration is intentionally out of scope — it needs a headed,
Cloudflare-clearing browser and the operator's own credentials. Use the `.alog` file picker,
or point `ALOG_DIR` at wherever the `roastetta` skill already downloaded files.
+
+## Regression checks
+
+`npm test` includes account ownership, authorization, persistence, parsing, planner/report,
+URL-fetch security, and Docker startup/migration checks. For the Chromium interaction check:
+
+```sh
+npx playwright install chromium
+npm run test:browser
+```
+
+The browser check covers Fahrenheit/Celsius round trips without deleting inputs, the report
+preview, standalone download, and print-only layout. It runs separately from the default test
+suite so production CI does not require installing a browser.
diff --git a/docs/project-review-2026-09-05.md b/docs/project-review-2026-09-05.md
new file mode 100644
index 0000000..94573df
--- /dev/null
+++ b/docs/project-review-2026-09-05.md
@@ -0,0 +1,38 @@
+# Project review — 2026-09-05
+
+Reviewed planner calculations, temperature display, generated output, model prompts, product-page fetching, account/ownership checks, inventory transactions, server-file access, dependency advisories, service-worker asset handling, and deployment configuration.
+
+## Changes and evidence
+
+| Finding | Correction | Verification |
+| --- | --- | --- |
+| Machine pace and uploaded-roast medians silently changed plans. | Planning math, curve defaults and plan-chat context no longer consume machine profiles. Machines retain descriptive history and upload organization. | Ledger/report tests; route test verifies chat receives no machine profiles. |
+| Old Hottop defaults appeared to be portable targets. | Removed machine-band UI/help and replaced curve defaults with explicitly illustrative references. User-entered temperatures take precedence. Preheat has separate fields. | Report tests and Chromium interaction check. |
+| Light development modifiers could produce 1:03 while failing the app's own DTR check. | Disclosed 1:15 suggestion floor for light plans, explicit development override, actionable warnings. This floor is a planning heuristic, not a universal minimum. | Regression covers original 1:38 − 0:30 − 0:05 example and manual override. |
+| Milestone connections could imply increasing late RoR. | Shape-preserving cubic interpolation; default drop gain depends on development duration and is lower per minute than Maillard. Inconsistent manual entries remain visible and are flagged. | Numerical no-overshoot checks, phase-rate checks, explicit inconsistent-target case. |
+| Field-help imports lacked build-version markers and could remain stale after deployment. | Added the same asset-version markers used by the app shell. | Asset stamping and Docker startup checks. |
+| Unit conversion wrote text into entire milestone rows and deleted their controls. | Limit caption updates to table/SVG labels. | Chromium test enters FC in °F, switches to °C and back, and checks values and all six temperature inputs. |
+| Duration parsing accepted invalid seconds and overflow; negative ledger totals could produce impossible plans. | Reject invalid/unsafe durations; flag nonpositive milestones and implausible density units without silently changing density. | Parser and ledger regressions. |
+| Printing reused a dense legacy worksheet; there was no standalone report download. | Shared report renderer, preview, print and downloadable HTML with inline CSS/SVG. All report temperatures use °F and mass uses g. | Escaping tests, browser download/print tests; sample PDF visually checked and measured at two Letter pages. Long notes/schedules can add pages. |
+| HTTPS product fetches could reach private services, including via redirects; deadline ended before body reading. | Public IP validation for all DNS answers, pinned socket lookup, per-redirect checks, deadline through response streaming, bounded body. Removed Browserless fallback because it bypassed those protections. | Literal/private/mapped IP, mixed DNS, redirect, stalled-body and authenticated-route tests. |
+| Any account could read the operator's server roast library; read calls followed symlinks. | Admin-only library routes, exact basenames, no-follow file opens, regular-file and size checks. Personal uploads retain existing ownership checks. | Admin/nonadmin route tests and traversal/symlink regressions. |
+| Locked production dependencies had reported vulnerabilities. | Updated Pi SDK to 0.85.1 and refreshed affected transitive packages, including undici, brace-expansion and qs. Declared Node >=22.19; Docker uses Node 24. | Production dependency audit reports zero known vulnerabilities; startup and app suite check compatibility. |
+
+## Interpretation and limits
+
+The existing cultivar worksheet is a starting framework, not a validated physical model. A light or fruity cup cannot be guaranteed from duration, DTR or a turning-point reading. Prompts and report text now make that distinction. Phase averages cannot prove that an instantaneous trace has no crash or flick.
+
+References checked:
+
+- [Scott Rao — Coffee Roasting Fundamentals](https://www.scottrao.com/blog/2020/3/29/coffee-roasting-fundamentals): absolute probe readings do not transfer directly; duration and DTR alone do not establish quality.
+- [Sweet Maria's — First Crack FAQ](https://library.sweetmarias.com/first-crack-faq-what-is-first-crack-what-is-second-crack/): audible first crack and temperature context for the illustrative reference.
+- [Kaleido Standard Roasting Guide](https://www.kaleido-coffee.com/news/kaleido-standard-roasting-guide): distinguishes preheat SV from BT and uses a 750 g M10 reference batch. Its settings are not applied automatically by this planner.
+
+No historical roast files or measured temperatures were rewritten. Legacy profile endpoints remain for compatibility/descriptive history, but do not drive plans. This review does not independently validate every claim in the historical cultivar tables or Academy narration. External storefronts that block direct requests may now require manual entry. Model-output quality still depends on the configured provider; automated tests isolate model calls rather than spending production inference credits.
+
+## Reproduce checks
+
+- `npm test`: unit/API/security/persistence tests and Docker startup with migrations. The browser case is opt-in.
+- `npx playwright install chromium && npm run test:browser`: real Chromium form, unit-toggle, preview, download and print regressions.
+- `npm audit --omit=dev`: production dependency advisories.
+- Push `master`, then verify the matching Gitea Actions run succeeds. The pipeline owns deployment; do not redeploy manually afterward.
diff --git a/package-lock.json b/package-lock.json
index 933926d..24baac7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,7 +8,7 @@
"name": "roast-planner-webapp",
"version": "0.1.0",
"dependencies": {
- "@earendil-works/pi-coding-agent": "^0.83.0",
+ "@earendil-works/pi-coding-agent": "^0.85.1",
"bcryptjs": "^3.0.3",
"express": "^5.0.1",
"nodemailer": "^9.0.3",
@@ -17,24 +17,29 @@
},
"devDependencies": {
"pg-mem": "^3.0.14",
+ "playwright": "^1.63.0",
"supertest": "^7.2.2"
+ },
+ "engines": {
+ "node": ">=22.19.0"
}
},
"node_modules/@earendil-works/pi-coding-agent": {
- "version": "0.83.0",
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-coding-agent/-/pi-coding-agent-0.83.0.tgz",
- "integrity": "sha512-uYhF+FsZxogoSX/AxBcUdiY+ZklubwaXyAoEGA2eQwsHcyEAhUYIKh/WLXe/a8+k8eTCmxb+ZN2Zo9mzQtzbWw==",
+ "version": "0.85.1",
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-coding-agent/-/pi-coding-agent-0.85.1.tgz",
+ "integrity": "sha512-FGRN+OHbWaefBPGaTggAdLjrIHW+s2PzLyglz/5dfLzb9of7uuXMXYC0fJIeZTw+shS32o2cuQ9jF7YSDuL/oQ==",
"hasShrinkwrap": true,
"license": "MIT",
"dependencies": {
- "@earendil-works/pi-agent-core": "^0.83.0",
- "@earendil-works/pi-ai": "^0.83.0",
- "@earendil-works/pi-tui": "^0.83.0",
+ "@earendil-works/chord": "^0.85.1",
+ "@earendil-works/pi-agent-core": "^0.85.1",
+ "@earendil-works/pi-ai": "^0.85.1",
+ "@earendil-works/pi-tui": "^0.85.1",
"@silvia-odwyer/photon-node": "0.3.4",
"chalk": "5.6.2",
"cross-spawn": "7.0.6",
"diff": "8.0.4",
- "glob": "13.0.6",
+ "grok-mermaid": "0.2.2",
"highlight.js": "10.7.3",
"hosted-git-info": "9.0.3",
"ignore": "7.0.5",
@@ -43,11 +48,11 @@
"proper-lockfile": "4.1.2",
"semver": "7.8.0",
"typebox": "1.3.7",
- "undici": "8.5.0",
+ "undici": "8.9.0",
"yaml": "2.9.0"
},
"bin": {
- "pi": "dist/cli.js"
+ "pi": "dist/bundle/cli.js"
},
"engines": {
"node": ">=22.19.0"
@@ -57,12 +62,13 @@
}
},
"node_modules/@earendil-works/pi-coding-agent/node_modules/@anthropic-ai/sdk": {
- "version": "0.91.1",
- "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.91.1.tgz",
- "integrity": "sha512-LAmu761tSN9r66ixvmciswUj/ZC+1Q4iAfpedTfSVLeswRwnY3n2Nb6Tsk+cLPP28aLOPWeMgIuTuCcMC6W/iw==",
+ "version": "0.123.0",
+ "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.123.0.tgz",
+ "integrity": "sha512-Y9oX9mPNGZClHQOFqrWRk43Srcu/UHuPq3rfxxOq7JgW0gi+lJA2MAOK4Ul3k/+AUrwRWFJvd0tK3oC0Pw25dw==",
"license": "MIT",
"dependencies": {
- "json-schema-to-ts": "^3.1.1"
+ "json-schema-to-ts": "^3.1.1",
+ "standardwebhooks": "^1.0.0"
},
"bin": {
"anthropic-ai-sdk": "bin/cli"
@@ -491,12 +497,25 @@
"node": ">=6.9.0"
}
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-agent-core": {
- "version": "0.83.0",
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.83.0.tgz",
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/chord": {
+ "version": "0.85.1",
+ "resolved": "https://registry.npmjs.org/@earendil-works/chord/-/chord-0.85.1.tgz",
"license": "MIT",
"dependencies": {
- "@earendil-works/pi-ai": "^0.83.0",
+ "esbuild": "0.28.1"
+ },
+ "engines": {
+ "node": ">=22.19.0"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-agent-core": {
+ "version": "0.85.1",
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.85.1.tgz",
+ "license": "MIT",
+ "dependencies": {
+ "@earendil-works/chord": "^0.85.1",
+ "@earendil-works/pi-ai": "^0.85.1",
+ "@earendil-works/pi-telemetry": "^0.85.1",
"diff": "8.0.4",
"ignore": "7.0.5",
"typebox": "1.3.7",
@@ -507,19 +526,18 @@
}
},
"node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai": {
- "version": "0.83.0",
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.83.0.tgz",
+ "version": "0.85.1",
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.85.1.tgz",
"license": "MIT",
"dependencies": {
- "@anthropic-ai/sdk": "0.91.1",
+ "@anthropic-ai/sdk": "0.123.0",
"@aws-sdk/client-bedrock-runtime": "3.1048.0",
+ "@earendil-works/pi-telemetry": "^0.85.1",
"@google/genai": "1.52.0",
- "@mistralai/mistralai": "2.2.6",
- "@opentelemetry/api": "1.9.0",
"@smithy/node-http-handler": "4.7.3",
"http-proxy-agent": "7.0.2",
"https-proxy-agent": "7.0.6",
- "openai": "6.26.0",
+ "openai": "6.40.0",
"partial-json": "0.1.7",
"typebox": "1.3.7"
},
@@ -530,9 +548,17 @@
"node": ">=22.19.0"
}
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-telemetry": {
+ "version": "0.85.1",
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-telemetry/-/pi-telemetry-0.85.1.tgz",
+ "license": "MIT",
+ "engines": {
+ "node": ">=22.19.0"
+ }
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-tui": {
- "version": "0.83.0",
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.83.0.tgz",
+ "version": "0.85.1",
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.85.1.tgz",
"license": "MIT",
"dependencies": {
"get-east-asian-width": "1.6.0",
@@ -542,6 +568,422 @@
"node": ">=22.19.0"
}
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
+ "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/android-arm": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
+ "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/android-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
+ "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/android-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
+ "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
+ "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
+ "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
+ "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-arm": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
+ "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
+ "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
+ "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
+ "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
+ "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
+ "cpu": [
+ "mips64el"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
+ "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
+ "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
+ "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/linux-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
+ "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
+ "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
+ "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
+ "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
+ "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
+ "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
+ "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@esbuild/win32-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
+ "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/@google/genai": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.52.0.tgz",
@@ -745,26 +1187,6 @@
"node": ">= 10"
}
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@mistralai/mistralai": {
- "version": "2.2.6",
- "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-2.2.6.tgz",
- "integrity": "sha512-W8pX7zHxjJvMIpw8JMxeJEleapXX0Q9NPszdNzqkM3MIEoIGPObdodujj+WHteXEvGfaP/AMwlNyRfEzSY6dQQ==",
- "license": "Apache-2.0",
- "dependencies": {
- "@opentelemetry/semantic-conventions": "^1.40.0",
- "ws": "^8.18.0",
- "zod": "^3.25.0 || ^4.0.0",
- "zod-to-json-schema": "^3.25.0"
- },
- "peerDependencies": {
- "@opentelemetry/api": "^1.9.0"
- },
- "peerDependenciesMeta": {
- "@opentelemetry/api": {
- "optional": true
- }
- }
- },
"node_modules/@earendil-works/pi-coding-agent/node_modules/@nodable/entities": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.0.tgz",
@@ -777,24 +1199,6 @@
],
"license": "MIT"
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@opentelemetry/api": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
- "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
- "license": "Apache-2.0",
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@opentelemetry/semantic-conventions": {
- "version": "1.41.1",
- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.41.1.tgz",
- "integrity": "sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==",
- "license": "Apache-2.0",
- "engines": {
- "node": ">=14"
- }
- },
"node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/aspromise": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
@@ -978,6 +1382,12 @@
"node": ">=14.0.0"
}
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/@stablelib/base64": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@stablelib/base64/-/base64-1.0.1.tgz",
+ "integrity": "sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ==",
+ "license": "MIT"
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/@types/node": {
"version": "22.19.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.19.tgz",
@@ -1041,15 +1451,15 @@
"license": "MIT"
},
"node_modules/@earendil-works/pi-coding-agent/node_modules/brace-expansion": {
- "version": "5.0.7",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
- "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
- "node": "18 || 20 || >=22"
+ "node": "20 || >=22"
}
},
"node_modules/@earendil-works/pi-coding-agent/node_modules/buffer-equal-constant-time": {
@@ -1128,12 +1538,59 @@
"safe-buffer": "^5.0.1"
}
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/esbuild": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
+ "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.1",
+ "@esbuild/android-arm": "0.28.1",
+ "@esbuild/android-arm64": "0.28.1",
+ "@esbuild/android-x64": "0.28.1",
+ "@esbuild/darwin-arm64": "0.28.1",
+ "@esbuild/darwin-x64": "0.28.1",
+ "@esbuild/freebsd-arm64": "0.28.1",
+ "@esbuild/freebsd-x64": "0.28.1",
+ "@esbuild/linux-arm": "0.28.1",
+ "@esbuild/linux-arm64": "0.28.1",
+ "@esbuild/linux-ia32": "0.28.1",
+ "@esbuild/linux-loong64": "0.28.1",
+ "@esbuild/linux-mips64el": "0.28.1",
+ "@esbuild/linux-ppc64": "0.28.1",
+ "@esbuild/linux-riscv64": "0.28.1",
+ "@esbuild/linux-s390x": "0.28.1",
+ "@esbuild/linux-x64": "0.28.1",
+ "@esbuild/netbsd-arm64": "0.28.1",
+ "@esbuild/netbsd-x64": "0.28.1",
+ "@esbuild/openbsd-arm64": "0.28.1",
+ "@esbuild/openbsd-x64": "0.28.1",
+ "@esbuild/openharmony-arm64": "0.28.1",
+ "@esbuild/sunos-x64": "0.28.1",
+ "@esbuild/win32-arm64": "0.28.1",
+ "@esbuild/win32-ia32": "0.28.1",
+ "@esbuild/win32-x64": "0.28.1"
+ }
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"license": "MIT"
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/fast-sha256": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/fast-sha256/-/fast-sha256-1.3.0.tgz",
+ "integrity": "sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==",
+ "license": "Unlicense"
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/fast-xml-builder": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz",
@@ -1246,23 +1703,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/glob": {
- "version": "13.0.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
- "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "minimatch": "^10.2.2",
- "minipass": "^7.1.3",
- "path-scurry": "^2.0.2"
- },
- "engines": {
- "node": "18 || 20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/@earendil-works/pi-coding-agent/node_modules/google-auth-library": {
"version": "10.6.2",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.6.2.tgz",
@@ -1295,6 +1735,15 @@
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"license": "ISC"
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/grok-mermaid": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/grok-mermaid/-/grok-mermaid-0.2.2.tgz",
+ "integrity": "sha512-XcJEP5dDC8liHBh52mlLjU18fNvu1ckFsu0QpIG3+APZ270fsj9wxpiA6cOURmbUEuoMVgjbC2+UYgTdCqqgzA==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/highlight.js": {
"version": "10.7.3",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
@@ -1451,15 +1900,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/minipass": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
- "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": ">=16 || 14 >=14.17"
- }
- },
"node_modules/@earendil-works/pi-coding-agent/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -1505,13 +1945,10 @@
}
},
"node_modules/@earendil-works/pi-coding-agent/node_modules/openai": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/openai/-/openai-6.26.0.tgz",
- "integrity": "sha512-zd23dbWTjiJ6sSAX6s0HrCZi41JwTA1bQVs0wLQPZ2/5o2gxOJA5wh7yOAUgwYybfhDXyhwlpeQf7Mlgx8EOCA==",
+ "version": "6.40.0",
+ "resolved": "https://registry.npmjs.org/openai/-/openai-6.40.0.tgz",
+ "integrity": "sha512-MWtTjd/gQt4jpbji61NTgFWJLoY/PdRJ6wG9/ZDRMYNMlBKrCrSlkLI+KgHP1vR1qT6LKSAyAqIxno6lcK9JiA==",
"license": "Apache-2.0",
- "bin": {
- "openai": "bin/cli"
- },
"peerDependencies": {
"ws": "^8.18.0",
"zod": "^3.25 || ^4.0"
@@ -1574,22 +2011,6 @@
"node": ">=8"
}
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/path-scurry": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
- "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "lru-cache": "^11.0.0",
- "minipass": "^7.1.2"
- },
- "engines": {
- "node": "18 || 20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/@earendil-works/pi-coding-agent/node_modules/proper-lockfile": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
@@ -1701,6 +2122,16 @@
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
"license": "ISC"
},
+ "node_modules/@earendil-works/pi-coding-agent/node_modules/standardwebhooks": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/standardwebhooks/-/standardwebhooks-1.1.1.tgz",
+ "integrity": "sha512-bCbX9ZEyFkWPsRz7Bl3NuQUJohmwGSev/yhr7vhaGPlc4AfIrspIRa6cPTBuI1ItmrTDJ4d/S2hCsfe4+vQGnQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@stablelib/base64": "^1.0.0",
+ "fast-sha256": "^1.3.0"
+ }
+ },
"node_modules/@earendil-works/pi-coding-agent/node_modules/strnum": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.3.0.tgz",
@@ -1732,9 +2163,9 @@
"license": "MIT"
},
"node_modules/@earendil-works/pi-coding-agent/node_modules/undici": {
- "version": "8.5.0",
- "resolved": "https://registry.npmjs.org/undici/-/undici-8.5.0.tgz",
- "integrity": "sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==",
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.9.0.tgz",
+ "integrity": "sha512-aWZpUj7XoGonMClx4gdDRfgBjqeA+F473aDmROQQbM9n6PRfK/u1q/a0X4wMTgcHfT8H6fpbt98PFuDUwFg2YA==",
"license": "MIT",
"engines": {
"node": ">=22.19.0"
@@ -1821,24 +2252,6 @@
"url": "https://github.com/sponsors/eemeli"
}
},
- "node_modules/@earendil-works/pi-coding-agent/node_modules/zod": {
- "version": "3.25.76",
- "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
- "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
- "license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/colinhacks"
- }
- },
- "node_modules/@earendil-works/pi-coding-agent/node_modules/zod-to-json-schema": {
- "version": "3.25.2",
- "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",
- "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",
- "license": "ISC",
- "peerDependencies": {
- "zod": "^3.25.28 || ^4"
- }
- },
"node_modules/@noble/hashes": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
@@ -2994,6 +3407,35 @@
"nearley": "^2.19.5"
}
},
+ "node_modules/playwright": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
+ "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "playwright-core": "1.63.0"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/playwright-core": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
+ "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "playwright-core": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
@@ -3047,9 +3489,9 @@
}
},
"node_modules/qs": {
- "version": "6.15.3",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
- "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
+ "version": "6.16.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
+ "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
"license": "BSD-3-Clause",
"dependencies": {
"es-define-property": "^1.0.1",
diff --git a/package.json b/package.json
index 5ea5ec0..4bf5552 100644
--- a/package.json
+++ b/package.json
@@ -7,10 +7,11 @@
"scripts": {
"start": "node server/index.js",
"dev": "node --watch server/index.js",
- "test": "node --test"
+ "test": "node --test",
+ "test:browser": "RUN_BROWSER_TESTS=1 node --test test/report-browser.test.js"
},
"dependencies": {
- "@earendil-works/pi-coding-agent": "^0.83.0",
+ "@earendil-works/pi-coding-agent": "^0.85.1",
"bcryptjs": "^3.0.3",
"express": "^5.0.1",
"nodemailer": "^9.0.3",
@@ -19,6 +20,10 @@
},
"devDependencies": {
"pg-mem": "^3.0.14",
+ "playwright": "^1.63.0",
"supertest": "^7.2.2"
+ },
+ "engines": {
+ "node": ">=22.19.0"
}
}
diff --git a/public/app.css b/public/app.css
index c3184a2..3f0331c 100644
--- a/public/app.css
+++ b/public/app.css
@@ -3373,3 +3373,7 @@ select.f {
width: 100%;
display: block;
}
+
+/* Historical machine bands and pace multipliers no longer guide planning. */
+#sec-machine .band-track, .ledger-pace { display:none !important; }
+#sec-machine .milestone-row { grid-template-columns:1fr 90px 110px; }
diff --git a/public/index.html b/public/index.html
index 09a4904..27fd5e3 100644
--- a/public/index.html
+++ b/public/index.html
@@ -10,7 +10,6 @@
-
@@ -255,8 +254,7 @@
- Answers are grounded in this plan's numbers, your learned pace, and
- the roaster behavior learned from your uploaded roasts.
+ Answers use this plan’s inputs and calculated milestones. Roaster history does not modify the plan.
@@ -402,8 +400,7 @@
Timing framework: Rob Hoos, Cultivars: A Practical Guide for Coffee Roasters.
- Temperatures, bands and machine settings: your own logged roasts on the Hottop
- KN-8828B-2K+ — they transfer to no other machine.
+ Temperatures are illustrative planning references, not universal targets. Enter your own readings; preheat setpoint and bean temperature are different measurements.
@@ -886,14 +883,21 @@
So the rule is: decline steadily from the
post-turning-point peak, through small frequent heat cuts
rather than a few big ones, and stay ahead of the
- machine's roughly 60-second lag — what you change now
- shows up a minute from now, so cut before the
+ machine’s response delay — changes take time to affect the bean, so cut before the
exotherm, gently. If a phase would need a rate outside the
- proven bands to hit its milestone, the plan is not
+ illustrative ranges to hit its milestone, the plan is not
reachable — fix the ledger, not the roaster.
Temperatures & rate-of-rise
+
Blank fields use an illustrative curve: charge 392°F, yellow 320°F, first crack 392°F. These are not preheat settings. First crack must be heard; enter your own probe readings to replace the illustration. Drop is derived from development time and a declining planned rise.
+
+
+
+
+
+
+
Subtotal (before pace)Timing subtotal
-
+
× Machine pace
@@ -1846,7 +1850,7 @@
-
Subtotal (before pace)
+
Timing subtotal
diff --git a/public/js/alog-ui.js b/public/js/alog-ui.js
index a3bab8d..3bc29ed 100644
--- a/public/js/alog-ui.js
+++ b/public/js/alog-ui.js
@@ -77,7 +77,9 @@ export function initAlogPanel({
Object.assign(document.createElement("li"), { textContent: "Loading…" }),
);
try {
- const body = await (await fetch("/api/alog/library")).json();
+ const response = await fetch("/api/alog/library");
+ if (response.status === 403) throw new Error("The server roast library is available to administrators. Use the file picker for your own logs.");
+ const body = await response.json();
if (!body.ok || !body.files.length) {
libraryList.replaceChildren(
Object.assign(document.createElement("li"), {
diff --git a/public/js/field-help-content.js b/public/js/field-help-content.js
index 1b35671..d51d73a 100644
--- a/public/js/field-help-content.js
+++ b/public/js/field-help-content.js
@@ -16,7 +16,7 @@ import {
CHARGE_SETTINGS,
YELLOW_RATIO,
findCultivar,
-} from "/shared/reference-data.js";
+} from "/shared/reference-data.js?v=__ASSET_VERSION__";
// ---- small DOM builders --------------------------------------------------
@@ -754,60 +754,13 @@ export const HELP_TOPICS = {
const label = input?.closest(".ledger-row")?.querySelector(".l-label");
return label ? [label] : [];
},
- render(_plan, unit, profile) {
- const pace = profile?.pace;
- const paceText =
- pace?.source === "learned"
- ? `Your own account is currently running at ${pace.value.toFixed(2)}× the reference ` +
- `pace (learned from ${pace.n} of your logged roasts) — that factor scales your ` +
- "whole first-crack line by how fast your roasts have actually run overall. It's a " +
- "single blanket ratio across your history, not something that adjusts itself by " +
- "batch weight, so this table's specific charge/heat/fan settings are still worth " +
- "reading as the reference operator's own notes, not something the learned pace " +
- "stands in for."
- : "This app now applies a learned per-user pace factor to first crack instead of a " +
- "flat added-seconds guess (below, it defaults to 1× until you've logged at least " +
- "two roasts with an actual first-crack time). That factor tracks how fast your " +
- "machine runs overall — it isn't conditioned on batch weight — so the specific " +
- "settings in this table are still the reference operator's own charge/heat/fan " +
- "choices, not derived from your machine.";
- return frag(
- p(
- "Batch size was the strongest correlate with first-crack time in the reference " +
- "operator's own logged data (r = +0.67): a 226 g batch landed first crack roughly " +
- "1:30–2:00 later than 200 g at similar settings — a ~13% weight increase stretching " +
- "first crack ~40%, a scaling relationship a flat added-seconds guess can't fully " +
- "represent. Field 6.4 below is still that same flat additive guess — you still " +
- "enter it by hand for your own batch, and it's now folded into the line that the " +
- "learned pace factor scales, so it moves by that factor too. What's new is a " +
- "separate learned pace factor (below) that scales your entire first-crack line by " +
- "how fast your account's roasts have actually run — but it's one blanket ratio " +
- "across your whole history, not a per-batch-weight adjustment, so it doesn't replace " +
- "6.4 for batch-to-batch changes.",
- ),
- p(paceText),
- buildTable({
- cols: [
- { label: "Batch", key: "batch" },
- { label: "Charge probe", num: true, render: (row) => chargeProbeCell(row, unit) },
- { label: "Heat", key: "heat", num: true },
- { label: "Fan", key: "fan", num: true },
- { label: "Observed result", key: "observed" },
- ],
- rows: CHARGE_SETTINGS,
- }),
- aside({
- tag: "Charge temperature is a batch-size function",
- text:
- "Higher charge for larger batches is how the reference rows keep their timing. If " +
- "your turning point lands much past 1:05 at 200 g, you charged cool.",
- }),
- );
- },
- },
+ render() {
+ return frag(p("Batch size can change roast behavior, but the app never applies machine pace or batch corrections automatically. Field 6.4 is an optional time adjustment you enter from your own observations. Change one variable at a time and compare the cup."));
+ },
+ },
"milestones-ror": {
- title: "Milestones & the RoR budget — proven numbers, learned or reference",
+ title: "Milestones & rate of rise — planning references",
targets: [],
place() {
const subheads = [...document.querySelectorAll("#sec-machine .subhead")];
@@ -816,107 +769,15 @@ export const HELP_TOPICS = {
console.warn('field-help: "milestones-ror" fell back to positional lookup — subhead text changed?');
return subheads[0] ? [subheads[0]] : [];
},
- render(_plan, unit, profile) {
- const t = (c) => convTemp(c, unit);
- const d = (c) => convDelta(c, unit);
- const u = unitLabel(unit);
- const ru = rateUnitLabel(unit);
- const milestoneDefs = [
- { label: "Charge", ref: MACHINE.charge, learnedKey: "charge", timeSuffix: "", note: "The probe reading when beans go in, i.e. your preheat. Higher for larger batches." },
- { label: "Turning point", ref: MACHINE.turningPoint, learnedKey: "tp", timeSuffix: ` @ ${MACHINE.turningPoint.medianTime}`, rangeTimeSuffix: ` @ ${MACHINE.turningPoint.rangeTime}`, note: "Falls out of charge temperature and batch mass; you don't set it directly. A TP much past 1:05 at 200 g means you charged cool." },
- { label: "Yellow", ref: MACHINE.yellow, learnedKey: "yellow", timeSuffix: "", note: "Threshold-derived, not observed. Use as a rough guide and start calling it by eye — grassy smell turns to bread, colour goes straw." },
- { label: "First crack", ref: MACHINE.firstCrack, learnedKey: "fc", timeSuffix: "", note: "Tight and reliable in the reference log. Usually the single most trustworthy number here." },
- { label: "Drop (light)", ref: MACHINE.drop, learnedKey: "drop", timeSuffix: "", note: `For darker levels, build the ladder yourself: raise drop ${d(2)}–${d(3)} ${u}, weigh, record — don't extrapolate.` },
- ];
- // Each milestone falls back to the reference band independently — a user might have
- // enough of their own First crack readings to trust long before they bother recording
- // Turning point, so this isn't a single all-or-nothing learned/reference switch.
- const rows = milestoneDefs.map(({ label, ref, learnedKey, timeSuffix, rangeTimeSuffix, note }) => {
- const learned = profile?.bands?.[learnedKey];
- const useLearned = learned?.source === "learned";
- const medianC = useLearned ? learned.medianC : ref.medianC;
- const rangeC = useLearned ? learned.rangeC : ref.rangeC;
- return {
- milestone: useLearned ? `${label} (n=${learned.n})` : label,
- median: `${t(medianC)} ${u}${timeSuffix}`,
- range: `${t(rangeC[0])}–${t(rangeC[1])} ${u}${rangeTimeSuffix ?? timeSuffix}`,
- note,
- };
- });
- const anyLearned = profile?.bandsSource === "learned";
- const introText = anyLearned
- ? "The rows marked (n=…) below are learned from your own logged roasts on this " +
- "account; the rest still use the reference operator's original Hottop log until " +
- "you've recorded enough actual temperatures of your own. The times and ratios in " +
- "this app port between similar drum roasters; the temperatures never do — they're " +
- "whichever machine and probe actually produced them."
- : "These bands are the reference operator's original 14 Hottop KN-8828B-2K+ roasts — " +
- "not yours, unless you're them. They'll start being replaced by your own account's " +
- "figures automatically once you log actual temperatures at each milestone. The times " +
- "and ratios in this app port between similar drum roasters; the temperatures never do.";
- return frag(
- p(
- `${introText} Reference first crack reads ${t(176)}–${t(187)} ${u}, well below the ` +
- `~${t(196)} ${u} a fast, well-immersed probe would show; that doesn't make it wrong, ` +
- "it makes it that probe's own.",
- ),
- buildTable({
- cols: [
- { label: "Milestone", key: "milestone" },
- { label: "Median", key: "median", num: true },
- { label: "Range", key: "range", num: true },
- { label: "Note", key: "note" },
- ],
- rows,
- }),
- p(
- "For each phase, divide the temperature you must gain by the time you have. A phase " +
- "outside its band means the plan is not reachable — change the ledger, not the roaster.",
- ),
- buildTable({
- cols: [
- { label: "Phase", key: "phase" },
- { label: `Machine-proven ${ru}`, key: "band", num: true },
- ],
- rows: [
- { phase: "TP → Yellow", band: `${d(MACHINE.ror.tpToYellow[0])}–${d(MACHINE.ror.tpToYellow[1])}` },
- { phase: "Yellow → FC", band: `${d(MACHINE.ror.yellowToFc[0])}–${d(MACHINE.ror.yellowToFc[1])}` },
- { phase: "FC → Drop", band: `${d(MACHINE.ror.fcToDrop[0])}–${d(MACHINE.ror.fcToDrop[1])}` },
- ],
- }),
- aside({
- tag: "Worked example — Typica, washed, light, 200 g",
- text:
- "Ledger gives yellow 4:15, first crack 7:30, development 1:30, drop 9:00. Turning " +
- `point lands about 0:55 at ${t(85)} ${u}.`,
- }),
- formula(
- `TP→Yellow: (${t(158)} − ${t(85)}) ${u} ÷ 3.33 min ≈ ${preciseRate(73, 3.33, unit)} ${ru}`,
- `inside ${d(17)}–${d(25)} ✓`,
- ),
- formula(
- `Yellow→FC: (${t(183)} − ${t(158)}) ${u} ÷ 3.25 min ≈ ${preciseRate(25, 3.25, unit)} ${ru}`,
- `inside ${d(6)}–${d(10)} ✓`,
- ),
- formula(
- `FC→Drop: (${t(190)} − ${t(183)}) ${u} ÷ 1.50 min ≈ ${preciseRate(7, 1.5, unit)} ${ru}`,
- `inside ${d(3)}–${d(9)} ✓ — plan is reachable. Checks: drying 47%, Maillard 36%, DTR 17% — all in band.`,
- ),
- h4("Terms"),
- glossary([
- ["Turning point", "the lowest bean-probe reading after charge, where the beans stop cooling the drum and start absorbing heat"],
- ["Yellow / dry end", "free moisture largely gone, colour green→straw, smell grassy→bread; call it by eye and nose"],
- ["Maillard", "the browning phase between yellow and first crack — most of the sweetness, body and complexity"],
- ["First crack", "audible, exothermic; internal pressure ruptures the cell structure"],
- ["Development", "first crack to drop — the main acidity/sweetness lever and the only phase you can still adjust while roasting"],
- ["DTR", "development ÷ total roast time"],
- ["Rate of rise", "how fast bean temperature climbs, °C/min"],
- ["Exotherm", "around first crack the bean briefly releases its own heat — roughly +1.4 °C/min you did not command"],
- ["Second crack", "quieter, higher-pitched; dark-roast territory, past everything these numbers are validated for"],
- ]),
- );
- },
- },
+ render() {
+ return frag(
+ p("Blank temperature fields draw an illustrative curve. Your entered readings take precedence. Roaster selection and historical measurements never adjust the plan."),
+ p("Preheat setpoint, environmental temperature and bean-probe temperature are different measurements. Record preheat separately. Mark yellow by color and aroma, and first crack by sustained audible cracking."),
+ p("Aim for controlled progression with declining RoR after its recovery peak. The smooth curve is interpolation, not a physical prediction. Phase-average RoR cannot show every brief crash or flick. Inconsistent entered milestones are flagged without rewriting your targets."),
+ p("Timing, DTR and turning point alone cannot diagnose cup quality. Evaluate color, aroma, the actual trace and tasting results together.")
+ );
+ },
+ },
actuators: {
title: "Heat & fan — the taper, and what actually moves first crack",
@@ -928,161 +789,28 @@ export const HELP_TOPICS = {
console.warn('field-help: "actuators" fell back to positional lookup — subhead text changed?');
return subheads[1] ? [subheads[1]] : [];
},
- render(_plan, unit) {
- return frag(
- buildTable({
- cols: [
- { label: "Point in roast", key: "point" },
- { label: "Heat", key: "heat", num: true },
- { label: "Fan", key: "fan", num: true },
- { label: "Intent", key: "intent" },
- ],
- rows: TAPER_TEMPLATE,
- }),
- h4("Charge settings by batch"),
- buildTable({
- cols: [
- { label: "Batch", key: "batch" },
- { label: "Charge probe", num: true, render: (row) => chargeProbeCell(row, unit) },
- { label: "Heat", key: "heat", num: true },
- { label: "Fan", key: "fan", num: true },
- { label: "Observed result", key: "observed" },
- ],
- rows: CHARGE_SETTINGS,
- }),
- aside({
- tag: "The first-cut lever",
- text:
- "When you make the first heat cut is your main first-crack lever — later cut, earlier " +
- "crack. Holding 100% to ~3:00 gave 7:55; cutting at ~1:00 gave 9:00. Steps of 3–5% " +
- "beat single large ones, and the machine has roughly a 60-second dead time: what you " +
- "change now shows up about a minute from now.",
- }),
- aside({
- tag: "What the reference operator's own logs do NOT tell you",
- warn: true,
- text:
- '"More heat before yellow gives an earlier first crack" does not hold in the reference ' +
- "operator's 14-roast log — heat delivered before yellow correlates positively with " +
- "first-crack time (r = +0.43) because it's partly a proxy for elapsed time; average " +
- "heat rate shows almost none (r = +0.20). The honest correlates there are batch size " +
- "(+0.67) and time to yellow (+0.59) — both descriptive, neither causal, and specific " +
- "to that one operator's machine. The taper is a starting shape, not a validated " +
- "control law: for a real lever on your own machine, vary only the time of the first " +
- "heat cut across three batches of the same coffee and see what actually moves.",
- }),
- h4("Fan, measured causally"),
- p(
- `On the reference machine, isolated fan steps with the burner held steady gave roughly ` +
- `${MACHINE.fanEffectCPerMinPer10Pct} °C/min of RoR per +10% fan — only 5 clean windows ` +
- "across 4 roasts, but the one number in this reference set from a controlled " +
- "comparison rather than a correlation. Worth re-measuring on your own machine before " +
- "trusting it there.",
- ),
- h4("The plant model"),
- formula("RoR (°C/min) = 0.0903 × (0.988·H + 0.215·F + 167.0 − BT)"),
- formula("H = (RoR ÷ 0.0903 − 0.215·F − 167.0 + BT) ÷ 0.988"),
- p("H = heat %, F = fan %, BT = bean temp °C; above 178 °C add ~+1.4 °C/min for the exotherm."),
- p(
- "Treat it as a sanity check on direction and rough magnitude, not a setpoint calculator: " +
- "it carries a ±5 °C band, a 60-second dead time, was fitted on the reference " +
- "operator's light roasts of 200–226 g, and its fan term's sign is wrong for planning " +
- "(fitted from closed-loop data — use the −1.3 figure instead). Where the equation and " +
- "your own logged roasts disagree, believe your logs — this formula is a planning aid " +
- "borrowed from someone else's machine, not a law.",
- ),
- );
- },
- },
+ render() {
+ return frag(
+ p("Enter heat and airflow steps that you can repeat, with the reason for each change. No machine-specific heat/fan percentages or response formula is applied by this planner."),
+ p("Use your manufacturer's preheat routine and log the setpoint separately from charge BT. Anticipate the machine's response delay and make controlled changes before excessive momentum builds."),
+ p("Fan changes can affect heat transfer as well as exhaust. Their effect depends on the equipment and airflow path. Do not infer a universal effect from another operator's percentages."),
+ p("Compare one deliberate change across repeat batches and judge the cup as well as the trace. A correlation in a small roast history is not a validated control law.")
+ );
+ },
+ },
"sanity-checks": {
title: "Sanity checks — what a failure is telling you",
targets: [".checks-card .dock-card-head h2"],
- render() {
- return frag(
- p(
- "Two of these are real checks that stand between an arithmetically valid plan and a " +
- "roastable one — a fail sends you back to the ledger, never to the machine. The " +
- "other two (drying share, Maillard share) are shown for context only; see the aside " +
- "below for why.",
- ),
- buildTable({
- cols: [
- { label: "Check", key: "check" },
- { label: "Compute", key: "compute" },
- { label: "Should be", key: "should", num: true },
- { label: "What a failure means", key: "meaning" },
- ],
- rows: [
- {
- check: "Drying share (informational)",
- compute: "yellow ÷ drop",
- should: `${SANITY_BANDS.drying.lo}–${SANITY_BANDS.drying.hi}%`,
- meaning:
- "Can't fail independently of DTR (see below) — shown for context. High → " +
- "yellow reads late relative to drop; low → yellow reads early.",
- },
- {
- check: "Maillard share (informational)",
- compute: "maillard ÷ drop",
- should: `${SANITY_BANDS.maillard.lo}–${SANITY_BANDS.maillard.hi}%`,
- meaning:
- "Same derivation as drying share, so the same caveat applies. Mirrors it: " +
- "whichever way drying share leans, this leans the other.",
- },
- {
- check: "Development ratio",
- compute: "dev ÷ drop",
- should: `${SANITY_BANDS.dtr.lo}–${SANITY_BANDS.dtr.hi}% (light: 12–17)`,
- meaning:
- "Below 12% → likely under-developed whatever the clock says. Expect sharp, " +
- "astringent acidity with no fruit behind it.",
- },
- {
- check: "Development ceiling",
- compute: "dev",
- should: "< 4:30",
- meaning: "Over 4:30 mutes even a dark roast. There is nothing useful on the other side of that line.",
- },
- ],
- }),
- aside({
- tag: "Why drying share and Maillard share stopped being pass/fail",
- text:
- "Yellow is never entered independently in this app — it's always derived as " +
- "0.56 × first crack (see Anchor & profile). That means drying% = 0.56 × (A ÷ D) and " +
- "Maillard% = 0.44 × (A ÷ D): both are pure algebra on the DTR check, not separate " +
- "measurements. Whenever DTR passes, the arithmetic guarantees drying lands in " +
- "44.8–49.3% and Maillard in 35.2–38.7% — comfortably inside both bands, every time. " +
- "They used to display green or red checkmarks that implied four independent " +
- "validations when only two ever could fail. They're kept here because the " +
- "percentages themselves are still useful context — just not a verdict.",
- }),
- aside({
- tag: "Worked check — when modifiers stack",
- text:
- "Bourbon anaerobic natural, light: anchor 8:45, base 1:30, natural −0:20, anaerobic " +
- "−0:10 → development 1:00, DTR 10.3% — below the 12% floor. When stacked modifiers " +
- "push you out of band, drop the smaller one rather than overriding the check.",
- }),
- aside({
- tag: "The reference operator's own history runs outside these bands — read before dismissing",
- warn: true,
- text:
- "Across the reference operator's 14 logged roasts the measured shares are drying " +
- "65%, Maillard 25%, DTR 10.4% — all outside the bands, all in the same direction. " +
- "Drying and Maillard are partly an artifact there: Artisan computes the dry end from " +
- "a temperature threshold, not an observed colour change, which inflates drying and " +
- "deflates Maillard in exactly this pattern — calling yellow by eye and smell is the " +
- "fix, not concluding the roasts were structurally wrong. DTR is not an artifact: both " +
- "first crack and drop are marked events. A median development of 1:00 is defensible " +
- "for the naturals that dominate that log, but 0:45–0:52 is below the floor for any " +
- "roast level; if those particular batches cupped sharp or thin, that's the number " +
- "that should have moved.",
- }),
- );
- },
- },
+ render() {
+ return frag(
+ p("These checks describe a planning range, not a verdict on roast quality. DTR is development divided by total time; a ratio inside 12–20% does not guarantee good coffee, and one outside it does not prove a failure."),
+ p("Drying and Maillard shares are informational because the planner derives yellow as 0.56 × first crack. They are not independent measurements."),
+ p("For light plans, modifier suggestions below 1:15 are raised to 1:15 with a warning. This is a starting heuristic. Enter a direct development target to override it; your choice remains visible even outside the planning range."),
+ p("Check color, aroma, actual RoR, and tasting results together. Longer development may suit a different roast intent; the 4:30 check is a worksheet review threshold, not a universal physical limit.")
+ );
+ },
+ },
"roast-log": {
title: "At the machine — before charging, and during the roast",
@@ -1119,31 +847,12 @@ export const HELP_TOPICS = {
curve: {
title: "Reading the curve — what good looks like",
targets: [".curve-card .dock-card-head h2"],
- render() {
- return frag(
- p(
- "Plot the five milestones — bean temperature against the left axis, rate of rise " +
- "against the right. Draw the plan before the roast, overlay what actually happened " +
- "afterward, so one chart carries both.",
- ),
- aside({
- tag: "What a good curve looks like",
- text:
- "The bean-temperature line falls to the turning point in the first minute, climbs " +
- "steeply out of it, then bends progressively flatter all the way to the drop. There " +
- "is no straight segment and no second steepening. If your drawn line needs a kink to " +
- "connect two milestones, the milestones are wrong — not the coffee.",
- }),
- aside({
- tag: "The rate-of-rise line",
- text:
- "Starts near its peak just after the turning point (17–25 °C/min on a similar drum roaster) and " +
- "declines steadily to somewhere between 3 and 9 °C/min at the drop. It never touches " +
- "zero and never turns back up. Watch the region just after first crack in particular: " +
- "the exotherm gives you free heat for a few seconds and then withdraws it, and that " +
- "hand-off is where a crash appears.",
- }),
- );
- },
- },
+ render() {
+ return frag(
+ p("The graph labels milestone times and Fahrenheit temperatures directly, with drying, Maillard and development durations. An attached reference trace appears dashed on the live chart."),
+ p("The smooth plan line interpolates your milestones; it is not a predicted sensor trace. Blank temperatures are marked illustrative. Enter actual probe references when you have them."),
+ p("Aim for controlled progression and declining RoR after the recovery peak. Phase-average RoR alone cannot rule out a brief crash or flick. The graph plots BT, not a separate measured RoR trace.")
+ );
+ },
+ },
};
diff --git a/public/js/field-help.js b/public/js/field-help.js
index 462dd50..a29ebb5 100644
--- a/public/js/field-help.js
+++ b/public/js/field-help.js
@@ -2,7 +2,7 @@
// section prose ("why this works"); this is an on-demand, per-field reference library ("what are
// my options"). See FIELD_HELP_SPEC.md (deleted after implementation) for the design rationale.
-import { HELP_TOPICS } from "./field-help-content.js";
+import { HELP_TOPICS } from "./field-help-content.js?v=__ASSET_VERSION__";
export function initFieldHelp({ getPlan, getTempUnit, getMachineProfile }) {
const dialog = document.getElementById("field-help-dialog");
diff --git a/public/js/main.js b/public/js/main.js
index c56e4d5..3c4ea6e 100644
--- a/public/js/main.js
+++ b/public/js/main.js
@@ -11,9 +11,10 @@ import {
findProcess,
findRoastLevel,
} from "/shared/reference-data.js?v=__ASSET_VERSION__";
-import { buildPlanCurve, pointsToPathD, tToX, tempToY } from "/shared/curve.js?v=__ASSET_VERSION__";
+import { buildPlanCurve, pointsToPathD, tToX, tempToY, curveWarnings } from "/shared/curve.js?v=__ASSET_VERSION__";
import { initPrefillPanel } from "./prefill-ui.js?v=__ASSET_VERSION__";
import { initAlogPanel } from "./alog-ui.js?v=__ASSET_VERSION__";
+import { renderReportCurve } from "/shared/report.js?v=__ASSET_VERSION__";
import { initPrint } from "./print.js?v=__ASSET_VERSION__";
import { initLotPicker } from "./lot-picker.js?v=__ASSET_VERSION__";
import { api, protectedFetch, csrfToken } from "./api.js?v=__ASSET_VERSION__";
@@ -37,73 +38,10 @@ let deferredInstallPrompt = null;
let lotPicker = null;
const BAND_DOMAIN = [60, 220]; // shared °C domain for every band-track in the Machine Plan section
-// Learned per-user machine profile (pace factor + temperature bands) from shared/learn.js — see
-// its header comment. Cached to localStorage per user so it's available offline, same pattern as
-// the plan draft cache below.
const MACHINE_PROFILE_KEY_PREFIX = "roastPlannerMachineProfile.v1";
-let machineProfile = null;
-// Learned roaster behavior from uploaded .alogs (server-aggregated) — used as the plan
-// curve's fallback milestone temps so the suggested curve matches this user's machine.
-let roasterProfile = null;
-
-async function loadRoasterProfile() {
- try {
- const response = await fetch("/api/roaster-profile");
- if (response.ok) roasterProfile = (await response.json()).profile;
- // A manual pace tweak on the default machine (Machines page) beats the plan-log
- // learned pace in the ledger.
- if (Number.isFinite(roasterProfile?.paceFactorOverride))
- machineProfile = {
- ...(machineProfile ?? {}),
- pace: {
- value: roasterProfile.paceFactorOverride,
- source: "override",
- roasterName: roasterProfile.roaster?.name ?? null,
- },
- };
- } catch {
- /* offline — curve falls back to reference machine temps */
- }
-}
-
-async function loadMachineProfile(userId) {
- const cacheKey = `${MACHINE_PROFILE_KEY_PREFIX}:${userId}`;
- try {
- const response = await fetch("/api/machine-profile");
- if (response.ok) {
- machineProfile = (await response.json()).profile;
- localStorage.setItem(cacheKey, JSON.stringify(machineProfile));
- return;
- }
- } catch {
- /* offline — fall through to the cached profile, if any */
- }
- try {
- const cached = localStorage.getItem(cacheKey);
- if (cached) machineProfile = JSON.parse(cached);
- } catch {
- /* no cached profile available; ledger falls back to pace 1.0 (reference) */
- }
-}
-
+const machineProfile = null;
function renderMachineProfileNote() {
- const el = document.getElementById("machine-profile-note");
- if (!el) return;
- const pace = machineProfile?.pace;
- if (pace?.source === "override") {
- el.textContent = `Pace ×${pace.value.toFixed(2)} — your manual tweak${pace.roasterName ? ` for ${pace.roasterName}` : ""} (Machines page).`;
- return;
- }
- if (!pace || pace.source !== "learned") {
- el.textContent =
- "Using reference timing (one operator's Hottop KN-8828B-2K+) — recalibrates to your own machine as you log roasts with an actual first-crack time.";
- return;
- }
- const paceText =
- Math.abs(pace.value - 1) < 0.01
- ? "running close to reference pace"
- : `running ${pace.value > 1 ? `${Math.round((pace.value - 1) * 100)}% slower` : `${Math.round((1 - pace.value) * 100)}% faster`} than reference`;
- el.textContent = `Learned from ${pace.n} of your own roasts — ${paceText}.`;
+ document.getElementById("machine-profile-note").textContent = "Plans use your inputs. Roaster selection and roast history do not change timing or temperature suggestions.";
}
// Temperature fields are always stored in state.plan as canonical °C — this is purely a
@@ -111,7 +49,7 @@ function renderMachineProfileNote() {
// the actuator schedule respectively; every other numeric field (%, g, days) is untouched.
const TEMP_UNIT_KEY = "roastPlannerTempUnit.v1";
const TEMP_FIELD_RE = /\.(tempC|actualBt|expectedBt)$/;
-let tempUnit = localStorage.getItem(TEMP_UNIT_KEY) === "F" ? "F" : "C";
+let tempUnit = localStorage.getItem(TEMP_UNIT_KEY) === "C" ? "C" : "F";
const cToF = (c) => (c * 9) / 5 + 32;
const fToC = (f) => ((f - 32) * 5) / 9;
function isTempField(name) {
@@ -357,6 +295,7 @@ function renderLedger() {
fmtOut("check-dtr", pct(ledger.checks.dtr.pct));
fmtOut("check-ceiling", d(ledger.checks.ceiling.valueS));
+ ledger.warnings.push(...curveWarnings(buildPlanCurve(state.plan, ledger)));
const warnings = document.getElementById("ledger-warnings");
warnings.replaceChildren(
...ledger.warnings.map((warning) => {
@@ -495,7 +434,7 @@ function paintCurveInto(planGroup, refGroup, planPoints, ref) {
}
function renderCurve(ledger) {
- const planPoints = buildPlanCurve(state.plan, ledger, roasterProfile);
+ const planPoints = buildPlanCurve(state.plan, ledger);
const ref = state.plan.reference;
paintCurveInto(
@@ -504,12 +443,10 @@ function renderCurve(ledger) {
planPoints,
ref,
);
- paintCurveInto(
- document.getElementById("plan-curve-live"),
- document.getElementById("ref-curve-live"),
- planPoints,
- ref,
- );
+ const live = document.getElementById("curve-svg-live");
+ live.setAttribute("viewBox", "0 0 900 440");
+ live.innerHTML = renderReportCurve(planPoints, ledger, ref).replace(/^