mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-13 11:40:53 +08:00
Comments, doc comments, UI labels, log and error messages, LLM prompt strings, markdown docs, test data and assertions. Identifiers, enum keys, routes, placeholders and code structure are unchanged. Notes: - docs/漏洞流量证据.md renamed to docs/vulnerability-traffic-evidence.md - tests that exercised CJK specific handling (GBK zip names, Chinese full text search) now use ASCII equivalents; go build passes and the test suite matches the pre translation baseline (remaining failures need a PostgreSQL DSN and fail identically on the original) - frontend mention syntax now uses English kinds (finding, asset, ...) matching the backend, chat mentions tests pass
23 lines
1.5 KiB
Go
23 lines
1.5 KiB
Go
package agent
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/Autumn-27/artex/db"
|
|
)
|
|
|
|
// FindingRecorder is injected by the host; agents never synthesize or copy
|
|
// evidence bodies themselves. Its implementation owns the atomic write.
|
|
type FindingRecorder interface {
|
|
Record(context.Context, db.RecordFindingInput, []db.TrafficRef) (*db.RecordedFinding, 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 (optional)**: when reporting a vulnerability via report_finding, if there are HTTP requests/responses you have reviewed and confirmed to support the conclusion, you may bind their real IDs via traffic_refs in reproduction order; domains and times are only candidate filters and do not imply association. For TCP and other non-HTTP vulnerabilities, when nothing was captured, or when there is no exact match, omit it or pass [], keep other verifiable evidence such as command output and logs in evidence, and preferably state why nothing was bound. 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 }
|
|
func (m *MainAgent) SetFindingRecorder(r FindingRecorder) { m.findingRecorder = r }
|