Findings enter the ledger from two writers kept consistent by a side map

オープン
#134 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

Start with recordFindings in internal/engine/run.go (around lines 341-383) and the runner.recorded field at lines 46-49, then read the early append in internal/engine/agentic.go near lines 432-444. Done means one method owns every write of a finding to the ledger, a table test in internal/engine covers the cap when more findings are already recorded than the limit, and the existing max_findings and interrupt tests still pass under go test ./internal/engine.

索引モデルが issue の本文から書いたものです。

説明

severity: low tech-debt

Summary

recordFindings is documented as "the one place a finding of a code scan or a running-target scan enters the ledger". Since the max_findings and interrupt fixes, investigateOne also appends each finished finding immediately, and a runner.recorded side map tells the cap which findings it must keep. The cap assumes the kept set fits the limit, and nothing enforces that.

Where

  • internal/engine/run.go:341-383 (recordFindings, the doc comment, and "The investigations are planned within the cap, so kept fits")
  • internal/engine/run.go:46-49 (runner.recorded)
  • internal/engine/agentic.go:432-444 (the early append)

Impact

Every rule about which findings reach the ledger (cap, validation, dedup) has to be reasoned about across two writers and a shared map. The two writers already validate differently: the early path skips an invalid finding silently, and the final path writes a reject. If planning ever stops respecting max_findings (a planner change, or resume carrying more findings), the report silently exceeds the limit.

Suggested fix

  1. Correct the doc comment at run.go:341-348 to describe both writers.
  2. Move the early append into a runner.persist(seq, f) method that owns recorded, and call it from investigateOne.
  3. Take the cap decision from a pure capFindings(findings, recorded, limit) (kept, dropped) with a table test that covers len(recorded) > limit. Clamp, or add a note, when the assumption breaks.
  4. Give both writers the same validation outcome.

Acceptance criteria

  • One method owns writes of findings to the ledger.
  • A table test covers the cap with more already-recorded findings than the limit.
  • The existing max_findings and interrupt tests still pass.

Getting started

  • Relevant files: internal/engine/run.go, internal/engine/agentic.go
  • How to run tests: go test ./internal/engine

Related: #113


Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: tech-debt|internal/engine/run.go|recordFindings

主要言語
Go
スター
0
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Spackle のほかの issue

TMHSDigital/Spackle の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。