CI + gated deploy, engine perf fixes, and normalizeState tests - #2
Merged
Conversation
Node's built-in test runner covers the engine (133 tests) but only ran by hand, and the site deploys straight from master root — so a red commit shipped live before any test saw it. - package.json: npm test (node --test, auto-discovers test/*.test.js) and npm start (npx serve). No dependencies. - .github/workflows/ci.yml: run the suite on every push and PR, and deploy to Pages only when master is green. Deploy is gated on the test job. - CONTRIBUTING.md: how to run it, the pure/DOM-free boundary, and the baseline-lock contract. The deploy job goes live once the repo's Pages source is switched from 'Deploy from a branch' to 'GitHub Actions'.
Behaviour-preserving perf tidies, salvaged from the parallel UX branch after master diverged: - buildVisData called findNode() per task (a full milestone rescan each), making canvas rebuilds O(tasks²); build a milestone-title map once → O(tasks). - resourceLoad ran up to 3x per render (Resources + Health + levelling) off the same nodes/metrics; memoise it per render in schedule.js. - computeCPM resolved each task's duration 3x to seed duration/remaining/span; resolve once. 158 tests green (baseline lock included).
Locks the repairs the README promises — duplicate-id de-dup, dangling dependency/link cleanup, legacy bare-array dependency migration, estimate clamping, schema stamping with provenance stripped, and negative deadline/ data-date reading as none. Schema assertion references SCHEMA_VERSION rather than a literal so a schema bump does not break it.
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.
Rebased cleanly onto the current
masterafter it gained the analysis-overlay / task-table / RAG work. This is the non-conflicting subset of the earlier UX branch — the parts that still apply and add value on top of the new master. The toolbar-grouping, tabbed-panel, and linkedMainNode-removal changes were dropped because master reworked those areas differently (and deliberately keptlinkedMainNode).What's here
Delivery safety net
package.json(no deps):npm test(node --test) andnpm start..github/workflows/ci.yml: runs the suite on every push/PR; deploys to Pages only when master is green.CONTRIBUTING.md.Engine perf (behaviour-preserving)
buildVisDatawas O(tasks²) (findNodeper node) → O(tasks) via a lookup map.resourceLoadmemoised per render (was up to 3× per render).computeCPMresolves each task's duration once instead of 3×.Tests
normalizeStateregression tests (id de-dup, dangling cleanup, legacy migration, clamping, schema stamping, negative-deadline handling).158 tests green on the new master baseline.