A live causal graph for generative developer work. Edit an earlier assumption, regenerate the affected future, and preserve the original lineage for comparison.
RESONANCE transforms structured GPT-5.6 output into a living graph of causal nodes. A goal appears immediately, followed by streamed assumption, generation, and result nodes. Each node records its parents, branch, source context, timestamp, lineage hashes, and a bounded influence heuristic.
Select any completed node to inspect it or create a revision. A revision starts a new branch without overwriting history: affected descendants on the original branch become stale, the revised node becomes authoritative, and GPT-5.6 generates a new continuation through the OpenAI Responses API. Both futures remain visible and export together as portable JSON.
- Incremental structured generation on a zoomable React Flow canvas
- Fork-and-edit interaction that never mutates the original branch
- Branch-restricted causal regeneration from authoritative lineage
- Original and revised outcomes visible side by side
- Deterministic SHA-256 node lineage and graph-integrity hashes
- Explainable influence heuristic bounded from 0 to 1
- Local persistence, reload restoration, reset, and retry
- Validated one-click JSON export
- Responsive desktop and mobile layouts
- Open the public demo.
- Select the suggested goal: Design an authentication system for a developer platform.
- Wait for the root and three generated nodes to complete.
- Select the early email/password assumption and choose Fork this node.
- Replace its content with: Use passkeys only, with no passwords.
- Create the revised branch.
- Compare the stale original continuation with the active WebAuthn-oriented branch.
- Select nodes to inspect their source, parent, branch, lineage, and influence metadata.
- Choose Export Resonance Graph and inspect the downloaded JSON.
The public demo requires no user account. It has been exercised in Chrome, desktop Safari, and mobile Safari. Other modern browsers use standard React and Web APIs but have not all been manually verified for the submission.
The product calls GPT-5.6 through the OpenAI Responses API from a server-only Next.js route. The provider stream is normalized into application-owned Server-Sent Events; raw provider events and credentials never reach the browser. A small stateful client parser safely recognizes complete objects even when JSON keys, escaped strings, or node boundaries span chunks.
For regeneration, RESONANCE sends the goal, the selected node's ancestors, and the revised node as authoritative context. Stale descendants are excluded from that lineage and supplied only as replacement context. This makes the new output a continuation of the revision instead of a disconnected chat response.
Codex was used as the development agent to scope the product, define acceptance criteria, design the graph and streaming protocols, implement the application, write tests, diagnose deployment issues, and refine the desktop and mobile experience.
| Layer | Implementation |
|---|---|
| Application | Next.js App Router, React, TypeScript, Tailwind CSS |
| Graph canvas | React Flow (@xyflow/react) |
| Client state | Zustand |
| Generation | OpenAI Responses API with configurable OPENAI_MODEL |
| Validation | Zod request, graph, and export schemas |
| Graph engine | TypeScript descendant traversal, branching, lineage, and weights |
| Integrity | Web Crypto SHA-256 |
| Persistence | Browser localStorage |
| Deployment | Cloudflare Workers through the OpenNext adapter and Wrangler |
app/ Next.js routes, layout, and global styles
components/ Canvas, inspector, and session UI
core/ Graph traversal, lineage, influence, import, and export logic
lib/ IDs, OpenAI client, prompts, events, and stream parser
schemas/ Zod validation schemas
store/ Zustand graph and generation lifecycle
types/ Shared graph and stream-event types
tests/ Hashing, influence, export, and resilience tests
public/ Static submission assets
Requirements: Node.js 20.9 or newer and npm 10 or newer.
git clone https://github.com/JROChub/RESONANCE.git
cd RESONANCE
npm install
cp .env.example .env.local
npm run devConfigure these server-only values in .env.local:
OPENAI_API_KEY=your_api_key
OPENAI_MODEL=gpt-5.6Open http://localhost:3000. Never prefix either secret with NEXT_PUBLIC_ or commit .env.local.
npm run lint
npm run typecheck
npm test
npm run buildThe automated suite covers deterministic and content-sensitive hashing, branch-lineage divergence, influence bounds, export integrity, and partial-stream/retry resilience. The causal generation demonstration requires a valid OpenAI API key and a model enabled for that API project.
Authenticate Wrangler and set production secrets:
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put OPENAI_MODEL
npm run deployUse npm run preview to exercise the production Worker runtime locally. After deployment, verify streaming, fork regeneration, export, reload restoration, and Reset Demo in a fresh browser session.
- Generated nodes are concise semantic artifacts, not access to hidden model chain-of-thought.
- Influence weights are structural heuristics, not proof of causality or model internals.
- Persistence is local to one browser and device; collaboration is not implemented.
- Export is supported; interactive import is not exposed in the demo UI.
- Long graphs do not yet have automatic subtree collapsing or graph merging.
- API availability, latency, and usage limits depend on the configured OpenAI project.
No open-source license has been assigned yet. Until a license is added, the source remains protected by default copyright rules. A license should be selected before presenting the repository as reusable open-source software.
