Skip to content

About

Fully-local AI coding agent kernel for C#/.NET: a 30B Qwen3-Coder model on your GPU plans, writes, fixes compile errors and verifies code. Data-injected symbol tables (not prompts), automatic rollback, web dashboard. E2E 7/7, 864 tests.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

263 Commits

Folders and files

Repository files navigation

LocalCodeForge

A fully-local AI coding agent kernel for C#/.NET β€” it plans, writes, builds, fixes compile errors, and verifies your project, powered by a 30B model on your own GPU. No cloud. No code leaves your machine.

Build Tests E2E License


Why another coding agent?

Most coding agents are prompt-based: they try to behave correctly because a giant system prompt tells them to. LocalCodeForge is data-injected: the model receives the actual engineering facts it needs β€” type inventories with signatures, access modifiers, symbol indexes β€” so it has no room to hallucinate. When it does fail, the kernel fixes and rolls back deterministically, not by hoping the model "behaves better."

Three things make it different:

  1. Engineering awareness as data, not prompts β€” type inventory with member signatures + access modifiers is injected before generation; a compile error is located to the exact file before the fix round begins (LocateErrorFile).
  2. A closed fix loop with a safety net β€” write β†’ dotnet build/run β†’ on failure: locate, fix, retry; on repeated failure: automatic rollback to the pre-task state (task-id isolated backups).
  3. Verifiable, not vibes β€” deterministic routing (rule-based intent classifier), advisory expected_output semantics for real computation, and an E2E suite (7/7 green) that distinguishes completed, safely blocked, and broken.

Demo: incremental task on a real project β€” new class, compile, run, done

Demo GIF: add a screen recording of a ShippingService-style incremental task (new class reusing existing services β†’ compile β†’ run β†’ output).


Quick start

# 1. Serve the local model (Ollama; 30B Qwen3-Coder-A3B, single tag "law-unified")
ollama pull law-unified

# 2. Build (solution file is LocalCodeForge.slnx β€” internal name pending rename)
dotnet build LocalCodeForge.slnx --no-incremental

# 3. Run, point at your project in write mode, then just describe the task
dotnet run --project src\Agent.Cli\Agent.Cli.csproj
> use --write X:\path\to\your\project
> add a ShippingService class that reuses TaxService and DiscountService, wire it into Program.cs

The web dashboard is the primary interaction surface: the CLI auto-launches it on startup (loopback + token) and opens your browser, with live task streams, stats, history, backup diff, rollback and one-click rerun. The CLI itself stays as a fallback (pipeline/headless safe) β€” every command keeps working.


What it can do

Mode Example Behavior
Read / query "read Order.cs and summarize" AgentLoop, converges with a summary
Single file "write hello.py printing Hello E2E" Generates + verifies
Multi-file project "C# student system: Student model, StudentService, Program" Planner orchestrates files + run
Incremental task "add ShippingService reusing TaxService/DiscountService, wire into Program.cs" Planner β†’ write β†’ build β†’ fix β†’ run β†’ done (3 consecutive green runs: 68s / 69s / 121s)
Modify existing code "add CalculateFinalTotal to OrderService, switch Program.cs to call it" Safely blocked by pre-write type-conflict guard if the model rewrites existing types (P-D)

Architecture at a glance

User input
   β†’ TaskClassifier (deterministic intent) β†’ SimpleQA / AgentLoop
                                          β†’ Orchestrator
   β†’ Planner (multi-file plan + run/verify spec)
   β†’ Executor (type inventory + signature injection β†’ write)
   β†’ Verify (dotnet build/run; compile-error β†’ LocateErrorFile β†’ fix loop)
   β†’ Done | Rollback (task-id isolated backups, dry-run preview)

Event stream β†’ SQLite β†’ web dashboard (SSE live updates, task replay, rollback).


Tech stack

Component Choice
Runtime .NET 10 (do not downgrade)
Model Qwen3-Coder-A3B 30B via Ollama (OpenAI-compatible, single tag, request-level temperature)
Orchestration Semantic Kernel 1.80.1
Storage SQLite (sessions, symbols, memory, metrics, events)
UI Local web dashboard (loopback + token auth, SSE)

Docs

  • docs/DEVELOPER.md β€” how to maintain & extend (deterministic rules, data schemas, E2E cases)
  • docs/DEVELOPER_DETAILED.md β€” deep walkthrough
  • docs/HANDOVER.md β€” change history & pitfalls (incl. the failure-point migration chain: hallucination β†’ signature injection β†’ advisory semantics β†’ 3 consecutive completions)

License

MIT β€” the LICENSE file is pending; feel free to use under MIT terms meanwhile.


Star if you believe local-first engineering is the way. Issues and PRs welcome.

About

Fully-local AI coding agent kernel for C#/.NET: a 30B Qwen3-Coder model on your GPU plans, writes, fixes compile errors and verifies code. Data-injected symbol tables (not prompts), automatic rollback, web dashboard. E2E 7/7, 864 tests.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages