Skip to content

feat(ctem): auto-queue proof-of-fix re-check on fix_applied - #266

Merged
0xmanhnv merged 1 commit into
developfrom
feat/ctem-tier0-proof-of-fix
Jul 7, 2026
Merged

feat(ctem): auto-queue proof-of-fix re-check on fix_applied#266
0xmanhnv merged 1 commit into
developfrom
feat/ctem-tier0-proof-of-fix

Conversation

@0xmanhnv

@0xmanhnv 0xmanhnv commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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

  • FindingActionsService gains an optional AutoValidator (wired to validation.RunService). BulkFixApplied auto-queues a re-check for each finding that successfully transitions.
    • Bounded: capped at maxAutoValidations=100 per 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 as validations_queued.
    • Best-effort: auto-validation never affects the fix_applied result.
  • RunService.ValidateFinding now rejects non-network-addressable assets (repository / container / cloud) with ErrNotNetworkAddressable, so a reachability probe is only dispatched where it's meaningful. This also hardens the manual POST /findings/{id}/validate path (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.

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.
@0xmanhnv
0xmanhnv merged commit 8c6c84a into develop Jul 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant