← Back to Pull requests

0.2.1: typed full-name mentions; edits keep links whose text remains #7

Closed
unknown closed this pull request without merging on Oct 31, 2026 20:58 UTC
View on GitHub
unknown unknown commented on Oct 31, 2026 20:27 UTC
Author

What

The 0.2.1 follow-ups to #6, implementing two product rules: typing an exact full name (@Ben Atkinson) mentions that person, and an edit keeps every @/# link whose text is still there (and drops the ones whose text was removed), even when the editor can no longer see the target.

1. Typed full-name mentions (ADR-0010)


  • One matcher runs at each @, case-insensitive. The longest mentionable full name wins (@Ann Lee over @Ann), and it must end at a word boundary (@Ann Leeds is not Ann Lee). If no name matches, the existing single-token handle is used.

  • A name shared by several mentionable users mentions nobody, and it doesn't fall back to a shorter name.

  • Picked mentions still take priority, forged tokens are still neutralised, and HUDDLE_FREE_TYPED_MENTIONS (on by default) covers both.

  • Composer: the @ trigger now allows up to three words, so @Ben A keeps narrowing. A multi-word query with no match renders nothing instead of "No matches".
  • 2. Edits keep links whose text remains (ADR-0011)


  • How placeholders stay unambiguous: each reference the editor can't see appears in the editable text as a distinct, stable #unavailable-1, #unavailable-2… numbered per distinct token in order of first appearance. This is used by the HTML edit form, the REST text field and ChatService.edit_message(). I chose this over hidden inputs so the text stays the single source of truth for all three paths.

  • ChatService.kept_links(user, message) rebuilds the editor's forms. Any existing mention (of a user who still exists) or recorded reference whose form is still in the text is kept verbatim, without a permission re-check and without a new signal. Remove the text and the link and its MessageReference row go.

  • Only tokens already on that message can be kept. Hand-typed <@…>/<#…> stay neutralised, and #unavailable-1 in another message is just text. A form shared by two tokens (two people with the same name) is treated as ambiguous and goes through the normal rules.

  • Fix: the HTML edit form no longer pre-picks people who are no longer mentionable. Pre-picking them failed form validation and blocked the edit.
  • New public helpers: ChatService.kept_links(), KeptLinks, MessageMarkup.editable_forms(), ChatRenderer.editable_links(), markup.mention_name(). The version is bumped to 0.2.1 (pyproject.toml, __init__, uv.lock) and the changelog has a 0.2.1 section. Not tagged.

    Testing


  • 166 tests (18 new in tests/test_full_names_and_edits.py). They cover longest-match, word boundary, ambiguity without fallback, the setting, partial-name autocomplete, numbered placeholders, keeping and dropping hidden references independently, keeping a mention of someone no longer mentionable, per-message placeholders, no forging, no signals for kept links, ambiguous forms and deleted users, and HTML-form and REST-PATCH round trips.

  • Coverage is 99% (gate 95%). ruff, mypy --strict, tox -f py314 (Django 6.0 + 6.1) and pre-commit run --all-files all pass.
  • AI Provenance

  • Tool: Claude Code

  • Model: Claude Opus

  • Prompt/thread: Agent follow-up: typed exact full-name @mentions (longest match, word boundary, ambiguity mentions nobody, autocomplete across spaces), and on edit keep any existing @/# link whose text remains (unambiguous placeholders, rows kept or dropped, no new signals, no forging, same behaviour in HTML/service/REST), shipped as 0.2.1.
  • Checklist

  • Addresses exactly one issue or feature (the two 0.2.1 follow-ups to #6)

  • New or changed behavior has test coverage

  • Diff contains only changes for this task
  • Diff: 455 lines (+341 / -114) across 5 files Reviewer: BenA-SA Review duration: 31m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 455 lines diff across 5 files
    0.45
    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.366
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7"
    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: 45.5% (MEDIUM) · Higher = larger blast radius
    45.5%
    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: 18.0% · Safe to merge
    18.0%