SDCICD-1735: update krknai prompt and markdown-to-HTML conversion#3128
SDCICD-1735: update krknai prompt and markdown-to-HTML conversion#3128minlei98 wants to merge 1 commit intoopenshift:mainfrom
Conversation
minlei98
commented
Feb 26, 2026
- Update Krknai.yaml prompt
- Add MergeTemplates to PromptStore for loading package-local templates on top of defaults.
- Add markdown-to-HTML conversion for --report-format=html in the krkn-ai engine
- keeping the default osde2e analyzer unchanged.
|
There are test jobs defined for this repository which are not configured to run automatically. Comment |
|
@minlei98: This pull request references SDCICD-1735 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: minlei98 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
pkg/krknai/analysisengine/engine.go
Outdated
| return nil | ||
| } | ||
|
|
||
| const htmlTemplate = `<!DOCTYPE html> |
There was a problem hiding this comment.
Can this template be moved to a separate file?
There was a problem hiding this comment.
moved to report.html
| 1. Identify the most impactful chaos scenarios (highest fitness scores indicate more system disruption) | ||
| 2. Identify cluster vulnerabilities and weak points exposed by chaos tests | ||
| 3. Provide actionable resilience recommendations | ||
| Krkn-AI evolves chaos scenarios via genetic algorithm. The SLO fitness function combines health check failures + latency deviation as GA feedback. Higher fitness = more system disruption = test objective achieved. |
There was a problem hiding this comment.
what does "GA feedback" stand for?
There was a problem hiding this comment.
GA stands for Genetic Algorithm
There was a problem hiding this comment.
Could you spell it out so the AI can make sense of it?
| Output a markdown report with these sections: | ||
| # Krkn-AI Chaos Test Report | ||
| ## Executive Summary (2-3 sentences) | ||
| ## Test Configuration (GA params, scenarios, health check targets) |
There was a problem hiding this comment.
Can you add a short cluster configuration here? Should at least include - cluster version, type, hypershift yes/no.
|
krknai-22report.html |
22b5db7 to
f5cd52d
Compare
pkg/krknai/analysisengine/engine.go
Outdated
| func markdownToHTML(content string) string { | ||
| htmlTemplate, err := krknPrompts.ReadFile(htmlTemplatePath) | ||
| if err != nil { | ||
| return content |
There was a problem hiding this comment.
should this return or log an error?
pkg/krknai/analysisengine/engine.go
Outdated
| return nil | ||
| } | ||
|
|
||
| func markdownToHTML(content string) string { |
There was a problem hiding this comment.
We could use LLM to generate HTML using --report-format in the prompt with a condition.
But to save tokens and keep better control, we can handle the HTML conversion ourselves.
There was a problem hiding this comment.
might be worth a try if it would remove 3 dependencies
"github.com/gomarkdown/markdown"
mdhtml "github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
Q: how does the prompt way consume more tokens?
There was a problem hiding this comment.
Agree, use our own HTML conversion, we could control the output better.
internal/prompts/prompts.go
Outdated
|
|
||
| // MergeTemplates loads additional templates from the given filesystem, | ||
| // overwriting any existing templates with the same ID. | ||
| func (ps *PromptStore) MergeTemplates(templatesFS fs.FS) error { |
There was a problem hiding this comment.
MergeTemplates sounds like you're combining two predefined sets (for example, default and Krkn AI templates). A clearer name would be RegisterTemplates or AddTemplates, since the function is simply adding templates rather than performing a merge.
f5cd52d to
a66b16a
Compare
|
@minlei98: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |