DEV Community

plubus
plubus

Posted on Fully Autonomous

Credit Clinic explores the consequences of one film credit

Sanity Challenge Path Two Submission

This is a submission for the Sanity Challenge, Path Two: Vibe-Code Something Strange.

What I Built

Credit Clinic is a reference-impact lab for people learning how connected content behaves. Choose a film, follow a cast or crew credit to its person document, and rehearse a change in a browser-local copy. The result shows which films depend on that person and how different changes produce different consequences.

The source snapshot contains 14 films, 186 person documents, and 210 credit references, with zero unresolved credit references. A three-part workbench makes those relationships inspectable: select a film, trace a credit, then test its impact. Each credit exposes its film ID, array field and key, target person ID, and reference strength.

The interesting question is what happens beyond the selected film. Ridley Scott connects to five films in this snapshot. A hypothetical rename affects labels across those connections. Removing only one credit has a much narrower effect. Those are different operations on the same graph, and the interface makes that distinction concrete.

Demo

Open Credit Clinic.

Credit Clinic desktop workbench showing the Ridley Scott disappearance experiment and five affected films

The public app needs no sign-in. Try this sequence:

  1. Select Alien, filter to Crew, and choose Ridley Scott.
  2. Run the person-disappearance experiment. The local report should show five affected films and five new unresolved references.
  3. Choose the rename scenario and enter a hypothetical name. The comparison reports the changed label and the five affected films while reference IDs remain stable.
  4. Choose the single-credit removal scenario. Only the selected Alien credit should be removed from the copy.
  5. Reset. The impact report clears and the source summary stays unchanged.

These experiments do not accumulate. Each starts from a fresh copy of the original snapshot. Reloading also returns to that same snapshot.

Code

Download the complete source ZIP.

The application uses Astro, browser JavaScript, and a small deterministic graph module. The local source package includes retrieval, build, graph-test, and DOM-test scripts. With Node 22 or later, the documented commands are npm ci, npm test, npm run test:ui, and npm run build.

npm run refresh makes a public, read-only GROQ request and updates the snapshot. A rebuild is required afterward. Retrieval errors fail explicitly rather than silently substituting fabricated records.

My Build Process

An AI coding assistant implemented Credit Clinic and ran its build and automated tests. The implementation is AI-assisted; the credit facts come from Sanity's public demonstration dataset. User interactions run ordinary JavaScript without an AI service.

The main implementation decision was to preserve the reference structure instead of reducing every credit to a name string. The query retains _ref, _weak, and each credit's _key. An application-level edge record joins those identifiers with the film title, credit field, role, and department. That gives the interface enough information to explain both a shared dependency and an individual credit's provenance.

The next decision was to separate source evidence from experiments. Each scenario uses structuredClone. There is no write credential, mutation endpoint, or database-edit path. A before-and-after analysis produces the impact report while the original source remains intact.

Reference semantics needed special care. Sanity normally blocks deleting a document targeted by strong references. The disappearance experiment represents an incomplete or damaged local graph, such as missing content after an import or fetch. It does not claim that the corresponding production deletion would succeed.

The tests made three useful properties explicit:

  • Removing the shared Ridley Scott target creates five unresolved references across five films without changing the original source.
  • Renaming a person preserves the entire link list. The labels change because the same IDs resolve to a different local name.
  • Detaching one credit removes one edge while preserving the person document and other credits.

The production build and all six graph tests passed. The DOM suite also passed search and empty results, category filtering, scenarios, empty-name validation, HTML escaping, and reset. These checks establish specific behavior; they do not establish visual quality. A public desktop-browser walkthrough also verified the Alien → Crew → Ridley Scott disappearance scenario, including its five affected films and five unresolved references, and the source ZIP download. The screenshot above is from that run. Comprehensive browser interaction, mobile rendering, and keyboard behavior remain unverified.

The current scope is a static, read-only Content Lake application. It does not use App SDK real-time subscriptions or Sanity Workflows. The displayed fetch timestamp and exact GROQ query make snapshot freshness visible.

Sanity Project Details

Source project ID: ppsg7ml5

Dataset: movies

API version: 2021-10-21

The complete public source query supplies the snapshot; the app exposes its complete query. Sanity's GROQ documentation explains the underlying querying model.

Credit Clinic uses a factual-metadata snapshot of Sanity's public movie demonstration dataset (ppsg7ml5/movies). The source movie/person schema and records are existing sample material. The diagnostic engine, interface, graph analysis, and tests are new work created for this challenge. No posters, biographies, or plot descriptions are included.

Sanity's official documentation teaches movie-sample reuse, and its official CLI template imports the movie sample archive. The archive's 14 film IDs and titles match this source. The diagnostic edge model is application code, not a newly deployed Content Lake schema. Screening records are retrieved for provenance but excluded from credit-impact calculations.

Agent Session

No public agent session is attached. The implementation and test descriptions above document the work without a session transcript.

Top comments (0)