[daily-security-observability] Restore and persist 7-day cache snapshot with stale-age gating#40881
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix cache miss in Daily Security Observability Report
[daily-security-observability] Restore and persist 7-day cache snapshot with stale-age gating
Jun 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Daily Security Observability workflow to reuse a cached 7‑day DIFC integrity-filtered log snapshot across runs, apply a staleness gate (7 days), merge cached + fresh results deterministically, and write the updated snapshot back each run. It also updates Phase 3 guidance to reflect the new warm-start semantics.
Changes:
- Added warm-start restore from a cached snapshot file and a 7‑day
updated_atTTL gate. - Downloaded fresh logs to a separate file, merged cached+fresh
runsbyrun_id(fresh wins), and always persisted a merged snapshot back to cache-memory. - Updated Phase 3 instructions to describe warm-start validation and stale-cache behavior.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/daily-security-observability.md | Adds warm-start/merge/persist logic for DIFC integrity-filtered logs and updates Phase 3 instructions accordingly. |
| .github/workflows/daily-security-observability.lock.yml | Regenerates the compiled workflow to include the updated run script. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
Comment on lines
+40
to
+44
| mkdir -p /tmp/gh-aw/cache-memory/security-observability | ||
|
|
||
| CACHE_FILE=/tmp/gh-aw/cache-memory/security-observability/filtered-logs.snapshot.json | ||
| RUN_FILE=/tmp/gh-aw/agent/integrity/filtered-logs.json | ||
| FRESH_LOGS=/tmp/gh-aw/agent/integrity/filtered-logs.fresh.json |
| || echo 0 | ||
| ) | ||
| cache_age_seconds=$((NOW_EPOCH - cache_updated_epoch)) | ||
| if [ "$cache_updated_epoch" -gt 0 ] && [ "$cache_age_seconds" -le "$MAX_CACHE_AGE_SECONDS" ]; then |
| MAX_CACHE_AGE_SECONDS=$((7 * 24 * 60 * 60)) | ||
|
|
||
| # Warm start from cached 7-day snapshot when available and fresh. | ||
| if [ -f "$CACHE_FILE" ] && jq -e '.runs and .updated_at' "$CACHE_FILE" > /dev/null 2>&1; then |
Comment on lines
+95
to
+96
| ' "$RUN_FILE" "$FRESH_LOGS" > "$RUN_FILE.merged" | ||
| mv "$RUN_FILE.merged" "$RUN_FILE" |
This was referenced Jun 22, 2026
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.
The Daily Security Observability workflow declared shared cache-memory but did not reliably reuse prior 7-day DIFC state, causing cold recomputation despite available history. This change adds an explicit warm-start + staleness gate and ensures the updated snapshot is written back on every run.
Cache warm-start (startup restore)
/tmp/gh-aw/cache-memory/security-observability/filtered-logs.snapshot.json.runsinto/tmp/gh-aw/agent/integrity/filtered-logs.jsonwhen cache metadata is present and valid.Explicit stale-data detection
updated_atwith a 7-day TTL.Fresh + cached state merge
--filtered-integritylogs into a separate file.runs, deduping byrun_idwith deterministic precedence.Always persist updated snapshot
updated_atrunssummary.total_runsWorkflow guidance alignment