TL;DR

Threlmark builds on a simple idea: your data lives on disk as JSON files, making your app faster, more reliable, and easily portable. This approach shifts the server from being the primary source of truth to a sync and coordination layer, enabling seamless offline work and multi-device collaboration. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Imagine your app could work perfectly offline, instantly reflect changes, and sync seamlessly without a complicated backend. That’s the promise of Threlmark’s local-first, disk-based architecture. It’s a bold shift from traditional cloud-centric models, putting the disk front and center as the single source of truth.

In this deep dive, you’ll see how storing every piece of data as a simple JSON file on your disk changes everything—how it makes your app faster, safer, and more open. No database lock-in, no server dependencies, just a straightforward, elegant approach to managing complex workflows across devices. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Disk is the contract: inside Threlmark’s architecture — ThorstenMeyerAI.com
ThorstenMeyerAI.com
Threlmark · Technical Deep-Dive
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
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.

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
ORIGBELIE External CD DVD Drive with 4 USB Ports and 2 TF/SD Card Slots, USB 3.0 Portable CD/DVD Disk Drive Player Burner Reader Writer for Laptop Mac PC Windows 11/10/8/7 Linux OS with Carrying Case

ORIGBELIE External CD DVD Drive with 4 USB Ports and 2 TF/SD Card Slots, USB 3.0 Portable CD/DVD Disk Drive Player Burner Reader Writer for Laptop Mac PC Windows 11/10/8/7 Linux OS with Carrying Case

【External CD/DVD Drive for Laptop Macbook】Since most new laptops and desktop computers no longer come with built-in CD/DVD…

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
REXBETI 25Pcs Metal File Set, Premium Grade T12 Drop Forged Alloy Steel, Flat/Triangle/Half-round/Round Large File and 12pcs Needle Files with Carry Case, 6pcs Sandpaper, Brush, A Pair Working Gloves

REXBETI 25Pcs Metal File Set, Premium Grade T12 Drop Forged Alloy Steel, Flat/Triangle/Half-round/Round Large File and 12pcs Needle Files with Carry Case, 6pcs Sandpaper, Brush, A Pair Working Gloves

all the 16 pieces file are made by T12 Drop Forged Alloy Steel, the long lasting teeth were…

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
MOBILE OFFLINE-FIRST APPLICATION DESIGN: Local persistence sync strategies and resilient connectivity handling

MOBILE OFFLINE-FIRST APPLICATION DESIGN: Local persistence sync strategies and resilient connectivity handling

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

  • Storing each item as a JSON file on disk creates a simple, portable, and reliable source of truth.
  • Atomic file writes and tolerant merging prevent corruption and support smooth schema evolution.
  • The architecture enables offline work, instant UI updates, and effortless multi-device sync.
  • By making the disk the contract, you eliminate the complexity of server dependencies and lock-in.
  • This approach is ideal for apps prioritizing speed, collaboration, and data control.

What Does ‘Disk Is the Contract’ Actually Mean?

“Disk is the contract” means your app’s data lives directly on your disk in a structured, predictable format—specifically JSON files. This setup makes the disk the ultimate source of truth, not a database or cloud service. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

For example, when you update a task in Threlmark, it writes a JSON file in a specific folder. Every app, script, or AI tool that reads that folder sees the current state, no matter if you’re offline or online.

This approach simplifies the architecture, because if the files are consistent and correct, the app’s behavior is predictable. It also means you can back up, migrate, or sync your data easily by copying files.

What Does 'Disk Is the Contract' Actually Mean?
What Does ‘Disk Is the Contract’ Actually Mean?

How Threlmark Uses JSON Files to Keep Everything in Sync

Threlmark’s architecture revolves around one file per item, stored in the directory `items/`. Each JSON file represents a task, idea, or card, with all its details.

When you move a card, add a comment, or mark it done, the app updates just that one file. It uses atomic writes—saving to a temporary file then renaming—to prevent corruption.

Lane orderings and other metadata live in separate files, like `board.json`. These self-healing structures reconcile differences on each read, so the system stays consistent even if files get out of sync or are edited outside the app.

For example, if you manually edit a card’s JSON, the app recognizes the change next time it scans, updating the interface without losing data.

Why Going Local-First Beats Cloud-Only for Speed and Reliability

Threlmark’s local-first approach means your data is always accessible, even if your internet drops. The app updates instantly from local files, not waiting for server responses.

Imagine editing a task on a plane or in a remote cabin—your changes save immediately, no lag, no error messages. When you’re back online, it syncs silently in the background.

This model reduces network dependency, cuts down error states, and enhances performance because the app doesn’t chase server responses for every tiny update.

