feat(ctem): auto-queue proof-of-fix re-check on fix_applied - #266
Merged
Conversation
Close the CTEM Validation loop: when findings transition to fix_applied,
auto-dispatch a safe-check reachability re-check per finding so a 'fix
applied' claim is verified rather than trusted. The existing
command-completion hook maps the agent's result into evidence and
reconciles finding status.
- FindingActionsService gains an optional AutoValidator (wired to
validation.RunService); BulkFixApplied auto-queues re-checks after a
successful transition. Bounded at maxAutoValidations=100 per batch so a
large bulk remediation cannot flood the platform-job queue; the queued
count is reported in the result.
- RunService.ValidateFinding now rejects non-network-addressable assets
(repository/container/cloud) with ErrNotNetworkAddressable, so a safe-check
reachability probe is only dispatched where it is meaningful. This also
hardens the manual POST /findings/{id}/validate path.
- Best-effort: auto-validation never affects the fix_applied result;
expected non-network skips are not logged as failures.
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.
Close the CTEM Validation loop (Tier-0 #3)
When findings transition to fix_applied, auto-dispatch a safe-check reachability re-check per finding, so a "fix applied" claim is verified instead of trusted. The already-wired command-completion hook maps the agent's result into validation evidence and reconciles finding status — this PR supplies the missing trigger.
What changed
FindingActionsServicegains an optionalAutoValidator(wired tovalidation.RunService).BulkFixAppliedauto-queues a re-check for each finding that successfully transitions.maxAutoValidations=100per batch so a large bulk remediation can't flood the platform-job queue; the remainder is left for manual validation. The queued count is returned asvalidations_queued.fix_appliedresult.RunService.ValidateFindingnow rejects non-network-addressable assets (repository / container / cloud) withErrNotNetworkAddressable, so a reachability probe is only dispatched where it's meaningful. This also hardens the manualPOST /findings/{id}/validatepath (previously it would dispatch a meaningless safe-check for a code finding).Why
Per the 2026-07 CTEM maturity assessment, Validation was the weakest phase and its retest trigger was built-but-disconnected. This wires the seam: fix_applied → proof-of-fix → evidence → status.
Tests
run_test.go: non-network asset ⇒ErrNotNetworkAddressable, dispatcher not called.actions_autovalidate_test.go: queues each finding; skips non-network without counting; caps at 100 (no flood); nil-validator no-op.go build,go vet,golangci-lint(new-from develop) all clean.