feat: publish legal dates at /legal.json - #195
Merged
Merged
Conversation
wavekat-platform records the terms version a user agreed to as the page's own YYYY-MM-DD date, but keeps its own copy of that date — and it has already drifted (platform says 2026-09-12, the terms page says 2026-09-13). /legal.json gives its CI something to compare against. The privacy date was hard-coded in all nine locale pages; it now lives in src/lib/privacy.ts, so the JSON and every page read one constant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gxht5A4tc5E4JeBHGrDE91
Contributor
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.
Why
wavekat-platform#321 records which version of the terms a user agreed to at sign-up, stored as the terms page's own
YYYY-MM-DD"last updated" date. The platform keeps its own copy of that date (TERMS_VERSION), and the only thing keeping it in step with this site was a comment. It has already drifted: the platform says2026-09-12,/terms/says2026-09-13.Sign-up shouldn't depend on this site being up, so the platform keeps its copy. What this adds is a file its CI can compare that copy against.
What
/legal.json, built statically:{ "terms": { "updated": "2026-09-13", "url": "https://wavekat.com/terms/" }, "privacy": { "updated": "2026-09-12", "url": "https://wavekat.com/privacy/" } }It reads
TERMS_UPDATEDand a newPRIVACY_UPDATED, the same constants that render each page's "last updated" line, so it can't disagree with what a reader sees.Privacy date consolidated. It was hard-coded as
new Date('2026-09-12')in all nine locale privacy pages, each with a "keep in sync with English" comment. It now lives insrc/lib/privacy.ts. Every page renders the same date as before (checked in the builten,ko,deoutput).scripts/test/legal-dates.test.js(now part ofnpm test) fails if any privacy page orTermsContent.astrohard-codes a date again, or iflegal.json.tsrestates one instead of reading the constants. I checked that it fails by putting a hard-coded date back in thekopage.Keys are additive-only: the platform reads them by name.
Verification
npm testastro builddist/legal.jsonas above, not in the sitemapcheck:linkscheck:metaNo visible page copy changed, so there was no SEO review.
Next
TERMS_VERSIONto2026-09-13, addprivacy_version, and add a CI check against this file.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gxht5A4tc5E4JeBHGrDE91