Repository navigation
feat(git): more accurate commit work types without a prefix - #143
Merged
Merged
Conversation
Commits without a conventional prefix were labeled from the subject alone
(58% agreement with their authors' own type). The model now also sees the
first body line and a content-free count of the kinds of files the commit
changed ("Changed files: 3 code, 1 tests (+120 / -30 lines)."); paths and
names never leave the Git scan. Held-out agreement rose from 57.5% to 72.0%
(67% vs 39% for commits with no body). Question version c2 relabels once.
A conventional prefix (feat:, fix(ui):, docs:, chore:, ...) is now taken as
the label directly, with no model call or queue slot.
Also from #139: MCP git_stats returns the estimated work-type split
(summary and per day, enum keys, counts only), and a failed rev-list in
the backfill walk has a test.
Co-Authored-By: Claude Code <noreply@anthropic.com>
- Only lowercase Conventional Commits types are taken as the label; capitalised and package-style prefixes (Fix:, testing:, config:) go to the model. - Common Git and Gerrit trailers (Reviewed-by, Change-Id, Cc, ...) are not taken as the detail line. - File kinds use each file's new name, with quoted non-ASCII paths unquoted and renames resolved. - A commit too large to list its files is labeled from its message alone. - MCP method now says conventional_prefix_or_local_model; the chart note no longer claims every label came from the model. - Docs: calibration method, scope (prefix-free commits only), sample limits, line totals in the files line, and the one-time relabel. - Tests for the prefix path's off, pause, clear-fence, and storage-error handling; revert a stray test edit. Co-Authored-By: Claude Code <noreply@anthropic.com>
… renames When only a commit's message could be read, the model was told no files changed; it now hears the files were not listed. Quoted renames are split before unquoting so each side's kind is read correctly. Trailers come from an explicit allowlist, so detail lines such as "Follow-up:" or "Fixes:" are kept. Comments and docs state the lowercase-only prefix choice and the calibration reference precisely. Co-Authored-By: Claude Code <noreply@anthropic.com>
… note
- Renames resolve braces first, then split each quoted side, so a name
containing "{" still classifies by its new path; the test now uses old
and new names of different kinds so it fails without the split.
- Any "...-by:" key and Fixes/Closes/Resolves/Refs followed by an id are
trailers; "Fixes: the crash" stays a detail line.
- The message-only fallback says "Changed files: not listed." without
guessing a cause.
Co-Authored-By: Claude Code <noreply@anthropic.com>
tests/test_git_delivery.py had grown past its size budget, so the commit work-type tests move to tests/test_git_commit_types.py unchanged (same 122 tests across the two modules). The rename fixture now has an old name that looks like tests where the new name is code, for both the plain and the brace form, so dropping either rename step fails the test. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Member
Author
|
Owner sign-off on the privacy rule change: Pratik approved widening the Work insights rule so the local model may also read each pushed commit's first body line and content-free counts of the kinds of files and lines it changed. As before, these are sent only to the loopback model and never stored; paths and file names never leave the Git scan. — Posted by Pratik's agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #139. It makes commit work-type labels more accurate for commits without a conventional prefix, and closes the gaps that PR listed.
More evidence for the model. For each commit, the local model now also sees:
Changed files: 3 code, 1 tests (+120 / -30 lines).File paths and names never leave the Git scan. The question version moves from
c1toc2, so existing labels are redone once.Conventional prefixes are taken as written. A lowercase Conventional Commits type is the label, with no model call and no queue slot. The types are
feat,fix,docs,style,refactor,perf,test,build,ciandchore. The model still handles capitalised prefixes (Fix:), package-style prefixes (testing:orconfig:in Go or Linux history), andrevert:.MCP
git_stats. It now returns the estimated split by work type, in the summary and in each day row. Keys are a fixed set and values are counts only.Edge cases handled:
…-by:,Change-Id,Cc, andFixes:orRefs:followed by an id.Tests. A failed
rev-listin the backfill walk now has a test. The commit-type tests move totests/test_git_commit_types.pyto keeptests/test_git_delivery.pywithin its size budget.Accuracy
The reference is each commit's own conventional-commit type, with the prefix stripped from the subject. It's a proxy for free-form messages, and the only labeled reference available.
The data is 664 of my own non-merge commits from the last 180 days, across 3 repos, labeled by
token-meter-gemma. Commits are split by hash. Variants were chosen on 120 dev commits and scored once on 200 held-out commits, using both option orders.c1, shipped in #139)c2)On the dev split:
The no-body row is small (about ±16 points), so it shows direction only. The scratch data and the harness read private Git history, so both were deleted; only these numbers were kept.
specs/WORK_INSIGHTS.mddocuments the method and its caveats.Privacy: needs owner sign-off
This widens what Work insights may read. The rule in
specs/AGENTS.md(and rootAGENTS.md) now also allows:Both sit alongside the commit subject. They stay in the in-memory queue and are sent only to the loopback model. Only labels persist. SECURITY, ARCHITECTURE, USER_GUIDE, README and the Git tooltip are updated to match. Tests check that no path, file name or body text reaches the classifier arguments or any stored file.
Validation
622683d:python3 scripts/run-testsexits 0, with 2587 tests passed and 21 skipped.scripts/check-page, py_compile,git diff --check, and the design-system, agent-workflow and size-budget contracts all pass../scripts/installreports installed commit622683d. Both LaunchAgents are running,/healthand/menubarreturn OK, and source and runtime match for every changed runtime file. Live/git-deliveryshowsc2relabeling under way: 108 of 343 commits after the first scan.Known limits (reviewed and accepted)
Fixes: defaced bannerorFixes: 3 flaky tests. The model then gets the next body line.dir/{a{1} => b}/x.py). This affects only the content-free count.🤖 Generated with Claude Code