TL;DR

Threlmark’s core idea is simple: the on-disk JSON files are the source of truth. This approach gives you a resilient, portable, and offline-capable system where data integrity depends on the disk, not a database. It’s a game-changer for local-first apps.

Imagine working on your project map, knowing that the files on your disk aren’t just backups—they are the system’s brain. That’s the core idea behind Threlmark’s local-first architecture. It’s a shift in thinking: instead of a server or cloud holding the record, your disk does.

This article peels back the layers—how making disk the contract simplifies collaboration, boosts reliability, and keeps your data safe—even when offline. If you’ve ever wrestled with syncing conflicts or data corruption, this approach might just change your mind.

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
SANDISK 128GB Ultra Flair USB 3.0 Flash Drive, SDCZ73-128G-G46, Black

SANDISK 128GB Ultra Flair USB 3.0 Flash Drive, SDCZ73-128G-G46, Black

High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard…

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
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.

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
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 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

  • Making disk the contract means your data is stored as JSON files that are both the source of truth and portable across tools.
  • Atomic file writes and tolerant merging keep your data safe and consistent, even when multiple devices sync or crashes happen.
  • A file-based approach simplifies offline use, removes server dependency, and makes recovery straightforward.
  • JSON files are human-readable and easy to share, enabling collaboration without lock-in or complex protocols.
  • This architecture encourages a mindset where the device’s disk is the ultimate authority—streamlining development, resilience, and user trust.

What Threlmark’s architecture actually looks like in practice

Threlmark sits on your disk as a collection of JSON files—no database, no cloud. At the root, you find a manifest (`threlmark.json`), project folders, and files for each roadmap card in `items/`. External suggestions, handoffs, reports—everything is just files.

For example, a card about a feature might be stored as `items/abc123.json`, containing its status, description, and history. Lane orderings are in `board.json`, and shared cards live in `shared/items/`. When you open Threlmark, it reads these files directly. When you make a change, it atomically rewrites the file, ensuring no partial data.

This file layout is more than just storage; it’s the core data model. By treating the filesystem as the database, the system leverages the inherent reliability and simplicity of files. The atomicity of file operations ensures that each change is complete, reducing the risk of corruption or partial updates—crucial for maintaining data integrity in offline scenarios or during unexpected failures. This design also simplifies backup and recovery, as the entire state can be captured by copying the folder structure, making the system inherently portable and easy to debug.

What Threlmark’s architecture actually looks like in practice
What Threlmark’s architecture actually looks like in practice

Why making disk the contract transforms your data reliability

When your disk is the source of truth, you get an ironclad guarantee: the data you see is exactly what’s stored. If your computer crashes, the files remain intact. No server or cloud dependency means fewer points of failure.

For instance, when you update a card, Threlmark writes a new JSON atomically. If your laptop loses power mid-write, the old file remains untouched. This reliability is a huge advantage—your data is safe, even without a network.

Atomic writes are critical here—they ensure that each data modification completes fully or not at all. Learn more about local-first architecture. This prevents partial or corrupted files, which can cause inconsistencies or crashes. The absence of a central server means that your data’s durability isn’t dependent on network stability or remote backups. Instead, the local disk’s reliability becomes the backbone, offering immediate, tangible assurance that your data is safe. However, this approach also means that synchronization and data consistency across devices depend on careful conflict management and merging strategies—since the disk is the ultimate arbiter, conflicts must be resolved at the file level rather than through complex database transactions. This tradeoff simplifies the architecture but shifts complexity to the sync process, emphasizing the importance of atomicity and conflict resolution techniques.

How JSON-on-disk makes collaboration and portability a breeze

JSON files are simple, human-readable, and portable. You can read more about JSON and its uses. You can back them up, sync via Dropbox, or even edit them with a plain text editor. Other tools can also join in—just read or write the files.

Say you want to share your roadmap with a teammate—just copy the folder or push it to GitHub. No lock-in, no special API—just raw files. This openness makes Threlmark’s data highly interoperable.

Beyond simplicity, this structure encourages a flexible workflow. Developers and users can directly access the files for debugging or manual editing, which is invaluable in troubleshooting or customizing workflows. The transparency of JSON means that understanding the current state or recovering from errors is straightforward—no opaque database layers or proprietary formats. This openness reduces dependency on specific tools, enabling a broader ecosystem of integrations and customizations, and fosters a true offline-first philosophy—if the files are local, the system can operate independently of external services.

How JSON-on-disk makes collaboration and portability a breeze
How JSON-on-disk makes collaboration and portability a breeze

Sync, conflicts, and offline magic: making the disk the ultimate referee

Threlmark handles sync by watching for changes in the JSON files. For more on synchronization strategies, see this article. When multiple devices update the same card, atomic writes and tolerant merging prevent corruption. If two edits clash, the system preserves both versions or prompts resolution.

