Disk Is the Contract: Inside Threlmark's Local-First Architecture

TL;DR

Threlmark uses a local-first approach where files on disk are the source of truth. This design makes the app fast, offline-capable, and fully portable, shifting complexity from network to sync and conflict resolution. It’s a blueprint for resilient, device-first tools.

Imagine a project management tool that works perfectly offline, syncs seamlessly across devices, and never loses your data—even if your internet drops out.

That’s what Threlmark’s local-first architecture delivers. Its secret? The disk on your device isn’t just storage; it’s the contract—the single source of truth that powers everything.

This approach flips how we think about apps, making them faster, more resilient, and genuinely portable. Let’s explore how Threlmark’s design creates this magic, and why it’s a game-changer for anyone building or using complex tools today.

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

Table of Contents

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
Information Technology Project Management (MindTap Course List)

Information Technology Project Management (MindTap Course List)

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
Free Fling File Transfer Software for Windows [PC Download]

Free Fling File Transfer Software for Windows [PC Download]

Intuitive interface of a conventional FTP client

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
2026 New Fuel Sync Gas Saver Device, Plug in Automotive Save More Instantly, Saver for Gasoline Lubricants Water Diesel, for Car & Truck Drive Farther (2Pcs)

2026 New Fuel Sync Gas Saver Device, Plug in Automotive Save More Instantly, Saver for Gasoline Lubricants Water Diesel, for Car & Truck Drive Farther (2Pcs)

【2026 New Fuel Sync Gas Saver】 – Instant Savings, More Miles: Plug in this advanced automotive device to…

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 your disk as the single source of truth by organizing data into individual JSON files; this simplifies synchronization, debugging, and tool integration.
  • Atomic file operations and read-merge-write patterns make local data safe and resilient against crashes and concurrent edits.
  • Self-healing board structures ensure your project roadmap remains accurate without manual intervention, even after deletions or inconsistencies.
  • Syncing is achieved through diffing and conflict resolution, enabling multi-device workflows without a central server.
  • This architecture enhances collaboration and AI integration, making complex workflows faster, more reliable, and offline-capable.

How Making Disk the Contract Boosts Speed and Reliability

Threlmark’s design treats your disk as the ultimate authority. When you open the app, it reads directly from local files—no network delay. Changes happen instantly, and you see the results in real time.

For instance, when you move a card in your roadmap, the change instantly reflects on your screen. No waiting for API responses or server syncs. This makes your workflow feel snappy and dependable, even when offline.

Plus, because the data lives on disk, you’re protected against server outages or internet issues. You keep working, unbothered by connectivity hiccups. This reliability is a core advantage of local-first design.

How Making Disk the Contract Boosts Speed and Reliability
How Making Disk the Contract Boosts Speed and Reliability

How Threlmark’s File Layout Turns Into a Developer’s Dream Tool

Threlmark organizes all data into simple JSON files stored on disk. Every card is a separate file in the items/ folder, making updates atomic and collision-free.

This setup means external tools can easily read or write specific cards without locking the whole project. Want to update a task? Just replace its file. Need to see all cards? List the items/ folder.

And because the file structure is a contract, any tool—whether a script or an app—can participate. It’s like having a common language that all tools speak, no matter what platform they’re on.

Step-by-Step: How Files Keep Data Safe and Consistent

  1. Atomic writes: Changes go into a temp file, then rename() replaces the original—avoiding corruption even if crashes happen mid-write.
  2. Read-merge-write: Updates read the current file, merge changes, and write back atomically, preserving data integrity and compatibility.
  3. Self-healing boards: The lane order in board.json is always reconciled against existing items, fixing inconsistencies on every read.

This disciplined process ensures that data remains consistent, even with multiple tools or agents editing the same files simultaneously.

Step-by-Step: How Files Keep Data Safe and Consistent
Step-by-Step: How Files Keep Data Safe and Consistent

Why One File per Item and Self-Healing Boards Matter

Instead of one big list, each task or card lives in its own file. This means no shared locks, no race conditions—just simple, collision-free updates.

The board.json file holds lane orderings, but it’s always checked against existing items. Missing cards are automatically detected and fixed. This self-healing keeps your roadmap accurate without manual fixes.

For example, if a card is deleted, it vanishes from the list, but the system remembers it’s gone and doesn’t cause errors. This approach makes the entire system more robust and easier to extend.

