TL;DR

Threlmark’s local-first architecture makes the disk the single source of truth, enabling portable, interoperable, and restartable systems. It simplifies data flow, improves resilience, and fosters user control without relying on central servers.

Imagine a project management tool that lives entirely on your disk—no cloud, no login, just plain files. It’s fast, reliable, and totally under your control. That’s the core idea behind Threlmark’s local-first architecture, where the disk isn’t just storage—it’s the contract that keeps your data honest and synchronized.

In this article, you’ll see how making the disk the system’s backbone changes everything: how it handles concurrency, external tools, and AI automation. If you want a system that’s resilient, portable, and simple to understand, keep reading.

Disk is the contract: inside Threlmark’s architecture — ThorstenMeyerAI.com
ThorstenMeyerAI.com
Threlmark · Technical Deep-Dive
Threlmark · architecture

Table of Contents

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 512GB Ultra USB 3.0 Flash Drive - SDCZ48-512G-G46, Black

SANDISK 512GB Ultra USB 3.0 Flash Drive – SDCZ48-512G-G46, Black

Transfer speeds up to 10x faster than standard USB 2.0 drives (4MB/s); up to 130MB/s read speed; USB…

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

8 solid reasons for the new Music Studio 11!

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
SSK 4TB Personal Cloud Network Attached Storage Support Wireless Remote Access, Home Office NAS Storage with Hard Drive Included for Phone/Tablet PC/Laptop Auto-Backup (Not Support WiFi Connection)

SSK 4TB Personal Cloud Network Attached Storage Support Wireless Remote Access, Home Office NAS Storage with Hard Drive Included for Phone/Tablet PC/Laptop Auto-Backup (Not Support WiFi Connection)

Your personal cloud storage with 4TB large capacity doesn't have own WIF: This NAS built-in 3.5inch 4TB storage,…

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 each project item as an individual JSON file to prevent race conditions and enable easy concurrency.
  • Use atomic write techniques—write to a temp file then rename—to protect data integrity.
  • Make the disk the system’s core contract, simplifying backup, migration, and interoperability.
  • Leverage self-healing mechanisms by reconciling order files with actual item files at load time.
  • External tools and AI agents can seamlessly participate by reading and writing plain files, no APIs needed.

How Threlmark Makes the Disk the Single Source of Truth

Threlmark’s key move is treating the local disk as the ultimate authority. Instead of a fancy database, it uses plain JSON files stored in a dedicated folder—usually ~/.threlmark. These files aren’t just storage; they’re the API, the data, and the contract all in one.

For example, each project has its own folder with a project.json for metadata, and each task or card gets its own file. The system reads, writes, and updates these files atomically, ensuring no corruption or race conditions. You can learn more about local-first architecture. This approach makes the data portable—just copy the folder, sync it with Dropbox, or open it on another device.

This design is simple but powerful: it’s open, interoperable, and restartable. For more insights, see how local-first systems work. No lock-in, no dependencies on external servers. Just plain files—trustworthy, accessible, and ready for whatever you throw at it.

By making the disk the contract, Threlmark emphasizes transparency and control. You see exactly what data exists, how it changes, and when. This clarity reduces bugs and misunderstandings, especially when multiple tools or users are involved. The tradeoff is that managing consistency and conflict resolution falls to the application logic, which requires careful design—but this tradeoff grants unparalleled flexibility and simplicity.

How Threlmark Makes the Disk the Single Source of Truth
How Threlmark Makes the Disk the Single Source of Truth

Why Making the Disk the Contract Boosts Resilience and Control

When your data lives on disk, it’s always there—no matter if the internet drops out or your cloud service blinks. Threlmark’s architecture ensures that the system can run offline, with no data loss. When back online, it syncs seamlessly, merging changes without conflicts or chaos.

Take a team working across multiple devices. Each one edits tasks stored as individual JSON files. When they reconnect, Threlmark reconciles differences automatically, thanks to conflict-free data types and smart merge strategies.

