Skip to content

AIR-607: mandate PR details as context to TFA agent with contract validation - #373

Open
Dave3130 wants to merge 3 commits into
TRA_TFAfrom
AIR-607-pr-details-context
Open

AIR-607: mandate PR details as context to TFA agent with contract validation#373
Dave3130 wants to merge 3 commits into
TRA_TFAfrom
AIR-607-pr-details-context

Conversation

@Dave3130

Copy link
Copy Markdown
Collaborator

AIR-607 — Github PR Details is incorrect

Problem: incomplete/missing PR context was being passed to the TFA agent, which misled root-cause attribution (wrong/irrelevant PRs). The earlier fix targeted the wrong layer.

Fix (mcp-server side): make PR context a validated, always-passed part of the tfaRcaTurn payload.

Changes

  • PrDetail contract (submit-turn.ts) — replaces the broken WIP type with a real one: title, author, link, number, tag (latent | regression). All fields required.
  • ValidationprDetails is optional, but any entry present must satisfy the contract; a partial PR object throws a clear TfaRcaTurnError (prDetails[i] missing required field(s): …) instead of being forwarded. Runs only on the submit path (skipped when resuming via turnId).
  • Mandated context — PR details are always concatenated onto the message sent to TFA: PR_DETAILS: <stringified list> when present, or PR_DETAILS: none provided when absent — so PR context is never silently dropped.
  • Zod param (constants.ts) — prDetails added to TFA_RCA_TURN_PARAMS (typed array, tag enum) for boundary validation on MCP clients.

Notes

  • Scope is change 2 only (mcp-server). The companion plugin-side pr_details contract in the rca-build skill (change 1) is tracked separately.
  • Tests for validatePrDetails / composeMessageWithPrDetails to follow.
  • Verified: tsc --noEmit and eslint on changed files pass.

Targets TRA_TFA.

…lidation

AIR-607: incomplete/missing PR context was misleading the TFA agent. Introduce a
typed PrDetail contract (title, author, link, number, tag=latent|regression) on
the tfaRcaTurn tool; validate it when present (reject partial PR objects with a
clear error rather than forwarding them); and always concatenate a stringified
PR_DETAILS block onto the message sent to TFA (explicit 'none provided' when
absent) so PR context is never silently dropped.
Add required repo (owner/name) field and enforce link is the canonical
https://github.com/<repo>/pull/<number>. A bare PR number is unique only within
its repo, so number-only identity let PRs from different repos collide into one
card (AIR-607 report showed the same #861 across unrelated cases + a 404 link).
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