From 3083bdb932757e2b393dc59788b9dc273922bebe Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Sat, 3 Oct 2026 11:12:20 -0400 Subject: [PATCH 1/5] fix(pipeline): keep foreign-owner PR bodies clean and refuse PRs with unresolved intent mismatch When the PR targets a repository whose owner differs from the fork that was pushed, the generated body now omits the ## Intent section and every local-file evidence reference the maintainer cannot open. Inline evidence text, links, and attachments stay; same-owner bodies are unchanged. Review now tags intent-contradiction findings with the structured category intent-conformance, and the PR step refuses to create or update the pull request while a completed review still holds one (it was approved, not fixed). The branch stays pushed. --- .../content/docs/reference/pipeline-steps.md | 4 +- internal/pipeline/steps/common.go | 3 +- internal/pipeline/steps/intent_prompt.go | 2 +- internal/pipeline/steps/pr.go | 82 +++++++- internal/pipeline/steps/pr_upstream_test.go | 195 ++++++++++++++++++ internal/pipeline/steps/prsummary.go | 11 +- internal/types/findings.go | 11 +- 7 files changed, 292 insertions(+), 16 deletions(-) create mode 100644 internal/pipeline/steps/pr_upstream_test.go diff --git a/docs/src/content/docs/reference/pipeline-steps.md b/docs/src/content/docs/reference/pipeline-steps.md index 40cae706a3..ef957d6d74 100644 --- a/docs/src/content/docs/reference/pipeline-steps.md +++ b/docs/src/content/docs/reference/pipeline-steps.md @@ -248,13 +248,15 @@ Creates or updates a pull request. - PR title: agent-generated from the final branch delta with user intent when available, in conventional commit format (`type(scope): description` or `type: description`); user-facing product impact should use `feat` or `fix` so release automation can pick it up; when a scope is used, it should be the primary affected real module/package from the changed paths and kept broad rather than file-level. If drafting fails, the fallback uses the neutral title `chore: update pull request` rather than inferring scope from earlier commits. - Bounds the PR-drafting agent with [`agent_timeout`](/no-mistakes/reference/global-config/#agent_timeout): an expired budget cancels the agent and uses that same fallback rather than leaving the run active indefinitely; a late successful title after the deadline is not used - The PR stage exclusively owns the complete branch-scope description. It drafts `## What Changed` from the actual final diff after local mutating stages finish, and its fallback lists the final changed paths and statuses. -- PR body includes a `## Intent` section when user intent is available, the final-diff `## What Changed`, and regenerated `## Risk Assessment`, `## Testing`, and `## Pipeline` sections from recorded step results and rounds. Only `## What Changed` describes the complete final branch scope; the deterministic sections remain evidence for the commit each step inspected. Auto-fix results in `## Pipeline` render as an issue -> fix -> verification narrative using recorded outcomes: applied changes, a confirmed no-change attempt, or an attempt whose result was not recorded. Test details show the live-validation verdict, scenario table, and recorded commands in both `## Testing` and the relevant Pipeline rounds. +- Refuses to create or update the pull request, failing the step with the branch left pushed, while the completed Review step still holds an intent-conformance finding: Review tags a finding `intent-conformance` when the change contradicts an authoritative intent, so one still present after Review completed was approved rather than fixed +- PR body includes a `## Intent` section when user intent is available and the PR is not a foreign-owner PR, the final-diff `## What Changed`, and regenerated `## Risk Assessment`, `## Testing`, and `## Pipeline` sections from recorded step results and rounds. Only `## What Changed` describes the complete final branch scope; the deterministic sections remain evidence for the commit each step inspected. Auto-fix results in `## Pipeline` render as an issue -> fix -> verification narrative using recorded outcomes: applied changes, a confirmed no-change attempt, or an attempt whose result was not recorded. Test details show the live-validation verdict, scenario table, and recorded commands in both `## Testing` and the relevant Pipeline rounds. - `## Pipeline` keeps the existing human-readable signature and includes the stable structured step attestation documented below. Bitbucket Cloud PR descriptions omit HTML-only features (`
`, ``, `