Skip to content

CI + gated deploy, engine perf fixes, and normalizeState tests - #2

Merged
ryan-war merged 3 commits into
masterfrom
salvage-ci-perf
Jul 25, 2026
Merged

CI + gated deploy, engine perf fixes, and normalizeState tests#2
ryan-war merged 3 commits into
masterfrom
salvage-ci-perf

Conversation

@ryan-war

Copy link
Copy Markdown
Owner

Rebased cleanly onto the current master after 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 kept linkedMainNode).

What's here

Delivery safety net

  • package.json (no deps): npm test (node --test) and npm start.
  • .github/workflows/ci.yml: runs the suite on every push/PR; deploys to Pages only when master is green.
  • CONTRIBUTING.md.
  • ⚠️ Needs the repo's Pages source switched to GitHub Actions for the gated deploy to take over from the current branch deploy.

Engine perf (behaviour-preserving)

  • buildVisData was O(tasks²) (findNode per node) → O(tasks) via a lookup map.
  • resourceLoad memoised per render (was up to 3× per render).
  • computeCPM resolves each task's duration once instead of 3×.

Tests

  • 11 normalizeState regression tests (id de-dup, dangling cleanup, legacy migration, clamping, schema stamping, negative-deadline handling).

158 tests green on the new master baseline.

ryan-war added 3 commits July 25, 2026 18:06
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.
@ryan-war
ryan-war merged commit 845dace into master Jul 25, 2026
2 checks passed
@ryan-war
ryan-war deleted the salvage-ci-perf branch July 25, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant