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

TL;DR

Threlmark uses disk as the single source of truth, making data portable, safe, and interoperable. This approach simplifies offline work, reduces errors, and enables automation and tech trends without a central server.

Imagine a tool where your data isn’t locked behind a server or cloud, like the assistive technology solutions that enhance accessibility. Instead, it lives right on your disk, accessible and editable with a simple text editor. That’s the core idea behind Threlmark’s local-first architecture. It’s a radical shift from traditional apps that rely on centralized databases. Here, your entire project roadmap, tasks, and AI interactions are stored as plain JSON files. No vendor lock-in, no server dependencies, just pure files sitting on your machine. This approach isn’t just about storage; it’s about creating a system that’s more resilient, transparent, and flexible. Whether you’re offline, collaborating across devices, or automating your workflow, Threlmark’s design makes it all possible with a simple, elegant principle: disk is the contract.
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
Amazon

external SSD portable 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

USB flash drive for data backup

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

text editor for JSON 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
Amazon

offline data synchronization 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 data as files on disk — it’s portable, transparent, and safe from vendor lock-in.
  • Use atomic write patterns to prevent corruption, especially when working with multiple tools or collaborators.
  • Store each item in its own file to simplify concurrency and improve robustness.
  • Design your system to be stateless — restartability ensures resilience and ease of automation.
  • Leverage open files for seamless multi-device workflows and AI automation.

Why Using Disk as the Single Source of Truth Changes Everything

In Threlmark, the on-disk layout isn’t just a storage choice — it’s the core of the system’s reliability and flexibility. All data lives in plain JSON files, which any tool or script can read or modify. This makes the data inherently portable, easy to back up, and compatible with other tools.

For example, if you want to migrate your roadmap to another app, just copy the folder. No databases to export, no vendor lock-in. This simple design also means that if your system crashes or your app updates, your data remains safe and intact.

According to the Threlmark project on GitHub, this approach ensures every artifact — from project metadata to individual cards — is inspectable and versionable. You can see exactly what’s happening by just opening a file or running a diff. It’s a transparent window into your work, making debugging and collaboration smoother than ever.

Why Using Disk as the Single Source of Truth Changes Everything
Why Using Disk as the Single Source of Truth Changes Everything

How Threlmark’s File Layout Acts Like a Contract You Can Trust

Threlmark’s on-disk layout isn’t a random collection of files — it’s a formal contract. At the root, you’ll find a manifest (threlmark.json) and a dependency graph (links.json). Each project has its own folder with metadata, lane setup, and one file per task or card. This structure makes it easy to understand, modify, or extend the system without surprises.

For example, if you want to add a new project or move a card, just create or edit the relevant JSON file. No need for complex migrations or database schemas. It’s a straightforward, predictable system that anyone can pick up and trust.

As the Threlmark documentation notes, this layout promotes interoperability. Other tools can join in by simply reading and writing these files, creating a vibrant ecosystem that’s open and flexible.

Making File-Based State Safe and Reliable — No More Corruption Fears

Handling files might sound risky, but Threlmark takes careful steps to keep data safe, much like the principles discussed in this article. Every write goes through an atomic process: first writing to a temporary file, then renaming it over the original. This simple trick ensures that even if your system crashes mid-write, your data remains consistent, similar to how outdoor safety gadgets ensure reliability in the wilderness.

For instance, when updating a card, the app writes the new JSON to a temporary file like card123.json.tmp. Once complete, it renames this file to replace the old one. Because renaming is atomic on most filesystems, you avoid half-written or corrupted data.

Additionally, Threlmark uses a read-merge-write cycle, which preserves crucial info like IDs and timestamps, and tolerates unknown or missing fields. This makes the system forward-compatible and robust against schema changes, according to the system’s design principles.

Making File-Based State Safe and Reliable — No More Corruption Fears
Making File-Based State Safe and Reliable — No More Corruption Fears

How Single-File Per Item Boosts Concurrency and Simplicity

Instead of a giant JSON array for all tasks, Threlmark stores each card as its own file inside an items/ folder. This tiny change makes a big difference. When you update one card, you only write that single file, avoiding complex locks or race conditions.

For example, if you’re collaborating with a teammate editing different cards, each can save independently without clobbering the other. The system’s self-healing board.json ensures the visual flow always matches the actual cards present. If a card gets deleted or moved, the board automatically updates itself on read.

