TL;DR

Threlmark’s approach centers on disk as the authoritative source, making apps faster, more reliable, and offline-capable. This design simplifies sync and enhances data durability, changing how we build multi-device tools.

Imagine a project management tool that works perfectly offline, updates instantly, and never loses your work — even if your internet drops out. That’s the power of a local-first architecture, where your disk isn’t just a storage space, but the contract that defines how your data lives and breathes.

In this article, you’ll see how Threlmark’s simple yet radical decision — making disk the source of truth — shifts every aspect of system design. It’s a pattern that boosts reliability, speeds up workflows, and lets you collaborate across devices without fuss. Ready to see what’s possible when your data lives directly on your disk? Let’s dive in.

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
SANDISK 1TB Extreme Portable SSD (Old Model) - Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware - External Solid State Drive - SDSSDE61-1T00-G25

SANDISK 1TB Extreme Portable SSD (Old Model) – Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware – External Solid State Drive – SDSSDE61-1T00-G25

Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity…

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
MixPad Multitrack Recording Software for Sound Mixing and Music Production Free [Mac Download]

MixPad Multitrack Recording Software for Sound Mixing and Music Production Free [Mac Download]

Mix an audio, music and voice tracks

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
NUOBESTY 4pcs Pottery Ceramic Spinner Clay Pottery Wheel Aluminum Throwing Trimming Tool Rotary Disc Wheel

NUOBESTY 4pcs Pottery Ceramic Spinner Clay Pottery Wheel Aluminum Throwing Trimming Tool Rotary Disc Wheel

Precision aluminum alloy structure: ensures smooth rotation and enhances the accuracy of your pottery creations, making it ideal…

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
eufy Security eufyCam S330 (eufyCam 3) 4-Cam Kit, Security Camera Outdoor Wireless, 4K with Integrated Solar Panel, Face Recognition AI, Expandable Local Storage, Spotlight, No Monthly Fee

eufy Security eufyCam S330 (eufyCam 3) 4-Cam Kit, Security Camera Outdoor Wireless, 4K with Integrated Solar Panel, Face Recognition AI, Expandable Local Storage, Spotlight, No Monthly Fee

Crystal-Clear Night Surveillance: Achieve superior night vision with the eufy 4k camera's Starlight system, delivering 4K quality and…

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

  • Treat disk as the single, authoritative source of truth to simplify data management and improve reliability.
  • Use a file-per-item approach to prevent race conditions and enable seamless concurrency.
  • Atomic file writes and tolerant merging protect data integrity and support forward compatibility.
  • Local-first design boosts app speed, offline resilience, and user trust by minimizing network dependence.
  • Sync and conflict resolution become straightforward when data lives directly on disk, not in a remote database.

Why Making Disk the Contract Changes Everything

In most apps, data lives in the cloud or in a database — a separate, often remote, system. Threlmark flips that script. It treats disk as the single source of truth, meaning your files are the real record. This approach makes your app more resilient, faster, and easier to work with offline.

Take a typical project tool. When it relies on a server, you’re waiting for network responses. But with Threlmark, you just read or write a file. No waiting, no errors if offline. It’s instant. Plus, because everything is just files, other tools can join in — no lock-in, no complicated integrations.

For example, when you update a task, it’s just a file change. The system automatically handles conflicts by merging changes or alerting you. This simple design impacts everything from concurrency to collaboration.

Why Making Disk the Contract Changes Everything
Why Making Disk the Contract Changes Everything

How Threlmark’s File Layout Acts Like a Contract

Threlmark’s file structure isn’t a random folder full of JSON files. It’s a carefully designed contract that anyone can follow. The root contains a manifest and dependency graph, then each project has its own folder with metadata, lane order, and one file per card. External suggestions or AI reports go into dedicated folders.

Here’s why this matters:

Property What It Means
Inspectability Every file can be `cat`ed or `diff`ed, making it transparent and easy to debug.
Portability Copy or sync the folder anywhere. No vendor lock-in or complex migration.
Interoperability Any tool can join by reading or writing files, regardless of language or platform.
Restartability Because the state lives on disk, the app can restart at any time without losing data.

For example, if you copy your `~/.threlmark` folder to another machine, your entire project state comes with it. No database, no special setup. It’s a simple, robust contract.

Making File-Based State Safe and Reliable

Using files as the primary data store sounds risky — but Threlmark makes it safe with two patterns: atomic writes and tolerant merging. Atomic writes mean you write to a temp file, then rename it. This prevents partial updates, even if your system crashes mid-write. It’s like changing a page in a book only after the entire page is ready.

For example, updating a task involves writing a new JSON file in a temporary location, then moving it over the old one. The process is quick and atomic, so data never gets corrupted.

