Add pre-push verification, diff checks, and commit squashing conventions#619
Add pre-push verification, diff checks, and commit squashing conventions#619kelos-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Agents frequently push changes with CI failures, include unrelated files in their diffs, and create multi-commit branches that reviewers must squash. Add explicit conventions for running make verify before pushing, verifying diff scope, and squashing commits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="self-development/kelos-workers.yaml">
<violation number="1" location="self-development/kelos-workers.yaml:105">
P2: The self-review loop in step 7a adds commits (`make them, commit and push`) without re-squashing or re-running verification. After a couple of review iterations, the branch will have multiple commits again — the same problem this PR aims to fix. Consider changing the loop to squash before each push, e.g., "make them, squash into a single commit, run `make verify`, and push."</violation>
</file>
<file name="self-development/kelos-pr-responder.yaml">
<violation number="1" location="self-development/kelos-pr-responder.yaml:87">
P2: After squashing, a regular `git push` will be rejected because the rewritten history diverges from the remote. Specify `--force-with-lease` to make this step actionable (it's also safer than `--force` since it aborts if someone else pushed in the meantime).</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| - Run `make verify` to catch lint, fmt, and vet issues locally. | ||
| - Run `git diff origin/main --stat` to confirm only files relevant to the task are modified. Revert any unrelated changes. | ||
| - 6a. Squash your commits into a single clean commit, then push to origin kelos-task-{{.Number}}. | ||
| - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. |
There was a problem hiding this comment.
P2: The self-review loop in step 7a adds commits (make them, commit and push) without re-squashing or re-running verification. After a couple of review iterations, the branch will have multiple commits again — the same problem this PR aims to fix. Consider changing the loop to squash before each push, e.g., "make them, squash into a single commit, run make verify, and push."
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-workers.yaml, line 105:
<comment>The self-review loop in step 7a adds commits (`make them, commit and push`) without re-squashing or re-running verification. After a couple of review iterations, the branch will have multiple commits again — the same problem this PR aims to fix. Consider changing the loop to squash before each push, e.g., "make them, squash into a single commit, run `make verify`, and push."</comment>
<file context>
@@ -98,10 +98,13 @@ spec:
+ - Run `make verify` to catch lint, fmt, and vet issues locally.
+ - Run `git diff origin/main --stat` to confirm only files relevant to the task are modified. Revert any unrelated changes.
+ - 6a. Squash your commits into a single clean commit, then push to origin kelos-task-{{.Number}}.
+ - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes.
+ - 8a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing).
+ - 9a. Make sure the PR passes all CI tests.
</file context>
| - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. | |
| - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, run `make verify`, squash into a single commit, and push, then /review again. Repeat until the review passes. |
| - 5. Before pushing, verify your changes are clean: | ||
| - Run `make verify` to catch lint, fmt, and vet issues locally. | ||
| - Run `git diff origin/main --stat` (or `git diff upstream/main --stat` if upstream is set) to confirm only files relevant to the task are modified. Revert any unrelated changes. | ||
| - 6. Squash your commits into a single clean commit, then push to origin {{.Branch}}. |
There was a problem hiding this comment.
P2: After squashing, a regular git push will be rejected because the rewritten history diverges from the remote. Specify --force-with-lease to make this step actionable (it's also safer than --force since it aborts if someone else pushed in the meantime).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-pr-responder.yaml, line 87:
<comment>After squashing, a regular `git push` will be rejected because the rewritten history diverges from the remote. Specify `--force-with-lease` to make this step actionable (it's also safer than `--force` since it aborts if someone else pushed in the meantime).</comment>
<file context>
@@ -81,10 +81,13 @@ spec:
+ - 5. Before pushing, verify your changes are clean:
+ - Run `make verify` to catch lint, fmt, and vet issues locally.
+ - Run `git diff origin/main --stat` (or `git diff upstream/main --stat` if upstream is set) to confirm only files relevant to the task are modified. Revert any unrelated changes.
+ - 6. Squash your commits into a single clean commit, then push to origin {{.Branch}}.
+ - 7. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes.
+ - 8. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #123` or `Closes #123`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). If `KELOS_UPSTREAM_REPO` is set, include `--repo "$KELOS_UPSTREAM_REPO"`.
</file context>
| - 6. Squash your commits into a single clean commit, then push to origin {{.Branch}}. | |
| - 6. Squash your commits into a single clean commit, then force-push (`git push --force-with-lease`) to origin {{.Branch}}. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Adds three new agent conventions based on recurring reviewer feedback across recent PRs:
Run
make verifybefore pushing — Agents frequently push changes that fail CI checks. Reviewer on PR Fix missing source column for GitHubPullRequests and Jira taskspawners #609 explicitly asked the agent to "check the CI and fix it."Verify diff only contains relevant changes — Agents often include unrelated files in their diffs. In PR Fix stale and disappeared task pod handling for kelos logs #587, reviewer asked to "rebase on origin/main to remove unnecessary patches" (the PR had 22 files changed when only 4 were relevant). In PR Switch kelos-workers from claude-code to codex with gpt-5.4 #573, reviewer limited scope: "let's update only kelos-workers for now."
Squash commits before final push — Reviewer repeatedly used
/squash-commitsacross many PRs: Co-locate AgentConfigs with TaskSpawners and use distinct agent names #555, Add comment-based labeling to label workflow #560, Switch kelos-workers from claude-code to codex with gpt-5.4 #573, Handle label commands across issue, PR, and review surfaces #586, Inject git identity env vars in all commit-producing tasks #591, self-development: Use GPT-5.4 for triage #605. This is the most common reviewer action across the last week.Changes are applied consistently to:
AGENTS.md/CLAUDE.md— project-level conventions for all agentsself-development/agentconfig.yaml— shared AgentConfig for self-development agentsself-development/kelos-workers.yaml— explicit verification steps in the worker promptself-development/kelos-pr-responder.yaml— explicit verification steps in the PR responder promptWhich issue(s) this PR is related to:
N/A
Special notes for your reviewer:
PR #582 (also from kelos-config-update) is still open and covers different conventions (stay within scope, typed constants, keep docs in sync). This PR does not overlap with #582.
Does this PR introduce a user-facing change?
Summary by cubic
Adds pre-push verification, diff scope checks, and commit squashing conventions to reduce CI failures, unrelated changes, and noisy histories. Updates
AGENTS.md,self-development/agentconfig.yaml,self-development/kelos-workers.yaml, andself-development/kelos-pr-responder.yamlwith explicit steps.make verifybefore pushing.git diff origin/main --stat(orupstream/main) and revert unrelated files.Written for commit c10d13f. Summary will update on new commits.