Repository navigation
CT-001: SmartMount health pass - #211
Draft
Swissystem7 wants to merge 6 commits into
Draft
Swissystem7 wants to merge 6 commits into
Swissystem7 wants to merge 6 commits into
Conversation
npm ci failed (no lockfile) and npm audit failed with ENOLOCK. The project has no dependencies, so the lockfile is the root entry only. Adds engines.node >=20, a test that pins the lockfile, zero deps and the LF .gitattributes rule, and fixes a stale 'no CI' comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Also updates the stale '140+ host tests' count (now ~500). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A CUSTOM panel accepted any limit: NaN or a string gave a NaN angle and NaN step count, Infinity let the law ask for 235 degrees, and a negative cap pinned every angle to it. Now only a finite limit >= 0 is used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sizeBattery gated 'pack-cannot-motor-rail' on holdW, which is > 0 even with a worm, so 'pack-cannot-move-pulse' (which power/ has text for) was unreachable. Gate on idle coils instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
validateBoardRunLog only matched invented lines ('WiFi connected', 'IP
address'). The .ino prints 'IP: ' + localIP(), so a connected board read
as hasWifi=false.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The root package must stay dependency-free (test/install.test.js and test/pages.test.js enforce it, README promises it), so the suite is an isolated package under e2e/: its own package.json + lockfile with @playwright/test, playwright.config.js, a zero-dependency static server (e2e/serve.js, 127.0.0.1 only) and specs in e2e/tests/. Root gets only the script npm run test:e2e; npm test is unchanged. Desktop and 360px mobile, 24 tests x 2 viewports: - home: badge, panel limits from control-params, CTA to the case, nav menu - every page is Hebrew RTL with an h1 and no sideways scroll; 404 page - case: filter review findings by severity - dashboard: glare tilts, failed sensor holds, manual mode - lab: dead sensor holds, deg=99 clamps to the OLED limit, WiFi cut, panel - spec: torque calculator (mass, self-lock, reset) Requests leaving 127.0.0.1, page errors, console errors and 4xx/5xx fail the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CT-001 health pass of SmartMount (owner: Goza, Claude Team, ASUS machine). No changes to
.github/workflows, no secrets added, no force push. I did not touchtest/coverage-pilot.test.js(#210).Before starting I checked for open PRs. The only one was #210 (Copilot, tests only), which doesn't overlap.
The first session paused for quota after the install and docs commits. The second session (after the quota reset) did the module-by-module review of
src/liband the three bug fixes below.Checklist: what changed
npm ciandnpm auditwork againpackage-lock.json. Without it,npm cifailed andnpm auditfailed withENOLOCK. The project has no dependencies, so the lockfile has only the root entry.package.json: addedengines.node >=20(CI uses 22).src/lib. Each one has a test that fails onmaster:control.js: a CUSTOM panel accepted any limit.calcOptimalAngle(500, 10, 'CUSTOM', 0, NaN)returnedNaN, andmoveToAnglegavesteps: NaN.Infinitylet the law ask for 235°. A negative cap pinned every angle to that negative value. Now only a finite limit ≥ 0 is used; anything else throwsunknown panel type, like an unknown panel. No page passes a custom limit, so the pages don't change. →test/control-custom-limit.test.jspower.js:pack-cannot-move-pulsecould never be returned.sizeBatterychosepack-cannot-motor-railwheneverholdW > 0.holdWis the winding I²R and is positive even with a worm, so a worm build on a USB bank or 2S pack was told "coils left on drain it anyway". The power page has its own sentence for the move-pulse case ("idle is cheap thanks to the worm, but the move pulse is still 12 V"). The check now uses idle coils (coilsIdle > 0). →test/power-move-pulse.test.js, which also checks that every kind returned has text onpower/index.htmlhil.js:validateBoardRunLogdidn't recognize the firmware's real WiFi line. It matched only invented lines (WiFi connected,IP address). The.inoprintsIP:+WiFi.localIP(), so a board that joined the network read ashasWifi: false. It now also accepts the real line. CRLF logs work too. →test/hil-board-log.test.jstest/install.test.jschecks that the lockfile exists and matchespackage.json, that there are no npm dependencies, theengines.nodefloor, and (for Windows) that.gitattributeskeepseol=lfand the key files contain no CR.docs/TESTING.mdnow has rows for the new test files. Fixed a stale "no CI on purpose" comment inscripts/compile-firmware.sh.src/lib: I read control, optics, torque, protocol, power, timing, gantt-chart, userValidation, sentryLoader, contact, feedback, bom, safety, hil, alts and case line by line. Forfsm.jsI read the firmware model and listed the functions infsm-table.js; every cell of both is already pinned byfsm-matrix.test.js.Verification (Windows 10, Node 24.19, npm 11.17)
Not done
scripts/compile-firmware.shneeds arduino-cli and the esp32 core).src/libwas.Needs a human decision
torque.verdictis not monotonic without a worm gear.factor: 1.0, selfLocking: falsegivesholds, but1.01givesmarginal(src/lib/torque.js). This is deliberate ([dev-cycle] In src/lib/torque.js, the function 'verdict' does not handle the case #36), andtest/torque.test.jspins it. Which do you want: 1.0 →marginal, or every factor in [1,2) →holdswithout a worm?src/lib/safety.js(shown onspec/) talks about "altitude and azimuth axes", "releasing clutches", "optical payload" and "timing belts". Each entry also repeats the same sentence in three fields (mitigation/action/step). This is content, so I didn't rewrite it. Should someone rewrite it for an ESP32 + NEMA17 TV tilt mount?/statusor a "holding position" line, so HIL-02 and HIL-03 can never match a real Serial log. Also,hasSensorInitis true for the failure lineBH1750 top not found at 0x23. Should the validator check what the.inoreally prints, or should the firmware print more?7.76.0) has no SRIintegrityhash, andscrubEventremovesuserandrequest.databut notrequest.urlquery strings or breadcrumbs. It's inert while the DSN is a placeholder.src/lib/bom.jsis CommonJS only (no browser global), unlike the other modules. No page loads it today.scripts/smoke.jshas a machine-specific Playwright path (D:\Cache\ms-playwright) and a fallback that usesHOME, which is often unset on Windows. Should Playwright become a pinned devDependency (that would end the zero-dependency rule)?CT-014: E2E tests
Commit:
741df5b.Why it lives under
e2e/: the root package is deliberately dependency-free. The README says "no npm dependencies", andtest/install.test.js(lockfile has only"") andtest/pages.test.js(devDependenciesundefined) enforce it. So@playwright/testis not added to the rootpackage.json. The suite is its own package:e2e/package.jsonande2e/package-lock.json(pinned@playwright/test1.64.1),e2e/playwright.config.js, a zero-dependency static servere2e/serve.js(127.0.0.1 only, directory →index.html, unknown path →404.htmllike Pages), and specs ine2e/tests/. The root gets only the scripttest:e2e.npm testis stillnode --test, the root lockfile is unchanged, and*.spec.jsundere2e/is outside thenode --testdefault globs. The files of Copilot's #210 (test/coverage-pilot.test.js) and.github/workflowsare untouched.How to run:
Flows covered (24 tests × 2 viewports = 48):
control-params.js(OLED 40°, QLED 30°, LED 20°), CTA → engineering case, the "עוד" nav menu → API contract.dir=rtl,lang=he, an h1, and no sideways scroll. The 404 page is served for an unknown path.aria-pressed, "2 מתוך 6"), then back to all.deg=99→ HTTP 200, auto OFF, target and current angle clamp to 40.0° (OLED). WiFi cut →WiFi DOWN, firmware serial line, auto stays ON. Panel switch updatesaria-pressed.Determinism:
e2e/tests/fixtures.jsaborts every request that is not to127.0.0.1, and fails the test on any such request, page error, console error or 4xx/5xx response (except the browser's own/favicon.ico). Sentry stays inert because the DSN is the placeholder, so no CDN request is made. Assertions use roles, accessible names, ids and text, not CSS.Results (Windows, Node 24, Chromium from Playwright 1.64.1): unit tests 518/518 pass before and after. E2E 48/48 pass, three runs in a row (one with
CI=1). No E2E test exposed a bug in this repo.Decisions for Aviran:
scripts/smoke.js/npm run smoke(390px,file://) is left as is. It overlaps with the new 360px suite, which goes further. Removing it would also changetest/smoke-390.test.js, so I didn't..github/workflows/validate.yml, whichtest/pages.test.jsalso pins, so I left that to you.🤖 Generated with Claude Code