mirror of
https://github.com/adobe/skills.git
synced 2026-09-19 08:06:09 +08:00
1ab6833f1e
* fix(stardust): make migrate output genuinely zip-and-deploy portable The 0.7.0 contract claimed "self-contained, zip-and-deploy" but emitted root-absolute paths (/assets/..., /beers/) plus directory-only nav links. Those work on a webserver at the host root only — they 404 on file:// and at any subpath. This PR delivers what the claim promised: - Output path is URL-literal: /beers/ -> beers/index.html, /about-us/history.html -> about-us/history.html. No more synthesizing /about/index.html from a slug. - Page map (state.json.migrate.pageMap[]) built once per run; per-page rendering and internal-link rewriting both consume it. - Reference shape is depth-aware relative: prefix is ./ for depth-0 pages, ../ * depth otherwise. Works on file://, at host root, and at any subpath without rewriting. - Phase 3 broadens the self-containment check into a full portability audit: refuses absolute internal refs, refuses directory-only nav, runs the new pageMap + file:// fixtures. - New fixtures: file-protocol-audit.mjs (Playwright file:// round-trip) and pagemap-audit.mjs (static pageMap consistency). - asset-bundling.md and migrate-output-format.md aligned to the new depth-aware-relative shape; state.json contract gains pageMap[]. Plugin bumped 0.7.0 -> 0.7.1. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * review: fix four flagged correctness issues - Directory-only-nav regex now catches `./beers/` (the cited example). Old pattern required a-z as first char; `./beers/` starts with `.` and would have slipped through. New pattern accepts ./, ../, /, or a bare segment, and excludes scheme-bearing URLs (no false positive on https://google.com/). - Add a second grep for absolute url() references inside inline style attrs and <style> blocks (and CSS files); the original href/src grep missed these. - SKILL.md Outputs row no longer claims the sidecar lives at <source-url-path>/_meta.json (nonsense for .html-leaf pages). Replaced with a row that points at the canonical sidecar rule. - migration-procedure.md § Page map now explicitly says same-origin absolute URLs are stripped to their path portion before pageMap lookup (per content-preservation.md § Internal link rewriting), closing the loophole that would let <a href="https://origin/foo/"> pass through verbatim. Regex patterns verified against a test fixture before commit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * review: update migrate-self-contained-bundle eval to 0.7.1 contract The eval was pinned to 0.7.0's root-relative /assets/<subpath> shape. This PR's contract change to depth-aware relative paths would have made the eval fail against correct 0.7.1 output. - detection_src_href criterion now asserts <prefix>assets/<subpath> (not /assets/<subpath>). - Renamed prefix_resolution_root_relative -> prefix_normalises_authoring; description flipped from "reference is left as-is" to "authoring is normalised to the depth-aware emit form". - Added 4 new criteria: depth_aware_paths (6pts), pagemap_constructed (6pts), internal_links_via_pagemap (5pts), portability_audit_passes (13pts). - Setup uses real source URLs that exercise the URL-literal rule: /, /beers/, /about/history.html (preserve .html leaf), /docs/api/ (depth-2 nested). - Prototype HTML now carries internal nav in three authoring styles (root-absolute, same-origin absolute, directory-only) plus a broken-link case, exercising the page map rewrite. - Run 1 expected behavior rewritten to expect depth-aware emission ('./assets/...'), pageMap built before render, broken-link flagging, and the 6-step portability audit passing. - Run 4 (cross-page dedup) updated so the second page emits its shared asset with its own '../' prefix while the underlying file on disk is a single copy. - Weights re-balanced to sum to 100; portability_audit_passes gets the largest weight (13pts) since it backs the contract claim. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>