Files
softharbor/docs
poli0981andClaude Opus 5 4a4fa181ca feat: M4 trust layer — legal pages, language switch, theme toggle
Five legal documents in both locales, the language switcher, the theme toggle,
and LICENSE-DATA.md. Five of the six islands now exist; ShBugReport is M5.

Cleared the S4 debt: the gate's copy was hardcoded in the island with a comment
saying M4 must move it. It now comes from the dictionaries, passed as props
rather than by importing `t` - the gate has to switch locale without a reload,
but importing the dictionaries would bundle all 78 keys into an island that
renders seven strings. Its tests now read the real dictionary, so they break if
a gate key is renamed.

A regression I introduced in the S1 trailing-slash fix, caught here:
build.format 'file' makes Astro.url.pathname the emitted FILE name, so ALL 52
pages shipped canonicals and hreflangs pointing at /apps.html - disagreeing
with both the sitemap and the URL actually served, which is exactly the
duplicate-content signal docs/16 works to avoid. I changed build.format for the
trailing-slash fix and never re-checked canonicals. Fixed with canonicalPath()
in src/lib/locale.ts, pinned by tests, and written up in docs/07 §6 so the
coupling is visible next time.

Two other structural changes:
- Locale ROUTING split into src/lib/locale.ts with no dictionary import, so
  islands can use localePair() without pulling in every string. src/i18n
  re-exports it, keeping one implementation.
- sh:lang moved behind typed helpers in src/lib/lang.ts. Lint caught this -
  docs/10 §3 requires every localStorage key to have one reader and one writer,
  which is also what keeps the privacy inventory in docs/09 §8 true.

Legal prose lives per locale in src/components/legal/, not in the dictionaries:
docs/07 §1 puts legal in its own layer because multi-paragraph documents are
content, not UI strings. EN and VI sit in one file per document so a change to
one is visibly a change to the other in review. Every VI page carries the
required courtesy notice, and all ten routes are gate-exempt - verified with
storage cleared.

The suggestion banner renders with t('vi', …) regardless of page locale, on
purpose: it only ever shows to someone whose browser is Vietnamese while they
are on an EN page, so English would be backwards.

NOT approved: these are the docs/14 drafts published as written. H6 (Kokone's
review) is outstanding, and LEGAL_VERSION should be reset to the approval date
when it happens - bumping it re-opens the gate for everyone, which is intended.
The site still carries X-Robots-Tag: noindex.

Gate: lint, i18n:check (78 keys), validate:data, 88 tests, astro check
(0 errors), build (52 pages) - all green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 13:42:43 +07:00
..
2026-07-27 21:46:00 +07:00
2026-07-27 21:46:00 +07:00
2026-07-27 21:32:31 +07:00