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

Đang mở
#134 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
45/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
0
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/Spackle

Tất cả issue của TMHSDigital/Spackle

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.