ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)
Go aiai-agentsautonomous-agentsbug-bountydockergolanglinuxllmmcpnextjspenetration-testingpentestpostgresqlreareactred-teamsecuritysecurity-automationsqlitetypescript
refactor(agent): remove unused finding traffic guidance
Николай Гусев25217afdce67
diff --git a/agent/finding_recorder.go b/agent/finding_recorder.goindex eed68d2..f5368f1 100644--- a/agent/finding_recorder.go+++ b/agent/finding_recorder.go@@ -20,10 +20,6 @@ type TrafficCaptureChecker interface {TrafficExists(ctx context.Context, trafficID string) (bool, error)}-// Tool-use guidance is appended without replacing the user's editable prompt.-// It does not require capture or claim that unavailable traffic tools exist.-const findingTrafficGuidance = "\n\n**Vulnerability traffic evidence**: when reporting a vulnerability via report_finding, bind real HTTP request/response IDs via traffic_refs in reproduction order; domains and times are only candidate filters and do not imply association. A finding without bound traffic stays recorded and visible, but cannot close a goal via prove_goal until verified traffic matching its asset host is bound (via report_finding or bind_finding_traffic). For TCP and other non-HTTP vulnerabilities, when nothing was captured, or when there is no exact match, omit traffic_refs or pass [], keep verifiable command output and logs in evidence, and close non-HTTP goals with an observed tool_output fact. Do not guess IDs, and do not re-probe just to capture packets."-func (t *ToolSet) SetFindingRecorder(r FindingRecorder) { t.findingRecorder = r }func (w *Worker) SetFindingRecorder(r FindingRecorder) { w.findingRecorder = r }func (p *Planner) SetFindingRecorder(r FindingRecorder) { p.findingRecorder = r }diff --git a/agent/finding_recorder_source_test.go b/agent/finding_recorder_source_test.gonew file mode 100644index 0000000..71ab6d9--- /dev/null+++ b/agent/finding_recorder_source_test.go@@ -0,0 +1,26 @@+package agent++import (+ "go/ast"+ "go/parser"+ "go/token"+ "testing"+)++func TestFindingRecorderHasNoLegacyTrafficGuidance(t *testing.T) {+ // Check the declaration directly: an unused constant cannot affect prompt output.+ f, err := parser.ParseFile(token.NewFileSet(), "finding_recorder.go", nil, parser.SkipObjectResolution)+ if err != nil {+ t.Fatal(err)+ }+ ast.Inspect(f, func(n ast.Node) bool {+ if spec, ok := n.(*ast.ValueSpec); ok {+ for _, name := range spec.Names {+ if name.Name == "findingTrafficGuidance" {+ t.Fatal("finding_recorder.go declares the obsolete findingTrafficGuidance constant")+ }+ }+ }+ return true+ })+}