5 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 ff95578f48 fix: unblock CI — close every dependency advisory, pin actions, fix asset caching (#21)
Squashed from 8 signed commits:

- chore: normalise line endings to LF with .gitattributes
- fix(deps): refresh dependencies and close every open advisory
- style: adopt prettier-plugin-astro 1.x formatting
- fix: resolve the SonarCloud findings in scripts and issueUrl
- ci: pin actions to SHAs, fix notify/quarantine/link-check, add Dependabot config
- fix(headers): stop Cache-Control concatenation that disabled asset caching
- fix(theme): guard storage access in the pre-paint theme script
- chore(config): TS6-safe tsconfig, type-aware lint, gated build script

Each commit's full rationale is preserved on the PR (#21).
Verified on the Workers Builds preview: hashed assets now carry a single
`Cache-Control: public, max-age=31536000, immutable`, the JSON feeds a single
`max-age=300`, security.txt is utf-8, and preview hosts send noindex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:10:17 +07:00
poli0981andClaude Opus 5 b75a67393e feat: M6 CI/CD, launch config, dead-code sweep
Repo automation, the config changes Kokone asked for, and a full error pass.

Kokone's asks:
- LEGAL_VERSION -> 2026-07-28, the H6 approval date. Anyone who accepted the
  pre-approval wording sees the gate once more; that is intended, they agreed
  to different text.
- X-Robots-Tag: noindex REMOVED. It existed only while the dataset was empty,
  where an indexed blank site can linger as "Crawled - currently not indexed".
  With real entries, legal pages and a sitemap live, that objection is gone.
- The existing favicon.svg is now the PWA manifest icon, sizes "any" with
  purpose "any maskable". One scalable asset covers every size, and browsers
  without SVG-manifest support fall back to the favicon - strictly better than
  the empty icons array that shipped in M5 and suppressed the install prompt.

The www deletion, diagnosed: a `www` DNS record added by hand is not part of
the Worker's trigger list, so `wrangler deploy` reconciles triggers and can
remove it - the redirect then dies silently. Declaring www.softharbor.net as a
second custom_domain makes wrangler CREATE and KEEP the record, so it survives
deploys and reproduces from a fresh clone instead of depending on a manual
step. www still never SERVES the site: Redirect Rule R1 runs before Workers
and 301s it to apex. That rule is now a documented hard prerequisite, because
without it www would serve a duplicate - the exact hazard docs/16 N1/N2 exist
to prevent.

CI/CD (docs/12): ci.yml with the two-job split the reusable workflow forces,
plus codeql, notify, deploy, preview, quarantine and link-check. Also
renovate.json - which pins TypeScript below 7 and flags Astro/Vite/Tailwind
majors for a fresh S1 - CODEOWNERS on the three highest-risk paths, and the
remaining issue templates.

quarantine.mjs implements hard rule 5 mechanically, and I tested it rather
than assuming: flagging VLC and running the sweep removed it from the detail
page, the grid, the API export, the RSS feed AND the search index - all five
surfaces - then restored cleanly.

Error sweep found real things:
- Two exactOptionalPropertyTypes violations. Under that flag `foo?: string`
  means "absent or string", not "may be passed undefined", and both props came
  from optional lookups. Object.fromEntries also widens to { [k: string]: … }
  and no longer satisfies Record<Locale, …>.
- ShProbe.svelte was still in the tree - a dead S1 leftover sitting in
  islands/ where docs/02 §5 caps the count at six.
- Five unused exports and an unused PWA type reference.
knip now passes clean, so the next dead export is visible instead of buried.

Gate: lint, i18n:check, validate:data, 99 tests, astro check (0 errors), knip,
build (55 pages) - all green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 14:38:52 +07:00
poli0981andClaude Opus 5 44c6faa8b8 feat: close S1/S5 gaps — trailing slash, service worker, offline page
Deployed to a Cloudflare preview URL (Worker created with a routes-free
config, so nothing is attached to softharbor.net yet) and tested against a
real origin. Four bugs that only a real deploy could surface:

1. trailingSlash x html_handling — S1's last open question, now answered.
   With build.format 'directory', Workers' auto-trailing-slash 307s /apps to
   /apps/, while every canonical, sitemap entry, hreflang alternate and
   internal link we emit uses the NO-slash form. So each advertised URL cost
   a redirect and none ever returned 200. Fixed with build.format 'file' +
   html_handling 'drop-trailing-slash': measured after, every canonical
   returns 200 and only the slashed variant redirects, to it.

2. The service worker never registered. @vite-pwa/astro emits registerSW.js
   and sw.js but references them from no page, and the build reports success
   regardless - so the entire offline story silently did not exist. Base.astro
   now loads the emitted file (external, to satisfy script-src).

3. navigateFallback served the offline page to ONLINE visitors. On its own it
   registers a NavigationRoute that answers every navigation from the
   precache; an online request for /apps returned "You appear to be offline".
   docs/08 Part D already had the right shape - NetworkOnly navigations with
   precacheFallback - and this config had dropped it. Restored, and the
   regression is now an explicit check.

4. clientsClaim was false, so the SW controlled only pages loaded after
   activation: a first-time visitor losing connection mid-session got the
   browser error page, not ours. Set true, which is what 'autoUpdate' implies.

Also: the workbox globs are coupled to build.format ('offline.html', not
'offline/**') and Workbox normalises the precache key to the extensionless
'/offline' - both verified against the emitted manifest rather than assumed.

Verified on the preview origin: _headers applies (CSP, X-Frame-Options,
Referrer-Policy, cache rules), /nope returns a real 404, SW is active AND
controlling, offline page is precached with all 13 fonts and renders both
languages, and online navigation still serves real pages.

Pre-launch X-Robots-Tag: noindex added to _headers - the site is deployable
but has no dataset, and an empty site indexed early can linger as "Crawled -
currently not indexed". Removing it is now a launch-checklist item.

Supporting: /offline and /404 pages, robots.txt, ringbuffer.ts and
issueUrl.ts (S3's subject) with tests covering budget truncation, oldest-line
eviction and unicode round-tripping.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 12:14:51 +07:00
poli0981andClaude Opus 5 d40f8c6ce6 feat: M1 skeleton — tokens, fonts, layout, bilingual shell
Welcome and an empty /apps grid in BOTH locales, on the full design-token and
font foundation. Verified in a real browser this time: the preview pane came
up, so the runtime checks S4 could only assert in happy-dom are now confirmed
against an actual rendering engine.

i18n (docs/07): en.json/vi.json + a typed t() whose Key union derives from
en.json, so a typo is a compile error rather than a blank string. Plus
scripts/check-i18n-parity.mjs, its own script on its own lefthook glob -
folding it into validate:data means an edit touching only src/i18n never runs
it. It also enforces alphabetical key order, because a 200-key dictionary is
unreviewable otherwise. Negative-controlled: deleting a key, adding a stray
one and unsorting all three get caught.

Pages: bodies live in src/components/pages/*.astro and src/pages/** are thin
locale wrappers. This extends the docs/07 §2 no-duplication rule from
getStaticPaths to whole pages - EN and VI cannot drift because there is only
one copy of the markup.

Tokens/fonts (docs/06 §2/§3): full --sh-* set for both themes, type scale with
a mobile step, offset-shadow lift, reduced-motion collapse including
view-transition groups. 13 woff2 self-hosted, latin+vietnamese only; grep of
the built output confirms zero third-party URLs (hard rule 7).

Two more inherited spec bugs found by reading dist/ rather than the spec:
- _headers carried a /fonts/* rule and the PWA a 'fonts/*.woff2' glob, but
  Astro content-hashes fonts into /_astro/. The header rule matched nothing
  (harmless), the workbox glob matched nothing (not harmless - the offline
  page would have rendered unstyled). Both corrected here and in docs/08 D
  and docs/09 §4.
- Tailwind's preflight zeroes the margin that native <dialog> relies on for
  centring, so the legal gate rendered in the top-left corner. Caught by
  looking at a screenshot; no test would have.

Browser verification: zero CSP violations with islands hydrating, which
confirms D20 against a real engine rather than by hash arithmetic. Accept
persists sh:legal and closes the gate; ClientRouter navigation does not
re-flash it; and navigating /apps -> /vi/apps switches the PERSISTED gate's
title, button and legal hrefs to Vietnamese - the exact S4 bug, now confirmed
fixed for real. No horizontal scroll at 375px; Vietnamese diacritics render
cleanly in all three faces.

Gate: lint, i18n:check, 67 tests, astro check (0 errors), build - all green.
CSP hash verification re-run across all 5 emitted pages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 11:44:05 +07:00
poli0981andClaude Opus 5 79bac59e69 feat: P1 scaffold + spikes S1 and S2
Astro 7 static scaffold with the full integration set, plus the two spikes
that could be run without external provisioning. Both passed; four findings
changed the spec and are folded into docs/ in this commit (docs/10 §7).

Toolchain (all verified building together): astro 7.1.3, svelte 5.56.8,
tailwindcss 4.3.3, minisearch 7.2.0, nanostores 1.4.1, vitest 4.1.10,
wrangler 4.114.0, Node 24, pnpm 11.15.1. The pre-approved astro@6.5.x
fallback was not needed.

S1 findings:
- @nanostores/svelte DOES NOT EXIST (registry 404). D15 named it as a locked
  dependency. No binding is needed - a nanostores atom already satisfies
  Svelte's store contract, which is why bindings exist for React/Vue/Solid
  but not Svelte. D15 amended.
- D18 ("ship nothing inline, use plain script-src 'self'") is unachievable.
  ClientRouter is fine - it compiles to an external script, so View
  Transitions are NOT at risk. The real source of inline script is Astro's
  island hydration: any page with a client:* directive gets bootstrap
  scripts inlined, and we have six islands. Replaced by D20: Astro's
  security.csp emits a per-page <meta> with generated hashes, and _headers
  carries only frame-ancestors. Both policies are enforced independently, so
  _headers must NOT also declare script-src or the intersection drops the
  hashes and breaks every island. Verified by recomputing the SHA-256 of
  every inline script/style in dist/ against the emitted policy.
- TypeScript 7's native compiler does not expose the API astro check needs;
  pnpm check fails outright. Held at 6.x (D21), matching the sibling project.
- ignore-scripts=true does not "break nothing" as docs/09 §7 assumed: pnpm
  >=10 already blocks dependency scripts by default, and the flag also
  suppresses the allowlist, so esbuild never links its binary and the build
  cannot run. Replaced with an explicit allowBuilds gate in
  pnpm-workspace.yaml (esbuild/lefthook yes, workerd no). pnpm line
  corrected 10.x -> 11.x.

S2 findings:
- normalizeViet passes the full docs/05 §A1 vector table incl. NFC/NFD
  convergence, d-stroke folding, and idempotency.
- FUZZY set to 0.25 by measurement (D22). The declared gmip -> GIMP vector
  needs 2 edits on 4 characters (fuzzy >= 0.375), and at that setting the
  correctly spelled query `gimp` stops being an exact match. Precision on
  correct spellings beats one contrived typo, so the vector was retired in
  favour of gimo -> GIMP and fierfox -> Firefox. Tests pin both directions
  so a future fuzzy miss cannot be "fixed" by raising the constant.

Gate: pnpm lint, pnpm test (21/21), pnpm check (0 errors), pnpm build - all
green.

Not done, blocked on provisioning rather than code: S3 needs the GitHub repo
(H1), S5 needs the zone and a deploy (H2/H3), and S1's trailingSlash x
html_handling probe needs a real origin. S4 is doable locally and is next.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 22:11:33 +07:00