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

TL;DR

Threlmark treats the disk as the main contract, storing all project data in JSON files. This approach makes the system fast, portable, and compatible with external tools, all without a central database.

Imagine a project tool that works perfectly without an internet connection. No cloud, no login, just plain files sitting on your disk. That’s the core idea behind Threlmark’s local-first architecture. It challenges the typical client-server model and shows how simplicity and discipline can create powerful software.

In this deep dive, you’ll learn how Threlmark’s design turns the disk into the contract. We’ll explore how this choice impacts concurrency, external integrations, and even AI automation. If you’re curious about building or using tools that are fast, portable, and resilient, this is your inside look.

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 JSON file editor

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

offline project management tool

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

local-first roadmap 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

JSON file version control

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 source of truth by storing all data in plain JSON files, making your system transparent and portable.
  • Use atomic file operations—write to a temp file then rename—to ensure data safety during updates.
  • Keep each project item in its own file to avoid race conditions and improve concurrency.
  • Design your system to self-heal by reconciling views with the actual file state on each read.
  • Make your data accessible to external tools and AI by sticking to simple, readable file formats.

Why Using the Disk as the Main Contract Changes Everything

Threlmark’s key move is to treat the disk as the source of truth. Instead of a database or cloud storage, all data lives in plain JSON files. This makes the system instantly inspectable, portable, and compatible with any tool that can read files. It’s like turning your project management system into a set of well-organized notes you can open, edit, and back up with a simple copy-paste.

For example, each project has its own folder with a ‘project.json’ for metadata, ‘items/’ for cards, and ‘board.json’ for lanes. When you want to see your roadmap, you just read these files. Need to move a card? Write a new file or update an existing one. No server, no API, just files and edits.

This approach simplifies architecture because it eliminates the need for complex server-side logic or database management. It reduces points of failure, making the system more resilient to crashes or network issues. Additionally, it fosters interoperability—any external tool that can handle JSON can read or modify your data. However, this simplicity comes with tradeoffs: it may require careful handling of concurrent edits to prevent conflicts and may not be as performant for extremely large datasets without additional optimization. Still, for many use cases, this tradeoff favors flexibility and robustness over raw speed at scale.

Why Using the Disk as the Main Contract Changes Everything
Why Using the Disk as the Main Contract Changes Everything

How Threlmark Ensures Data Safety with Atomic File Operations

Using files for data storage sounds risky, but Threlmark makes it safe with atomic writes. Each change goes to a temporary file, then renames over the old one. Since rename is atomic on most file systems, you never end up with corrupted data, even if your computer crashes mid-save.

Imagine editing a card. The system writes to ‘item123.json’ in the background, then swaps it in seamlessly. This guarantees your data remains consistent and reliable, even during quick, repeated updates or power failures.

This technique ensures data integrity by preventing partial writes that could corrupt your files. It also allows for easier recovery—if a write is interrupted, the original file remains untouched until the new version is fully written and renamed. The tradeoff is that this process might involve slightly more disk I/O and require careful handling of temporary files, but it’s a proven method to maintain data consistency in file-based systems.

One File Per Item: How Threlmark Avoids Race Conditions

Instead of updating a big list of cards, Threlmark keeps each card in its own file, like individual pages in a notebook. This approach prevents race conditions—when two tools try to change the same data at once—since each file write is atomic.

For example, when an AI agent moves a card to ‘Done,’ it updates ‘items/abc123.json’ directly. External tools can also add or modify cards independently, without locking or complex coordination.

This modular approach reduces conflicts because each item is isolated. Changes to one card won’t accidentally overwrite another, and multiple tools can operate concurrently without stepping on each other’s toes. The tradeoff, however, is managing many small files, which can become cumbersome at scale if not handled properly. Nonetheless, this method significantly improves concurrency and simplifies conflict resolution, making the system more robust in multi-tool environments.

One File Per Item: How Threlmark Avoids Race Conditions
One File Per Item: How Threlmark Avoids Race Conditions

Making the Board Self-Healing and Consistent

The ‘board.json’ file tracks lane order and card placement. But what if a card gets deleted or moved outside the system? Threlmark reads the actual files in ‘items/’ each time, then reconciles the board accordingly. It’s like a self-healing map—always accurate.

For example, if a card is deleted, the next read automatically removes it from lanes. This keeps your roadmap clean and current without manual cleanup.

This self-healing process ensures the system maintains consistency between the visual representation and actual data. It reduces manual synchronization efforts and prevents stale or broken links. The tradeoff involves additional logic to reconcile state at each read, which can add complexity but results in a more resilient and trustworthy system overall.

Interoperability and External Tools: How Threlmark Plays Nice

