A newer version of the Gradio SDK is available: 6.22.0
AGENTS.md β rules for any agent (Codex) working in this repo
StoryCode explains a non-coder's project to them as a story. Read HANDOFF.md for
the task list and ~/.claude/plans/so-uh-this-is-modular-curry.md for the why.
The one rule that defines this app
Static analysis is the source of truth; the model only narrates it.
analyzer/ computes the real files, import edges, fan-in/out, roles, entry points,
and safe-to-edit verdicts. The language model (via narrate.py / story.py) writes
plain-English about those facts. Never let the model invent files, edges, or
safety verdicts, and never let model text override what analyzer/ produced. The
Architecture Map (diagram.py) and Safe-to-Edit panel are built directly from the
ProjectModel β keep them that way.
Architecture (where things live)
ingest.pyβ zip/file β cleanSourceFiles; redacts secrets before anything leaves it. All code text must pass through here first.analyzer/β the deterministic engine.graph.pyowns edges, fan-in/out, roles, and the safe-to-edit logic. Touch with care; it's covered by tests.narrate.pyβ map (per-file) + reduce (project), with caching and a model-free fallback.story.pyβ the prompts.llm.pyβ the Modal/vLLM client.app.py+ui/β the Gradio UI.modal_app.pyβ the GPU backend.
Hard constraints β do not violate
- No
torch/vllm/transformersinrequirements.txt. The Space is a CPU container; the GPU lives on Modal (modal_app.py). The only exception is the ZeroGPU break-glass path, and only if you deliberately switch to it. - Model β€ 32B and it must be a MiniCPM (OpenBMB prize). Default is
openbmb/MiniCPM4.1-8B. Don't swap in a non-OpenBMB model as the core brain. - Don't claim the Tiny Titan badge (that needs all models β€4B; ours is ~8B).
- Keep the custom UI (
ui/styles.css) β it's the Off-Brand badge and a user requirement. Don't fall back to the default Gradio theme. - Secrets: never display or send code without
ingest.redact_secretshaving run. Don't weaken the secret patterns. - Tests stay green. If you change
analyzer/, updatetests/test_analyzer.pyand keeppython tests/test_analyzer.pyat 10/10 (or higher).
Style conventions (match the existing code)
from __future__ import annotations; PEP 604 unions (str | None); module docstrings that explain why, not just what.- Keep functions small and pure where you can; parsing/analysis code never calls the network or the model.
- Prefer extending the curated map in
analyzer/deps.pyover adding a model call.
What to work on
Only the next unchecked item in HANDOFF.md. Don't start post-MVP features until
steps 1β6 there are deployed. One feature per commit; write Codex-attributed
commit messages (the OpenAI Codex prize depends on them).