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

TL;DR

Threlmark’s ‘disk is the contract’ approach means all project data lives directly on your disk, making it portable, safe, and instantly accessible. Disk Is the Contract: Inside Threlmark’s Local-First Architecture This design removes reliance on servers, enabling offline work, easy sync, and flexible integration with any tool that reads files.

Imagine working on your project roadmap with zero lag, even offline. No server delays, no cloud dependencies, just instant access and editing right on your disk. That’s the power of Threlmark’s local-first architecture — it’s like having a tiny, self-sufficient data hub on your machine.

Why does this matter? Because it turns traditional project management on its head. Instead of relying on a central database or cloud service, your data lives where you can see it, edit it, and back it up with a simple copy or sync. It’s a straightforward, resilient way to keep your work safe and accessible, no matter what.

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
Amazon

portable external SSD drive

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
Amazon

offline project management software

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
Amazon

JSON file editor for Windows

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
Amazon

local data backup tools

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, with all data stored as individual JSON files.
  • Use atomic file operations to prevent corruption and ensure reliable updates.
  • Design your system so it can self-heal and reconcile differences automatically.
  • External tools can participate freely because the data is plain, open JSON files.
  • Be prepared for conflicts — handle them transparently with simple rules or manual merges.

How ‘disk is the contract’ makes your data safer and more portable

In Threlmark, the entire system treats your disk as the single source of truth. Files are the record, not a database. This means you can open, read, modify, or move files using any tool—no special permissions needed. Think of it like a shared folder where every change is transparent and recoverable. Learn more about sustainable practices.

For example, each project gets a dedicated folder with JSON files for each card. If your computer crashes or you switch devices, just copy the folder or sync it. The data is always accessible, always consistent because each file is an atomic unit.

This approach shuns lock-in. You can back up your data with a simple copy, or integrate with Dropbox, Syncthing, or even git. Disk Is the Contract: Inside Threlmark’s Local-First Architecture The system is designed for interoperability, making it easy to work across tools and platforms. All of this hinges on one simple rule: the on-disk layout is the API.

How ‘disk is the contract’ makes your data safer and more portable
How ‘disk is the contract’ makes your data safer and more portable

Why atomic file writes keep your data safe from corruption

Imagine saving a file, then crashing. Traditional writes can leave your data half-finished, corrupting the record. Threlmark sidesteps this danger with atomic writes. It writes changes to a temporary file first, then renames it over the original. That rename operation is atomic—either the full update happens or nothing at all. Educational resources on technology and tools.

For example, updating a roadmap card involves writing a new JSON file with the latest info, then replacing the old one instantly. If your computer crashes during that, the old file remains untouched. This guarantees your data never ends up in an inconsistent state.

By combining simple, atomic file operations with careful read-merge logic, Threlmark ensures your project data stays reliable, even in the face of crashes or power outages.

One file per item: how Threlmark avoids race conditions and keeps everything synchronized

Most systems store all data in one big JSON array. That’s a problem — editing one item requires rewriting the whole list. Threlmark solves this by giving each item its own JSON file. Biodiversity and conservation practices. So, updating a task or card involves just replacing that single file.

This makes concurrent edits safe. Two tools can update different cards simultaneously without clobbering each other. Plus, the system self-heals: every time you read the project, it checks for missing or orphaned files and keeps the order correct.

For example, if you drag a card to a new lane, only its file updates. No need to lock or coordinate. This simplicity scales up as your project grows, and it makes syncing changes across devices straightforward.

One file per item: how Threlmark avoids race conditions and keeps everything synchronized
One file per item: how Threlmark avoids race conditions and keeps everything synchronized

How the system keeps the project’s board consistent — even when files change outside the app

Threlmark’s board isn’t just a static list. It’s a self-healing structure that reconcilies itself with the actual files on disk each time you open it. The `board.json` stores the order of items, but every read checks that items still exist and are correctly referenced.

For example, if you accidentally delete or move a card file outside the app, the next time you open Threlmark, the board updates itself. It skips missing files and reorders based on the current state, avoiding errors or stale data.

This design ensures your project view always matches reality, even if external tools or manual file edits happen.

How external tools can participate without permission — open data as a superpower

Because all data is stored as plain JSON files, any external tool can read or modify it without needing API permissions. Want to add a new task? Drop a JSON file into the `items/` folder. Guides and resources for astrophotography. Need to generate a report? Read the files directly.

