Repository navigation
feat(changelog): Add configurable AI summaries for CLI and Actions - #902
Conversation
Generate opt-in summaries in the actual changelog serializer with one bounded structured request. Preserve original entries and keep releases independent of model availability. Inspired by #688; uses OpenRouter instead of the retired GitHub Models service.
|
Reuse bounded scope and category digests for complete release overviews. Preserve original entries and critical facts, and keep version analysis AI-free. Read CRAFT_AI_API_KEY and default to release-only summaries.
Remove the alternate provider and process documents. Keep caller release tools unchanged by installing the SDK with a private, integrity-pinned pnpm distribution.
Ship the pinned SDK and native runtime with release artifacts instead of installing packages in callers. Keep the runtime outside the ordinary npm package and retain immutable nightly compatibility.
Keep critical PR titles in model input when custom entries replace them, reject negative claims in critical facts, and neutralize generated protocol links. Share artifact integrity enforcement and exclude runtime assets from unpublished CDN registry links.
Bundle the JavaScript client and stdio factory while retaining the matching native runtime, authentication libraries, and license notices. Verify structured sessions and cancellation against a loopback fixture in the platform matrix.
Ship only native runtime assets separately and launch them through the SDK stdio path option. Preserve license notices and verify the embedded SDK and standalone Craft across platforms.
BYK
left a comment
There was a problem hiding this comment.
We should also enable this feature in Craft itself as part of the PR for demonstration purposes. I'd say we should go with minItems: 2 or less here.
Retain scope labels in parent requests and fold each original entry once. Enable summary dogfooding with minItems: 2 and run the CLI E2E in the ordinary Node suites.
|
Enabled AI summaries in Craft’s own Generation still requires an authorized credential and the documented Copilot permission/policy for built-in workflow-token access; denied access retains the original changelog. No organization policies were changed. |
BYK
left a comment
There was a problem hiding this comment.
I remember talking about adding a "style" config option too or a prompt override/addendum to give some personality to the output when desired. Where's that?
Allow bounded tone guidance at every summary level while preserving the base safeguards. Render validated release statements as up to three paragraphs without category labels.
|
Added |
Adds opt-in AI summaries to automatic changelogs in the CLI and GitHub Actions. Choose release, category, and scope summaries independently; hidden lower-level digests are reused for higher levels. Both surfaces use one HTTP client, defaulting to Copilot Responses with GPT-6 Luna, with custom Responses or Chat Completions endpoints supported.
An
aiSummaryobject enables generation; omission oraiSummary: falsedisables it. Omitted or emptylevelsuse[release]. Summaries appear when original entry counts exceedminItems(default 5), including descendants for categories and the entire changelog for release summaries. A threshold of0includes every nonempty selected group. Release-only output leaves originals expanded. Category prose and scope headings/summaries stay visible, with originals folded once per group. Release overviews are plain prose in up to three paragraphs and include every category, and source-linked breaking/security facts survive reductions.Optional
stylesupplies 1–500 characters of tone guidance at every generation stage while retaining factual, coverage and inert-output safeguards. Craft enables all three levels in its own.craft.ymlwithminItems: 2and a concise, friendly writing style for dogfooding. Generation still requires an authorized credential and, for built-in Actions tokens, the organization policy described below; denied requests retain original output.Connection settings live under
llm; credentials come from the named environment variable (defaultGITHUB_TOKEN). Per-field precedence is explicit CLI flags, structuredCRAFT_AI_LLM, scalar environment overrides, then effective project/workspace configuration. The Action acceptsllmand an explicitllm_api_key; reusable release workflows forward both. Repository/organization variables are mapped in the calling workflow. Credentials are excluded from argument tracing. Craft sends HTTP requests directly, with no additional runtime installation or release artifact.Copilot model access depends on the supplied credential. Explicit built-in workflow-token use requires
copilot-requests: writeand “Allow use of Copilot CLI billed to the organization,” with organization billing. Thellm_api_keyinput selects a separate credential without replacing the release token. Copilot's direct inference backend is outside GitHub's public REST API contract. Custom endpoints receive no Copilot-specific headers, and failures never switch endpoints or providers.Requests have fixed input/output, concurrency, count, and deadline limits. Strict structured-response validation and escaped generated prose keep summaries inert. Missing credentials, errors, timeouts, refusals, or incomplete coverage retain the entire original output. Dry runs, highlighted previews,
--no-changelog, and version analysis make zero model calls; version-bump analysis remains independent.Validation: 301 focused regressions, lint, type checking, formatting and the documentation build pass locally. The E2E runs under
pnpm testin the regular Node 22/24 suites. It builds privately and exercises paths containing spaces, both HTTP formats, configuration precedence and original-output fallback. Regressions cover every level combination, visible scope headings, mixed groups, retained scope labels in reused digests, bounded writing styles and a ten-category prose overview. Final-head CI passes onf512a005383a10841b4bd3fe56e20925cfbe1670, including both Node suites, the native smoke test, container build, security scans and automated reviews. The two publication jobs are skipped for pull requests. Documentation includes release, category, scope and combination examples.Live CLI samples passed Copilot Luna and OpenRouter Luna requests. The OpenRouter sample on
b3769873passed eight HTTP 200 responses with the revised config, preserving every original entry and the version bump while dry-run, missing-token andaiSummary: falsecases made zero calls. Source metadata was a fixture; inference was live. The isolated built-in Actions-token run received HTTP 403 because the required organization policy was disabled. The real CLI and composite Action preserved original entries after the denial; Git pushes stayed local and publishing was stubbed. This is fallback proof, not successful workflow-token inference. Live OpenRouter inference in Actions remains untested. No organization policies were changed, and the live-test workflow is outside this PR.