chore(friction): improve report format — surface category, compact body, opt-in label#1313
Merged
Merged
Conversation
…dy, opt-in label PRs #1305 + #1311 closed the recruit→fire loop. Looking at the 5 reports filed live in prod 2026-05-10 (Trello cascade + Linear mongrel): - Title slugs read `frictionlow-...` because `[Friction][severity]` put brackets adjacent with no separator. Category — the most useful triage signal — wasn't in the title at all. - Body had 5 sections including `## What happened` (just repeats the summary already in the title), `## Classification` (now-redundant category/severity + the useful-but-buried whileDoing), and `## Timestamp` (the PM provider's native createdAt already shows this). - No PM-side label, so operators couldn't filter friction cards even though the alert flow already established the cascade-alert opt-in pattern via spec 019. Agents are already writing structured prose in `details` voluntarily (what they tried, error, workaround, impact). The win is in rendering, not in tightening the gadget input. Changes: - src/friction/format.ts: - Title: `[Friction · ${category} · ${severity}] ${summary}` — one bracket pair, dot separators, all three classification facets surfaced. Slugifies as `friction-tooling-low-...`. - Body has only two sections: `## Details` (agent prose verbatim, first because it's the most worth reading) and `## Run context` (bold-keyed bullets — Run / Work item / PR / Project / While doing). Italic `_Reported {iso}_` footer. Lines for absent fields drop entirely; no `_not provided_` placeholders for conditional context. - Compact bullets mirror src/integrations/alerting/_shared/format.ts. - src/pm/config.ts: add `getFrictionLabelId(project)` mirroring the `getAlertLabelId` opt-in pattern from spec 019. Reads `labels['cascade-friction']` (Trello) / `labels.cascadeFriction` (JIRA, Linear). Returns undefined when unconfigured — current prod cascade & ucho behavior is preserved. - src/integrations/pm/{jira,linear}/config-schema.ts: extend Zod schemas with the optional `cascadeFriction` label key. - src/friction/materialize.ts: pass `[labelId]` to createWorkItem when configured, `[]` otherwise. Back-compat — projects without the label configured continue to file unlabeled cards exactly as before. Tests: - tests/unit/friction/format.test.ts: re-pin title + body invariants (only `## Details` + `## Run context` headings; no `## What happened` / `## Classification` / `## Timestamp`), Run-context bullet shape (run link, work item with monospaced id, PR with branch + 12-char SHA, project key/repo/pmType, whileDoing). Pin absence of prior bracket-concat title form as a regression net. - tests/unit/friction/materialize.test.ts: add label-applied paths for Trello + JIRA + a label-absent regression net pinning `labels: []`. - tests/unit/pm/config-friction-slot.test.ts: cover getFrictionLabelId across providers + Zod schema acceptance for `labels.cascadeFriction`. Hand-rendered against a prod-shaped fixture confirms the new title slug (`friction-tooling-low-pm-add-checklist-...`) and dense body shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure presentation pass on friction reports — same
FrictionReportinput from agents, more useful PM card output. Plus an opt-incascade-frictionlabel (mirrors the spec-019cascade-alertpattern) so operators can filter/cluster friction cards in the PM UI.Live signal driving this: PRs #1305 + #1311 closed the recruit→fire loop today (5 reports filed cleanly post-deploy at 09:05Z across cascade/Trello + mongrel/Linear). The reports work, but the rendering was suboptimal.
What changes
Title
[Friction][medium] PM add-checklist failed ...[Friction · tooling · low] PM add-checklist failed ...frictionmedium-pm-add-checklist-...friction-tooling-low-pm-add-checklist-...Body
Removed (all redundant):
## What happened(title carries summary),## Classification(category+severity in title; whileDoing migrates into Run context),## Timestampheader (PM provider's native createdAt already surfaces this).New shape:
Bold-keyed bullets, dense, run link first (the gold piece — links to the full agent transcript). Lines for absent fields drop entirely. Mirrors
src/integrations/alerting/_shared/format.ts:formatSentryCardBody.Optional
cascade-frictionlabelgetFrictionLabelId(project)accessor readslabels['cascade-friction'](Trello) /labels.cascadeFriction(JIRA, Linear).materializeFrictionReportpasses[labelId]tocreateWorkItemwhen configured,[]otherwise.Test plan
npm run lint+typecheckcleanformat.test.ts: title is[Friction · category · severity] summary; body has only## Details+## Run contextheadings; the prior bracket-concat / removed-section forms are pinned absent (regression net for revert).materialize.test.ts: label applied for Trello + JIRA; back-compatlabels: []pinned for projects without the label.config-friction-slot.test.ts:getFrictionLabelIdcoverage + schema acceptance for the new label key.report-friction. Expect: title slug starts withfriction-<category>-<severity>-..., only## Detailsand## Run contextheadings on the rendered card.Out of scope (intentional defer)
category/severityenums.cascade-frictionlabel on production cascade / ucho projects (operator config, not code).🤖 Generated with Claude Code