Repository navigation
[kelos-self-update] Prompt Tuning: reviewers can approve a superseded PR head #1412
Description
🤖 Kelos Self-Update Agent @gjkim42
Latest verdict
- Status:
VALID - Checked at:
2026-10-26T06:03:18Z - Evidence: The default branch is now
68257b1, from #1841. No commit since3040ff1(2026-10-15) touchesself-development/. The gap remains:kelos-reviewerand the PR path ofkelos-api-reviewerstill only reviewgit diff origin/main...HEAD. Neither the regular sticky template nor the API sticky template has a reviewed-commit field. A search ofself-development/andinternal/examples/finds noheadRefOidor "reviewed commit". New case: an API PR merged on a head neither reviewer saw. On #1841 (kind/api), theKelos: kelos-api-reviewerCheck Run (21:43:35Z to 21:48:55Z) and theKelos: kelos-reviewerCheck Run (21:48:23Z to 21:55:01Z) on 2026-10-25 both ran on37aaa96. They posted the APIAPPROVEsticky (last updated 21:48:31Z) and the regularAPPROVEsticky (21:54:38Z). At 22:07:03Z the branch was force-pushed toe7e6184, which has the same parent84b993d. That push changed 6 files (+99/−8). It added symlink resolution to--skilldirectories ininternal/cli/skill.goand new kubelet projected-path byte limits tovalidateSkillFilePathininternal/controller/job_builder.go. No Kelos Check Run exists one7e6184. The PR merged at 22:33:29Z as68257b1with both stickies still showingAPPROVEand naming no commit. The predicted case on Integrate native Session goals and loops across agents #1840 has happened: theAPPROVEsticky, posted ondbf066eat 2026-10-24T11:20:01Z, is still in place after force-pushes to360da14(2026-10-25T22:29:08Z) and47ee6ec(22:58:54Z). No Kelos Check Run exists on either new head, yet the comment still reads as a current approval. The earlier cases #1839, #1836, #1828, and #1829 still apply. So does #1823, still open at2ee8f9dwithAPPROVEstickies from before its 2026-10-16 force-push. No overlap: #1249 is still at5cee024. Its reviewer-file hunks add only checklist items and no head binding. Open PRs #1840, #1843, #1844, and #1831 touch nothing underself-development/,internal/examples/, or.github/workflows/. Issue and PR searches forheadRefOidand "reviewed commit" find no duplicate beyond this slot. Configuration still aligned: thebase-agent.yamlagentsMDis byte-identical (4,667 bytes) togjkim42/kanon-repoinstructions/AGENTS.md, which last changed at27c4781. The kanon-repo HEAD is stillb30d6f4, and the skills source is stillgjkim42/kanon-repo. All 12 root spawners andtasks/fake-strategist-task.yamllistbase-agentfirst. The newest mergedgenerated-by-kelosPRs are image bumps from 2026-10-25: #1833, #1835, #1837, #1838, and #1842. Weaker alternatives unchanged: thekelos/needs-inputleftovers are only noise. They arekelos-squash-commitsstep 7, thekelos-api-reviewerclosing line, and README line 224 and line 366. #969 and #544 still cover the drift intasks/fake-strategist-task.yaml.
Area: Prompt Tuning
Summary
Kelos reviewer prompts can publish or keep an APPROVE sticky comment for a commit that is no longer the PR head. The comments do not name the reviewed commit. The agents do not verify that their checkout matches the live PR head before analysis, and they do not recheck the head right before publishing.
The gap continues after publication. Maintainers, pick-up Sessions, and kelos-squash-commits can all push after a verdict is published. Because the sticky comment names no commit, nobody can tell from the comment alone whether the verdict still covers the current head.
I chose this candidate after reviewing the root self-development spawner prompts, the 20 most recent merged PRs labeled generated-by-kelos, the 20 most recent generated issues, and current open generated issues for overlap. It has the highest impact of the prompt-tuning candidates found.
Current prompt gap
kelos-reviewer.yamlfetchesmainand reviewsorigin/main...HEADon the branch Kelos checked out. It never readsheadRefOid, verifies the checkout against it, or rechecks it before publication.kelos-api-reviewer.yamlhas the same gap on its PR path. Its issue-review path does not need commit binding.- The regular sticky template and the API sticky template contain a verdict and scope but no reviewed SHA.
- The
reporting.checksCheck Run does not bind the verdict. The webhook handler attaches it to the head SHA it resolves when the command arrives, and it reports only task success or failure. The review verdict lives only in the sticky comment.
The reviewers need their own guard. A maintainer, a pick-up Session, or another agent can change the head while a review is running or after it has been published. The Session prompts deliberately leave follow-up steps to the agent and the maintainer (PR #1641). The sticky comment is therefore the only place that can show which commit a verdict covers.
Evidence from agent activity
The head changed between a review request and publication
On PR #1602, a maintainer posted /kelos review at 07:55:00 UTC on 2026-08-08. The PR was force-pushed to final head f448565 at 07:59:52 UTC. The sticky approval, first created on August 6, was updated at 08:02:06 UTC on August 8, before merge. Its body names no reviewed SHA. These timestamps show the branch changed between the request and publication, but they do not show which commit was analyzed. This is evidence of missing traceability, not proof of an outdated review.
A regular verdict went stale after later pushes
On PR #1569, the regular reviewer published its last sticky verdict at 10:29:40 UTC on 2026-08-08. The branch was force-pushed at 10:29:58 and again at 10:40:18, ending at head 0906431. Only the API reviewer ran after that, and its prompt deliberately leaves general correctness to the regular reviewer. The PR merged without a current regular verdict.
A surviving approval described a different diff
On PR #1496, the reviewer published an APPROVE describing a serial Session StatefulSet restart change. The branch was then force-pushed and merged without another regular review. The reviewed commit 8e56ed8 changed only .github/workflows/deploy-dev.yaml. The final head 51b1344 changed only internal/sessionruntime/codex.go and internal/sessionruntime/server_test.go. The approval that remained described a diff sharing no files with what merged.
Proposed minimal prompt changes
- In
kelos-reviewerand on the PR path ofkelos-api-reviewer, read the PR's liveheadRefOidbefore analysis. Fetch and check out that exact commit, and confirm thatgit rev-parse HEADmatches it. - Read
headRefOidagain right before creating or updating the sticky comment. If it changed, do not publish the old verdict. Either review the complete new diff, or publish a clearly non-approving stale-run status that records both SHAs and asks for a fresh run. - Add
**Reviewed commit**: <full SHA>to both PR sticky-review templates. Leave issue-only API review comments unchanged.
Out of scope
- Review-handoff steps in
kelos-workersandkelos-pr-responder. PR #1641 deliberately reduced these Session prompts to the target URL and left workflow steps to the shared agent configuration. Adding a handoff checklist would reverse that decision. - Automatic re-review from
kelos-squash-commits. It already hands the PR back to the maintainer after the force-push by postingSquash complete.. Once each sticky comment records its reviewed SHA, the maintainer can see when a verdict predates the squash and post/kelos reviewagain. - Issue-only API reviews. They have no PR head to bind.
Related but not duplicate
- Closed issue #752 proposed re-triggering polling sources on push. These reviewers are webhook spawners triggered by commands, and a single in-flight review still needs commit binding.
- Closed issue #962 proposed deduplicating and debouncing webhook events. It does not cover binding a verdict to a commit.
- Open issues #1089 and #1203 concern routing reviewer commands to PRs rather than plain issues. They do not address a PR head changing during or after review.
- Targeted issue and PR searches for
headRefOid, reviewed commits, stale reviewer heads, and superseded heads found no duplicate beyond this slot. No open PR implements the proposed binding.
Acceptance criteria
- Both PR reviewers (
kelos-reviewerand the PR path ofkelos-api-reviewer) verify that their checkout matches the live PR head before analysis, and include the full reviewed SHA in their sticky comments. - Both reviewers recheck the live PR head right before publication. If the head changed, no
APPROVEorREQUEST CHANGESverdict is presented as current: the agent either reviews the new head or publishes a non-approving stale-run status. - Focused tests in
internal/examples/self_development_test.gopin the commit-binding instructions and the reviewed-commit field in both PR reviewers. - The
kelos-workersandkelos-pr-responderSession prompts,kelos-squash-commits, and issue-only API review behavior are unchanged.
Activity
[-]Prompt Tuning: kelos-self-update must enforce its exact issue-slot marker[/-][+]Prompt Tuning: single-slot discovery spawners must enforce exact issue markers[/+][-]Prompt Tuning: single-slot discovery spawners must enforce exact issue markers[/-][+]Prompt Tuning: discovery spawners must enforce top-level issue-slot markers[/+][-]Prompt Tuning: discovery spawners must enforce top-level issue-slot markers[/-][+]Configuration Alignment: discovery agents create triage-accepted issues without triage labels[/+][-]Configuration Alignment: discovery agents create triage-accepted issues without triage labels[/-][+]Prompt Tuning: reviewers can approve a superseded PR head[/+][-]Prompt Tuning: reviewers can approve a superseded PR head[/-][+][kelos-self-update] Prompt Tuning: reviewers can approve a superseded PR head[/+]