Code comments that no longer describe the code (llm, agent, mapper, bench)

Offen
#210 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Dokumentation
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
go

Rechercherichtung

Start by comparing the comments at the listed locations in internal/llm/anthropic.go, internal/agent/fixer.go and reviewer.go, internal/agent/tools/tools.go, internal/mapper/mapper.go, internal/bench/run.go and results.go, internal/report/json.go, internal/seed/external.go, and internal/cli/flags.go with the code and tests they describe. Resolve each checklist item, deciding whether Correlate and failed-fixture rows need wording or code changes. Run make test-short and make lint; done means all listed comments are accurate and the checks pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

documentation good first issue severity: low

Summary

A checklist of comments that would mislead the next reader. Each was read against the code it sits on.

Where

  • internal/llm/anthropic.go:128
  • internal/agent/fixer.go:176
  • internal/agent/reviewer.go:124
  • internal/agent/tools/tools.go:279
  • internal/mapper/mapper.go:389
  • internal/bench/run.go:37, internal/bench/results.go:73
  • internal/report/json.go:17
  • internal/seed/external.go:315
  • internal/cli/flags.go:63

Details

  • internal/llm/anthropic.go:128-130: "tool results are user turns, so merge them into a preceding user turn if there is one", followed by a plain append. Nothing is merged.
  • internal/agent/fixer.go:176-184: the doc comment of hideKnownSecrets sits directly above the doc comment of hideAllKnownSecrets, so both attach to the latter and hideKnownSecrets has none.
  • internal/agent/reviewer.go:124-126: Correlate "asks the model which confirmed findings combine". It takes every finding with status open, which includes leads nobody investigated; only the first 60 rows are sent while ids beyond them are still accepted from the reply. Either filter to investigated findings or say "open findings" and build the id index from the rows sent.
  • internal/agent/tools/tools.go:279: "computed once per Registry". It is computed once per shared cache, and in a scan not at all (the mapper's listing is preloaded).
  • internal/mapper/mapper.go:389-390: a doc comment for isTestFile, which no longer exists, is attached to type linePattern.
  • internal/bench/run.go:37-38: "its truth entries count as false negatives". The totals leave failed fixtures out of every figure, as Totals.FailedFixtures says. The fixture row still carries false_negatives and missed, so per-fixture rows of a results file do not add up to its totals; either zero them on a failed fixture or say so.
  • internal/report/json.go:17-33: the list of keys "always in this order" omits rejected.
  • internal/seed/external.go:315: "Note returns what the last Run dropped"; it also returns the configured Semgrep rules before any run and the honored ignore files.
  • internal/cli/flags.go:63: the comment on the budget flag group omits --allow-unpriced.

Impact

Maintenance cost only. The Correlate wording also shapes what a reader believes a kill chain in a report is built from, and the bench comment leaves an inconsistency in committed results files.

Suggested fix

Correct the comments; for Correlate and the bench rows decide between changing the code and changing the words.

Acceptance criteria

  • Each checklist item is resolved
  • go vet and the linters stay clean

Related: #61

Getting started

  • Relevant files: internal/agent/fixer.go, internal/agent/reviewer.go, internal/agent/tools/tools.go, internal/bench/run.go, internal/cli/flags.go, internal/llm/anthropic.go, internal/mapper/mapper.go, internal/report/json.go, internal/seed/external.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: documentation|internal/llm/anthropic.go|stale-comments-2

Vorherrschende Sprache
Go
Sterne
0
Forks
1
Ø Merge
8 Std. 14 Min.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/Spackle

Alle Issues in TMHSDigital/Spackle

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.