Repository navigation
test: gate redirect pages on what a browser decodes from make-redirects.sh output - #133
Merged
Merged
Conversation
…ts.sh output make-redirects.sh interpolates each MAP url and label into the refresh url=, canonical href, <a href>, <title> and link text unescaped. check-redirects.sh proves the page matches the generator and check-links.sh curls the raw text, so a url ending in a legacy no-semicolon entity (¶, ®, ©, ...) or a label with a quote or angle bracket regenerates cleanly and ships a broken redirect. Add scripts/redirect-targets.test.mjs: parse the MAP, reject uninterpolatable url/label characters, decode every committed redirect page's attributes under HTML attribute rules and its title/link text under text rules, require each to resolve to the MAP entry, and report any other ambiguous ampersand. Fixture self-tests for each rule; README Checks entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Test Improvement
Adds
scripts/redirect-targets.test.mjs, a static gate over what a browser actually makes of the shortcut-redirect pages thatmake-redirects.shemits with theMAPurl and label interpolated unescaped:MAPblock parses; every entry has an absolute whitespace-freehttps?://url and a label, and neither carries",<or>(the template cannot escape them). A label that decodes as a character reference in text (Q¬ify→¬) is rejected.url=, canonicalhrefand<a href>are decoded under HTML attribute-value rules — numeric refs,&name;, and the 106 legacy no-semicolon names (¶,®,©,¬, …) with the tokenizer's=/alphanumeric quirk — and must equal theMAPurl exactly;<title>and the link text are decoded under text rules and must equal the label.&is the one accepted escape, so an escaping generator would pass just as well as today's raw&tmeid=…&tmsrc=…separators do.MAPpaths must match one-to-one, and the generator template must still interpolate where the gate looks.Each rule has a fixture self-test; zero dependencies. Picked up automatically by the existing
node --test scripts/*.test.mjsCI step — no workflow change. README## Checksdocuments the gate.Verified locally at
7d6d8e1: full suite 314 → 338 pass. Mutation check: rewritingtv/index.html's target to end in¶fails only the new gate, naming all three attributes (browser decodes ¶) plus three ambiguous-ampersand offsets; every pre-existing gate stays green on that mutation.Closes #132
Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88