Skip to content

Merge dev to main: friction report format improvements#1314

Merged
zbigniewsobiecki merged 2 commits into
mainfrom
dev
May 10, 2026
Merged

Merge dev to main: friction report format improvements#1314
zbigniewsobiecki merged 2 commits into
mainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • chore(friction): improve report format — surface category, compact body, opt-in label (chore(friction): improve report format — surface category, compact body, opt-in label #1313) — title now [Friction · category · severity] summary (clean slugs, all 3 facets surfaced); body collapsed to ## Details + ## Run context (bold-keyed bullets, run link first); optional cascade-friction label applied at materialize time when configured (mirrors spec-019 cascade-alert opt-in).

Test plan

  • dev CI green pre-merge
  • Watch main CI + Build and Deploy after merge
  • Post-deploy: watch the next 2-3 prod runs that fire report-friction and verify the new title/body shape on the rendered Trello/Linear cards.

🤖 Generated with Claude Code

zbigniewsobiecki and others added 2 commits May 10, 2026 10:06
…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>
…tion-report-format

chore(friction): improve report format — surface category, compact body, opt-in label
@zbigniewsobiecki zbigniewsobiecki merged commit 8c7215f into main May 10, 2026
14 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

❌ Patch coverage is 92.15686% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/friction/format.ts 87.50% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant