TL;DR

Threlmark’s system treats disk files as the single source of truth, making it easy to inspect, sync, and evolve data without a database. This design boosts offline work, simplifies conflict resolution, and supports flexible tooling.

Imagine a project management app that never relies on a cloud server. Instead, everything lives right on your disk, in plain JSON files. That’s the core idea behind Threlmark’s local-first architecture — it’s a radically simple yet powerful way to manage data. You’ll see how this approach makes your workflow faster, more reliable, and surprisingly flexible.

In this article, you’ll learn what it really means when we say “disk is the contract,” how this design influences data handling, sync, and conflict resolution, and why it might be the future for your own tools or projects.

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

Contemporary 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
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 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
HEARTSINE DATA MANAGEMENT SOFTWARE

HEARTSINE DATA MANAGEMENT SOFTWARE

Part Number: PAD-ACC-02

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 disk files as the primary source of truth — it simplifies data management and debugging.
  • Use one JSON file per item for collision-free, atomic updates without locks.
  • Design self-healing structures like lane ordering to keep the project roadmap consistent.
  • Conflict resolution through timestamps and manual merging keeps things straightforward.
  • Offline-first design enables seamless work even without network connectivity.

What does ‘disk is the contract’ really mean in Threlmark?

At its core, ‘disk is the contract’ means the files on your hard drive are the authoritative record of your data. No server, no cloud, just a structured set of JSON files. When you open Threlmark, it reads these files directly. When you make changes, they’re written back to disk immediately. Learn more about local-first architecture.

For example, a project card is just a `.json` file in the `items/` folder. If you want to see what’s happening, you can peek at that file — no need to log into a database or API. The entire system hinges on this simple, transparent file structure.

What does ‘disk is the contract’ really mean in Threlmark?
What does ‘disk is the contract’ really mean in Threlmark?

How the JSON-on-disk model keeps data transparent and easy to debug

Threlmark’s data lives in plain JSON files, making it easy to inspect, troubleshoot, and migrate. Say you’re debugging a task stuck in a certain state. Just open the relevant `item.json` file, see the raw data, and understand exactly what’s stored. No opaque database layer hiding the details.

This approach also makes migrating to new formats straightforward. You modify a file, and your tools can handle the transition, thanks to the human-readable structure. It’s like having a digital paper trail of every change.

Why managing files directly makes sync and conflict resolution simpler

In Threlmark, each project item gets its own JSON file, and updates are atomic — they happen one file at a time. This means no complex locking or coordination. When two devices edit the same card, the last write wins. Conflicts are easy to detect by comparing file versions.

For example, editing a task on your laptop and your phone simultaneously might create a conflict, but resolving it simply involves choosing which JSON file to keep or merging changes manually.

Why managing files directly makes sync and conflict resolution simpler
Why managing files directly makes sync and conflict resolution simpler

Self-healing lane structure keeps your roadmap consistent

The lane order for your project is stored separately in `board.json`. Every time you read it, Threlmark cross-checks the actual items in `items/`. Missing or misplaced cards are automatically corrected. It’s like having a smart assistant that keeps your project tidy without manual cleanup.

This self-healing property ensures that your view always matches reality, even if files get moved or corrupted unexpectedly.

Practical tips for building with a file-based, local-first mindset

  • Use atomic write functions to prevent corruption during crashes.
  • Keep each item in its own JSON file for collision-free updates.
  • Separate metadata like lane order into dedicated files for easy management.
  • Implement read-merge-write cycles to normalize and preserve data.
  • Leverage file diff and version control to track changes over time.

How Threlmark’s approach compares to traditional client-server apps

FeatureThrelmark (File-Based)Traditional Client-Server
Data SourceJSON files on diskRemote database/API
Offline CapabilityFull offline supportLimited; often requires sync layer
Sync MethodManual or automated file syncNetwork requests and conflict resolution
DebuggingInspect files directlyUse database tools or logs
ScalabilitySimpler for small to medium projectsBetter for large, multi-user systems

Handling conflicts and ensuring consistency in a local-first system

Threlmark’s system handles conflicts by last-write-wins and version comparison. When two devices change the same card simultaneously, the file with the latest `updatedAt` timestamp becomes the authoritative version. If needed, manual merging is straightforward. Discover how conflict resolution works in local-first systems.

For example, if your laptop and tablet both update a task, you can easily spot the conflict by comparing timestamps and decide which change to keep.

Handling conflicts and ensuring consistency in a local-first system
Handling conflicts and ensuring consistency in a local-first system

Offline mode and later sync: how Threlmark keeps working smoothly

Because all data is stored locally in JSON files, you can work offline indefinitely. Changes are saved instantly, and sync happens later when connected. This means no interruptions, even in low or no connectivity zones.

When you reconnect, Threlmark can quickly propagate all your local changes to other devices or tools, maintaining a seamless workflow.

The future of local-first apps: simpler, more flexible, more resilient

Threlmark’s design shows that you don’t need a complex database to build powerful apps. By treating disk files as the contract, developers gain transparency, ease of debugging, and flexibility. It’s a straightforward way to support collaboration, automation, and offline work in a single package.

This approach is gaining momentum as more tools embrace local-first principles, making your data more resilient and your workflows more adaptable.

Frequently Asked Questions

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

It means the JSON files on your disk are the single source of truth. Your app reads and writes directly to these files, making the data transparent, portable, and easy to manage without a database.

How does Threlmark handle sync between devices?

Sync happens by copying files between devices. Changes are atomic, conflicts are resolved by timestamps or manual merge, and the architecture supports offline work without issues.

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

Threlmark compares the `updatedAt` timestamps and applies last-write-wins. Conflicts are simple to detect and resolve, keeping data consistent without complex protocols.

Is this approach suitable for large, multi-user apps?

It works well for small to medium projects where simplicity and offline support matter most. Larger, multi-user systems might require a more robust, server-based solution.

Can I manually inspect and migrate my data?

Absolutely. Since data lives in plain JSON files, you can open, edit, and migrate your data with any text editor or version control system.

Conclusion

Threlmark’s approach proves that a simple, transparent architecture built around the disk as the contract can unlock powerful, flexible workflows. It’s a reminder that sometimes, the simplest tools — plain files — can create the most resilient systems.

Next time you think about your app’s architecture, ask yourself: could the disk itself be the contract? The answer might just be yes — and it might make your life easier, too.

The future of local-first apps: simpler, more flexible, more resilient
The future of local-first apps: simpler, more flexible, more resilient
You May Also Like

PPMs for Renewable Energy Projects: Highlighting Regulatory and Market Risks

Analyzing regulatory and market risks in renewable energy PPAs reveals potential threats to profitability and strategies to mitigate them.

What Investors Want to See in a Management Incentive Discussion

Lenders seek management incentives that prioritize long-term value, balancing performance metrics, risk management, and transparency to ensure sustainable growth—discover how.

Die Rolle von Treuhandkonten erklärt – Einfach verständlich für PPM-Leser

Ich werde erklären, wie Treuhandkonten in einfachen Worten funktionieren und warum sie für sichere Transaktionen unerlässlich sind – entdecken Sie die wichtigsten Details, die Sie wissen müssen.

Acoustic Dampening, Placement, and the “Rig in the Closet” Setup

Discover practical tips on acoustic dampening, placement, and building a quiet, effective ‘rig in the closet.’ Learn how to reduce noise and improve sound quality today.