TL;DR

Threlmark treats the on-disk JSON files as the primary data source—no database needed. This design enables offline work, fast local access, and simple synchronization, making it ideal for resilient, portable apps. It’s a straightforward approach with big benefits for modern workflows.

Imagine working on your project without waiting for a server to respond. No cloud dependency. Just your disk, your files, and the freedom to work offline or online seamlessly.

That’s the core idea behind Threlmark’s architecture. It’s a bold shift from traditional client-server models, putting the disk front and center as the source of truth. This approach promises speed, resilience, and simplicity—if you’re willing to embrace some discipline around file structure and sync mechanics.

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
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.

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
SUUNTO Nautic S Dive Watch Computer w/Bright AMOLED Display, GPS, Offline Maps and Weather Tools, Wireless Tank Pressure, Up to 60H on a Single Charge

SUUNTO Nautic S Dive Watch Computer w/Bright AMOLED Display, GPS, Offline Maps and Weather Tools, Wireless Tank Pressure, Up to 60H on a Single Charge

Bright AMOLED Display for Superior Readability-Enjoy crystal-clear visibility underwater with a bright AMOLED screen, designed for easy reading…

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
Project Planner: Management Notebooks Organizer & Work Log Book Tracker With Checklist Brainstorming for Entrepreneurs, Managers & Small Business Owners

Project Planner: Management Notebooks Organizer & Work Log Book Tracker With Checklist Brainstorming for Entrepreneurs, Managers & Small Business Owners

TURN YOUR IDEAS INTO REALITY: Unleash your creativity with this unique planning notebook, consisting of 224 pages divided…

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 disk as the single source of truth—your data lives in JSON files, making it transparent and portable.
  • One file per item avoids race conditions and simplifies concurrency, even in multi-tool environments.
  • Atomic writes ensure data durability and prevent corruption during crashes or interruptions.
  • Forward-compatible JSON schemas allow seamless evolution without breaking older tools.
  • Local-first architecture offers speed, resilience, and offline capability—ideal for distributed, dynamic workflows.

What does “disk is the contract” actually mean?

‘Disk is the contract’ means your data lives on your local disk, and that file system defines what’s true. Every change, every state, is a JSON file you can open, read, and modify directly.

Think of it like a shared notebook where every project, task, or idea lives in its own page. No middleman, no database—just a set of files that act as the single source of truth.

For example, Threlmark stores each card as a separate JSON file inside an ‘items’ folder. When you open your project, you’re reading and writing these files directly. It’s simple, transparent, and portable. You can learn more about local-first architectures.

What does “disk is the contract” actually mean?
What does “disk is the contract” actually mean?

Why choose local-first instead of traditional client-server?

Local-first software like Threlmark feels faster because it avoids round trips to a server. Your computer reads and writes directly to files, making interactions immediate and smooth.

Imagine editing a task list on your laptop and seeing instant updates without waiting for the cloud. That’s the power of local-first. Plus, you keep working during outages—your data remains accessible even if the internet drops.

For instance, Threlmark’s architecture lets you work offline on a plane, then sync changes later. It’s resilience in action, not just convenience.

How does Threlmark sync data across devices and handle conflicts?

Threlmark uses a layered approach for sync, built around files. Changes made on one device are tracked in individual JSON files, then merged or updated on others during sync.

When two devices edit the same card offline, conflicts are resolved through a merge strategy. The system preserves unknown keys, so no data is lost even if a newer version adds new fields.

For example, you might edit a task on your phone and your laptop offline. When you reconnect, Threlmark compares the JSON files, merges updates, and keeps everything consistent.

How does Threlmark sync data across devices and handle conflicts?
How does Threlmark sync data across devices and handle conflicts?

What does the JSON-on-disk data model look like?

The core of Threlmark is a set of neatly organized JSON files. Each project has a folder, with individual cards stored as separate files inside an ‘items’ directory.

For example, a card’s JSON might look like:

{"id": "123", "title": "Finish report", "status": "next", "createdAt": "2024-04-01T10:00:00Z", "updatedAt": "2024-04-02T15:00:00Z"}

This simple format makes it easy to inspect, diff, and migrate data, and any tool can read or write these files without special permissions.

How does Threlmark handle schema migrations and data evolution?

