← all projects

kevin@portfolio:~$ cat projects/taskflow-devsecops.md

# DevSecOps · AI Failure Intelligence

TaskFlow DevSecOps Pipeline

A CI/CD pipeline for a Go API that explains failed builds using similar past failures and an LLM report.

Timeframe
2026
Status
Public team project
Stack
GoGitHub ActionsDockerGHCRgovulncheckgosecPythonGemini embeddingsTelegram
Contribution
I built the AI failure intelligence pipeline. It covers workflow changes, log cleaning, the embedding index, similar-failure retrieval, the report generator, the knowledge base and the controlled-failure evaluation. I then fixed log collection and report reliability. Earlier I added the security scan job, the project report, and the Kubernetes manifests with the deploy workflow and incident docs.

Numbers

15/15
Top-3 retrieval accuracy on controlled failure scenarios

Problem

When a CI pipeline fails, developers get a long raw log. Similar failures also repeat.

How it works

TaskFlow is a Go task API used as a DevSecOps case study. The pipeline runs tests, security scans, a Docker build, a push to GHCR and a smoke test. When a job fails, the failed logs are cleaned, the three most similar past failures are retrieved by embedding similarity, and an LLM writes a debugging report from that evidence. On success no AI call is made.

Push or pull requestCISecurityCDStable tagFailure checkLog cleaningSimilar failuresAI reportNotifyPush or pull requestCISecurityCDStable tagFailure checkLog cleaningSimilar failuresAI reportNotify
  1. Push or pull request A change reaches main or develop.
  2. CI Go matrix, vet, race tests, integration tests, coverage gate, build.
  3. Security govulncheck and gosec, blocking on findings.
  4. CD Build and push the image to GHCR, then smoke test.
  5. Stable tag A successful image is tagged stable.
  6. Failure check Decides if any job failed. If not, no AI is called.
  7. Log cleaning Failed logs are collected, cleaned and secrets masked.
  8. Similar failures Top-3 matches from the knowledge base by cosine similarity.
  9. AI report An LLM writes a Markdown report from the evidence.
  10. Notify A Telegram summary is sent.

Key decisions

  1. 01

    The LLM is only an explanation layer. Root-cause candidates come from the cleaned log and the retrieved similar failures, which lowers the risk of invented causes.

  2. 02

    AI runs only on failure, so successful runs cost nothing.

  3. 03

    A synthetic, validated knowledge base is used to start, because real failed logs were few. Entries are marked as synthetic.

  4. 04

    The full cleaned log is the main retrieval query. The filtered suspicious lines only support the report.

Results

  • Controlled evaluation of 15 failure scenarios: 15/15 Top-1 and 15/15 Top-3 with the full cleaned log.
  • The filtered-lines variant scored 14/15 Top-1 and 15/15 Top-3.
  • The knowledge base is synthetic and small (5 entries), so this measures a controlled setting.