From b515b371ebf59d3e56f8109ee0bee41a66f7b474 Mon Sep 17 00:00:00 2001 From: Snow Lee Date: Wed, 29 Jul 2026 09:07:23 -0700 Subject: [PATCH] feat(hook): warn agents about stale files at turn start (BEA-34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hub already computes the hot-but-stale judgment and shows it on a Dashboard page nobody has open mid-task, while the agent doing most of the reads gets a plain file and cites it with full confidence. `bdrive sync --hook` now appends a bounded watchlist to the additionalContext it already emits: up to 5 files whose newest journal op is 90+ days old and that sit in a directory where something changed in the last 30 days, ranked by age x churn. Ages come from the journal, never mtimes — a freshly materialized clone has today's mtime on every file and would report the whole project as fresh for exactly the new joiner this helps most. No new hook, no network call, no per-read cost; nothing qualifying means byte-identical output to today's. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 2 +- cmd/bdrive/hooksync.go | 124 ++++++++++++++- cmd/bdrive/hooksync_test.go | 148 ++++++++++++++++++ plugin/skills/beardrive/SKILL.md | 2 +- .../content/docs/guides/agent-artifacts.md | 5 +- web/docs/src/content/docs/reference/cli.md | 2 +- 6 files changed, 271 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7998da9..216efbe 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ hub's own storage, never something a syncing client points at directly: | `bdrive forget ...` | Stop syncing a path *and* remove it from the hub — adds the rule to `.bdriveignore` (which syncs) and prunes in one step. Local files are never touched, here or on teammates' devices | | `bdrive url [path]` | Internal hub link for a file/folder (sign-in + membership required; `--sync` pushes first; no arg = project home). Computed locally | | `bdrive share ` | Public URL for a synced file (`--list`, `--revoke`, `--expires`) | -| `bdrive sync [folder]` | Run one sync cycle now. `--note ` stamps session context (e.g. an agent session id) onto changes — shown in `bdrive log` and hub history; keeps applying to daemon-committed changes until `--note-ttl` (default 30m) expires. `--prune` also removes from the hub what `.bdriveignore` now excludes (files stay on disk everywhere). `--hook