← Back to Pull requests

Report board changes as events at /api/events #61

Closed
unknown closed this pull request without merging on Nov 22, 2026 19:05 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 16:39 UTC
Author

Lets a service react to the board as it changes, without reading the whole board over and over. One example is starting an agent as soon as a task lands in todo. Today /api/changes only says that something changed, so a service has to reload /api/board and diff it. This adds what changed, through a small long-poll endpoint.

If you'd rather agree on the approach first, I'm happy to open an issue and continue there.

What it adds

  • Migration 10 adds an events table, filled by SQLite triggers in the same transaction as the change. No change is lost, and older versions that open the board still write events through the triggers. COMPATIBLE_FROM is unchanged.

  • Kinds: task.created, task.moved (from/to), task.updated, task.deleted, comment.added (author).

  • One event per edit: an edit that changes the column is task.moved, whatever else it changes; any other edit is task.updated. update_task and update_tasks now write fields and status in one statement for this. Reordering within a column is no event.

  • Deleting a project reports each of its tasks with the project's slug.

  • Retention: the last 10,000 events are kept.

  • GET /api/events returns a cursor to start from (last). GET /api/events?since=<cursor>&wait=<s>&project=<slug> waits up to 25 seconds, answers as soon as an event arrives and returns at most 500 events.

  • Cursors are <id>.<nonce>. A cursor that names no event of this board gives "reset": true with the newest cursor. That happens when the event was dropped, or when the board is behind or a diverged copy, as after kanzo sync.

  • Shutdown: a waiting request answers at once, so it doesn't hold shutdown up.

  • Docs: a new section "React to changes" in README.md and README.zh.md.
  • Cost

  • Agents: no MCP tool or reply changes, so no extra tokens.

  • Writes: each write inserts one row more. A bulk update of 5,000 tasks took about 0.8 s in a debug build, and deleting a project with 5,000 tasks about 60 ms.

  • Waiting readers: each does one indexed read every 500 ms, and only while it waits.

  • Dependencies: none new.
  • cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings and cargo test --locked pass (86 tests; new store and HTTP tests for every point above)

  • A board change was tried in a browser, in light and dark mode: not applicable, the board UI is unchanged

  • The README says what changed for users
  • Known limits

  • A reader filtered on a project doesn't see a task that moves to another project.

  • Deleting a blocker together with the task waiting on it can report a task.updated for the waiting task just before its task.deleted.
  • Diff: 340 lines (+255 / -85) across 4 files Reviewer: emanuele-em Review duration: 13106m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 340 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.349
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #61"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.3% (MEDIUM) · Higher = larger blast radius
    42.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.7% · Safe to merge
    16.7%