Skip to content

ci: summarize release notes with a configurable AI API - #313

Merged
zengchuang-hw merged 18 commits into
InferMatrixLab:mainfrom
zengchuang-hw:codex/gpt-release-notes
Nov 3, 2026
Merged

zengchuang-hw merged 18 commits into
InferMatrixLab:mainfrom
zengchuang-hw:codex/gpt-release-notes

Conversation

@zengchuang-hw

@zengchuang-hw zengchuang-hw commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Governing Issue and resulting behavior

Refs #238

After package validation, an optional read-only job calls a configured Responses API to produce a concise English release overview. The original GitHub changelog and PR links remain. Missing credentials, unusable output or provider errors fall back to ordinary notes without blocking an otherwise valid publication.

The requester selected DeepSeek's official API and DeepSeek-V4.1-Flash-1017. Its documented API name is deepseek-flash; this provider-managed alias may be upgraded and is not a version pin. Publication remains github-actions[bot] creating tags and Releases. AI has no repository write capability.

Configuration and implementation

  • Repository secret: DS_API_KEY, mapped only in the notes step to the helper's internal OPENAI_API_KEY environment variable. There is no fallback to the old repository secret. No key value was retrieved, exposed or copied.
  • Repository variables and code defaults agree: OPENAI_RELEASE_NOTES_MODEL=deepseek-flash, OPENAI_BASE_URL=https://api.deepseek.com.
  • The dependency-free helper accepts only approved HTTPS bases: https://api.deepseek.com, https://api.openai.com/v1 and https://yibuapi.com/v1. It normalizes trailing slashes and appends /responses. Other destinations and redirects cannot forward the key. Configured model IDs are sent unchanged.
  • One request uses a 45-second timeout, at most 3200 output tokens, no tools, JSON Accept and an honest InferRSI user agent. DeepSeek alone receives reasoning: {effort: "none"}. The payload includes store: false, which DeepSeek ignores under its documented stateless compatibility; this does not establish zero retention. Billing and data handling depend on the selected provider.
  • Validate the planned checkout and previous-release ancestry. Send at most 100 commit subjects/links and bounded file-change statistics within 48KB, excluding authors, commit bodies and raw patches. Redact complete fields containing recognizable private data before serialization while retaining generated canonical commit links.
  • Accept only completed, non-refused Markdown within 20KB. A fixed coverage notice is derived from trusted truncation flags and counts toward the total UTF-8 limit. The model is asked to leave coverage statements to the helper. Stale output is removed on failure; raw HTTP bodies, credentials and exception details are never logged.
  • Restrict explicit model URLs/Markdown links to simple inline links whose full destination exactly matches a canonical repository/40-hex-SHA URL in the supplied source snapshot. Reject images, unverified targets, reference/relative/bare links, email/mention/issue shorthand and unsupported escapes/entities/encoded forms. Unsupported output uses the normal fallback; the residual scan is linear. GitHub's site/custom-autolink policy remains separate.
  • Transfer notes as a separate optional artifact. Failed downloads cannot contribute partial text. Read model text through --notes-file, retain GitHub's changelog and the fixed source/evidence notice, and never execute generated text.
  • The publisher has no checkout or API key. Its only mutations remain new tags at existing default-history commits and Release creation/assets/publication. Cancellation and failed package checks still prevent publication. Four package assets, four CI lanes and campaign gates are unchanged.

A changed-source dry run calls the selected provider when the key is configured. Ordinary releases work without AI access. Existing public releases are never rewritten.

Verification