Schema changes are managed by updating the JSON format and ensuring older files remain readable. Threlmark’s design preserves unknown keys, so new fields can be added without breaking older tools. For more on this approach, see disk as the contract.

More importantly, this approach allows for flexible data evolution. When you introduce new fields or structures, older files still function because the system ignores unknown keys during parsing. This means you can incrementally upgrade your data and tools without disrupting existing projects.

For example, if you decide to add a ‘priority’ field to all cards, you can write a script that updates each JSON file without rewriting the entire dataset. This incremental migration reduces downtime and minimizes risk, enabling continuous improvement of your data model.

How does Threlmark handle schema migrations and data evolution?
How does Threlmark handle schema migrations and data evolution?

What are the benefits of a file-per-item approach?

Using one file per item avoids race conditions common with large JSON arrays. Each card can be updated independently, making concurrency safe and straightforward. This is a key benefit of file-per-item approach.

Imagine two different tools editing separate cards at once—no conflicts, no locks. Threlmark’s architecture also allows self-healing of the project board, which reconciles itself every time it’s read.

For example, updating a task doesn’t require reading and rewriting the entire roadmap; just the one card’s JSON file. This modular approach simplifies collaboration, reduces the chance of conflicts, and improves resilience against partial failures or corruption.

What tradeoffs come with a disk-based architecture?

While simplicity and portability are big wins, managing conflicts, migrations, and sync can get complex. You need discipline around file structure and conflict resolution strategies.

For example, if multiple users or tools modify files simultaneously without proper coordination, conflicts can escalate, leading to data inconsistency. Additionally, large projects with many files may slow down file operations or require more sophisticated indexing and synchronization tools.

Furthermore, this approach assumes users are comfortable with manual troubleshooting and understanding file-based workflows. It’s powerful but requires a disciplined mindset and good practices to avoid pitfalls that could compromise data integrity.

What tradeoffs come with a disk-based architecture?
What tradeoffs come with a disk-based architecture?

How to start implementing a local-first JSON system like Threlmark

  1. Define a clear folder structure for your JSON files and metadata.
  2. Use atomic write techniques: write to temp files, then rename, to prevent corruption.
  3. Design your JSON schema to be forward-compatible, preserving unknown keys.
  4. Implement a self-healing board that reconciles state on read.
  5. Build or adopt a sync layer that compares files and merges changes.

For example, start with a simple folder of JSON cards, then add sync logic to handle offline edits and conflict resolution.

Frequently Asked Questions

What does “disk is the contract” actually mean?

It means your data is stored directly on your disk as JSON files, and these files define what’s true. No database, no cloud dependency—just files you can open, edit, and trust.

How does Threlmark sync data across devices?

Threlmark tracks changes in individual JSON files and compares them during sync. Conflicts are resolved through merging strategies that preserve unknown fields, ensuring consistency across devices.

Is JSON-on-disk a database?

Not exactly. It’s a simple, file-based persistence layer that acts like a lightweight database, but with the advantages of transparency, portability, and simplicity. It’s more like an event log in files than a traditional database.

How are schema migrations handled?

Schema updates are managed by scripts that modify existing JSON files or add new fields, all while preserving unknown keys for backward compatibility. This keeps your system flexible as it evolves.

What applications benefit most from this architecture?

Tools that need offline capability, fast local interactions, and portability—like task managers, note-taking apps, or collaborative design tools—are perfect fits for this approach.

Conclusion

Threlmark’s approach turns the familiar disk into a powerful contract—where your project data is always accessible, always under your control. It shifts the focus from server uptime to local discipline, simplicity, and portability.

Next time you think about data storage, imagine your files as the true record—clear, inspectable, and ready to move at a moment’s notice. That’s the real promise of the disk-first revolution.

You May Also Like

You Won’t Believe How Precious Metals Starter Kit Can Secure Your Future

Opportunity awaits with a precious metals starter kit that could transform your financial security—discover the secrets to safeguarding your future today.

Understanding Credit Scores and How to Improve Them

Start mastering your credit score today to unlock better loans and interest rates—discover the secrets to boosting your financial future!

You Won’t Believe How Smart Floodlight Camera Can Secure Your Future

Smart floodlight cameras revolutionize home security with advanced features that keep your future safe—discover how they can transform your protection today.