TL;DR

Threlmark treats the disk as the source of truth, storing data in JSON files that are easy to inspect, back up, and sync. This local-first approach boosts resilience and flexibility, especially in offline scenarios.

Imagine managing your project roadmap without a centralized server or a cloud database. Just files. Plain, simple JSON files on your disk. That’s the magic behind Threlmark’s architecture. It might sound old-school, but it’s a bold move in a world obsessed with SaaS and live sync. Why? Because this approach turns your disk into the single source of truth, making everything more portable, resilient, and transparent.

In this deep dive, you’ll see how this design choice cascades into everything — from how data is stored, to how external tools participate, to how AI agents can move work forward without complex infrastructure. Ready to see how disk becomes the contract instead of just storage? Let’s go.

Disk is the contract: inside Threlmark’s architecture — ThorstenMeyerAI.com
ThorstenMeyerAI.com
Threlmark · Technical Deep-Dive
Threlmark · architecture

Disk is the contract: inside a local-first roadmap hub

A Next.js app on top of plain JSON files — no database, no cloud, no accounts. The key decision: the on-disk layout IS the API. Everything else cascades from taking that seriously.

Next.js · TypeScript · JSON-on-disk · MIT · part 2 of the Threlmark series
01The core decision

There is no server-of-record — the files are the record

The UI and any external tool reach the same files through the same discipline. The data root defaults to ~/.threlmark — home-based, because it’s a shared hub every one of your apps points at.

~/.threlmark/ ├─ threlmark.json # manifest ├─ links.json # dependency graph ├─ projects// │ ├─ project.json # meta + wipLimits │ ├─ board.json # lane ordering │ ├─ items/.json # ONE card per file ← source of truth │ ├─ suggestions/ # the Inbox (drop-zone) │ ├─ handoffs/ # recorded agent handoffs │ ├─ reports/ # agent report drop-zone │ └─ ROADMAP.md # human-readable mirror ├─ shared/items/ # cards many projects ref └─ archive/ # archived, still readable

Inspectable

Every artifact is a file you can cat, diff, grep, commit.

Portable · no lock-in

Back up with cp, sync with Dropbox / git, migrate trivially.

Interoperable

Any tool in any language joins by reading / writing files.

Restartable

No in-memory state to lose — stateless over the files.

02Making files safe
Amazon

JSON file management tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Two disciplined patterns instead of a database

“Just use files” is easy to get wrong. These two patterns — ported from a battle-tested sibling app — are what make file-based state sound rather than reckless.

Pattern 1

Atomic writes

Write to a temp file in the same dir, then rename() over the target. Rename is atomic on one filesystem — a crash mid-write leaves the complete old file or the complete new one, never a half.

write .tmp-pid-rand fsync rename() over target
Pattern 2 · one file per item

The board heals itself

A single roadmap.json array races when two tools write at once. One file per card makes writes collision-free. Lane order lives in board.json and reconciles on read.

The payoff: an external tool never touches board.json. It writes an item file — the board fixes itself on Threlmark’s next read. Unknown keys are preserved, so the contract is forward-compatible.
03Derived, never stored
Amazon

offline-first data storage solutions

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

The numbers can’t drift from the files

Anything computable from item state is computed — so the displayed numbers can never disagree with the underlying JSON. Priority is the clearest example: it’s calculated on read, never persisted.

priority — computed on read

Impact weighted heaviest; effort the only axis that subtracts. Reused verbatim from the original tool, so imported cards rank identically.

priority = max(0, round(impact·3 + evidence·2 + fit·2effort·1.5))
a 5 / 5 / 5 / 4 card 29
work-item age
now − lane-entry time. Past threshold (dev 7d, ranked 21d, idea 60d) → stale.
cycle time
first DevelopmentDone. Derived from append-only transitions[].
throughput
items reaching Done per ISO week, 8-week window.
WIP
count per lane; over the cap shows 3 / 2 in red.
04The closed agent loop · press play
Amazon

local JSON database software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

A handoff is a first-class flow event

The genuinely 2026-shaped part: most building is done by AI agents, so Threlmark closes the loop. Watch a card go from ranked to Done without anyone dragging it.

Handoff → report → self-move

The brief carries a reporting protocol. The agent reports through REST or the filesystem — and a done report moves the card itself.

