Repository navigation
feat(author): confine a build to folders, build with nothing written, the content as text - #221
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…rough the semantics, one tag stripper (#220) publicFetch checks addresses with net.BlockList, so [::ffff:127.0.0.1], which a URL writes as [::ffff:7f00:1], no longer reaches loopback; it keeps a Request's method, headers and redirect mode, and its redirect handling is tested through guardedFetch. The outline is every result's outline, read through the libraries' semantics: numbers kept, the right answers marked, interface texts and settings left out in any language. stripTags and decodeEntities live in text.mjs for the generator, the layouts, schema and the outline, which clears CodeQL alert #46. A file named ..notes.png is inside its folder. The README says what within and publicFetch cover.
There was a problem hiding this comment.
All reported issues were addressed across 12 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…entials, a lazy outline that shows structure (#220) A confined build judges a path before looking for the file and names no absolute path. publicFetch refuses the local IPv4 ranges behind NAT64's prefix and in 6to4, drops Authorization, Proxy-Authorization and Cookie on a redirect to another origin, and lets the signal stop a lookup. A check looks at no output. The outline is made when first read; finds score ranges by RangeList; keeps a text's breaks as ' / '; numbers slides, chapters, questions and a scenario's content; writes a scenario's links and scores and a video's times. Tests for each.
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Turn on auto-fix | Re-trigger cubic
…quest asks no resolver, the outline reads text by its tags (#220) publicFetch refuses TEST-NET-1 to 3 and 2001:db8::/32 too, and checks the signal before a lookup. The outline splits rich text at its tags and plain text at every line break, \r alone included, before it reads entities, so no text can pass for a break; labels are read as plain text. The README shows a confined build; the design note says what changes for a build run without the options, and that within is no guard against another process racing on the folders.
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
… NAT64 and 6to4 forms, a confined-build example that runs as written (#220) The README's example defines its folder and reads its source from it, and the text after it is a paragraph of its own.
…file a problem, tags as the content check reads them, an outline without settings (#220) - `within` must be a list: one folder given as a string was read letter by letter, `/` among them, and confined nothing. - A file the build cannot read is a problem of the source's, in a check too, naming no path. - `stripTags` and `tagsIn` split markup as the content check does (`PIECE`): an apostrophe in an unquoted attribute no longer runs a tag into the text after it, as the quote-aware reader did. - The outline leaves out what the editor does not draw and a text no label names (Game Map's positions, Find the Hotspot's figure, Virtual Tour's), takes a tag inside a word out whole, writes a label without a colon of its own, names a bookmark as one, and leaves out a question's title the build gave (`questionTitle`, shared with the layout). - `outlineOf(libraries, content)` takes its arguments as `checkContent` does and refuses other shapes; it cuts at a limit only where one is given, so a build's outline is whole. - `check` takes no output; the docs say what it still downloads. - `publicFetch` refuses the IPv4-translated, Teredo, benchmarking, documentation, discard-only and segment-routing ranges, and a name that does not resolve in the words a local one gets. - design/author.md counts its 32 things; design/layout.md names outline.mjs and the new tests.
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…d a hosted video stays an address (#220)
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
… asks, and a worker with no client posts to every window (#220)
Closes #220. Step 1 of #219's plan: what a local MCP server needs from the author package.
What it adds
within, abuildPackageoption: a list of the folders the output and every local file a source names must be inside, judged on real paths, so..and links out are refused. A path outside gets the same answer whether or not a file is there, a file that cannot be read is a problem of the source's, and a confined build's problems name no absolute path. One folder given as a string is refused, not read letter by letter.check, andh5p-author build --check <source>: builds and writes no package, with the same checks as a build, and takes no output (buildPackage(source, undefined, { check: true })). A media file named by web address is still downloaded, to a temporary folder removed after; a video on YouTube, Vimeo, Panopto or Echo360 stays an address, as in a build.publicFetch, used where it is passed asfetch: refuses every network that is not the public internet, on every redirect, throughnet.BlockList(IPv4 written as IPv6, NAT64 and 6to4 forms, the documentation ranges, and the IPv6 ranges no web host is on). A name that does not resolve is refused in the words a local one is, so a refusal names no local host. It dropsAuthorization,Proxy-AuthorizationandCookieon a redirect to another origin, asfetchdoes; the signal stops a DNS lookup, and an aborted request asks no resolver at all. It guards against a model's mistake or a planted address, not a hostile network: DNS rebinding is out of scope.outlineon every build result, andoutlineOf(libraries, content, { limit }), incheckContent's order: the content as plain lines for a review, read through the libraries' semantics. Authored text only, with interface texts and settings left out in any language (what the editor does not draw, and texts a type's own widget sets); right answers marked; score ranges; slides, chapters, questions and a scenario's content numbered, without the titles the build gave; a scenario's links and scores; a video's interaction and bookmark times. It is made only when read, and whole unless a limit is given.stripTagsanddecodeEntitiesintext.mjs, shared by the generator, the layouts,schemaand the outline; tags are read as the content check splits markup. The type files are unchanged (sync-skill --check: 0 out of date).Review rounds
[::ffff:127.0.0.1]reached loopback; CodeQL alert Vendor the H5P core from h5p-php-library and retire h5p-standalone #46; the first outline dropped numeric answers, hid True/False's answer and showed interface texts; a file named..notes.pngwas refused; the redirect guard was untested; the README wording.checkstill needed the output's folder; the outline ran inside every build; the score-range rule was a guess; a DNS lookup could not be stopped; the outline ran text together and showed no slides, links or times.\rwas not one; labels holding entities; the README's import; the design note's wording. Declined, with the reason in each thread: the two file-race P1s (a process that can write in the user's folders already acts as the user; recorded indesign/author.md) and decoding&in plain fields.withingiven as a string confined nothing; an unreadable file failed a build with its absolute path and passed a check; the quote-aware tag reader ran a link's tag into the text after it (a regression from main); the outline showed settings in four types (Game Map, Find the Hotspot, Find Multiple Hotspots, Virtual Tour), split words at inline tags, doubled a label's colon, wrote the build's own question titles and an unnamed bookmark, and stopped at 400 lines;outlineOftook its arguments in the opposite order tocheckContentand answered a wrong shape with nothing;checkneeded an output; the docs (the design note's count, the layout map, what a check downloads); IPv6 ranges; refusals that told which local names exist.AGENTS.md, namedframe-document.tsfor a relay that lives in the runtime'sframe-boot.ts; it now names the relay, the element's handler, and the broadcast to every controlled window when no client can answer.Also here, the owner's commit:
AGENTS.mdcut from 150 lines to a 97-line index, and the Service Worker's statelessness rule, which lived only there, moved todesign/serving.md.Tests
Author 216/216 with the browser test, apps/skills author-verify and author-playback 73/73, both typechecks clean. New tests in
tests/confine.test.tsandtests/text.test.ts, at least one per fix. Every type file's example outlined before and after the last round: only the intended lines changed.Not here: moving the types table out of
SKILL.md(the server reads it where it is), andread(step 3). The version bump to 0.11.0 is the owner's.