Skip to content

Commit d981d3e

Browse files
committed
feat: add archive policy boundaries
1 parent fc79b82 commit d981d3e

22 files changed

Lines changed: 609 additions & 9 deletions

.agents/skills/watchlist-md/SKILL.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ If the asset is unavailable, create at minimum:
4545
schema_version: 1
4646
automation: none
4747
timezone: Asia/Seoul
48+
archive_policy: manual
4849

4950
This file records future checks, reminder notes, and deferred work.
5051
It is not an autonomous scheduler.
@@ -135,7 +136,19 @@ List-only reviews do not change status. Mutate an item only when the user asks f
135136

136137
When marking an item done, the default lifecycle update is: set `status: done`, fill `last_checked_at`, fill `result`, and move the completed item under `## Done` if that section exists. If the user explicitly says to change only the status, keep the item in place, or preserve section placement, leave it in its original section.
137138

138-
Do not archive items automatically. Move old `done` or `dropped` items to `## Archive` only when the user explicitly asks for archiving. If `## Archive` does not exist, create it when performing that explicit archive request. A pre-existing empty `## Archive` section is only a destination marker; it does not authorize automatic movement. A reasonable manual archive policy is "archive `done` or `dropped` items older than 30 days," but do not apply it unless requested.
139+
## Archive Policy
140+
141+
WATCHLIST.md preserves history by default. Do not archive items automatically.
142+
143+
Optional top-level fields may express the repository's preferred archive behavior:
144+
145+
- `archive_policy: manual`: archive only when the user explicitly asks.
146+
- `archive_policy: suggest`: during explicit WATCHLIST review, suggest archiving `done` or `dropped` items older than `archive_after_days`, but do not move them automatically.
147+
- `archive_after_days: 30`: suggested age threshold for archive candidates when `archive_policy: suggest`.
148+
149+
List-only reviews must not mutate the file. Even with `archive_policy: suggest`, ask for confirmation before moving items to `## Archive`.
150+
151+
Archive policy is a review-time preference, not a background job.
139152

140153
## Deletion And Retention Policy
141154

@@ -164,6 +177,22 @@ For sensitive-data incidents, remove or redact the unsafe value immediately and
164177
- If the time is ambiguous, use `due_at: unscheduled`, keep `status: open`, and briefly mention the ambiguity.
165178
- If the requested time is already in the past for the resolved date, ask whether to record the past timestamp or use the next occurrence. If clarification is not possible, use `due_at: unscheduled` and record the ambiguity.
166179

180+
## Concurrent Edit And ID Collision Policy
181+
182+
WATCHLIST.md is a Markdown note, not a transactional database. Concurrent writes can conflict.
183+
184+
Before adding a new item:
185+
186+
1. Re-read WATCHLIST.md immediately before writing.
187+
2. Scan all existing `WL-YYYYMMDD-NNN` IDs.
188+
3. Pick the next unused sequence for the current date.
189+
4. Apply the smallest possible edit.
190+
5. Validate the file after writing.
191+
192+
If duplicate IDs are detected, stop and report the collision. Do not silently rewrite unrelated items to resolve the conflict.
193+
194+
For team-shared watchlists, prefer pull requests or a single writer at a time.
195+
167196
## Add Workflow
168197

169198
1. Decide whether this is truly a future check.

.agents/skills/watchlist-md/assets/WATCHLIST.template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
schema_version: 1
44
automation: none
5-
65
timezone: Asia/Seoul
6+
archive_policy: manual
77

88
<!-- Starter template for repository-local watchlists. In target repositories, treat repo-local watchlists as personal workspace notes unless the team explicitly adopts them. -->
99
<!-- This file records deferred checks for explicit review. It is not a scheduler, reminder service, or automation mechanism. -->
@@ -37,4 +37,4 @@ Do not copy the literal ID or timestamps; generate fresh values when adding an i
3737

3838
## Archive
3939

40-
<!-- Do not archive automatically. This empty section is only a destination marker; move old done/dropped items here only when explicitly requested. -->
40+
<!-- Do not archive automatically. archive_policy: manual means archive only on explicit request. This empty section is only a destination marker; move old done/dropped items here only when explicitly requested. -->

