fix(slack): cut long tag values in a gate's context line so the gate still posts #1240
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 471 lines diff across 5 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.368
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1240"
general
weight: 0.35
mvschwarz
What a person gets: a workflow gate parked on a person always reaches Slack, even when its row carries a very long
workflow:,instance:orstep:tag.The cause
SLACK_TEXT_CAP, enforced bybounded(), which refuses rather than cuts). So a hand-made gate row with a very long tag made the whole message refuse before it reached Slack. Before #1143, the same row posted.The change
buildGateContextLine(packages/daemon/src/domain/gateway/slack/message.ts):GATE_CONTEXT_VALUE_CAP(80) characters to its first 32 and last 33 characters around…, then the first 12 hex characters of the SHA-256 of the whole redacted value. Labels that differ at the start or end stay visibly distinct. For labels that differ only in the cut middle, the digest makes a collision unlikely but doesn't rule it out. A value of 80 or fewer characters, such as a ULID instance, is shown whole.[redacted-secret]marker as one unit, so no surrogate pair is split and the marker is shown whole or left out, never cut;<-style escape is split.buildOutboundMessage: the line is supplementary. When it alone would push the complete fallback pastSLACK_TEXT_CAP(a near-limit summary with long escaped tags),instance <value>alone is tried, and the line is left out of both the fallback text and the blocks only when even that doesn't fit. The gate still posts.Tests
slack-message.test.ts:<instance and a 200-emoji step build. Each shows 32 characters,…, its last 33 and a 12-hex digest, with whole<escapes and whole emoji. The fallback text and thecontextblock carry the same line, withinSLACK_TEXT_CAP.pplus-Aor-Brender distinctly (…pp-A #…vs…pp-B #…). Two 85-character labels that differ only in the middle, whose digests share their first 6 characters, render distinctly through the 12-hex digest. A ULID instance is shown whole.- a 2,990-character summary with long
&tags shows only the instance part;- with a long Evidence line as well, it leaves the line out;
- an ordinary summary keeps the whole line.
Refs #1013
🤖 Generated with Claude Code
https://claude.ai/code/session_01WfCu2MmcrSGRNX9Rjv1h6u
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Improvements
Slack gate context redacts secrets and shortens long workflow, instance, and step values while preserving missing-value behavior. Shortened values retain excerpts and a digest to distinguish labels that might otherwise look alike, and redaction markers remain intact.
* When full context exceeds the fallback message budget, the message retains instance-only context if it fits; otherwise, context is omitted. Existing fallback limits still apply.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->