Knowledge Base
Self-learning loop — every engineer resolution saves a fix for future AI triage
How the self-learning loop works
When an escalated ticket is resolved by an engineer, they can opt to “Save fix to knowledge base”. GhostFix stores the error pattern and solution here. The next time a similar bug is reported, the AI retrieves this entry via RAG and produces a higher-confidence, grounded diagnosis — without any re-training.
Trigger:AppTier connection timeout
Proposed Fix
The AppTier module is failing due to a stale connection pool. The hotfix resets the pool and increases the connection timeout threshold from 2s to 5s, preventing cascade failures under load.
Patch Preview
diff --git a/src/services/appTier.ts b/src/services/appTier.ts
--- a/src/services/appTier.ts
+++ b/src/services/appTier.ts
@@ -12,7 +12,8 @@ const poolConfig = {
- connectionTimeoutMillis: 2000,
+ connectionTimeoutMillis: 5000,
+ idleTimeoutMillis: 30000,
max: 10,
};Trigger:authentication token expiry JWT
Proposed Fix
JWT tokens are expiring prematurely due to clock skew between auth servers. The hotfix adds a 5-minute (300s) tolerance to token validation, eliminating false "session expired" errors.
Patch Preview
diff --git a/src/middleware/auth.ts b/src/middleware/auth.ts
--- a/src/middleware/auth.ts
+++ b/src/middleware/auth.ts
@@ -8,3 +8,3 @@ const verifyToken = (token: string) => {
- return jwt.verify(token, SECRET);
+ return jwt.verify(token, SECRET, { clockTolerance: 300 });
};Trigger:dashboard not loading 504 slow blank screen
Proposed Fix
The dashboard API is returning 504 Gateway Timeouts due to a missing database index on the analytics table. The hotfix adds the index and wraps the query in a 5-minute Redis cache layer.
Patch Preview
diff --git a/src/api/dashboard.ts b/src/api/dashboard.ts
--- a/src/api/dashboard.ts
+++ b/src/api/dashboard.ts
@@ -5,5 +5,10 @@ export async function getDashboardData(userId: string) {
+ // HOTFIX: Redis cache — prevents repeated slow queries causing 504s
+ const cached = await redis.get(`dashboard:${userId}`);
+ if (cached) return JSON.parse(cached);
+
const data = await db.query(
`SELECT * FROM analytics WHERE user_id = $1 ORDER BY created_at DESC`,
[userId]
);
+ await redis.set(`dashboard:${userId}`, JSON.stringify(data), { EX: 300 });
return data;
}Trigger:file upload fails large files CORS error
Proposed Fix
Large file uploads are failing due to a 10MB payload limit set in the API gateway config and a missing CORS header for the storage endpoint. The hotfix raises the limit to 100MB and adds the correct header.
Patch Preview
diff --git a/src/config/gateway.ts b/src/config/gateway.ts
--- a/src/config/gateway.ts
+++ b/src/config/gateway.ts
@@ -3,4 +3,5 @@ export const gatewayConfig = {
- maxPayloadSize: "10mb",
+ maxPayloadSize: "100mb",
+ corsHeaders: { "Access-Control-Allow-Origin": process.env.ALLOWED_ORIGIN },
};Trigger:email notifications not sending stuck queued
Proposed Fix
The email worker is silently failing because the SMTP credentials rotated last week and the environment variable was not updated in production. The hotfix re-points the mailer to the correct credentials key.
Patch Preview
diff --git a/src/workers/mailer.ts b/src/workers/mailer.ts
--- a/src/workers/mailer.ts
+++ b/src/workers/mailer.ts
@@ -7,3 +7,3 @@ const transporter = nodemailer.createTransport({
- auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
+ auth: { user: process.env.SMTP_USER_V2, pass: process.env.SMTP_PASS_V2 },
});