docs: add stateful scanning (repo-memory baseline diff) pattern to memory.md#24687
docs: add stateful scanning (repo-memory baseline diff) pattern to memory.md#24687
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a5280f76-bfa0-4587-8c43-c7e6828e532a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot optimize update for an agent that needs to generate agentic workflows |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/2d997c9a-a1a8-4b8e-ad5e-25c1bad8f08a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Restructured the section in
|
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/5b2de2e8-dd5b-4b91-8929-0d836e36675b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in Path bug: the compiler assigns Clutter removed:
|
|
Hey One thing to address before this is ready for review:
Also noting the PR is still Draft — once the diff is cleaned up, marking it ready for review will help maintainers pick it up. If you'd like a hand, you can assign this prompt to your coding agent:
|
There was a problem hiding this comment.
Pull request overview
Adds documentation for a “stateful scanning” workflow pattern where a scheduled run loads a persisted baseline, runs a scan, diffs results, alerts only on new findings, then writes the updated baseline back for the next run.
Changes:
- Extends
.github/aw/memory.mdwith a new “Stateful Scanning Pattern (repo-memory)” section and updates the page description. - Re-formats (re-serializes)
pkg/agentdrain/data/default_weights.jsoncontent (no apparent semantic change from the diff).
Show a summary per file
| File | Description |
|---|---|
.github/aw/memory.md |
Documents a repo-memory baseline/diff approach for “alert only on new findings” scheduled scans. |
pkg/agentdrain/data/default_weights.json |
Formatting-only change to embedded default weights JSON. |
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
| "id": 5, | ||
| "size": 1, | ||
| "stage": "error", | ||
| "template": [ | ||
| "stage=error", | ||
| "reason=The", | ||
| "Serena", | ||
| "MCP", | ||
| "server", | ||
| "is", | ||
| "not", | ||
| "available", | ||
| "in", | ||
| "this", | ||
| "environment.", | ||
| "No", | ||
| "serena-*", | ||
| "tools", | ||
| "are", | ||
| "registered.", | ||
| "tool=Serena", | ||
| "MCP", | ||
| "server", | ||
| "type=missing_tool" | ||
| ] | ||
| "template": ["stage=error", "reason=The", "Serena", "MCP", "server", "is", "not", "available", "in", "this", "environment.", "No", "serena-*", "tools", "are", "registered.", "tool=Serena", "MCP", "server", "type=missing_tool"] | ||
| }, |
There was a problem hiding this comment.
The PR description focuses on documentation changes, but this file is also modified (looks like a re-serialization/formatting change to the embedded default weights). If this change is intentional, please call it out explicitly in the PR description; if not, consider reverting it or moving it to a separate PR to keep the docs change isolated.
| ## Stateful Scanning Pattern (repo-memory) | ||
|
|
||
| Use `repo-memory` to persist a baseline JSON file between scheduled runs so that the workflow only alerts on *new* findings — vulnerability scans, dependency audits, licence checks, or any "track changes over time" scenario. | ||
|
|
||
| ### Example Workflow | ||
|
|
There was a problem hiding this comment.
The PR description mentions an ASCII lifecycle diagram and a recommended-caps table in this new section, but they are not present in the added content. Either add those elements or adjust the PR description so it matches what was actually introduced.
| timeout-minutes: 20 | ||
| --- | ||
|
|
||
| Load `/tmp/gh-aw/repo-memory/default/vuln-baseline.json`. |
There was a problem hiding this comment.
The example uses /tmp/gh-aw/repo-memory/default/... but the earlier repo-memory section describes the directory generically as /tmp/gh-aw/repo-memory/. Consider adding a brief note here clarifying that the directory is /tmp/gh-aw/repo-memory/{id}/ and that the default id is default, so readers don’t assume the file should be written directly under /tmp/gh-aw/repo-memory/.
| Load `/tmp/gh-aw/repo-memory/default/vuln-baseline.json`. | |
| Load `/tmp/gh-aw/repo-memory/default/vuln-baseline.json`. | |
| `repo-memory` files live under `/tmp/gh-aw/repo-memory/{id}/`; if you do not configure an id, the default id is `default`. |
|
|
||
| ### Key Design Decisions | ||
|
|
||
| - **`repo-memory` for baselines, not `cache-memory`** — caches expire after 7 days; a lost baseline makes every known finding appear "new" on the next run, flooding the repo with duplicate issues |
There was a problem hiding this comment.
This bullet states cache-memory baselines are lost after 7 days, but cache retention is configurable (up to the documented max). To avoid misleading guidance, please rephrase to "default 7 days (configurable up to 90)" and clarify that repo-memory is needed when you require persistence beyond the cache retention window.
| - **`repo-memory` for baselines, not `cache-memory`** — caches expire after 7 days; a lost baseline makes every known finding appear "new" on the next run, flooding the repo with duplicate issues | |
| - **`repo-memory` for baselines when you need persistence beyond cache retention** — `cache-memory` retention is 7 days by default (configurable up to 90); if the cache baseline expires, every known finding can appear "new" on the next run, flooding the repo with duplicate issues |
Adds a documented, copy-paste-ready "Stateful Scanning Pattern" to
.github/aw/memory.mdfor the common "alert only on new findings" use case — nightly vuln scans, licence audits, secret scanning, etc.Changes
repo-memoryovercache-memory(baselines must outlive the 7-day cache TTL)[], written at end of run so run N+1 has a clean baseline with no duplicate issuesnpm audit --jsonas the scan step, withengine: claude,repo-memory, restricted network, andsafe-outputsmax:flood guard oncreate-issuewith a recommended-caps table by scenarioExample frontmatter