From 43accc722e033d2e5a33dd6dbc2bcd5aba6ede6c Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 12 Jul 2026 20:26:19 +0100 Subject: [PATCH] Project RG06 resource staleness fully --- internal/api/patrol_autonomy_colima_real_lab_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/api/patrol_autonomy_colima_real_lab_test.go b/internal/api/patrol_autonomy_colima_real_lab_test.go index 7b0af93b40..5e3898b04d 100644 --- a/internal/api/patrol_autonomy_colima_real_lab_test.go +++ b/internal/api/patrol_autonomy_colima_real_lab_test.go @@ -252,12 +252,17 @@ reportReady: return rg06SubmitBarrier(context.Background(), broker, rg06BarrierProposalFor(runID, "downgrade", resource.ID, findingID, investigationID)) }, server, containerID), rg06BarrierMeasured(t, "stale_resource", "policy_authorization_revoked", persistence, store, patrol, investigations, resource, func() error { - resourceProvider.freshness = time.Now().UTC().Add(-2 * time.Hour) - resourceProvider.resources[0].SourceStatus[unified.SourceAgent] = unified.SourceStatus{Status: "stale", LastSeen: time.Now().UTC().Add(-2 * time.Hour)} + staleAt := time.Now().UTC().Add(-2 * time.Hour) + resourceProvider.freshness = staleAt + resourceProvider.resources[0].LastSeen = staleAt + resourceProvider.resources[0].UpdatedAt = staleAt + resourceProvider.resources[0].SourceStatus[unified.SourceAgent] = unified.SourceStatus{Status: "stale", LastSeen: staleAt} resources.invalidateCache(orgID) return nil }, func() {}, func() { resourceProvider.freshness = reportAt + resourceProvider.resources[0].LastSeen = reportAt + resourceProvider.resources[0].UpdatedAt = reportAt resourceProvider.resources[0].SourceStatus[unified.SourceAgent] = unified.SourceStatus{Status: "online", LastSeen: reportAt} resources.invalidateCache(orgID) }, func(findingID, investigationID string) (aicontracts.ActionDisposition, error) {