Inspiration
AI image workflows produce many useful visual directions, but the image often becomes separated from the prompt, model, task, and decisions that created it. A folder of PNG files is not creative memory. We built MOSA so every generated visual keeps both its origin and its next possible use.
What it does
MOSA is a local-first creative memory library for Codex and Cowart. While its local service is running, it watches Codex's standard generated-image directory and a project-scoped Cowart canvas directory. New images are archived automatically without requiring a manual upload step.
For Codex images, MOSA matches the output file to the corresponding local image_generation_end event and preserves the revised image prompt, Codex task ID, model, generation tool, original path, timestamp, dimensions, content hash, and prompt provenance. For Cowart, it synchronizes generated or edited canvas assets and records their canvas source. The web app then provides gallery browsing, search, source filters, editable metadata, complete prompt inspection, and provenance details.
MOSA also exposes MCP tools for creating, listing, retrieving, and updating assets. A saved visual can be retrieved with its recipe and inserted into Cowart with its MOSA source ID, preventing the bridge from archiving the same image twice.
How we built it
The project uses a small Node.js service, filesystem-backed records, a vanilla JavaScript web interface, and an MCP server. The Codex bridge reconciles filesystem events with local Codex session records; the Cowart bridge reconciles saved canvas snapshots with page assets. Same-filesystem Codex archives use hard links so the source and library paths remain available without duplicating image data, with a safe copy fallback across filesystems.
The repository includes tracked sample records, so judges can inspect the gallery, search, prompt details, and source metadata immediately after npm ci and npm start. No API key, test account, external database, or image credits are required. The current suite contains 24 automated tests covering archive reconciliation, prompt provenance, source-boundary security, concurrency, route behavior, accessibility contracts, background refresh behavior, and Cowart deduplication.
How we used Codex and GPT-5.6
MOSA was built through iterative Codex sessions using GPT-5.6 Terra. GPT-5.6 helped define the local-first product boundary, the provenance schema, the end-to-end creative loop, and the tradeoffs between automatic watching and explicit MCP actions. Codex implemented the Node service, MCP tools, web interface, Codex image bridge, Cowart bridge, hard-link migration, and focused regression tests.
The workflow was iterative rather than one-shot: Codex inspected real generated-image and session records, tested the bridges, identified missing model and revised-prompt provenance, hardened path handling and concurrent writes, preserved active edits during background refreshes, and updated the judging path based on those verification results. The dated Git history and README document this progression.
Challenges
The hardest part was preserving trustworthy provenance across asynchronous tools. A filesystem watcher can see a new image before its session record is complete, so MOSA needs polling and reconciliation rather than assuming one event contains every field. It also needs to distinguish a generated image from a library image inserted back into Cowart, or the same asset would be archived repeatedly.
Local-first behavior introduced additional engineering constraints: source paths must stay inside approved roots, symbolic-link escapes must be rejected, stale locks must recover without interrupting live writers, and background refreshes must not overwrite metadata while a user is editing it.
Accomplishments
- A real Codex generation task produced three images that MOSA matched to exactly three automatic archive records.
- Complete revised prompts and source metadata remain inspectable after generation.
- Codex and Cowart both feed one searchable library without requiring cloud storage.
- MCP retrieval and Cowart source IDs support reuse without duplicate records.
- Judges can test the included sample data without rebuilding integrations or using an OpenAI account.
What we learned
Creative provenance should be treated as product data, not incidental logging. The useful artifact is not only the final image; it is the relationship between the image, the prompt the model actually used, the task that produced it, and the decisions that followed.
What's next
Next steps include remote encrypted sync, richer prompt-version history, more creative-tool adapters, and a first-class "continue from this visual" action that can launch a new Codex or Cowart workflow directly from an archived record.
Built With
- codex
- cowart
- css
- gpt-5.6
- html
- javascript
- local-first
- model-context-protocol
- node.js
Log in or sign up for Devpost to join the conversation.