Head: 214f8dc29e38951b57d8f8e5c55ed1d2ccd27af6. Source base: 977289d290092dcb4251cadb9593950771b6178c; assessed target base: 2baebf6ebb815ebf07d21c41e3b3754858c0798e.

  • 190 focused tests passed on this final head: 141 helper/API/endpoint/redaction/coverage/link tests, 21 actual publisher-shell tests with real jq and 28 planner/package checks. All unit HTTP requests are mocked.
  • Full-tree Ruff, actionlint 1.7.12 and whitespace checks passed. actionlint shellcheck/pyflakes integrations are unavailable.
  • Independent Codex research_release review cleared exact head 214f8dc29e38951b57d8f8e5c55ed1d2ccd27af6 against b7ee0fa502d73600725d89fcfb862825c2723b14, including 46 focused source/link/long-text checks, additional reference-link/image cases and an offline replay of the prior real summary. No material blockers remain in the three-file review-fix delta. Endpoint credentials, strict response rejection, coverage/byte caps and publisher behavior are unchanged.
  • Final-head hosted CI passed Python3.10/3.11 full-check and clean installed-package jobs plus PR reference/declaration validation. Knowledge policy is Not applicable; upstream KV qualification is skipped by its draft condition.
  • The requester-authorized v0.1.0 provider preview used helper b7ee0fa502d73600725d89fcfb862825c2723b14 before output-link hardening, the official endpoint, deepseek-flash and DS_API_KEY. The response completed: 13683 input tokens, 745 output tokens, 0 reasoning tokens. The artifact contains the validated summary and credential-free metadata.
  • Independent final-sample review verified all 12 commit URLs against the supplied historical context, supported software statements, no future-version bleed or unsupported performance/quality/PASS claims, and one correct fixed coverage notice without contradictory model text. The exact current URL gate replays this unchanged sample successfully against its historical source context. This review fix made no further AI API call or publication. This is evidence for one real sample, not a guarantee of general summary accuracy. Six-bullet/one-link instructions remain prompt guidance; this sample has 11 bullets and one two-link bullet.
  • v0.1.0 has 200 reachable commits; the bounded context includes the latest 100 plus truncated file statistics (36047 input bytes). The original GitHub changelog remains available for omitted history. Public Release body/state/publication time and all four attachments were verified unchanged; the temporary upstream preview branch is removed.

The earlier HTTP401 run read the old repository secret and did not validate DS_API_KEY. The corrected binding now authenticates and generates notes successfully.

Readiness and Issue completion

The previously missed GitHub P2 is fixed and answered in its original thread. Independent review, 190 focused local checks and final-head hosted CI passed; the addressed review thread is resolved. The earlier provider test remains applicable with the current gate independently validated offline. This PR remains a draft; merging enables the optional stage for future releases. Future scheduled AI-stage activation and requester acceptance remain separate from this preview. Issue #238 stays open.

Provider contracts: model mapping, Responses compatibility.

Keep GPT in a read-only notes job, preserve the GitHub changelog, and fall back to ordinary notes if summary generation or artifact delivery fails.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Generate an optional Markdown overview from a bounded immutable commit range and file statistics. Isolate API credentials from subprocesses, reject redirects and invalid replies, and fall back without stale output when generation is unavailable.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Describe the bounded metadata sent to the API and retain source links without claiming that field selection alone removes all private values.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Conservatively omit metadata fields containing recognizable addresses, personal paths, URLs or credential patterns before constructing the API input. Preserve canonical commit links and source identities, and report that bounded metadata was redacted.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
@Dong1017 Dong1017 added the area:process Repo-wide process, governance, privacy and security rules label Nov 2, 2026 — with ChatGPT Codex Connector

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Draft #313 增量静态评审(head a0a136ef):1 项 P2 输出信任边界风险,见 inline。 本轮检查了 GPT 响应解析、可选 notes artifact 到发布器的 Markdown 路径、相关模拟测试以及 #238 的授权范围。现有代码将模型文本作为文件读取,未发现 shell 插值执行路径;但模型生成的外链/图片 Markdown 尚未形成可核验的发布约束。建议在合入前按本项补充响应白名单或拒绝规则及负例测试。未调用 GPT API、未运行测试或实际发布;此意见不构成合入/目标验收批准。

