Repository navigation
[3736 by Claude Opus 5.5] Commit subjects: a short imperative line generated separately from the run summary - #3749
Conversation
…ed, such as `fix: keep the create dialog open`. The run summary goes in the commit body. My new tests and the related suites I ran all pass, and lint and typecheck are clean. I didn't run the full test suite, and nothing has run against a real small model yet.
What a commit looks like now
- Subject: at most 72 characters, cut at a word boundary with "…". A separate small-model call writes it, using the same model setting as PR task titles.
- Rejected replies: a reply in the first person ("I fixed…") or one that reports test results is thrown away.
- Fallback: if the call fails, times out, gets rejected, or no small model is configured, the subject is the PR or issue title with the `[N by Model]` prefix and `(#N)` suffix removed. It never uses the summary text.
- Type: if every changed file is docs, tests, CI or dependency files, the type is `docs`, `test`, `ci` or `build`. Otherwise the earliest keyword in the title decides (`fix`, `feat`, `refactor`, …), and anything unclear is `chore`. It's word matching, so it can misjudge: the title "Fold an aggregate CI job…" comes out as `ci` because "CI" appears before any other keyword.
- AI marker: the `(ai)` scope is gone. Agent commits end with a `ProPR-Agent: <agent alias>/<model>` trailer instead.
Where it applies
- Issue runs and PR follow-ups: they share one builder. The changed paths come from `git status` in the worktree just before the commit.
- Epic-branch squash (`checkRunHandler.ts`): the subject is built from the sub-PR title plus ` (#N)`, and the first commit's message becomes the body. This now applies only when the merge method is squash. Before, an epic merge with the merge method also used the first commit's subject; it now gets GitHub's standard "Merge pull request #N" title.
- Merge-conflict commits: they keep their `merge:` subjects, now capped at 72 characters. I didn't add the trailer to them.
- Follow-up recovery commit: it becomes `chore: recover interrupted follow-up for PR #N`, with the trailer when the model is known.
- Commits not covered: goal checkpoint commits still use the message the agent declares. That path wasn't in the issue, so I left it alone.
Old and new history
- `parseCommitSubject` and `isProprAgentCommit` in `@propr/shared` read both old `feat(ai): …` subjects and new ones.
- The completion comment's fallback strips the trailer before showing the commit body.
- No release-notes script parses commit subjects, so nothing else needed changing.
Tests
- New tests: `packages/shared/test/commitSubject.test.ts` (10) and `test/commitSubjectGeneration.test.ts` (9) cover each case the issue lists: first-person summary in, imperative subject out; truncation; fallback to the title; type by path; trailer present.
- Existing suites: I updated one assertion in `test/runSummarySelection.test.ts`. I ran 69 suites in the issue-job, follow-up, handoff, epic and auto-merge areas, plus `checkRunHandler`, `commitOperations` and `mergeConflictHelpers`, and all pass.
- One fix from the run: `test/prPublicationRecoveryJob.test.ts` first failed all 39 tests because its job data has a non-string task title. I made the title parsing tolerate that, and it now passes.
Cost and where the code is
- One more small-model call per run that publishes a summary. It is opt-in through a new `commitSubject` field on `applyRunSummarySelection`, so other callers don't make it.
- The pure builder is `packages/shared/src/commitSubject.ts` and the model call is `packages/core/src/agents/commitSubjectGeneration.ts`.
- The root helper `src/jobs/agentCommitMessage.ts` only imports `@propr/shared`, so existing test mocks of `@propr/core` didn't need new entries.
I added the CHANGELOG entry under Unreleased. There's nothing visual to preview.
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: CodeQL Please investigate and fix this CI failure.
Failure evidence
|
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR separates commit subjects from run summaries and updates issue, follow-up, recovery, and epic-squash paths. It needs minor corrections before merge. ✅ Separate subject generation — A dedicated model call proposes the description; generation failures fall back without failing publication. ✅ Bounded subjects — Shared formatting caps ordinary subjects and reserves space for epic-squash PR-number suffixes. The issue specification contains an explicit truncation notice; this review assesses the visible requirements and supplied code. Current checks report no failures, with six pending. No commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Validate title-derived subjects too
F2: 🔴 Classify only publishable changed paths
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise successful summary selectionThe new “own call” test returns a subject string for both model calls, so summary selection encounters invalid JSON and falls back. Returning valid selection JSON first and a subject second would additionally verify successful selection feeds the separate generator. This is optional because the existing test still verifies that two calls occur and the summary survives. ScoreThe implementation is cohesive and has useful focused coverage, but two deterministic boundary cases undermine the new subject contract. The supplied checks have no current failures; six remain pending. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit f865267 Processed 2 comments:
Summary of ChangesI fixed the slow regex that CodeQL flagged in The cause: the line that strips a trailing The fix:
Normal titles come out the same as before. Testing: I added a test to There's nothing visual to preview. Review digestRisk-tiered paths
Diff size: 2 files changed, +20/−2 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…itle` (`packages/shared/src/commitSubject.ts:149`). CodeQL itself hasn't re-run yet, so whether the alert clears will show on the next CI run. I fixed the slow regex that CodeQL flagged in `cleanCommitTitle` (`packages/shared/src/commitSubject.ts:149`). CodeQL itself hasn't re-run yet, so whether the alert clears will show on the next CI run. **The cause:** the line that strips a trailing `(#N)` from a title used `/\s*\(#\d+\)\s*$/`. Because the pattern starts with `\s*` and isn't anchored at the front, the regex engine retries from every position inside a long run of whitespace. Its run time grows with the square of the length. I measured it: with 50,000 tabs, the old regex took 5.8 seconds. **The fix:** `cleanCommitTitle` now trims the title first and then strips the two parts with plain scans instead of the risky patterns: - **The `[N by Model]` prefix:** if the title starts with `[`, it finds the first `]` and drops that bracket only if the text inside contains the word "by". This matches what the old prefix regex did. - **The `(#N)` suffix:** it uses `/\(#\d+\)$/`, which has no leading `\s*`, then trims what's left. Normal titles come out the same as before. **Testing:** I added a test to `packages/shared/test/commitSubject.test.ts`. It checks normal title cleaning and two inputs with 200,000 tabs each, which now finish in milliseconds. The shared commit-subject tests (11) and the related root suites `commitSubjectGeneration` and `runSummarySelection` (44 tests) all pass, and the shared package typechecks. ESLint has no rules set up for `packages/shared`, so lint doesn't cover these two files. There's nothing visual to preview. PR: #3749 Comment by: @github-advanced-security[bot] (ID: 4645214108) Comment by: @propr-dev[bot] (ID: 7045344994) Model: Claude Opus 5.5
|
✅ Applied the requested follow-up changes in commit b49f441
Summary of ChangesI fixed both findings, and the tests I ran pass. F1: titles now go through the same check as generated subjects.
F2: the commit type and staging now skip the same paths.
What I ran: the shared and root commit-subject suites, the core and root One behaviour change: the old path filter also skipped No preview was captured because nothing here changes what users see. Review digestRisk-tiered paths
Diff size: 8 files changed, +63/−26 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed both findings, and the tests I ran pass. **F1: titles now go through the same check as generated subjects.** - `buildCommitSubject` (`packages/shared/src/commitSubject.ts`) now tries the generated description, then the title, and uses the first one that passes `isAcceptableCommitDescription`. If neither passes, it uses the fixed fallback. So an issue titled `I cannot log in` with no usable generated subject now gets `chore: resolve issue #12` instead of `chore: I cannot log in`. - `epicSquashCommitFields` follows the same order: sub-PR title, then the first commit's new-style subject, then `merge pull request #N`. Before, any non-empty title was used without checking. - The title can still set the conventional type when its wording is rejected. For example, `All tests pass` gives `test: merge pull request #6 (#6)`. This matches the minimum fix the finding asked for. - New tests in `packages/shared/test/commitSubject.test.ts` cover first-person titles, test-report titles and a prefixed title like `[12 by Codex] We broke the export (#13)`, for both builders. **F2: the commit type and staging now skip the same paths.** - The list of ProPR runtime paths that commits never stage now lives in one place, the new `packages/shared/src/proprRuntimePaths.ts`. It covers `.propr/assets`, `.propr/cache`, `.propr/.cache`, `.propr/node_modules`, `.propr/previews` and `.propr/preview-src`. - `stageCommitFiles` in core and `pendingChangePaths` (`src/jobs/agentCommitMessage.ts`) both use that list now. Core still exports `isGeneratedRuntimePath` under the same name, and `visualPreviewPaths.ts` takes its two preview directory names from the shared file. - The runtime-file test in `test/commitSubjectGeneration.test.ts` now creates a file in each of those paths next to `docs/a.md`. It checks that only `docs/a.md` comes back and that the title `Add retry documentation` gets `docs`, not `feat`. **What I ran:** the shared and root commit-subject suites, the core and root `commitOperations` suites, the blocked-run and follow-up-handoff suites, and the visual-preview service and config suites. All pass. Shared, core and root typecheck cleanly, and lint passes on the changed source files. **One behaviour change:** the old path filter also skipped `.propr/tmp/`. Staging does not skip it and it isn't gitignored, so it does get committed. To match staging, `pendingChangePaths` now counts it toward the type. No preview was captured because nothing here changes what users see. PR: #3749 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR separates commit subjects from run summaries and adds shared formatting, type inference, and attribution helpers. It needs one localized correction before merge. ✅ Separate subject generation — A dedicated model call generates the description, with failure handling that falls back to the issue or PR title. ✅ Consistent runtime exclusions — Staging and changed-path classification now share the same generated-runtime path definitions. ✅ Focused coverage — Tests cover subject length, rejected narration, generation failures, trailers, and epic squash formatting. The supplied issue specification is truncated, so this review assesses the visible requirements and supplied code. Current checks show no failures, with six checks pending. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F3: 🔴 Dependency manifests receive the docs type
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Exercise successful summary selectionThe new integration test in ScoreThe implementation largely fulfills the visible objective, but a deterministic classification error needs correction. Coverage is substantial; the supplied current-head checks have no failures and six remain pending. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 59dabe4
Summary of ChangesI fixed F3: a commit that changes only The fix ( The same mistake in other places:
New tests (
Test results:
Nothing visible changed, so there are no previews. Review digestRisk-tiered paths
Diff size: 2 files changed, +19/−3 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ow gets the `build` type instead of `docs`. I fixed F3: a commit that changes only `requirements.txt` now gets the `build` type instead of `docs`. **The fix** (`packages/shared/src/commitSubject.ts`): the docs check accepts every `.txt` file, so it was claiming dependency manifests before the dependency check ran. A new helper, `isDocsChangeFile`, counts a file as documentation only if it is not a dependency file. `pathClass` now checks "all dependency files → `build`" before the docs check. **The same mistake in other places:** - **Docs plus tests:** the rule that types a mix of test and doc files as `test` used the same docs check, so `test/test_api.py` + `requirements-dev.txt` came out as `test`. It now uses the new helper, and that mix falls through to the title wording. - **Manifests under `docs/`:** any path under `docs/` counts as documentation, so `docs/package.json` and `docs/requirements.txt` were typed `docs`. They now get `build`. - Mixes like `README.md` + `requirements.txt` used to be typed `docs`; now the type comes from the title. **New tests** (`packages/shared/test/commitSubject.test.ts`): - `requirements.txt` alone, and with `requirements-dev.txt`, gives `build`. - `docs/requirements.txt` and `docs/package.json` + `docs/package-lock.json` give `build`. - A dependency-upgrade title on `requirements.txt` gives `build`. - `README.md` + `requirements-dev.txt` and a test file + `requirements-dev.txt` take the type from the title (`feat`). - A plain `notes.txt` is still `docs`. **Test results:** - The shared `commitSubject` suite passes (14 of 14). Run against the old classifier, both new tests fail, so they do catch the bug. - The shared package typecheck is clean. - The related root suites (`commitSubjectGeneration`, `runSummarySelection`) pass (44 of 44). - ESLint skips `packages/shared`, so there was no lint gate to run on these files. Nothing visible changed, so there are no previews. PR: #3749 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR separates commit-subject generation from run summaries, centralizes formatting and type inference, and updates epic squash subjects. The implementation appears merge-ready within the visible scope, conditional on pending checks completing successfully. ✅ Separate subject generation — Issue runs and PR follow-ups request a dedicated subject, with title-based fallback when generation fails. ✅ Consistent formatting — Shared helpers cap subjects, infer conventional types, and append agent trailers while retaining summary bodies. ✅ Runtime-path consistency — Staging and changed-path classification share the same exclusions for generated ProPR files. This was a static review of the supplied code; no commands were run. The issue specification is explicitly truncated, so requirements beyond its visible text could not be assessed. Current checks show no failures and five pending checks. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Test successful summary selection integrationIn ScoreThe visible implementation addresses the objective coherently and includes substantial focused coverage, with no verified merge blockers. Pending checks and the truncated issue specification limit confidence in final acceptance. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3736
Branch:
3736/claude-opus-5-5-commit-subjects-a-short-i-20261120-1619-d6dCommits: ✅ Changes committed (177313e)
AI Processing Completed
Execution Details:
Summary:
ProPR commits now get a short imperative subject that says what changed, such as
fix: keep the create dialog open. The run summary goes in the commit body. My new tests and the related suites I ran all pass, and lint and typecheck are clean. I didn't run the full test suite, and nothing has run against a real small model yet.What a commit looks like now
[N by Model]prefix and(#N)suffix removed. It never uses the summary text.docs,test,ciorbuild. Otherwise the earliest keyword in the title decides (fix,feat,refactor, …), and anything unclear ischore. It's word matching, so it can misjudge: the title "Fold an aggregate CI job…" comes out ascibecause "CI" appears before any other keyword.(ai)scope is gone. Agent commits end with aProPR-Agent: <agent alias>/<model>trailer instead.Where it applies
git statusin the worktree just before the commit.checkRunHandler.ts): the subject is built from the sub-PR title plus(#N), and the first commit's message becomes the body. This now applies only when the merge method is squash. Before, an epic merge with the merge method also used the first commit's subject; it now gets GitHub's standard "Merge pull request #N" title.merge:subjects, now capped at 72 characters. I didn't add the trailer to them.chore: recover interrupted follow-up for PR #N, with the trailer when the model is known.Old and new history
parseCommitSubjectandisProprAgentCommitin@propr/sharedread both oldfeat(ai): …subjects and new ones.Tests
packages/shared/test/commitSubject.test.ts(10) andtest/commitSubjectGeneration.test.ts(9) cover each case the issue lists: first-person summary in, imperative subject out; truncation; fallback to the title; type by path; trailer present.test/runSummarySelection.test.ts. I ran 69 suites in the issue-job, follow-up, handoff, epic and auto-merge areas, pluscheckRunHandler,commitOperationsandmergeConflictHelpers, and all pass.test/prPublicationRecoveryJob.test.tsfirst failed all 39 tests because its job data has a non-string task title. I made the title parsing tolerate that, and it now passes.Cost and where the code is
commitSubjectfield onapplyRunSummarySelection, so other callers don't make it.packages/shared/src/commitSubject.tsand the model call ispackages/core/src/agents/commitSubjectGeneration.ts.src/jobs/agentCommitMessage.tsonly imports@propr/shared, so existing test mocks of@propr/coredidn't need new entries.I added the CHANGELOG entry under Unreleased. There's nothing visual to preview.
Review digest
Risk-tiered paths
packages/core/src/agents/commitSubjectGeneration.ts(added, +87/−0)packages/core/src/agents/runSummarySelection.ts(+18/−0)packages/core/src/agents/types.ts(+2/−0)packages/core/src/claude/claudeService.ts(+4/−0)packages/core/src/git/commitOperations.ts(+4/−2)packages/core/src/index.ts(+1/−0)packages/core/src/webhook/checkRunHandler.ts(+9/−6)packages/shared/src/commitSubject.ts(added, +236/−0)packages/shared/src/index.ts(+2/−0)src/jobs/agentCommitMessage.ts(added, +70/−0)src/jobs/followupHandoffMessages.ts(+5/−2)src/jobs/issueJob/agent.ts(+7/−1)src/jobs/issueJobPostProcessing.ts(+12/−6)src/jobs/mergeConflictHelpers.ts(+3/−3)src/jobs/prCommentAgentUtils.ts(+2/−2)src/jobs/prCommentJobUtils.ts(+16/−14)src/jobs/prCommentPostExecution.ts(+5/−1)src/jobs/prCompletionComment.ts(+2/−2)src/jobs/prFileUtils.ts(+1/−0)CHANGELOG.md(+25/−0)packages/shared/test/commitSubject.test.ts(added, +116/−0)test/commitSubjectGeneration.test.ts(added, +135/−0)test/runSummarySelection.test.ts(+3/−2)Diff size: 23 files changed, +765/−41 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3736.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!