Skip to content

Commit cdbd168

Browse files
authored
Merge pull request #24224 from dvdksn/fix-nightly-again
ci: force freshness agent to finally move on
2 parents d4ebf95 + 9f09e78 commit cdbd168

File tree

2 files changed

+48
-17
lines changed

2 files changed

+48
-17
lines changed

.github/agents/docs-scanner.yaml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,42 @@ agents:
2121
2222
## Setup
2323
24-
1. Call `get_memories` to get the list of already-scanned paths.
25-
Each entry has the form `scanned: <path> YYYY-MM-DD`.
26-
2. Use `list_directory` to explore `content/manuals/` and find a leaf
27-
directory (no subdirectories) whose path does NOT appear in memory.
28-
Skip: content/reference/, content/languages/, content/tags/,
29-
content/includes/. If all leaves have been scanned, pick the one
30-
with the oldest date.
31-
3. Call `directory_tree` on that leaf and read all its files
32-
4. File issues for what you find (max 3 per run)
33-
5. Call `add_memory` with `scanned: <path> YYYY-MM-DD`
24+
1. Read `.cache/scan-history.json` using `read_file`.
25+
This file tracks every previously scanned directory as a JSON object:
26+
```json
27+
{
28+
"scanned": {
29+
"content/manuals/desktop/networking/": "2026-02-24",
30+
"content/manuals/build/cache/": "2026-02-23"
31+
}
32+
}
33+
```
34+
If the file does not exist or is empty, treat it as `{"scanned": {}}`.
35+
36+
2. Call `get_memories` to load any learned patterns from previous scans
37+
(false positives to skip, codebase context, human feedback).
38+
39+
3. Use `list_directory` to explore `content/manuals/` and find all leaf
40+
directories (no subdirectories). Skip these top-level paths entirely:
41+
content/reference/, content/languages/, content/tags/,
42+
content/includes/.
43+
44+
4. Pick a leaf directory to scan:
45+
- FIRST CHOICE: a directory that does NOT appear in scan-history.json
46+
- FALLBACK: if every leaf directory has been scanned, pick the one
47+
with the OLDEST date in scan-history.json
48+
49+
5. Call `directory_tree` on the selected leaf and read all its files.
50+
51+
6. Analyze and file issues for what you find (max 3 per run).
52+
53+
7. After scanning, update `.cache/scan-history.json` using `write_file`.
54+
Read the current content, add or update the scanned path with today's
55+
date (YYYY-MM-DD), and write the full updated JSON back.
56+
57+
8. If you learn anything useful for future scans (false positive patterns,
58+
codebase context), call `add_memory` to store it. Do NOT use
59+
`add_memory` for scan tracking — that is what scan-history.json is for.
3460
3561
## What good issues look like
3662
@@ -107,6 +133,7 @@ agents:
107133
tools:
108134
- read_file
109135
- read_multiple_files
136+
- write_file
110137
- list_directory
111138
- directory_tree
112139
- type: memory

.github/workflows/nightly-docs-scan.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ jobs:
3535
- name: Ensure cache directory exists
3636
run: mkdir -p "${{ github.workspace }}/.cache"
3737

38-
- name: Restore scanner memory
38+
- name: Restore scanner state
3939
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
4040
with:
41-
path: ${{ github.workspace }}/.cache/scanner-memory.db
42-
key: docs-scanner-memory-${{ github.repository }}-${{ github.run_id }}
41+
path: |
42+
${{ github.workspace }}/.cache/scanner-memory.db
43+
${{ github.workspace }}/.cache/scan-history.json
44+
key: docs-scanner-state-${{ github.repository }}-${{ github.run_id }}
4345
restore-keys: |
44-
docs-scanner-memory-${{ github.repository }}-
46+
docs-scanner-state-${{ github.repository }}-
4547
4648
- name: Generate GitHub App token
4749
if: env.HAS_APP_SECRETS == 'true'
@@ -63,9 +65,11 @@ jobs:
6365
github-token: ${{ steps.app-token.outputs.token || github.token }}
6466
timeout: 1200
6567

66-
- name: Save scanner memory
68+
- name: Save scanner state
6769
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6870
if: always()
6971
with:
70-
path: ${{ github.workspace }}/.cache/scanner-memory.db
71-
key: docs-scanner-memory-${{ github.repository }}-${{ github.run_id }}
72+
path: |
73+
${{ github.workspace }}/.cache/scanner-memory.db
74+
${{ github.workspace }}/.cache/scan-history.json
75+
key: docs-scanner-state-${{ github.repository }}-${{ github.run_id }}

0 commit comments

Comments
 (0)