Repository navigation
Expose paginated finding evidence for agent-assisted remediation - #12
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Assessment findings currently discard the scan's evidence, so an agent can read general remediation guidance without seeing the observed settings, affected files, or referenced code locations that would help it target a fix.
Add
include_evidencetoget_assessment_findings, scoped bycheck_ids. Responses include evidence rows, field definitions, and available code-location data alongside full developer recommendations. Evidence defaults to 20 rows per finding, supportsevidence_offset/evidence_limit(maximum 100), and reports totals and continuation metadata. Only locations referenced by the returned page are fetched. Missing location data is reported explicitly.For example, a high-severity insecure-network finding can now expose the observed
base-configcleartext setting and separate domain exceptions, giving an agent specific configuration to inspect. The workflow guidance explains how to retrieve evidence and check the same finding against an explicitly selected new scan. The MCP tools remain read-only; source changes and new scans use the agent's other capabilities.The README keeps user-facing examples under Platform prompts. Evidence integration details and live-audit instructions live in
docs/evidence.md, linked from Development.The findings response also preserves large numeric evidence values on the wire. The SDK's typed-output validation currently rounds such values through
float64; a narrow findings registration helper validates a disposable copy and serializes the original JSON. Input validation, output schemas, logging, and compact default tables are retained. The existingjsonschema-godependency becomes direct without a version change.Validation:
go test -race ./...,go vet ./..., andgo build ./....The live audit is disabled in normal test runs, reads credentials only from the process environment, and reports aggregate measurements without app identities or raw evidence. Tokens and live captures are excluded from this commit. This validates evidence retrieval and response sizes; a full coding-agent patch/test/rescan workflow has not been evaluated.
Self-review