This openness invites innovation. For example, IdeaClyst can suggest new cards by placing JSON snippets directly into `suggestions/`. The system then integrates these seamlessly.

It’s like having an open API, but built on the filesystem. No special SDKs, no server dependencies. Just plain files, everywhere.

How external tools can participate without permission — open data as a superpower
How external tools can participate without permission — open data as a superpower

Sync, conflict, and resolve — how Threlmark handles multiple devices working together

Syncing in a local-first system can be tricky. Threlmark relies on simple principles: each device reads and writes files locally, then syncs them using any file sync tool. Conflicts are inevitable, but the system is designed to handle them gracefully.

For example, if two devices edit the same card simultaneously, the last write wins. But because each file is atomic, conflicts are easy to detect and resolve. Users can compare versions or merge changes manually if needed.

Automatic conflict resolution is possible—like keeping the latest update or merging non-overlapping fields—but the key point is that the architecture makes conflicts transparent and manageable.

What apps benefit most from a local-first, disk-as-contract approach

Any app that needs fast, offline access and resilience benefits from Threlmark’s design. Think project management, note-taking, or task boards. Especially when collaboration happens across devices or when internet reliability is shaky.

For example, a remote team using a shared folder can keep working without waiting for cloud sync or worrying about outages. They can also back up or migrate data easily by copying files.

This approach shines in scenarios where data security, offline work, and interoperability matter most.

What apps benefit most from a local-first, disk-as-contract approach
What apps benefit most from a local-first, disk-as-contract approach

Main tradeoffs — what you give up for local-first simplicity

Local-first isn’t free. It trades off some complexity in conflict resolution and sync management. Handling simultaneous edits and ensuring consistency requires thoughtful design.

For example, resolving conflicting changes manually or via simple rules like “latest wins” can sometimes frustrate users. Also, large datasets may slow down file operations.

But these tradeoffs are manageable with a disciplined approach. The payoff: resilience, instant responsiveness, and total control over data.

How to start building your own local-first project like Threlmark

  1. Define your data structure clearly as JSON files.
  2. Use atomic write patterns to update files safely.
  3. Separate each item into its own file for concurrency and easy sync.
  4. Build self-healing logic into your reading routines to reconcile file states.
  5. Leverage existing file sync tools, or build custom sync if needed.

For example, start with a simple folder structure: `items/`, `board.json`, and individual item files. Test offline workflows first, then layer sync and conflict resolution.

Frequently Asked Questions

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

It means your data lives directly on your disk as plain files, which serve as the definitive record. Any tool or device can access, modify, or back it up without needing a special API or server.

How does Threlmark handle sync conflicts between devices?

It relies on simple rules—like last-write-wins—and atomic file updates. Conflicts are transparent, and users can review or merge changes manually if necessary.

Can I use this system for collaborative apps?

Absolutely. Because data is stored as files, multiple devices or users can work asynchronously or in real-time by syncing their folders. Conflict resolution and self-healing keep everything consistent.

What are the main benefits of a local-first approach?

Instant responsiveness, offline access, resilience to outages, and easy backup or migration. It also encourages open, interoperable workflows since data is plain files.

What are the main challenges or tradeoffs?

Handling conflicts, managing sync reliability, and dealing with larger datasets can be tricky. But with disciplined design, these issues become manageable and worth the benefits.

Conclusion

Choosing to make disk the contract turns your data into a living, portable artifact—immune to server outages, easy to backup, and simple to extend. It’s a straightforward way to build resilient, collaborative tools that respect your control.

Now, imagine your next project where every file, every change, is part of a transparent, self-healing system. That’s the power of Threlmark’s local-first architecture—where your data always stays with you, no matter what.

How to start building your own local-first project like Threlmark
How to start building your own local-first project like Threlmark
You May Also Like

The Chair Fit Test: Seat Height, Depth, and Armrests in 5 Minutes

Wanna ensure perfect chair comfort in just five minutes? Discover how to optimize your seat height, depth, and armrests now.

Asynchronous Communication: How to Reduce Meetings Fast

Navigating the shift to asynchronous communication can drastically reduce meetings—discover innovative strategies to keep your team connected and productive.

Timeboxing: Why Your Calendar Beats Your Motivation

Focusing on calendar-based timeboxes rather than motivation ensures consistent productivity and habit formation even when motivation wanes, making it essential to read on.

The Filing System That Beats Folders: One Label, One Rule

Only adopting a one-label, one-rule filing system can revolutionize your organization—discover how it simplifies everything and why it works better.