TL;DR

Threlmark treats disk storage as the single source of truth, making data portable, safe, and easy to sync. This design simplifies collaboration, offline work, and tool integration without complex databases.

Ever wonder how some apps seem to work perfectly offline, sync seamlessly across devices, and stay simple under the hood? Threlmark’s secret is its radical approach: it treats your disk as the contract for all data. No server, no cloud, just files. That’s it. And it’s powerful. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

In this article, you’ll see how this design flips the usual model on its head. You’ll learn why the on-disk layout is the heartbeat of the system, how it makes data safe and portable, and what it means for developers who want a simpler, more resilient way to build project tools.

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
8GB Flash Drive 10 Pack Bulk USB Flash Drives, USB2.0 Thumb Drive USB Stick for Data Storage Backup, Jump Drive Pen Drive Zip Drive Memory Stick with Indicator, USB Storage Flash Drive Swivel Design

8GB Flash Drive 10 Pack Bulk USB Flash Drives, USB2.0 Thumb Drive USB Stick for Data Storage Backup, Jump Drive Pen Drive Zip Drive Memory Stick with Indicator, USB Storage Flash Drive Swivel Design

10 Pack USB Sticks: 10 pieces of USB flash drives are fit for a variety of scenarios. Whether…

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
iPhone and iOS Forensics: Investigation, Analysis and Mobile Security for Apple iPhone, iPad and iOS Devices

iPhone and iOS Forensics: Investigation, Analysis and Mobile Security for Apple iPhone, iPad and iOS Devices

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
PNY 256GB Attaché X USB 3.2 Gen 1 Flash Drive, Advanced Performance Up to 130MB/s Read, Everyday Data Store & Transfer, Reliable Portable Storage, Durable, Type-A, Computers, Laptops, Desktops

PNY 256GB Attaché X USB 3.2 Gen 1 Flash Drive, Advanced Performance Up to 130MB/s Read, Everyday Data Store & Transfer, Reliable Portable Storage, Durable, Type-A, Computers, Laptops, Desktops

Performance: Advanced read speeds of up to 130MB/s for everyday data storage & transfers²

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

  • Threlmark’s core idea is using the disk layout as the single source of truth, simplifying data management.
  • Atomic file writes prevent corruption and make the system restartable without complex lock mechanisms.
  • Single-file per item prevents conflicts and race conditions during concurrent updates.
  • Self-healing board files keep the workflow consistent and tidy without manual intervention.
  • Open JSON files allow any external tool or AI agent to participate effortlessly, fostering collaboration.

How Threlmark Turns Your Disk Into the Single Source of Truth

Threlmark’s architecture is built on one simple idea: the files on your disk are the database. Each project, card, and even the flow of work lives as a JSON file. This means every change, every update, is just a file write. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Imagine editing a task directly in your file explorer—your app reads and writes files in a predictable, atomic way. No server needed. No complex syncing protocols. Just a folder full of JSON files that represent your entire project ecosystem.

For example, your project folder might look like this:

  • threlmark.json: your manifest
  • items/123.json: a task card
  • board.json: your lane order
All these files are the contract—if you change them, your app reflects those changes immediately.

How Threlmark Turns Your Disk Into the Single Source of Truth
How Threlmark Turns Your Disk Into the Single Source of Truth

Why This Simple Disk Approach Makes Everything Easier

Using files as the source of truth isn’t just elegant—it solves real problems. First, it makes your data portable. Copy the whole folder, and you have your project. No database migration or complex export needed. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Second, it’s super safe. Because every write is atomic, you never get a corrupted file. And if your app crashes mid-save, the old data remains intact. Think of it like a safety net for your work.

Third, it’s open and interoperable. Any tool that can read and write files can join your project. Want to hack on your data with a script? Just modify JSON files. Need to migrate to another system? Copy and go.

How Threlmark Ensures Data Safety with Atomic Files

Atomic writes are the backbone of safe file-based data. Instead of overwriting a file directly, Threlmark writes to a temporary file first. Only after the write completes does it rename the temp file over the original. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

This process guarantees that you never end up with a half-written or corrupt file, even if your system crashes. Imagine saving a big document—your app does the same, replacing only when the data is fully written.

For example, updating a task involves writing a new JSON to a temp file, then renaming it. This simple step makes your data resilient and trustworthy.

How Threlmark Ensures Data Safety with Atomic Files
How Threlmark Ensures Data Safety with Atomic Files

The One File Per Item Strategy: No Collisions, No Claps

Instead of a giant list of tasks in one file, Threlmark keeps each task as its own JSON file in the items/ folder. This prevents race conditions when multiple tools update different cards at the same time. Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Think of it like a deck of index cards—each one stands alone, easy to read or change without disturbing the others. The folder contains all current tasks, with the app reading and writing individual files as needed.