Imagine working on your laptop at home and then on a tablet during a commute. The files sync in the background—no server needed. When offline, your local files are still the system’s brain.

This approach relies on the fact that file changes are explicit and easily monitored. By watching filesystem events and comparing timestamps or checksums, Threlmark can detect modifications and initiate synchronization. Conflict resolution strategies—such as preserving both versions or prompting user input—are critical in multi-device scenarios. The offline capability is inherent: since all data resides on local files, work can proceed uninterrupted without network access. When connectivity is restored, the system reconciles changes, merging updates intelligently. This model emphasizes the importance of conflict management policies and atomic operations to ensure data integrity and user trust, even in complex multi-device environments.

Performance and reliability: what this approach costs and gains

Using files instead of a database means your app can start instantly, with no waiting for network or database initialization. Check out our site for more insights on local-first systems. It also simplifies debugging—just open a file to see the current state.

On the downside, large datasets can slow down file operations. But for most project management use cases, this tradeoff is negligible. The reliability gained—resilience to crashes, easy backups—is worth it.

Moreover, this approach offers a performance advantage in scenarios where data is small or moderate in size, as file I/O is typically faster and more predictable than establishing database connections. It also reduces complexity, making the system easier to maintain and troubleshoot. However, developers should be aware that as datasets grow significantly, file-based operations might become slower, potentially requiring optimization strategies such as indexing or batching. The key benefit remains: the system’s resilience to crashes, power failures, or data corruption improves because each change is atomic and immediately persisted, reducing the risk of data loss or inconsistency during unexpected shutdowns.

Performance and reliability: what this approach costs and gains
Performance and reliability: what this approach costs and gains

What this means for other builders: lessons from Threlmark’s design

Making disk the contract isn’t just a tech trick; it’s a mindset shift. It pushes you to think about data as something tangible—files you can see, move, and trust. This approach reduces complexity, boosts reliability, and makes your app truly offline-first.

For example, a small startup could replace a cloud database with a simple folder of JSON files—no need for a dedicated backend. It’s a model that scales from solo projects to team tools, as long as you keep the discipline.

Adopting this mindset means designing your system around the idea that the device’s disk is the ultimate authority. It encourages developers to think about data synchronization, conflict resolution, and backup strategies from the ground up. While this approach simplifies many aspects of app architecture, it also requires careful planning to handle edge cases—like conflicting edits or large datasets. The tradeoff is a more resilient, transparent, and user-trustworthy system that can operate fully offline and recover gracefully from failures. It’s a philosophy that can inspire a new wave of robust, simple, and portable applications, especially in the era of increasingly connected and disconnected workflows.

Frequently Asked Questions

What does “disk is the contract” actually mean?

It means the JSON files on your disk are the ultimate source of truth. Everything your app does is based on reading and writing these files, making data durable, portable, and easy to recover.

How is this different from traditional client-server architecture?

Instead of relying on a remote database or server, the system stores all data locally as files. Syncing and collaboration happen by copying or merging these files, not through a centralized database.

Why use JSON on disk instead of a database or binary format?

JSON is human-readable, easy to edit, and platform-agnostic. It simplifies collaboration, debugging, and portability—key advantages for local-first, offline-capable apps.

How does sync work when multiple devices edit the same data?

Syncing in Threlmark relies on atomic file writes and tolerant merging. When conflicts happen, files preserve both versions or prompt resolution, ensuring data stays consistent.

What happens if the app is offline or the sync server fails?

The system keeps working because all data lives on your device’s disk. Offline work is seamless, and sync resumes automatically once a connection is restored.

Conclusion

Threlmark’s architecture proves that the disk can be more than just storage; it can be the core of your entire system. Making the disk the contract turns your device into a resilient, portable, and offline-capable powerhouse.

If you want to build apps that truly work everywhere, think of your disk as your system’s backbone—solid, simple, and unshakeable.

You May Also Like

Carbon Nanotubes: Properties and Applications

Offering exceptional strength, conductivity, and versatility, carbon nanotubes are revolutionizing industries—discover how their unique properties are shaping the future.

Perovskite Solar Cells: Can They Finally Beat Silicon?

Could perovskite solar cells finally surpass silicon in efficiency and affordability, or do persistent challenges still hold them back from widespread adoption?

Antimicrobial Surfaces: Chemistries That Work

Antimicrobial surfaces utilize advanced chemistries like nano coatings and metal ions, and understanding how these technologies work can reveal their true potential.

Environmental Chamber Testing: The Humidity Trap That Skews Polymer Aging

Humidity can create hidden pitfalls in environmental chamber testing that distort polymer aging results—discover how to identify and prevent this trap.