Skip to content

feat(watch): auto-ingest watcher for folders and AI transcripts (Phase 1) - #48

Draft
therahul-yo wants to merge 1 commit into
mainfrom
claude/watch-daemon
Draft

feat(watch): auto-ingest watcher for folders and AI transcripts (Phase 1)#48
therahul-yo wants to merge 1 commit into
mainfrom
claude/watch-daemon

Conversation

@therahul-yo

Copy link
Copy Markdown
Owner

Implements REVAMP_PLAN Phase 1 (see #47): the palace now keeps itself current.

What's new

superton watch add ~/notes     # manage the watchlist
superton watch                 # poll every 30s (Ctrl+C to stop)
superton watch --once          # single pass — cron-friendly
superton watch list            # see what's being watched
  • superton/watcher.py — polling scanner using mtime + size signatures, persisted to <home>/watch_state.json so restarts stay quiet. Watchlist lives in <home>/watchlist (one path per line, # comments).
  • Two source kinds: the user watchlist, plus the AI transcript roots the importers already understand (~/.claude/projects, ~/.cursor, ~/.amp) — every Claude Code / Cursor / Amp session lands in the palace as it happens. --no-transcripts scopes to the watchlist only.
  • Changed transcript sessions are re-imported with replace — the importers skip already-indexed sources, so appended turns would otherwise never land. This is the detail that makes "always current" true for long-running sessions.
  • Deliberate semantics: new files ingest; changed files refresh (stale chunks dropped first, so edits don't pile up near-duplicates); deleted files keep their drawers — the palace is memory, not a mirror.

Design notes

  • Polling instead of native FS events: zero new dependencies, identical behavior on macOS/Linux/CI, and --once is trivially cron-able and testable. Native events (watchfiles) can slot in later behind the same scan_once() seam, as can watch install for launchd/systemd.
  • First scan of an already-ingested corpus is a cheap all-dedup pass thanks to content-addressed drawer ids.
  • Unsupported file types (images, binaries) are skipped quietly — routine in any watched folder.

Validation

  • 14 new tests in tests/test_watcher.py: watchlist round trips, refresh-without-duplicates, deletion-keeps-drawers, state persistence across restarts, transcript append pickup, CLI passes — 275 passing total, ruff + mypy clean.
  • Smoke-tested end-to-end: add → --once ingests → second --once reports "palace already current".

🤖 Generated with Claude Code

https://claude.ai/code/session_0145446GXbqRfpA4NF5Tn89E


Generated by Claude Code

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
superton Ready Ready Preview, Comment Jul 6, 2026 5:47pm

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f30041fe-3964-4508-b83d-e189447a5adc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

REVAMP_PLAN Phase 1: `superton watch` keeps the palace current without
manual adds.

- New superton/watcher.py: polling scanner (mtime + size signatures),
  JSON state in <home>/watch_state.json, watchlist file managed via
  `superton watch add|remove|list`.
- Watches the user watchlist plus AI transcript roots the importers
  already understand (~/.claude/projects, ~/.cursor, ~/.amp); changed
  sessions are re-imported with replace so appended turns land.
- Semantics: new files ingest, changed files refresh (stale chunks
  dropped first), deleted files KEEP their drawers — the palace is
  memory, not a mirror.
- `superton watch --once` runs one cron-friendly pass; `--interval`
  tunes the polling loop; `--no-transcripts` scopes to the watchlist.
- 14 new tests: watchlist round trips, refresh-without-duplicates,
  deletion-keeps-drawers, state persistence across restarts, transcript
  append pickup, CLI passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0145446GXbqRfpA4NF5Tn89E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants