π οΈ Bug Resolver Agent Specification¶
π― Purpose¶
The Bug Resolver Agent is a specialized autonomous agent in the ConnectSoft AI Software Factory designed to:
Generate safe, contextual, and test-verifiable bug fixes for failed code execution, test failures, regressions, or crash incidents β using trace data, stack analysis, source control history, and prompt-enriched memory retrieval.
It serves as a bridge between bug diagnosis (e.g. by the Bug Investigator Agent) and concrete developer-grade fix generation β helping close the feedback loop from test β analysis β patch β test.
π― Primary Objectives¶
| Goal | Description |
|---|---|
| π§ Generate patch-level code suggestions | Based on known errors, stack traces, and memory-mapped behavior |
| π§ Understand context via memory & trace | Learns from previously resolved bugs and their fix patterns |
| π€ Collaborate with Developer Agents | Produces safe-to-apply changes within domain/edition constraints |
| β Provide validation-ready outputs | Fixes must be verifiable via re-run, simulation, or inline test scaffold |
| πͺ Operate across frontend, backend, mobile codebases | Supports React, .NET, Flutter, SQL, YAML, etc. via classified domain roles |
ποΈ Position in the ConnectSoft Factory Flow¶
flowchart TD
QA[QA Agent] --> Bug[Bug Investigator Agent]
Bug --> Resolver[π οΈ Bug Resolver Agent]
Resolver --> Dev[Developer Agent]
Resolver --> Commit[Code Committer Agent]
Resolver --> QA
The Bug Resolver Agent activates after a confirmed failure, and before or alongside the Developer Agent and Code Committer β helping create a semantically explainable and optionally human-reviewable patch.
π§ Related Agents It Bridges¶
| Agent | Role |
|---|---|
| π Bug Investigator Agent | Detects, classifies, and fingerprints the bug |
| π¨βπ» Backend/Frontend/Mobile Developer Agents | Receives patch suggestions from Resolver |
| π€ Code Committer Agent | May auto-commit or PR the fix with CI validation |
| π¦ Studio Agent | Displays diff previews, confidence score, and reasoning |
| π§ͺ Test Generator Agent | May enhance or regenerate tests to verify the patch post-resolution |
π§Ύ Common Scenarios It Handles¶
| Scenario | Resolution |
|---|---|
| π§ͺ Assertion fails in a flaky UI test | Generates debounce, waitFor, or delay patch in test template |
| π₯ NullReferenceException in backend | Suggests null check, parameter validation, or fallback strategy |
| π« Contract mismatch between services | Adjusts DTO structure, adds conditional mapper logic |
| β³ Async timeout | Adds await/timeout handling, modifies retry logic |
| π Edition-only bug | Fix suggestion scoped to edition guard or config split |
π Safety Principles¶
- πΎ No fix is emitted without structural trace context
- π Each fix is ranked with a confidence score
- π§ͺ Optionally accompanied by a test snippet or retry
- π§βπ» Fixes are explainable and optionally human-reviewable
β Summary¶
The Bug Resolver Agent:
- π§ Converts bug diagnoses into validated code fixes
- π§ Uses knowledge graphs and memory vectors for safe patch suggestion
- π€ Collaborates with Developer Agents and Committer Agents
- π Closes the loop from test β failure β fix β test
- π§± Fits seamlessly into ConnectSoftβs clean, trace-first, multi-agent system
π Responsibilities¶
This section defines the precise operational scope and responsibilities of the Bug Resolver Agent, emphasizing its role in closing the software feedback loop between detection and resolution within the ConnectSoft AI Software Factory.
β Core Responsibilities¶
| Responsibility | Description |
|---|---|
| π Interpret Diagnostic Artifacts | Consumes structured bug metadata from the Bug Investigator Agent (e.g. bug-fingerprint.json, fix-recommendation.yaml, stackTrace) |
| π‘ Analyze Root Cause | Performs root cause inference using stack traces, telemetry spans, source context, and code structure |
| π§ Retrieve Contextual Memory | Queries the vector memory (knowledge layer) to find similar bugs and their historical fixes |
| π οΈ Synthesize Safe Fix | Generates a patch suggestion: code diff, config change, or test update, using Semantic Kernel or fine-tuned prompting |
| π Generate Explanation | Produces a Markdown-formatted explanation of the issue and why the patch addresses it |
| π§ͺ Suggest Tests or Rerun | Optionally generates inline test assertions or rerun logic to validate the fix |
| β Score the Fix | Assigns confidence and impact scores (e.g., risk, change surface area, recoverability) |
| π¬ Emit Patch Metadata | Produces outputs like bug-resolution.yaml, proposed-fix.diff, fix-summary.md |
| π€ Forward to Developer Agent | Sends results to human or AI Developer Agent for review, testing, or commit workflow |
| π§Ύ Log and Report | Emits fix attempt trace, error logs, and observability metrics for QA and HumanOps dashboards |
π§± Additional Optional Responsibilities¶
| Feature | Description |
|---|---|
| π Retry alternate fix strategies | If the first patch fails validation or rerun |
| π§ͺ Test Generator integration | Automatically trigger test scenario regeneration |
| π§© Multi-edition scoping | Suggest edition-specific fix toggles or conditional guards |
| π Source diff patching | Construct inline git diff or PR-ready suggestion artifacts |
| π Learning from history | Update bug memory with successful or failed fix strategies for future suggestions |
π Resolution Flow Integration¶
| Input Artifact | Source | Purpose |
|---|---|---|
bug-fingerprint.json |
Bug Investigator Agent | Base metadata for fix |
stackTrace / trace-logs.json |
Observability Layer | Determine failure context |
fix-recommendation.yaml |
QA or Diagnostic Agent | Seed suggestion or preferred strategy |
test-results.json |
QA Agent or CI | Input for pre/post fix comparison |
knowledge-index |
KM Agent | Retrieve prior fix patterns for similar bugs |
π§ͺ Fix Types Supported¶
| Type | Example |
|---|---|
| Code patch | Null check, field initialization, retry logic |
| Test fix | Adjust timeout, debounce, fix assertion |
| DTO/schema patch | Field added, mapped, or defaulted |
| Config adjustment | Feature flag, retry setting, timeouts |
| Edition-based override | Patch only in vetclinic-premium, skip for others |
β Summary¶
The Bug Resolver Agent is responsible for:
- π§ Translating bug diagnostics into actionable, testable code-level fixes
- π Looping through root cause β patch synthesis β validation
- π€ Emitting fix metadata and collaborating with the Developer and Committer agents
- π Leveraging memory, stack traces, and structured fingerprints to produce high-confidence, minimal-risk suggestions
This makes the Bug Resolver Agent the core remediation node in ConnectSoftβs AI-driven debugging and development mesh.
π₯ Inputs Consumed¶
This section defines the structured, semi-structured, and contextual inputs the Bug Resolver Agent consumes to analyze bugs, synthesize candidate fixes, and validate the resolution strategy.
Inputs come from test execution artifacts, memory, observability traces, source repositories, and upstream agents.
π Primary Input Artifacts¶
| File | Description |
|---|---|
bug-fingerprint.json |
Structured summary of the issue including classification, root cause, and affected module |
stackTrace |
Raw or parsed stack frames from the failing execution context |
trace-logs.json |
Observability data (OpenTelemetry spans, errors, durations) |
fix-recommendation.yaml |
Suggestion (if any) from the Bug Investigator or QA Agent |
test-results.json |
Test failure details including retries, flakiness score, related editions |
build-manifest.json |
Git commit history, build version, and module structure |
code-snippet.context.json |
Optionally injected local context for affected file(s), method(s), or test(s) |
edition-config.yaml |
Used to detect conditional bugs related to edition-specific code paths |
memory-entry.json |
Prior knowledge of related bugs, patches, test cases, or architecture components |
π§ Embedded Memory Access¶
| Source | Use |
|---|---|
embedding-vector.json |
Semantic match against previous bugs or fixes |
knowledge-index.yaml |
Find reusable patch patterns by module or artifact type |
trace-link-map.json |
Link bug back to feature/test plan or earlier architectural decisions |
studio.knowledge.status.json |
Surface area and severity scoring by trace coverage and test confidence |
π§Ύ Supplementary Inputs (Optional)¶
| Input | Purpose |
|---|---|
diff-context |
Local git diff around affected file used for patch alignment |
priorFixConfidence.json |
Records from past fix strategies with similar error tags |
execution-context.log |
Debug print or local logs collected during crash |
code-policy.yaml |
Coding guidelines, Lint rules, patch safety restrictions (e.g. no breaking async flow) |
human-annotation.json |
Feedback from QA reviewers or Studio annotation flows ("this fails in multi-tenant only") |
π Sample: bug-fingerprint.json¶
{
"fingerprintId": "bug-a1c02d34",
"testId": "CancelAppointmentWithModal",
"classification": "Flaky Test",
"confidence": 0.92,
"stackTrace": [
"ModalDialog.tsx: open() β render() β timeout"
],
"platform": "flutter",
"module": "Appointments",
"edition": "vetclinic-blue"
}
π§ Context Inference Logic¶
Even if some artifacts are missing, the Bug Resolver Agent can infer missing inputs using:
| Inference | Source |
|---|---|
domainContext |
From moduleId + prior memory embeddings |
fileName |
From stackTrace top frame |
functionPath |
From logs, spanName, or last known stack |
editionImpact |
Derived from test execution matrix or trace-linked plan |
recentFixPattern |
Retrieved via vector similarity using current error hash or summary |
β Summary¶
The Bug Resolver Agent ingests:
- Structured failure and classification artifacts
- Observability and runtime traces
- Edition context, source code structure, and build metadata
- Memory-layer fix patterns and historical bug fingerprints
This rich, multi-layered context empowers it to synthesize context-aware, safe, and version-aligned fixes across microservices and client editions.
π€ Outputs Produced¶
This section documents the output artifacts generated by the Bug Resolver Agent after analyzing a bug. These outputs are consumed by Developer Agents, Committer Agents, QA pipelines, and the Studio dashboard.
Every output is trace-linked, version-aware, and designed for auditability, validation, and optional human review.
π¦ Primary Outputs¶
| File | Description |
|---|---|
bug-resolution.yaml |
Canonical metadata about the fix: patch strategy, risk score, confidence, edition scope |
proposed-fix.diff |
Line-by-line code diff in Git-style patch format |
fix-summary.md |
Human-readable explanation of what the fix does and why it works |
fix-verification-plan.json |
Test or rerun actions suggested to validate the fix |
memory-entry.json (patched) |
Optional: if fix is a template update, embedded as knowledge unit |
studio.bug.status.json |
Studio-facing update with fix status, fingerprint ID, and resolution status |
MemoryEntryResolved (event) |
Emitted to Event Grid with fingerprintId + resolution status |
code-review-annotation.json |
Optional: injects inline suggestions if code reviewer agent is active |
π Example: bug-resolution.yaml¶
fingerprintId: bug-a1c02d34
resolutionStatus: proposed
fixType: test-patch
confidenceScore: 0.94
riskLevel: low
module: Appointments
platform: flutter
patchGeneratedBy: BugResolverAgent
editionScope: vetclinic-blue
strategy:
action: waitForVisible
target: ModalDialog
delayMs: 1000
π Example: proposed-fix.diff¶
--- a/CancelAppointmentTest.feature
+++ b/CancelAppointmentTest.feature
@@
- Then I should see the confirmation modal
+ Then I wait for "confirmation-modal" to appear within 1000ms
+ And I should see the confirmation modal
π Example: fix-summary.md¶
### π οΈ Proposed Fix: Modal Timeout in Cancel Appointment
- **Bug**: The confirmation modal is not rendered within the testβs default timeout window.
- **Root Cause**: UI race condition in Flutter due to delayed async render.
- **Fix**: Added `waitForVisible("confirmation-modal", 1000ms)` before assertion.
- **Confidence**: 94%
- **Edition**: vetclinic-blue
- **Suggested Validation**: Rerun test 5 times to confirm flakiness eliminated.
π§ͺ Example: fix-verification-plan.json¶
{
"fingerprintId": "bug-a1c02d34",
"testToRerun": "CancelAppointmentWithModal",
"retries": 5,
"passRateExpected": 1.0,
"autoValidate": true
}
π Optional Studio Outputs¶
| File | Use |
|---|---|
studio.bug.status.json |
Updates bug tile with fix status and explanation |
studio.fix.metrics.json |
Fix impact scope, coverage, and verification plan preview |
fix-history.yaml |
Tracks patch attempts, authorship, and validation status for audit trail |
π€ Output Consumers¶
| Consumer Agent | Usage |
|---|---|
| Developer Agent | Reviews patch, integrates into build, or expands test |
| Code Committer Agent | Applies fix automatically if confidence high and validation plan passes |
| QA Agent | Confirms regression resolved or feedback is needed |
| Studio Agent | Visualizes fix status, diff preview, and recovery coverage |
| Memory Agent | Embeds fix into memory if successful and reusable |
β Summary¶
The Bug Resolver Agent emits:
- β
A structured patch (
*.diff) - π§ A traceable fix declaration (
*.yaml) - π A human-readable explanation (
*.md) - π§ͺ A rerun/test validation plan (
*.json) - π A dashboard update and event log for downstream visibility
This output ecosystem enables trustworthy, testable, and traceable resolution workflows across the ConnectSoft agentic platform.
π§ Knowledge Base¶
This section outlines the pre-trained memory, embedded patterns, and reusable bug-fix intelligence the Bug Resolver Agent has access to before receiving new inputs. It enables faster resolution, safer patches, and alignment with ConnectSoftβs architectural and edition-specific constraints.
π Embedded Prior Knowledge Domains¶
| Domain | Description |
|---|---|
| π Bug Classifications & Fix Patterns | Mapped relationships between known bug types (null refs, race conditions, timeouts) and their preferred resolution strategies |
| π¦ Code Templates & Microservice Blueprints | Understands standard structure, layers, service conventions from the Microservice Generator Agent |
| π§ Common Fix Macros | Reusable repair sequences like waitForVisible, addNullCheck, injectDefaultParam, sanitizeInput, useSafeMapper |
| π§ͺ Test Behavior Models | Knows standard test flows (BDD/SpecFlow) and how to patch assertion, retry, wait steps |
| π§ Fix History from Past Bugs | Accesses embedded memory entries for previous bug fingerprints and their accepted patches |
| π Framework-Specific Repair Knowledge | Includes knowledge of .NET async patterns, Flutter widget lifecycles, React hooks, NHibernate, MassTransit, etc. |
| βοΈ Coding Conventions and Linting | Recognizes project-wide and module-level style rules (e.g., use guard clauses, preserve async flow, avoid side-effects in tests) |
π§© Knowledge Graph Examples (Semantic Links)¶
| Source Bug Pattern | Linked Fix Action |
|---|---|
NullReferenceException at Line X |
addNullCheck, initializeField, fallbackResolver |
Element not visible in time |
add waitForVisible, debounceAction, extend timeout |
DTO missing required field |
injectDefaultField, mapOptionalField, guardMissingKey |
Edition-specific config missing |
wrap in edition guard, fallback to base config |
π Sample: Embedded Memory Entry (from vector DB)¶
{
"fingerprintId": "bug-5c32a1d7",
"rootCause": "Modal render race condition",
"resolution": "Added waitForVisible(modal)",
"module": "Appointments",
"edition": "vetclinic-premium",
"embeddingVector": [0.00123, ..., 0.9321]
}
β Used for vector similarity matching when diagnosing a new modal bug.
π§ Retrieval Strategies¶
| Trigger | Memory Search |
|---|---|
| Stack trace contains known frame | Retrieve previous bugs with same top-level frame signature |
| Error message similarity | Fuzzy match against vector embeddings in known errors |
| Module + classification match | Filter to bugs in the same domain with same classification |
| Manual match via fingerprint ID | If investigator agent emits known bug ID already |
ποΈ Pre-Linked Fix Categories¶
| Category | Fix Patterns |
|---|---|
| UI Flaky Tests | waitFor, debounce, useStableSelector, disableAsyncGuard |
| Backend Crashes | addNullCheck, validateRequest, patchAutoMapper, default value fallback |
| Cross-service Errors | align contract, add dto converter, wrap with try-catch and failover logic |
| Edition Bugs | wrapWithEditionIf, sync feature flag, fallbackConfigForEdition |
π Memory Evolution¶
The agent updates its own internal memory through:
- β
New
bug-resolution.yamlentries linked tofingerprintId - β Confirmed diffs + test validation feedback
- β Studio annotations from Developer Agents or HumanOps
- β
Knowledge Management Agent ingestion (
memory-entry.json)
β Summary¶
The Bug Resolver Agent begins execution with:
- π§ A deep understanding of code structures, bug categories, and fix techniques
- π Access to historical bug resolution examples (embedded as vectors)
- π§© Awareness of domain, edition, and test patterns across ConnectSoftβs architecture
- π Continuous learning as new patches are accepted and linked to fingerprints
This allows it to propose high-confidence, explainable, and context-aware fixes β from the very first failure trace.
π Process Flow (High-Level)¶
This section outlines the high-level lifecycle of the Bug Resolver Agent β from receiving bug context, through fix generation, to emitting validation-ready outputs. It shows how the agent participates in closing the feedback loop between failure and patch across the AI Software Factory.
π§ High-Level Flow Diagram¶
flowchart TD
Start[π Bug Fingerprint + Stack Trace Received]
Analyze[π Analyze Root Cause]
Retrieve[π§ Retrieve Similar Bugs from Memory]
Propose[π οΈ Generate Fix Strategy]
Diff[π Construct Proposed Patch (diff)]
Explain[π Generate Fix Explanation]
Validate[β
Run Fix Validation Plan]
Output[π€ Emit Fix Artifacts]
End[π― Resolution Complete]
Start --> Analyze --> Retrieve --> Propose --> Diff --> Explain --> Validate --> Output --> End
π§© Key Phases Explained¶
| Phase | Description |
|---|---|
| π Input Received | Triggered by upstream Bug Investigator Agent; includes stack trace, fingerprint, test info |
| π Root Cause Analysis | Parses stack, matches error pattern, identifies critical line/module/test |
| π§ Memory Retrieval | Uses embedding vector search to find similar past bugs and resolutions |
| π οΈ Fix Strategy Generation | Selects patch template (e.g., add null check, delay, config fallback) |
| π Diff Construction | Generates Git-style diff with inline code edits or config mutations |
| π Explanation Generation | Human-readable Markdown output: what the fix does, why itβs safe |
| β Validation Plan Creation | Suggests rerun/test plan to verify correctness or retry |
| π€ Fix Artifact Emission | Writes patch files, fix metadata, and emits fix events for Studio and CI/CD pipelines |
π Optional Subflows¶
- Retry with alternate strategy if patch fails validation
- Add fallback for multi-edition patching (e.g., conditionally wrap logic)
- Escalate to HumanOps if ambiguity is too high or trace incomplete
π Example Scenario: Modal Render Timeout¶
| Step | Action |
|---|---|
Stack β ModalDialog.render() |
Agent tags root cause as UI async render |
| Past fix found β debounce + waitForVisible | Agent reuses that strategy |
| Patch generated β 1000ms wait before assertion | Written to proposed-fix.diff |
| Markdown summary explains race condition | Logged in fix-summary.md |
| Verification plan β rerun test 5Γ | Added to fix-verification-plan.json |
β Summary¶
The Bug Resolver Agent executes a deterministic, traceable, and testable process:
- π Diagnose
- π§ Recall from memory
- π οΈ Propose fix
- π Emit patch
- β Validate
- π€ Report resolution
This high-level lifecycle empowers it to act as a self-sufficient, explainable, and intelligent debugging agent in the ConnectSoft platform.
π¬ Cycle 7 β Process Flow (Detailed)¶
This section expands on the high-level lifecycle by detailing each stage in the Bug Resolver Agentβs internal resolution pipeline, including skill calls, decision branches, and fallback logic.
π Detailed Fix Resolution Flow¶
flowchart TD
START[π Receive bug-fingerprint.json + stack trace]
CLASSIFY[π Classify error type and scope]
RETRIEVE[π§ Query memory for similar fingerprints]
SELECT[π― Choose best matching resolution strategy]
PATCH[π οΈ Synthesize candidate patch]
DIFF[π Format patch as diff]
EXPLAIN[π Generate fix explanation]
VALIDATE[β
Run fix verification plan (optional)]
SCORE[π Score risk and confidence]
OUTPUT[π€ Emit patch + metadata]
END[π Resolution artifact complete]
START --> CLASSIFY --> RETRIEVE --> SELECT --> PATCH
PATCH --> DIFF --> EXPLAIN --> VALIDATE --> SCORE --> OUTPUT --> END
π§© Internal Steps Breakdown¶
1. π Receive Inputs¶
- Required:
bug-fingerprint.json,stackTrace,testId,moduleId - Optional:
fix-recommendation.yaml,editionId,trace-logs.json
2. π Classify Error¶
- Use
ErrorClassifierSkill - Recognize patterns: null ref, timeout, assertion fail, etc.
- Extract top-level stack frames and affected files
3. π§ Retrieve Memory¶
- Call
SimilaritySearchSkillwith error + trace context - Search
bug-fingerprint-dbandmemory-entry.json - Filter by module, domain, edition
4. π― Select Fix Strategy¶
- Call
SelectFixTemplateSkillwith classification and top result - Choose macro:
addNullCheck,waitForVisible,wrapWithEditionGuard, etc.
5. π οΈ Synthesize Patch¶
- Call
PatchSynthesizerSkill - Generates in-memory patch structure
- May also output inline patch for in-place fix
6. π Format as Diff¶
- Call
FormatPatchAsGitDiffSkill - Use
artifactIdorsourcePathto generate a standard.difffile
7. π Explain Fix¶
- Generate
fix-summary.md:- Root cause
- Fix description
- Confidence
- Validation plan preview
8. β Validate (Optional)¶
- Generate
fix-verification-plan.json - Trigger test rerun or dry-run scenario if execution agent is connected
9. π Score¶
- Risk level: based on change surface area
- Confidence: semantic match, strategy strength, past reuse success
10. π€ Emit Output Artifacts¶
- Emit:
proposed-fix.diffbug-resolution.yamlfix-summary.mdfix-verification-plan.json
- Optionally emit:
MemoryEntryResolvedevent, Studio update file
π Retry Flow (If Patch Fails)¶
flowchart LR
FAIL[β Patch Fails Validation]
FAIL --> TRY1[π Retry with Alternate Fix Strategy]
TRY1 --> PATCH2
PATCH2 --> DIFF2 --> VALIDATE2 --> OUTPUT2
FAIL --> ESCALATE[π¨ Escalate to HumanOps (manual review)]
π§ Skills Used in Pipeline¶
| Skill | Role |
|---|---|
ErrorClassifierSkill |
Parse stack and classify error |
SimilaritySearchSkill |
Retrieve past bugs and fixes |
PatchSynthesizerSkill |
Generate patch candidate |
FixExplanationSkill |
Create human-readable explanation |
FormatPatchAsGitDiffSkill |
Format diff correctly |
FixScoringSkill |
Assign confidence/risk scores |
β Summary¶
The Bug Resolver Agent executes a skill-composed diagnostic + patch + validation pipeline that:
- π Diagnoses root cause
- π§ Retrieves related memory
- π οΈ Generates safe, testable patches
- π Emits trace-linked artifacts
- π§Ύ Supports retry + fallback + human escalation
This process ensures high-quality, context-rich, and production-grade bug resolutions across all ConnectSoft modules.
π§© Skills and Kernel Functions¶
This section defines the Semantic Kernel skills and supporting functions used by the Bug Resolver Agent to diagnose, synthesize, validate, and emit fix artifacts. These skills are modular, composable, and traceable β enabling the agent to operate independently or in coordination with other ConnectSoft agents.
π§ Core Skills Used¶
| Skill Name | Purpose |
|---|---|
ErrorClassifierSkill |
Parses stack trace and log snippets to classify the error (e.g. null ref, timeout, flake) |
SimilaritySearchSkill |
Finds semantically similar bugs from memory for reuse |
FixStrategySelectorSkill |
Maps bug classification to a preferred resolution macro (e.g., addNullCheck, waitForVisible) |
PatchSynthesizerSkill |
Generates the candidate fix using prompt templating and context injection |
FixExplanationSkill |
Produces fix-summary.md: what the patch does, why it works, how to verify it |
FormatPatchAsGitDiffSkill |
Turns structured edits into .diff format suitable for PR pipelines |
FixScoringSkill |
Assigns a confidence level and risk category to the fix |
ValidationPlanGeneratorSkill |
Builds fix-verification-plan.json for rerun/test replay automation |
π Retry & Correction Skills (Optional)¶
| Skill | Use |
|---|---|
AlternateStrategyRetrySkill |
Retries resolution using a different fix macro |
PatchRewriterSkill |
Refines a patch with additional constraints (e.g., sync β async safe) |
EditionScopedWrapperSkill |
Wraps fix in edition-specific if guard or config split |
π§ͺ Fix Template Registry (Used Internally)¶
| Template Name | Behavior |
|---|---|
nullCheck.cs.template |
Adds if (obj == null) guard with fallback or throw |
waitForElement.feature.template |
Adds test-level wait step before assertion |
defaultValue.yaml.template |
Suggests config fallback in missing edition override |
fieldMapperFix.cs.template |
Adjusts AutoMapper rules for missing DTO field |
Each template is pre-embedded and loaded from the Knowledge Management Agent during initialization.
π§ Example: FixStrategySelectorSkill Prompt Template¶
You are a fix strategy selector for ConnectSoft AI Factory.
Given a classified bug:
- classification: "UI Flaky Test"
- affected module: "Appointments"
- top stack frame: "ModalDialog.render"
Suggest a fix macro: one of `waitForVisible`, `debounceEvent`, `addTestRetry`, `skipIfEnv`
Respond with:
{
"fixMacro": "waitForVisible"
}
π Example: FixScoringSkill Output¶
{
"confidenceScore": 0.94,
"riskLevel": "low",
"explanation": "Fix is scoped to one line in test layer; no side effects"
}
π Inter-Agent Skill Export (Optional)¶
These skills may be reused or extended by:
| Agent | Skill |
|---|---|
Code Reviewer Agent |
FixExplanationSkill, FixScoringSkill |
Developer Agent |
PatchSynthesizerSkill |
Test Generator Agent |
ValidationPlanGeneratorSkill |
Knowledge Management Agent |
Embeds patches + explanations into memory via memory-entry.json |
π Skill Observability¶
Each skill call emits:
executionId,traceId,fingerprintIdinputSize,durationMs,statusresultSize,confidenceScore(if applicable)
β All logged in bug-resolution-log.jsonl and surfaced in Studio if errors occur.
β Summary¶
The Bug Resolver Agent uses a powerful and modular set of Semantic Kernel skills to:
- π Classify and understand bugs
- π οΈ Synthesize safe patches
- π Explain and document the fix
- β Score and validate the resolution
- π€ Emit output artifacts for developers, committers, and QA
These skills form the agentβs execution backbone, enabling autonomous and testable bug resolution at scale.
π οΈ Technology Stack¶
This section outlines the underlying technologies, platforms, libraries, and integrations used by the Bug Resolver Agent. These components support fix generation, memory access, observability, and traceable collaboration across ConnectSoftβs AI Software Factory.
π‘ Core Technology Components¶
| Layer | Technology |
|---|---|
| Agent Runtime | .NET 8 + C# + Semantic Kernel |
| Embedding & Reasoning | Azure OpenAI (gpt-4, text-embedding-ada-002) |
| Skill Orchestration | Microsoft.SemanticKernel |
| Code Diff Formatting | Git diff engine or custom diff library |
| Vector Search | Azure AI Search or SK-compatible vector memory |
| Artifact Storage | Azure Blob Storage, YAML/JSON artifacts |
| Traceability | Model Context Protocol (MCP), trace IDs, artifact linkage |
π§ Semantic Skills Layer¶
| Component | Role |
|---|---|
| Prompt-based skills | Classify, synthesize, and explain using OpenAI LLM |
| Native SK skills | Memory search, text chunking, diff formatting |
| Skill execution context | Configured via SKContext with trace metadata, input artifacts, and agent options |
| Ingestion context | Skill outputs feed into file writers and memory events |
π Artifact Management¶
| Mechanism | Purpose |
|---|---|
fix-summary.md / .diff |
Markdown + Git patch output formats |
bug-resolution.yaml |
Fix metadata for traceability and version tracking |
studio.bug.status.json |
Update file for dashboard display |
| Blob path format | /memory/bug-resolver/{traceId}/{fingerprintId}/ (multi-edition safe) |
π§© Observability¶
| Component | Function |
|---|---|
| Application Insights | Logs SK execution duration, exceptions, retry attempts |
| OpenTelemetry | Captures spans: FixSynthesis, MemoryQuery, ExplanationGeneration |
| Event Grid / Service Bus | Emits MemoryEntryResolved, FixProposed, FixRejected |
| Logs | bug-resolution-log.jsonl, memory-metrics.json, skill-metrics.yaml |
π Studio Integration¶
| Feature | Description |
|---|---|
studio.bug.status.json |
Updates fix card (status: proposed/resolved) |
fix-history.yaml |
Tracks patch attempts, diff size, and validation results |
inline-diff-preview |
Optional: surfaced in Studioβs PR preview mode |
π‘οΈ Safety & Isolation¶
| Layer | Strategy |
|---|---|
| Edition-based filtering | Only suggest or apply fixes in edition-scoped files |
| Read-only memory access | Does not mutate past entries; patches are additive |
| Patch scoring threshold | Fixes under confidence threshold are flagged as needs-review |
| Change isolation | All diffs operate within known trace-linked modules (e.g. no global refactor without explicit trigger) |
π§ͺ Validation Tooling (optional)¶
| Tool | Use |
|---|---|
| Test harness / CI sandbox | Apply patch β rerun test β validate fix quality |
| Static analyzer | Run patch against Linter or Analyzer rules |
| Studio annotation interface | Review/approve/rescore generated fix if human input required |
β Summary¶
The Bug Resolver Agent is built on a cloud-native, LLM-integrated, memory-aware architecture, powered by:
- β Semantic Kernel + Azure OpenAI
- π§ Vector memory search and prompt-based fix generation
- π Git-format diff synthesis and explanation tools
- π Full observability via telemetry, logs, and Studio dashboards
- π Safety-first fix application with multi-edition awareness
This enables high-confidence, traceable, and production-safe bug resolution workflows across all ConnectSoft microservices and platforms.
π§Ύ System Prompt¶
This section defines the system prompt used to initialize and govern the behavior of the Bug Resolver Agent. It outlines the agent's role, constraints, and expectations, ensuring consistency, traceability, and safety across all bug resolution flows.
π System Prompt (Template)¶
You are the Bug Resolver Agent within the ConnectSoft AI Software Factory.
Your mission is to propose minimal, safe, test-verifiable fixes for software bugs β using provided error context, memory of past resolutions, source structure, and semantic strategies.
You receive structured bug metadata including:
- stack trace
- bug fingerprint
- test failures
- traceId, agentId, moduleId, editionId
- optionally: prior fix recommendations and memory embeddings
You must:
- Analyze the root cause using stack, logs, and error patterns
- Retrieve prior bugs/fixes from memory via vector search
- Select an appropriate fix strategy (e.g. waitForVisible, addNullCheck, patchMapper, fallbackConfig)
- Synthesize a safe code patch or test change
- Output the fix as a Git-style `.diff` and a Markdown summary (`fix-summary.md`)
- Generate a `bug-resolution.yaml` with classification, confidence score, and edition scope
- Ensure your fix is explainable, traceable, and edition-safe
- Optionally create a `fix-verification-plan.json` to validate the patch
Constraints:
- Never hallucinate code unrelated to the error scope
- Do not emit unsafe or high-risk changes without marking them as `needs-review`
- All outputs must be trace-linked and version-aware
- Memory retrieval must favor recent, validated, edition-compatible patches
You collaborate with the Developer Agent, QA Agent, Committer Agent, and Studio interface.
π― Key Behaviors Enforced by Prompt¶
| Behavior | Enforcement |
|---|---|
| β Trace-aware | Requires traceId, agentId, and moduleId in context |
| π€ Structured output | Emits .diff, .yaml, .md, and .json formats |
| π Safe by design | Default to minimal surface patch with explanation and validation |
| π§ Memory-augmented | Embedding search and similarity-based reuse enabled |
| π§Ύ Transparent | Fix reasoning is included in Markdown summary |
| π§© Edition-scoped | Fixes respect tenant/edition-specific conditions when relevant |
π§© Personality Traits Encoded¶
| Trait | Manifestation |
|---|---|
| π§ Knowledgeable | Leverages memory and past bug resolutions |
| π§ Practical | Fixes are minimal, precise, and often scoped to one line or block |
| π§ͺ Test-aware | Knows when to adjust tests or suggest reruns |
| π Careful | Validates or annotates unsafe patches |
| π€ Collaborative | Passes results to Developer and Committer agents for continuation |
β Summary¶
The Bug Resolver Agent system prompt:
- Defines the agent as a semantic repair specialist, not a general code generator
- Constrains behavior to traceable, safe, edition-aware fixes
- Produces explainable, version-controlled resolution artifacts
- Aligns it with upstream (Bug Investigator) and downstream (Developer, QA, Committer) agents
This prompt enables consistent, high-confidence bug resolution across ConnectSoftβs modular, event-driven AI platform.
π§Ύ Input Prompt Template¶
This section presents the structured input prompt template used by the Bug Resolver Agent when interacting with the LLM (via Semantic Kernel) to synthesize code fixes, classify issues, or generate explanations.
The prompt is designed for deterministic fix generation, using traceable, memory-enriched context and standardized instruction formatting.
π Fix Generation Prompt Template¶
You are an expert software bug fixer within an AI Software Factory.
Given the following input, generate a safe and minimal patch in the form of a code diff.
--- Bug Context ---
classification: {{classification}} # e.g. "UI Flaky Test"
stackTrace: {{stack_trace}} # multiline frame string
fingerprintId: {{fingerprintId}}
testId: {{testId}}
module: {{moduleId}}
edition: {{editionId}}
--- Optional Memory Context ---
priorFixSummary: {{prior_fix_summary}} # If retrieved from vector memory
priorFixSnippet: {{prior_fix_code}} # Code of known fix if similar
tags: {{bug_tags}}
--- Fix Requirements ---
- The patch must resolve the root cause (describe how).
- The patch must be safe, non-breaking, and edition-safe.
- If applicable, wrap in an edition config guard.
- Output the patch as a unified Git-style diff.
- Also return a Markdown explanation of the fix.
Respond with:
1. `--- BEGIN PATCH ---` (Git diff)
2. `--- BEGIN EXPLANATION ---` (Markdown)
π Example Input (Partial)¶
{
"classification": "Flaky Test",
"stackTrace": "ModalDialog.tsx: render() β open()",
"fingerprintId": "bug-123456",
"testId": "CancelAppointmentTest",
"module": "Appointments",
"edition": "vetclinic-premium",
"priorFixSummary": "Similar UI modal bug fixed by adding a waitForVisible guard",
"priorFixCode": "Then I wait for 'confirmation-modal' to appear within 1000ms"
}
π§© Input Prompt Flexibility¶
| Parameter | Behavior |
|---|---|
priorFix* |
If no similar fix exists, these sections are omitted |
edition |
May trigger fix generation with edition-specific guard (if (edition == "vetclinic")) |
stackTrace |
Helps anchor the fix to the correct method or component |
classification |
Guides fix template selection (e.g., test retry vs. backend fix) |
π Prompt Use Cases¶
| Mode | Purpose |
|---|---|
| Fix Synthesis | Generate full patch and explanation |
| Fix Classification Only | Use subset of prompt to generate resolution category |
| Fix Summary Rewriting | Regenerate fix-summary.md from existing patch |
| Edition Scope Decision | Ask whether fix should be edition-guarded based on test matrix or context |
π§ͺ Prompt Injection Format (in SK)¶
- Prompt template lives in
.promptor YAML files underskills/PatchSynthesizerSkill/ - Injected via
SKContext["traceId"],SKContext["classification"], etc. - Chunked with
ChunkArtifactSkillif logs or memory content is large
β Summary¶
The input prompt template for the Bug Resolver Agent:
- π§ Merges bug fingerprint, trace, and memory context
- π§Ύ Instructs LLM to generate a structured, safe, explainable patch
- π Returns both
.diffandfix-summary.mdin a predictable format - π§© Supports multi-edition, multi-module, multi-agent debugging flows
This prompt is the backbone of fix generation within a trace-safe, explainable, and edition-aware ConnectSoft environment.
π¦ Output Format & Structure¶
This section defines the structured output formats generated by the Bug Resolver Agent after synthesizing a fix. These outputs support downstream consumption by Developer Agents, Committer Agents, CI/CD systems, and Studio dashboards.
Each output is machine-readable, trace-linked, and explainable, conforming to ConnectSoftβs traceability and safety standards.
π§Ύ Key Output Artifacts¶
| File | Description |
|---|---|
bug-resolution.yaml |
Core fix metadata: strategy, classification, confidence, scope |
proposed-fix.diff |
Git-style diff containing patch lines to apply |
fix-summary.md |
Human-readable explanation of the fix and its rationale |
fix-verification-plan.json |
Test rerun or validation instructions |
studio.bug.status.json |
Dashboard update showing fix status and trace links |
π 1. bug-resolution.yaml¶
fingerprintId: bug-a1c02d34
resolutionStatus: proposed
fixType: waitForVisible
strategy:
action: waitForVisible
target: confirmation-modal
delayMs: 1000
module: Appointments
platform: flutter
edition: vetclinic-premium
confidenceScore: 0.94
riskLevel: low
patchSize: 2 lines
suggestedValidation: rerun test 5Γ
createdAt: 2025-05-15T20:02:00Z
π 2. proposed-fix.diff¶
--- a/tests/CancelAppointment.feature
+++ b/tests/CancelAppointment.feature
@@
- Then I should see the confirmation modal
+ Then I wait for "confirmation-modal" to appear within 1000ms
+ And I should see the confirmation modal
π 3. fix-summary.md¶
### π οΈ Fix Summary: Confirmation Modal Timeout
- **Issue**: Flaky test due to delayed rendering of confirmation modal.
- **Cause**: Async behavior in `ModalDialog.tsx` occasionally causes timeout.
- **Fix**: Added `waitForVisible("confirmation-modal", 1000ms)` before assertion.
- **Edition**: vetclinic-premium only
- **Confidence**: 94%
- **Validation Plan**: Rerun `CancelAppointmentTest` 5 times β expect 100% pass rate.
π 4. fix-verification-plan.json¶
{
"fingerprintId": "bug-a1c02d34",
"testId": "CancelAppointmentTest",
"retries": 5,
"passRateExpected": 1.0,
"autoValidate": true
}
π 5. studio.bug.status.json¶
{
"traceId": "proj-888-v2",
"fingerprintId": "bug-a1c02d34",
"fixStatus": "proposed",
"module": "Appointments",
"platform": "flutter",
"summary": "Patch generated: waitForVisible guard added",
"confidence": 0.94
}
π§ All Outputs Are:¶
| Trait | Description |
|---|---|
| π Traceable | Linked to traceId, fingerprintId, moduleId, and editionId |
| π§Ύ Explainable | Includes a Markdown summary with reasoning |
| β Validatable | Supports test rerun plan and post-fix validation |
| π€ Composable | Used by downstream agents or tools in CI, Studio, or PR pipelines |
π Safety Rules Enforced in Output¶
- Fixes scoped only to the affected module
- Edition-specific outputs include
editionId - High-risk patches are flagged with
riskLevel: highandneedsReview: true - No fix is emitted without
confidenceScore
β Summary¶
The Bug Resolver Agent emits structured, multi-format fix outputs:
*.yamlfor metadata*.difffor developer pipelines*.mdfor human-readable explainability*.jsonfor Studio and test automation
This guarantees traceable, verifiable, and production-safe resolution workflows across ConnectSoftβs distributed AI platform.
π§ Short-Term Memory¶
This section explains the short-term memory (STM) used by the Bug Resolver Agent during a single execution session. STM enables the agent to track localized, transient context while reasoning about the bug, synthesizing a fix, and orchestrating internal skill executions.
π§ Purpose of Short-Term Memory¶
| Function | Description |
|---|---|
| π Trace linkage | Retains active traceId, agentId, moduleId, and fingerprintId |
| π§© Chunk history | Tracks input snippets (stack trace, logs, prompt inputs) across chunked evaluations |
| π‘ Strategy path | Stores which fix strategies were attempted and which succeeded or failed |
| π Retry flow | Maintains retry count, fallback mode flags, and last failure reason |
| π§Ύ Artifact registry | Tracks which output artifacts (diff, yaml, md) have been synthesized during this execution |
π STM Example Snapshot¶
{
"traceId": "proj-888-v3",
"fingerprintId": "bug-b55f239d",
"moduleId": "NotificationService",
"testId": "SendConfirmationTest",
"stackTop": "NotificationQueue.Enqueue()",
"classification": "NullReferenceException",
"fixStrategyAttempted": ["addNullCheck", "defaultValueFallback"],
"currentStrategy": "addNullCheck",
"lastPatchStatus": "success",
"outputGenerated": {
"diff": true,
"yaml": true,
"summaryMd": true,
"verificationPlan": false
},
"retriesRemaining": 1
}
π§ STM Data Structure¶
Stored in a scoped context object (e.g., FixSessionContext.cs) and injected into every skill via:
SKContext["fingerprintId"]SKContext["stackTop"]SKContext["currentStrategy"]SKContext["moduleId"]SKContext["attemptLog"]
π Used By Skills:¶
| Skill | STM Usage |
|---|---|
PatchSynthesizerSkill |
Knows current strategy and module scope |
FixExplanationSkill |
Pulls classification, editionId, and retry history |
FixScoringSkill |
Considers number of strategies attempted and diff size |
ValidationPlanGeneratorSkill |
Knows which test to rerun and context of the patch |
π§ͺ Memory Scope and TTL¶
| Scope | Duration |
|---|---|
| Execution thread | Until patch is emitted or agent fails terminally |
| Retry block | STM preserved across up to 3 retry attempts |
| Skill orchestration | Reset after successful resolution and event emission |
π§© Benefits of STM¶
- β Reduces redundant analysis across retries
- β Enables consistent explanations and patch trace metadata
- β Ensures all outputs align with same fingerprint + strategy + edition scope
- β Powers skill reuse without reloading trace context on every call
π§Ό STM Expiry / Flush¶
| Event | Action |
|---|---|
| Fix successfully emitted | STM cleared |
| Agent terminated | STM snapshot stored in logs if debug mode enabled |
| All retries failed | STM flushed to fix-attempt-failure.yaml for escalation |
β Summary¶
Short-Term Memory enables the Bug Resolver Agent to:
- π§ Maintain context, decisions, and strategy flow across fix synthesis
- π Support retry handling and fallback logic
- π§Ύ Coordinate consistent traceable artifact generation
- βοΈ Feed skills with relevant execution parameters and constraints
STM is essential for modular, state-aware, and explainable resolution flows.
π§ Long-Term Memory¶
This section describes how the Bug Resolver Agent utilizes long-term memory (LTM) to reference previously resolved bugs, learned fix strategies, and agent-generated artifacts. LTM enables the agent to operate with experience, identify fix patterns, and improve resolution speed and accuracy over time.
π§ Role of Long-Term Memory (LTM)¶
| Function | Description |
|---|---|
| π Retrieve similar bugs | Uses embedding-based semantic search to match current issue with historical fingerprints |
| π οΈ Reuse prior fix patterns | Learns and reuses patch macros or diff templates from validated fixes |
| π Store fix metadata | Captures resolution strategies, explanations, editions affected, and validation results |
| π‘ Avoid duplication | Detects previously resolved bugs and avoids regenerating known fixes |
| π§Ύ Improve explanations | Enhances Markdown summaries using phrasing from similar past resolutions |
π¦ Stored Knowledge Types¶
| Artifact | Description |
|---|---|
bug-fingerprint-db |
Historical fingerprints with classification and context |
embedding-vector.json |
Encoded representations of stack traces + fix summaries for vector similarity search |
memory-entry.json |
Canonical memory records for resolution metadata, patch context, etc. |
patch-strategy-map.yaml |
Maps bug types to preferred fix macros used in successful past resolutions |
studio.knowledge.status.json |
Studio dashboard input showing which bugs have been resolved, how, and when |
fix-history.yaml |
Tracks outcomes of prior fixes by module, risk level, and edition scope |
π Example: Historical Memory Entry¶
{
"artifactId": "fix-bug-b99e4511",
"fingerprintId": "bug-b99e4511",
"classification": "Timeout",
"patchType": "test-patch",
"strategy": "waitForVisible",
"module": "Appointments",
"confidenceScore": 0.92,
"resolutionStatus": "applied",
"embeddingId": "vec-bug-b99e4511",
"tags": ["flaky", "ui", "modal", "async"]
}
π Retrieval Workflow¶
flowchart TD
A[Current Fingerprint] --> B[Embedding Vector Created]
B --> C[Query Memory Vector Store]
C --> D[Return Top 3 Matches]
D --> E[Inject Prior Fix into Prompt Context]
- Memory query enriched by:
classification,stackTraceTopFrame,tags,moduleId
π Fix Strategy Learning¶
| Signal | Stored In |
|---|---|
| High-confidence + validated fix | Stored in patch-strategy-map.yaml |
| Failed or reverted patch | Flagged in fix-history.yaml as avoid for given classification |
| Edition-based fixes | Indexed by editionId to reuse only in safe contexts |
π€ Memory Update Triggers¶
| Event | Update |
|---|---|
MemoryEntryResolved |
Adds fix to vector store + metadata index |
PatchValidationPassed |
Marks strategy as reusable, safe |
Manual Review Approved |
Adds human-reviewed fix explanation to future prompt context |
EditionDiffIntroduced |
Creates edition-aware memory overlay for future selective fix recall |
π§Ύ Governance Constraints¶
| Rule | Enforcement |
|---|---|
| Read-only for current run | LTM is not mutated mid-execution, only read from |
| Canonical metadata required | Fix must have traceId, fingerprintId, and agentId to be stored |
| Edition-aware recall | Fixes only retrieved for editions where they were validated or marked reusable |
| Timestamped records | All stored memory entries include ingestedAt timestamp for trace integrity |
β Summary¶
The Bug Resolver Agentβs Long-Term Memory allows it to:
- π§ Leverage past resolutions to propose smarter, safer fixes
- π οΈ Identify reusable strategies and avoid failure-prone patches
- π Track fix validation outcomes across modules and editions
- π Provide semantic similarity search to guide new diagnoses
- π§Ύ Expand its own resolution knowledge graph over time
This transforms the Bug Resolver Agent from a reactive patch generator into a learning, memory-enhanced AI repair assistant.
β Validation Strategies¶
This section outlines how the Bug Resolver Agent validates its proposed fixes, ensuring every emitted patch is safe, effective, and verifiable. Validation includes automated test re-execution, static heuristics, and optional human-in-the-loop workflows.
π§ͺ Core Validation Techniques¶
| Technique | Description |
|---|---|
| β Test Rerun Plan | Re-execute the test scenario or case that originally failed to confirm the bug is resolved |
| π Heuristic Scoring | Score patch based on scope, line count, module impact, risk, and prior success of strategy |
| π Patch Simulation | Apply the patch in a dry-run environment to evaluate compile and test behavior |
| π Diff Analysis | Confirm that the fix is localized, low-risk, and consistent with factory standards |
| π§Ύ Edition Filtering | Ensure the fix is valid only in the appropriate edition (multi-tenant safety) |
π Example: fix-verification-plan.json¶
{
"fingerprintId": "bug-a1c02d34",
"testId": "CancelAppointmentTest",
"retries": 5,
"passRateExpected": 1.0,
"autoValidate": true,
"runInCI": true,
"patchPreviewOnly": false
}
This plan may be sent to QA Agent, CI Pipeline Agent, or HumanOps agent.
π Patch Validation Workflow¶
flowchart TD
PATCH[Patch Synthesized]
PATCH --> PLAN[Generate Verification Plan]
PLAN --> TESTS[Trigger Rerun / Simulation]
TESTS --> SCORE[Evaluate Result]
SCORE -->|Success| FINALIZE[Mark Fix as Validated]
SCORE -->|Fail| RETRY[Try Alternate Strategy]
RETRY --> PATCH
π§ Scoring Heuristics¶
| Factor | Influence |
|---|---|
| Patch size (lines added/removed) | Smaller = safer |
| Affected layer | UI/test fixes less risky than domain/infrastructure |
| Edition scope | Global fixes scored more conservatively |
| Memory similarity | If retrieved fix has prior pass rate >90%, score boosted |
| Strategy strength | waitForVisible > retryLogic > silent catch |
π Risk Categorization¶
| Risk Level | Description |
|---|---|
low |
Test-only or configuration tweak |
medium |
Code change with trace-limited scope (1 method, 1 module) |
high |
Multi-file diff, domain logic, or critical path involved |
needsReview |
Any patch with score < 0.70 or >10 lines of code changed |
π Patch Validation Sources¶
| Source | Role |
|---|---|
Test Generator Agent |
Can generate new test assertions to cover the patch |
CI Agent |
Executes verification plan in simulated or PR environment |
QA Engineer Agent |
Manually reruns the scenario or reclassifies fix |
Developer Agent |
Reviews patch manually if risk flagged or retry fails |
π§Ύ Output After Validation¶
| Artifact | Description |
|---|---|
fix-validation-result.json |
Pass/fail + metrics (duration, test outcomes, CI log hash) |
MemoryEntryResolved (event) |
Only emitted if patch passes validation plan |
fix-history.yaml |
Resolution recorded with confidence + success flag |
π§Ό Fallbacks on Validation Failure¶
| Failure | Action |
|---|---|
| Test fails again | Alternate strategy attempted (e.g., waitFor β retry) |
| Patch causes crash | Patch invalidated; fix rejected; MemoryEntryRejected event emitted |
| Coverage incomplete | Trigger generation of extra test or suggest manual intervention |
β Summary¶
The Bug Resolver Agent ensures each fix is:
- π§ͺ Validated via test rerun or simulation
- π Scored for safety, precision, and risk
- π Re-tried automatically if needed
- π Traceable and reportable in CI or Studio dashboards
This validation layer provides automated confidence in autonomous bug fixing, keeping ConnectSoftβs AI-generated fixes production-grade and reviewable.
π Retry and Correction Flow¶
This section defines how the Bug Resolver Agent handles failed fix attempts, applies alternate strategies, and supports human intervention when automated resolution paths are exhausted or ambiguous.
The retry logic ensures high resilience while maintaining traceability and avoiding infinite loops.
π Retry Triggers¶
| Trigger | Description |
|---|---|
| β Fix fails validation | Test rerun unsuccessful or patch causes new error |
| β οΈ Confidence below threshold | FixScoringSkill yields score < 0.70 |
| π« Patch flagged as risky | Affects more than 2 files or includes non-local logic |
| β Strategy lacks memory precedent | No similar bug resolved successfully using selected fix macro |
π Retry Flow Diagram¶
flowchart TD
START[Initial Fix Attempt]
VALIDATE[Validate Patch]
VALIDATE -->|Fail| RETRY[Select Alternate Strategy]
RETRY --> SYNTH[Generate New Patch]
SYNTH --> VALIDATE
VALIDATE -->|Success| OUTPUT[Emit Final Fix]
VALIDATE -->|Max Retries Reached| ESCALATE[π Escalate to HumanOps Agent]
π Retry Strategy Sequence¶
| Step | Fallback |
|---|---|
| 1st | Primary macro from FixStrategySelectorSkill |
| 2nd | Closest matching fix from memory (SimilaritySearchSkill) |
| 3rd | Safe default macro (e.g. addNullCheck, waitForVisible, try-catch wrap) |
| 4th | Annotated patch + needsReview: true |
π§ Memory-Aware Retry¶
The agent uses historical memory to:
- Avoid repeating known failing patches
- Detect if similar errors were resolved using a different strategy
- Flag retry paths that previously caused regressions
Example:
π Example Retry Attempt Summary¶
{
"fingerprintId": "bug-a193f88c",
"retryAttempt": 2,
"previousStrategies": ["addNullCheck", "defaultFallback"],
"currentStrategy": "guardWithEditionCheck",
"result": "success",
"confidenceScore": 0.81
}
π¨ Escalation Flow¶
| Condition | Action |
|---|---|
| All retries fail (default: 3 max) | Output fix-attempt-failure.yaml and notify HumanOps Agent |
| Retry exceeds complexity threshold | Escalate automatically (e.g. recursive diff, test cascade) |
| Memory suggests low fixability | Output resolutionDeferred state and store for future training |
π§Ύ Escalation Artifact¶
fixEscalationReport:
fingerprintId: bug-a193f88c
reason: "All fix strategies failed"
attemptedStrategies: ["addNullCheck", "defaultFallback", "editionGuard"]
lastPatch: proposed-fix-v3.diff
humanReviewRequired: true
π Retry Metrics (in memory-metrics.json)¶
| Metric | Description |
|---|---|
averageRetryAttempts |
Typical retries per resolved bug |
retrySuccessRate |
% of cases where retry succeeded |
escalationRate |
% of bugs that required human review |
strategyChangeImpactScore |
Delta in confidence between first and final strategy |
β Summary¶
The Bug Resolver Agent supports robust, memory-guided retries, ensuring that:
- β Failed patches are not blindly retried
- π οΈ Safer or better-matched alternatives are explored
- π§βπ» Escalation is structured, traceable, and reviewable when needed
- π Fix loops are deterministic, intelligent, and non-repetitive
This empowers autonomous debugging with safeguards, ensuring productivity without sacrificing confidence or oversight.
π€ Collaboration Interfaces¶
This section defines how the Bug Resolver Agent interacts with other ConnectSoft agents, services, dashboards, and trace frameworks β supporting seamless diagnosis-to-resolution handoff, patch application, and traceable coordination across the AI Software Factory.
π§© Agent Collaboration Overview¶
flowchart TD
BI[π Bug Investigator Agent]
DEV[π¨βπ» Developer Agent]
QA[π§ͺ QA Engineer Agent]
COMMIT[π€ Code Committer Agent]
STUDIO[π Studio Agent]
KM[π§ Knowledge Management Agent]
BI --> Resolver[π οΈ Bug Resolver Agent]
Resolver --> DEV
Resolver --> COMMIT
Resolver --> QA
Resolver --> STUDIO
Resolver --> KM
π Inputs Received From:¶
| Agent | Interaction |
|---|---|
| Bug Investigator Agent | Provides bug-fingerprint.json, fix-recommendation.yaml, classification metadata |
| QA Agent | Provides test failure trace, flakiness index, validation results |
| Studio Agent | May allow inline review, tag fix as approved, or show resolution timeline |
| Developer Agent | May optionally tag or review a failed fix or diff |
| KM Agent | Provides access to fix memory (via memory-entry.json, vector search, patch templates) |
π€ Outputs Shared With:¶
| Agent | Format |
|---|---|
| Developer Agent | proposed-fix.diff, fix-summary.md for review or editing |
| Code Committer Agent | Resolution package (validated patch, metadata, confidence score) |
| QA Agent | fix-verification-plan.json, rerun instructions, test guidance |
| Studio Agent | studio.bug.status.json, dashboard tile update, risk classification |
| KM Agent | New fix memory entry (memory-entry.json) for embedding and reuse |
π API/Interface Types Used¶
| Interface | Description |
|---|---|
| SK Skills | Invoked and exposed to other agents for patch suggestion, scoring, fix explanation |
| Memory Event Bus | Emits events like MemoryEntryResolved, FixProposed, FixRejected |
| Blob Storage / Artifact Push | Stores .diff, .yaml, .md, and validation JSON |
| HTTP API (internal) | Enables downstream agents to fetch last fix for given fingerprintId or traceId |
| Studio Interface Hooks | Tile updates, diff previews, tag actions (mark as fixed, requires human review) |
π¬ Collaboration Use Cases¶
| Scenario | Interaction |
|---|---|
| π§ Similar fix found in memory | Uses KM Agent to load prior patch and adjust it |
| π§ͺ QA rerun fails | QA Agent sends validationFailed β Resolver retries or escalates |
| π§βπ» Developer requests alternate strategy | Developer Agent suggests fix strategy via Studio or annotation |
| π§Ύ Fix committed | Committer Agent emits FixConfirmed, which triggers final memory update and Studio tile closure |
π Collaboration Rules¶
| Rule | Enforced Behavior |
|---|---|
traceId and fingerprintId required |
All collaboration must be trace-linked |
| Edition-safe context | Resolver cannot emit or commit cross-edition patches unless explicitly flagged |
| Skill-level modularity | Other agents may invoke Resolverβs patch synthesis skill independently with shared context |
| Retry authority | Only Bug Resolver Agent or QA Agent may trigger retry within resolution session |
| Resolution status tracking | Studio reflects proposed, validated, committed, failed, or escalated states |
β Summary¶
The Bug Resolver Agent integrates seamlessly across the ConnectSoft ecosystem by:
- π Receiving diagnostic input from upstream agents
- π€ Sharing testable, diff-based fixes with downstream agents
- π§ Contributing to shared memory and knowledge
- π Updating Studio dashboards with real-time resolution status
- π Supporting retries, rollbacks, and human intervention paths
This collaboration design makes the agent a trusted, composable node in the broader ConnectSoft agent mesh.
π Observability Hooks¶
This section details the telemetry, metrics, and eventing hooks built into the Bug Resolver Agent. These observability mechanisms ensure all fix attempts are traceable, auditable, measurable, and visible in Studio, CI/CD pipelines, and downstream decision flows.
π‘ Emitted Events¶
| Event Type | When Emitted | Payload Includes |
|---|---|---|
FixProposed |
Fix synthesized and validated | traceId, fingerprintId, confidenceScore, strategy, artifactId |
MemoryEntryResolved |
Fix accepted, committed, or marked final | traceId, artifactId, moduleId, resolutionStatus |
FixRejected |
Fix failed validation or exceeded retry limits | traceId, reason, strategiesAttempted, escalated: true/false |
FixEscalated |
Manual review required | fingerprintId, patchSize, riskLevel, reason |
All events are published to Azure Event Grid, Service Bus, or stored in event logs for audit dashboards.
π Logged Artifacts¶
| File | Description |
|---|---|
bug-resolution-log.jsonl |
Execution trace of fix generation and validation steps |
memory-metrics.json |
Metrics snapshot per run: retries, risk levels, validation outcome |
studio.bug.status.json |
Dashboard-facing fix metadata and resolution status |
fix-validation-result.json |
Detailed validation feedback (pass/fail, rerun score, output) |
π§ Telemetry Signals¶
| Signal Name | Captured Info |
|---|---|
FixSession.Started |
traceId, fingerprintId, moduleId, agentId |
FixSynthesized |
strategy, linesChanged, embeddingId, strategySource (manual, memory, fallback) |
FixValidated |
validationOutcome, passRate, testId |
FixScored |
confidenceScore, riskLevel, patchImpactScore |
FixSession.Completed |
finalStatus, durationMs, retryCount |
All signals are exposed to OpenTelemetry, Application Insights, and optionally streamed to Studio and observability dashboards.
π Key Metrics¶
| Metric | Description |
|---|---|
fixConfidenceHistogram |
Distribution of confidenceScore across all resolved bugs |
retrySuccessRate |
Ratio of retries that resulted in successful fix |
riskLevelDistribution |
Proportion of fixes categorized as low, medium, high risk |
patchSizeStats |
Mean and max patch line count |
validationPassRate |
% of fixes passing verification on first attempt |
escalationRate |
Bugs escalated to human review vs. auto-resolved |
π Studio Dashboard Integration¶
| Tile | Description |
|---|---|
| π’ Resolved Bugs | Shows count, module distribution, and validation success rate |
| π Fix Summaries | Displays recent fix-summary.md content |
| π Fix Diff Viewer | Preview the patch before merge |
| β οΈ Needs Review | Fixes below confidence threshold or flagged manually |
| π Fix Metrics Panel | Aggregates confidence, risk, retry, and strategy trends per sprint |
π§Ύ CI/CD Feedback Loop¶
| Output | Consumed By |
|---|---|
fix-verification-plan.json |
QA/Test Agent, CI Agent |
MemoryEntryResolved |
Used to close Studio tile, signal downstream fix available |
FixRejected |
Triggers retry attempt or human escalation path |
β Summary¶
The Bug Resolver Agent delivers rich observability by:
- π Emitting structured, real-time events
- π Logging metrics, diffs, summaries, and decisions
- π€ Surfacing insights into Studio dashboards and CI pipelines
- π Enabling feedback loops that improve fix accuracy and agent learning
This ensures every fix is measurable, explainable, and production-grade β empowering transparency in autonomous debugging workflows.
π§βπ» Human Intervention Hooks¶
This section outlines how human engineers β via Developer Agents, QA leads, or HumanOps roles β can review, override, or augment the Bug Resolver Agentβs behavior, especially in ambiguous, high-risk, or multi-edition scenarios.
π οΈ Intervention Triggers¶
| Trigger | Description |
|---|---|
| β All retry strategies failed | Patch generation exceeded configured retry limit (default: 3) |
| β οΈ Low confidence fix | confidenceScore < 0.70, or riskLevel: high |
| π§© Multi-module diff | Affects more than one service or domain context |
| π« Validation failure | Test rerun failed despite patch application |
| π€ Studio manual tag | Human-in-the-loop explicitly flags patch as needs-review |
| π Edition collision | Patch conflicts with memory overlay in another edition |
π§Ύ Human-Editable Artifacts¶
| File | Description |
|---|---|
fix-summary.md |
HumanOps can clarify explanation, fix logic, or rewrite the summary |
proposed-fix.diff |
May be reviewed, edited, or rejected via Studio or Dev Agent |
fix-annotation.yaml |
Human-provided notes on strategy, correctness, or review result |
fix-review.log |
Audit log of all manual actions taken on a fix |
fix-attempt-failure.yaml |
Summary of why automated resolution failed |
π§ Studio Collaboration Panel¶
| Interface | Behavior |
|---|---|
| π€ Proposed Fix Viewer | Preview patch and explanation, with side-by-side diff |
| π‘ βNeeds Reviewβ Flag | Appears automatically when score is low or risk is high |
| βοΈ Inline Feedback | Reviewers can annotate diff or suggest better macro |
| β Mark as Reviewed | Signals downstream agents to treat patch as trusted |
| π Regenerate Fix | Manual override to trigger new generation from different strategy |
π¨βπ» HumanOps Actions Supported¶
| Action | Effect |
|---|---|
| β Approve fix | Agent emits MemoryEntryResolved, patch forwarded to Committer |
| π Edit explanation | Updates fix-summary.md, added to memory on next run |
| π Reject fix | Agent emits FixRejected, resets resolution state |
| π Retry with new macro | Triggers fix generation using manually chosen template |
| β Blacklist strategy | Prevents strategy from being reused for that classification or module |
π Example: fix-annotation.yaml¶
fingerprintId: bug-cde912f2
reviewedBy: miriam.gold@connectsoft.ai
decision: rejected
reason: "Fix uses deprecated modal handler. Please use new waitForVisibleV2()"
suggestedStrategy: "waitForVisibleV2"
timestamp: 2025-05-15T22:32:11Z
π Human Review Integration Flow¶
flowchart TD
Agent[Bug Resolver Agent]
Patch[Patch Proposed]
Score[Confidence < 0.70 or Retry Failed]
Review[π§βπ» Human Review Triggered]
Review --> Accept[β
Approve]
Review --> Reject[π Reject]
Review --> Retry[π Manual Retry]
Patch --> Score --> Review
Accept --> Finalize[Emit MemoryEntryResolved]
Reject --> Escalated[Emit FixRejected + escalation]
Retry --> NewPatch[Generate New Fix]
π Review Metrics (in memory-metrics.json)¶
| Metric | Purpose |
|---|---|
manualReviewRate |
% of fixes requiring human intervention |
avgReviewTimeSec |
Mean time between fix proposal and human review |
overrideRate |
% of patches modified by human input |
approvalConfidenceDelta |
How much confidence increased after manual revision |
β Summary¶
The Bug Resolver Agent supports structured human intervention to ensure:
- π§Ύ Fixes are transparent, reviewable, and safe
- β Low-confidence or ambiguous patches are never auto-applied
- π§ Knowledge feedback loops include human insight
- π οΈ Fix summaries, diffs, and metadata can be updated pre-commit
- π Retry and override flows are deterministic and auditable
This ensures the platform maintains enterprise-grade trust and control β even in an AI-driven debugging pipeline.
π Summary and Positioning¶
This final cycle consolidates the role, architecture, skills, responsibilities, and system integration of the Bug Resolver Agent within the ConnectSoft AI Software Factory. It reinforces how this agent transforms diagnosis into resolution β autonomously, safely, and at scale.
π― Core Purpose Recap¶
Convert diagnostic artifacts into explainable, edition-aware, test-verifiable code fixes β autonomously and traceably.
The Bug Resolver Agent is a resolution engine, responsible for closing the loop from failure β fix β verification within a modular, multi-agent AI software lifecycle.
π§© System Placement¶
flowchart TD
QA[π§ͺ QA Agent]
BI[π Bug Investigator Agent]
BR[π οΈ Bug Resolver Agent]
DEV[π¨βπ» Developer Agent]
COMMIT[π€ Code Committer Agent]
STUDIO[π Studio Agent]
KM[π§ Knowledge Management Agent]
QA --> BI --> BR --> DEV --> COMMIT
BR --> STUDIO
BR --> KM
π§ Functional Overview¶
| Layer | Role |
|---|---|
| π Diagnosis | Analyzes stackTrace, bug-fingerprint.json, and test failures |
| π§ Memory Recall | Retrieves similar bugs and past fixes from vector DB |
| π οΈ Fix Synthesis | Generates patch using semantic macros and embedded context |
| π Explanation | Emits Markdown summary for audit, review, and commit |
| β Validation | Suggests reruns, replays, or test regen plans |
| π Retry + Escalation | Fallbacks for failure; safe human override paths |
| π€ Emission | Outputs .diff, .yaml, .json, .md with trace linkage |
| π Observability | Logs telemetry, emits events, updates Studio tiles |
π§Ύ Outputs Recap¶
| Artifact | Description |
|---|---|
proposed-fix.diff |
Git patch representing the synthesized fix |
fix-summary.md |
Natural-language explanation of the resolution |
bug-resolution.yaml |
Structured traceable metadata |
fix-verification-plan.json |
Post-fix validation strategy |
MemoryEntryResolved |
Event indicating resolution completion |
π§ Agent Skills Used¶
| Skill | Function |
|---|---|
ErrorClassifierSkill |
Classify and root-cause stack traces |
PatchSynthesizerSkill |
Generate fix from code and error context |
FixExplanationSkill |
Generate Markdown summary |
FixScoringSkill |
Rate fix confidence and risk |
SimilaritySearchSkill |
Retrieve semantically similar fixes |
ValidationPlanGeneratorSkill |
Suggest test reruns or patch simulations |
π Safety and Governance¶
| Feature | Mechanism |
|---|---|
| Edition-aware patching | editionId scope respected in all emitted patches |
| Confidence scoring | <0.70 requires review, never auto-committed |
| Human override | Editable summaries, diffs, annotations, retry macros |
| Observability | Full telemetry + OpenTelemetry trace support |
| Risk gating | Risky patches auto-flagged as needs-review |
π Platform Value¶
| Benefit | Description |
|---|---|
| β±οΈ Speeds resolution | Reduces MTTR (mean time to repair) across test or runtime failures |
| π§ Remembers fixes | Learns and reuses resolution strategies across microservices |
| π Automates iteration | Retries, adjusts, and escalates intelligently |
| π§Ύ Improves quality | Ensures test-verifiable, explainable, and trace-linked fixes |
| π§© Scales with editions | Fully supports ConnectSoftβs edition/multi-tenant design patterns |
β Final Statement¶
The Bug Resolver Agent is the ConnectSoft Factoryβs AI-powered patch engine β turning:
- Failing tests
- Stack traces
- Execution anomalies
into:
- Semantic patches
- Markdown explanations
- Verified, memory-linked resolutions
It is modular, memory-enhanced, trace-aware, and collaborative by design β making bug resolution a first-class citizen in autonomous SaaS generation.