Skip to main content

When Missing Files Break Mental Models

When Missing Files Break Mental Models digs into what happens when your code layout lies to you. If paths don’t match expectations, how far does the damage go?

Code Cracking
15m read
#softwareengineering#devexperience#codebase#mentalmodels
When Missing Files Break Mental Models - Featured blog post image
Mahmoud Zalt

1:1 Mentor

Are you a software engineer moving into AI?

Let's have a call. I'll help you modernize your skills and learn the tools, systems, and architecture behind real AI products. One session or ongoing.

Hire AI Employees

Hire AI employees that work 24/7. No code.

We’re examining how the Ollama project handles a surprisingly common failure mode: a critical path in the repository that doesn’t actually contain code. Ollama is an open‑source system for running and serving language models, and its runner subsystem is central to orchestrating models like LLaMA. In the reported snapshot of the repo, the path runner/llamarunner/runner.go looks like the obvious entry point for that runner, yet the raw file returns nothing but 404: Not Found.

I’m Mahmoud Zalt, an AI solutions architect helping teams turn AI into ROI, and we’ll use this tiny 404 as a case study. The core lesson is that your repository layout is effectively a public API: when paths drift away from expectations, you quietly damage architecture, developer experience, and tooling.

The Street Address with No Building

The report tells us the directory path exists in the Ollama repository structure, and everything about it suggests a key orchestration point for LLaMA models.

ollama/
  runner/
    llamarrunner/
      runner.go   (404 at provided raw URL; likely intended runner entry point)
      ...         (actual implementation may live in other Go files, not visible here)
A directory promising a LLaMA runner entry point that isn’t actually readable at the documented location.

When the analysis tried to fetch the file content, the “source” was simply:

404: Not Found
The full content returned from the raw URL—our only hard evidence.

A path like this in a widely used open‑source project is like a street address on a city map. Documentation, blog posts, READMEs, and tools inevitably point to it. When developers arrive and find no building there, they don’t just lose a few seconds—they lose confidence in the map itself and in their mental model of the system.

Structure as a Contract

Because we have no implementation to inspect, the question isn’t “how does the runner work?” but “what does this missing runner teach us about structure as an interface?”. That’s where this 404 becomes interesting for experienced engineers.

A mental model is the internal map developers build to understand a system: where control flows, how responsibilities are grouped, and where to look when something breaks. A path like runner/llamarunner/runner.go strongly suggests “this is the entry point for the LLaMA runner.” When that file is referenced in docs or tools but doesn’t contain the code, we create cognitive friction: extra work just to reconcile expectation with reality.

The analysis flags this as high-friction for new contributors in particular. Juniors—and even senior engineers who are new to the codebase—follow directory names, imports, and links to learn how the system is structured. When those landmarks lie to them, they waste time and start doubting everything else the structure implies.

Smell Impact on Developers Impact on Tooling
Missing or inaccessible source file New contributors can’t inspect or reason about a core component. Static analysis, importers, and generators fail on the broken path.
Undiscoverable actual implementation Time wasted hunting for the “real” runner; risk of editing stale copies. Hard‑coded paths in scripts or docs silently rot.
Drift between repo layout and expectations Confusion about what’s canonical and trustworthy. CI or build tooling may break in subtle, non-obvious ways.

This is the core lesson: your repository layout is a contract. Breaking that contract—by moving a core file without leaving any forwarding address—hurts onboarding, security review, and automation at the same time.

Stubs as Compatibility Layers

Suppose the real LLaMA runner code has already been moved elsewhere in the repo. How do we repair the contract without undoing the refactor? The analysis suggests a small but effective tool: restore the file as a stub that clearly redirects readers to the new home of the runner.

Here is the proposed shape of that stub, expressed as a self‑contained example:

// Package llamarrunner provides the entry point for running LLaMA models.
//
// Note: The implementation was moved to runner/llamarunner/runner_impl.go.
// This stub is kept to preserve compatibility with older tools and docs.
package llamarrunner