Plus, the system self-heals: whenever you load your project, it checks that all cards listed in board.json actually exist in items/. Missing cards are ignored or cleaned up, keeping everything consistent.

How the Board Self-Heals and Keeps Your Workflow Smooth

The board.json file tracks your lane order and task statuses. But it doesn’t just sit there. Every time you load your project, Threlmark compares the list with actual task files. Missing or orphaned cards get cleaned up automatically.

This means your workflow stays clean and accurate without manual cleanup. It’s like having a smart editor that always keeps your task board tidy—even if you accidentally delete a card or get out of sync.

For example, if a task file is deleted outside the app, the next load automatically removes it from the board, preventing clutter and confusion.

How the Board Self-Heals and Keeps Your Workflow Smooth
How the Board Self-Heals and Keeps Your Workflow Smooth

Making Files Play Nicely with External Tools and AI Agents

Because the data lives as plain JSON files, any tool or AI agent can join in. No special API or database commands needed. Just read, modify, and write files. List of

This openness allows external tools like IdeaClyst or custom scripts to participate. For example, an AI agent can analyze your tasks, suggest improvements, and move cards to ‘Done’—all by editing JSON files directly.

It’s like giving everyone a shared notepad instead of a locked cabinet. Collaboration becomes frictionless and transparent.

Sync Without a Server: How Threlmark Handles Offline and Multiple Devices

Threlmark’s local-first approach means your data is always on your disk. When devices connect, you sync changes by copying files between folders or using sync tools like Dropbox or Syncthing.

Imagine working on your laptop at home, then picking up your tablet—your JSON files stay the same. When connected, your files sync in the background, keeping everything up to date.

This model makes your app resilient to outages. You can work offline for days, then sync when you’re back online—no fuss.

Sync Without a Server: How Threlmark Handles Offline and Multiple Devices
Sync Without a Server: How Threlmark Handles Offline and Multiple Devices

Practical Tips for Building Your Own Disk-First App

  1. Use atomic writes: Always write temp files and rename to avoid corruption.
  2. Keep each item in its own file: Prevent race conditions and make updates simple.
  3. Implement self-healing: Reconcile your folder contents on load to keep things tidy.
  4. Make data portable: Use JSON files so tools can read and write your data easily.
  5. Design for offline: Sync changes via file copying, not just online updates.

Frequently Asked Questions

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

Threlmark uses atomic writes on individual files, so conflicts are rare. It relies on read-merge-write patterns, and if conflicts occur, last-write-wins. For more advanced conflict resolution, custom merge strategies can be added.

Can I use Threlmark with other tools like Notion or Trello?

Yes. Since all data is stored as JSON files, you can sync or import/export with other tools. Threlmark’s open format makes integration straightforward, especially when combined with file sync tools like Dropbox or Syncthing.

What happens if a file gets corrupted or lost?

Because each item is a separate JSON file, corruption is localized. Restoring from a backup or a previous version of the file system can recover lost data. Atomic writes also minimize the chances of corruption happening in the first place.

Is this approach suitable for large projects?

For very large projects, managing thousands of JSON files can become cumbersome. However, with careful organization and indexing, the approach scales well, especially for teams that value transparency and offline access.

How does Threlmark’s architecture compare to traditional databases?

Unlike databases, Threlmark avoids the complexity of server management, migrations, and lock-in. It focuses on simplicity, portability, and offline resilience, making it ideal for personal, small-team, or hybrid workflows.

Conclusion

Threlmark’s disk-as-contract approach shows that simplicity and transparency beat complex databases every time. By making your data files the source of truth, you gain control, resilience, and flexibility.

Imagine a project tool that’s as easy to hack as editing a text file—no lock-in, no cloud dependency. That’s the power of thinking of your disk as the contract. Your next project might just be a folder away.

You May Also Like

Four-Season Tents and the Tradeoff Between Weight and Protection

Knowledge of four-season tents reveals a crucial tradeoff between weight and protection that could impact your ultimate camping experience.

Chainsaws, Land Work, and Safe Property Stewardship

Guidelines for safe chainsaw use and land work ensure effective property stewardship—discover essential tips to protect yourself and your land.

Utility Carts and Wagons for Heavy Harvest Days

Inefficient transport can hinder your harvest, but discovering the right utility carts and wagons can transform your workflow—keep reading to learn how.

How Dutch Ovens Support Rustic and Reliable Camp Meals

Pioneering outdoor cooks rely on Dutch ovens for rustic, reliable meals that transform simple ingredients into unforgettable campfire dishes.