Skip to content

Copy the type file of a type named as a chat with no skill text names it - #14

Merged
alekswebnet merged 1 commit into
mainfrom
feat/build-type-named-loosely
Nov 10, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
feat/build-type-named-loosely

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #13.

Copy the problems for the chat carried the type file of the source's type as written. A chat with no skill text writes the type as it is spoken of, "interactive-book", or under contentType, as Gemini in Chrome did from a link to the skill, and its first copy had no type file. Now the page asks h5p-author for the source's type, sourceType (new in 0.8.0, h5p-offline-player#176): its type as written or as it is spoken of, or with none the one under contentType or library, as the build reads it. Below it, a library counts by its listed machine name under any key, so a slide's element { "type": "text" } is no H5P.Text.

The page asks the build it ships instead of keeping a copy of its rule: sourceType was exported from h5p-author for this.

Measured

In h5p-offline-player#174 on the weakest Claude model, Haiku 5.5, with no skill text: the request as Gemini was given it, six content types, two runs each, this page's copy pasted back.

By round 2 By round 3 By round 4 Never
h5p-author 0.7.0, this page's rule before 3 of 12 6 8 4
h5p-author 0.7.1, the type as the build reads it 10 of 12 12 0

What changes

  • src/h5p/build/build-source.ts: typesNamed(source, listed) takes the source's own type from sourceType, then every listed machine name below it, alone or with a major and minor, under any key.
  • src/h5p/build/build-page.ts: typeFilesOf fetches index.json first, since a name is read against that list.
  • package.json: h5p-author 0.8.0. The player stays at 1.6.0, the version 0.8.0 names.
  • README.md: The type files says how the type is found, and what the second test measured.

Tested

  • pnpm e2e: 12 pass, one of them new: a book as Haiku wrote one (the content's fields beside "type": "interactive-book") and one as Gemini did (contentType, metadata) each copy the book's type file and those of the libraries they name; a type named under a key the build does not read, and a slide element's "type": "text", copy none. Three mutations of typesNamed (the type as written, names read loosely below it, nothing read below it) each fail it.
  • The 14 rounds that failed in the no-skill test were built again on this page, and each copied byte for byte what the model had been given.
  • The 39 sources the type-file test replayed before: 36 copy byte for byte as measured. The other three carry the same type files and differ in their problems only, which read better since h5p-author 0.7.0 (a Game Map) and 0.7.1 (two books whose chapters had a title beside them, 13 problems now 7).
  • pnpm install --frozen-lockfile, tsc and pnpm build pass; /h5p/build/types/index.json says author 0.8.0.

Summary by cubic

Fixes the copy for the chat carrying no type file when a source names its type as a chat without skill text writes it — as spoken ("interactive-book") or under contentType or library — rather than as the type field writes it. The copy now carries the type file of the type the build reads the source as.

  • The source's own type comes from h5p-author 0.8.0's sourceType, and the copy fetches index.json first so names are read against the actual list.
  • The 14 previously failing no-skill rounds now copy byte for byte; 3 of 39 replayed sources carry the same type files and their problems read better since 0.7.0/0.7.1.

Written for commit 8b4ea54. Summary will update on new commits.

View guided diff Turn on auto-fix

The copy for the chat carried the type file of the source's `type` as written, so a type named
"interactive-book", or under `contentType`, as a chat with no skill text writes it, had none. The
page now asks h5p-author 0.8.0 for the source's own type, `sourceType`, the build's reading of it,
and below it takes every listed machine name, under any key. A name is read against the list of
type files, so `index.json` is fetched first.

The 14 rounds that failed in h5p-offline-player#174's test, with no skill text, were built again
on this page, and each copied what the model had been given. Of the 39 sources the type-file test
replayed before, 36 copy as they did; the other three carry the same type files, and their
problems read better since h5p-author 0.7.0 and 0.7.1.

Closes #13.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​missing-elements/​h5p-author@​0.7.0 ⏵ 0.8.080100100 +193 +1100

View full report

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@alekswebnet
alekswebnet merged commit 5485479 into main Nov 10, 2026
4 checks passed
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.

Copy the type file of a type named as a chat with no skill text names it

1 participant