feat(app): background collection frame for sites, search words and RSS feeds

Targets (none by default), interval and keep days on a new 백그라운드 수집 screen with the
results; the worker collects on its own thread through the web search's address check and
writes only to the data folder's collect/ (logs carry target names and counts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-13 21:29:49 +09:00
parent d531eb0ffc
commit b94e9dc112
15 changed files with 861 additions and 14 deletions

View File

@@ -317,6 +317,29 @@ which carry Discord's own time.
`budget_tokens` (4000).
- Logs carry IDs, counts and timings only, never record, question or answer text.
### Background collection (M6)
With `JARVIS_COLLECT_PATH` set, the worker collects on its own thread, apart from the voice and the
brain (`app/src/admin.spec.md`, "Background collection"). The file is
`{"dir": "<data>/collect", "keepDays": 30, "targets": [{"name", "kind", "value", "everyMinutes"}]}`;
the app writes only enabled targets. Nothing is collected without targets.
- A target runs when `everyMinutes` passed since its last run (also across restarts; the last run is
kept in `<dir>/<name>/state.json`), one target at a time, checked every 30 s. A failed run counts
as a run, so a broken site is tried again only at its next interval.
- Kinds: `site` keeps the page's title and text (at most 20,000 characters) when it differs from the
last kept one; `rss` (RSS or Atom) keeps each new item (title, link, time, summary of at most 2,000
characters, new by its id or link); `search` keeps each new web search result (title and link) for
the words, from DuckDuckGo's lite page, which needs no key (its bot challenge is a failed run, not "no results").
- Every request goes through the web search's address check (`web_search.spec.md`): only public
http(s) addresses, every redirect checked again, at most 1 MB, 15 s. The collected text is web
content: it goes only to `<dir>/<name>/<YYYY-MM-DD>.jsonl` (one JSON object per line: `at`, then
`title`, `url`, `text` as the kind has them), never to the brain or a log.
- Day files older than `keepDays` are deleted in every folder of `dir` at each check, also of
targets no longer listed.
- Each run is a `notice` line (category `voice_worker`): the target's name and how many new items, or
a `Warning` with the error's type. Never a URL, words or collected text.
### Errors
`{"type": "error", "code": "...", "message": "...", "id": "..."}`. Codes: `bad_message` (unknown type,