RE:CZ

Challenges and Solutions of CZON Link Checking with AI Repair

Troubleshooting

👤 Software developers, AI tool users, technical documentation maintainers
This article details the development process of CZON's link checking feature, from the initial implementation of dead link detection to the discovery of problems with AI-based repair. The author identifies two main issues with AI in link repair: it does not scan the entire project files by default, and it has insufficient understanding of relative paths. This leads to errors such as redirecting links to compilation output directories or creating symbolic links. By analyzing the root causes, the author proposes a solution: providing AI with a list of relative path candidates based on the problematic file, avoiding the need for AI to scan the entire project or interpret relative paths independently. Ultimately, CZON version 0.9.1 successfully fixed 500 link errors. The author concludes that compilation checks need to complement AI repair and designs a check output format suitable for AI.
  • ✨ CZON implemented a link checking feature, but errors occurred during AI repair
  • ✨ AI has insufficient understanding of relative paths and does not scan the entire project by default
  • ✨ The solution is to provide AI with a list of relative path candidates based on the problematic file
  • ✨ Compilation checks need to be designed in an AI-friendly format
  • ✨ CZON version 0.9.1 successfully fixed 500 link errors
📅 2026-02-09 · 457 words · ~3 min read
  • CZON
  • Link Checking
  • AI Repair
  • Relative Paths
  • Compilation Checks
  • MiniMax M2.1
  • OpenCode

It is now February 9, 2026, in the afternoon.

As I mentioned earlier, CZON has implemented link checking functionality, but there were a few minor hiccups along the way. Initially, I only implemented checks for dead links and links that point outside the project scope. This successfully detected some dead links, and I then fed these error messages to OpenCode + MiniMax M2.1 for fixing.

A typical case was: in .czon/AIGC/SUMMARY/summary-popular.md, there was a reference to ../LOGS/25.md. In reality, this was an AI hallucination—the link did not exist. The actual file was at LOGS/25.md, and the correct relative path reference should have been: ../../../LOGS/25.md.

However, MiniMax M2.1's fix was rather clumsy. At first, it scanned the entire project, found that .czon/src/zh-Hans/LOGS/25.md existed, and then changed the reference to ../src/zh-Hans/LOGS/25.md.

This changed the link to point to the compiled output directory, which was obviously incorrect.

So, I added a new rule to the link checker: it must not allow references to files under .czon/src.

As a result, the AI started searching for files under .czon/dist, which is even further downstream (the HTML static resource files). After I interrupted it, the AI clearly went haywire—it began creating symbolic links and even copying my original files all over the place in an attempt to pass the link check. But in reality, the environment was getting worse, with new files creating even more link errors. I had to interrupt everything and restore the entire environment. Sorry, AI, I shouldn't have called you stupid; I was just frustrated in the moment.

Alright, the real issues are:

  1. The AI Agent does not scan the entire project's files by default. This can be attributed to OpenCode's design scenario, which often needs to handle very large projects, making it impractical to scan all files by default.
  2. The AI itself has an insufficient understanding of relative paths. I saw this in its Thinking chain—it was trying to run some scripts and experiment to grasp the concept of relative paths. (By the way, I also can't always intuitively understand the result after many ../.. steps.)

The solution is:

I need to provide it with a list of candidate fixes for the links, presented in a relative path format based on the problematic file. This way, the AI won't need to scan the entire project or try to understand relative paths on its own.

npx czon@latest check

The link checking feature is already available in CZON version 0.9.1 and successfully enabled MiniMax M2.1 to fix 500 link errors, which is fairly efficient.

This experience made me realize that compilation checks and AI fixes need to complement each other. Compilation checks must be AI-friendly. However, the prerequisite for being AI-friendly is understanding the AI's limitations and designing a check output format that suits it.

See Also

Referenced By