Repository navigation
fix(author): a source's own fields no longer hide its content, for a chat with no skill text - #175
Conversation
…chat with no skill text (#174) A chat given a link to the skill and none of its text writes a source's outer shape its own way. The build checked a source's own fields, then the type's name, then the content, and stopped at each, so every layer cost a round in which nothing inside was looked at. A build now reads a source with the pack's names and takes what can only be meant, each said once with what to write, and checks the content in the same build wherever the type is known: - the content type under another key, `contentType`, or named loosely as `type`, "interactive-book", "Question Set": the one library of those letters (names.mjs). A name that is none has the nearest offered; - the title, language, licence and authors in an object, as H5P keeps them in `metadata`; - the content's fields beside `type`, with no `params` around them. Sub-content that names its library under another key, with its parameters in `params` or beside the name, is taken the same way, in a library field and in the place of the group that holds one. A title beside the parameters that is no field of the library is the sub-content's own. Measured on Haiku 5.5 with no skill text, six content types, two runs each, the build page's copy pasted back: 0.7.0 had 3 of 12 right by the second round and 8 by the fourth, four never; with this, 10 by the second round and all 12 by the third. Of 263 sources the earlier tests stored, 257 have the same problems and none builds with one build and not the other; the 36 sources of the type files and the quiz format build the same package.
…257 (#174) Counted again with the nearest names as they are now, those the letters end with and not those they begin with: the two sources that named H5P.ImageChoice have the problem they had, with no H5P.Image offered. The four that differ are the books whose chapters had a title beside them. The count in the commit before this one, 257, was of the rule before.
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
…eeps what is written with it (#174) From the review of #175, cubic's eleven findings and CodeQL's alert: - A name under `type` or `contentType` written loosely, "advancedtext", was taken by the generator but not loaded, so in a field that takes several libraries what was written for it was checked against no fields ("is not a field here; the fields are" and none). The loader now loads what the generator takes: a name under those keys, as it is or loosely. - Only those keys name sub-content's library, and `contentType` or `library` a source's own type. Under any key, a title "Text", a card's answer "table" or a text that is a library's name was taken for one; in the 328 sources the tests stored, every name found under another key was such a text. - A version written with the name is kept where the field takes that major, "H5P.Child 2.0", and not the field's first. - A title beside sub-content in its group's place, with its parameters beside the name, in `params` or with `library`, is its `metadata.title`, not a parameter or a field of the group. - Only `metadata` holds a source's own fields: Question Set's `introPage` has a title too, and was taken for them in a source with none at the top. - "Question Set 2" is no Question Set: a number with no point is no version. A version of three parts is read loosely, since what reads a library's name takes two. - Names are read without a regular expression that backtracks (CodeQL js/polynomial-redos), and a text longer than 64 characters is no name. - The design note says what reading titles would cost, every part, instead of that a page cannot. The 263 stored sources have the same problems as with the commit before, the 36 sources of the type files and the quiz format build the same package as 0.7.0, every entry, note and translation report, and the 14 failed rounds of the no-skill test give the problems the model was given.
There was a problem hiding this comment.
1 issue found across 10 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/author/README.md">
<violation number="1" location="packages/author/README.md:102">
P3: `library` is also accepted for the source type, and `metadata.language` is moved to the source's language field. Include both in this summary so users know the supported source shape.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
|
||
| A source's own fields are read the same way, for a chat that wrote one with no skill beside it. | ||
| What its outer shape plainly means is taken and said once, and the content is checked in the same | ||
| round: the content type under `contentType` or named as it is spoken of (`"interactive-book"`, |
There was a problem hiding this comment.
P3: library is also accepted for the source type, and metadata.language is moved to the source's language field. Include both in this summary so users know the supported source shape.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/author/README.md, line 102:
<comment>`library` is also accepted for the source type, and `metadata.language` is moved to the source's language field. Include both in this summary so users know the supported source shape.</comment>
<file context>
@@ -99,8 +99,8 @@ h5p-author: The source has 3 problems:
What its outer shape plainly means is taken and said once, and the content is checked in the same
-round: the content type under another key or named as it is spoken of (`"interactive-book"`,
-`"Question Set"`), the title, licence and authors in an object, the content's fields beside `type`.
+round: the content type under `contentType` or named as it is spoken of (`"interactive-book"`,
+`"Question Set"`), the title, licence and authors in `metadata`, the content's fields beside `type`.
</file context>
…ce's outer shape may hold (#174) As the build reads it: the content type under `contentType` or `library`, and the title, language, licence and authors in `metadata`.
Closes #174.
A chat given a link to the skill and none of its text writes a source's outer shape its own way. The build checked a source's own fields, then the type's name, then the content, and stopped at each, so every layer cost a round in which nothing inside was looked at. Now what the outer shape plainly means is taken, said once with what to write, and the content is checked in the same build.
Measured
The weakest Claude model, Haiku 5.5, as Gemini in Chrome was: the request as worded ("create interactive book using <a link to the skill's folder>. topic - …"), no skill text, each reply built, what the build page copies pasted back, up to four rounds. Six content types, two runs each, both rows from the same 12 first replies. Right means it builds, holds what was asked for, and plays (h5p-verify).
Both books and both sets of cards gave up under 0.7.0, on the type's name. The second row needs the build page's part too, a follow-up in missing-elements.github.io once this is released: its rule for the type files is the source's
typeas written, which finds no file forinteractive-book.Gemini's own first source, which was seven problems of the outer shape and then thirty of the content, is now seven in all:
What changes
A source read for a build (
lib/build.mjs,sourceOf). With the pack's names, it takes:contentTypeorlibrary, or named loosely astype:interactive-book,Question Set,dialogcards. A name that is no type has the nearest offered:the library pack has no content type book; nearest: H5P.InteractiveBook;metadata, as H5P keeps them, and in no other object: Question Set'sintroPagehas a title too;type, with noparamsaround them.Each is a problem, so a source that was refused is refused still. The content is then generated and checked in the same build, with a stand-in for what is missing.
readSourcekeeps its contract: a source's own problems, thrown, without the pack's names.Names (
lib/names.mjs, new). A library written loosely is the one library of the same letters and digits, in any case, with or withoutH5P.and a version; a number with no point is no version, so "Question Set 2" is no Question Set. Titles are not tried, "Multiple Choice" or "Image Choice": the pack's index has none, and reading them means fetching every part, 147 of them and some 15 MB, to name one type. Names are read without a regular expression that backtracks, and a text over 64 characters is no name.Sub-content that names its library under
typeorcontentType(lib/generator.mjs,lib/libraries.mjs).{ "contentType": "H5P.AdvancedText", "params": { … } }and{ "type": "H5P.MultiChoice", "question": … }, in a library field and in the place of the group that holds one: one problem that shows what to write, and what is inside checked, named by where the source has it. Only where one of the two names a library the field takes, at the major written where the field takes it; the loader loads that library, as it is named or loosely, so what is inside is checked against its fields. No other key: in the 328 sources the tests stored, every name found under another one was a text that reads like one, a card's answer "table", a title "Text". A title beside the parameters that is no field of the library is the sub-content's own, in a library field's place or in its group's, which had been two problems a chapter.librarywritten loosely is taken too.Tested
pnpm --filter @missing-elements/h5p-author test: 178 pass, the page's build in Chromium among them. New tests for each shape, for what is not guessed (two keys that name a type or a library, a name under another key, saved content), and for the names. Each of twelve mutations of the new code fails a test, and so does undoing any of the ten fixes from the review.pnpm --filter @missing-elements/h5p-skills test: 77 pass, so every type file's example still builds and plays. The author'stypecheckpasses.To release
h5p-author 0.7.1: no new export, and no source that built is refused or builds otherwise. Then the build page's pull request, which moves its pin and hands the type's file back for a type named loosely or under another key.