Skip to content

Redesign elpx-validator: modular architecture, deep validation, asset explorer, iDevice registry, navigable UI#4

Merged
erseco merged 6 commits intomainfrom
copilot/improve-elpx-validator
Apr 6, 2026
Merged

Redesign elpx-validator: modular architecture, deep validation, asset explorer, iDevice registry, navigable UI#4
erseco merged 6 commits intomainfrom
copilot/improve-elpx-validator

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

Summary

Major redesign of the elpx-validator from a simple linear checklist into a comprehensive .elpx / .elp package inspector, validator, asset explorer, and preview tool, aligned with the ELPX format specification.

All processing remains fully client-side in the browser. No server dependencies. Existing functionality is preserved.


What changed

Architecture refactoring

The monolithic validator.js has been refactored into a modular architecture with 10 modules:

Module Purpose
js/core/rules.js Rule catalog with 50+ rule definitions and finding factory
js/core/model.js Normalized project model builder from content.xml
js/registries/idevice-types.js Registry of 18 known iDevice types
js/validators/package-rules.js ZIP/package structure validation
js/validators/xml-rules.js XML schema validation
js/validators/nav-rules.js Navigation/ID/reference validation
js/validators/idevice-rules.js iDevice type validation
js/validators/asset-rules.js Asset inventory and validation
js/preview/virtual-fs.js Blob URL virtual filesystem for preview
js/validator.js Main orchestrator (new + legacy API)

New validation layers

Package layer (PKG):* Required files, recommended dirs, path traversal, suspicious filenames, duplicate paths

XML/Schema layer (XML):* Namespace http://www.intef.es/xsd/ode, version attribute, DOCTYPE check, child element ordering, unknown root children

Navigation layer (NAV):* Page/block/component ID uniqueness, dangling parent references, cycle detection, sibling ordering, component containment mismatch

Metadata layer (META):* odeId/odeVersionId format validation (14-digit timestamp + 6 uppercase alphanumeric), eXeVersion presence, project title

iDevice layer (IDEV):* Registry of 18 known types from the ELPX spec, jsonProperties parseability, type-specific checks (image references, URLs, download flags)

Asset layer (ASSET):* Full inventory, reference extraction from htmlView/jsonProperties/exported HTML, {{context_path}} normalization, orphan/missing detection, casing mismatches

UI redesign

From a flat checklist to a tabbed navigable inspector:

  • Overview — Legacy checklist preserved with package metadata
  • Findings — All findings with severity/category filtering
  • Pages — Hierarchical page tree with blocks and components
  • iDevices — Type summary with known/unknown classification
  • Assets — Full inventory table with filtering (all/referenced/orphaned/missing)
  • Preview — Sandboxed iframe with Blob URL asset resolution

Summary banner shows format badge (Modern ELPX / Legacy ELP) and error/warning/info counts.

Testing

  • 102 tests across 9 test suites (87 new + 15 original preserved)
  • Tests cover: rules, model, iDevice registry, package/xml/nav/idevice/asset validators, legacy API backward compatibility

Documentation

  • Complete README rewrite with validation scope, rule catalog, architecture, known iDevice types, known limitations

Validation rule catalog

Code Range Category Count
PKG001PKG014 Package 14
XML001XML008 XML/Schema 8
NAV001NAV022 Navigation 22
META001META006 Metadata 6
IDEV001IDEV006 iDevice 6
ASSET001ASSET005 Asset 5
COMPAT001COMPAT002 Compatibility 2

Known limitations

  • DTD validation: Not feasible client-side; checks for DOCTYPE declaration and content.dtd presence
  • Legacy .elp: Limited to metadata extraction
  • iDevice depth: 5 types have deep validation, 13 have shallow validation
  • Preview: Blob URLs may not perfectly replicate server behavior
  • XML vs HTML cross-check: Reference-based only (full structural comparison is future work)

Copilot AI and others added 4 commits April 6, 2026 20:19
…, nav/asset/xml validators

