[feature not live] docs(flaky-tests): document test_case.investigation_completed webhook event#558
Conversation
… event The investigation_completed webhook event now delivers rendered citation links in markdown_summary and facts[].content (shipped in v156). There was no existing docs page for this event. Shipped in v156 via trunk-io/trunk2#3592. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> https://claude.ai/code/session_01B2TQ276xj88AoXyrgaahah
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Triage status (2026-05-05): merge conflicts with main in |
|
Verification status (2026-05-07): Eng merged but flag off in prod. Hold off.
Suggested next action: re-run |
…ation-completed-webhook-event # Conflicts: # flaky-tests/webhooks/README.md
…ation-completed-webhook-event
…ation-completed-webhook-event
…lassname casing - Remove the invented facts[].impact field from the example payload and the field reference table. The Zod payload schema in trunk2 only defines fact_type, content, and confidence on each fact. - Fix vale flag on the classname row description. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @samgutentag's task in 1m 36s —— View job Review
FindingsBlocking
Should fix before merge
Nits
Looks good
review_passed: false (blocked on the stray trailer at line 127; the README/new-page |
|
|
||
| For general webhook setup, see [Webhooks](README.md). | ||
|
|
||
| Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
There was a problem hiding this comment.
Blocking: A Co-Authored-By commit-message trailer was accidentally committed into the page body. It will render as visible text at the bottom of the published doc. Belongs in the commit message, not the file.
| Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | |
| For general webhook setup, see [Webhooks](README.md). |
|
|
||
| | Field | Type | Description | | ||
| |---|---|---| | ||
| | `fact_type` | string | Category of evidence (e.g., `CI_LOGS`, `COMMIT`, `TEST_RUN`). | |
There was a problem hiding this comment.
The fact_type examples here (CI_LOGS, COMMIT, TEST_RUN) don't match the example in README.md line 73, which uses GIT_BLAME. Worth reconciling so a reader scanning both pages sees consistent values — and ideally the list reflects the actual enum from the trunk2 schema.
|
|
||
| When Trunk's AI finishes investigating a flaky test, it fires a `test_case.investigation_completed` webhook event. Your endpoint receives the investigation findings, a confidence score, and a rendered markdown summary you can post to Slack, create tickets from, or feed into your own tooling. | ||
|
|
||
| ## Event type |
There was a problem hiding this comment.
Nit: this page uses sentence-case H2 headings (Event type, Markdown summary, Enabling the webhook), while sibling pages (README.md, slack-integration.md) use Title Case for section headings (Supported Events, Configure Slack webhooks). Worth aligning to keep the section nav consistent across the webhooks folder.
| * [GitHub Issues integration](flaky-tests/webhooks/github-issues-integration.md) | ||
| * [Linear integration](flaky-tests/webhooks/linear-integration.md) | ||
| * [Jira integration](flaky-tests/webhooks/jira-integration.md) | ||
| * [AI Investigation Completed Event](flaky-tests/webhooks/investigation-completed-event.md) |
There was a problem hiding this comment.
Nit: the surrounding entries use sentence case (Linear integration, Jira integration, Microsoft Teams integration). Consider AI investigation completed event for consistency.
| * [AI Investigation Completed Event](flaky-tests/webhooks/investigation-completed-event.md) | |
| * [AI investigation completed event](flaky-tests/webhooks/investigation-completed-event.md) |
Summary
test_case.investigation_completedwebhook event, documenting the full payload schema includingmarkdown_summary,facts[],repository, andtest_casefieldsContext
Shipped in v156 (trunk-io/trunk2#3592): the
markdown_summaryfield andfacts[].contentin theinvestigation_completedwebhook payload now contain rendered citation links (actual URLs) instead of rawCITE:TAGplaceholders. This makes the event payload directly usable for Slack messages, ticket creation, etc.Previously there was no docs page for this event at all.
Test plan
https://claude.ai/code/session_01B2TQ276xj88AoXyrgaahah