Watchdog: Sanity backbone (draft / RFC for the Sanity-as-dep decision) - #35
Draft
ylevtov wants to merge 1 commit into
Draft
Watchdog: Sanity backbone (draft / RFC for the Sanity-as-dep decision)#35ylevtov wants to merge 1 commit into
ylevtov wants to merge 1 commit into
Conversation
Foundation for merging the standalone PauseAI Watchdog (ai-integrity-watch.vercel.app) into pauseai.uk. This commit is the architectural foundation only — UI routes and CSS port follow in subsequent commits on this branch. See `lib/sanity/INTEGRATION_NOTES.md` for the full plan, the decisions the maintainer needs to weigh in on, and the TODO list for the rest of the integration. What's in: - Sanity v3 deps (next-sanity, @sanity/client, sanity, @sanity/vision, @sanity/image-url, styled-components) - lib/sanity/schemas: incident, company, category, submission (+ index) - lib/sanity/messagingValidation: PauseAI brand/messaging rules surfaced inline in Studio as editors type (errors block publish, warnings don't) - lib/messagingRules: shared rules module (single source of truth) - lib/sanity-client (read), lib/sanity-write (server-only, for /api/submit) - lib/queries, lib/types, lib/companyLogos, lib/categoryMeta - sanity.config.ts + app/studio/[[...tool]] (embedded Studio at /studio) - .env.example with the three Sanity env vars Reversible if the team decides against Sanity: the only files that need to come back out are this directory tree and the package.json deps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for pauseaiuk ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
|
@hturnbull93 Now is a good time to decide what CMS we want to use. My main concern about Sanity is that it is not FOSS. |
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.
Summary
Foundation for merging the standalone PauseAI Watchdog (live at https://ai-integrity-watch.vercel.app) into pauseai.uk. This commit is the architectural foundation only — UI routes and the Tailwind → vanilla-CSS port follow in subsequent commits on this same branch.
I'm opening it as a draft now so the Sanity-as-a-dependency decision can be reviewed against concrete schemas before the rest of the integration goes in. Yuli will walk through the context on a call.
What's in this commit
@sanity/client,next-sanity,sanity,@sanity/vision,@sanity/image-url,styled-components). Only the Watchdog routes will use them; the rest of the site stays static.lib/sanity/schemas/— four document types:incident,company,category,submission(inbound from the public form, with a triagestatus).lib/sanity/messagingValidation.ts— Studio-side validator that surfaces brand-spelling errors and discouraged-term warnings inline as editors type. Backed by the sharedlib/messagingRules.tsmodule.lib/sanity-client(read) andlib/sanity-write(server-only, for/api/submit).lib/queries.ts,lib/types.ts,lib/companyLogos.ts,lib/categoryMeta.ts— the shared data layer the UI pages will consume.sanity.config.ts+app/studio/[[...tool]]/— the embedded Studio at/studio, so editors don't need a separate deploy..env.examplewith the three Sanity env vars.Typecheck passes.
What's TODO on this branch before unmarking draft
app/watchdog/page.tsx— main feed (incident list + filters)app/watchdog/[slug]/page.tsx— incident detailapp/watchdog/submit/page.tsx— submission form (POSTs to the API route)app/watchdog/about/page.tsx— credits + AI Lab Watch attributioncomponents/watchdog/*— IncidentCard, IncidentFeed, CompanyFilter, CategoryFilter, SubmitFormapp/api/submit/route.ts— validates + writes asubmissiondocapp/api/revalidate/route.ts— Sanity webhook target for ISR refreshapp/watchdog/watchdog.css— scoped CSS using your design tokens (--bg,--accent,--surface, …); standalone Watchdog uses Tailwind, so the port is a mechanical Tailwind → vanilla-CSS translation, not a redesigncomponents/Nav.tsx— add the "Watchdog" linkscripts/check-messaging.ts+.githooks/pre-commit)tsconfig.tsbuildinfoand gitignore itSee
lib/sanity/INTEGRATION_NOTES.mdfor the full plan.Decisions I'd love your input on
lib/data/incidents.tsand losing editor self-service + the public submission form./watchdog/. Could be/integrity-incidents/if you'd rather. The existing/track-record/(the personal one-year retrospective) stays untouched either way./studioon the same domain. Alternative: a separate subdomain likewatchdog-admin.pauseai.ukif you'd prefer to keep the public site free of any admin tier.When this lands — deploy work
NEXT_PUBLIC_SANITY_*,SANITY_WRITE_TOKEN,SANITY_REVALIDATE_SECRETto Netlify env.https://pauseai.uk(and previews) to the Sanity CORS allowlist, Allow credentials checked.Test plan
npm install(peer-deps clean)npx tsc --noEmitpasses (✅ green locally on this commit)npm run buildsucceeds with Sanity env vars set/studiorenders with the four schemas listed/watchdog/renders the incident feed (after follow-up commits)/watchdog/submitPOSTs to/api/submitand creates asubmissiondoc visible in Studio🤖 Generated with Claude Code