Repository navigation
feat: play every content type in the library pack (pnpm sweep) - #21
Merged
Merged
Conversation
The sweep generates content for each runnable library in the pack from its own semantics, lays in what apps/demo/sweep/<machineName>.json says (a right answer, a drop zone, the steps through it, the finished expected), plays it as a content-only export untrusted and trusted, and reports every statement and finished. 110 plays, about three minutes; CI runs it on changes to the player, the runtime, the pack or the sweep, weekly, and in the pack refresh before its pull request. All 55 boot in both modes. 32 end with a result of their own, 19 send none, 4 need a microphone or camera. Interactive Book and Game Map create their parts without a parent, so a part's result arrives as the content's; documented for hosts and cmi5. Refs #20 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The first cut worked each type through with hand-written steps on the libraries' own selectors and timing, and failed a play whose last finished was not the one its file named. Game Map's finish passed four runs locally and failed both modes on the first CI run. The steps and the finished gate go: ten files stay, with content and attributes only, and what a type sends after ready is reported, not judged. Refs #20 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch was successfully deployed
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.
Closes #20.
pnpm sweepplays every runnable library in the library pack as a content-only export, untrusted and trusted, and fails when one doesn't reachreadyor throws while booting. There are 55 libraries: the hub's 53 content types, plus two the pack carries as options of others. That makes 110 plays, which take about three minutes locally and five on CI.Results
All 110 plays boot. The report also lists what each content type sent when the generic walk pressed its buttons; that part is information, not a check (see below).
Measured once, with the first cut of this PR, which worked each type through with hand-written steps:
answeredcompletedFor Interactive Book, Course Presentation and Interactive Video, which #16 never played, the parts' statements carry a parent and the content's own
completedis the result.Two content types report a part's result as their own
{ parent: self }. In that scopeselfis the globalwindow, not the book, so every chapter'scompletedhas no parent. The book's owncompletedcomes only when its report is submitted, and the submit button appears only withreporting. Withoutreporting, a book's lastfinishedis its last chapter's.answeredwith no parent. The map's owncompletedcomes when the learner finishes the map.H5P's core uses the same rule for
setFinished, so both behave this way on any H5P site. It matters for hosts: one that takes the lastfinishedgets the content's result (for a book, withreporting); cmi5 records the first, so a unit with either completes on its first part. Both are now in the README's event table anddocs/cmi5.md.What was cut, and why
The first cut had a step file per content type (
click,drag,fill, timed pauses — 13 files on the libraries' own CSS selectors) and failed a play whose lastfinishedwasn't the one its file named. Game Map's seven-click finish passed four runs locally and failed both modes on the first CI run, on the slower runner. So the steps and thefinishedgate went, the same day:ready, or an error while booting.How it works
Generator (
apps/demo/scripts/lib/sweep-content.mjs): content from the content type's ownsemantics.json, the way H5P's editor saves a form — every default, the smallest valid value for a required field without one, an untouched optional group with its defaults only, a library field from the first option the pack has.tests/sweep-content.test.tsholds the rules, 12 tests.Files (
apps/demo/sweep/<machineName>.json):params, walked with the semantics so everything left out is filled in;attributesfor the element (reporting).pnpm sweep --semantics <machineName>prints a content type's fields for writing one.Script (
apps/demo/scripts/sweep-content-types.mjs): plays each package as a picked file against the local pack in the runner's Chrome (Playwright's Chromium can't decode Interactive Video's H.264 clip); writesreport.md,report.json, the packages and screenshots.CI:
.github/workflows/content-types.yml: on PRs touching the player's source, the runtime, the pack or the sweep, and every Monday; the report is the run's summary, the packages and screenshots an artifact.libraries.yml) sweeps the new pack and puts the report in the PR it opens, since CI doesn't start on a PR a workflow opened.Docs: AGENTS.md (The content-type sweep, the measurements under the
finishedinvariant, layout and commands),docs/development.md, README,docs/cmi5.md. The demo'stsconfig.jsongainsallowJsso its tests can import the generator, as the player's test config does.Testing
pnpm sweep, cut down, locallypnpm sweep, first cut, locally, three runspnpm sweep, first cut, on CItests/sweep-content.test.tspnpm typecheckThe CI sweep on this PR's latest commit is the check for the cut-down version on GitHub.
Not verified
Release
None. Nothing published changes except two documentation lines in the README.
🤖 Generated with Claude Code