This approach simplifies concurrency and makes the system more resilient to simultaneous edits — no need for a central database or locking mechanisms.

Why Open, Portable Files Make Your Workflow Smarter

Open files are your best ally. With Threlmark, every artifact is a plain JSON file you can open in any editor, run diffs on, or back up with a simple copy. This openness means your data is never trapped in a proprietary format.

For example, if you decide to switch to a different tool or just want to peek inside your roadmap, you can. No exporting, no complex integrations — just open the files and see what’s happening.

This portability also means you can sync your data across devices using Dropbox, Syncthing, or even just git. It’s a lightweight, flexible way to keep your work consistent everywhere.

Why Open, Portable Files Make Your Workflow Smarter
Why Open, Portable Files Make Your Workflow Smarter

Making the System Restartable — No State, Just Files

Threlmark’s design is stateless. It doesn’t rely on in-memory databases or server sessions, similar to the approach described on home entertainment and tech guides. Instead, it reads from disk every time, so even if you restart your computer or the app crashes, your data is intact and ready to go.

For instance, when you launch Threlmark, it rebuilds the current view by reading the JSON files. No lost data, no complicated recovery steps. This makes the system incredibly resilient and easy to maintain.

Plus, this approach makes automation and external tools easier to integrate, since they can just read and write files at will. No special APIs required.

How Threlmark Enables Seamless Offline and Multi-Device Work

Because all data lives on disk, you can work offline without breaking a sweat. Just open your files, make changes, and save. When you reconnect, sync tools automatically update other devices.

For example, if you’re traveling and working on your laptop, your roadmap updates instantly when you reconnect to Dropbox or Syncthing. No need to worry about server availability or conflicts — the system is designed for offline resilience.

This model supports multi-device workflows effortlessly, making Threlmark ideal for teams that split their work across laptops, tablets, or even shared folders.

How Threlmark Enables Seamless Offline and Multi-Device Work
How Threlmark Enables Seamless Offline and Multi-Device Work

How Automation and AI Agents Work with Files — Closing the Loop

Threlmark’s file-based design makes it easy for AI agents and automation scripts to participate. They simply read and write the JSON files, updating cards or moving tasks to Done.

For example, an AI agent might scan the reports/ folder, find a completed task, and move its card to the done/ folder. Because the entire system is just files, automation becomes a natural part of the workflow.

This setup allows the system to close the loop: AI can review, update, and even trigger new actions without needing a complex API or database, just plain files.

Frequently Asked Questions

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

It means all data lives in plain JSON files, which serve as the single source of truth. This makes the system transparent, portable, and easy to modify without relying on databases or cloud services.

How does Threlmark handle multiple devices or offline work?

Because all data is stored on disk, you can work offline and sync changes later using tools like Dropbox or Syncthing. The system is designed for resilience and multi-device collaboration without central servers.

Is this approach safe from data corruption?

Yes. Threlmark uses atomic write techniques, writing to a temporary file and renaming it, which prevents corruption even if the system crashes during a write.

Can external tools or AI agents participate easily?

Absolutely. Since everything is plain JSON files, external scripts and AI agents can read and modify data directly, enabling automation and closing the loop naturally.

What are the main benefits of this file-based architecture?

It’s open, portable, restartable, and easy to extend. You gain transparency, resilience, and flexibility, making it ideal for modern, offline-capable workflows.

Conclusion

Threlmark’s core insight is simple but powerful: the disk isn’t just storage. It’s the contract that makes the entire system honest, flexible, and resilient. When you treat files as the single source of truth, you build a tool that’s easy to extend, debug, and trust. In a world of complex databases and cloud lock-in, this approach stands out as refreshingly straightforward and remarkably effective. Your next project could benefit from this clarity — just start with the files on your disk.
You May Also Like

Office Chair Fit Guide: Seat Depth, Lumbar, and Armrests

Fitting your office chair properly ensures comfort and productivity—discover essential tips to customize your chair for all-day support.

A Beginner’s Guide to Windows Backup Locations

Here’s a beginner’s guide to Windows backup locations, highlighting options and tips to ensure your data stays safe—discover the best choice for your needs.

Mattress Promo Code: 20% Off │May

Mattress Firm offers a 20% discount for military, medical, student, and teacher discounts this May, with additional deals available during the promotion.

Windows Power Plans Explained (And Why “Balanced” Isn’t Always Best)

Windows power plans control how your PC balances performance and energy use,…