Because all data is plain JSON files, any tool or script can read or write to Threlmark’s data. Want to add a custom automation? Drop a file in ‘suggestions/’ or update an item directly. Want to migrate your data? Just copy the files.

This openness means no vendor lock-in, and external apps like IdeaClyst can participate without permissions or APIs—just file access.

This approach encourages a vibrant ecosystem of tools and automation, but it also requires discipline in managing file formats and updates. It’s a tradeoff between flexibility and potential complexity in coordination. Nonetheless, this open design fosters innovation and integration without sacrificing control or security.

Interoperability and External Tools: How Threlmark Plays Nice
Interoperability and External Tools: How Threlmark Plays Nice

How Threlmark Supports AI and Automation Seamlessly

Threlmark’s design makes it easy for AI agents to participate. An AI can read the JSON files, understand what’s next, and even update the cards—like moving a task to ‘Done.’ It’s a closed loop, without complex APIs or server dependencies.

For instance, an AI assistant can scan ‘reports/’ for completed tasks, then update ‘items/’ directly, ensuring full automation with minimal fuss.

This seamless integration relies on the simplicity of the file structure—AI tools can parse, analyze, and modify data without needing special permissions or complex protocols. The tradeoff is that this approach depends on well-structured, consistent data formats and may require additional logic for conflict resolution in concurrent AI operations. Still, it opens the door for flexible automation and AI participation in a way that’s both straightforward and reliable.

What Are the Practical Benefits of a Disk-Centric Approach?

Using the disk as the contract isn’t just neat tech talk. It results in real-world gains:

  • Speed: No network delay. Your roadmap loads instantly.
  • Resilience: Offline work continues seamlessly, even if your internet drops.
  • Portability: Backup, migrate, or sync by copying files. No lock-in.
  • Transparency: You see every change as a file diff—easy to audit or revert.

These benefits aren’t just about convenience—they also shape how teams and individuals can operate more flexibly, securely, and with greater control over their data. The tradeoff is that managing many files and ensuring consistent updates requires discipline, but the payoff is a system that’s inherently robust, transparent, and adaptable to many workflows.

What Are the Practical Benefits of a Disk-Centric Approach?
What Are the Practical Benefits of a Disk-Centric Approach?

Key Takeaways: How to Apply Threlmark’s Ideas Today

  • Embrace file-based data: Use JSON files for all project info to stay portable and transparent.
  • Write atomically: Always save to a temp file, then rename, to keep data safe.
  • Keep items separate: One file per card prevents conflicts and simplifies updates.
  • Implement self-healing logic: Reconcile views with actual files to maintain consistency.
  • Open your data: Make it easy for external tools and AI to participate by reading/writing files.

Applying these principles ensures your system benefits from the simplicity, resilience, and interoperability that Threlmark exemplifies. While some tradeoffs exist, the overall impact is a more transparent, flexible, and robust project management approach.

Frequently Asked Questions

How does Threlmark handle conflicts if two tools update the same file at once?

Since each file update is atomic, tools either overwrite or leave the file untouched. Conflicts are minimized because updates happen one at a time. For more complex conflicts, you can implement manual merge or versioning strategies.

Can I integrate my favorite external tool with Threlmark?

Absolutely. Because all data is plain JSON files, any tool that can read and write JSON can participate. Just drop or modify files in the appropriate folders, and Threlmark will pick up the changes on the next read.

Is this approach suitable for large projects or teams?

Yes. The single-file per item model scales well with many tasks, and the system’s self-healing ensures consistency. However, for very large teams or complex workflows, consider additional layering or conflict resolution strategies.

How do I migrate existing project data to this disk-based system?

Simply convert your current data into JSON files following the structure described. Backup your files, then place them in the appropriate folders. Because the system is just files, migration is straightforward.

Conclusion

Threlmark’s approach proves that simplicity can be revolutionary. When the disk is the contract, your system becomes faster, safer, and more open. It’s a reminder that sometimes, the simplest design—just plain files—can unlock the most powerful workflows.

Next time you build or choose a tool, ask yourself: can I make the data transparent, portable, and resilient? If yes, you’re on the right track.

You May Also Like

14 Ways Natural Language Processing Transforms Customer Support in Business AI

Are you prepared to transform your customer service by utilizing the capabilities…

Hyper‑Personalized Ads: Balancing Conversion Rates With Consumer Trust

What are the key strategies brands use to balance hyper-personalized ads’ effectiveness and consumer trust?

Streamline Business Operations With AI Automation

Are you tired of dealing with inefficiency and roadblocks that are slowing…

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst transforms your idea process with a digital war room, making decision-making faster, clearer, and more confident—without leaving your laptop.