Skip to content

LukeHolmes/CSASim

Repository files navigation

CSASim · DeltaV Interactive Primer

Project Status (2026-05-31): Complete / Maintenance mode. Core scope is complete and stable. Future changes are limited to bug fixes, compatibility updates, and minor content maintenance. Static, client-side learning app for Emerson DeltaV-style biopharma control concepts: architecture, S88, PID / bioreactor sandboxes, HMI and alarms, validation (CSV, V-Model, CSA), advanced labs, knowledge check, and a Validation Digital Twin capstone. Source lives under src/.

This repository is educational and not affiliated with Emerson.

Run from source

Serve the repo root over HTTP and open src/index.html (some browsers restrict file:// for iframes).

Example:

npx --yes serve .

Then open the served URL for src/index.html.

Assets are loaded relative to src/:

  • ./styles/app.css
  • ./scripts/shared/scoring.js then ./scripts/app.js
  • Module 20 iframe: ./modules/validation-twin.html

Portable standalone

Build a standalone primer plus the Validation Digital Twin iframe sibling so ./modules/validation-twin.html resolves:

node tools/build-standalone.mjs

PowerShell (same output layout):

./tools/build-single-html.ps1

Defaults write exports/DeltaVPrimer_Standalone.html and copy src/modules/* to exports/modules/. Distribute the exports/ folder (or a zip), not only the HTML file.

Phase 3B: builders embed the twin as a data: URL so one HTML file can be shared alone (--no-embed-twin / -NoEmbedTwin to skip). Phase 4: the twin reports document height to the parent for iframe sizing; CSS uses a smaller fixed fallback until the first message.

Details: notes/PHASE-3-PORTABLE-STANDALONE.md.

Tooling

The app itself has no runtime package dependencies. Node tooling is used for build validation and Playwright smoke tests.

npm ci
npm test
Script Role
npm run build Rebuild the canonical standalone export
npm run test:validate Validate the standalone export structure and inline scripts
npm run test:e2e Run Playwright smoke tests
tools/build-standalone.mjs Node: inline CSS/JS; copy src/modules; embed twin unless --no-embed-twin
tools/build-single-html.ps1 PowerShell: same; -NoEmbedTwin skips embed
tools/split-single-html.ps1 Split a monolithic HTML back into src/
tools/validate-html.ps1 Quick structural checks on standalone output
tools/github/ Optional GitHub setup/sync helpers

Project layout

Path Role
src/ Editable app source
exports/ Canonical portable build output
notes/ Current docs, QA checklists, and historical refactor notes
tools/ Build, validation, split, and GitHub helper scripts
archive/baselines/ Historical full-HTML snapshots
archive/investigation-snapshot/ Pre-investigation source snapshots
archive/scratch/ Retained scratch artifacts

Documentation

Document Purpose
notes/PRODUCT-STATUS.md What is implemented today vs historical plans
notes/PHASED-IMPLEMENTATION-PLAN.md Ordered roadmap for remaining completion work
notes/APP-MODULE-SPLIT-PLAN.md Safe plan for gradually splitting src/scripts/app.js
notes/qa-checklist.md Manual regression checklist
notes/QA-REPORT-2026-05-29.md Latest post-merge QA pass
notes/refactor-log.md Session-by-session change log
notes/REFACTOR_PLAN.md Original refactor narrative (partially superseded by product status)

Architecture (do not break casually)

  • APP_MODULES in src/scripts/app.js is the module registry (navigation, progress counts, mastery).
  • Tabs use data-mod="{id}" matching section.module#mod-{id} and journey items .journey-item[data-mod="{id}"].
  • On load, warnIfModuleRegistryDriftFromDom() logs warnings if the registry and DOM disagree (Phase 0 guardrail).

Licence / use

Built for biopharma learning. See footer in src/index.html for disclaimer text.

About

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors