TL;DR

Threlmark’s architecture centers on treating disk files as the official data record. This local-first setup offers offline access, straightforward syncing, and resilience—no cloud needed, just plain JSON files that anyone can read, edit, and trust.

Imagine a system so simple it doesn’t rely on a server, cloud, or even a dedicated database. Instead, it treats your entire project data as plain text files sitting right on your disk. That’s the core idea behind Threlmark’s local-first architecture, where the disk is the contract—the single source of truth that everyone trusts.

Why does this matter? Because it radically simplifies how your tools, apps, and even AI agents work together. No more locking yourself into a cloud vendor or complex sync protocols. Instead, you get a system that’s fast, resilient, and incredibly transparent. Stick around, and I’ll show you exactly how Threlmark makes this work and why it might change how you think about data storage.

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

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

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

file synchronization software

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 management 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 the disk as the definitive source of data, with JSON files serving as the system’s contract.
  • Use atomic file writes and merge techniques to ensure data safety and forward compatibility.
  • Single-item files prevent race conditions and simplify concurrency handling.
  • Local-first design enhances speed and resilience, especially for offline workflows.
  • Syncing relies on file transfer protocols, avoiding complex database replication.

What Does ‘Disk Is the Contract’ Actually Mean?

At its core, this phrase means the on-disk JSON files are the definitive record of your data. Instead of a database or cloud API, the system relies on reading and writing these files directly. If you open a project folder, you see every task, note, or card as a JSON file—completely inspectable and editable.

For example, a card in Threlmark isn’t stored in a database. It’s just an `item/abc123.json` file, containing all its data. The system trusts this file to be the source of truth, so every operation—be it updating a task or moving a card—happens by changing that file.

What Does 'Disk Is the Contract' Actually Mean?
What Does ‘Disk Is the Contract’ Actually Mean?

How Threlmark Uses JSON Files to Keep Data Safe and Simple

Threlmark chooses JSON because it’s human-readable, portable, and easy to manipulate. Every project, card, or dependency lives as a separate JSON file. When you update a card, the system writes a new JSON file atomically, ensuring no corruption or partial updates. You can learn more about home theater, audio equipment, and gadgets to see how simplicity benefits user experience.

For example, if your AI assistant moves a card from ‘In Progress’ to ‘Done,’ it just updates the corresponding `item/xyz.json` file. If the process crashes halfway, the previous file remains intact, so your data stays reliable.

Why Local-First Architecture Outshines Cloud-Dependent Tools

Local-first systems like Threlmark handle the same data on multiple devices without needing constant internet. You can work offline, and your changes sync later—just like magic. This setup reduces latency, speeds up your workflow, and keeps you productive even when the internet goes down.

Imagine you’re on a plane, editing your roadmap. No problem. When you land, all your changes sync automatically. That’s the power of a disk-as-the-contract approach, where the local files are always the source of truth, independent of network conditions.

Why Local-First Architecture Outshines Cloud-Dependent Tools
Why Local-First Architecture Outshines Cloud-Dependent Tools

Making File-Based Data Safe with Atomic Writes and Merge Techniques

One of the biggest fears with files is corruption. Threlmark handles this with atomic writes: each update first saves to a temporary file, then renames it to replace the old one. This guarantees that a crash doesn’t leave your data half-written.

Updates aren’t just overwrites. They merge with existing data, preserving important fields like IDs and timestamps. This pattern makes the system resilient, compatible, and safe—even if you’re editing files with multiple tools or AI agents.

How the Single-Item Files and Self-Healing Boards Keep Data Consistent

Instead of one big `roadmap.json`, Threlmark uses one JSON file per item. This avoids race conditions and makes updates atomic. The lane order and board layout are stored separately but are checked against the actual items every time you load the system.

For example, if a card is deleted or moved, the system automatically heals the board, removing missing items and reordering lanes. It’s like a self-correcting map, always aligned with the real data.

How the Single-Item Files and Self-Healing Boards Keep Data Consistent
How the Single-Item Files and Self-Healing Boards Keep Data Consistent

Sync and Collaboration: How Files Travel Between Devices

Syncing is simple in Threlmark: changes are just file updates. When you save a card, the file gets updated locally, and later, a sync process copies these files to other devices. Because the data is just JSON files, you can use Syncthing, Dropbox, or even Git to keep everything in sync.