According to recent discussions on offline-first apps, this method boosts user experience by making work feel instant—without sacrificing eventual consistency.

Why Going Local-First Beats Cloud-Only for Speed and Reliability
Why Going Local-First Beats Cloud-Only for Speed and Reliability

How the Architecture Supports Collaboration and Multi-Device Work

With each device reading and writing JSON files locally, Threlmark supports multi-device workflows naturally. When you sync, it’s just copying files—no complex conflict resolution required.

Suppose you work on your laptop in the morning and your tablet in the evening. Changes made on one device appear on the other after sync, because both read the same files. Read more about local-first architecture

In case of conflicting edits—say, two devices change the same task offline—Threlmark can apply simple conflict resolution strategies, like last-write-wins or merge prompts, since all data is just files.

This flexibility enables real-time collaboration and asynchronous updates, similar to how Dropbox or Google Drive sync files, but with a focus on structured JSON data.

Comparison Table: Local-First JSON-on-Disk vs. Traditional Cloud Apps

FeatureThrelmark (Local-First JSON)
Data StorageJSON files on disk, per item
Sync MethodFile copying and conflict resolution
Offline AccessAlways available; no internet needed
Setup ComplexitySimple, no backend server
Data PortabilityHigh; just copy files
PerformanceImmediate updates from local disk
Conflict HandlingMerge or last-write-wins, manual fixes

Handling Schema Changes Without Breaking Everything

Schema changes are inevitable. Threlmark handles this gracefully by preserving unknown fields during reads and writes. This means older tools can still read newer files, and vice versa.

For example, if you add a new property to a task structure, older versions of the app will ignore it but won’t break. When you upgrade, the new property is read and preserved, ensuring smooth evolution.

This forward-compatibility is crucial for long-term projects, where data schemas evolve faster than the apps themselves.

Security, Data Integrity, and Recovery in a Disk-Backed System

Data integrity relies on atomic writes and careful file management. If a disk gets corrupted, simple file backups or version control restore the data.

For example, you can back up your `~/.threlmark` folder, restore from a previous state, or even use checksum verification during reads. These steps keep your data safe without complex recovery processes.

Because all data is plain JSON files, you can audit, edit, or recover data manually if needed—no proprietary database lock-in or recovery tools required.

Security, Data Integrity, and Recovery in a Disk-Backed System
Security, Data Integrity, and Recovery in a Disk-Backed System

Who Benefits Most From This Architecture?

This design shines in apps where speed, offline work, and collaboration matter. Think task managers, note apps, design tools, or any software supporting multi-device workflows.

For example, a small team working on a shared project can edit their tasks offline, then sync seamlessly. The app remains fast and reliable, even without a server connection.

It’s especially appealing to developers and power users who want control, portability, and simplicity in their tools.

Frequently Asked Questions

What does ‘disk is the contract’ really mean?

It means your data’s structure and state are stored directly on your disk as JSON files. These files define how your app behaves, making it simple, transparent, and portable.

How is this different from a traditional cloud app?

Unlike cloud apps that rely on a central server, a disk-based approach keeps data local, updates instantly, and syncs by copying files. This makes the app faster and more resilient offline.

How do conflicts get resolved when multiple devices edit offline?

Threlmark uses simple conflict resolution strategies like last-write-wins or manual merges, since all data is just files. This keeps things straightforward and predictable.

Is this architecture suitable for large-scale enterprise apps?

It’s best suited for small to medium apps where offline speed, data control, and simplicity matter most. Large enterprises might need additional layers for compliance and scale, but the core ideas still apply.

How do I handle schema changes without breaking my app?

Threlmark preserves unknown fields during reads and writes, so schema updates won’t break existing data or older tools. It’s a flexible, future-proof design.

Conclusion

Threlmark’s disk-as-the-contract approach flips traditional app architecture on its head. It proves that simplicity, transparency, and local control can power powerful, resilient tools.

Next time you build or choose a tool, ask yourself: what if the disk was the source of truth? The results might just surprise you—and make your system more flexible, reliable, and ready for the future.

You May Also Like

The Projector Mistakes First-Time Buyers Make

Choosing the wrong projector can ruin your home theater—discover the common mistakes first-time buyers often overlook to ensure a perfect setup.

Tech Myths Debunked: Don’t Fall for These Common Electronics Myths

Keen to avoid costly mistakes, discover which common electronics myths are false and learn the truth to keep your devices in top shape.

Buying Used Phones Safely: How to Secure a Second-Hand Smartphone

Looking to buy a used phone safely? Learn the essential tips to avoid scams and make a secure purchase today.

How to Shop for a Tablet Without Overbuying

Learning how to shop for a tablet without overbuying helps you focus on what truly matters and avoid costly mistakes.