bitreka

Software Engineering Leader | AI-Assisted Development | .NET & C# | FinTech & Payments | E-Commerce | Architecture • Backend • Microservices • DevOps • Test Automation • AI Agents

All work

ChatUxer

Describe a job in chat; the system turns it into a plan, waits for your approval and runs it as an isolated job.

Status
MVPA working first version with the core flows.
Role
Sole engineer: the architecture and the MVP skeleton across web, API, worker, LLM gateway and document service.
Started
Categories
AI and LLM, Automation
Parts
Web

Purpose

Let a user describe automation work — test automation, screen scraping, or app and RAG generation — in a chat, and get it done through an approved plan without the model ever deciding on its own what runs.

The problem

Chat-driven agents tend to act while they talk: side effects happen before anyone agreed to them, permissions and budgets are left to the model, and failed steps are retried blindly. For automation that touches real systems, that is not acceptable.

What I built

  • A boundary at plan approval: before it, everything is synchronous and cancellable; after it, the job is queued and runs isolated in a BullMQ worker behind a sandbox-provider abstraction.
  • A code-driven job state machine — queued, planning, awaiting approval, running or paused, then a terminal state — that neither the model nor the client can set directly.
  • An LLM gateway with a static task-to-model router and cost telemetry; only the gateway holds provider keys, and a hard per-job budget stops a job when it is exceeded.
  • Shared zod contracts for job states, events and queue names, and an idempotency class on every step so that only safe steps are ever retried.
  • A NestJS API with a fail-closed global guard and the organisation taken from a signed token, a Next.js chat UI with live job streaming over SSE, and module manifests for three job types.

Features

  • A chat screen where you describe a job, which becomes a plan you approve.
  • Three modules: test automation, screen scraping, and app and RAG generation.
  • A job list and detail view with a live event stream.
  • Stop, terminate and restart a job.
  • A list of generated apps with start, stop, delete and file view and edit.
  • Version history, revert and fork of a generated app.
  • Generated apps run inside the product and show in a frame.
  • JWT sign-in with organisation-scoped tenancy.
  • A dashboard view.

Stack

  • NestJS
  • BullMQ
  • Next.js
  • TypeScript
  • PostgreSQL
  • pgvector
  • Redis
  • MinIO
  • Python
  • FastAPI

AI in this project

In the product

  • One LLM gateway is the only service that holds model keys. It returns a completion and its cost for a task, using a static routing table with a fallback model per task and a closed failure (404) when a task has no route. Anthropic and DeepSeek are wired; other providers are declared but not connected yet.
  • The worker runs each plan step that needs a model through the gateway. In the code-generation step the model returns a JSON description with files, which is parsed and written out as a generated project.
  • Cost and time guards: a hard budget cap per job (default 5 USD) fails the job when exceeded, and there is a maximum runtime. When the gateway is unreachable the run is simulated and the artifact says so; with no key the gateway answers with a stub that has no cost.
  • Planning is deliberately not an LLM: plans are built deterministically from module manifests, validated against a schema, hashed, and must be approved before the job is queued. Intent detection is a keyword score, and an LLM classifier is only planned.
  • The sandbox for generated apps is a local stub with no real isolation yet.

In how it was built

  • 68 of 74 commits carry a Claude co-author trailer.
  • A 210-line rule file lists non-negotiable architecture principles and a "do not" list, and a local gate checks each change. Screenshots of live verification sessions are kept in the repository.

Key flows

Steps

From chat to a running job

  1. Step 1 of 5: Describe

    The user describes the job in chat; intent classification picks the module.

  2. Step 2 of 5: Plan

    The system drafts a plan, and the model's output is validated against a schema before anyone sees it.

  3. Step 3 of 5: Approve

    The user approves the plan; it becomes a job spec that does not change afterwards.

  4. Step 4 of 5: Run

    The job is queued and runs in the worker, inside its budget and runtime cap.

  5. Step 5 of 5: Watch

    Progress streams live to the job page.

Limitations

  • An MVP skeleton: the document service's PII scan is a stub, and the state machine, idempotency classes and budget wallet are not tested yet.
  • No role-based authorisation, sign-in rate limiting or refresh tokens yet.

Want something like this?

Tell me about your project — I reply within two working days.

Start a project