TL;DR

Threlmark’s architecture centers on the idea that the on-disk state is the true record. This design makes apps more resilient, faster, and easier to debug by using JSON files as the core data layer, without relying on servers or databases.

Imagine an app where your project data isn’t stored in some distant cloud or locked behind a database. Instead, it lives right on your disk, in plain JSON files. That’s the core idea behind Threlmark’s architecture — a system that treats the disk as the single source of truth. It’s a radical shift that makes the app blazing fast, resilient offline, and surprisingly simple to work with. Disk is the contract.

In this deep dive, you’ll see how this ‘disk is the contract’ approach shapes everything — from data consistency to collaboration, to how external tools can plug in without special permissions. If you’ve ever wondered how to build a local-first app that’s both flexible and robust, stick around.

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
Music Studio 11 - Music software to edit, convert and mix audio files - Eight music programs in one for Windows 11, 10

Music Studio 11 – Music software to edit, convert and mix audio files – Eight music programs in one for Windows 11, 10

Music software to edit, convert and mix audio files

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
SUUNTO Nautic S Dive Watch Computer w/Bright AMOLED Display, GPS, Offline Maps and Weather Tools, Wireless Tank Pressure, Up to 60H on a Single Charge

SUUNTO Nautic S Dive Watch Computer w/Bright AMOLED Display, GPS, Offline Maps and Weather Tools, Wireless Tank Pressure, Up to 60H on a Single Charge

Bright AMOLED Display for Superior Readability-Enjoy crystal-clear visibility underwater with a bright AMOLED screen, designed for easy reading…

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
Real-World Android App Projects with Kotlin and Jetpack Compose: Build Production-Style Android Apps with Modern Architecture, API Integration, State Management, Local Data Storage, Practical Projects

Real-World Android App Projects with Kotlin and Jetpack Compose: Build Production-Style Android Apps with Modern Architecture, API Integration, State Management, Local Data Storage, Practical Projects

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 ultimate authority—store your data in JSON files directly on disk.
  • Atomic file operations prevent corruption and make concurrent updates safe.
  • Design for offline use: local reads/writes keep your app fast, even without network.
  • External tools can participate in sync by just reading and writing files, simplifying conflict resolution.
  • Debugging becomes a breeze when data is stored in human-readable JSON files.

What Does ‘Disk Is the Contract’ Actually Mean?

‘Disk is the contract’ means the app’s true state lives on your hard drive in a set of JSON files. These files are the final word — not a database, not a server, not some in-memory cache. When you open Threlmark, it reads these files, and when you make changes, it writes directly to them. Think of the disk as the ledger everyone agrees on.

For example, imagine you’re working on a project management app. Instead of sending changes to a remote server, you update a JSON file like tasks.json directly on your disk. Later, if you open the app again, it reads that same file to reconstruct your task list. If you edit a task on your laptop and then open the app on your phone, both devices read and write to these same files, ensuring everyone has a consistent view. This approach is like maintaining a shared notebook where all edits are written directly on paper — simple, transparent, and always the source of truth.

Why does this matter? Because it shifts the entire paradigm of data management. Instead of relying on complex synchronization protocols or server-dependent transactions, the system depends on the integrity of these files. If you understand that the disk is the ultimate authority, you realize that every change is immediately persistent and recoverable. This simplifies debugging, backups, and data recovery — because you can always inspect or revert to a specific JSON snapshot. However, it also means that the app must handle file consistency and conflict resolution carefully, especially when multiple sources modify files simultaneously. The tradeoff is between simplicity and potential complexity in managing concurrent edits, but for many use cases, this approach offers a powerful balance of transparency and control.

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

How Threlmark’s Architecture Differs From Traditional Apps

Most apps rely on a central server to hold all the data. You send requests, and the server responds. Threlmark flips this on its head. It doesn’t have a server — the disk is the single source of truth. The app reads and writes files directly, just like editing a set of documents on your desktop.

For instance, imagine you’re collaborating on a to-do list. Instead of syncing with a cloud server, you and your teammates work on JSON files stored in a shared folder. When one person updates tasks.json, the change is immediately on disk. The next person opening the app on their device reads the latest file. When offline, everyone continues editing independently, and when back online, the files can be merged effortlessly by comparing the JSON contents. Think of it like everyone maintaining their own copy of a paper notebook, then later stacking the notebooks to see what’s changed — simple, transparent, and resilient. Disk is the contract.

This architecture emphasizes local control and reduces complexity, making the app resilient even offline, with sync happening later when network is available. Disk is the contract.

Why is this significant? Because it removes many layers of potential failure inherent in client-server models. The app’s resilience depends on the integrity of local files, which are easier to back up, inspect, and modify. This approach also means developers can focus on local workflows, confident that the core data is always accessible and modifiable without the need for constant server communication. The tradeoff is that this model may struggle with complex data relationships or large datasets, where file-based storage can become slow or unwieldy. But for many applications, especially personal or small-team tools, this tradeoff favors simplicity and robustness over complexity.

Why JSON Files on Disk Beat a Database for This Use Case

JSON files are human-readable, easy to inspect, and simple to back up. For example, imagine you’re managing a project with tasks stored in tasks.json. You can open this file directly in a text editor to see all your tasks listed clearly, or run a command-line diff like diff tasks.json previous_tasks.json to see exactly what changed between versions. Disk is the contract. This is akin to having a live, readable log of your project’s history, making troubleshooting straightforward.

Think of it like maintaining a paper ledger for your finances; you can always open the ledger and see every transaction. Similarly, with JSON files, you can manually review or revert changes if needed. This transparency builds trust because you always know what data the app is working with, reducing surprises or hidden errors. It also simplifies integrating external tools—like version control systems—since they can directly manipulate these files without complex APIs. For example, you could use Git to track changes to your project files, making collaboration and rollback simple. The tradeoff? For very large or complex datasets, JSON files may slow down parsing or updating. But for small to medium projects, this approach offers unmatched clarity and control—like having a physical notebook versus a complex database system.

Why JSON Files on Disk Beat a Database for This Use Case
Why JSON Files on Disk Beat a Database for This Use Case

How Offline Resilience and Sync Work in Practice

Threlmark’s design shines when offline. Picture working on your project during a flight. You add new tasks, update existing ones, or rearrange priorities—all directly saved into JSON files stored locally on your device. When you land and reconnect Wi-Fi, the app automatically compares your local files with those on other devices or cloud storage, merging changes seamlessly.

For example, suppose you’re updating your task list on your laptop while traveling. You add a new task, and later, on your tablet, you make another update. When both devices go online, the system compares tasks.json from each device. If both have a new task with the same ID, the app can ask you which to keep or merge details. If one device has a newer version, it overwrites the older. Think of it like two people editing different pages of a shared notebook—when both return and compare, they can see what changed and decide how to combine their notes. This process keeps your workflow fast and reliable, even with spotty internet, because all changes are just file updates. The key is that the system relies on the simplicity of file-based storage: as long as changes are atomic and conflicts are managed carefully, the app remains consistent and predictable, much like maintaining a shared paper journal that everyone updates and reviews at their own pace.

How Sync and Conflict Resolution Actually Happen

Syncing in Threlmark involves comparing JSON files from different devices. Imagine two team members working on separate copies of a project plan stored as project.json. When they reconnect, the system detects differences—say, one added a new task, while the other updated a deadline. The app then applies simple rules: the newer change overwrites the older, or external tools can merge the updates. For example, a tool like IdeaClyst might read both files, analyze the differences, and generate a merged version that combines the best of both edits.

Think of it like two people editing separate drafts of a document. When they compare the drafts, they see what’s changed. If one has a new paragraph and the other fixed a typo, merging involves choosing the latest version of each part. This process is straightforward when changes are isolated—like editing different sections of a shared notebook—but can get complicated if many edits happen simultaneously. The key is that conflicts are resolved transparently, either by simple rules or external tools, giving users control and visibility. It’s akin to manually reviewing two versions of a document to decide what to keep, rather than relying on opaque database merges. This approach favors simplicity and user control, which works well for small teams or offline scenarios, but might need more sophisticated solutions for large, real-time collaborative environments.

How Sync and Conflict Resolution Actually Happen
How Sync and Conflict Resolution Actually Happen

Making Development and Debugging Simpler with Files

With the disk as the source of truth, debugging becomes easier. For example, if you’re troubleshooting why a task isn’t displaying correctly, you can open tasks.json directly in your editor to see exactly what data is stored. You might find a typo or an unexpected value. Running diff between versions shows you what changed, and editing the file manually can test fixes instantly. This is like having a detailed, real-time log you can inspect and modify at will.

Imagine you’re trying to understand why a specific task isn’t appearing in your app. Instead of digging through logs or complex queries, you open tasks.json and see the raw data. If the task is missing or incorrect, you can fix it directly in the file. This immediate access encourages better data hygiene and makes it easier to identify issues. For instance, you might notice a task had an incorrect status or a missing field, and correcting it manually restores proper function. This transparency reduces guesswork, speeds up troubleshooting, and lets you experiment with changes safely. The tradeoff is that managing consistency across multiple files and ensuring atomic updates requires discipline and tooling, but for small to medium projects, the clarity and control gained are well worth the effort—much like editing a shared document rather than navigating a complex database schema.

Frequently Asked Questions

What does ‘disk is the contract’ really mean?

It means the app’s core state is stored directly in JSON files on your disk. These files are the definitive source of truth, making the system transparent, easy to debug, and resilient offline.

How does this differ from a traditional client-server app?

Instead of relying on a remote database, Threlmark reads and writes files directly on your device. Sync happens later, making it more resilient to network issues and faster for local interactions.

Why use JSON files instead of a database?

JSON files are human-readable, easy to inspect, and simple to back up. This transparency simplifies debugging and recovery, especially for small-scale or solo projects.

How does sync work when the app is back online?

Sync compares JSON files across devices, resolving conflicts with simple rules or external tools. Since all data is just files, merging is straightforward and transparent.

What are the main tradeoffs of this approach?

While ideal for offline use and simplicity, it can become slow with large datasets or complex relationships. Handling many users simultaneously may require a more traditional server-based system.

Conclusion

Threlmark’s architecture shows that sometimes, the simplest idea — the disk as the contract — can unlock powerful, resilient, and flexible applications. This approach turns traditional client-server thinking upside down, giving you a system that’s more transparent, offline-friendly, and easy to maintain.

Next time you need a project tool or app that just works everywhere, consider putting the disk front and center. Your future self will thank you for it.

You May Also Like

Are Polymarket Trading Bots Actually Profitable? The Math Behind 2026’s Prediction-Market Arbitrage Industry

An analysis of Polymarket trading bots reveals only 0.51% of wallets profit over $1,000, with most strategies losing money or breaking even in 2026.

Technology operations signal monitor: Show HN: Kage – Shadow any website to a single binary for offline viewing

Kage, a tool that shadows websites into a single binary for offline viewing, is being tested as a workflow for product and engineering leads at small software firms.

The OAuth Permission Apocalypse.

Analysis of the recent Vercel breach reveals OAuth permission misconfigurations as the core risk, likened to SQL injection’s historical dominance.

Accessibility issue triage board for small websites

A new triage board for accessibility issues on small websites is being tested as a workflow solution for small business owners and freelancers.