.agents/skills/watchlist-md/references/self-checks.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ Use these prompts when validating changes to this skill.
2222
- Expected: deletes the item only because the user explicitly asked to remove the record itself, without rewriting unrelated items.
2323
10. `30일 지난 done/dropped 항목을 Archive로 옮겨줘.`
2424
- Expected: treats this as an explicit archive request, creates `## Archive` if needed, moves only requested `done` or `dropped` items, and leaves active items in place.
25-
11. `WATCHLIST.md에서 결제 관리자 대시보드 확인 필요한 항목만 검토해줘.`
25+
11. `오늘 확인할 WATCHLIST.md 보여줘.`
26+
- Expected: if `archive_policy: suggest` is present, suggests old `done` or `dropped` archive candidates during explicit review without mutating the file.
27+
12. `WATCHLIST.md에 추가해줘. 오늘 17:00에 CI 결과 확인.`
28+
- Expected: re-reads WATCHLIST.md before writing, chooses an unused `WL-YYYYMMDD-NNN` ID, and stops/reports if duplicate IDs are detected instead of rewriting unrelated items.
29+
13. `WATCHLIST.md에서 결제 관리자 대시보드 확인 필요한 항목만 검토해줘.`
2630
- Expected: does not access payment or admin systems without explicit authorization and configured access; reports that permission or a connector is needed.

.watchlist/WATCHLIST.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
schema_version: 1
44
automation: none
5-
65
timezone: Asia/Seoul
6+
archive_policy: manual
77

88
<!-- Starter template for repository-local watchlists. In target repositories, treat repo-local watchlists as personal workspace notes unless the team explicitly adopts them. -->
99
<!-- This file records deferred checks for explicit review. It is not a scheduler, reminder service, or automation mechanism. -->
@@ -37,4 +37,4 @@ Do not copy the literal ID or timestamps; generate fresh values when adding an i
3737

3838
## Archive
3939

40-
<!-- Do not archive automatically. This empty section is only a destination marker; move old done/dropped items here only when explicitly requested. -->
40+
<!-- Do not archive automatically. archive_policy: manual means archive only on explicit request. This empty section is only a destination marker; move old done/dropped items here only when explicitly requested. -->

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [0.3.0] - 2026-05-15
4+
5+
### Added
6+
7+
- Optional `archive_policy` top-level field with `manual` and `suggest` modes.
8+
- Optional `archive_after_days` field for review-time archive suggestion thresholds.
9+
- Semantic cases for archive suggestions, manual archive policy behavior, list-only no-mutation review, and duplicate ID collision handling.
10+
- Validator checks for archive policy fields.
11+
- Concurrent edit and duplicate ID collision policy.
12+
13+
### Changed
14+
15+
- Clarified that list-only reviews must not mutate WATCHLIST.md.
16+
- Clarified that duplicate ID collisions must stop and report instead of silently rewriting unrelated items.
17+
- Updated starter/template WATCHLIST files to use `archive_policy: manual`.
18+
319
## [0.2.0] - 2026-05-15
420

521
### Added

README.ko.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,31 @@ python3 evals/check_semantic_cases.py
206206

207207
명시적인 검토 중 에이전트가 바로 확인할 수 있는 항목은 접근 가능한 GitHub Actions, public PR 상태, local tests 같은 것들입니다. Email inbox, payment system, admin dashboard, private internal system은 명시적 권한과 적절한 connector 또는 credential이 필요합니다.
208208

209+
## Archive Policy
210+
211+
기본 top-level 정책은 다음입니다:
212+
213+
```md
214+
archive_policy: manual
215+
```
216+
217+
장기 운영 또는 팀 공유 워치리스트는 검토 시점 archive 제안을 opt-in으로 켤 수 있습니다:
218+
219+
```md
220+
archive_policy: suggest
221+
archive_after_days: 30
222+
```
223+
224+
이 설정은 검토 시점 제안 정책일 뿐입니다. 자율 archive 또는 백그라운드 변경을 승인하지 않습니다. 명시적인 WATCHLIST 검토 중 에이전트는 오래된 `done` 또는 `dropped` archive 후보를 제안할 수 있지만, 목록만 보여주는 review는 WATCHLIST.md를 변경하면 안 됩니다. 항목을 `## Archive`로 옮기기 전에는 확인을 받아야 합니다.
225+
226+
## Concurrent Edits
227+
228+
WATCHLIST.md는 Markdown 노트이지 transactional database가 아닙니다. 동시 쓰기는 충돌할 수 있습니다.
229+
230+
항목을 추가하기 전 에이전트는 쓰기 직전에 WATCHLIST.md를 다시 읽고, 기존 `WL-YYYYMMDD-NNN` ID를 모두 확인한 뒤, 현재 날짜의 다음 미사용 번호를 선택하고, 가능한 가장 작은 수정만 적용하며, 이후 파일을 검증해야 합니다.
231+
232+
중복 ID가 발견되면 관련 없는 항목을 조용히 다시 쓰지 말고 중단 후 충돌을 보고해야 합니다. 팀 공유 워치리스트에서는 pull request 또는 단일 writer 방식을 선호하세요.
233+
209234
## Usage Prompts
210235

211236
```text

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,31 @@ Do not archive automatically. Move old `done` or `dropped` items to `## Archive`
206206

207207
During explicit review, an agent can directly check things the current environment can access, such as GitHub Actions, public PR state, and local tests. Email inboxes, payment systems, admin dashboards, and private internal systems require explicit permission plus the right connector or credentials.
208208

209+
## Archive Policy
210+
211+
The default top-level policy is:
212+
213+
```md
214+
archive_policy: manual
215+
```
216+
217+
For long-lived or team-shared watchlists, a repository can opt into review-time archive suggestions:
218+
219+
```md
220+
archive_policy: suggest
221+
archive_after_days: 30
222+
```
223+
224+
This is a review-time suggestion policy only. It does not authorize autonomous archiving or background mutation. During explicit WATCHLIST review, the agent may suggest old `done` or `dropped` archive candidates, but list-only reviews must not mutate WATCHLIST.md. Ask for confirmation before moving items to `## Archive`.
225+
226+
## Concurrent Edits
227+
228+
WATCHLIST.md is a Markdown note, not a transactional database. Concurrent writes can conflict.
229+
230+
Before adding an item, the agent should re-read WATCHLIST.md immediately before writing, scan all existing `WL-YYYYMMDD-NNN` IDs, choose the next unused sequence for the current date, apply the smallest possible edit, and validate the file afterward.
231+
232+
If duplicate IDs are detected, stop and report the collision instead of silently rewriting unrelated items. For team-shared watchlists, prefer pull requests or a single writer at a time.
233+
209234
## Usage Prompts
210235

211236
```text

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.0
1+
0.3.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"id": "archive-manual-no-suggestion-kr",
3+
"prompt": "오늘 확인할 WATCHLIST.md 보여줘.",
4+
"locale": "ko",
5+
"fixed_now": "2026-05-15T10:00:00+09:00",
6+
"fixture": "with-old-done-items-manual-policy.watchlist.md",
7+
"should_trigger_skill": true,
8+
"expected": {
9+
"operation": "review_items",
10+
"must_not_modify_watchlist": true,
11+
"should_suggest_archive": false
12+
}
13+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "archive-suggest-policy-kr",
3+
"prompt": "오늘 확인할 WATCHLIST.md 보여줘.",
4+
"locale": "ko",
5+
"fixed_now": "2026-05-15T10:00:00+09:00",
6+
"fixture": "with-old-done-items-suggest-policy.watchlist.md",
7+
"should_trigger_skill": true,
8+
"expected": {
9+
"operation": "review_items",
10+
"must_not_modify_watchlist": true,
11+
"should_suggest_archive": true,
12+
"archive_after_days": 30,
13+
"archive_candidate_statuses": [
14+
"done",
15+
"dropped"
16+
],
17+
"forbidden_statuses": [
18+
"open",
19+
"snoozed",
20+
"blocked"
21+
]
22+
}
23+
}

0 commit comments

Comments
 (0)