Comment thread tools/generate_release_notes.py Resolved
Pass the repository API base URL to the read-only notes helper and align the fallback model with GPT-6.1 Terra.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Allow only the explicitly approved OpenAI and Yibu HTTPS API bases for release overviews. Preserve the requested model override, default to GPT-6.1 Terra, and reject unapproved endpoint variants before constructing an HTTP request.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Send JSON Accept and an explicit InferRSI client user agent for the approved API endpoints.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Default release overviews to the official DeepSeek Responses endpoint and documented model name. Disable thinking for DeepSeek requests while preserving explicit model IDs and existing OpenAI/Yibu settings. Keep provider-neutral status messages and all privacy, validation and fallback boundaries.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
@zengchuang-hw zengchuang-hw changed the title ci: summarize release notes with the GPT API ci: summarize release notes with a configurable AI API Nov 2, 2026
Agent-assisted-by: Codex
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Limit release summaries to six concise bullets and 250 words of prose, with one supplied commit link per bullet. Give completed summaries a bounded 3200-token response budget while retaining strict incomplete-response rejection and byte limits.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Specify one neutral coverage note whenever commit or file statistics are truncated, and forbid unsupported earlier/later characterizations of omitted history. Preserve the existing source limits, request budget and response validation.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Append a fixed coverage notice from trusted source truncation flags instead of asking the model to infer omitted history. Include that notice and its newlines in the UTF-8 output budget while retaining strict response validation and secret checks.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Restrict generated overview Markdown to simple inline links whose exact canonical GitHub commit URLs occur in validated source metadata. Reject images, unsupported link syntax and common raw autolink forms before producing the notes file, preserving the existing fallback and byte-budget behavior.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Detect unsupported colon-without-space URL forms directly instead of rescanning long scheme-like letter runs. Verify a plain ASCII overview at the complete byte limit remains accepted without introducing a timing threshold.

Agent-assisted-by: Codex (implementation)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM for the optional release-overview implementation and link-validation repair at 214f8dc2, assessed for integration with main ebdbf5af.

  • The original link/image P2 is cleared, as already confirmed in that resolved thread; this review adds an independent assessment of the full five-file scope.
  • The inspected source-to-publication path preserves bounded source collection, credential isolation, approved endpoints/no redirects, atomic text output and a publisher that reads the notes as data. Optional notes failure preserves the ordinary release path.
  • Current Ready/declaration checks pass. The inspected 3.11 run reports Ruff success, 3,534 passed, 13 skipped and 284 passing subtests. This is hosted integration evidence, not a new provider call by this reviewer.
  • zengchuang-hw retains draft finalization/integration. This software approval does not accept the whole Issue or establish future scheduled AI-stage activation, account import or model/service effects.
Evidence and scope
  • Approved head: 214f8dc29e38951b57d8f8e5c55ed1d2ccd27af6; API base: 2baebf6ebb815ebf07d21c41e3b3754858c0798e; assessed current main: ebdbf5af00c94f228b504a3f4d813aad0b63840c.
  • Independently reviewed the five-file optional-notes scope: workflow, helper, documentation and helper/publisher regression definitions. The new validator's source-bound gate is called after completed-response parsing and before writing the artifact. Prompt guidance alone is not relied on as that gate.
  • Ready run, inspected 3.11 job, and current declarations.
  • The actual tested checkout is synthetic merge 9f44c9e2e85a09ed916f14b3689be356f440b9f6, with main/head parents. Its tree 7e868ff271aaa834be82a812ae80d3f904f5f3d3 differs from standalone head tree 783b9a10644314cc8cf2dc4a573ee391e1a50df5: the complete 206-path integration delta brings in existing main framework/packaging changes and changes none of this PR's five files. I do not label this as an identical-tree standalone-head test.
  • Main advanced during preflight through hardware-only PR #283. The complete 103-path main delta changes library metadata/projections and no file in this PR or its release-helper/publisher interfaces. Main's tree equals the passing #283 head 012bdcc8524a56c65482e14561469111736ac907. I reuse the earlier Ready evidence for the unchanged release-overview scope; a combined post-main run was not executed here.
  • The successful live provider preview was at historical helper b7ee0fa502d73600725d89fcfb862825c2723b14; it is not a current-head live-call result. The new gate is covered by static inspection and hosted software tests; no fresh API request, local suite or workflow run was initiated here.
  • Independent review only; I did not implement this PR. Approval is bound to this head and assessed integration input. Merge authority and requester acceptance remain separate.

@zengchuang-hw
zengchuang-hw marked this pull request as ready for review November 3, 2026 06:09
@zengchuang-hw
zengchuang-hw merged commit 663f3b3 into InferMatrixLab:main Nov 3, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:process Repo-wide process, governance, privacy and security rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants