← Back to Pull requests

Guard task edits with optional versions #57

Closed
unknown closed this pull request without merging on Nov 28, 2026 17:41 UTC
View on GitHub
unknown unknown commented on Nov 11, 2026 12:47 UTC
Author

Stacked on #58: merge it after #58. Until then GitHub shows #58's commits here too; this PR's own are the last three: Guard task edits with optional versions, Store task versions as 64-bit integers and Cut the version guard's README section to two lines.

Two agents can read the same task and overwrite each other. get_task with include_version: true now adds the task's version; update_task with if_version checks it and writes in the same transaction. A stale edit changes nothing and asks the agent to reread. Calls without these fields, and their replies, are unchanged. Fixes #54.

A version is the task's number and 64 random bits from SQLite, like 12.9c1f0a7e3b5d4268, in a small task_revs table that triggers keep up to date. So writes from the board, bulk edits and older Kanzo versions count too. It changes with the title, description, column, project, tags, url, human, escalated and the task's own waits_on list. Reordering, comments and a blocker finishing don't change it.

With #58, a guarded handoff saves its comment only when the version holds. Its reply ends with the new version: Updated api#1, todo -> review: …\nComment added as agent.\nversion: 1.….

Migration 12 adds the table, after #58's 11. schema.sql and the compatibility floor are unchanged, so older Kanzo versions keep opening the board.

Since the review:

  • Compact versions: 64 random bits stored as an integer instead of 32 hex characters. On measure.py's 3,000-task board the versions now add 52 KB to the database (3.9%) instead of 124 KB (9.4%), and the version agents read and send back is 16 hex digits at most instead of 32.

  • README: two lines, in all four READMEs.
  • Tokens: the tool list grows by 224 bytes (include_version and if_version).

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass (133 tests, with #58)

  • A board change was tried in a browser, in light and dark mode (no board change here)

  • The README says what changed for users, if anything did
  • Diff: 256 lines (+192 / -64) across 3 files Reviewer: emanuele-em Review duration: 24774m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 256 lines diff across 3 files
    0.39
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #57"
    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: 39.1% (MEDIUM) · Higher = larger blast radius
    39.1%
    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: 15.4% · Safe to merge
    15.4%