Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.
Python agentsai-hackingai-penetration-testingai-pentestingai-securityartificial-intelligencebug-bountycode-qualityctf-toolscybersecuritycybersecurity-toolsethical-hackinghackingllm-securityoffensive-securitypenetration-testingpentesting-toolsred-teamingsecuritysecurity-automation
fix(tui): render report section bodies as markdown
Ahmed Allam64dae6f4845d
diff --git a/strix/interface/tui/internal/render/dependency.go b/strix/interface/tui/internal/render/dependency.goindex f41bddc3..f0210696 100644--- a/strix/interface/tui/internal/render/dependency.go+++ b/strix/interface/tui/internal/render/dependency.go@@ -51,7 +51,7 @@ func renderDependencyReport(args map[string]any, result any) string {field("Target", StringValue(args["target"]))section := func(label, value string) {if value != "" {- b.WriteString("\n\n" + Bold(Field).Render(label) + "\n" + value)+ b.WriteString("\n\n" + Bold(Field).Render(label) + "\n" + renderAssistantMarkdown(value))}}section("Description", StringValue(args["description"]))diff --git a/strix/interface/tui/internal/render/render_test.go b/strix/interface/tui/internal/render/render_test.goindex e14169fd..58a854b2 100644--- a/strix/interface/tui/internal/render/render_test.go+++ b/strix/interface/tui/internal/render/render_test.go@@ -321,3 +321,25 @@ func TestCollapseToolOnlyOutputHeavyTools(t *testing.T) {t.Fatal("respond_to_user must never collapse")}}++func TestReportSectionsRenderMarkdown(t *testing.T) {+ body := "**Systemic themes:** zero auth on `/share`\n\n# Recommendations\n1. Merge the **ejs 3.1.10** fix"+ cases := map[string]string{+ "finish_scan": renderFinishScan(map[string]any{"executive_summary": body}),+ "create_vulnerability_report": renderVulnerabilityReport(map[string]any{"title": "x", "description": body}, nil),+ "create_dependency_report": renderDependencyReport(map[string]any{"title": "x", "description": body}, nil),+ }+ for name, out := range cases {+ plain := ansi.Strip(out)+ for _, raw := range []string{"**", "`", "# Recommendations"} {+ if strings.Contains(plain, raw) {+ t.Fatalf("%s left raw markdown %q in %q", name, raw, plain)+ }+ }+ for _, want := range []string{"Systemic themes:", "/share", "Recommendations", "1. Merge the ejs 3.1.10 fix"} {+ if !strings.Contains(plain, want) {+ t.Fatalf("%s lost %q in %q", name, want, plain)+ }+ }+ }+}diff --git a/strix/interface/tui/internal/render/report.go b/strix/interface/tui/internal/render/report.goindex 8b82b602..2c32eca4 100644--- a/strix/interface/tui/internal/render/report.go+++ b/strix/interface/tui/internal/render/report.go@@ -89,7 +89,7 @@ func renderReport(args map[string]any, result any, heading, pending string) strisection := func(label, value string) {if value != "" {- b.WriteString("\n\n" + Bold(Field).Render(label) + "\n" + value)+ b.WriteString("\n\n" + Bold(Field).Render(label) + "\n" + renderAssistantMarkdown(value))}}if confidence := StringValue(args["confidence"]); confidence != "" {diff --git a/strix/interface/tui/internal/render/scan.go b/strix/interface/tui/internal/render/scan.goindex d1fc75c5..1c82ed94 100644--- a/strix/interface/tui/internal/render/scan.go+++ b/strix/interface/tui/internal/render/scan.go@@ -13,7 +13,7 @@ func renderFinishScan(args map[string]any) string {b.WriteString(Col(Green).Render("◆ ") + Bold(Green).Render("Penetration test completed"))section := func(label, value string) {if value != "" {- b.WriteString("\n\n" + Bold(Field).Render(label) + "\n" + value)+ b.WriteString("\n\n" + Bold(Field).Render(label) + "\n" + renderAssistantMarkdown(value))}}es := StringValue(args["executive_summary"])