惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recorded Future
Recorded Future
C
Cyber Attacks, Cyber Crime and Cyber Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
Google Online Security Blog
Google Online Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
WordPress大学
WordPress大学
博客园 - 聂微东
L
LINUX DO - 最新话题
月光博客
月光博客
小众软件
小众软件
T
Troy Hunt's Blog
A
Arctic Wolf
量子位
I
Intezer
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
有赞技术团队
有赞技术团队
N
News and Events Feed by Topic
美团技术团队
The Cloudflare Blog
P
Privacy International News Feed
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
N
News | PayPal Newsroom
Apple Machine Learning Research
Apple Machine Learning Research
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 热门话题
V
Vulnerabilities – Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
Hacker News: Ask HN
Hacker News: Ask HN
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
BugTheatre AI: Turning Screenshots, Logs, and Stack Traces Into Debugging Case Files with Gemma 4
Akshat Uniya · 2026-05-15 · via DEV Community

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

My app did not need another chatbot.

It needed an investigator.

Debugging rarely starts with a clean stack trace. It usually starts with a screenshot, a vague error, a half-copied log, and the feeling that something obvious is hiding in plain sight.

So I built BugTheatre AI — a local-first debugging investigator powered by Gemma 4 through Ollama.

BugTheatre AI turns messy bug evidence into a structured debugging case file. Instead of returning one generic answer, it builds a complete investigation board with:

  • a prime suspect
  • evidence found
  • missing evidence
  • confidence score
  • affected layer
  • false leads to avoid
  • safe patch plan
  • validation steps
  • rollback guidance
  • postmortem-ready export

The goal is simple:

Do not build an AI that merely answers bugs. Build an AI that investigates bugs.


Demo

The walkthrough follows this flow:

New Case -> Investigate Bug -> Investigation Board -> Patch Room -> Postmortem -> Export

Enter fullscreen mode Exit fullscreen mode

BugTheatre AI Demo

BugTheatre starts with messy debugging evidence, lets local Gemma analyze it, and then turns the result into a structured case board, safe patch plan, and postmortem-ready export.

The most important screen is the Investigation Board, because it shows the main transformation: a vague bug report becomes an organized debugging case.


Code

Repository:

https://github.com/AkshatUniyal/bugtheatre-ai

Current POC stack:

  • Streamlit frontend
  • Python application logic
  • Ollama local model server
  • Gemma 4 E2B as the default local model
  • optional Gemma 4 E4B support
  • strict JSON investigation schema
  • local case history in data/cases.json
  • Markdown and JSON exports

How I Used Gemma 4

BugTheatre AI uses Gemma 4 E2B locally through Ollama as the default demo model.

I chose local Gemma because debugging evidence often contains sensitive information:

  • private URLs
  • internal file paths
  • customer IDs
  • stack traces
  • screenshots of proprietary systems
  • configuration details
  • environment names
  • API routes
  • session and auth clues

So local inference was not just a technical preference.

It was a product requirement.

Gemma 4 is used as the core reasoning layer for:

  • reading mixed debugging evidence
  • extracting visible facts
  • separating evidence from inference
  • identifying the prime suspect
  • listing missing information
  • avoiding likely false leads
  • proposing a safe patch path
  • generating validation steps
  • producing a postmortem-ready summary

The important design choice was to avoid using Gemma as a generic chat interface.

I wanted Gemma to act like an investigation engine.

The app asks Gemma for structured JSON, then the UI turns that into debugging artifacts that are easier to review, share, and act on.

Gemma 4 E4B is also supported as a higher-quality local option. For the challenge demo, E2B gives a practical balance between privacy, local performance, and useful reasoning on developer hardware.


Why I Built It

Most debugging tools assume the developer already knows where the problem is.

But real bugs are rarely that clean.

A developer may have:

  • a screenshot from staging
  • a browser console error
  • a partial stack trace
  • a failing network request
  • a config snippet
  • a vague user report
  • an environment detail that may or may not matter

The problem is not just finding a possible fix.

The real problem is knowing:

  • what evidence matters
  • what is probably noise
  • what the safest first action is
  • what missing information would raise confidence
  • what change could accidentally make things worse
  • how to explain the issue to the team afterward

That is where BugTheatre AI fits.

It treats a bug like a case file.


Example Case: Laravel 419 / CSRF Failure

For one demo, I used a PHP/Laravel admin bug.

The user is on an order details page and tries to update an order status from Processing to Shipped.

The UI shows:

Failed to update order status.
Page expired. Please refresh and try again.

Enter fullscreen mode Exit fullscreen mode

DevTools shows:

POST /admin/orders/1024/status -> 419 Page Expired
CSRF token mismatch
TokenMismatchException
VerifyCsrfToken.php
Session driver: redis

Enter fullscreen mode Exit fullscreen mode

A generic chatbot might say:

Try refreshing the page.

BugTheatre AI builds a deeper investigation:

  • Prime suspect: expired or stale Laravel CSRF/session token during admin inactivity
  • Evidence: HTTP 419, CSRF mismatch, page idle time, failed status update request
  • Missing evidence: Laravel logs, VerifyCsrfToken.php, SESSION_DRIVER, cookie/session settings, Redis health
  • False leads to avoid: database issue, payment issue, order calculation bug
  • Safe patch path: refresh/regenerate CSRF token before submission, handle 419 gracefully, preserve unsaved intent, verify session/cookie/CSRF middleware
  • Validation: reproduce idle session, submit form, verify re-authentication or token refresh path
  • Rollback: revert token-refresh handling if it blocks valid admin submissions

This is the kind of output I wanted: not just a fix, but a safe debugging path.


How It Works

BugTheatre AI follows a structured investigation pipeline:

User evidence
  -> privacy guard and secret redaction
  -> screenshot encoding, if provided
  -> strict investigation prompt
  -> local Gemma 4 through Ollama
  -> structured JSON case file
  -> rendered debugging views
  -> Markdown / JSON export

Enter fullscreen mode Exit fullscreen mode

The model is not used as a free-form chat box.

Instead, Gemma is asked to return a structured case file with fields like:

  • case title
  • summary
  • severity
  • confidence
  • affected layer
  • prime suspect
  • evidence found
  • missing evidence
  • false leads
  • fix plan
  • validation steps
  • rollback plan
  • postmortem

That JSON is then rendered into dedicated product views.


Product Screens

BugTheatre AI has separate screens for separate debugging jobs.

Dashboard

The dashboard acts as the command center.

It shows:

  • current active investigation
  • saved cases
  • export readiness
  • local AI mode
  • demo story
  • next best action

This helps judges or teammates understand the workflow quickly.

Dashboard UI

New Case

The New Case screen captures messy evidence:

  • case title
  • language/framework
  • environment
  • short description
  • expected behavior
  • actual behavior
  • logs / stack trace
  • code or config snippet
  • screenshot evidence

Only the title is required, but more evidence improves the investigation.

Sample Cases

This is the demo gallery.

It includes prebuilt examples such as:

  • React hydration mismatch
  • FastAPI dependency mismatch
  • Docker port mismatch

This makes the project easy to test without inventing a bug first.

Investigation Board

This is the main screen.

It shows:

  • prime suspect
  • confidence
  • severity
  • affected layer
  • fastest fix
  • executive debug summary
  • evidence found
  • missing evidence
  • case snapshot

This is where the product stops feeling like a chatbot and starts feeling like a real debugging assistant.

Investigation Board UI

Patch Room

Patch Room converts diagnosis into action.

It includes:

  • quick patch
  • clean fix
  • prevention
  • validation
  • safe patch review
  • suggested commands
  • action plan
  • rollback plan

For risky areas such as auth, session handling, dependency changes, deployment, payment, or data paths, BugTheatre is intentionally conservative. It avoids unsafe recommendations and pushes the user toward validation before change.

Patch Room UI

Postmortem

The postmortem view turns the debugging session into a workplace artifact.

It includes:

  • technical artifacts
  • summary
  • impact
  • root cause
  • detection
  • resolution
  • prevention
  • follow-up actions

Exports are available as Markdown and JSON.


Why This Is Not Just a Chatbot

A chatbot usually gives a prose answer.

BugTheatre AI turns one messy bug into a reusable investigation artifact.

That difference matters.

A bug investigation needs structure:

  • What is the strongest hypothesis?
  • What evidence supports it?
  • What evidence is missing?
  • What should we avoid changing first?
  • What is the safest patch path?
  • How do we validate the fix?
  • What do we tell the team afterward?

BugTheatre AI gives each of those questions a dedicated place in the workflow.

The result feels less like asking AI for help and more like opening a debugging case file.


Output Quality and Safety Guardrails

One thing I learned quickly: debugging recommendations can be dangerous if they are too confident or too generic.

So BugTheatre AI is designed to be conservative around risky areas.

For example:

  • Auth/session bugs should not blindly recommend shorter session timeouts.
  • Dependency bugs should tie recommendations to observed versions and lockfiles.
  • Deployment bugs should validate runtime facts before changing app code.
  • Payment or data-loss paths should recommend verification before modification.

In the Laravel 419 case, the safer recommendation is not “reduce the session timeout.”

The safer path is:

  • refresh or regenerate the CSRF token before submission
  • warn the user before session expiry
  • handle 419 gracefully with re-authentication or refresh
  • preserve unsaved intent where possible
  • verify Laravel session, cookie, CSRF middleware, and Redis/session configuration

This is the kind of caution I wanted the product to show.


Limitations

BugTheatre AI is a proof of concept, not an autonomous production fixer.

It does not modify code directly.

It does not deploy fixes.

It does not replace developer judgment.

Gemma helps structure the evidence and suggest likely patch paths, but developers should still validate fixes with logs, tests, and environment-specific checks.

Some limitations:

  • local model output can vary
  • screenshot-only analysis depends on readable text
  • strict JSON generation needs validation and repair loops
  • production use would need stronger permissions, audit trails, and integrations
  • a production UI would likely benefit from a React/Next.js frontend instead of Streamlit

What Worked Well

A few things worked better than expected:

  • Gemma 4 could reason over mixed debugging evidence.
  • Local inference made the privacy story much stronger.
  • Screenshot input made the demo feel realistic.
  • The investigation-board format made the output easier to trust.
  • Patch Room helped convert diagnosis into action.
  • Postmortem export turned a debugging session into something a team could actually use.

The biggest win was this:

BugTheatre did not just explain the bug.

It organized the debugging process.


Challenges

The hardest part was not building the UI.

The hardest part was controlling the output.

For a debugging product, the model needs to be useful without being reckless.

That meant spending time on:

  • structured prompts
  • strict JSON response shape
  • evidence vs inference separation
  • missing evidence fields
  • safer patch language
  • conservative recommendations for auth/session/deployment cases

Another challenge was screenshot analysis. If the screenshot is readable, Gemma can extract useful signals. But if the screenshot is noisy or cropped, the model needs to admit uncertainty instead of pretending it knows everything.

That is why “missing evidence” is a first-class section in the product.


Future Improvements

If I continue the project, I would like to add:

  • React/Next.js frontend
  • FastAPI backend
  • SQLite case history
  • JSON schema validation and retry/repair loop
  • GitHub issue export
  • Slack summary export
  • PDF reports
  • saved case detail pages
  • team workspaces
  • project-specific debugging playbooks
  • stronger secret redaction
  • automatic evidence quality scoring

A more advanced version could also support repository-level investigation, where BugTheatre reads the relevant files and connects the screenshot/log evidence back to actual code paths.


Closing

BugTheatre AI is built around a simple belief:

Debugging is not just about getting an answer.

It is about building a path from symptom to evidence to action.

That is why I built BugTheatre AI as an investigator, not a chatbot.

Gemma 4 made that practical locally by combining screenshot understanding, evidence extraction, and structured reasoning into a private debugging workflow.

Do not build an AI that merely answers bugs. Build an AI that investigates bugs.