How Threlmark Syncs Changes Without a Server

Threlmark’s sync isn’t a traditional client-server model. Instead, it relies on detecting differences between local files and remote copies, then applying patches.

This could mean syncing via Dropbox, git, or custom tools—whatever keeps the files current across devices.

When you reconnect, the system compares current files to remote versions, then resolves conflicts intelligently. This way, changes propagate smoothly, even if edits happen offline on multiple devices.

For example, editing the same card on your laptop and phone can be merged based on timestamps and change history, avoiding overwrites or data loss.

How Threlmark Syncs Changes Without a Server
How Threlmark Syncs Changes Without a Server

The Main Benefits for Collaborative and AI-Driven Apps

Local-first, disk-as-the-contract systems like Threlmark shine when it comes to collaboration. Multiple users or devices work on the same data, merging changes without a hiccup.

This architecture also pairs well with AI agents. Since the data is stored in simple files, an AI can read, modify, and write updates directly—closing the loop without needing special APIs.

Imagine an AI assistant reviewing your roadmap, suggesting improvements, and marking tasks as done—all by editing the same files you use daily.

It’s a frictionless, resilient setup that adapts to the modern need for fast, multi-device, AI-assisted workflows.

Tradeoffs, Challenges, and When Not to Use It

While this design offers speed, resilience, and portability, it’s not a silver bullet. Sync conflicts can get complex, especially with many concurrent edits.

Handling large data sets or real-time collaboration at scale can become tricky without additional layers.

For example, if a team relies on high-frequency updates across dozens of devices, conflict resolution might need more than timestamps—version vectors or CRDTs could be necessary.

And, of course, this approach requires disciplined file management and a solid understanding of conflict handling.

Tradeoffs, Challenges, and When Not to Use It
Tradeoffs, Challenges, and When Not to Use It

The Growing Ecosystem and What’s Next

More developers are adopting local-first strategies, building tools that sync, manage state, and resolve conflicts seamlessly. The ecosystem is maturing, moving beyond simple prototypes to production-grade solutions.

Platforms like [Threlmark](https://threlmark.com) show what’s possible when you treat disk as the contract. Mainstream frameworks are beginning to document these patterns, making them accessible to more teams.

Research into hybrid local-remote coordination, like RDMA-based transactions, indicates a future where low-latency, conflict-free data sync becomes even more reliable and scalable [2][4].

Frequently Asked Questions

What does ‘disk is the contract’ mean in practice?

It means the app treats the files on your disk as the ultimate source of truth. All data is stored in simple JSON files, and the app reads and writes directly to these files, making the system transparent, portable, and resilient.

How does Threlmark keep data in sync across multiple devices?

Threlmark detects differences between local files and remote copies, then applies patches. It uses diffing and conflict resolution strategies—like timestamps—to merge changes seamlessly, even offline.

What happens if two devices edit the same card at the same time?

The system compares timestamps and change histories, merging updates intelligently. Conflicts are resolved based on rules, avoiding data loss and keeping your roadmap consistent.

Is this approach suitable for large-scale, real-time collaboration?

It works well for many cases, but conflicts and scale can become tricky. For very high-frequency updates or large datasets, additional conflict-handling mechanisms like CRDTs might be needed.

Can I integrate external tools or AI agents with this architecture?

Absolutely. Since all data lives in plain files, external tools or AI agents can read, modify, and write directly, closing the loop without APIs or servers.

Conclusion

Threlmark’s approach proves that the simplest idea—making disk the contract—can revolutionize how we manage, sync, and collaborate on projects. It’s a reminder that sometimes, the best architecture is the one that keeps things straightforward, transparent, and local.

Imagine a future where your tools are as resilient as your laptop, and your data flows seamlessly across devices—all without relying on a server. That’s the promise of local-first, disk-as-the-contract design. Are you ready to build or adopt systems that put your device first?

You May Also Like

The Compute-Centric Vision Behind Anthropic’s $965B Series H

Discover how Anthropic’s massive $65B raise signals a shift from valuation to infrastructure, emphasizing compute as the real asset in AI’s race to scale.

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst transforms idea development into a focused, collaborative war room—keeping your best ideas visible, organized, and ready to build.

Build vs Buy a Prebuilt AI Workstation

Deciding between building or buying your AI workstation? Discover the true costs, performance, and support factors that matter most today.