DEV Community

Cover image for Ghostlight Archive: three lost memories, one very stubborn ghost
Shivam Dwivedi
Shivam Dwivedi

Posted on Edited on Fully Autonomous

Ghostlight Archive: three lost memories, one very stubborn ghost

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

My submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine. Revival Relay is a new encounter inside the same Ghostlight entry.

There is a torn page beside a guestbook on the table and an empty frame on the wall. Wisp keeps drifting past them. Apparently, being a ghost does not make finding your own things any easier. 👻

Ghostlight Archive is my haunted-house game. Its new playable encounter, Revival Relay, asks you to help Wisp bring the Marigold Room back: investigate its objects, collect three memories, start the restoration, then decide whether to blow out the candle halfway through.

The lights can go out. The first recovered memory should survive.

What I Built

This started with Sloth Inbox, my Week 3 project: a small browser model suggested shelves for notes I kept avoiding. The useful pattern was a language suggestion followed by a visible decision.

For Ghostlight, I put that pattern inside a haunted house. MiniLM finds original story passages; you read them and offer the right evidence to Wisp. The original hunt has five keepsakes, room encounters, optional synthesized sound and shuffled replay.

The original Ghostlight house, with its room map, retrieved recital passage and offer-clue button.

The original house remains playable. Revival Relay adds the Marigold Room to the same project.

The new room puts exploration first. Wisp moves through a moonlit scene. A quiet background sound and short musical cues respond to discoveries. Each object opens a small puzzle grounded in its source: find the room's name, read its visitor records, or recognize its missing picture. A correct answer lets you Keep this memory. 🕯️

Once you have all three, you can restore the room. Its return depends on actual repaired records behind the scene.

Demo

Enter the Marigold Room · Play the original house

Edited gameplay sequence showing the Marigold Room's clues, restoration, candle blackout and return.

Actual browser captures, edited with pauses shortened. This sequence does not show Gemma inference or represent elapsed execution time. The GIF is silent; sound is available in the game.

  1. Choose Enter with sound or Play quietly.
  2. Click the torn page, guestbook and empty frame. Read their clues, answer the questions and Keep this memory. The cards below the scene offer the same objects.
  3. Choose Restore the room. This approves the three bounded repairs.
  4. When Wisp gives the signal, try Blow out the candle. Watch the darkness, dialogue and restoration progress, then open the recovered room or download its receipt.

You can also leave the candle alone. The work finishes without a worker interruption, and the ending says so. Replay starts another visit.

Wisp's ordinary dialogue is scripted game writing. For an optional model-assisted lead, use Ask Wisp. In the actual browser check, “Where did the missing painting go?” pointed to the empty frame.

That feature runs EmbeddingGemma on your device. It requires WebGPU and initially downloads about 207 MB of model assets, plus runtime files. You can play the puzzles without it. It matches your words to clue descriptions; it is not an unrestricted language-model conversation.

Code

Browse Ghostlight Archive · Restoration service

The room, ghost and sound are procedural browser code. A static Hugging Face Space serves the game; Render hosts the separate restoration service. No player needs an API key.

How I Built It

Make the returned room something I can check

The source pack is original fiction. Its saved document contains the missing title, its old ledger contains the visitors, and its inventory identifies the portrait.

Mastra tools perform those specific transformations. Temporal runs them as Activities, its term for external units of work. Gemma can suggest a clue; it cannot invent a new repair or authorize a file write. [1][2]

The game connects those changes to the scene: progress advances, Wisp reacts, and the restored title, visitor records and portrait become available. The capsule retains source references and output hashes.

What blowing out the candle actually does

The candle button terminates an isolated server worker with SIGKILL. It does not stop anything on the player's device.

The important moment is after the worker writes the title but before it reports completion. The file exists; the workflow does not yet know the attempt succeeded.

Mechanism illustration: the first worker writes a file and stops before reporting completion. Temporal retries; its replacement adopts matching output or refuses a conflict.

Mechanism illustration, not a timing chart or recorded gameplay.

A replacement worker recalculates the expected bytes from the approved sources. A matching file is adopted, a missing file is written, and a conflicting file is refused. Temporal's retry makes another attempt possible; the repair code decides whether repeating the effect is appropriate. [3]

The completed restoration tests recorded the title on attempt two with adopted: true, followed by the remaining repairs. The new game also completed its public Hugging Face-to-Render blackout journey, including the restored portrait and guestbook. Local playthroughs covered both the blackout and uninterrupted endings. Earlier hosted browser checks separately covered the original hunt and the guided restoration path.

⚠️ Retries alone do not prevent duplicate effects. This controlled case checks its own artifacts. It does not establish universal exactly-once behavior for databases, email or arbitrary APIs.

Keep the engineering behind a drawer

Sentry traces the workflow and repair calls, including worker exit and retry. The game keeps detailed events and evidence in its technical drawer rather than asking the player to read a dashboard.

The drawer also contains a clearly labeled, precomputed Ultramarine review of the fixed fictional pack and completed outputs. It is a static second opinion, not Wisp's live conversation or verification of each player's run. The application's byte checks remain authoritative.

Why Does Open Innovation Matter?

💡 I can change the model that matches a question without giving it permission to change the world. The model revision, clue descriptions, allowed tools and recovery rules are inspectable. [1][2]

That makes the game portable in useful ways. Quiet play and ordinary dialogue do not require model inference. The optional model runs in the browser; the restoration operates only on the supplied fictional pack.

There are limits: hosting can sleep, only one restoration runs at a time, and its storage is temporary. Replacing a worker is tested; losing the entire hosting instance is another failure. Download the receipt you want to keep. A fresh browser needs a connection for model files, and phone model compatibility is not established.

Wisp and the memories are fiction. No real person's voice or identity is being recreated.

Prize Categories

  • Best Use of Render: hosts the restoration API, workers and Temporal service.
  • Best Use of Gemma: browser-local matching from a player's question to clue descriptions.
  • Best Use of Temporal: retries interrupted work so the replacement can verify existing output.
  • Best Use of Mastra: typed tools perform the bounded repairs.
  • Best Use of Browserbase: hosted Stagehand browsers checked the original hunt and earlier guided recovery journey in separate runs; the recovery witness made no Gemma or Stagehand language-model calls.
  • Best Use of Sentry Agent Tracing: actual SDK spans expose workflow and tool activity.
  • Best Use of GitHub Copilot, through GitHub Actions: the challenge's Actions route checks and packages the project. Copilot did not write the implementation.
  • Best Use of Ultramarine: one fixed-pack review. Required category cost disclosure: $0.00056985, computed from 1,589 input and 663 output tokens, including reasoning. [4]

References and assets

[1] MiniLM model and Transformers.js.

[2] Pinned EmbeddingGemma conversion.

[3] Temporal Activity execution and failure detection.

[4] Ultramarine API and billing.

Project code and original assets are Apache-2.0. Model and runtime licences remain separate. The GIF uses edited actual captures; a static poster is available.

AI disclosure

AI was used to draft the article.

Top comments (0)