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

TL;DR

Threlmark treats local disk storage as the core record, making data portable, safe, and offline-first. Sync happens in the background, while files on disk are the ultimate authority—changing how we think about data integrity and collaboration.

Imagine a project tool that never loses your data, works offline without fuss, and can be shared with anyone—no cloud required. That’s the promise of Threlmark’s local-first architecture. It shifts the focus from centralized servers to your disk, turning your file system into the single source of truth.

Why does this matter? Because it rewires how we think about data safety, collaboration, and resilience. Instead of depending on a fragile network connection or a proprietary database, Threlmark’s design makes your files the contract—simple, transparent, and portable.

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

Information Technology 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
128GB Flash Drive Aiibe USB Flash Drive 128 GB Thumb Drive USB 2.0 Memory Stick Zip Drive Backup Jump Drive Single 128GB 128G USB Drive for PC Laptop

128GB Flash Drive Aiibe USB Flash Drive 128 GB Thumb Drive USB 2.0 Memory Stick Zip Drive Backup Jump Drive Single 128GB 128G USB Drive for PC Laptop

Large Data Storage Capacity: Flash Drive with 128GB capacity, meet your needs of daily use on work, school,…

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
Json Genie Premium: JSON Editor, Viewer & Formatter

Json Genie Premium: JSON Editor, Viewer & Formatter

Open, view, and edit JSON and JSONC files with a fast tree-based interface

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 local disk files as the ultimate source of truth—every change is a file update, making data transparent and portable.
  • Use atomic write patterns to prevent corruption—write to a temp file, then rename, ensuring safe updates even on crashes.
  • Break data into one file per item—this simplifies concurrency, conflict resolution, and offline work.
  • Design self-healing structures—boards and lanes automatically reconcile themselves to stay consistent.
  • Background sync runs seamlessly, merging changes with deterministic algorithms, supporting offline work and multi-device sync.

What does ‘disk is the contract’ really mean for your data?

The phrase ‘disk is the contract’ means that your data’s primary copy lives on your local disk, not in a database or cloud. Every file in Threlmark, from cards to dependencies, acts as the authoritative record. Think of it like a shared notebook where everyone writes, reads, and updates from the same pages.

For example, when you add a task or move a card in Threlmark, it’s just a file change. No API call required. This makes everything transparent and easy to verify—just open the file, see the current state, or revert changes with a simple diff.

It also means your data isn’t trapped in a proprietary format. You can back it up with a copy-paste, sync it with Dropbox, or move it between machines without fuss.

What does ‘disk is the contract’ really mean for your data?
What does ‘disk is the contract’ really mean for your data?

How does Threlmark keep your data safe and consistent?

Threlmark uses two key patterns to make file-based data safe. First, atomic writes. Every change writes to a temporary file, then renames it over the original—guaranteeing you never get a half-written, corrupted file. Second, **read-merge-write**. When updating a file, it reads the current state, merges in your changes, and rewrites it without overwriting others’ edits.

For instance, if two tools update different cards simultaneously, each makes an atomic write. The system ensures no data is lost or clobbered, even if a crash happens mid-save.

This disciplined approach keeps your data trustworthy. No crashes or conflicts can corrupt your files, and everything remains compatible across updates.

Why one file per item beats a giant JSON list

Many tools store all tasks in a single JSON array—dangerous when multiple updates happen at once. Learn more about home entertainment, audio equipment, and technology guides. Threlmark breaks that mold by giving each item its own JSON file. This means each task is a tiny, atomic piece, making concurrent updates safe and easy.

For example, updating a card’s status doesn’t require rewriting the entire list. You just replace one file—no locks, no race conditions. It’s like editing a single page in a notebook instead of rewriting the whole notebook each time.

This design simplifies syncing, merging, and conflict resolution—crucial for offline work and multi-device sync.

Why one file per item beats a giant JSON list
Why one file per item beats a giant JSON list

How does Threlmark handle the ‘flow’ and status of tasks?

Threlmark’s board isn’t just a static list. It’s a self-healing structure that reconciles itself each time you read it. The lane order and card statuses aren’t stored as a single big list but as ordered references that check themselves against actual items.

For example, if you move a card from ‘In Progress’ to ‘Done,’ the system updates the lane order file, then on each read, it verifies the card still exists. If a card is missing, it automatically heals the lane by removing references.

This approach keeps your workflow consistent, even if external edits or crashes happen. It’s like a smart map that always corrects itself.