// Version indicates the current semantic version of the LLaMA runner API.
const Version = "v1"
Illustrative stub for runner/llamarunner/runner.go that documents the move and preserves compatibility.

This stub does almost nothing, and that’s the point. A good compatibility layer is intentionally boring:

  • Instant signposting: Anyone opening the file immediately learns where the real implementation lives.
  • Backward compatibility: Older tools or code that import llamarrunner continue to resolve a valid package, even if the internals moved.
  • Self-documenting architecture: The comment captures why the move happened, not just where the code went.
Why expose a simple Version constant?

A trivial exported constant gives downstream code a way to adapt to breaking changes. It’s a tiny API surface, but it can encode meaningful signals, such as when the runner’s configuration or behavioral contract changes, while still keeping the stub minimal.

Tooling, CI, and Drift

The missing file isn’t just a UX problem for humans; it has operational consequences. CI pipelines, code generators, and static analyzers often embed assumptions about where key packages live. When those assumptions drift, you get fragile automation that breaks unpredictably.

The analysis proposes a couple of simple repository‑level checks that turn these implicit assumptions into explicit guardrails.

Validate repository structure in CI

The first guardrail is to assert that the project still builds and that no tooling depends on a path that no longer contains real code.

# From the Ollama repo root

go list ./...

go build ./...

These commands are basic, but they act as a canary: if runner/llamarunner/runner.go (or its stub) becomes required again, or is accidentally removed, you’ll see failures early instead of via user‑reported bugs.

Identify and bless the canonical runner

The second piece is discovering where the real LLaMA runner now lives and making that location canonical.

# Example search to locate actual llamarrunner code
rg "llamarunner" -n .

Once you find the actual implementation, update docs and examples to reference it, and make sure the stub at runner/llamarunner/runner.go explicitly points there. That gives you a clean, linear chain:

  1. Existing links and tools → the stub file
  2. Stub file → documented new implementation path
  3. Docs and tests → the new canonical location

Actionable Takeaways

Starting from an empty file—literally a 404—we uncovered a broader point about how structure, tooling, and human cognition interact in real codebases. Even without source code to read, this single runner path makes it clear how easily mental models can break when the repository layout stops matching expectations.

Here are the practices worth carrying forward:

  • Treat paths as contracts. If a file path appears in public docs, examples, or blog posts, changing it is a breaking change. Plan migrations the same way you would for a public API.
  • Leave clear forwarding stubs. When you move or delete a core file, add a minimal stub with comments that explain where the new implementation is and why it moved.
  • Automate structure checks. Add simple CI checks (for example, go list ./... and go build ./...) that assert key packages and paths exist and compile, catching accidental regressions early.
  • Design for discoverability. Directory names like runner/llamarunner set strong expectations. Either satisfy those expectations or explicitly redirect them for both humans and tools.

We spend a lot of time optimizing algorithms and abstractions, but this runner/llamarunner/runner.go episode is a reminder that some of the most consequential engineering work is simpler: keeping our maps honest, our addresses valid, and our collaborators—human and automated—able to find what they need without getting lost.

Full Source Code

Direct source from the upstream repository. Preview it inline or open it on GitHub.

heads/main/runner/llamarunner/runner.go

ollama/ollama • refs

Choose one action below.

Open on GitHub

Thanks for reading! I hope this was useful. If you have questions or thoughts, feel free to reach out.

Content Creation Process: This article was generated via a semi-automated workflow using AI tools. I prepared the strategic framework, including specific prompts and data sources. From there, the automation system conducted the research, analysis, and writing. The content passed through automated verification steps before being finalized and published without manual intervention.

Mahmoud Zalt

About the Author

I’m Zalt, a technologist with 16+ years of experience, passionate about designing and building AI systems that move us closer to a world where machines handle everything and humans reclaim wonder.

Let's connect if you're working on interesting AI projects, looking for technical advice or want to discuss anything.

Support this content

Share this article

CONSULTING

AI consulting. Strategy to production.

Architecture, implementation, team guidance.