pub async fn render_since_last_session_banner(
ctx: &BannerContext,
) -> Option<String>Expand description
Build the “since-last-session” banner for the given context. Returns
None when there is nothing new to show OR when any step in the
pipeline failed — callers should treat both as “emit nothing”.
The pipeline:
- Resolve the project root + repo aliases from
ctx.cwd. - Read the watermark (
prev_ts) —Noneon first session. - Open
data.dband query for rules withinstalled_at > prev_tswhosesource_repomatches one of this repo’s aliases. - Advance the watermark to “now” (best-effort).
- Format the rows into the banner string.
Each step is fenced by tokio::time::timeout against BANNER_BUDGET
so a stuck DB never stalls the agent’s session start.