A newer version of the Gradio SDK is available: 6.22.0
StoryCode β Handoff for the executing agent (Codex)
Full design rationale: ~/.claude/plans/so-uh-this-is-modular-curry.md.
This file is the do-this-next checklist. Deadline: 2026-06-15.
Read AGENTS.md first β it has the rules you must not break.
What's already built & verified β
The whole app is written, and the deterministic core is tested green
(python tests/test_analyzer.py β 10/10, no GPU). The Gradio UI builds and every
panel renders. The only thing not yet exercised is the live model β because it
needs the Modal endpoint.
| File | State |
|---|---|
config.py, schema.py, ingest.py (+ secret scan) |
β done & tested |
analyzer/ (python_ast, js_treesitter, generic, graph, deps, __init__) |
β done & tested β the source of truth |
diagram.py, story.py, narrate.py, db.py |
β done; narration verified via the model-free fallback |
llm.py |
β written; needs the live Modal endpoint to exercise the real path |
ui/theme.py, ui/styles.css, app.py |
β
written; UI builds. Needs a live python app.py run |
modal_app.py (vLLM serving MiniCPM4.1-8B) |
β written; you must deploy + version-pin it |
zerogpu_backend.py |
β break-glass fallback |
scripts/sample_project/, tests/test_analyzer.py |
β done; tests pass |
README.md (HF frontmatter+tags), .env.example, requirements.txt |
β done |
Do these in order
Deploy the GPU backend.
- In
modal_app.py: confirmVLLM_VERSIONagainst the MiniCPM4.1-8B model card (it uses custom code β--trust-remote-code). Set a real shared secret:modal secret create storycode-api MODAL_API_KEY=<secret>, thenmodal token newandmodal deploy modal_app.py. - Smoke-test the endpoint:
curl -H "Authorization: Bearer <secret>" <url>/v1/chat/completions -d '{"model":"openbmb/MiniCPM4.1-8B","messages":[{"role":"user","content":"Reply with JSON {\"ok\":true}"}]}' - Risk: MiniCPM4.1 is a hybrid-reasoning model. If it emits long
<think>chains or ignoresguided_json, (a) check the model card for the flag that disables thinking and add it to the vLLM args, and (b) confirm the installed vLLM version supportsxgrammarguided decoding. The contractllm.pyexpects is a plain OpenAI/v1/chat/completionsthat honoursextra_body={"guided_json": ...}.
- In
Wire secrets. Copy
.env.exampleβ.envlocally; on the Space setMODAL_ENDPOINT_URL(=<url>/v1) andMODAL_API_KEY(same shared secret).Run locally.
pip install -r requirements.txt && python app.py. Click "Try the sample project" β you should get a Story + Plain-English panel + a rendered Architecture Map + the Safe-to-Edit list + Dependencies. Switch styles/difficulty β the Story re-narrates (no re-analysis).Tune the narration prompts in
story.py(and onlystory.py) until the output is accurate AND in-voice for each of the 5 styles Γ 3 difficulties. This is the main creative loop and your clearest Codex-attributed work. Keep the grounding rule intact (the model narrates facts; it never invents files). Re-runpython tests/test_analyzer.pyafter β it must stay 10/10.Real-user proof (Backyard AI requirement). Run the friend's actual Claude-generated app through StoryCode. Capture: a quote from them, before/after screenshots, and the story it produced. Put these in the README.
Deploy + submission assets.
- Create a Gradio Space under
build-small-hackathon; push this repo; set the two secrets. Verify it reaches Modal (check Modal logs). Test on mobile. - Record a 60β90s demo video (upload β Story β Map β Safe-to-Edit); link in README.
- Push to a public GitHub repo with Codex-attributed commits; link it in the README (OpenAI Codex prize requirement).
- Post once on social; link it. Confirm README frontmatter tags are present.
- Create a Gradio Space under
Post-MVP queue β only after steps 1β6 are deployed. One at a time.
In priority order (each is a clean, bounded task; details in the plan file):
- Grounded chat Q&A β "Ask anything about your code", answered from the
ProjectModel + summaries already in
gr.State(no new analysis). - "How do I change X?" assistant β "file X, line Y, change Z to W."
- Error detective β paste an error + file β detective-story fix.
- Dependency panel polish β surface
analyzer/deps.pyrisk flags more loudly. - Save / revisit + Share (wire
db.pyinto the UI). - Export story as PDF / Markdown.
- GitHub URL ingestion (add a
from_githubpath toingest.py). - Before/after edit preview.
Gotchas
- Don't add
torch/vllm/transformerstorequirements.txtβ the GPU is on Modal; the Space is a CPU container. (Those belong only inmodal_app.py, or in the Space only if you switch to the ZeroGPU fallback.) - Keep the UI custom (
ui/styles.css) β Off-Brand badge + explicit requirement. - Don't claim Tiny Titan β MiniCPM4.1-8B is ~8B, not β€4B.
- The static analysis is the source of truth. Never let the model override the
Architecture Map or the Safe-to-Edit verdicts. If you change
analyzer/, updatetests/test_analyzer.pyto match and keep it green.