The second pattern, read-merge-write, helps keep data consistent. When updating, Threlmark reads the current file, merges in new info, preserves timestamps and IDs, and writes back. It also ignores unknown fields, so tools can evolve without breaking existing files.

Making File-Based State Safe and Reliable
Making File-Based State Safe and Reliable

Why One File Per Item Beats a Big JSON Array

Instead of storing all tasks in one huge `roadmap.json`, Threlmark uses a separate file for each item. This makes concurrent updates safe and simple. No more race conditions or clobbering each other’s changes. Learn more about how this pattern scales.

Suppose two devices update different tasks at the same time. With one file per item, they both write their changes independently. When the system reads the files, it reconciles the current state, avoiding conflicts. This pattern scales well, especially as projects grow.

Plus, the system self-heals: if a task disappears from the main list but still exists as a file, it can be re-integrated seamlessly.

How Threlmark Supports Multi-Device Collaboration

Threlmark’s local-first design makes it easy to sync across devices. Because the core data lives on disk, just copying the folder or using sync tools like Dropbox or Syncthing keeps everything in sync. This approach simplifies multi-device collaboration.

Imagine working on your laptop at home, then opening your tablet at a coffee shop. The files are the same, instantly. When you make a change on one device, the other sees it almost immediately after sync.

And if two devices edit the same task differently? Threlmark’s merge logic detects conflicts and prompts you to resolve them, preventing data loss and chaos.

How Threlmark Supports Multi-Device Collaboration
How Threlmark Supports Multi-Device Collaboration

Real-World Benefits: Speed, Offline, and Trust

With Threlmark, your workflow accelerates. No waiting for server responses. You see updates instantly because they’re just files on disk. Plus, you can work offline without losing any functionality. Discover more about reliable offline workflows.

For example, a designer sketching ideas on a plane can keep adding tasks or moving cards. When back online, just sync — no data loss or surprises.

This approach also builds trust. Your data isn’t stored in some cloud where you depend on a third party. It’s on your disk, safe and under your control. You can back it up, move it, or share it with confidence.

The Tradeoffs and Challenges to Consider

Of course, this isn’t perfect. Managing conflicts and ensuring sync accuracy can get tricky, especially with multiple devices. Handling corruption or disk failures requires backups and recovery plans.

For example, if your disk gets corrupted, restoring from backups or version control is essential. And conflicts may need manual resolution, which can slow down workflows.

Deciding whether disk as the contract fits your project depends on your needs for collaboration, scale, and reliability. But the benefits in speed and offline capability make it worth considering.

Frequently Asked Questions

What does ‘disk is the contract’ really mean?

It means your app treats local disk storage as the primary source of truth, with all data stored in files that are read, written, and merged directly. This makes the system more resilient, offline-capable, and simple to reason about.

How does Threlmark handle conflicts when multiple devices edit the same data?

Threlmark uses a read-merge-write cycle and conflict detection. When conflicts happen, it prompts you to resolve them, ensuring no data is lost or overwritten unexpectedly.

Can this architecture work with large projects or teams?

Yes, but you’ll want to implement additional syncing and conflict-resolution strategies. The file-per-item approach scales well, and tools like Dropbox or Syncthing help keep data consistent across devices.

What are the main challenges with a disk-as-contract system?

Managing sync conflicts, handling disk corruption, and ensuring reliable backups can be tricky. Planning for these issues is vital to keep data safe and workflows smooth.

Is local-first just for personal projects or also for team collaboration?

It’s suitable for both. When combined with proper sync tools, local-first apps support multi-device collaboration without relying on a central server, making teamwork faster and more reliable.

Conclusion

Choosing to make disk the contract transforms the way you build and think about apps. It’s about trusting your local device to hold the real data, making everything faster, safer, and more flexible.

When you see your data as files, you realize that simplicity and resilience go hand in hand. That small shift unlocks powerful new workflows and collaboration models. So, ask yourself: what if your app’s true contract was just a file? The results might surprise you.

The Tradeoffs and Challenges to Consider
The Tradeoffs and Challenges to Consider
You May Also Like

Build vs Buy a Prebuilt AI Workstation

Decide whether to build or buy your AI workstation with this clear, practical guide. Learn the real costs, performance, and support factors shaping 2026.

Anthropic’s $965B Series H: Paving the Way for Next-Gen AI Compute

Anthropic’s $65B Series H at a $965B valuation signals more than hype — it’s a massive infrastructure bet on AI’s compute future. Discover what’s really behind the numbers.

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst transforms idea validation into a focused, collaborative digital war room—grounded in research, disagreement, and ownership. Perfect for founders.

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

Learn how to turn your closet into a quiet, effective voice or vocal booth. Discover placement, dampening tricks, and the truth about soundproofing your rig.