- Create js/core/rules.js with 50+ validation rule definitions and finding factory
- Create js/core/model.js with normalized project model builder
- Create js/validators/package-rules.js for ZIP structure validation
- Create js/validators/xml-rules.js for XML schema validation (namespace, version, DOCTYPE, child ordering)
- Create js/validators/nav-rules.js for ID uniqueness, cross-references, cycle detection, ordering
- Create js/validators/idevice-rules.js with type validation against known registry
- Create js/validators/asset-rules.js with full asset inventory, reference extraction, orphan detection
- Create js/registries/idevice-types.js with 18 known iDevice types from ELPX spec
- Refactor js/validator.js to orchestrate all modules with runFullValidation() API
- Preserve all legacy API functions for backward compatibility
- All 15 existing tests still pass

Agent-Logs-Url: https://github.com/ateeducacion/elpx-validator/sessions/6e7022bc-c0e4-4e25-8c6d-1b80e78abc88

Co-authored-by: erseco <1876752+erseco@users.noreply.github.com>
…e summary, asset explorer, preview

- Add summary banner with format badge and error/warning/info counts
- Add tabbed navigation: Overview, Findings, Pages, iDevices, Assets, Preview
- Add findings panel with severity/category filtering and structured finding cards
- Add page tree with hierarchical navigation, blocks, and components
- Add iDevice summary panel with type breakdown and known/unknown status
- Add asset explorer with inventory table, filtering (all/referenced/orphaned/missing)
- Add preview panel with sandboxed iframe and Blob URL virtual filesystem
- Create js/preview/virtual-fs.js for asset preview via Blob URLs
- Update index.html with all new UI panels and script tags for modules
- Update styles.css with complete styling for all new components
- Preserve legacy checklist in Overview tab for backward compatibility
- All 15 existing tests still pass

Agent-Logs-Url: https://github.com/ateeducacion/elpx-validator/sessions/6e7022bc-c0e4-4e25-8c6d-1b80e78abc88

Co-authored-by: erseco <1876752+erseco@users.noreply.github.com>
…tion

Tests:
- tests/rules.test.js: Rule catalog, finding factory, frozen objects
- tests/model.test.js: Project model builder from content.xml
- tests/idevice-registry.test.js: Known type registry, lookup, case-insensitivity
- tests/package-rules.test.js: Package validation, path traversal, suspicious files
- tests/xml-rules.test.js: XML schema validation, namespace, DOCTYPE, ordering
- tests/nav-rules.test.js: ID uniqueness, cycles, cross-references, containment
- tests/idevice-rules.test.js: Type recognition, JSON parsing, type-specific checks
- tests/asset-rules.test.js: Inventory, references, orphans, missing, casing

README:
- Complete validation scope documentation
- Rule catalog reference table
- Architecture diagram with all modules
- Known iDevice types table
- Known limitations section
- Development workflow (102 tests passing)

Agent-Logs-Url: https://github.com/ateeducacion/elpx-validator/sessions/6e7022bc-c0e4-4e25-8c6d-1b80e78abc88

Co-authored-by: erseco <1876752+erseco@users.noreply.github.com>
…o, README example consistency

- Fix XSS vulnerability: use textContent instead of innerHTML in setChecklistStatus
- Add null/undefined check in escapeHtml helper function
- Fix iDevice label: 'Quick Questions (Multiple)' → 'Quick Questions (Multiple Choice)'
- Fix README example: use correct rule code IDEV001 (info) instead of IDEV003 (error)

Agent-Logs-Url: https://github.com/ateeducacion/elpx-validator/sessions/6e7022bc-c0e4-4e25-8c6d-1b80e78abc88

Co-authored-by: erseco <1876752+erseco@users.noreply.github.com>
erseco and others added 2 commits April 6, 2026 21:37
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@erseco erseco marked this pull request as ready for review April 6, 2026 20:38
@erseco erseco merged commit 1182d4d into main Apr 6, 2026
3 checks passed
@erseco erseco deleted the copilot/improve-elpx-validator branch April 6, 2026 20:47
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.

2 participants