This approach gives you total control. You might explore lighting and smart home devices for related technology ideas. You decide how and when to sync, back up, or migrate your data. Plus, your data remains private—no third-party servers involved. It’s a simple, robust way to keep your system alive, even when connectivity is unreliable.

Choosing local storage as the contract shifts the focus from centralized control to distributed trust. This means you are responsible for maintaining consistency, backups, and security, which can be both empowering and challenging. The implication is that you gain sovereignty over your data but also bear the responsibility for its integrity and resilience, making robust conflict management and versioning strategies essential. This design also reduces attack surface—no external server means fewer vulnerabilities—yet it demands careful handling of synchronization to prevent data divergence.

How Atomic Writes Keep Your Data Safe and Consistent

Atomic writes are the secret sauce behind Threlmark’s safety. To understand more about data integrity, visit disk-based data safety. Instead of writing directly to a file, it writes to a temporary file first. Then, it renames that temp file over the original. On most filesystems, this operation is atomic—either the entire new file appears or not at all.

Imagine editing a task: changes are saved to task123.json.tmp. When ready, a quick rename replaces task123.json. If the process crashes midway, the original stays intact.

This simple pattern prevents partial writes, corruption, or data loss. It’s a tiny technical trick with huge impact—making file-based systems as reliable as databases, but far simpler to understand and maintain. The tradeoff is that it requires discipline in implementation; if not carefully handled, partial states could occur, especially on networked or unusual filesystems. Nevertheless, when used correctly, it provides a robust safeguard, ensuring that each operation leaves the data in a consistent state, which is vital for maintaining trustworthiness and recoverability in local-first systems.

Frequently Asked Questions

How does Threlmark handle conflicts when multiple tools modify the same file?

Threlmark uses merge strategies that preserve unknown fields and reconcile changes intelligently, preventing data loss while allowing concurrent edits.

Can I switch from a traditional database to a file-based system without losing data?

Yes. Because each item is a separate JSON file, you can migrate data gradually—just export your database content into individual JSON files and integrate them into the folder structure.

Is this approach suitable for large projects with thousands of items?

It can scale well, especially since each item is independent. However, managing thousands of files may require some tooling for indexing and search, but the core principles still hold.

What security measures should I consider with a file-based system?

Encrypt sensitive files, control access permissions, and keep backups. Since all data is local, you hold the keys—security is in your hands.

How does this architecture support offline work and synchronization?

Because all data lives on the disk, working offline is seamless. When online, sync tools or custom scripts can reconcile changes across devices, making your data portable and resilient.

Conclusion

Making the disk the contract isn’t just a tech trick; it’s a mindset shift. For more on innovative tech approaches, see Elfy’s World. It turns your data into a resilient, portable, and transparent foundation—free from the constraints of servers and lock-in. When your system respects this simple rule, you get a workflow that’s flexible, safe, and ready for anything.

Next time you design a tool or manage your data, ask yourself: can I make the disk *the* contract? Chances are, you’ll find it’s the simplest, most powerful move you can make.

How Atomic Writes Keep Your Data Safe and Consistent
How Atomic Writes Keep Your Data Safe and Consistent
You May Also Like

How AI ‘Robo‑Advisors’ Actually Pick Your Portfolio

Lurking behind the scenes, AI robo-advisors craft personalized portfolios by analyzing your goals and market data, but how exactly do they do it?

QAtrial Launches Enterprise-Ready Open-Source Quality Management Platform

QAtrial releases version 3.0.0 with Docker, SSO, validation docs, webhooks, and Jira/GitHub integrations under AGPL-3.0 license for regulated industries.

Blockchain in Finance: How This Technology Is Changing Banking

The transformative power of blockchain in finance is reshaping banking, but what future innovations lie ahead? Discover the possibilities.

What is Lupin Pill? Uncover Its Uses & Benefits

Explore the purpose and advantages of Lupin pills and understand how this medication can aid in treating various health conditions.