Skip to content

ci(spec-sync): summarize the drift PR description with an LLM - #124

Merged
tian-lan-landing merged 3 commits into
mainfrom
ci/spec-sync-llm-pr-summary
Jul 22, 2026
Merged

ci(spec-sync): summarize the drift PR description with an LLM#124
tian-lan-landing merged 3 commits into
mainfrom
ci/spec-sync-llm-pr-summary

Conversation

@tian-lan-landing

Copy link
Copy Markdown
Collaborator

After the mechanical + AI-wiring commits land, a best-effort step feeds the PR diff to the Anthropic API and appends a ## What changed section under the existing static preamble (which stays authoritative: gates + human-review). continue-on-error, so a summary failure never reds the run; only edits the PR body via SPEC_SYNC_TOKEN. Added to both V1 and V2 jobs. Native GitHub Copilot PR summaries are manual-only, hence doing it in the workflow.

After the mechanical + AI-wiring commits land, a best-effort step feeds
the PR diff (surface-first, capped) to the Anthropic API and appends a
"## What changed" section under the static process/safety preamble, so
the body reflects what the drift actually changed instead of only the
boilerplate. continue-on-error, so it never reds the run; the step can
only edit the PR body via SPEC_SYNC_TOKEN, so an injected spec
description can't escalate past text. Added to both the V1 and V2 jobs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 06:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds best-effort Anthropic-generated summaries to V1 and V2 spec-sync PR descriptions.

Changes:

  • Collects and truncates relevant PR diffs.
  • Generates concise public-surface summaries.
  • Appends summaries while preserving the static safety preamble.

Comment thread .github/workflows/spec-sync.yml Outdated
Comment thread .github/workflows/spec-sync.yml Outdated
Comment thread .github/workflows/spec-sync.yml Outdated
…ot notes

- Move the inline summarize logic (duplicated across the V1 and V2 jobs)
  into scripts/spec-sync/summarize-pr.sh; both jobs now call it. The only
  per-job difference — the V2 /v2/workflow* exclusion — is passed via
  SUMMARY_SCOPE_NOTE.
- Bound the Anthropic call with --connect-timeout/--max-time: continue-on-error
  does not rescue a hung socket (it would burn the 60-min job timeout).
- V2: exclude /v2/workflow* from the summary so a workflow-only drift can't
  advertise SDK endpoints the PR never wired.
- Guard the body read and append-only edit so a transient failure never
  clobbers the static preamble.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread scripts/spec-sync/summarize-pr.sh
The summary is built from untrusted spec descriptions and appended to the
PR body, which also carries the reserved `<!-- spec-sync-slack-thread:
<ts> -->` marker that thread-ts.sh trusts to route Slack lifecycle
notifications. A prompt-injected marker in the model output could hijack
that routing (or become the only marker if the root-save step failed).
Strip HTML-comment delimiters from the summary before appending.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@tian-lan-landing
tian-lan-landing merged commit 427842b into main Jul 22, 2026
6 checks passed
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.

2 participants