Skip to content

feat: add interactive PHP tutorials for every bundled runtime - #436

Merged
glassmonkey merged 18 commits into
masterfrom
feat/versioned-tutorial
Oct 30, 2026
Merged

glassmonkey merged 18 commits into
masterfrom
feat/versioned-tutorial

Conversation

@glassmonkey

@glassmonkey glassmonkey commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Adds an interactive beginner tutorial inside PHP Playground. Readers edit an Example or select an Experiment, predict its result, then explicitly Run it in the selected PHP WASM runtime. The course covers all bundled runtimes, with compatible code and explanations for older versions and feature-gated lessons for enums and property hooks.

  • Preserve versioned canonical URLs; tutorial/latest entry points redirect to the explicitly configured default. Generate route HTML, sitemap, robots, article metadata and 1200×630 PNG share images in the existing Vite build. Share images use each lesson's title and Example code with bundled licensed fonts.
  • Share Playground theme controls, colors and Chakra controls. Keep Example and Experiment as siblings, preserve variant drafts and use one result panel. Add tutorial links in the header and About section.
  • Keep structured sections/blocks and shared programs. Add author/reviewer learning notes for Example reasoning, Experiment goal references/change/observation/reason, misconceptions, and prerequisite lessons. Select version-specific notes after code adaptation; do not expose answers in the learner UI.
  • Define chapter boundaries, assumptions and subsequent learning in the code catalog. Validate prerequisite order and structural references. Correct the Loops goal, explain early var_dump/array-index usage locally, and require Classes before Errors.
  • Keep source, harness and fixtures under src/tutorial; integrate tests into existing e2e and Vite/Playwright configuration. No separate build root or validation Vite server.
  • Separate lesson authoring, curriculum design, PHP versioning and read-only review into four project skills. Keep shared contracts and conditional task references in .agents/tutorial, directly reachable from each entry. Read current version/lesson/latest data from code rather than duplicating current lists in documentation.

Astra review follow-ups also preserve the authoring HTML entry during SEO transformation, report PHP stderr/exit failures, and correct Enums/version-authoring explanations. The reviewer remained read-only during the learning-data changes and returned feedback for the parent to implement; final read found no remaining concrete findings.

Based directly on master; independent of #405. Existing app dependencies and WASM assets are preserved except the added build-only PNG renderer and licensed fonts.

Validation

  • Frozen local Chromium tutorial UI/WASM suite: 143/143 passed, workers 2, retries 0. All bundled runtimes execute registered solutions, Examples, Experiments, selected independent wrong answers, and failure/recovery paths.
  • Frozen unit suite: 190/190 passed; types, lint and diff checks passed. Test-owned exact-key version contracts specify full inventories and metadata for every runtime. Complete Program/learning DTO contracts cover the conditional and division variants, with explicit introduction-boundary cases.
  • Independent wrong-answer expectations include literal inputs, IDs, labels, statuses and messages; complete AssessmentResponse values include the submitted correlation ID. Always-pass checker controls demonstrate detection. Parse diagnostics have a documented engine-wording exception. The code-mode exit probe checks the bundled WASM host flag, not a universal PHP CLI exit-code contract.
  • Normal npm run build now performs lightweight post-build checks: 188 canonical pages, 187 image references, compiled JS/CSS and 18 configured-latest aliases. No build.test.ts, separate build root or validation server. The build itself needs no browser.
  • PNG contracts use independent Chromium decoding. HTTP tests compare complete decoded pixels against 24 reviewed, fixed index/Variables image baselines across all runtimes; expected images are not regenerated by tests. Long/special-character layout was inspected separately on an 8.5 sample. No all-article/arbitrary-input visual guarantee is claimed. Unit CI installs Chromium from the existing Playwright dependency; no new decoder dependency.
  • Astra remained read-only for the implementation follow-ups, reviewed the complete payload/fixture changes and visual evidence, inspected the final logs and per-version matrix, and closed T1–T8. Local Chromium evidence is separate from subsequent Linux/Firefox/WebKit CI results.
  • Four explicitly invoked skill smoke tasks passed on isolated Japanese 6af4618 snapshots (draft authoring, curriculum design, compatibility drafting, and review with 3/3 seeded defects). The English instructions were separately reviewed for preserved meaning and 57 local links. These tasks did not execute WASM/build/fixture recording and do not establish English behavior, automatic routing, repeatability or generation-performance improvement.
  • Earlier source/reference review checked 29 URLs/topics and font licensing. No full-book comparison, legal assurance or general semantic proof is claimed. Representative desktop/mobile light/dark UI was inspected; no uploaded screenshot attachment is claimed.

Local preview: http://127.0.0.1:18902/tutorial/ (development machine only).

@glassmonkey
glassmonkey force-pushed the feat/versioned-tutorial branch from 307f3cf to 75f67e7 Compare October 28, 2026 14:20
@glassmonkey
glassmonkey changed the base branch from feat/emsdk-latest to master October 28, 2026 14:21
@glassmonkey
glassmonkey merged commit 854a9c6 into master Oct 30, 2026
3 checks passed
@glassmonkey
glassmonkey deleted the feat/versioned-tutorial branch October 30, 2026 06:22
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