How background sync and conflict resolution work behind the scenes

In Threlmark, sync isn’t the core—it’s the background process. For more on technology trends, visit gadgetfee.com. Changes made on one device are detected by comparing files. When connected, the system pushes updates automatically, merging changes with deterministic algorithms like CRDTs or simple timestamp-based merges.

Suppose two devices update the same card differently offline. When synced, Threlmark compares the files, detects conflicts, and merges them predictably—e.g., latest timestamp wins or custom merge rules.

This background sync means you can work offline without losing data. When online again, everything updates smoothly, preserving your work without manual intervention.

How background sync and conflict resolution work behind the scenes
How background sync and conflict resolution work behind the scenes

What about privacy, encryption, and ownership?

Local-first means your data stays under your control. Files on disk can be encrypted easily, and you decide how to share or sync. No third-party server sees your raw data unless you choose to upload it.

For example, you might encrypt your `threlmark/` folder with GPG or a filesystem encryption tool. When syncing, only encrypted blobs move around, keeping your project details private and secure.

This approach aligns with privacy-first principles—your data, your rules.

What are the tradeoffs and potential pitfalls?

Moving from a server to local files shifts complexity to the client. Handling conflicts, ensuring atomicity, and managing sync logic become your responsibility. If not done carefully, it can lead to tricky bugs or data loss.

For example, a poorly managed conflict might overwrite someone’s work. Or, if sync fails silently, you might think your data is safe when it’s not.

But with disciplined patterns—like atomic writes and self-healing structures—these risks are manageable. Still, it’s a different mindset from traditional cloud apps.

What are the tradeoffs and potential pitfalls?
What are the tradeoffs and potential pitfalls?

Real-world use cases: why teams love local-first systems

Teams working in remote or disconnected environments find Threlmark invaluable. For example, a design team on a plane can update tasks, then sync when they land. It’s also perfect for privacy-sensitive projects, where data never leaves the local device unless explicitly shared.

In practice, companies use it for product roadmaps, personal task management, and even collaborative planning—where trust, resilience, and portability matter most.

It’s not just a niche; local-first is becoming a practical, scalable approach for many kinds of teamwork.

What does this mean for developers and product teams?

For developers, building with a disk-is-the-contract mindset means focusing on file-based APIs, atomic operations, and conflict resolution. It simplifies deployment and scaling—no need for a complex backend.

For product teams, it delivers faster responses, better privacy, and greater control. Plus, you sidestep many server-side headaches—no database migrations, no API bloat.

In short, it’s a fresh way of thinking that puts resilience and portability at the center.

Frequently Asked Questions

What is meant by ‘disk is the contract’ in Threlmark?

It means the primary source of truth for all data is stored directly on your local disk, with files representing each piece of information. No external database or server holds the authoritative data—your files do.

How does Threlmark handle conflicts when multiple devices edit offline?

Threlmark uses deterministic merging strategies, like timestamps or custom rules, to reconcile conflicting changes. It compares files during sync and merges changes automatically, preserving data integrity.

Is local-first architecture secure and private?

Yes. Since data resides on your device, you can encrypt files and control sharing. No third-party server sees your raw data unless you explicitly upload or share it.

Can Threlmark work without a network connection?

Absolutely. Its design allows you to read, write, and manage your projects offline. Sync happens in the background once you reconnect, ensuring seamless continuity.

What are the main tradeoffs of a disk-centric approach?

The main challenge is managing conflicts and ensuring atomic, safe updates on the client side. It also shifts complexity from server infrastructure to local logic, requiring careful design and discipline.

Conclusion

Threlmark’s approach proves that disk isn’t just storage—it’s the contract. By making files the authoritative record, it creates a resilient, portable, and privacy-friendly architecture that shifts the power back to users and developers alike.

Imagine your project data as a living document on your disk—always consistent, always in your control. That’s the future of robust, offline-capable tools that work everywhere, all the time.

What does this mean for developers and product teams?
What does this mean for developers and product teams?
You May Also Like

When a Content Network Starts Publishing to Itself

Discover how internal publishing shifts a content network’s value, creates network effects, and transforms SEO, revenue, and privacy. Learn what to watch for.

How Indie Games Are Changing Pay Models for VO

Sparking a shift in voice-over pay models, indie games embrace innovative methods that could redefine industry standards—discover how this transformation unfolds.