Let reference resolvers choose their trigger character (0.4.0) #13
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 · 337 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.348
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #13"
general
weight: 0.35
BenA-SA
Summary
Users of the package can now designate the character that starts a reference and which resolver(s) it is used for.
ReferenceResolver.trigger: ClassVar[str] = "#". Settrigger = "!"and that kind is typed as!0004. Defaults to#, so existing hosts are unchanged.InvalidReferenceTriggerError), and not@/</>(ReservedReferenceTriggerError). Both carryresolver/triggerincontext.ReferenceRegistry.triggerslists them.search(..., trigger=)andresolve_codes(..., trigger=)ask only resolvers with that trigger; settings order still breaks ties within a trigger.<#kind:id>, so there's no migration, old messages keep rendering, and a host can change a trigger later.Referencegainstriggerandtyped(!0004). The REST API and websocket JSON includetrigger.label()defaults totrigger + code. The unavailable placeholder uses the kind's trigger (!unavailable,!unavailable-Nwhen editing), so ADR-0011's keep-on-edit works for every trigger.composer_fields.htmlrendersdata-reference-triggers,huddle.jsbuilds its pattern from it (character-class escaping,uflag), sends?trigger=to the search view, and inserts picks withdata-trigger. The search view and APIreferences/endpoint accept?trigger=(absent means every resolver, as before).Milestonemodel and a!M1MilestoneResolver.Internal shape change (not documented API):
MessageMarkuptakes the registry,reference_codes()becametyped_references()(returns#T1), andencode()'s references are keyed by the typed form, because#T1and!T1can name different objects.Tests
tests/test_reference_triggers.pycovers: unchanged defaults; invalid and reserved triggers; validation from settings; shared triggers; each trigger resolving only its own kind; the same code under two triggers; picks with a custom trigger; prose with!(done!,!!!,really?!,wow!M1,! M1, …) never reachingresolve_code; forged tokens; placeholders and keep-on-edit with!; changing a trigger after messages exist; HTML escaping of the trigger; the composer attribute; and per-trigger search in the view and API.pytest(221 passed),tox -f py314(Django 6.0 + 6.1),pre-commit run --all-files.Release
Do not merge until approved. After merging: tag
v0.4.0to publish. Comply 100 has a draft PR that depends on 0.4.0.