Ranked
Add price-drop alertsscore 31 · ready
Development
Handed off 🤖
Done
▶ preferred — REST
POST /api/projects/:id/
items/:itemId/report

Direct call. Applied immediately.

▶ fallback — filesystem
drop reports/.json
→ ingested on read

Robust even if the server’s down at finish time.

🤖 claude done: price-drop alerts shipped · typecheck + lint + build passed — card moved to Done
05Portfolio score & deployment
Amazon

file-based project management tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

A small formula, and an honest hosting caveat

Because items are globally addressable (/), the Portfolio ranks everything together by a status-weighted score — finishing beats starting, blockers get a boost.

Portfolio ranking — status-weighted

In-flight work floats to the top; bottlenecks cost the most, so blockers get nudged up.

score = priority · statusWeight (+ 0.1 · blockedCount · priority)
1.3
development
1.0
ranked
0.85
idea
0.15
done
Path 1

Static read-only demo

Seeded data, writes to localStorage. Try-before-you-clone.

Path 2

Personal Node instance

Password-gated, persistent backed-up THRELMARK_DATA_DIR.

Path 3

Multi-tenant SaaS

Add accounts + per-tenant isolation. A separate build.

The elegant part: the store interface src/lib/*/store.ts is the natural seam — the same boundary that keeps the local tool simple is the one you’d extend for multi-tenancy. The architecture doesn’t fight that future; it just doesn’t pay for it until you need it.
ThorstenMeyerAI.com
Threlmark · open source (MIT) · github.com/MeyerThorsten/threlmark · part 2 of a series · file layout, formula, weights & agent-loop channels are Threlmark’s actual mechanics.

Key Takeaways

  • The on-disk layout in Threlmark acts as a transparent, portable API, making data inspection and migration straightforward.
  • Atomic file writes prevent data corruption during crashes, ensuring safety and consistency.
  • One file per item reduces conflicts and simplifies concurrent updates, with the system self-healing on read.
  • Folder structure is an open contract, allowing external tools and AI agents to participate without API barriers.
  • Local-first architecture boosts offline resilience, reduces latency, and simplifies development and debugging.

How Threlmark’s Disk-First Design Turns Files Into a Single Source of Truth

Threlmark’s core idea is simple but powerful: the data on your disk isn’t just storage — it’s the API. Every file reflects the current state, every change is an atomic write, and no external server is needed to keep things consistent. For more details, see this explanation of Threlmark’s design. For example, each project has its own folder with a project.json for metadata and an items/ folder with individual JSON files for each task or card.

This setup makes it easy to see exactly what’s happening just by inspecting the files. Want to back up your roadmap? Just copy the folder. Need to migrate to a new tool? Read and write the JSON files. It’s transparency in action.

How Threlmark’s Disk-First Design Turns Files Into a Single Source of Truth
How Threlmark’s Disk-First Design Turns Files Into a Single Source of Truth

Why This Approach Is More Than Just Files — It’s a Resilient, Offline-First Powerhouse

When your data lives on disk, you gain immediate offline capabilities. No internet? No problem. You keep working, and your files stay in sync. Learn more about biodiversity and sustainable practices. If your device crashes or loses connection, your project doesn’t stop — just open the files, edit, and later sync.

This approach isn’t just about convenience. It’s about resilience. If your cloud service goes down, your work continues. When you want to switch devices, just copy the folder, and everything’s right there. According to recent research, local-first models like Threlmark’s dramatically improve user experience during outages and reduce latency.

Atomic Writes and File-Based State: How Threlmark Keeps Data Safe and Consistent

Imagine saving a document. You’d want it to save completely or not at all. Threlmark achieves this with atomic writes — writing to a temp file, then renaming it. This method prevents corruption if a crash occurs mid-save. For example, when updating a task, the app writes a new JSON file in a temp, then replaces the old.

This pattern ensures your data remains consistent, even if your system crashes. It’s a simple trick with huge benefits, making the file system itself a reliable database.

Atomic Writes and File-Based State: How Threlmark Keeps Data Safe and Consistent
Atomic Writes and File-Based State: How Threlmark Keeps Data Safe and Consistent

One File Per Item: How Threlmark Handles Concurrency Without Locks

Managing multiple updates without conflicts is tricky. Threlmark solves this by giving each task or card its own JSON file. If two tools update different cards simultaneously, no problem — they write their own files independently. To see how this architecture supports collaboration, visit this detailed overview.

Even better, the system self-heals. Every time you open the board, it checks the actual items folder, removes missing cards, and updates the lane order accordingly. For example, if a card is deleted, it disappears from the board automatically.

How the Folder Structure Supports Collaboration and External Tools

Threlmark’s folder layout isn’t just for the app — it’s an open contract. External tools can read or write JSON files directly, adding suggestions, reports, or handoffs. For instance, an AI agent can drop a completed task into reports/ or move a card to done/ without any special API.

This openness means your project can integrate with other systems easily, using simple file access. No proprietary API lock-in, just plain files that anyone can handle.

How the Folder Structure Supports Collaboration and External Tools
How the Folder Structure Supports Collaboration and External Tools

Sync, Conflict, and Merge: How Threlmark Keeps Everything in Harmony

Syncing changes across devices is straightforward when each file is a small, atomic piece. When two devices modify different cards, their changes won’t conflict. For more on conflict resolution, see this article.

For example, if two editors update the same task on different devices, the latest timestamp determines which change sticks. This approach favors eventual consistency and simplicity over complex conflict resolution.

Developer Benefits: How This Architecture Simplifies Building and Extending the App

Developers love this setup because it’s predictable and simple. No complex database layer, no API contracts, just read and write files. Want to learn more about building disk-based apps? Visit this resource.

Plus, debugging becomes a breeze. You can open any JSON file, see exactly what’s stored, and understand the app’s state instantly. This transparency speeds up development and troubleshooting.

Developer Benefits: How This Architecture Simplifies Building and Extending the App
Developer Benefits: How This Architecture Simplifies Building and Extending the App

What Does All This Mean for You? Practical Tips for Building Your Own Disk-Based App

  • Use atomic write patterns to prevent corruption.
  • Store each item as a separate file for concurrency and simplicity.
  • Design your folder layout as a contract — predictable and open.
  • Implement simple merge policies for conflict resolution.
  • Keep your data inspectable and portable for easy backup and migration.

Frequently Asked Questions

What does “disk is the contract” really mean?

It means the data stored on disk is the definitive source of truth. The app’s structure, state, and data are all represented directly in files, making everything transparent, portable, and easy to inspect.

How does Threlmark handle conflicts when two devices edit the same task?

Threlmark uses timestamps to determine the latest change. When conflicts occur, the most recent update overwrites the older one. This simple merge policy favors eventual consistency and keeps things moving smoothly.

Is Threlmark fully offline-capable?

Yes. Since all data lives in JSON files on your disk, you can work without any internet connection. Syncs happen later when devices reconnect, making the system resilient during outages.

How easy is it to back up or migrate my data?

Very easy. Just copy the entire data folder. Since everything is stored in plain JSON files, you can back up, sync, or migrate your data with simple file operations.

Can external tools or AI agents participate in the workflow?

Absolutely. The folder structure is an open contract, so external tools can read, write, or drop files into specific zones, enabling seamless integration without complex APIs.

Conclusion

Turning the disk into the contract isn’t just a clever trick; it’s a mindset shift that makes your app more resilient, transparent, and flexible. It’s a reminder that sometimes, the simplest tools — plain files, atomic writes, clear structure — build the most powerful systems.

What if your next project started with the assumption that the disk is the source of truth? The results might surprise you. Maybe it’s time to treat your data like a living, breathing document — one that you can see, edit, and trust simply by opening a file.

You May Also Like

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst transforms idea validation with a portable, AI-powered war room—keeping your most valuable concepts safe and sharp on your own machine.

Acoustic Dampening, Placement, and the “Rig in the Closet” Setup

Discover how to optimize your closet setup for better sound, reduce noise, and keep your rig cool. Practical tips for placement, treatment, and airflow.

Build vs Buy a Prebuilt AI Workstation

Deciding between building or buying an AI workstation? Discover the real costs, benefits, and when each option makes sense in 2026. Make smarter choices now.

Anthropic’s Series H: A Commitment to Leading in AI Compute

Discover why Anthropic’s $65B raise signals more than growth — it’s a massive bet on compute infrastructure shaping AI’s future. Learn what’s really behind the numbers.