The Last Directory:附有來源記錄的本地鬼故事
The Last Directory: a local ghost story with a paper trail
The Last Directory 使用本地運行的 Spark-X2.6-4B,將虛構檔案索引改編成三段鬼故事場景。每段場景均附有來源標記,方便檢視引文與原始檔案;園景故事有兩項引文檢查未通過,作品亦未經獨立評估。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.
What I Built
The Last Directory turns a fictional file index into three short ghost-story scenes, using a small open-weight model running locally. Each scene has a source chip. Click it and the archive line that inspired the scene lights up beside the story.
The starting image is a station that has closed for the night. Its last train has left. A red umbrella has no owner. An announcement is queued for platform nine, although the station has only eight platforms.
Those four notes are original fiction. So are the filenames and the station. Nothing on your computer is searched or opened. The interesting question is what a model will make of the gaps between those notes—and whether its quoted evidence will survive the telling.
There are two other archives: a computer that promises to remember its visitors, and an unsent postcard from a garden with an empty chair. The result is a small Halloween reading experiment with an inspectable paper trail.
Demo
Open the interactive recorded demo.
Choose Station Nine, then press Explore recorded inference. Click E3 below the second scene. The corresponding announcement entry lights up. Save provenance downloads the exact model completion, source archive, settings and check results.
The public site replays three saved outputs from actual local Spark runs. Its banner says RECORDED DEMO · NO ONLINE INFERENCE. New generation runs in the local Python app; no cloud model key or payment is needed.
Here is the actual local application after a browser-triggered generation:
For the less tidy part, choose The Unsent Postcard in the public demo. The model changes “marigolds” to “marigold” inside a quote and gives a postcard quotation the visitor-book's ID. Both problems are visible above the story. Clicking E3 shows the original visitor-book entry, making the mismatch easy to inspect.
Code
GitHub: eric0219c/the-last-directory
The repository includes the frontend, standard-library Python service, original fictional archives, tests, actual recordings, and a source ZIP containing the full baseline and revised evidence. The code and fictional data are MIT licensed. Weights, runtime binaries and private keys are excluded.
python3 setup_runtime.py
sh start_model.sh
# In a second terminal:
python3 haunt.py
Open http://127.0.0.1:8763. The pinned setup script targets macOS Apple Silicon; the README explains the tested environment and other-platform limit.
How I Built It
The core is Spark-X2.6-4B, using the publisher's Q4_K_M GGUF with llama.cpp b11669 on an Apple M5 with 16GiB memory. The three-scene JSON schema separates original prose from an event ID and a literal quotation. The Python validator checks the structure, known IDs, exact quote substrings, distinct sources and their order. It never rewrites the generated story.
The browser renders text with textContent, keeps the original archive beside the fiction, highlights source entries, and exports provenance. The live route sends only a selected fictional archive to the loopback model. It has no shell tool, filesystem-crawling feature, external account access or command executor.
The prompt, schema, model revisions and hashes are included in the source. The runs use temperature0.6, seed20261027 and an output limit of900 tokens. The three revised development runs took about21–25 seconds each on this machine. That is a description of these runs, not a performance benchmark.
Eight tests passed, including fabricated quotations, a quote from the wrong file, unknown or repeated source IDs, reversed source order and incomplete output. The actual model experiments were more useful than the passing tests:
- In the first prompt version, all three outputs passed literal source checks. Reading them revealed a borrowed timestamp and a season assigned to the wrong event. Exact matching did not catch either problem.
- After revising the prompt, two of the same three cases passed literal checks. The garden output failed two quotation checks, and the app displayed those failures. Original results from both versions remain in the evidence bundle.
- Some generated scenes still include stray source IDs or merely retell the notes. The prose is a modest prototype, and narrative quality is subjective.
These are known-case regression runs. There was no held-out evaluation, independent human review, originality certification or audience study. Matching a quote is a useful inspection aid; it does not establish that the whole scene is faithful to that source.
Why Does Open Innovation Matter?
Local open weights make the entire little experiment inspectable. The model revision is pinned. The prompt is a normal source file. The validation rules are short enough to read. A reviewer can run the same archive, change the prompt, replace the model, or investigate a bad quotation without depending on a hosted model endpoint staying available.
After downloading the public weights and runtime, inference needs no Internet connection. The public demonstration is also a static collection of actual outputs, so it can remain readable without maintaining a paid inference service. Running it still uses electricity and hardware; there is no claim that computation is free.
The project began on27 October2026, inside this challenge's window. Its archives, narrative workflow, interface and source interactions are new for this entry. The pinned downloader and llama.cpp startup utilities were reused from our earlier MIT PlainBridge project, with that provenance documented in NOTICE.md. The model weights themselves were already downloaded. This entry claims its new application work, with the reused infrastructure credited.
Disclosure
ChillG, the account owner, authorized Codex AI agents to prepare the implementation, fictional source material, tests, model runs and this post. This was an autonomous build, and the post uses DEV's Fully Autonomous / AI Generated disclosure. Agents are tools, not human teammates. No human editing, validation, memories or audience reactions are claimed. The application outputs shown are actual Spark completions, retained without silent repairs.
This entry is for the overall challenge. No partner technology prize is claimed.
來源:DEV Community · dev.to

