The persistent failure mode of local LLMs in software engineering is their inability to reliably understand existing codebases without hallucinating dependencies and control flows. Gen-system, a new open-source project by developer hpdkhoa, tackles this by decoupling code analysis from generation. Instead of asking a model to guess what a routine does, the tool uses hand-written parsers for Go, COBOL, Java, TypeScript, and Python to build deterministic syntax trees, symbol indexes, and control flow graphs. This ensures that the 'facts' fed to the model are derived from the code itself, not the model's probabilistic interpretation.

The Belief System Architecture

Gen-system operates on a concept called 'beliefs,' which are assertions about a routine’s inputs, outputs, and side effects. These beliefs are initially generated by the parsers, guaranteeing that the same code always yields the same graph. Local models, specifically qwen3:14b for planning and qwen2.5-coder:14b for writing code, can propose additional claims, but the system rigorously checks these against the parser’s truth. If a model claim contradicts the parser, it is marked and ignored. Only beliefs verified by a human or the parser are allowed to steer the actual code generation process, creating a high-fidelity context window for the LLM.

Deterministic Generation and Compilation Gates

The generation pipeline is unforgiving: every operation generated by the model must compile individually before it is integrated into the final service. If a code block fails to compile after two repair attempts, it is replaced with a 'not implemented' stub, and the failure is counted in the run metrics. The system then runs go vet, go build, and go test on the assembled service. Benchmarks conducted on September 9, 2026, showed that the parsers achieved zero parse errors and 100% call resolution on 405 files, including 268 COBOL files. While the localization recall on SWE-bench tasks was 0.674, the tool’s primary value lies in its ability to produce compilable, grounded code rather than just solving algorithmic puzzles.

Integration with Modern AI Agents

For developers using AI coding assistants, Gen-system exposes its parsed facts via an MCP (Model Context Protocol) server. This allows tools like Claude Code, Cursor, and Codex to query the actual architecture, call graphs, and symbol effects of a codebase rather than relying on file scans. The understand-mcp component is read-only and links no generation code, ensuring that the analytical half of the tool remains stable and secure. By providing precise data on what functions touch databases, files, or networks, the tool reduces the cognitive load on the LLM, allowing it to focus on logic rather than structure.

Key Takeaways

  • Gen-system uses hand-written parsers to create deterministic code graphs, eliminating LLM hallucinations in structural analysis.
  • A strict 'compile-or-stub' gate ensures that generated Go services are syntactically valid before integration.
  • The tool integrates with MCP clients, providing agents like Claude Code with accurate call graphs and symbol effects.
  • Benchmarks show 100% call resolution on complex COBOL and Go codebases, though multi-GPU support is currently limited.

The Bottom Line

This is the most pragmatic approach to local LLM coding I’ve seen: stop asking the model to read code and start feeding it the parser’s truth. The compilation gate is a necessary evil that trades perfect functionality for guaranteed syntactic validity, which is exactly what enterprise adoption needs. If the stub rate can be lowered, this could finally make local models viable for serious legacy modernization work.