Imagine working on a project on your laptop at home, then opening your tablet at a coffee shop. As long as the files are synced, your project is exactly the same—no cloud API, no lock-in.

Handling Conflicts When Devices Go Offline

Offline edits can lead to conflicts. Threlmark handles this by using simple merge rules and timestamps. When two devices edit the same file, the system detects the conflict based on the `updatedAt` timestamp and then asks you which version to keep—or merges them intelligently.

For example, if you move a card on your laptop but your tablet also moves it differently offline, the next sync prompts you to choose the latest change or combine the updates. This keeps your data consistent without complex conflict resolution protocols.

Handling Conflicts When Devices Go Offline
Handling Conflicts When Devices Go Offline

The Performance Boost of Local-First Filesystem Operations

Accessing data from local files is blazing fast—no network lag, no waiting for server responses. This makes your interactions feel instant. For example, opening a project folder or updating a card takes just a few milliseconds.

Plus, because everything is stored locally, even large projects load quickly, and your AI agents can read and write files without delay, enabling seamless automation.

Tradeoffs of a Disk-Centric, Local-First System

While simple and resilient, this design has its challenges. Conflict management, syncing, and ensuring consistency across devices require careful planning. Handling simultaneous edits or network sync failures can be tricky.

For example, if two devices edit the same card offline, you need clear rules to resolve conflicts—something Threlmark manages with timestamps and merging.

Despite these hurdles, the benefits of speed, simplicity, and offline access often outweigh the downsides for many productivity and collaboration tools.

Tradeoffs of a Disk-Centric, Local-First System
Tradeoffs of a Disk-Centric, Local-First System

Real-World Example: How Threlmark Transforms Project Management

Imagine managing multiple side projects—each with its own list of tasks, deadlines, and priorities. Threlmark keeps everything on your local disk in plain files. When you update a task on your laptop, it’s just a quick file write. Later, your phone syncs those changes—no cloud, no fuss.

This setup makes it easy to collaborate with others without worrying about server outages or data lock-in. Plus, you can audit every change by inspecting the JSON files directly.

Frequently Asked Questions

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

It means the system’s true record lives in plain JSON files on your disk. All operations—reading, writing, syncing—are just file manipulations, making the data transparent and easy to recover or migrate.

How does Threlmark handle conflicts when two devices edit offline?

Threlmark compares timestamps (`updatedAt`) to detect conflicts. It then either prompts you to choose the latest version or performs an intelligent merge, ensuring data stays consistent across devices.

Why use JSON files instead of a database?

JSON files are inspectable, portable, and simple to manipulate. They eliminate the complexity of database setup and make the data accessible for debugging, external tools, or manual edits.

Can this architecture work for large projects?

Yes, but it depends. Since each item is a separate file, large projects may generate many small files, which could impact performance. However, for most productivity apps, this approach remains fast and manageable.

How does the system sync across multiple devices?

Syncing is just copying updated JSON files via tools like Dropbox, Syncthing, or Git. Changes are local, fast, and conflict resolution is handled through timestamps and merges.

Conclusion

By making the disk the contract, Threlmark simplifies data management, boosts resilience, and keeps your workflows lightning-fast. It’s a reminder that sometimes, the simplest approach—treating files as the system’s heart—can unlock powerful capabilities.

Next time you think about data storage, remember: it’s not about fancy databases. It’s about trust, transparency, and plain old files that just work.

You May Also Like

Nanotech in Developing Countries: Bridging or Widening the Gap?

Saw how nanotech can either bridge or widen the gap in developing countries—discover the strategies that could make the difference.

Are Nano-Cures Only for the Rich? The Accessibility Issue

Could nano-cures truly be accessible to all, or are barriers keeping breakthroughs out of reach? Discover the ongoing efforts shaping their future.

Who Owns Nanotech? Patents, Access, and Inequality

Who owns nanotech patents and how do these structures influence access and inequality? Discover the surprising global dynamics shaping innovation.

DIY Nanotech: When Enthusiasts Build Labs in Their Garage

Pioneering enthusiasts are transforming garages into DIY nanotech labs, unlocking innovative possibilities—discover how you can join this groundbreaking movement.